Skip to content

Commit

Permalink
FITD: Moved some globals out of vars
Browse files Browse the repository at this point in the history
  • Loading branch information
klusark committed Feb 8, 2012
1 parent ff0b5b6 commit 525b288
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 33 deletions.
17 changes: 13 additions & 4 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,19 @@ int input5;

enumCVars *currentCVarTable = NULL;

struct messageStruct {
textEntryStruct *string;
int16 time;
};

struct regularTextEntryStruct {
char *textPtr;
int16 width;
};

regularTextEntryStruct textTable[40];
messageStruct messageTable[NUM_MAX_MESSAGE];

int getCVarsIdx(enumCVars searchedType) { // TODO: optimize by reversing the table....
return g_fitd->getCVarsIdx(searchedType);

Expand Down Expand Up @@ -870,7 +883,6 @@ void setupSMCode(int centerX, int centerY, int x, int y, int z) {
cameraZ = z;
}


void updateAllActorAndObjectsSub1(int index) { // remove actor
actorStruct *actorPtr = &actorTable[index];

Expand Down Expand Up @@ -1282,7 +1294,6 @@ void updateAllActorAndObjectsAITD2() {
//TODO: object update
}


void updateAllActorAndObjects() {
int i;
actorStruct *currentActor = actorTable;
Expand Down Expand Up @@ -1448,8 +1459,6 @@ void createActorList() {
}
}



int16 computeDistanceToPoint(int x1, int z1, int x2, int z2) {
int axBackup = x1;
x1 -= x2;
Expand Down
6 changes: 6 additions & 0 deletions src/save.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@

namespace Fitd {

struct saveEntry {
void *ptr;
uint32 size;
};

unsigned int currentSaveEntrySize;
saveEntry saveTable[40];

void *getSaveEntry(int index) {
currentSaveEntrySize = saveTable[index].size;
Expand Down
6 changes: 0 additions & 6 deletions src/vars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ char button;

char languageNameString[20] = "";

regularTextEntryStruct textTable[NUM_MAX_TEXT];

int32 readVar;

char *screenSm1;
Expand All @@ -100,8 +98,6 @@ int16 *vars;

int32 varSize;

messageStruct messageTable[NUM_MAX_MESSAGE];

int16 currentMusic;
int32 action;

Expand Down Expand Up @@ -241,8 +237,6 @@ const char *listAnimSelect[] = {
"LISTANI2",
};

saveEntry saveTable[40];

int32 mainVar3 = 4000;
int32 mainVar2 = -2000;

Expand Down
23 changes: 0 additions & 23 deletions src/vars.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,6 @@ struct point3dStruct {
int16 z;
};

struct textEntryStruct;

struct messageStruct {
textEntryStruct *string;
int16 time;
};

struct saveEntry {
void *ptr;
uint32 size;
};

struct regularTextEntryStruct {
char *textPtr;
int16 width;
};

struct ZVStruct {
int32 ZVX1;
int32 ZVX2;
Expand Down Expand Up @@ -216,8 +199,6 @@ extern char button;

extern char languageNameString[];

extern regularTextEntryStruct textTable[40];

extern int32 readVar;

extern char *screenSm1;
Expand All @@ -244,8 +225,6 @@ extern int16 *vars;

extern int32 varSize;

extern messageStruct messageTable[5];

extern int16 currentMusic;
extern int32 action;

Expand Down Expand Up @@ -377,8 +356,6 @@ extern int16 hardColVar2;

extern ZVStruct hardClip;

extern saveEntry saveTable[];

extern int32 mainVar3;
extern int32 mainVar2;

Expand Down

0 comments on commit 525b288

Please sign in to comment.