- Exhumed: converted all #define constants to enums.

This commit is contained in:
Christoph Oelckers 2020-10-11 13:14:32 +02:00
parent 51b48ca124
commit df42230b45
28 changed files with 115 additions and 84 deletions

View file

@ -101,7 +101,7 @@ void FuncFishLimb(int a, int b, int c);
// grenade // grenade
#define kMaxGrenades 50 enum { kMaxGrenades = 50 };
void InitGrenades(); void InitGrenades();
int BuildGrenade(int nPlayer); int BuildGrenade(int nPlayer);
@ -111,7 +111,7 @@ void FuncGrenade(int, int, int);
// gun // gun
#define kMaxWeapons 7 enum { kMaxWeapons = 7 };
enum enum
{ {
@ -255,7 +255,7 @@ void SetQuake(short nSprite, int nVal);
// mummy // mummy
#define kMaxMummies 150 enum { kMaxMummies = 150 };
void InitMummy(); void InitMummy();
int BuildMummy(int val, int x, int y, int z, int nSector, int nAngle); int BuildMummy(int val, int x, int y, int z, int nSector, int nAngle);
@ -263,9 +263,12 @@ void FuncMummy(int nSector, int edx, int nRun);
// object // object
#define kMaxPoints 1024 enum
#define kMaxSlides 128 {
#define kMaxElevs 1024 kMaxPoints = 1024,
kMaxSlides = 128,
kMaxElevs = 1024
};
enum kStatus enum kStatus
{ {
@ -366,8 +369,11 @@ void FuncRoach(int a, int nDamage, int nRun);
// runlist // runlist
#define kMaxRuns 25600 enum
#define kMaxChannels 4096 {
kMaxRuns = 25600,
kMaxChannels = 4096
};
struct RunStruct struct RunStruct
{ {
@ -438,7 +444,7 @@ void FuncSet(int, int, int);
// snake // snake
#define kSnakeSprites 8 // or rename to kSnakeParts? enum { kSnakeSprites = 8 }; // or rename to kSnakeParts?
// 32bytes // 32bytes
struct Snake struct Snake
@ -480,8 +486,11 @@ void FuncSpider(int a, int b, int nRun);
// switch // switch
#define kMaxLinks 1024 enum
#define kMaxSwitches 1024 {
kMaxLinks = 1024,
kMaxSwitches = 1024
};
void InitLink(); void InitLink();
void InitSwitch(); void InitSwitch();
@ -516,7 +525,7 @@ void FuncWasp(int eax, int edx, int nRun);
#define kMessageMask 0x7F0000 enum { kMessageMask = 0x7F0000 };
inline int GrabTimeSlot(int nVal) { return -1; } inline int GrabTimeSlot(int nVal) { return -1; }
END_PS_NS END_PS_NS

View file

@ -25,7 +25,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_PS_NS BEGIN_PS_NS
#define kMaxAnims 400 enum { kMaxAnims = 400 };
short nMagicSeq = -1; short nMagicSeq = -1;
short nPreMagicSeq = -1; short nPreMagicSeq = -1;

View file

@ -25,7 +25,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_PS_NS BEGIN_PS_NS
#define kMaxAnubis 80 enum { kMaxAnubis = 80 };
struct Anubis struct Anubis
{ {

View file

@ -26,8 +26,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_PS_NS BEGIN_PS_NS
#define kMaxBubbles 200 enum
#define kMaxMachines 125 {
kMaxBubbles = 200,
kMaxMachines = 125
};
struct Bubble struct Bubble
{ {

View file

@ -34,7 +34,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_PS_NS BEGIN_PS_NS
#define kMaxBullets 500 enum { kMaxBullets = 500 };
short BulletFree[kMaxBullets]; short BulletFree[kMaxBullets];

View file

@ -24,22 +24,20 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_PS_NS BEGIN_PS_NS
#define kMaxSprites 4096
#define kMaxSectors 1024
#define kMaxWalls 8192
#define kMaxVoxels 4096
enum enum
{ {
kStatIgnited = 404 kStatIgnited = 404,
kMaxSprites = 4096,
kMaxSectors = 1024,
kMaxWalls = 8192,
kMaxVoxels = 4096,
kMaxPalookups = 256,
kMaxStatus = 1024,
kMap20 = 20,
kAngleMask = 0x7FF
}; };
#define kMaxPalookups 256
#define kMaxStatus 1024
//#define MAXPSKYTILES 256
int movesprite(short spritenum, int dx, int dy, int dz, int ceildist, int flordist, unsigned int clipmask); int movesprite(short spritenum, int dx, int dy, int dz, int ceildist, int flordist, unsigned int clipmask);
void precache(); void precache();
void resettiming(); void resettiming();
@ -52,7 +50,6 @@ bool CDplaying();
void StopCD(); void StopCD();
// init // init
#define kMap20 20
enum { enum {
kSectUnderwater = 0x2000, kSectUnderwater = 0x2000,
@ -123,7 +120,6 @@ int RandomSize(int nSize);
// trigdat // trigdat
#define kAngleMask 0x7FF
int GetMyAngle(int x, int y); int GetMyAngle(int x, int y);

View file

@ -35,7 +35,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_PS_NS BEGIN_PS_NS
#define kTimerTicks 120 enum { kTimerTicks = 120 };
enum basepal_t { enum basepal_t {
BASEPAL = 0, BASEPAL = 0,

View file

@ -25,8 +25,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_PS_NS BEGIN_PS_NS
#define kMaxFishes 128 enum
#define kMaxChunks 128 {
kMaxFishes = 128,
kMaxChunks = 128
};
short FishCount = 0; short FishCount = 0;

View file

@ -25,7 +25,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_PS_NS BEGIN_PS_NS
#define kMaxLavas 20 enum { kMaxLavas = 20 };
struct Lava struct Lava
{ {

View file

@ -27,7 +27,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_PS_NS BEGIN_PS_NS
#define kMaxGrads 12 enum { kMaxGrads = 12 };
const char *GradList[kMaxGrads] = { const char *GradList[kMaxGrads] = {
"normal.rmp", "normal.rmp",

View file

@ -26,11 +26,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_PS_NS BEGIN_PS_NS
#define kMaxFlashes 2000 enum
#define kMaxFlickerMask 25 {
#define kMaxGlows 50 kMaxFlashes = 2000,
#define kMaxFlickers 100 kMaxFlickerMask = 25,
#define kMaxFlows 375 kMaxGlows = 50,
kMaxFlickers = 100,
kMaxFlows = 375,
};
struct Flash struct Flash
{ {

View file

@ -25,7 +25,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_PS_NS BEGIN_PS_NS
#define kMaxLions 40 enum { kMaxLions = 40 };
short LionCount = -1; short LionCount = -1;
short MoveHook[kMaxLions]; short MoveHook[kMaxLions];

View file

@ -42,8 +42,11 @@ short nBodySprite[50];
int hihit, sprceiling, sprfloor, lohit; int hihit, sprceiling, sprfloor, lohit;
#define kMaxPushBlocks 100 enum
#define kMaxMoveChunks 75 {
kMaxPushBlocks = 100,
kMaxMoveChunks = 75
};
// think this belongs in init.c? // think this belongs in init.c?
BlockInfo sBlockInfo[kMaxPushBlocks]; BlockInfo sBlockInfo[kMaxPushBlocks];

View file

@ -30,16 +30,18 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_PS_NS BEGIN_PS_NS
#define kMaxBobs 200 enum
#define kMaxDrips 50 {
#define kMaxMoveSects 50 kMaxBobs = 200,
#define kMaxObjects 128 kMaxDrips = 50,
#define kMaxWallFace 4096 kMaxMoveSects = 50,
#define kMaxSlideData 128 kMaxObjects = 128,
#define kMaxPoints 1024 kMaxWallFace = 4096,
#define kMaxTraps 40 kMaxSlideData = 128,
#define kMaxTrails 20 kMaxTraps = 40,
#define kMaxTrailPoints 100 kMaxTrails = 20,
kMaxTrailPoints = 100,
};
static short ObjectSeq[] = { static short ObjectSeq[] = {

View file

@ -33,10 +33,13 @@ void RestartPlayer(short nPlayer);
void FuncPlayer(int nSector, int nSprite, int nRun); void FuncPlayer(int nSector, int nSprite, int nRun);
#define kMaxPlayers 8 enum
#define kDefaultLives 3 {
#define kMaxPlayerLives 5 kMaxPlayers = 8,
#define kMaxHealth 800 kDefaultLives = 3,
kMaxPlayerLives = 5,
kMaxHealth = 800
}
extern int nLocalPlayer; extern int nLocalPlayer;

View file

@ -27,9 +27,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_PS_NS BEGIN_PS_NS
#define kMaxQueens 1 enum
#define kMaxEggs 10 {
#define kMaxTails 7 kMaxQueens = 1,
kMaxEggs = 10,
kMaxTails = 7
};
short QueenCount = 0; short QueenCount = 0;

View file

@ -25,7 +25,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_PS_NS BEGIN_PS_NS
#define kMaxRats 50 enum { kMaxRats = 50 };
short nMinChunk; short nMinChunk;
short nPlayerPic; short nPlayerPic;

View file

@ -26,7 +26,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_PS_NS BEGIN_PS_NS
#define kMaxRex 50 enum { kMaxRex = 50 };
short RexCount = 0; short RexCount = 0;
short RexChan[kMaxRex]; short RexChan[kMaxRex];

View file

@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_PS_NS BEGIN_PS_NS
#define kMaxRoach 100 enum { kMaxRoach = 100 };
int16_t RoachCount = -1; int16_t RoachCount = -1;

View file

@ -25,9 +25,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_PS_NS BEGIN_PS_NS
//#define kFuncMax 0x260000 // the number 38 stored in the high word of an int enum
#define kFuncMax 39 {
#define kMaxRunStack 200 kFuncMax = 39,
kMaxRunStack = 200
};
short RunCount = -1; short RunCount = -1;

View file

@ -29,7 +29,7 @@ BEGIN_PS_NS
Selkis Boss AI code Selkis Boss AI code
*/ */
#define kMaxScorpions 5 enum { kMaxScorpions = 5 };
short ScorpCount = -1; short ScorpCount = -1;

View file

@ -32,10 +32,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_PS_NS BEGIN_PS_NS
#define kMaxSequences 4096 enum
#define kMaxSEQFiles 78 {
#define kMaxSEQFrames 18000 kMaxSequences = 4096,
#define kMaxSEQChunks 21000 kMaxSEQFiles = 78,
kMaxSEQFrames = 18000,
kMaxSEQChunks = 21000
};
short sequences = 0; short sequences = 0;
short frames = 0; short frames = 0;

View file

@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_PS_NS BEGIN_PS_NS
#define kMaxSets 10 enum { kMaxSets = 10};
short SetCount = 0; short SetCount = 0;

View file

@ -29,7 +29,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_PS_NS BEGIN_PS_NS
#define kMaxSnakes 50 enum { kMaxSnakes = 50 };
int nSnakeCount = 0; int nSnakeCount = 0;
int nSnakesFree; int nSnakesFree;

View file

@ -22,14 +22,15 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_PS_NS BEGIN_PS_NS
#define kMaxSoundFiles 80 enum
#define kMaxSounds 200 {
#define kMaxSoundNameLen 8 kMaxSoundFiles = 80,
#define kMaxActiveSounds 8 kMaxSounds = 200,
kMaxSoundNameLen = 8,
#define kCreepyCount 150 kMaxActiveSounds = 8,
kCreepyCount = 150,
#define MUSIC_ID (-65536) MUSIC_ID = (-65536)
};
enum { enum {
kSound0 = 0, kSound0 = 0,

View file

@ -27,7 +27,7 @@ BEGIN_PS_NS
short SpiderCount = 0; short SpiderCount = 0;
#define kMaxSpiders 100 enum { kMaxSpiders = 100 };
struct Spider struct Spider
{ {

View file

@ -59,7 +59,7 @@ short enemy;
short nEnemyPal = 0; short nEnemyPal = 0;
#define MAXINTERPOLATIONS MAXSPRITES enum { MAXINTERPOLATIONS = MAXSPRITES };
int32_t g_interpolationCnt; int32_t g_interpolationCnt;
int32_t oldipos[MAXINTERPOLATIONS]; int32_t oldipos[MAXINTERPOLATIONS];
int32_t* curipos[MAXINTERPOLATIONS]; int32_t* curipos[MAXINTERPOLATIONS];

View file

@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_PS_NS BEGIN_PS_NS
#define kMaxWasps 100 enum { kMaxWasps = 100 };
static short nWaspVelShift = 0; static short nWaspVelShift = 0;
short nWaspCount; short nWaspCount;