From 9c6e217f29bb0a76ec153574a3d493b020e5fb60 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Sat, 29 May 2010 08:12:39 +0000 Subject: 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 --- apps/plugins/doom/doomdef.h | 56 +++++++++++++++++++++++++++------------------ 1 file changed, 34 insertions(+), 22 deletions(-) (limited to 'apps/plugins/doom/doomdef.h') diff --git a/apps/plugins/doom/doomdef.h b/apps/plugins/doom/doomdef.h index a0e8ad50bc..05346cd443 100644 --- a/apps/plugins/doom/doomdef.h +++ b/apps/plugins/doom/doomdef.h @@ -48,30 +48,33 @@ enum { DVERSION = 110 }; // Game mode handling - identify IWAD version // to handle IWAD dependend animations etc. -typedef enum { +enum { shareware, // DOOM 1 shareware, E1, M9 registered, // DOOM 1 registered, E3, M27 commercial, // DOOM 2 retail, E1 M34 (DOOM 2 german edition not handled) retail, // DOOM 1 retail, E4, M36 indetermined // Well, no IWAD found. -} GameMode_t; +}; +typedef unsigned GameMode_t; // Mission packs - might be useful for TC stuff? -typedef enum { +enum { doom, // DOOM 1 doom2, // DOOM 2 pack_tnt, // TNT mission pack pack_plut, // Plutonia pack none -} GameMission_t; +}; +typedef unsigned GameMission_t; // Identify language to use, software localization. -typedef enum { +enum { english, french, german, unknown -} Language_t; +}; +typedef unsigned Language_t; // // 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 // at the intermission screen, the game final animation, or a demo. -typedef enum { +enum { GS_LEVEL, GS_INTERMISSION, GS_FINALE, GS_DEMOSCREEN -} gamestate_t; +}; +typedef unsigned gamestate_t; // // Difficulty/skill settings/filters. @@ -147,20 +151,21 @@ typedef enum { #define MTF_FRIEND 128 #define MTF_RESERVED 256 -typedef enum { +enum { sk_none=-1, //jff 3/24/98 create unpicked skill setting sk_baby=0, sk_easy, sk_medium, sk_hard, sk_nightmare -} skill_t; +}; +typedef int skill_t; // // Key cards. // -typedef enum { +enum { it_bluecard, it_yellowcard, it_redcard, @@ -168,11 +173,12 @@ typedef enum { it_yellowskull, it_redskull, NUMCARDS -} card_t; +}; +typedef unsigned card_t; // The defined weapons, including a marker // indicating user has not changed weapon. -typedef enum { +enum { wp_fist, wp_pistol, wp_shotgun, @@ -185,20 +191,23 @@ typedef enum { NUMWEAPONS, wp_nochange // No pending weapon change. -} weapontype_t; +}; +typedef unsigned weapontype_t; // Ammunition types defined. -typedef enum { +enum { am_clip, // Pistol / chaingun ammo. am_shell, // Shotgun / double barreled shotgun. am_cell, // Plasma rifle, BFG. am_misl, // Missile launcher. NUMAMMO, am_noammo // Unlimited for chainsaw / fist. -} ammotype_t; +}; + +typedef unsigned ammotype_t; // Power up artifacts. -typedef enum { +enum { pw_invulnerability, pw_strength, pw_invisibility, @@ -206,15 +215,17 @@ typedef enum { pw_allmap, pw_infrared, NUMPOWERS -} powertype_t; +}; +typedef unsigned powertype_t; // Power up durations (how many seconds till expiration). -typedef enum { +enum { INVULNTICS = (30*TICRATE), INVISTICS = (60*TICRATE), INFRATICS = (120*TICRATE), IRONTICS = (60*TICRATE) -} powerduration_t; +}; +typedef unsigned powerduration_t; // // DOOM keyboard definition. @@ -289,7 +300,7 @@ typedef enum { // Defines Setup Screen groups that config variables appear in. // Used when resetting the defaults for every item in a Setup group. -typedef enum { +enum { ss_none, ss_keys, ss_weap, @@ -301,7 +312,8 @@ typedef enum { ss_gen, /* killough 10/98 */ ss_comp, /* killough 10/98 */ ss_max -} ss_types; +}; +typedef unsigned ss_types; // phares 3/20/98: // -- cgit v1.2.3