Skip to content

Commit

Permalink
Unload texture transformation state cache.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent Lejeune committed May 4, 2014
1 parent d6d7c61 commit 849467d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/graphics/glwrap.cpp
Expand Up @@ -304,6 +304,11 @@ GLuint getDepthTexture(irr::video::ITexture *tex)

std::set<irr::video::ITexture *> AlreadyTransformedTexture;

void resetTextureTable()
{
AlreadyTransformedTexture.clear();
}

void compressTexture(irr::video::ITexture *tex, bool srgb)
{
if (AlreadyTransformedTexture.find(tex) != AlreadyTransformedTexture.end())
Expand Down
1 change: 1 addition & 0 deletions src/graphics/glwrap.hpp
Expand Up @@ -159,6 +159,7 @@ GLint LoadProgram(Types ... args)

GLuint getTextureGLuint(irr::video::ITexture *tex);
GLuint getDepthTexture(irr::video::ITexture *tex);
void resetTextureTable();
void compressTexture(irr::video::ITexture *tex, bool srgb);
void blitFBO(GLuint Src, GLuint Dst, size_t width, size_t height);

Expand Down
3 changes: 3 additions & 0 deletions src/tracks/track.cpp
Expand Up @@ -28,6 +28,7 @@
#include "config/user_config.hpp"
#include "graphics/camera.hpp"
#include "graphics/CBatchingMesh.hpp"
#include "graphics/glwrap.hpp"
#include "graphics/irr_driver.hpp"
#include "graphics/lod_node.hpp"
#include "graphics/material_manager.hpp"
Expand Down Expand Up @@ -206,6 +207,8 @@ void Track::cleanup()
ItemManager::destroy();

ParticleKindManager::get()->cleanUpTrackSpecificGfx();
// Clear remainder of transformed textures
resetTextureTable();

for(unsigned int i=0; i<m_animated_textures.size(); i++)
{
Expand Down

0 comments on commit 849467d

Please sign in to comment.