diff options
Diffstat (limited to 'src/render')
-rw-r--r-- | src/render/draw.cc | 6 | ||||
-rw-r--r-- | src/render/render.cc | 25 | ||||
-rw-r--r-- | src/render/render.h | 5 |
3 files changed, 29 insertions, 7 deletions
diff --git a/src/render/draw.cc b/src/render/draw.cc index 6de398a..573587e 100644 --- a/src/render/draw.cc +++ b/src/render/draw.cc @@ -1107,10 +1107,4 @@ void draw(float seconds) // GL_BLEND must be enabled for the GUI } -// reset drawing parameters for a new localcontrol -void reset() -{ - Dust::reset(); -} - } 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; diff --git a/src/render/render.h b/src/render/render.h index 5d8d12f..3faa097 100644 --- a/src/render/render.h +++ b/src/render/render.h @@ -29,7 +29,10 @@ namespace render { /// shutdown the render subsystem void shutdown(); - /// unload render data + /// reset all render data + void reset(); + + /// unload game render data void unload(); extern core::Cvar *r_arraysize; |