Skip to content

Commit

Permalink
FITD: Removed three global variables
Browse files Browse the repository at this point in the history
  • Loading branch information
klusark committed Feb 8, 2012
1 parent c02752a commit 913982f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 18 deletions.
16 changes: 6 additions & 10 deletions src/track.cpp
Expand Up @@ -170,7 +170,7 @@ int32 makeProportional(int32 x1, int32 x2, int32 y1, int32 y2) {
return x1 + ((x2 - x1) * y2) / y1;
}

int32 computeAngleModificatorToPositionSub1(int32 ax) {
int32 computeAngleModificatorToPositionSub1(int32 ax, int32 angleCompX, int32 angleCompZ) {
int32 xOut;
int32 yOut;

Expand All @@ -191,18 +191,14 @@ int32 computeAngleModificatorToPositionSub1(int32 ax) {
}

int32 computeAngleModificatorToPosition(int32 x1, int32 z1, int32 beta, int32 x2, int32 z2) {
int32 resultMin;
int32 resultMax;
int32 angleCompX = x2 - x1;
int32 angleCompZ = z2 - z1;

angleCompX = x2 - x1;
angleCompZ = z2 - z1;
angleCompBeta = beta;

resultMin = computeAngleModificatorToPositionSub1(beta - 4);
resultMax = computeAngleModificatorToPositionSub1(beta + 4);
int32 resultMin = computeAngleModificatorToPositionSub1(beta - 4, angleCompX, angleCompZ);
int32 resultMax = computeAngleModificatorToPositionSub1(beta + 4, angleCompX, angleCompZ);

if(resultMax == -1 && resultMin == 1) { // in the middle
return(computeAngleModificatorToPositionSub1(beta));
return(computeAngleModificatorToPositionSub1(beta, angleCompX, angleCompZ));
} else {
return(((resultMax + resultMin) + 1) >> 1);
}
Expand Down
4 changes: 0 additions & 4 deletions src/vars.cpp
Expand Up @@ -191,10 +191,6 @@ int16 renderPointList[6400];
int32 numActorInList;
int32 sortedActorTable[NUM_MAX_ACTOR];

int32 angleCompX;
int32 angleCompZ;
int32 angleCompBeta;

int32 bufferAnimCounter = 0;

int32 animMoveX;
Expand Down
4 changes: 0 additions & 4 deletions src/vars.h
Expand Up @@ -335,10 +335,6 @@ extern int16 renderPointList[6400];
extern int32 numActorInList;
extern int32 sortedActorTable[NUM_MAX_ACTOR];

extern int32 angleCompX;
extern int32 angleCompZ;
extern int32 angleCompBeta;

extern int32 bufferAnimCounter;

extern int32 animMoveX;
Expand Down

0 comments on commit 913982f

Please sign in to comment.