| 941 | } |
| 942 | |
| 943 | Result DeleteDynamicTexture(HScene scene, const dmhash_t texture_hash) |
| 944 | { |
| 945 | TextureInfo* t = scene->m_DynamicTextures.Get(texture_hash); |
| 946 | if (!t) |
| 947 | { |
| 948 | return RESULT_RESOURCE_NOT_FOUND; |
| 949 | } |
| 950 | |
| 951 | if (t->m_ImageType != UINT32_MAX) |
| 952 | { |
| 953 | uint32_t buffer_size_mb = t->m_OriginalWidth * t->m_OriginalHeight * dmImage::BytesPerPixel((dmImage::Type) t->m_ImageType); |
| 954 | DM_PROPERTY_ADD_F32(rmtp_GuiDynamicTexturesSizeMb, - buffer_size_mb); |
| 955 | } |
| 956 | |
| 957 | scene->m_DeleteTextureResourceCallback(scene, texture_hash, t->m_TextureSource); |
| 958 | scene->m_DynamicTextures.Erase(texture_hash); |
| 959 | t = scene->m_Textures.Get(texture_hash); |
| 960 | if (t) |
| 961 | { |
| 962 | UpdateTexture(scene, texture_hash, t->m_TextureSource, t->m_TextureSourceType); |
| 963 | } |
| 964 | else |
| 965 | { |
| 966 | UnassignTexture(scene, texture_hash); |
| 967 | } |
| 968 | |
| 969 | return RESULT_OK; |
| 970 | } |
| 971 | |
| 972 | Result SetDynamicTextureData(HScene scene, const dmhash_t texture_hash, uint32_t width, uint32_t height, dmImage::Type type, dmImage::CompressionType compression_type, bool flip, const void* buffer, uint32_t buffer_size) |
| 973 | { |