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 );
for(i=0;i<maxplayers;i++)
{
- if (glIsTexture(player[i].skeleton.drawmodel.textureptr))
- {
- glDeleteTextures(1, &player[i].skeleton.drawmodel.textureptr);
- }
+ glDeleteTextures(1, &player[i].skeleton.drawmodel.textureptr);
player[i].skeleton.drawmodel.textureptr=0;;
}
{
deallocate();
- if(textureptr) glDeleteTextures( 1, &textureptr );
+ glDeleteTextures( 1, &textureptr );
}
void Model::deallocate()
Objects::~Objects()
{
- if (boxtextureptr) glDeleteTextures( 1, &boxtextureptr );
- if (treetextureptr) glDeleteTextures( 1, &treetextureptr );
- if (bushtextureptr) glDeleteTextures( 1, &bushtextureptr );
- if (rocktextureptr) glDeleteTextures( 1, &rocktextureptr );
+ glDeleteTextures( 1, &boxtextureptr );
+ glDeleteTextures( 1, &treetextureptr );
+ glDeleteTextures( 1, &bushtextureptr );
+ glDeleteTextures( 1, &rocktextureptr );
};
SkyBox::~SkyBox()
{
- if (front) glDeleteTextures( 1, &front );
- if (left) glDeleteTextures( 1, &left );
- if (back) glDeleteTextures( 1, &back );
- if (right) glDeleteTextures( 1, &right );
- if (up) glDeleteTextures( 1, &up );
- if (down) glDeleteTextures( 1, &down );
+ glDeleteTextures( 1, &front );
+ glDeleteTextures( 1, &left );
+ glDeleteTextures( 1, &back );
+ glDeleteTextures( 1, &right );
+ glDeleteTextures( 1, &up );
+ glDeleteTextures( 1, &down );
};
void Sprite::clearTextures()
{
- if (toothtexture) glDeleteTextures( 1, &toothtexture );
- if (cloudtexture) glDeleteTextures( 1, &cloudtexture );
- if (cloudimpacttexture) glDeleteTextures( 1, &cloudimpacttexture );
- if (bloodtexture) glDeleteTextures( 1, &bloodtexture );
- if (flametexture) glDeleteTextures( 1, &flametexture );
- if (bloodflametexture) glDeleteTextures( 1, &bloodflametexture );
- if (smoketexture) glDeleteTextures( 1, &smoketexture );
- if (snowflaketexture) glDeleteTextures( 1, &snowflaketexture );
- if (shinetexture) glDeleteTextures( 1, &shinetexture );
- if (splintertexture) glDeleteTextures( 1, &splintertexture );
- if (leaftexture) glDeleteTextures( 1, &leaftexture );
+ glDeleteTextures( 1, &toothtexture );
+ glDeleteTextures( 1, &cloudtexture );
+ glDeleteTextures( 1, &cloudimpacttexture );
+ glDeleteTextures( 1, &bloodtexture );
+ glDeleteTextures( 1, &flametexture );
+ glDeleteTextures( 1, &bloodflametexture );
+ glDeleteTextures( 1, &smoketexture );
+ glDeleteTextures( 1, &snowflaketexture );
+ glDeleteTextures( 1, &shinetexture );
+ glDeleteTextures( 1, &splintertexture );
+ glDeleteTextures( 1, &leaftexture );
}
}
Terrain::~Terrain()
{
- if(terraintexture)glDeleteTextures( 1, &terraintexture );
- if(shadowtexture) glDeleteTextures( 1, &shadowtexture );
- if(bodyprinttexture) glDeleteTextures( 1, &bodyprinttexture );
- if(footprinttexture) glDeleteTextures( 1, &footprinttexture );
- if(bloodtexture) glDeleteTextures( 1, &bloodtexture );
- if(bloodtexture2) glDeleteTextures( 1, &bloodtexture2 );
- if(breaktexture) glDeleteTextures( 1, &breaktexture );
+ glDeleteTextures( 1, &terraintexture );
+ glDeleteTextures( 1, &shadowtexture );
+ glDeleteTextures( 1, &bodyprinttexture );
+ glDeleteTextures( 1, &footprinttexture );
+ glDeleteTextures( 1, &bloodtexture );
+ glDeleteTextures( 1, &bloodtexture2 );
+ glDeleteTextures( 1, &breaktexture );
}
glDeleteLists(base, 512);
base = 0;
}
- if (FontTexture) glDeleteTextures( 1, &FontTexture );
+ glDeleteTextures( 1, &FontTexture );
}
Texture::~Texture() {
free(array);
- if(id)
- glDeleteTextures(1,&id);
+ glDeleteTextures(1,&id);
}
void Texture::load() {
Weapons::~Weapons()
{
- if (Weapon::stafftextureptr) glDeleteTextures( 1, &Weapon::stafftextureptr );
- if (Weapon::knifetextureptr) glDeleteTextures( 1, &Weapon::knifetextureptr );
- if (Weapon::lightbloodknifetextureptr) glDeleteTextures( 1, &Weapon::lightbloodknifetextureptr );
- if (Weapon::bloodknifetextureptr) glDeleteTextures( 1, &Weapon::bloodknifetextureptr );
- if (Weapon::swordtextureptr) glDeleteTextures( 1, &Weapon::swordtextureptr );
- if (Weapon::lightbloodswordtextureptr) glDeleteTextures( 1, &Weapon::lightbloodswordtextureptr );
- if (Weapon::bloodswordtextureptr) glDeleteTextures( 1, &Weapon::bloodswordtextureptr );
+ glDeleteTextures( 1, &Weapon::stafftextureptr );
+ glDeleteTextures( 1, &Weapon::knifetextureptr );
+ glDeleteTextures( 1, &Weapon::lightbloodknifetextureptr );
+ glDeleteTextures( 1, &Weapon::bloodknifetextureptr );
+ glDeleteTextures( 1, &Weapon::swordtextureptr );
+ glDeleteTextures( 1, &Weapon::lightbloodswordtextureptr );
+ glDeleteTextures( 1, &Weapon::bloodswordtextureptr );
}