| 760 | } |
| 761 | |
| 762 | Result AddDynamicTexture(HScene scene, dmhash_t texture_name_hash, HTextureSource texture_source, NodeTextureType texture_type, uint32_t original_width, uint32_t original_height) |
| 763 | { |
| 764 | TextureInfo* t = scene->m_DynamicTextures.Get(texture_name_hash); |
| 765 | if (t) |
| 766 | { |
| 767 | if (t->m_ImageType != UINT32_MAX) |
| 768 | { |
| 769 | uint32_t buffer_size_mb = t->m_OriginalWidth * t->m_OriginalHeight * dmImage::BytesPerPixel((dmImage::Type) t->m_ImageType); |
| 770 | DM_PROPERTY_ADD_F32(rmtp_GuiDynamicTexturesSizeMb, -buffer_size_mb); |
| 771 | } |
| 772 | |
| 773 | scene->m_DeleteTextureResourceCallback(scene, texture_name_hash, t->m_TextureSource); |
| 774 | } |
| 775 | return AddTexture(scene, scene->m_DynamicTextures, texture_name_hash, texture_source, texture_type, original_width, original_height, UINT32_MAX); |
| 776 | } |
| 777 | |
| 778 | static void UnassignTexture(HScene scene, dmhash_t texture_name_hash) |
| 779 | { |
no test coverage detected