diff options
Diffstat (limited to 'src/render/render.cc')
-rw-r--r-- | src/render/render.cc | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/render/render.cc b/src/render/render.cc index f018510..3ba7e92 100644 --- a/src/render/render.cc +++ b/src/render/render.cc @@ -115,6 +115,30 @@ void clear() void unload() { + // clear zone sky textures + for (core::Zone::Registry::iterator it = core::Zone::registry().begin(); it != core::Zone::registry().end(); it++) { + core::Zone *zone = (*it).second; + if (zone->sky_texture()) { + render::Textures::unload(zone->sky_texture()); + zone->set_sky_texture(0); + } + } + + for (core::Entity::Registry::iterator it = core::Entity::registry().begin(); it != core::Entity::registry().end(); it++) { + core:: Entity *entity = (*it).second; + + 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; + } + } + } +} + +void reset() +{ clear(); Textures::shutdown(); @@ -128,6 +152,7 @@ void unload() vertexarray = new VertexArray(mb); } + void shutdown() { con_print << "^BShutting down renderer..." << std::endl; |