From: Côme Chilliet Date: Fri, 25 Nov 2016 13:55:53 +0000 (+0800) Subject: Removed unused local vars X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=3f27343fe706bb582974ca77dffb39ae1791d76f;p=lugaru.git Removed unused local vars --- diff --git a/Source/GameTick.cpp b/Source/GameTick.cpp index 4ff1250..c994c0f 100644 --- a/Source/GameTick.cpp +++ b/Source/GameTick.cpp @@ -3197,7 +3197,6 @@ void doAerialAcrobatics() void doAttacks() { - static XYZ relative; static int randattack; static bool playerrealattackkeydown = 0; diff --git a/Source/Models.cpp b/Source/Models.cpp index 3aa178d..9614908 100644 --- a/Source/Models.cpp +++ b/Source/Models.cpp @@ -154,7 +154,6 @@ int Model::SphereCheck(XYZ *p1, float radius, XYZ *p, XYZ *move, float *rotate) static int firstintersecting; static XYZ point; static XYZ oldp1; - static XYZ start, end; firstintersecting = -1; @@ -208,7 +207,6 @@ int Model::SphereCheckPossible(XYZ *p1, float radius, XYZ *move, float *rotate) static int firstintersecting; static XYZ point; static XYZ oldp1; - static XYZ start, end; firstintersecting = -1; diff --git a/Source/Person.cpp b/Source/Person.cpp index 62796aa..87aaace 100644 --- a/Source/Person.cpp +++ b/Source/Person.cpp @@ -609,7 +609,6 @@ bool Person::DoBloodBigWhere(float howmuch, int which, XYZ where) static float rotationpoint; static int whichtri; static XYZ p1, p2, p3, p0; - static XYZ N, temp; XYZ bary; XYZ gxx, gyy; float coordsx, coordsy; @@ -5668,7 +5667,7 @@ void Person::DoStuff() */ void IKHelper(Person *p, float interp) { - XYZ point, newpoint, change, change2; + XYZ point, change, change2; float heightleft, heightright; // TODO: implement localToWorld and worldToLocal @@ -6245,7 +6244,7 @@ int Person::DrawSkeleton() weapons[i].smallrotation2 = 50; } if ((animCurrent == crouchstabanim && animTarget == crouchstabanim) || (animCurrent == backhandspringanim && animTarget == backhandspringanim)) { - XYZ temppoint1, temppoint2, tempforward; + XYZ temppoint1, temppoint2; float distance; temppoint1 = jointPos(righthand); @@ -6264,7 +6263,7 @@ int Person::DrawSkeleton() weapons[i].rotation1 = 360 - weapons[i].rotation1; } if ((animCurrent == knifeslashreversalanim && animTarget == knifeslashreversalanim) || (animCurrent == knifeslashreversedanim && animTarget == knifeslashreversedanim)) { - XYZ temppoint1, temppoint2, tempforward; + XYZ temppoint1, temppoint2; float distance; temppoint1 = jointPos(righthand); @@ -6308,7 +6307,7 @@ int Person::DrawSkeleton() weapons[i].rotation3 = 0; } if ((animTarget == swordgroundstabanim && animCurrent == swordgroundstabanim) || (animTarget == swordsneakattackanim && animCurrent == swordsneakattackanim) || (animTarget == swordslashparryanim && animCurrent == swordslashparryanim) || (animTarget == swordslashparriedanim && animCurrent == swordslashparriedanim) || (animTarget == swordslashreversalanim && animCurrent == swordslashreversalanim) || (animTarget == swordslashreversedanim && animCurrent == swordslashreversedanim) || (animTarget == knifeslashreversalanim && animCurrent == knifeslashreversalanim) || (animTarget == knifeslashreversedanim && animCurrent == knifeslashreversedanim) || (animTarget == swordslashanim && animCurrent == swordslashanim) || (animTarget == drawleftanim && animCurrent == drawleftanim) || (animCurrent == backhandspringanim && animTarget == backhandspringanim)) { - XYZ temppoint1, temppoint2, tempforward; + XYZ temppoint1, temppoint2; float distance; temppoint1 = animation[animCurrent].position[skeleton.jointlabels[righthand]][frameCurrent] * (1 - target) + animation[animTarget].position[skeleton.jointlabels[righthand]][frameTarget] * (target); //jointPos(righthand); @@ -6331,7 +6330,7 @@ int Person::DrawSkeleton() weapons[i].smallrotation = 100; weapons[i].smallrotation2 = 0; if ((animTarget == staffhitanim && animCurrent == staffhitanim) || (animTarget == staffhitreversedanim && animCurrent == staffhitreversedanim) || (animTarget == staffspinhitreversedanim && animCurrent == staffspinhitreversedanim) || (animTarget == staffgroundsmashanim && animCurrent == staffgroundsmashanim) || (animTarget == staffspinhitanim && animCurrent == staffspinhitanim)) { - XYZ temppoint1, temppoint2, tempforward; + XYZ temppoint1, temppoint2; float distance; temppoint1 = animation[animCurrent].position[skeleton.jointlabels[righthand]][frameCurrent] * (1 - target) + animation[animTarget].position[skeleton.jointlabels[righthand]][frameTarget] * (target); //jointPos(righthand); diff --git a/Source/Quaternions.cpp b/Source/Quaternions.cpp index ebea833..ff1ad71 100644 --- a/Source/Quaternions.cpp +++ b/Source/Quaternions.cpp @@ -280,7 +280,7 @@ bool LineFacet(Vector p1, Vector p2, Vector pa, Vector pb, Vector pc, Vector *p) { static float d; static float denom, mu; - static Vector n, pa1, pa2, pa3; + static Vector n; //Calculate the parameters for the plane n.x = (pb.y - pa.y) * (pc.z - pa.z) - (pb.z - pa.z) * (pc.y - pa.y); @@ -392,7 +392,7 @@ bool LineFacet(XYZ p1, XYZ p2, XYZ pa, XYZ pb, XYZ pc, XYZ *p) { static float d; static float denom, mu; - static XYZ n, pa1, pa2, pa3; + static XYZ n; //Calculate the parameters for the plane n.x = (pb.y - pa.y) * (pc.z - pa.z) - (pb.z - pa.z) * (pc.y - pa.y); @@ -423,7 +423,7 @@ float LineFacetd(XYZ p1, XYZ p2, XYZ pa, XYZ pb, XYZ pc, XYZ *p) { static float d; static float denom, mu; - static XYZ n, pa1, pa2, pa3; + static XYZ n; //Calculate the parameters for the plane n.x = (pb.y - pa.y) * (pc.z - pa.z) - (pb.z - pa.z) * (pc.y - pa.y); @@ -454,7 +454,6 @@ float LineFacetd(XYZ p1, XYZ p2, XYZ pa, XYZ pb, XYZ pc, XYZ n, XYZ *p) { static float d; static float denom, mu; - static XYZ pa1, pa2, pa3; //Calculate the parameters for the plane d = - n.x * pa.x - n.y * pa.y - n.z * pa.z; @@ -480,7 +479,7 @@ float LineFacetd(XYZ *p1, XYZ *p2, XYZ *pa, XYZ *pb, XYZ *pc, XYZ *p) { static float d; static float denom, mu; - static XYZ pa1, pa2, pa3, n; + static XYZ n; //Calculate the parameters for the plane n.x = (pb->y - pa->y) * (pc->z - pa->z) - (pb->z - pa->z) * (pc->y - pa->y); @@ -511,7 +510,6 @@ float LineFacetd(XYZ *p1, XYZ *p2, XYZ *pa, XYZ *pb, XYZ *pc, XYZ *n, XYZ *p) { static float d; static float denom, mu; - static XYZ pa1, pa2, pa3; //Calculate the parameters for the plane d = - n->x * pa->x - n->y * pa->y - n->z * pa->z; diff --git a/Source/Terrain.cpp b/Source/Terrain.cpp index 8c0335c..af56b86 100644 --- a/Source/Terrain.cpp +++ b/Source/Terrain.cpp @@ -198,7 +198,6 @@ void Terrain::UpdateTransparency(int whichx, int whichy) void Terrain::UpdateTransparencyother(int whichx, int whichy) { - static XYZ vertex; static int i, j, a, b, c, d, patch_size, stepsize; patch_size = size / subdivision; @@ -803,7 +802,7 @@ void Terrain::drawpatchotherother(int whichx, int whichy, float opacity) float Terrain::getHeight(float pointx, float pointz) { static int tilex, tiley; - static XYZ startpoint, endpoint, intersect, triangle[3], average; + static XYZ startpoint, endpoint, intersect, triangle[3]; pointx /= scale; pointz /= scale; diff --git a/Source/Weapons.cpp b/Source/Weapons.cpp index d876320..7b694a1 100644 --- a/Source/Weapons.cpp +++ b/Source/Weapons.cpp @@ -117,7 +117,6 @@ void Weapon::DoStuff(int i) static XYZ point[3]; static XYZ closestpoint; static XYZ closestswordpoint; - static XYZ extramove; static float tempmult; if (owner != -1) { @@ -174,7 +173,7 @@ void Weapon::DoStuff(int i) position = colpoint - normalrot * .2; else if (type == staff) position = colpoint - normalrot * .2; - XYZ temppoint1, temppoint2, tempforward; + XYZ temppoint1, temppoint2; float distance; temppoint1 = 0; @@ -314,7 +313,7 @@ void Weapon::DoStuff(int i) tippoint.z = M[14]; glPopMatrix(); position -= tippoint * .15; - XYZ temppoint1, temppoint2, tempforward; + XYZ temppoint1, temppoint2; rotation3 = 0; smallrotation = 90; @@ -350,7 +349,7 @@ void Weapon::DoStuff(int i) if (velocity.x != 0 || velocity.z != 0 || velocity.y != 0) { velocity.y += gravity * multiplier; - XYZ temppoint1, temppoint2, tempforward; + XYZ temppoint1, temppoint2; float distance; temppoint1 = 0; @@ -824,7 +823,7 @@ void Weapon::DoStuff(int i) tipvelocity.y += gravity * multiplier; //Rotation - XYZ temppoint1, temppoint2, tempforward; + XYZ temppoint1, temppoint2; float distance; temppoint1 = position; diff --git a/Source/openal_wrapper.cpp b/Source/openal_wrapper.cpp index e316da4..0a3d9cb 100644 --- a/Source/openal_wrapper.cpp +++ b/Source/openal_wrapper.cpp @@ -375,7 +375,6 @@ AL_API OPENAL_SAMPLE *OPENAL_Sample_Load(int index, const char *name_or_data, un return NULL; // this is all the game does... OPENAL_SAMPLE *retval = NULL; - ALuint bufferName = 0; ALenum format = AL_NONE; ALsizei size = 0; ALuint frequency = 0;