diff options
Diffstat (limited to 'src/render/render.cc')
-rw-r--r-- | src/render/render.cc | 33 |
1 files changed, 9 insertions, 24 deletions
diff --git a/src/render/render.cc b/src/render/render.cc index 6755e08..589dce3 100644 --- a/src/render/render.cc +++ b/src/render/render.cc @@ -9,9 +9,11 @@ #include <sstream> #include <iomanip> -#include "render/render.h" -#include "render/tga.h" #include "render/gl.h" +#include "render/textures.h" +#include "render/tga.h" +#include "render/render.h" + #include "core/core.h" #include "filesystem/filesystem.h" #include "sys/sys.h" @@ -58,27 +60,7 @@ void init() con_print << " vendor " << gl::vendor() << std::endl; con_print << " version " << gl::version() << std::endl; - con_print << "Loading textures..." << std::endl; - - if (!texture( "bitmaps/loader.tga", 0)) { - con_error << "Essential file bitmaps/loader.tga missing" << std::endl; - core::application()->shutdown(); - } - - if (!texture("bitmaps/conchars.tga", 1)) { - con_error << "Essential file bitmaps/conchars.tga missing" << std::endl; - core::application()->shutdown(); - } - - if (!texture("bitmaps/crosshair.tga", 2)) { - con_error << "Essential file bitmaps/crosshair.tga missing" << std::endl; - core::application()->shutdown(); - } - - if (!texture("bitmaps/fx/flare01.tga", 3)) { - con_error << "Essential file bitmaps/fx/flare01.tga missing" << std::endl; - core::application()->shutdown(); - } + Textures::init(); // size of the vertex array in megabytes r_arraysize = core::Cvar::get("r_arraysize", 0.0f , core::Cvar::Archive); @@ -103,7 +85,7 @@ void shutdown() { con_print << "Shutting down renderer..." << std::endl; - glDeleteTextures(2, textures); + Textures::shutdown(); // clear entity models, this will force a reload for (std::map<unsigned int, core::Entity *>::iterator it=core::Entity::registry.begin(); it != core::Entity::registry.end(); it++) { @@ -112,7 +94,10 @@ void shutdown() entity->entity_model = 0; } + // clear models core::Model::clear(); + + // clear vertex array delete vertexarray; vertexarray = 0; } |