From 2d54e57ffa32e0a02013d79be57b8a2f3bc8db05 Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=B4me=20Chilliet?= Date: Fri, 25 Nov 2016 22:55:51 +0800 Subject: [PATCH] Removed commented out code --- Source/Account.cpp | 2 -- Source/GameDraw.cpp | 6 ------ Source/GameInitDispose.cpp | 7 ------- Source/GameTick.cpp | 14 -------------- Source/Globals.cpp | 4 +--- Source/MacCompatibility.cpp | 1 - Source/Models.cpp | 16 ---------------- Source/Person.cpp | 10 ---------- 8 files changed, 1 insertion(+), 59 deletions(-) diff --git a/Source/Account.cpp b/Source/Account.cpp index 1d7bbd1..11483f8 100644 --- a/Source/Account.cpp +++ b/Source/Account.cpp @@ -128,7 +128,6 @@ Account* Account::loadFile(string filename) funpackf(tfile, "Bi", &(acc->progress)); int nbCampaigns; funpackf(tfile, "Bi", &nbCampaigns); - //~ printf("loading %d campaign progress info\n",nbCampaigns); for (int k = 0; k < nbCampaigns; ++k) { string campaignName = ""; @@ -139,7 +138,6 @@ Account* Account::loadFile(string filename) funpackf(tfile, "Bb", &c); campaignName.append(1, c); } - //~ printf("loading %s campaign progress info\n",campaignName.c_str()); funpackf(tfile, "Bf", &(acc->campaignProgress[campaignName].time)); funpackf(tfile, "Bf", &(acc->campaignProgress[campaignName].score)); funpackf(tfile, "Bf", &(acc->campaignProgress[campaignName].fasttime)); diff --git a/Source/GameDraw.cpp b/Source/GameDraw.cpp index f6d5953..4940424 100644 --- a/Source/GameDraw.cpp +++ b/Source/GameDraw.cpp @@ -29,7 +29,6 @@ extern int environment; extern float texscale; extern Light light; extern Terrain terrain; -//extern Sprites sprites; extern float multiplier; extern float sps; extern float viewdistance; @@ -73,8 +72,6 @@ extern int mainmenu; extern int bloodtoggle; extern int difficulty; extern bool decals; -// MODIFIED GWC -//extern int texdetail; extern float texdetail; extern bool musictoggle; extern int tutoriallevel; @@ -1483,11 +1480,9 @@ int Game::DrawGLScene(StereoSide side) float maxdistance = 0; float tempdist; - //~ int whichclosest; for (int i = 0; i < objects.numobjects; i++) { tempdist = distsq(¢er, &objects.position[i]); if (tempdist > maxdistance) { - //~ whichclosest=i; maxdistance = tempdist; } } @@ -1495,7 +1490,6 @@ int Game::DrawGLScene(StereoSide side) if (!Person::players[i]->dead) { tempdist = distsq(¢er, &Person::players[i]->coords); if (tempdist > maxdistance) { - //~ whichclosest=i; maxdistance = tempdist; } } diff --git a/Source/GameInitDispose.cpp b/Source/GameInitDispose.cpp index e9655e9..0ce61ee 100644 --- a/Source/GameInitDispose.cpp +++ b/Source/GameInitDispose.cpp @@ -34,7 +34,6 @@ extern Light light; extern Skeleton testskeleton; extern int numsounds; extern Terrain terrain; -//extern Sprites sprites; extern int kTextureSize; extern float texdetail; extern float realtexdetail; @@ -740,32 +739,26 @@ void Game::LoadStuff() Weapon::throwingknifemodel.load((char *)":Data:Models:throwingknife.solid", 1); Weapon::throwingknifemodel.Scale(.001, .001, .001); - //Weapon::throwingknifemodel.Rotate(0,0,-90); Weapon::throwingknifemodel.Rotate(90, 0, 0); Weapon::throwingknifemodel.Rotate(0, 90, 0); Weapon::throwingknifemodel.flat = 0; Weapon::throwingknifemodel.CalculateNormals(1); - //Weapon::throwingknifemodel.ScaleNormals(-1,-1,-1); Weapon::swordmodel.load((char *)":Data:Models:sword.solid", 1); Weapon::swordmodel.Scale(.001, .001, .001); - //Weapon::swordmodel.Rotate(0,0,-90); Weapon::swordmodel.Rotate(90, 0, 0); Weapon::swordmodel.Rotate(0, 90, 0); Weapon::swordmodel.Rotate(0, 0, 90); Weapon::swordmodel.flat = 1; Weapon::swordmodel.CalculateNormals(1); - //Weapon::swordmodel.ScaleNormals(-1,-1,-1); Weapon::staffmodel.load((char *)":Data:Models:staff.solid", 1); Weapon::staffmodel.Scale(.005, .005, .005); - //Weapon::staffmodel.Rotate(0,0,-90); Weapon::staffmodel.Rotate(90, 0, 0); Weapon::staffmodel.Rotate(0, 90, 0); Weapon::staffmodel.Rotate(0, 0, 90); Weapon::staffmodel.flat = 1; Weapon::staffmodel.CalculateNormals(1); - //Weapon::staffmodel.ScaleNormals(-1,-1,-1); terrain.shadowtexture.load(":Data:Textures:shadow.png", 0, 1); terrain.bloodtexture.load(":Data:Textures:blood.png", 0, 1); diff --git a/Source/GameTick.cpp b/Source/GameTick.cpp index c994c0f..c767097 100644 --- a/Source/GameTick.cpp +++ b/Source/GameTick.cpp @@ -659,10 +659,6 @@ void Setenvironment(int which) terraintexture.load(":Data:Textures:snow.jpg", 1, 0); terraintexture2.load(":Data:Textures:rock.jpg", 1, 0); - //LoadTexture(":Data:Textures:detailgrain.png",&terraintexture3,1); - - - temptexdetail = texdetail; if (texdetail > 1) @@ -698,9 +694,6 @@ void Setenvironment(int which) terraintexture.load(":Data:Textures:sand.jpg", 1, 0); terraintexture2.load(":Data:Textures:sandslope.jpg", 1, 0); - //LoadTexture(":Data:Textures:detailgrain.png",&terraintexture3,1); - - temptexdetail = texdetail; if (texdetail > 1) @@ -735,9 +728,6 @@ void Setenvironment(int which) terraintexture.load(":Data:Textures:grassdirt.jpg", 1, 0); terraintexture2.load(":Data:Textures:mossrock.jpg", 1, 0); - //LoadTexture(":Data:Textures:detail.png",&terraintexture3,1); - - temptexdetail = texdetail; if (texdetail > 1) @@ -1135,11 +1125,9 @@ void Game::Loadlevel(const char *name) float maxdistance = 0; float tempdist; - //~ int whichclosest; for (int i = 0; i < objects.numobjects; i++) { tempdist = distsq(&objects.center, &objects.position[i]); if (tempdist > maxdistance) { - //~ whichclosest=i; maxdistance = tempdist; } } @@ -1195,7 +1183,6 @@ void Game::Loadlevel(const char *name) } } funpackf(tfile, "Bi", &Person::players[i - howmanyremoved]->numwaypoints); - //Person::players[i-howmanyremoved]->numwaypoints=10; for (int j = 0; j < Person::players[i - howmanyremoved]->numwaypoints; j++) { funpackf(tfile, "Bf", &Person::players[i - howmanyremoved]->waypoints[j].x); funpackf(tfile, "Bf", &Person::players[i - howmanyremoved]->waypoints[j].y); @@ -1600,7 +1587,6 @@ void doTutorial() break; case 19: tutorialstage = 20; - //tutorialmaxtime=500; break; case 20: tutorialmaxtime = 500; diff --git a/Source/Globals.cpp b/Source/Globals.cpp index 16d350d..2969af5 100644 --- a/Source/Globals.cpp +++ b/Source/Globals.cpp @@ -167,7 +167,7 @@ float skyboxlightb = 0; int hostile = 0; float hostiletime = 0; -XYZ envsound[30]; // = {0}; +XYZ envsound[30]; float envsoundvol[30] = {0}; float envsoundlife[30] = {0}; int numenvsounds; @@ -186,8 +186,6 @@ bool campaign = false; bool gamestarted = false; -//TextureList textures; - StereoMode stereomode = stereoNone; StereoMode newstereomode = stereoNone; float stereoseparation = 0.05; diff --git a/Source/MacCompatibility.cpp b/Source/MacCompatibility.cpp index 467c978..ea8ba74 100644 --- a/Source/MacCompatibility.cpp +++ b/Source/MacCompatibility.cpp @@ -132,7 +132,6 @@ static int locateOneElement(char *buf) char *ptr; DIR *dirp; - //if (PHYSFS_exists(buf)) if (access(buf, F_OK) == 0) return(1); /* quick rejection: exists in current case. */ diff --git a/Source/Models.cpp b/Source/Models.cpp index 9614908..d0a991b 100644 --- a/Source/Models.cpp +++ b/Source/Models.cpp @@ -404,10 +404,6 @@ bool Model::loadnotex(const char *filename ) FILE *tfile; long i; - //~ int oldvertexNum, oldTriangleNum; - //~ oldvertexNum = vertexNum; - //~ oldTriangleNum = TriangleNum; - type = notextype; color = 0; @@ -433,7 +429,6 @@ bool Model::loadnotex(const char *filename ) } for (i = 0; i < TriangleNum; i++) { - //funpackf(tfile, "Bi Bi Bi", &Triangles[i].vertex[0], &Triangles[i].vertex[1], &Triangles[i].vertex[2]); short vertex[ 6]; funpackf(tfile, "Bs Bs Bs Bs Bs Bs", &vertex[ 0], &vertex[ 1], &vertex[ 2], &vertex[ 3], &vertex[ 4], &vertex[ 5]); Triangles[i].vertex[ 0] = vertex[ 0]; @@ -479,10 +474,6 @@ bool Model::load(const char *filename, bool texture ) if (visibleloading) Game::LoadingScreen(); - //~ int oldvertexNum, oldTriangleNum; - //~ oldvertexNum = vertexNum; - //~ oldTriangleNum = TriangleNum; - type = normaltype; color = 0; @@ -511,7 +502,6 @@ bool Model::load(const char *filename, bool texture ) } for (i = 0; i < TriangleNum; i++) { - //funpackf(tfile, "Bi Bi Bi", &Triangles[i].vertex[0], &Triangles[i].vertex[1], &Triangles[i].vertex[2]); short vertex[ 6]; funpackf(tfile, "Bs Bs Bs Bs Bs Bs", &vertex[ 0], &vertex[ 1], &vertex[ 2], &vertex[ 3], &vertex[ 4], &vertex[ 5]); Triangles[i].vertex[ 0] = vertex[ 0]; @@ -589,7 +579,6 @@ bool Model::loaddecal(const char *filename, bool texture ) } for (i = 0; i < TriangleNum; i++) { - //funpackf(tfile, "Bi Bi Bi", &Triangles[i].vertex[0], &Triangles[i].vertex[1], &Triangles[i].vertex[2]); short vertex[ 6]; funpackf(tfile, "Bs Bs Bs Bs Bs Bs", &vertex[ 0], &vertex[ 1], &vertex[ 2], &vertex[ 3], &vertex[ 4], &vertex[ 5]); Triangles[i].vertex[ 0] = vertex[ 0]; @@ -654,10 +643,6 @@ bool Model::loadraw(char *filename ) LOG(std::string("Loading raw...") + filename); - //~ int oldvertexNum, oldTriangleNum; - //~ oldvertexNum = vertexNum; - //~ oldTriangleNum = TriangleNum; - type = rawtype; color = 0; @@ -685,7 +670,6 @@ bool Model::loadraw(char *filename ) } for (i = 0; i < TriangleNum; i++) { - //funpackf(tfile, "Bi Bi Bi", &Triangles[i].vertex[0], &Triangles[i].vertex[1], &Triangles[i].vertex[2]); short vertex[ 6]; funpackf(tfile, "Bs Bs Bs Bs Bs Bs", &vertex[ 0], &vertex[ 1], &vertex[ 2], &vertex[ 3], &vertex[ 4], &vertex[ 5]); Triangles[i].vertex[ 0] = vertex[ 0]; diff --git a/Source/Person.cpp b/Source/Person.cpp index 87aaace..2f92f88 100644 --- a/Source/Person.cpp +++ b/Source/Person.cpp @@ -633,13 +633,6 @@ bool Person::DoBloodBigWhere(float howmuch, int which, XYZ where) p1 = skeleton.drawmodel.vertex[skeleton.drawmodel.Triangles[whichtri].vertex[0]]; p2 = skeleton.drawmodel.vertex[skeleton.drawmodel.Triangles[whichtri].vertex[1]]; p3 = skeleton.drawmodel.vertex[skeleton.drawmodel.Triangles[whichtri].vertex[2]]; - /* - CrossProduct(p2-p1,p3-p1,&N); - CrossProduct(p0-p1,p3-p1,&temp); - s = dotproduct(&temp,&N)/findLength(&N); - CrossProduct(p2-p1,p1-p0,&temp); - t = dotproduct(&temp,&N)/findLength(&N); - r = 1 - (s + t);*/ bary.x = distsq(&p0, &p1); bary.y = distsq(&p0, &p2); @@ -669,9 +662,6 @@ bool Person::DoBloodBigWhere(float howmuch, int which, XYZ where) coordsx = skeleton.drawmodel.Triangles[whichtri].gx[0] * bary.x + skeleton.drawmodel.Triangles[whichtri].gx[1] * bary.y + skeleton.drawmodel.Triangles[whichtri].gx[2] * bary.z; coordsy = skeleton.drawmodel.Triangles[whichtri].gy[0] * bary.x + skeleton.drawmodel.Triangles[whichtri].gy[1] * bary.y + skeleton.drawmodel.Triangles[whichtri].gy[2] * bary.z; - //coordsx=skeleton.drawmodel.Triangles[whichtri].gx[1]; - //coordsy=skeleton.drawmodel.Triangles[whichtri].gy[1]; - if (bleeding <= 0 && spurt) { spurt = 0; for (int i = 0; i < 3; i++) { -- 2.39.5