Skip to content

Commit

Permalink
- deleted some unused global variables, code simplification plus exte…
Browse files Browse the repository at this point in the history
…nded wall index field in Trap

Todo: give fields more meaningful names!
  • Loading branch information
coelckers committed Nov 21, 2021
1 parent 1d98470 commit 73e3960
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 27 deletions.
14 changes: 0 additions & 14 deletions source/games/exhumed/src/exhumed.cpp
Expand Up @@ -108,41 +108,27 @@ short nAlarmTicks;
short nButtonColor;
short nEnergyChan;


short bModemPlay = false;
int lCountDown = 0;
short nEnergyTowers = 0;

short nCfgNetPlayers = 0;
FILE *vcrfp = NULL;

int lLocalCodes = 0;

short bCoordinates = false;

int nNetTime = -1;

short nCodeMin = 0;
short nCodeMax = 0;
short nCodeIndex = 0;

//short nScreenWidth = 320;
//short nScreenHeight = 200;
int flash;
int totalmoves;

short nCurBodyNum = 0;

short nBodyTotal = 0;

short lastfps;
short nTotalPlayers = 1;
// TODO: Rename this (or make it static) so it doesn't conflict with library function
//short socket = 0;

short nFirstPassword = 0;
short nFirstPassInfo = 0;
short nPasswordCount = 0;

short bSnakeCam = false;
short bRecord = false;
Expand Down
2 changes: 0 additions & 2 deletions source/games/exhumed/src/exhumed.h
Expand Up @@ -130,8 +130,6 @@ extern short nButtonColor;

extern short nHeadStage;

extern short lastfps;

extern int flash;

extern short nSnakeCam;
Expand Down
1 change: 0 additions & 1 deletion source/games/exhumed/src/init.cpp
Expand Up @@ -174,7 +174,6 @@ void InitLevel(MapRecord* map)
InitPlayerKeys(i);
}
EndLevel = 0;
lastfps = 0;
ResetView();
ResetEngine();
totalmoves = 0;
Expand Down
13 changes: 3 additions & 10 deletions source/games/exhumed/src/object.cpp
Expand Up @@ -154,7 +154,7 @@ struct Trap

short field_0;
short nType;
short field_6;
int field_6;
int field_8; // wallnum
short field_A;
short field_C;
Expand Down Expand Up @@ -2612,15 +2612,8 @@ void PostProcess()

if (i != j && SectSpeed[j] && !(SectFlag[i] & kSectLava))
{
int xVal = wall[sector[i].wallptr].x - wall[sector[j].wallptr].x;
if (xVal < 0) {
xVal = -xVal;
}

int yVal = wall[sector[i].wallptr].x - wall[sector[j].wallptr].x;
if (yVal < 0) {
yVal = -yVal;
}
int xVal = abs(sector[i].firstWall()->x - sector[j].firstWall()->x);
int yVal = abs(sector[i].firstWall()->y - sector[j].firstWall()->y);

if (xVal < 15000 && yVal < 15000 && (xVal + yVal < var_20))
{
Expand Down

0 comments on commit 73e3960

Please sign in to comment.