From 0d831968949b1119db48530a86c2d1651c6cbfc6 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 11 Oct 2008 09:37:23 +0000 Subject: zonechange events, menu previous command --- src/render/draw.cc | 6 ------ src/render/render.cc | 25 +++++++++++++++++++++++++ src/render/render.h | 5 ++++- 3 files changed, 29 insertions(+), 7 deletions(-) (limited to 'src/render') 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 @@ -114,6 +114,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(entity); + if (globe->render_texture) { + render::Textures::unload(globe->render_texture); + globe->render_texture = 0; + } + } + } +} + +void reset() { clear(); @@ -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; -- cgit v1.2.3