- deleted some unused global variables, code simplification plus extended wall index field in Trap

Todo: give fields more meaningful names!
This commit is contained in:
Christoph Oelckers 2021-11-18 00:59:59 +01:00
parent c1c59006bc
commit 33a3e0d8bf
4 changed files with 3 additions and 27 deletions

View file

@ -108,13 +108,10 @@ short nAlarmTicks;
short nButtonColor; short nButtonColor;
short nEnergyChan; short nEnergyChan;
short bModemPlay = false;
int lCountDown = 0; int lCountDown = 0;
short nEnergyTowers = 0; short nEnergyTowers = 0;
short nCfgNetPlayers = 0; short nCfgNetPlayers = 0;
FILE *vcrfp = NULL;
int lLocalCodes = 0; int lLocalCodes = 0;
@ -122,12 +119,6 @@ short bCoordinates = false;
int nNetTime = -1; int nNetTime = -1;
short nCodeMin = 0;
short nCodeMax = 0;
short nCodeIndex = 0;
//short nScreenWidth = 320;
//short nScreenHeight = 200;
int flash; int flash;
int totalmoves; int totalmoves;
@ -135,14 +126,9 @@ short nCurBodyNum = 0;
short nBodyTotal = 0; short nBodyTotal = 0;
short lastfps;
short nTotalPlayers = 1; short nTotalPlayers = 1;
// TODO: Rename this (or make it static) so it doesn't conflict with library function // 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 bSnakeCam = false;
short bRecord = false; short bRecord = false;

View file

@ -130,8 +130,6 @@ extern short nButtonColor;
extern short nHeadStage; extern short nHeadStage;
extern short lastfps;
extern int flash; extern int flash;
extern short nSnakeCam; extern short nSnakeCam;

View file

@ -174,7 +174,6 @@ void InitLevel(MapRecord* map)
InitPlayerKeys(i); InitPlayerKeys(i);
} }
EndLevel = 0; EndLevel = 0;
lastfps = 0;
ResetView(); ResetView();
ResetEngine(); ResetEngine();
totalmoves = 0; totalmoves = 0;

View file

@ -154,7 +154,7 @@ struct Trap
short field_0; short field_0;
short nType; short nType;
short field_6; int field_6;
int field_8; // wallnum int field_8; // wallnum
short field_A; short field_A;
short field_C; short field_C;
@ -2612,15 +2612,8 @@ void PostProcess()
if (i != j && SectSpeed[j] && !(SectFlag[i] & kSectLava)) if (i != j && SectSpeed[j] && !(SectFlag[i] & kSectLava))
{ {
int xVal = wall[sector[i].wallptr].x - wall[sector[j].wallptr].x; int xVal = abs(sector[i].firstWall()->x - sector[j].firstWall()->x);
if (xVal < 0) { int yVal = abs(sector[i].firstWall()->y - sector[j].firstWall()->y);
xVal = -xVal;
}
int yVal = wall[sector[i].wallptr].x - wall[sector[j].wallptr].x;
if (yVal < 0) {
yVal = -yVal;
}
if (xVal < 15000 && yVal < 15000 && (xVal + yVal < var_20)) if (xVal < 15000 && yVal < 15000 && (xVal + yVal < var_20))
{ {