Skip to content

Commit

Permalink
pad enums to int size and change optimation to 2
Browse files Browse the repository at this point in the history
  • Loading branch information
elhobbs committed Dec 15, 2019
1 parent 5406552 commit 3761b5e
Show file tree
Hide file tree
Showing 16 changed files with 87 additions and 42 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export OUTPUT_FORMAT ?= 3dsx
#---------------------------------------------------------------------------------
ARCH := -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft

CFLAGS := -g -Wall -O3 -mword-relocations \
CFLAGS := -g -Wall -O2 -mword-relocations \
-fomit-frame-pointer -ffunction-sections \
$(ARCH)

Expand Down
Binary file modified hexen.3ds
Binary file not shown.
Binary file modified hexen.3dsx
Binary file not shown.
Binary file modified hexen.cia
Binary file not shown.
48 changes: 32 additions & 16 deletions include/H2DEF.H
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ typedef enum
sk_easy,
sk_medium,
sk_hard,
sk_nightmare
sk_nightmare,
sk_maxint=0xffffffff
} skill_t;

typedef enum
Expand All @@ -183,7 +184,8 @@ typedef enum
ev_mouse,
ev_joystick,
ev_nub,
ev_cstick
ev_cstick,
ev_maxint = 0xffffffff
} evtype_t;

typedef struct
Expand Down Expand Up @@ -231,7 +233,8 @@ typedef enum
GS_LEVEL,
GS_INTERMISSION,
GS_FINALE,
GS_DEMOSCREEN
GS_DEMOSCREEN,
GS__maxint = 0xffffffff
} gamestate_t;

typedef enum
Expand All @@ -248,7 +251,8 @@ typedef enum
ga_singlereborn,
ga_victory,
ga_worlddone,
ga_screenshot
ga_screenshot,
ga_maxint = 0xffffffff
} gameaction_t;

typedef enum
Expand All @@ -259,7 +263,8 @@ typedef enum
wipe_3,
wipe_4,
NUMWIPES,
wipe_random
wipe_random,
wipe_maxint = 0xffffffff
} wipe_t;

/*
Expand Down Expand Up @@ -439,14 +444,16 @@ typedef enum
PCLASS_CLERIC,
PCLASS_MAGE,
PCLASS_PIG,
NUMCLASSES
NUMCLASSES,
PCLASS_maxint = 0xffffffff
} pclass_t;

typedef enum
{
PST_LIVE, // playing
PST_DEAD, // dead on the ground
PST_REBORN // ready to restart
PST_REBORN, // ready to restart,
PST_maxint = 0xffffffff
} playerstate_t;

// psprites are scaled shapes directly on the view screen
Expand All @@ -455,7 +462,8 @@ typedef enum
{
ps_weapon,
ps_flash,
NUMPSPRITES
NUMPSPRITES,
ps_maxint = 0xffffffff
} psprnum_t;

typedef struct
Expand Down Expand Up @@ -488,7 +496,8 @@ typedef enum
KEYTYPE_9,
KEYTYPE_A,
KEYTYPE_B,
NUMKEYS
NUMKEYS,
KEYTYPE_maxint = 0xffffffff
} keytype_t;

typedef enum
Expand All @@ -497,7 +506,8 @@ typedef enum
ARMOR_SHIELD,
ARMOR_HELMET,
ARMOR_AMULET,
NUMARMOR
NUMARMOR,
ARMOR_maxint = 0xffffffff
} armortype_t;

typedef enum
Expand All @@ -507,7 +517,8 @@ typedef enum
WP_THIRD,
WP_FOURTH,
NUMWEAPONS,
WP_NOCHANGE
WP_NOCHANGE,
WP_maxint = 0xffffffff
} weapontype_t;

typedef enum
Expand All @@ -516,7 +527,8 @@ typedef enum
MANA_2,
NUMMANA,
MANA_BOTH,
MANA_NONE
MANA_NONE,
MANA_maxint = 0xffffffff
} manatype_t;

#define MAX_MANA 200
Expand Down Expand Up @@ -575,7 +587,8 @@ typedef enum
arti_puzzgear2,
arti_puzzgear3,
arti_puzzgear4,
NUMARTIFACTS
NUMARTIFACTS,
arti_maxint = 0xffffffff
} artitype_t;

typedef enum
Expand All @@ -589,7 +602,8 @@ typedef enum
pw_health2,
pw_speed,
pw_minotaur,
NUMPOWERS
NUMPOWERS,
pw_maxint = 0xffffffff
} powertype_t;

#define INVULNTICS (30*35)
Expand Down Expand Up @@ -1385,7 +1399,8 @@ enum
SEQ_DOOR_EARTH,
SEQ_DOOR_METAL2,
SEQ_ESOUND_WIND,
SEQ_NUMSEQ
SEQ_NUMSEQ,
SEQ_maxint = 0xffffffff
};

typedef enum
Expand All @@ -1400,7 +1415,8 @@ typedef enum
SEQTYPE_ICE,
SEQTYPE_EARTH,
SEQTYPE_METAL2,
SEQTYPE_NUMSEQ
SEQTYPE_NUMSEQ,
SEQTYPE_maxint = 0xffffffff
} seqtype_t;

void SN_InitSequenceScript(void);
Expand Down
9 changes: 6 additions & 3 deletions include/INFO.H
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,8 @@ SPR_RADE,
SPR_WATR,
SPR_KORX,
SPR_ABAT,
NUMSPRITES
NUMSPRITES,
SPR_maxint=0xffffffff
} spritenum_t;

typedef enum {
Expand Down Expand Up @@ -3151,7 +3152,8 @@ S_BAT1,
S_BAT2,
S_BAT3,
S_BAT_DEATH,
NUMSTATES
NUMSTATES,
S_maxint = 0xffffffff
} statenum_t;

typedef struct
Expand Down Expand Up @@ -3574,7 +3576,8 @@ MT_CENTAUR_MASH,
MT_KORAX_BOLT,
MT_BAT_SPAWNER,
MT_BAT,
NUMMOBJTYPES} mobjtype_t;
NUMMOBJTYPES,
MT_maxint = 0xffffffff} mobjtype_t;

typedef struct {
int doomednum;
Expand Down
10 changes: 7 additions & 3 deletions include/P_LOCAL.H
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ typedef enum
DI_SOUTH,
DI_SOUTHEAST,
DI_NODIR,
NUMDIRS
NUMDIRS,
DI_maxint = 0xffffffff
} dirtype_t;

#define BASETHRESHOLD 100 // follow a player exlusively for 3 seconds
Expand Down Expand Up @@ -120,7 +121,8 @@ enum
FLOOR_LIQUID,
FLOOR_WATER,
FLOOR_LAVA,
FLOOR_SLUDGE
FLOOR_SLUDGE,
FLOOR_maxint = 0xffffffff
};

#define ONFLOORZ MININT
Expand Down Expand Up @@ -312,6 +314,7 @@ typedef enum
PODOOR_NONE,
PODOOR_SLIDE,
PODOOR_SWING,
PODOOR_maxint = 0xffffffff
} podoortype_t;

typedef struct
Expand Down Expand Up @@ -344,7 +347,8 @@ enum
{
PO_ANCHOR_TYPE = 3000,
PO_SPAWN_TYPE,
PO_SPAWNCRUSH_TYPE
PO_SPAWNCRUSH_TYPE,
PO_maxint = 0xffffffff
};

#define PO_LINE_START 1 // polyobj line start special
Expand Down
24 changes: 17 additions & 7 deletions include/P_SPEC.H
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ typedef enum
LITE_FADE,
LITE_GLOW,
LITE_FLICKER,
LITE_STROBE
LITE_STROBE,
LITE_maxint = 0xffffffff
} lighttype_t;

typedef struct
Expand Down Expand Up @@ -202,7 +203,8 @@ typedef enum
{
SWTCH_TOP,
SWTCH_MIDDLE,
SWTCH_BOTTOM
SWTCH_BOTTOM,
SWITCH_maxint = 0xffffffff
} bwhere_e;

typedef struct
Expand Down Expand Up @@ -237,6 +239,7 @@ typedef enum
PLAT_DOWN,
PLAT_WAITING,
// PLAT_IN_STASIS
PLAT_maxint = 0xffffffff
} plat_e;

typedef enum
Expand All @@ -248,6 +251,7 @@ typedef enum
PLAT_UPBYVALUEWAITDOWNSTAY,
//PLAT_RAISEANDCHANGE,
//PLAT_RAISETONEARESTANDCHANGE
platt_maxint = 0xffffffff
} plattype_e;

typedef struct
Expand Down Expand Up @@ -292,6 +296,7 @@ typedef enum
DREV_CLOSE,
DREV_OPEN,
DREV_RAISEIN5MINS,
DREV_maxint = 0xffffffff
} vldoor_e;

typedef struct
Expand Down Expand Up @@ -331,7 +336,8 @@ typedef enum
CLEV_LOWERBYVALUE,
CLEV_RAISEBYVALUE,
CLEV_CRUSHRAISEANDSTAY,
CLEV_MOVETOVALUETIMES8
CLEV_MOVETOVALUETIMES8,
CLEV_maxint = 0xffffffff
} ceiling_e;

typedef struct
Expand Down Expand Up @@ -380,7 +386,8 @@ typedef enum
FLEV_LOWERBYVALUETIMES8,
FLEV_LOWERTIMES8INSTANT,
FLEV_RAISETIMES8INSTANT,
FLEV_MOVETOVALUETIMES8
FLEV_MOVETOVALUETIMES8,
FLEV_maxint = 0xffffffff
} floor_e;

typedef struct
Expand Down Expand Up @@ -436,14 +443,16 @@ typedef enum
{
RES_OK,
RES_CRUSHED,
RES_PASTDEST
RES_PASTDEST,
RES_maxint = 0xffffffff
} result_e;

typedef enum
{
STAIRS_NORMAL,
STAIRS_SYNC,
STAIRS_PHASED
STAIRS_PHASED,
STAIRS_maxint = 0xffffffff
} stairs_e;

result_e T_MovePlane(sector_t *sector, fixed_t speed,
Expand Down Expand Up @@ -491,7 +500,8 @@ typedef enum
ASTE_WAITINGFORTAG,
ASTE_WAITINGFORPOLY,
ASTE_WAITINGFORSCRIPT,
ASTE_TERMINATING
ASTE_TERMINATING,
ASTE_maxint = 0xffffffff
} aste_t;

typedef struct acs_s acs_t;
Expand Down
3 changes: 2 additions & 1 deletion include/R_LOCAL.H
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ typedef enum
ST_HORIZONTAL,
ST_VERTICAL,
ST_POSITIVE,
ST_NEGATIVE
ST_NEGATIVE,
ST_maxint = 0xffffffff
} slopetype_t;

/*
Expand Down
6 changes: 4 additions & 2 deletions include/SOUNDS.H
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ typedef enum
mus_titl,
mus_intr,
mus_cptd,
NUMMUSIC
NUMMUSIC,
mus_maxint = 0xffffffff
} musicenum_t;

// Sound identifiers
Expand Down Expand Up @@ -305,7 +306,8 @@ typedef enum
SFX_FIREBALL,
SFX_PUPPYBEAT,
SFX_MYSTICINCANT,
NUMSFX
NUMSFX,
SFX_maxint = 0xffffffff
} sfxenum_t;

#endif
6 changes: 4 additions & 2 deletions include/XDDEFS.H
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ enum
ML_SECTORS,
ML_REJECT,
ML_BLOCKMAP,
ML_BEHAVIOR
ML_BEHAVIOR,
ML_maxint = 0xffffffff
};

typedef struct
Expand Down Expand Up @@ -134,7 +135,8 @@ enum
BOXTOP,
BOXBOTTOM,
BOXLEFT,
BOXRIGHT
BOXRIGHT,
BOX_maxint = 0xffffffff
};

#define NF_SUBSECTOR 0x8000
Expand Down
3 changes: 2 additions & 1 deletion source/CT_CHAT.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ enum
CT_PLR_PLAYER6,
CT_PLR_PLAYER7,
CT_PLR_PLAYER8,
CT_PLR_ALL
CT_PLR_ALL,
CT_PLR_maxint = 0xffffffff
};

#define CT_KEY_BLUE 'b'
Expand Down
3 changes: 2 additions & 1 deletion source/IN_LUDE.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ typedef enum
{
SINGLE,
COOPERATIVE,
DEATHMATCH
DEATHMATCH,
gametype_maxint = 0xffffffff
} gametype_t;

// EXTERNAL FUNCTION PROTOTYPES --------------------------------------------
Expand Down
Loading

0 comments on commit 3761b5e

Please sign in to comment.