From: Peter Schaefer Date: Mon, 4 May 2015 20:29:32 +0000 (+0200) Subject: badHack Textures!!! X-Git-Url: https://git.leopard-lacewing.eu/?a=commitdiff_plain;h=85f7322635d0fdd6dd2bddbbfbaa153878156bc6;p=cgue_weave.git badHack Textures!!! --- diff --git a/Weave/Game.cpp b/Weave/Game.cpp index c5afb7f..488b143 100644 --- a/Weave/Game.cpp +++ b/Weave/Game.cpp @@ -15,6 +15,7 @@ #include "Graphix\Shader.h" #include "Graphix\Graphix.h" +#include "Graphix\Texture.h" #include "Fps.h" #include "Events.h" @@ -74,6 +75,9 @@ Game::Game() : playing(true) Game::~Game() { delete current_world; + + //RALLLY BAD HACK!!!! No Texture will be freed!!!! + Texture::clean(); } diff --git a/Weave/Graphix/Graphix.cpp b/Weave/Graphix/Graphix.cpp index d4a776b..be1e6ee 100644 --- a/Weave/Graphix/Graphix.cpp +++ b/Weave/Graphix/Graphix.cpp @@ -96,6 +96,7 @@ void Graphix::clear() void Graphix::cleanup() { + delete shader_BBox; SDL_SetWindowGrab(sdl_window, SDL_FALSE); SDL_GL_DeleteContext(sdl_glcontext); diff --git a/Weave/Graphix/Texture.cpp b/Weave/Graphix/Texture.cpp index e140861..7454dc1 100644 --- a/Weave/Graphix/Texture.cpp +++ b/Weave/Graphix/Texture.cpp @@ -96,6 +96,7 @@ Texture::Texture(const string& _path, const vec4& _material) : path(_path), hand Texture::~Texture() { + texture_map.erase(path); glDeleteTextures(1, &handle); } @@ -110,4 +111,10 @@ Texture::operator string() const return path; } +void Texture::clean() +{ + //RALLLY BAD HACK!!!! No Texture will be freed!!!! + texture_map.clear(); +} + str2int_map Texture::texture_map; \ No newline at end of file diff --git a/Weave/Graphix/Texture.h b/Weave/Graphix/Texture.h index 7137d6c..313920a 100644 --- a/Weave/Graphix/Texture.h +++ b/Weave/Graphix/Texture.h @@ -24,6 +24,9 @@ public: vec4 material; + //RALLLY BAD HACK!!!! No Texture will be freed!!!! + static void clean(); + private: unsigned int handle; string path;