- 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
#define kMaxGrenades 50
enum { kMaxGrenades = 50 };
void InitGrenades();
int BuildGrenade(int nPlayer);
@ -111,7 +111,7 @@ void FuncGrenade(int, int, int);
// gun
#define kMaxWeapons 7
enum { kMaxWeapons = 7 };
enum
{
@ -255,7 +255,7 @@ void SetQuake(short nSprite, int nVal);
// mummy
#define kMaxMummies 150
enum { kMaxMummies = 150 };
void InitMummy();
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
#define kMaxPoints 1024
#define kMaxSlides 128
#define kMaxElevs 1024
enum
{
kMaxPoints = 1024,
kMaxSlides = 128,
kMaxElevs = 1024
};
enum kStatus
{
@ -366,8 +369,11 @@ void FuncRoach(int a, int nDamage, int nRun);
// runlist
#define kMaxRuns 25600
#define kMaxChannels 4096
enum
{
kMaxRuns = 25600,
kMaxChannels = 4096
};
struct RunStruct
{
@ -438,7 +444,7 @@ void FuncSet(int, int, int);
// snake
#define kSnakeSprites 8 // or rename to kSnakeParts?
enum { kSnakeSprites = 8 }; // or rename to kSnakeParts?
// 32bytes
struct Snake
@ -480,8 +486,11 @@ void FuncSpider(int a, int b, int nRun);
// switch
#define kMaxLinks 1024
#define kMaxSwitches 1024
enum
{
kMaxLinks = 1024,
kMaxSwitches = 1024
};
void InitLink();
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; }
END_PS_NS

View file

@ -25,7 +25,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_PS_NS
#define kMaxAnims 400
enum { kMaxAnims = 400 };
short nMagicSeq = -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
#define kMaxAnubis 80
enum { kMaxAnubis = 80 };
struct Anubis
{

View file

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

View file

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

View file

@ -24,22 +24,20 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_PS_NS
#define kMaxSprites 4096
#define kMaxSectors 1024
#define kMaxWalls 8192
#define kMaxVoxels 4096
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);
void precache();
void resettiming();
@ -52,7 +50,6 @@ bool CDplaying();
void StopCD();
// init
#define kMap20 20
enum {
kSectUnderwater = 0x2000,
@ -123,7 +120,6 @@ int RandomSize(int nSize);
// trigdat
#define kAngleMask 0x7FF
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
#define kTimerTicks 120
enum { kTimerTicks = 120 };
enum basepal_t {
BASEPAL = 0,

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_PS_NS
#define kMaxRoach 100
enum { kMaxRoach = 100 };
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
//#define kFuncMax 0x260000 // the number 38 stored in the high word of an int
#define kFuncMax 39
#define kMaxRunStack 200
enum
{
kFuncMax = 39,
kMaxRunStack = 200
};
short RunCount = -1;

View file

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

View file

@ -32,10 +32,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_PS_NS
#define kMaxSequences 4096
#define kMaxSEQFiles 78
#define kMaxSEQFrames 18000
#define kMaxSEQChunks 21000
enum
{
kMaxSequences = 4096,
kMaxSEQFiles = 78,
kMaxSEQFrames = 18000,
kMaxSEQChunks = 21000
};
short sequences = 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
#define kMaxSets 10
enum { kMaxSets = 10};
short SetCount = 0;

View file

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

View file

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

View file

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

View file

@ -59,7 +59,7 @@ short enemy;
short nEnemyPal = 0;
#define MAXINTERPOLATIONS MAXSPRITES
enum { MAXINTERPOLATIONS = MAXSPRITES };
int32_t g_interpolationCnt;
int32_t oldipos[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
#define kMaxWasps 100
enum { kMaxWasps = 100 };
static short nWaspVelShift = 0;
short nWaspCount;