Doom plugin: In anticipation of moving to the EABI toolchain, because of its assumptions about enums being sized as ints, convert enum typdefs to int or unsigned depending upon whether they have negative values in the enumeration. This should effectively preserve the manner in which it is compiled under the old toolchain and avoids having to closely inspect and possibly change many places in the code.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26368 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Michael Sevakis 2010-05-29 08:12:39 +00:00
parent 6980c1e998
commit 9c6e217f29
25 changed files with 260 additions and 191 deletions

View file

@ -194,7 +194,7 @@ int ddt_cheating = 0; // killough 2/7/98: make global, rename to ddt_*
static int leveljuststarted = 1; // kluge until AM_LevelInit() is called static int leveljuststarted = 1; // kluge until AM_LevelInit() is called
enum automapmode_e automapmode; // Mode that the automap is in automapmode_e automapmode; // Mode that the automap is in
// location of window on screen // location of window on screen
static int f_x; static int f_x;

View file

@ -42,13 +42,14 @@
// //
// Input event types. // Input event types.
typedef enum enum
{ {
ev_keydown, ev_keydown,
ev_keyup, ev_keyup,
ev_mouse, ev_mouse,
ev_joystick ev_joystick
} evtype_t; };
typedef int evtype_t;
// Event structure. // Event structure.
typedef struct typedef struct
@ -60,7 +61,7 @@ typedef struct
} event_t; } event_t;
typedef enum enum
{ {
ga_nothing, ga_nothing,
ga_loadlevel, ga_loadlevel,
@ -71,14 +72,15 @@ typedef enum
ga_completed, ga_completed,
ga_victory, ga_victory,
ga_worlddone, ga_worlddone,
} gameaction_t; };
typedef unsigned gameaction_t;
// //
// Button/action code definitions. // Button/action code definitions.
// //
typedef enum enum
{ {
// Press "Fire". // Press "Fire".
BT_ATTACK = 1, BT_ATTACK = 1,
@ -111,7 +113,8 @@ typedef enum
BTS_SAVEMASK = (4+8+16), BTS_SAVEMASK = (4+8+16),
BTS_SAVESHIFT = 2, BTS_SAVESHIFT = 2,
} buttoncode_t; };
typedef unsigned buttoncode_t;
// //

View file

@ -58,12 +58,12 @@
// Networking and tick handling related. // Networking and tick handling related.
#define BACKUPTICS 12 #define BACKUPTICS 12
typedef enum enum
{ {
CMD_SEND = 1, CMD_SEND = 1,
CMD_GET = 2 CMD_GET = 2
};
} command_t; typedef unsigned command_t;
// //
@ -125,11 +125,12 @@ typedef struct
char filler[sizeof(ticcmd_t)*BACKUPTICS-STARTUPLEN]; char filler[sizeof(ticcmd_t)*BACKUPTICS-STARTUPLEN];
} startup_t; } startup_t;
typedef enum { enum {
// Leave space, so low values corresponding to normal netgame setup packets can be ignored // Leave space, so low values corresponding to normal netgame setup packets can be ignored
nm_plcolour = 3, nm_plcolour = 3,
nm_savegamename = 4, nm_savegamename = 4,
} netmisctype_t; };
typedef unsigned netmisctype_t;
typedef struct typedef struct
{ {

View file

@ -58,7 +58,7 @@
// //
// Player states. // Player states.
// //
typedef enum enum
{ {
// Playing or camping. // Playing or camping.
PST_LIVE, PST_LIVE,
@ -67,13 +67,14 @@ typedef enum
// Ready to restart/respawn??? // Ready to restart/respawn???
PST_REBORN PST_REBORN
} playerstate_t; };
typedef unsigned playerstate_t;
// //
// Player internal flags, for cheats and debug. // Player internal flags, for cheats and debug.
// //
typedef enum enum
{ {
// No clipping, walk through barriers. // No clipping, walk through barriers.
CF_NOCLIP = 1, CF_NOCLIP = 1,
@ -82,7 +83,8 @@ typedef enum
// Not really a cheat, just a debug aid. // Not really a cheat, just a debug aid.
CF_NOMOMENTUM = 4 CF_NOMOMENTUM = 4
} cheat_t; };
typedef unsigned cheat_t;
// //

View file

@ -48,30 +48,33 @@ enum { DVERSION = 110 };
// Game mode handling - identify IWAD version // Game mode handling - identify IWAD version
// to handle IWAD dependend animations etc. // to handle IWAD dependend animations etc.
typedef enum { enum {
shareware, // DOOM 1 shareware, E1, M9 shareware, // DOOM 1 shareware, E1, M9
registered, // DOOM 1 registered, E3, M27 registered, // DOOM 1 registered, E3, M27
commercial, // DOOM 2 retail, E1 M34 (DOOM 2 german edition not handled) commercial, // DOOM 2 retail, E1 M34 (DOOM 2 german edition not handled)
retail, // DOOM 1 retail, E4, M36 retail, // DOOM 1 retail, E4, M36
indetermined // Well, no IWAD found. indetermined // Well, no IWAD found.
} GameMode_t; };
typedef unsigned GameMode_t;
// Mission packs - might be useful for TC stuff? // Mission packs - might be useful for TC stuff?
typedef enum { enum {
doom, // DOOM 1 doom, // DOOM 1
doom2, // DOOM 2 doom2, // DOOM 2
pack_tnt, // TNT mission pack pack_tnt, // TNT mission pack
pack_plut, // Plutonia pack pack_plut, // Plutonia pack
none none
} GameMission_t; };
typedef unsigned GameMission_t;
// Identify language to use, software localization. // Identify language to use, software localization.
typedef enum { enum {
english, english,
french, french,
german, german,
unknown unknown
} Language_t; };
typedef unsigned Language_t;
// //
// For resize of screen, at start of game. // For resize of screen, at start of game.
@ -122,12 +125,13 @@ extern int SCREENHEIGHT;
// The current state of the game: whether we are playing, gazing // The current state of the game: whether we are playing, gazing
// at the intermission screen, the game final animation, or a demo. // at the intermission screen, the game final animation, or a demo.
typedef enum { enum {
GS_LEVEL, GS_LEVEL,
GS_INTERMISSION, GS_INTERMISSION,
GS_FINALE, GS_FINALE,
GS_DEMOSCREEN GS_DEMOSCREEN
} gamestate_t; };
typedef unsigned gamestate_t;
// //
// Difficulty/skill settings/filters. // Difficulty/skill settings/filters.
@ -147,20 +151,21 @@ typedef enum {
#define MTF_FRIEND 128 #define MTF_FRIEND 128
#define MTF_RESERVED 256 #define MTF_RESERVED 256
typedef enum { enum {
sk_none=-1, //jff 3/24/98 create unpicked skill setting sk_none=-1, //jff 3/24/98 create unpicked skill setting
sk_baby=0, sk_baby=0,
sk_easy, sk_easy,
sk_medium, sk_medium,
sk_hard, sk_hard,
sk_nightmare sk_nightmare
} skill_t; };
typedef int skill_t;
// //
// Key cards. // Key cards.
// //
typedef enum { enum {
it_bluecard, it_bluecard,
it_yellowcard, it_yellowcard,
it_redcard, it_redcard,
@ -168,11 +173,12 @@ typedef enum {
it_yellowskull, it_yellowskull,
it_redskull, it_redskull,
NUMCARDS NUMCARDS
} card_t; };
typedef unsigned card_t;
// The defined weapons, including a marker // The defined weapons, including a marker
// indicating user has not changed weapon. // indicating user has not changed weapon.
typedef enum { enum {
wp_fist, wp_fist,
wp_pistol, wp_pistol,
wp_shotgun, wp_shotgun,
@ -185,20 +191,23 @@ typedef enum {
NUMWEAPONS, NUMWEAPONS,
wp_nochange // No pending weapon change. wp_nochange // No pending weapon change.
} weapontype_t; };
typedef unsigned weapontype_t;
// Ammunition types defined. // Ammunition types defined.
typedef enum { enum {
am_clip, // Pistol / chaingun ammo. am_clip, // Pistol / chaingun ammo.
am_shell, // Shotgun / double barreled shotgun. am_shell, // Shotgun / double barreled shotgun.
am_cell, // Plasma rifle, BFG. am_cell, // Plasma rifle, BFG.
am_misl, // Missile launcher. am_misl, // Missile launcher.
NUMAMMO, NUMAMMO,
am_noammo // Unlimited for chainsaw / fist. am_noammo // Unlimited for chainsaw / fist.
} ammotype_t; };
typedef unsigned ammotype_t;
// Power up artifacts. // Power up artifacts.
typedef enum { enum {
pw_invulnerability, pw_invulnerability,
pw_strength, pw_strength,
pw_invisibility, pw_invisibility,
@ -206,15 +215,17 @@ typedef enum {
pw_allmap, pw_allmap,
pw_infrared, pw_infrared,
NUMPOWERS NUMPOWERS
} powertype_t; };
typedef unsigned powertype_t;
// Power up durations (how many seconds till expiration). // Power up durations (how many seconds till expiration).
typedef enum { enum {
INVULNTICS = (30*TICRATE), INVULNTICS = (30*TICRATE),
INVISTICS = (60*TICRATE), INVISTICS = (60*TICRATE),
INFRATICS = (120*TICRATE), INFRATICS = (120*TICRATE),
IRONTICS = (60*TICRATE) IRONTICS = (60*TICRATE)
} powerduration_t; };
typedef unsigned powerduration_t;
// //
// DOOM keyboard definition. // DOOM keyboard definition.
@ -289,7 +300,7 @@ typedef enum {
// Defines Setup Screen groups that config variables appear in. // Defines Setup Screen groups that config variables appear in.
// Used when resetting the defaults for every item in a Setup group. // Used when resetting the defaults for every item in a Setup group.
typedef enum { enum {
ss_none, ss_none,
ss_keys, ss_keys,
ss_weap, ss_weap,
@ -301,7 +312,8 @@ typedef enum {
ss_gen, /* killough 10/98 */ ss_gen, /* killough 10/98 */
ss_comp, /* killough 10/98 */ ss_comp, /* killough 10/98 */
ss_max ss_max
} ss_types; };
typedef unsigned ss_types;
// phares 3/20/98: // phares 3/20/98:
// //

View file

@ -52,14 +52,15 @@ extern boolean fastparm; // checkparm of -fast
extern boolean devparm; // DEBUG: launched with -devparm extern boolean devparm; // DEBUG: launched with -devparm
enum automapmode_e { enum {
am_active = 1, // currently shown am_active = 1, // currently shown
am_overlay= 2, // covers the screen, i.e. not overlay mode am_overlay= 2, // covers the screen, i.e. not overlay mode
am_rotate = 4, // rotates to the player facing direction am_rotate = 4, // rotates to the player facing direction
am_follow = 8, // keep the player centred am_follow = 8, // keep the player centred
am_grid =16, // show grid am_grid =16, // show grid
}; };
extern enum automapmode_e automapmode; // Mode that the automap is in typedef int automapmode_e;
extern automapmode_e automapmode; // Mode that the automap is in
// ----------------------------------------------------- // -----------------------------------------------------
// Game Mode - identify IWAD as shareware, retail etc. // Game Mode - identify IWAD as shareware, retail etc.

View file

@ -33,18 +33,9 @@
#define __DOOMTYPE__ #define __DOOMTYPE__
#include "rockmacros.h" #include "rockmacros.h"
#ifndef __BYTEBOOL__
#define __BYTEBOOL__
// Fixed to use builtin bool type with C++. // Fixed to use builtin bool type with C++.
#ifdef __cplusplus typedef unsigned int boolean;
typedef bool boolean;
#else
//typedef enum {false, true} boolean;
//#define boolean bool
typedef enum _boolean { FALSE, TRUE } boolean;
#endif
typedef unsigned char byte; typedef unsigned char byte;
#endif
typedef signed long long int_64_t; typedef signed long long int_64_t;
typedef unsigned long long uint_64_t; typedef unsigned long long uint_64_t;
@ -63,7 +54,7 @@ typedef unsigned long long uint_64_t;
#define MINLONG ((long)0x80000000) #define MINLONG ((long)0x80000000)
/* cph - move compatibility levels here so we can use them in d_server.c */ /* cph - move compatibility levels here so we can use them in d_server.c */
typedef enum { enum {
doom_12_compatibility, /* Behave like early doom versions */ doom_12_compatibility, /* Behave like early doom versions */
doom_demo_compatibility, /* As compatible as possible for doom_demo_compatibility, /* As compatible as possible for
* playing original Doom demos */ * playing original Doom demos */
@ -80,6 +71,7 @@ typedef enum {
/* Aliases follow */ /* Aliases follow */
boom_compatibility = boom_201_compatibility, /* Alias used by G_Compatibility */ boom_compatibility = boom_201_compatibility, /* Alias used by G_Compatibility */
best_compatibility = prboom_3_compatibility, best_compatibility = prboom_3_compatibility,
} complevel_t; };
typedef unsigned complevel_t;
#endif #endif

View file

@ -41,7 +41,7 @@
/******************************************************************** /********************************************************************
* Sprite name enumeration - must match info.c * * Sprite name enumeration - must match info.c *
********************************************************************/ ********************************************************************/
typedef enum enum
{ {
SPR_TROO, SPR_TROO,
SPR_SHTG, SPR_SHTG,
@ -188,13 +188,14 @@ typedef enum
#endif #endif
NUMSPRITES NUMSPRITES
} spritenum_t; };
typedef unsigned spritenum_t;
/******************************************************************** /********************************************************************
* States (frames) enumeration -- must match info.c * * States (frames) enumeration -- must match info.c *
********************************************************************/ ********************************************************************/
typedef enum enum
{ {
S_NULL, S_NULL,
S_LIGHTDONE, S_LIGHTDONE,
@ -1204,7 +1205,8 @@ typedef enum
NUMSTATES /* Counter of how many there are */ NUMSTATES /* Counter of how many there are */
} statenum_t; };
typedef unsigned statenum_t;
/******************************************************************** /********************************************************************
* Definition of the state (frames) structure * * Definition of the state (frames) structure *
@ -1230,7 +1232,7 @@ extern const char *sprnames[NUMSPRITES+1]; /* 1/17/98 killough - CPhipps - const
* Note that many of these are generically named for the ornamentals * Note that many of these are generically named for the ornamentals
*/ */
typedef enum { enum {
MT_PLAYER, MT_PLAYER,
MT_POSSESSED, MT_POSSESSED,
MT_SHOTGUY, MT_SHOTGUY,
@ -1391,7 +1393,8 @@ typedef enum {
MT_STEALTHZOMBIE, MT_STEALTHZOMBIE,
NUMMOBJTYPES NUMMOBJTYPES
} mobjtype_t; };
typedef unsigned mobjtype_t;
/******************************************************************** /********************************************************************
* Definition of the Thing structure * Definition of the Thing structure

View file

@ -246,7 +246,8 @@ enum
readthis, readthis,
quitdoom, quitdoom,
main_end main_end
} main_e; };
unsigned main_e;
menuitem_t MainMenu[]= menuitem_t MainMenu[]=
{ {
@ -280,7 +281,8 @@ enum
ep3, ep3,
ep4, ep4,
ep_end ep_end
} episodes_e; };
unsigned episodes_e;
menuitem_t EpisodeMenu[]= menuitem_t EpisodeMenu[]=
{ {
@ -311,7 +313,8 @@ enum
violence, violence,
nightmare, nightmare,
newg_end newg_end
} newgame_e; };
unsigned newgame_e;
menuitem_t NewGameMenu[]= menuitem_t NewGameMenu[]=
{ {
@ -347,7 +350,8 @@ enum
option_empty2, option_empty2,
soundvol, soundvol,
opt_end opt_end
} options_e; };
unsigned options_e;
menuitem_t OptionsMenu[]= menuitem_t OptionsMenu[]=
{ {
@ -377,7 +381,8 @@ enum
{ {
rdthsempty1, rdthsempty1,
read1_end read1_end
} read_e; };
unsigned read_e;
menuitem_t ReadMenu1[] = menuitem_t ReadMenu1[] =
{ {
@ -398,7 +403,8 @@ enum
{ {
rdthsempty2, rdthsempty2,
read2_end read2_end
} read_e2; };
unsigned read_e2;
menuitem_t ReadMenu2[]= menuitem_t ReadMenu2[]=
{ {
@ -427,7 +433,8 @@ enum
system_vol, system_vol,
sfx_empty3, sfx_empty3,
sound_end sound_end
} sound_e; };
unsigned sound_e;
menuitem_t SoundMenu[]= menuitem_t SoundMenu[]=
{ {
@ -461,7 +468,8 @@ enum
load5, load5,
load6, load6,
load_end load_end
} load_e; };
unsigned load_e;
menuitem_t LoadMenu[]= menuitem_t LoadMenu[]=
{ {

View file

@ -60,13 +60,13 @@ void M_StartControlPanel (void);
* The setup_group enum is used to show which 'groups' keys fall into so * The setup_group enum is used to show which 'groups' keys fall into so
* that you can bind a key differently in each 'group'. * that you can bind a key differently in each 'group'.
*/ */
enum {
typedef enum {
m_null, // Has no meaning; not applicable m_null, // Has no meaning; not applicable
m_scrn, // A key can not be assigned to more than one action m_scrn, // A key can not be assigned to more than one action
m_map, // in the same group. A key can be assigned to one m_map, // in the same group. A key can be assigned to one
m_menu, // action in one group, and another action in another. m_menu, // action in one group, and another action in another.
} setup_group; };
typedef unsigned setup_group;
/**************************** /****************************
* *

View file

@ -61,6 +61,17 @@ struct default_s *M_LookupDefault(const char *name); /* killough 11/98 */
// CPhipps - struct to hold a value in a config file // CPhipps - struct to hold a value in a config file
// Cannot be a union, as it must be initialised // Cannot be a union, as it must be initialised
enum {
def_none, // Dummy entry
def_str, // A string
def_int, // Integer
def_hex, // Integer (write in hex)
def_bool = def_int, // Boolean
def_key = def_hex, // Key code (byte)
def_mouseb = def_int,// Mouse button
def_colour = def_hex // Colour (256 colour palette entry)
}; /* type */
typedef struct default_s typedef struct default_s
{ {
const char* name; const char* name;
@ -84,16 +95,7 @@ typedef struct default_s
// Limits (for an int) // Limits (for an int)
int minvalue; // jff 3/3/98 minimum allowed value int minvalue; // jff 3/3/98 minimum allowed value
int maxvalue; // jff 3/3/98 maximum allowed value int maxvalue; // jff 3/3/98 maximum allowed value
enum { unsigned type; // CPhipps - type of entry
def_none, // Dummy entry
def_str, // A string
def_int, // Integer
def_hex, // Integer (write in hex)
def_bool = def_int, // Boolean
def_key = def_hex, // Key code (byte)
def_mouseb = def_int,// Mouse button
def_colour = def_hex // Colour (256 colour palette entry)
} type; // CPhipps - type of entry
int setupscreen; // phares 4/19/98: setup screen where this appears int setupscreen; // phares 4/19/98: setup screen where this appears
int *current; /* cph - MBF-like pointer to current value */ int *current; /* cph - MBF-like pointer to current value */
// cph - removed the help strings from the config file // cph - removed the help strings from the config file

View file

@ -57,7 +57,7 @@
// indicated by the #'s, because they're critical for preserving demo // indicated by the #'s, because they're critical for preserving demo
// sync. Do not remove entries simply because they become unused later. // sync. Do not remove entries simply because they become unused later.
typedef enum { enum {
pr_skullfly, // #1 pr_skullfly, // #1
pr_damage, // #2 pr_damage, // #2
pr_crush, // #3 pr_crush, // #3
@ -124,7 +124,8 @@ typedef enum {
// End of new entries // End of new entries
NUMPRCLASS // MUST be last item in list NUMPRCLASS // MUST be last item in list
} pr_class_t; };
typedef unsigned pr_class_t;
// The random number generator's state. // The random number generator's state.
typedef struct { typedef struct {

View file

@ -50,7 +50,7 @@
static mobj_t *current_actor; static mobj_t *current_actor;
typedef enum { enum {
DI_EAST, DI_EAST,
DI_NORTHEAST, DI_NORTHEAST,
DI_NORTH, DI_NORTH,
@ -61,7 +61,8 @@ typedef enum {
DI_SOUTHEAST, DI_SOUTHEAST,
DI_NODIR, DI_NODIR,
NUMDIRS NUMDIRS
} dirtype_t; };
typedef unsigned dirtype_t;
void A_Fall(mobj_t *actor); void A_Fall(mobj_t *actor);
void A_FaceTarget(mobj_t *actor); void A_FaceTarget(mobj_t *actor);

View file

@ -65,12 +65,13 @@
* coordinates are given for a 320*200 view screen. * coordinates are given for a 320*200 view screen.
*/ */
typedef enum enum
{ {
ps_weapon, ps_weapon,
ps_flash, ps_flash,
NUMPSPRITES NUMPSPRITES
} psprnum_t; };
typedef unsigned psprnum_t;
typedef struct typedef struct
{ {

View file

@ -248,10 +248,11 @@ void P_UnArchiveWorld (void)
// Thinkers // Thinkers
// //
typedef enum { enum {
tc_end, tc_end,
tc_mobj tc_mobj
} thinkerclass_t; };
typedef unsigned thinkerclass_t;
// phares 9/13/98: Moved this code outside of P_ArchiveThinkers so the // phares 9/13/98: Moved this code outside of P_ArchiveThinkers so the
// thinker indices could be used by the code that saves sector info. // thinker indices could be used by the code that saves sector info.
@ -527,7 +528,8 @@ enum {
tc_pusher, // phares 3/22/98: new push/pull effect thinker tc_pusher, // phares 3/22/98: new push/pull effect thinker
tc_flicker, // killough 10/4/98 tc_flicker, // killough 10/4/98
tc_endspecials tc_endspecials
} specials_e; };
unsigned specials_e;
// //
// Things to handle: // Things to handle:

View file

@ -193,7 +193,7 @@
// define names for the TriggerType field of the general linedefs // define names for the TriggerType field of the general linedefs
typedef enum enum
{ {
WalkOnce, WalkOnce,
WalkMany, WalkMany,
@ -203,21 +203,23 @@ typedef enum
GunMany, GunMany,
PushOnce, PushOnce,
PushMany, PushMany,
} triggertype_e; };
typedef unsigned triggertype_e;
// define names for the Speed field of the general linedefs // define names for the Speed field of the general linedefs
typedef enum enum
{ {
SpeedSlow, SpeedSlow,
SpeedNormal, SpeedNormal,
SpeedFast, SpeedFast,
SpeedTurbo, SpeedTurbo,
} motionspeed_e; };
typedef unsigned motionspeed_e;
// define names for the Target field of the general floor // define names for the Target field of the general floor
typedef enum enum
{ {
FtoHnF, FtoHnF,
FtoLnF, FtoLnF,
@ -227,29 +229,32 @@ typedef enum
FbyST, FbyST,
Fby24, Fby24,
Fby32, Fby32,
} floortarget_e; };
typedef unsigned floortarget_e;
// define names for the Changer Type field of the general floor // define names for the Changer Type field of the general floor
typedef enum enum
{ {
FNoChg, FNoChg,
FChgZero, FChgZero,
FChgTxt, FChgTxt,
FChgTyp, FChgTyp,
} floorchange_e; };
typedef unsigned floorchange_e;
// define names for the Change Model field of the general floor // define names for the Change Model field of the general floor
typedef enum enum
{ {
FTriggerModel, FTriggerModel,
FNumericModel, FNumericModel,
} floormodel_t; };
typedef unsigned floormodel_t;
// define names for the Target field of the general ceiling // define names for the Target field of the general ceiling
typedef enum enum
{ {
CtoHnC, CtoHnC,
CtoLnC, CtoLnC,
@ -259,49 +264,54 @@ typedef enum
CbyST, CbyST,
Cby24, Cby24,
Cby32, Cby32,
} ceilingtarget_e; };
typedef unsigned ceilingtarget_e;
// define names for the Changer Type field of the general ceiling // define names for the Changer Type field of the general ceiling
typedef enum enum
{ {
CNoChg, CNoChg,
CChgZero, CChgZero,
CChgTxt, CChgTxt,
CChgTyp, CChgTyp,
} ceilingchange_e; };
typedef unsigned ceilingchange_e;
// define names for the Change Model field of the general ceiling // define names for the Change Model field of the general ceiling
typedef enum enum
{ {
CTriggerModel, CTriggerModel,
CNumericModel, CNumericModel,
} ceilingmodel_t; };
typedef unsigned ceilingmodel_t;
// define names for the Target field of the general lift // define names for the Target field of the general lift
typedef enum enum
{ {
F2LnF, F2LnF,
F2NnF, F2NnF,
F2LnC, F2LnC,
LnF2HnF, LnF2HnF,
} lifttarget_e; };
typedef unsigned lifttarget_e;
// define names for the door Kind field of the general ceiling // define names for the door Kind field of the general ceiling
typedef enum enum
{ {
OdCDoor, OdCDoor,
ODoor, ODoor,
CdODoor, CdODoor,
CDoor, CDoor,
} doorkind_e; };
typedef unsigned intdoorkind_e;
// define names for the locked door Kind field of the general ceiling // define names for the locked door Kind field of the general ceiling
typedef enum enum
{ {
AnyKey, AnyKey,
RCard, RCard,
@ -311,7 +321,8 @@ typedef enum
BSkull, BSkull,
YSkull, YSkull,
AllKeys, AllKeys,
} keykind_e; };
typedef unsigned keykind_e;
////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////
// //
@ -321,31 +332,34 @@ typedef enum
//jff 2/23/98 identify the special classes that can share sectors //jff 2/23/98 identify the special classes that can share sectors
typedef enum enum
{ {
floor_special, floor_special,
ceiling_special, ceiling_special,
lighting_special, lighting_special,
} special_e; };
typedef unsigned special_e;
//jff 3/15/98 pure texture/type change for better generalized support //jff 3/15/98 pure texture/type change for better generalized support
typedef enum enum
{ {
trigChangeOnly, trigChangeOnly,
numChangeOnly, numChangeOnly,
} change_e; };
typedef unsigned change_e;
// p_plats // p_plats
typedef enum enum
{ {
up, up,
down, down,
waiting, waiting,
in_stasis in_stasis
} plat_e; };
typedef unsigned plat_e;
typedef enum enum
{ {
perpetualRaise, perpetualRaise,
downWaitUpStay, downWaitUpStay,
@ -356,11 +370,12 @@ typedef enum
genPerpetual, genPerpetual,
toggleUpDn, //jff 3/14/98 added to support instant toggle type toggleUpDn, //jff 3/14/98 added to support instant toggle type
} plattype_e; };
typedef unsigned plattype_e;
// p_doors // p_doors
typedef enum enum
{ {
normal, normal,
close30ThenOpen, close30ThenOpen,
@ -380,11 +395,12 @@ typedef enum
genBlazeClose, genBlazeClose,
genCdO, genCdO,
genBlazeCdO, genBlazeCdO,
} vldoor_e; };
typedef unsigned vldoor_e;
// p_ceilng // p_ceilng
typedef enum enum
{ {
lowerToFloor, lowerToFloor,
raiseToHighest, raiseToHighest,
@ -405,11 +421,12 @@ typedef enum
genCrusher, genCrusher,
genSilentCrusher, genSilentCrusher,
} ceiling_e; };
typedef unsigned ceiling_e;
// p_floor // p_floor
typedef enum enum
{ {
// lower floor to highest surrounding floor // lower floor to highest surrounding floor
lowerFloor, lowerFloor,
@ -464,21 +481,24 @@ typedef enum
//new types for stair builders //new types for stair builders
buildStair, buildStair,
genBuildStair, genBuildStair,
} floor_e; };
typedef unsigned floor_e;
typedef enum enum
{ {
build8, // slowly build by 8 build8, // slowly build by 8
turbo16 // quickly build by 16 turbo16 // quickly build by 16
} stair_e; };
typedef unsigned stair_e;
typedef enum enum
{ {
elevateUp, elevateUp,
elevateDown, elevateDown,
elevateCurrent, elevateCurrent,
} elevator_e; };
typedef unsigned elevator_e;
////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////
// //
@ -487,21 +507,23 @@ typedef enum
////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////
// texture type enum // texture type enum
typedef enum enum
{ {
top, top,
middle, middle,
bottom bottom
} bwhere_e; };
typedef unsigned bwhere_e;
// crush check returns // crush check returns
typedef enum enum
{ {
ok, ok,
crushed, crushed,
pastdest pastdest
} result_e; };
typedef unsigned result_e;
////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////
// //
@ -700,6 +722,14 @@ typedef struct
// p_spec // p_spec
// killough 3/7/98: Add generalized scroll effects // killough 3/7/98: Add generalized scroll effects
enum
{
sc_side,
sc_floor,
sc_ceiling,
sc_carry,
sc_carry_ceiling, // killough 4/11/98: carry objects hanging on ceilings
}; /* type */
typedef struct { typedef struct {
thinker_t thinker; // Thinker structure for scrolling thinker_t thinker; // Thinker structure for scrolling
@ -709,14 +739,7 @@ typedef struct {
fixed_t last_height; // Last known height of control sector fixed_t last_height; // Last known height of control sector
fixed_t vdx, vdy; // Accumulated velocity if accelerative fixed_t vdx, vdy; // Accumulated velocity if accelerative
int accel; // Whether it's accelerative int accel; // Whether it's accelerative
enum unsigned type; // Type of scroll effect
{
sc_side,
sc_floor,
sc_ceiling,
sc_carry,
sc_carry_ceiling, // killough 4/11/98: carry objects hanging on ceilings
} type; // Type of scroll effect
} scroll_t; } scroll_t;
// phares 3/12/98: added new model of friction for ice/sludge effects // phares 3/12/98: added new model of friction for ice/sludge effects
@ -730,15 +753,17 @@ typedef struct {
// phares 3/20/98: added new model of Pushers for push/pull effects // phares 3/20/98: added new model of Pushers for push/pull effects
enum
{
p_push,
p_pull,
p_wind,
p_current,
}; /* type */
typedef struct { typedef struct {
thinker_t thinker; // Thinker structure for Pusher thinker_t thinker; // Thinker structure for Pusher
enum unsigned type;
{
p_push,
p_pull,
p_wind,
p_current,
} type;
mobj_t* source; // Point source if point pusher mobj_t* source; // Point source if point pusher
int x_mag; // X Strength int x_mag; // X Strength
int y_mag; // Y Strength int y_mag; // Y Strength

View file

@ -54,12 +54,13 @@ void P_UpdateThinker(thinker_t *thinker); // killough 8/29/98
void P_SetTarget(mobj_t **mo, mobj_t *target); // killough 11/98 void P_SetTarget(mobj_t **mo, mobj_t *target); // killough 11/98
// killough 8/29/98: threads of thinkers, for more efficient searches // killough 8/29/98: threads of thinkers, for more efficient searches
typedef enum { enum {
th_misc, th_misc,
th_friends, th_friends,
th_enemies, th_enemies,
NUMTHCLASS NUMTHCLASS
} th_class; };
typedef unsigned th_class;
extern thinker_t thinkerclasscap[]; extern thinker_t thinkerclasscap[];

View file

@ -177,13 +177,22 @@ side_t;
// //
// Move clipping aid for LineDefs. // Move clipping aid for LineDefs.
// //
typedef enum enum
{ {
ST_HORIZONTAL, ST_HORIZONTAL,
ST_VERTICAL, ST_VERTICAL,
ST_POSITIVE, ST_POSITIVE,
ST_NEGATIVE ST_NEGATIVE
} slopetype_t; };
typedef int slopetype_t;
enum { // cph:
RF_TOP_TILE = 1, // Upper texture needs tiling
RF_MID_TILE = 2, // Mid texture needs tiling
RF_BOT_TILE = 4, // Lower texture needs tiling
RF_IGNORE = 8, // Renderer can skip this line
RF_CLOSED =16, // Line blocks view
};
typedef struct line_s typedef struct line_s
{ {
@ -202,13 +211,7 @@ typedef struct line_s
int tranlump; // killough 4/11/98: translucency filter, -1 == none int tranlump; // killough 4/11/98: translucency filter, -1 == none
int firsttag,nexttag; // killough 4/17/98: improves searches for tags. int firsttag,nexttag; // killough 4/17/98: improves searches for tags.
int r_validcount; // cph: if == gametic, r_flags already done int r_validcount; // cph: if == gametic, r_flags already done
enum { // cph: int r_flags;
RF_TOP_TILE = 1, // Upper texture needs tiling
RF_MID_TILE = 2, // Mid texture needs tiling
RF_BOT_TILE = 4, // Lower texture needs tiling
RF_IGNORE = 8, // Renderer can skip this line
RF_CLOSED =16, // Line blocks view
} r_flags;
} }
line_t; line_t;

View file

@ -102,7 +102,7 @@ extern musicinfo_t S_music[];
// Identifiers for all music in game. // Identifiers for all music in game.
// //
typedef enum { enum {
mus_None, mus_None,
mus_e1m1, mus_e1m1,
mus_e1m2, mus_e1m2,
@ -172,13 +172,14 @@ typedef enum {
mus_dm2ttl, mus_dm2ttl,
mus_dm2int, mus_dm2int,
NUMMUSIC NUMMUSIC
} musicenum_t; };
typedef unsigned musicenum_t;
// //
// Identifiers for all sfx in game. // Identifiers for all sfx in game.
// //
typedef enum { enum {
sfx_None, sfx_None,
sfx_pistol, sfx_pistol,
sfx_shotgn, sfx_shotgn,
@ -299,6 +300,7 @@ typedef enum {
#endif #endif
NUMSFX NUMSFX
} sfxenum_t; };
typedef unsigned sfxenum_t;
#endif #endif

View file

@ -68,19 +68,21 @@ void ST_Start(void);
void ST_Init(void); void ST_Init(void);
// States for status bar code. // States for status bar code.
typedef enum enum
{ {
AutomapState, AutomapState,
FirstPersonState FirstPersonState
} st_stateenum_t; };
typedef unsigned st_stateenum_t;
// States for the chat code. // States for the chat code.
typedef enum enum
{ {
StartChatState, StartChatState,
WaitDestState, WaitDestState,
GetChatState GetChatState
} st_chatstateenum_t; };
typedef unsigned st_chatstateenum_t;
boolean ST_Responder(event_t* ev); boolean ST_Responder(event_t* ev);

View file

@ -208,7 +208,7 @@ void V_MarkRect(int x, int y, int width, int height)
// //
void V_CopyRect(int srcx, int srcy, int srcscrn, int width, void V_CopyRect(int srcx, int srcy, int srcscrn, int width,
int height, int destx, int desty, int destscrn, int height, int destx, int desty, int destscrn,
enum patch_translation_e flags) patch_translation_e flags)
{ {
byte *src; byte *src;
byte *dest; byte *dest;
@ -263,7 +263,7 @@ void V_CopyRect(int srcx, int srcy, int srcscrn, int width,
// implemented, to support highres in the menus // implemented, to support highres in the menus
// //
void V_DrawBlock(int x, int y, int scrn, int width, int height, void V_DrawBlock(int x, int y, int scrn, int width, int height,
const byte *src, enum patch_translation_e flags) const byte *src, patch_translation_e flags)
{ {
byte *dest; byte *dest;
@ -406,7 +406,7 @@ void V_Init (void)
// means that their inner loops weren't so well optimised, so merging code may even speed them). // means that their inner loops weren't so well optimised, so merging code may even speed them).
// //
void V_DrawMemPatch(int x, int y, int scrn, const patch_t *patch, void V_DrawMemPatch(int x, int y, int scrn, const patch_t *patch,
int cm, enum patch_translation_e flags) int cm, patch_translation_e flags)
{ {
const byte *trans; const byte *trans;
@ -588,7 +588,7 @@ void V_DrawMemPatch(int x, int y, int scrn, const patch_t *patch,
inline inline
#endif #endif
void V_DrawNumPatch(int x, int y, int scrn, int lump, void V_DrawNumPatch(int x, int y, int scrn, int lump,
int cm, enum patch_translation_e flags) int cm, patch_translation_e flags)
{ {
V_DrawMemPatch(x, y, scrn, (const patch_t*)W_CacheLumpNum(lump), V_DrawMemPatch(x, y, scrn, (const patch_t*)W_CacheLumpNum(lump),
cm, flags); cm, flags);
@ -634,7 +634,7 @@ int V_NamePatchHeight(const char* name)
// patch will be undefined (in fact black for now) // patch will be undefined (in fact black for now)
byte *V_PatchToBlock(const char* name, int cm, byte *V_PatchToBlock(const char* name, int cm,
enum patch_translation_e flags, patch_translation_e flags,
unsigned short* width, unsigned short* height) unsigned short* width, unsigned short* height)
{ {
(void)cm; (void)cm;

View file

@ -53,7 +53,7 @@
extern const byte *colrngs[]; extern const byte *colrngs[];
// symbolic indices into color translation table pointer array // symbolic indices into color translation table pointer array
typedef enum enum
{ {
CR_BRICK, //0 CR_BRICK, //0
CR_TAN, //1 CR_TAN, //1
@ -67,7 +67,8 @@ typedef enum
CR_YELLOW, //9 CR_YELLOW, //9
CR_BLUE2, //10 // proff CR_BLUE2, //10 // proff
CR_LIMIT //11 //jff 2/27/98 added for range check CR_LIMIT //11 //jff 2/27/98 added for range check
} crange_idx_e; };
typedef unsigned crange_idx_e;
//jff 1/16/98 end palette color range additions //jff 1/16/98 end palette color range additions
#define CR_DEFAULT CR_RED /* default value for out of range colors */ #define CR_DEFAULT CR_RED /* default value for out of range colors */
@ -83,17 +84,18 @@ void V_InitColorTranslation(void);
// Allocates buffer screens, call before R_Init. // Allocates buffer screens, call before R_Init.
void V_Init (void); void V_Init (void);
enum patch_translation_e { enum {
VPT_NONE = 0, // Normal VPT_NONE = 0, // Normal
VPT_FLIP = 1, // Flip image horizontally VPT_FLIP = 1, // Flip image horizontally
VPT_TRANS = 2, // Translate image via a translation table VPT_TRANS = 2, // Translate image via a translation table
VPT_STRETCH = 4, // Stretch to compensate for high-res VPT_STRETCH = 4, // Stretch to compensate for high-res
}; };
typedef unsigned patch_translation_e;
#ifndef GL_DOOM #ifndef GL_DOOM
void V_CopyRect(int srcx, int srcy, int srcscrn, int width, int height, void V_CopyRect(int srcx, int srcy, int srcscrn, int width, int height,
int destx, int desty, int destscrn, int destx, int desty, int destscrn,
enum patch_translation_e flags); patch_translation_e flags);
#else #else
#define V_CopyRect(sx,sy,ss,w,h,dx,dy,ds,f) #define V_CopyRect(sx,sy,ss,w,h,dx,dy,ds,f)
#endif /* GL_DOOM */ #endif /* GL_DOOM */
@ -111,14 +113,14 @@ void V_FillRect(int scrn, int x, int y, int width, int height, byte colour);
#define V_DrawMemPatch(x,y,s,p,t,f) gld_DrawPatchFromMem(x,y,p,t,f) #define V_DrawMemPatch(x,y,s,p,t,f) gld_DrawPatchFromMem(x,y,p,t,f)
#else #else
void V_DrawMemPatch(int x, int y, int scrn, const patch_t *patch, void V_DrawMemPatch(int x, int y, int scrn, const patch_t *patch,
int cm, enum patch_translation_e flags); int cm, patch_translation_e flags);
#endif #endif
// V_DrawNumPatch - Draws the patch from lump num // V_DrawNumPatch - Draws the patch from lump num
#ifdef GL_DOOM #ifdef GL_DOOM
#define V_DrawNumPatch(x,y,s,l,t,f) gld_DrawNumPatch(x,y,l,t,f) #define V_DrawNumPatch(x,y,s,l,t,f) gld_DrawNumPatch(x,y,l,t,f)
#else #else
void V_DrawNumPatch(int x, int y, int scrn, int lump, void V_DrawNumPatch(int x, int y, int scrn, int lump,
int cm, enum patch_translation_e flags); int cm, patch_translation_e flags);
#endif #endif
// V_DrawNamePatch - Draws the patch from lump "name" // V_DrawNamePatch - Draws the patch from lump "name"
#ifdef GL_DOOM #ifdef GL_DOOM
@ -140,7 +142,7 @@ int V_NamePatchHeight(const char* name);
// CPhipps - added const's, patch translation flags for stretching // CPhipps - added const's, patch translation flags for stretching
#ifndef GL_DOOM #ifndef GL_DOOM
void V_DrawBlock(int x, int y, int scrn, int width, int height, void V_DrawBlock(int x, int y, int scrn, int width, int height,
const byte *src, enum patch_translation_e flags); const byte *src, patch_translation_e flags);
#endif #endif
/* cphipps 10/99: function to tile a flat over the screen */ /* cphipps 10/99: function to tile a flat over the screen */
@ -160,7 +162,7 @@ void V_MarkRect(int x, int y, int width,int height);
// CPhipps - function to convert a patch_t into a simple block bitmap // CPhipps - function to convert a patch_t into a simple block bitmap
// Returns pointer to the malloc()'ed bitmap, and its width and height // Returns pointer to the malloc()'ed bitmap, and its width and height
byte *V_PatchToBlock(const char* name, int cm, byte *V_PatchToBlock(const char* name, int cm,
enum patch_translation_e flags, patch_translation_e flags,
unsigned short* width, unsigned short* height); unsigned short* width, unsigned short* height);
#else #else
#define V_MarkRect(x,y,w,h) #define V_MarkRect(x,y,w,h)

View file

@ -73,7 +73,7 @@ typedef struct
// CPhipps - defined enum in wider scope // CPhipps - defined enum in wider scope
// Ty 08/29/98 - add source field to identify where this lump came from // Ty 08/29/98 - add source field to identify where this lump came from
typedef enum { enum {
// CPhipps - define elements in order of 'how new/unusual' // CPhipps - define elements in order of 'how new/unusual'
source_iwad=0, // iwad file load source_iwad=0, // iwad file load
source_pre, // predefined lump source_pre, // predefined lump
@ -81,7 +81,15 @@ typedef enum {
source_pwad, // pwad file load source_pwad, // pwad file load
source_lmp, // lmp file load source_lmp, // lmp file load
source_net // CPhipps source_net // CPhipps
} wad_source_t; };
typedef unsigned wad_source_t;
enum {
ns_global=0,
ns_sprites,
ns_flats,
ns_colormaps
}; /* namespace */
typedef struct typedef struct
{ {
@ -97,12 +105,7 @@ typedef struct
int index, next; int index, next;
// killough 4/17/98: namespace tags, to prevent conflicts between resources // killough 4/17/98: namespace tags, to prevent conflicts between resources
enum { unsigned namespace;
ns_global=0,
ns_sprites,
ns_flats,
ns_colormaps
} namespace;
int handle; int handle;
int position; int position;

View file

@ -107,12 +107,13 @@
// These animation variables, structures, etc. are used for the // These animation variables, structures, etc. are used for the
// DOOM/Ultimate DOOM intermission screen animations. This is // DOOM/Ultimate DOOM intermission screen animations. This is
// totally different from any sprite or texture/flat animations // totally different from any sprite or texture/flat animations
typedef enum enum
{ {
ANIM_ALWAYS, // determined by patch entry ANIM_ALWAYS, // determined by patch entry
ANIM_RANDOM, // occasional ANIM_RANDOM, // occasional
ANIM_LEVEL // continuous ANIM_LEVEL // continuous
} animenum_t; };
typedef unsigned animenum_t;
typedef struct typedef struct
{ {

View file

@ -38,13 +38,14 @@
// States for the intermission // States for the intermission
typedef enum enum
{ {
NoState = -1, NoState = -1,
StatCount, StatCount,
ShowNextLoc ShowNextLoc
} stateenum_t; };
typedef int stateenum_t;
// Called by main loop, animate the intermission. // Called by main loop, animate the intermission.
void WI_Ticker (void); void WI_Ticker (void);