bug fix to properly initialize textures dynamically loaded when loading a faction.

This commit is contained in:
Mark Vejvoda
2010-04-05 19:38:50 +00:00
parent ab1c302107
commit 1fe29664c9
7 changed files with 124 additions and 12 deletions

View File

@@ -1,7 +1,7 @@
// ==============================================================
// This file is part of Glest Shared Library (www.glest.org)
//
// Copyright (C) 2001-2008 Marti<EFBFBD>o Figueroa
// Copyright (C) 2001-2008 Martio Figueroa
//
// You can redistribute this code and/or modify it under
// the terms of the GNU General Public License as published
@@ -33,6 +33,20 @@ TextureManager::~TextureManager(){
end();
}
void TextureManager::initTexture(Texture *texture) {
if(texture != NULL) {
texture->init(textureFilter, maxAnisotropy);
}
}
void TextureManager::endTexture(Texture **texture) {
if(texture != NULL && *texture != NULL) {
(*texture)->end();
delete (*texture);
*texture = NULL;
}
}
void TextureManager::init(){
for(int i=0; i<textures.size(); ++i){
textures[i]->init(textureFilter, maxAnisotropy);