From: sf17k Date: Fri, 3 Jun 2011 19:57:10 +0000 (-0400) Subject: glDeleteTextures safely ignores zeroes X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=263a338c0c3648cfa2388d4a21584a09294ffd9e;p=lugaru.git glDeleteTextures safely ignores zeroes --- diff --git a/Source/GameInitDispose.cpp b/Source/GameInitDispose.cpp index ee82765..8c09179 100644 --- a/Source/GameInitDispose.cpp +++ b/Source/GameInitDispose.cpp @@ -142,17 +142,15 @@ void Game::deleteGame(){ delete skybox; if(text) delete text; - for(int i=0;i<10;i++){ - if(Mainmenuitems[i])glDeleteTextures( 1, &Mainmenuitems[i] ); - } + glDeleteTextures( 10, &Mainmenuitems[0] ); glDeleteTextures( 1, &cursortexture ); glDeleteTextures( 1, &Maparrowtexture ); glDeleteTextures( 1, &Mapboxtexture ); glDeleteTextures( 1, &Mapcircletexture ); glDeleteTextures( 1, &terraintexture ); glDeleteTextures( 1, &terraintexture2 ); - if(screentexture>0)glDeleteTextures( 1, &screentexture ); - if(screentexture2>0)glDeleteTextures( 1, &screentexture2 ); + glDeleteTextures( 1, &screentexture ); + glDeleteTextures( 1, &screentexture2 ); glDeleteTextures( 1, &hawktexture ); glDeleteTextures( 1, &logotexture ); glDeleteTextures( 1, &loadscreentexture ); @@ -754,10 +752,7 @@ void Game::LoadStuff() for(i=0;i