| 98 | } |
| 99 | |
| 100 | void Material::set_texture(StringId32 sampler_name, ResourceId texture_resource) |
| 101 | { |
| 102 | const TextureResource *tr = (TextureResource *)_resource_manager->get(RESOURCE_TYPE_TEXTURE, texture_resource); |
| 103 | TextureData *td = material_resource::texture_data_array(_resource); |
| 104 | u32 idx = material_resource::texture_data_index(_resource, td, sampler_name); |
| 105 | TextureHandle *th = (TextureHandle *)material_resource::texture_handle(td, idx, _data); |
| 106 | th->texture_handle = tr->handle.idx; |
| 107 | #if CROWN_CAN_RELOAD |
| 108 | u32 index = material_resource::texture_data_index(_resource, td, sampler_name); |
| 109 | _texture_resources[index] = (TextureResource *)tr; |
| 110 | #endif |
| 111 | } |
| 112 | |
| 113 | void Material::reload_textures(const TextureResource *old_resource, const TextureResource *new_resource) |
| 114 | { |