diff options
Diffstat (limited to 'src/render/render.cc')
-rw-r--r-- | src/render/render.cc | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/render/render.cc b/src/render/render.cc index 7776ef2..33dcb0c 100644 --- a/src/render/render.cc +++ b/src/render/render.cc @@ -172,9 +172,14 @@ void unload() if (entity->type() == core::Entity::Globe) { core::EntityGlobe *globe = static_cast<core::EntityGlobe *>(entity); - if (globe->render_texture) { - render::Textures::unload(globe->render_texture); - globe->render_texture = 0; + + if (globe->texture_id()) { + render::Textures::unload("textures/" + globe->texturename()); + globe->set_texture_id(0); + } + if (globe->corona_id()) { + render::Textures::unload("textures/corona/" + globe->coronaname()); + globe->set_corona_id(0); } } @@ -199,7 +204,14 @@ void clear() if (entity->type() == core::Entity::Globe) { core::EntityGlobe *globe = static_cast<core::EntityGlobe *>(entity); - globe->render_texture = 0; + if (globe->texture_id()) { + render::Textures::unload("textures/" + globe->texturename()); + globe->set_texture_id(0); + } + if (globe->corona_id()) { + render::Textures::unload("textures/corona/" + globe->coronaname()); + globe->set_corona_id(0); + } } if (ext_render(entity)) { |