From 5fcf8f2dd84714a4563c5db291f7b173eda434d4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=B4me=20Chilliet?= Date: Tue, 29 Nov 2016 12:00:53 +0700 Subject: [PATCH] Removed ununused field hasAlpha --- Source/GameInitDispose.cpp | 78 +++++++++++++++++++------------------- Source/GameTick.cpp | 44 ++++++++++----------- Source/Skybox.cpp | 12 +++--- Source/Text.cpp | 2 +- Source/Texture.cpp | 10 ++--- Source/Texture.h | 5 +-- 6 files changed, 74 insertions(+), 77 deletions(-) diff --git a/Source/GameInitDispose.cpp b/Source/GameInitDispose.cpp index b825162..6073246 100644 --- a/Source/GameInitDispose.cpp +++ b/Source/GameInitDispose.cpp @@ -606,25 +606,23 @@ void Game::InitGame() if (musictoggle) emit_stream_np(stream_menutheme); - cursortexture.load(":Data:Textures:Cursor.png", 0, 1); + cursortexture.load(":Data:Textures:Cursor.png", 0); - Mapcircletexture.load(":Data:Textures:MapCircle.png", 0, 1); - Mapboxtexture.load(":Data:Textures:MapBox.png", 0, 1); - Maparrowtexture.load(":Data:Textures:MapArrow.png", 0, 1); + Mapcircletexture.load(":Data:Textures:MapCircle.png", 0); + Mapboxtexture.load(":Data:Textures:MapBox.png", 0); + Maparrowtexture.load(":Data:Textures:MapArrow.png", 0); temptexdetail = texdetail; if (texdetail > 2) texdetail = 2; - Mainmenuitems[0].load(":Data:Textures:Lugaru.png", 0, 0); - Mainmenuitems[1].load(":Data:Textures:Newgame.png", 0, 0); - Mainmenuitems[2].load(":Data:Textures:Options.png", 0, 0); - Mainmenuitems[3].load(":Data:Textures:Quit.png", 0, 0); - Mainmenuitems[4].load(":Data:Textures:Eyelid.png", 0, 1); - Mainmenuitems[5].load(":Data:Textures:Resume.png", 0, 0); - Mainmenuitems[6].load(":Data:Textures:Endgame.png", 0, 0); - - //LoadTexture(":Data:Textures:Eye.jpg",&Mainmenuitems[5],0,1); - //~ LoadTexture(":Data:Textures:World.png",&Mainmenuitems[7],0,0); // LoadCampaign will take care of that + Mainmenuitems[0].load(":Data:Textures:Lugaru.png", 0); + Mainmenuitems[1].load(":Data:Textures:Newgame.png", 0); + Mainmenuitems[2].load(":Data:Textures:Options.png", 0); + Mainmenuitems[3].load(":Data:Textures:Quit.png", 0); + Mainmenuitems[4].load(":Data:Textures:Eyelid.png", 0); + Mainmenuitems[5].load(":Data:Textures:Resume.png", 0); + Mainmenuitems[6].load(":Data:Textures:Endgame.png", 0); + texdetail = temptexdetail; FadeLoadingScreen(95); @@ -681,7 +679,7 @@ void Game::LoadStuff() i = abs(Random() % 4); visibleloading = 0; //don't use loadscreentexture yet - loadscreentexture.load(":Data:Textures:fire.jpg", 1, 0); + loadscreentexture.load(":Data:Textures:fire.jpg", 1); visibleloading = 1; temptexdetail = texdetail; @@ -707,13 +705,13 @@ void Game::LoadStuff() LOG("Loading weapon data..."); - Weapon::knifetextureptr.load(":Data:Textures:knife.png", 0, 1); - Weapon::bloodknifetextureptr.load(":Data:Textures:bloodknife.png", 0, 1); - Weapon::lightbloodknifetextureptr.load(":Data:Textures:lightbloodknife.png", 0, 1); - Weapon::swordtextureptr.load(":Data:Textures:sword.jpg", 1, 0); - Weapon::bloodswordtextureptr.load(":Data:Textures:Swordblood.jpg", 1, 0); - Weapon::lightbloodswordtextureptr.load(":Data:Textures:Swordbloodlight.jpg", 1, 0); - Weapon::stafftextureptr.load(":Data:Textures:Staff.jpg", 1, 0); + Weapon::knifetextureptr.load(":Data:Textures:knife.png", 0); + Weapon::bloodknifetextureptr.load(":Data:Textures:bloodknife.png", 0); + Weapon::lightbloodknifetextureptr.load(":Data:Textures:lightbloodknife.png", 0); + Weapon::swordtextureptr.load(":Data:Textures:sword.jpg", 1); + Weapon::bloodswordtextureptr.load(":Data:Textures:Swordblood.jpg", 1); + Weapon::lightbloodswordtextureptr.load(":Data:Textures:Swordbloodlight.jpg", 1); + Weapon::stafftextureptr.load(":Data:Textures:Staff.jpg", 1); Weapon::throwingknifemodel.load((char *)":Data:Models:throwingknife.solid", 1); Weapon::throwingknifemodel.Scale(.001, .001, .001); @@ -738,28 +736,28 @@ void Game::LoadStuff() Weapon::staffmodel.flat = 1; Weapon::staffmodel.CalculateNormals(1); - terrain.shadowtexture.load(":Data:Textures:shadow.png", 0, 1); - terrain.bloodtexture.load(":Data:Textures:blood.png", 0, 1); - terrain.breaktexture.load(":Data:Textures:break.png", 0, 1); - terrain.bloodtexture2.load(":Data:Textures:blood.png", 0, 1); + terrain.shadowtexture.load(":Data:Textures:shadow.png", 0); + terrain.bloodtexture.load(":Data:Textures:blood.png", 0); + terrain.breaktexture.load(":Data:Textures:break.png", 0); + terrain.bloodtexture2.load(":Data:Textures:blood.png", 0); - terrain.footprinttexture.load(":Data:Textures:footprint.png", 0, 1); - terrain.bodyprinttexture.load(":Data:Textures:bodyprint.png", 0, 1); - hawktexture.load(":Data:Textures:hawk.png", 0, 1); + terrain.footprinttexture.load(":Data:Textures:footprint.png", 0); + terrain.bodyprinttexture.load(":Data:Textures:bodyprint.png", 0); + hawktexture.load(":Data:Textures:hawk.png", 0); - Sprite::cloudtexture.load(":Data:Textures:cloud.png", 1, 1); - Sprite::cloudimpacttexture.load(":Data:Textures:cloudimpact.png", 1, 1); - Sprite::bloodtexture.load(":Data:Textures:bloodparticle.png", 1, 1); - Sprite::snowflaketexture.load(":Data:Textures:snowflake.png", 1, 1); - Sprite::flametexture.load(":Data:Textures:flame.png", 1, 1); - Sprite::bloodflametexture.load(":Data:Textures:bloodflame.png", 1, 1); - Sprite::smoketexture.load(":Data:Textures:smoke.png", 1, 1); - Sprite::shinetexture.load(":Data:Textures:shine.png", 1, 0); - Sprite::splintertexture.load(":Data:Textures:splinter.png", 1, 1); - Sprite::leaftexture.load(":Data:Textures:leaf.png", 1, 1); - Sprite::toothtexture.load(":Data:Textures:tooth.png", 1, 1); + Sprite::cloudtexture.load(":Data:Textures:cloud.png", 1); + Sprite::cloudimpacttexture.load(":Data:Textures:cloudimpact.png", 1); + Sprite::bloodtexture.load(":Data:Textures:bloodparticle.png", 1); + Sprite::snowflaketexture.load(":Data:Textures:snowflake.png", 1); + Sprite::flametexture.load(":Data:Textures:flame.png", 1); + Sprite::bloodflametexture.load(":Data:Textures:bloodflame.png", 1); + Sprite::smoketexture.load(":Data:Textures:smoke.png", 1); + Sprite::shinetexture.load(":Data:Textures:shine.png", 1); + Sprite::splintertexture.load(":Data:Textures:splinter.png", 1); + Sprite::leaftexture.load(":Data:Textures:leaf.png", 1); + Sprite::toothtexture.load(":Data:Textures:tooth.png", 1); yaw = 0; pitch = 0; diff --git a/Source/GameTick.cpp b/Source/GameTick.cpp index fda1df5..a251430 100644 --- a/Source/GameTick.cpp +++ b/Source/GameTick.cpp @@ -600,18 +600,18 @@ void Setenvironment(int which) if (ambientsound) emit_stream_np(stream_wind); - objects.treetextureptr.load(":Data:Textures:snowtree.png", 0, 1); - objects.bushtextureptr.load(":Data:Textures:bushsnow.png", 0, 1); - objects.rocktextureptr.load(":Data:Textures:bouldersnow.jpg", 1, 0); - objects.boxtextureptr.load(":Data:Textures:snowbox.jpg", 1, 0); + objects.treetextureptr.load(":Data:Textures:snowtree.png", 0); + objects.bushtextureptr.load(":Data:Textures:bushsnow.png", 0); + objects.rocktextureptr.load(":Data:Textures:bouldersnow.jpg", 1); + objects.boxtextureptr.load(":Data:Textures:snowbox.jpg", 1); footstepsound = footstepsn1; footstepsound2 = footstepsn2; footstepsound3 = footstepst1; footstepsound4 = footstepst2; - terraintexture.load(":Data:Textures:snow.jpg", 1, 0); - terraintexture2.load(":Data:Textures:rock.jpg", 1, 0); + terraintexture.load(":Data:Textures:snow.jpg", 1); + terraintexture2.load(":Data:Textures:rock.jpg", 1); temptexdetail = texdetail; @@ -631,10 +631,10 @@ void Setenvironment(int which) } else if (environment == desertenvironment) { windvector = 0; windvector.z = 2; - objects.treetextureptr.load(":Data:Textures:deserttree.png", 0, 1); - objects.bushtextureptr.load(":Data:Textures:bushdesert.png", 0, 1); - objects.rocktextureptr.load(":Data:Textures:boulderdesert.jpg", 1, 0); - objects.boxtextureptr.load(":Data:Textures:desertbox.jpg", 1, 0); + objects.treetextureptr.load(":Data:Textures:deserttree.png", 0); + objects.bushtextureptr.load(":Data:Textures:bushdesert.png", 0); + objects.rocktextureptr.load(":Data:Textures:boulderdesert.jpg", 1); + objects.boxtextureptr.load(":Data:Textures:desertbox.jpg", 1); if (ambientsound) @@ -645,8 +645,8 @@ void Setenvironment(int which) footstepsound3 = footstepsn1; footstepsound4 = footstepsn2; - terraintexture.load(":Data:Textures:sand.jpg", 1, 0); - terraintexture2.load(":Data:Textures:sandslope.jpg", 1, 0); + terraintexture.load(":Data:Textures:sand.jpg", 1); + terraintexture2.load(":Data:Textures:sandslope.jpg", 1); temptexdetail = texdetail; @@ -666,10 +666,10 @@ void Setenvironment(int which) } else if (environment == grassyenvironment) { windvector = 0; windvector.z = 2; - objects.treetextureptr.load(":Data:Textures:tree.png", 0, 1); - objects.bushtextureptr.load(":Data:Textures:bush.png", 0, 1); - objects.rocktextureptr.load(":Data:Textures:boulder.jpg", 1, 0); - objects.boxtextureptr.load(":Data:Textures:grassbox.jpg", 1, 0); + objects.treetextureptr.load(":Data:Textures:tree.png", 0); + objects.bushtextureptr.load(":Data:Textures:bush.png", 0); + objects.rocktextureptr.load(":Data:Textures:boulder.jpg", 1); + objects.boxtextureptr.load(":Data:Textures:grassbox.jpg", 1); if (ambientsound) emit_stream_np(stream_wind, 100.); @@ -679,8 +679,8 @@ void Setenvironment(int which) footstepsound3 = footstepst1; footstepsound4 = footstepst2; - terraintexture.load(":Data:Textures:grassdirt.jpg", 1, 0); - terraintexture2.load(":Data:Textures:mossrock.jpg", 1, 0); + terraintexture.load(":Data:Textures:grassdirt.jpg", 1); + terraintexture2.load(":Data:Textures:mossrock.jpg", 1); temptexdetail = texdetail; @@ -731,9 +731,9 @@ void LoadCampaign() ifstream test(ConvertFileName((":Data:Textures:" + accountactive->getCurrentCampaign() + ":World.png").c_str())); if (test.good()) { - Mainmenuitems[7].load((":Data:Textures:" + accountactive->getCurrentCampaign() + ":World.png").c_str(), 0, 0); + Mainmenuitems[7].load((":Data:Textures:" + accountactive->getCurrentCampaign() + ":World.png").c_str(), 0); } else { - Mainmenuitems[7].load(":Data:Textures:World.png", 0, 0); + Mainmenuitems[7].load(":Data:Textures:World.png", 0); } if (accountactive->getCampaignChoicesMade() == 0) { @@ -1276,7 +1276,7 @@ void Game::Loadlevel(const char *name) (char *)":Data:Models:Body7.solid", (char *)":Data:Models:Bodylow.solid", (char *)":Data:Models:Belt.solid", 1); - Person::players[i]->skeleton.drawmodelclothes.textureptr.load(":Data:Textures:Belt.png", 1, 1); + Person::players[i]->skeleton.drawmodelclothes.textureptr.load(":Data:Textures:Belt.png", 1); } if (Person::players[i]->creature == wolftype) { Person::players[i]->skeleton.Load( @@ -2388,7 +2388,7 @@ void doDebugKeys() Person::players.back()->whichskin = 2; } - Person::players.back()->skeleton.drawmodelclothes.textureptr.load(":Data:Textures:Belt.png", 1, 1); + Person::players.back()->skeleton.drawmodelclothes.textureptr.load(":Data:Textures:Belt.png", 1); Person::players.back()->power = 1; Person::players.back()->speedmult = 1; Person::players.back()->animCurrent = bounceidleanim; diff --git a/Source/Skybox.cpp b/Source/Skybox.cpp index 327db69..7db0d2b 100644 --- a/Source/Skybox.cpp +++ b/Source/Skybox.cpp @@ -32,12 +32,12 @@ extern float skyboxb; void SkyBox::load (const char *ffront, const char *fleft, const char *fback, const char *fright, const char *fup, const char *fdown) { - front.load(ffront, true, false); - left.load(fleft, true, false); - back.load(fback, true, false); - right.load(fright, true, false); - up.load(fup, true, false); - down.load(fdown, true, false); + front.load(ffront, true); + left.load(fleft, true); + back.load(fback, true); + right.load(fright, true); + up.load(fup, true); + down.load(fdown, true); } void SkyBox::draw() diff --git a/Source/Text.cpp b/Source/Text.cpp index 1c00920..5b90b6a 100644 --- a/Source/Text.cpp +++ b/Source/Text.cpp @@ -28,7 +28,7 @@ void Text::LoadFontTexture(const char *fileName) LOG(std::string("Loading font texture...") + fileName); - FontTexture.load(fileName, false, false); + FontTexture.load(fileName, false); if (base) { glDeleteLists(base, 512); base = 0; diff --git a/Source/Texture.cpp b/Source/Texture.cpp index 08010c3..dd2d1cc 100644 --- a/Source/Texture.cpp +++ b/Source/Texture.cpp @@ -74,8 +74,8 @@ void TextureRes::bind() glBindTexture(GL_TEXTURE_2D, id); } -TextureRes::TextureRes(const string& _filename, bool _hasMipmap, bool _hasAlpha): - id(0), filename(_filename), hasMipmap(_hasMipmap), hasAlpha(_hasAlpha), isSkin(false), +TextureRes::TextureRes(const string& _filename, bool _hasMipmap): + id(0), filename(_filename), hasMipmap(_hasMipmap), isSkin(false), skinsize(0), data(NULL), datalen(0) { load(); @@ -83,7 +83,7 @@ TextureRes::TextureRes(const string& _filename, bool _hasMipmap, bool _hasAlpha) } TextureRes::TextureRes(const string& _filename, bool _hasMipmap, GLubyte* array, int* skinsizep): - id(0), filename(_filename), hasMipmap(_hasMipmap), hasAlpha(false), isSkin(true), + id(0), filename(_filename), hasMipmap(_hasMipmap), isSkin(true), skinsize(0), data(NULL), datalen(0) { load(); @@ -104,10 +104,10 @@ TextureRes::~TextureRes() } } -void Texture::load(const string& filename, bool hasMipmap, bool hasAlpha) +void Texture::load(const string& filename, bool hasMipmap) { destroy(); - tex = new TextureRes(filename, hasMipmap, hasAlpha); + tex = new TextureRes(filename, hasMipmap); } void Texture::load(const string& filename, bool hasMipmap, GLubyte* array, int* skinsizep) diff --git a/Source/Texture.h b/Source/Texture.h index 111712c..95547bf 100644 --- a/Source/Texture.h +++ b/Source/Texture.h @@ -34,7 +34,6 @@ private: GLuint id; string filename; bool hasMipmap; - bool hasAlpha; bool isSkin; int skinsize; GLubyte* data; @@ -43,7 +42,7 @@ private: void load(); public: - TextureRes(const string& filename, bool hasMipmap, bool hasAlpha); + TextureRes(const string& filename, bool hasMipmap); TextureRes(const string& filename, bool hasMipmap, GLubyte* array, int* skinsize); ~TextureRes(); void bind(); @@ -55,7 +54,7 @@ private: TextureRes* tex; public: inline Texture(): tex(NULL) {} - void load(const string& filename, bool hasMipmap, bool hasAlpha); + void load(const string& filename, bool hasMipmap); void load(const string& filename, bool hasMipmap, GLubyte* array, int* skinsizep); void destroy(); void bind(); -- 2.39.5