From 637f48e9ced77738ef849ed8ec94ec190ba2c6ae Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Wed, 25 Nov 2015 12:08:24 +0000 Subject: [PATCH] Don't implicitly define GAMEFLAG_NAM for WWII GI. Instead, implement a new macro NAM_WW2GI synonymous with (NAM || WW2GI). git-svn-id: https://svn.eduke32.com/eduke32@5450 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/common.c | 3 +-- polymer/eduke32/source/common_game.h | 1 + polymer/eduke32/source/config.c | 4 ++-- polymer/eduke32/source/game.c | 12 ++++++------ polymer/eduke32/source/gamevars.c | 16 ++++++++-------- polymer/eduke32/source/grpscan.c | 2 +- polymer/eduke32/source/player.c | 2 +- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/polymer/eduke32/source/common.c b/polymer/eduke32/source/common.c index 3a7bc8220..c81669976 100644 --- a/polymer/eduke32/source/common.c +++ b/polymer/eduke32/source/common.c @@ -60,7 +60,6 @@ const char *G_DefaultGrpFile(void) { if (DUKE) return defaultgamegrp[GAME_DUKE]; - // order is important for the following three because GAMEFLAG_NAM overlaps all else if (NAPALM) return defaultgamegrp[GAME_NAPALM]; else if (WW2GI) @@ -871,7 +870,7 @@ void G_CleanupSearchPaths(void) { removesearchpaths_withuser(SEARCHPATH_REMOVE); - if (!(NAM || NAPALM)) + if (!NAM) removesearchpaths_withuser(SEARCHPATH_NAM); } diff --git a/polymer/eduke32/source/common_game.h b/polymer/eduke32/source/common_game.h index f14bff9c5..9989b1389 100644 --- a/polymer/eduke32/source/common_game.h +++ b/polymer/eduke32/source/common_game.h @@ -34,6 +34,7 @@ extern int32_t g_usingAddon; #define NAM (g_gameType & GAMEFLAG_NAM) #define NAPALM (g_gameType & GAMEFLAG_NAPALM) #define WW2GI (g_gameType & GAMEFLAG_WW2GI) +#define NAM_WW2GI (g_gameType & (GAMEFLAG_NAM|GAMEFLAG_WW2GI)) #define SHAREWARE (g_gameType & GAMEFLAG_SHAREWARE) #define DUKEBETA ((g_gameType & GAMEFLAG_DUKEBETA) == GAMEFLAG_DUKEBETA) diff --git a/polymer/eduke32/source/config.c b/polymer/eduke32/source/config.c index 27527f080..b5090e64f 100644 --- a/polymer/eduke32/source/config.c +++ b/polymer/eduke32/source/config.c @@ -666,7 +666,7 @@ int32_t CONFIG_ReadSetup(void) g_grpNamePtr = dup_filename(G_DefaultGrpFile()); } - if (!NAM) + if (!NAM_WW2GI) { SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "Out",&ud.lockout); SCRIPT_GetString(ud.config.scripthandle, "Screen Setup","Password",&ud.pwlockout[0]); @@ -830,7 +830,7 @@ void CONFIG_WriteSetup(uint32_t flags) SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "MaxRefreshFreq", maxrefreshfreq, FALSE, FALSE); #endif - if (!NAM) + if (!NAM_WW2GI) { SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "Out",ud.lockout,FALSE,FALSE); SCRIPT_PutString(ud.config.scripthandle, "Screen Setup", "Password",ud.pwlockout); diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 1aa4519e3..39272c462 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -1205,7 +1205,7 @@ int32_t G_PrintGameText(int32_t hack, int32_t tile, int32_t x, int32_t y, cons } // order is important, this bit comes after the rest - if ((hack & 2) && !NAM) // squishtext + if ((hack & 2) && !NAM_WW2GI) // squishtext --xbetween; if (x == (160<<16)) @@ -5884,7 +5884,7 @@ int32_t A_Spawn(int32_t j, int32_t pn) sp->shade = -8; - if (sp->yvel == 1 || NAM) + if (sp->yvel == 1 || NAM_WW2GI) { sp->ang = a+512; sp->xvel = 30; @@ -11615,7 +11615,7 @@ int32_t app_main(int32_t argc, const char **argv) G_LoadGroups(!g_noAutoLoad && !ud.config.NoAutoLoad); // flushlogwindow = 1; - if (WW2GI || NAM) + if (NAM_WW2GI) { Bstrcpy(GametypeNames[0],"GruntMatch (Spawn)"); Bstrcpy(GametypeNames[2],"GruntMatch (No Spawn)"); @@ -12707,7 +12707,7 @@ static int32_t G_PrintTime_ClockPad(void) { for (ii=MapInfo[G_LastMapInfoIndex()].partime/(REALGAMETICSPERSEC*60), ij=1; ii>9; ii/=10, ij++) ; clockpad = max(clockpad,ij); - if (!NAM && MapInfo[G_LastMapInfoIndex()].designertime) + if (!NAM_WW2GI && MapInfo[G_LastMapInfoIndex()].designertime) { for (ii=MapInfo[G_LastMapInfoIndex()].designertime/(REALGAMETICSPERSEC*60), ij=1; ii>9; ii/=10, ij++) ; clockpad = max(clockpad,ij); @@ -12942,7 +12942,7 @@ void G_BonusScreen(int32_t bonusonly) gametext(10,yy+9,"Par Time:",0,2+8+16); yy+=10; } - if (!NAM && !DUKEBETA && MapInfo[G_LastMapInfoIndex()].designertime) + if (!NAM_WW2GI && !DUKEBETA && MapInfo[G_LastMapInfoIndex()].designertime) { gametext(10,yy+9,"3D Realms' Time:",0,2+8+16); yy+=10; @@ -12986,7 +12986,7 @@ void G_BonusScreen(int32_t bonusonly) gametext((320>>2)+71,yy+9,tempbuf,0,2+8+16); yy+=10; } - if (!NAM && !DUKEBETA && MapInfo[G_LastMapInfoIndex()].designertime) + if (!NAM_WW2GI && !DUKEBETA && MapInfo[G_LastMapInfoIndex()].designertime) { G_PrintDesignerTime(); gametext((320>>2)+71,yy+9,tempbuf,0,2+8+16); diff --git a/polymer/eduke32/source/gamevars.c b/polymer/eduke32/source/gamevars.c index d0e6b3bbb..ae1758988 100644 --- a/polymer/eduke32/source/gamevars.c +++ b/polymer/eduke32/source/gamevars.c @@ -1386,8 +1386,8 @@ static weapondata_t weapondefaults[MAX_WEAPONS] = { }, { - PISTOL_WEAPON, /*NAM?20:*/12, /*NAM?50:*/27, 2, 5, 0, - /*(NAM?WEAPON_HOLSTER_CLEARS_CLIP:0) |*/ WEAPON_RELOAD_TIMING, + PISTOL_WEAPON, /*NAM_WW2GI?20:*/12, /*NAM_WW2GI?50:*/27, 2, 5, 0, + /*(NAM_WW2GI?WEAPON_HOLSTER_CLEARS_CLIP:0) |*/ WEAPON_RELOAD_TIMING, SHOTSPARK1__STATIC, 2, SHELL__STATIC, 0, 0, PISTOL_FIRE__STATIC, 0, 0, EJECT_CLIP__STATIC, INSERT_CLIP__STATIC, INSERT_CLIP__STATIC, 255+(95<<8) }, @@ -1421,7 +1421,7 @@ static weapondata_t weapondefaults[MAX_WEAPONS] = { }, { - SHRINKER_WEAPON, 0, 0, 10, /*NAM?30:*/12, 0, + SHRINKER_WEAPON, 0, 0, 10, /*NAM_WW2GI?30:*/12, 0, WEAPON_GLOWS, SHRINKER__STATIC, 0, 0, 0, SHRINKER_FIRE__STATIC, 0, 0, 0, EJECT_CLIP__STATIC, INSERT_CLIP__STATIC, SELECT_WEAPON__STATIC, 128+(255<<8)+(128<<16) @@ -1456,9 +1456,9 @@ static weapondata_t weapondefaults[MAX_WEAPONS] = { }, { - GROW_WEAPON, 0, 0, 3, /*NAM?30:*/5, 0, + GROW_WEAPON, 0, 0, 3, /*NAM_WW2GI?30:*/5, 0, WEAPON_GLOWS, - GROWSPARK__STATIC, /*NAM?2:*/0, /*NAM?SHELL:*/0, 0, 0, /*NAM?0:*/EXPANDERSHOOT__STATIC, 0, 0, + GROWSPARK__STATIC, /*NAM_WW2GI?2:*/0, /*NAM_WW2GI?SHELL:*/0, 0, 0, /*NAM_WW2GI?0:*/EXPANDERSHOOT__STATIC, 0, 0, EJECT_CLIP__STATIC, INSERT_CLIP__STATIC, SELECT_WEAPON__STATIC, 255+(95<<8) }, }; @@ -1577,7 +1577,7 @@ static void Gv_AddSystemVars(void) char aszBuf[64]; #endif - if (NAM) + if (NAM_WW2GI) { weapondefaults[PISTOL_WEAPON].Clip = 20; weapondefaults[PISTOL_WEAPON].Reload = 50; @@ -1618,7 +1618,7 @@ static void Gv_AddSystemVars(void) { DukePlayer_t *ps = g_player[i].ps; - ps->pipebombControl = NAM ? PIPEBOMB_TIMER : PIPEBOMB_REMOTE; + ps->pipebombControl = NAM_WW2GI ? PIPEBOMB_TIMER : PIPEBOMB_REMOTE; ps->pipebombLifetime = NAM_GRENADE_LIFETIME; ps->pipebombLifetimeVar = NAM_GRENADE_LIFETIME_VAR; @@ -1634,7 +1634,7 @@ static void Gv_AddSystemVars(void) Gv_NewVar("STICKYBOMB_LIFETIME_VAR", NAM_GRENADE_LIFETIME_VAR, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM); Gv_NewVar("TRIPBOMB_CONTROL", TRIPBOMB_TRIPWIRE, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM); - Gv_NewVar("PIPEBOMB_CONTROL", NAM?PIPEBOMB_TIMER:PIPEBOMB_REMOTE, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM); + Gv_NewVar("PIPEBOMB_CONTROL", NAM_WW2GI ? PIPEBOMB_TIMER : PIPEBOMB_REMOTE, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM); Gv_NewVar("RESPAWN_MONSTERS", (intptr_t)&ud.respawn_monsters,GAMEVAR_SYSTEM | GAMEVAR_INTPTR); Gv_NewVar("RESPAWN_ITEMS",(intptr_t)&ud.respawn_items, GAMEVAR_SYSTEM | GAMEVAR_INTPTR); diff --git a/polymer/eduke32/source/grpscan.c b/polymer/eduke32/source/grpscan.c index 6b08eb3c1..7ca30a4b0 100644 --- a/polymer/eduke32/source/grpscan.c +++ b/polymer/eduke32/source/grpscan.c @@ -63,7 +63,7 @@ static grpinfo_t const internalgrpfiles[] = { "Duke!ZONE II", (int32_t)0x1E9516F1, 3186656, GAMEFLAG_DUKE|GAMEFLAG_ADDON, DUKE15_CRC, "DZ-GAME.CON", NULL, NULL, NULL }, { "NAM", NAM_CRC, 43448927, GAMEFLAG_NAM, 0, NULL, NULL, NULL, NULL }, { "NAPALM", NAPALM_CRC, 44365728, GAMEFLAG_NAM|GAMEFLAG_NAPALM, 0, NULL, NULL, NULL, NULL }, - { "WWII GI", WW2GI_CRC, 77939508, GAMEFLAG_WW2GI|GAMEFLAG_NAM, 0, NULL, NULL, NULL, NULL }, + { "WWII GI", WW2GI_CRC, 77939508, GAMEFLAG_WW2GI, 0, NULL, NULL, NULL, NULL }, }; struct grpfile_t *foundgrps = NULL; diff --git a/polymer/eduke32/source/player.c b/polymer/eduke32/source/player.c index d5823878e..7b5e3dbad 100644 --- a/polymer/eduke32/source/player.c +++ b/polymer/eduke32/source/player.c @@ -1194,7 +1194,7 @@ static int32_t A_ShootHardcoded(int32_t i, int32_t atwith, int16_t sa, vec3_t sr if (p >= 0) P_PreFireHitscan(i, p, atwith, &srcvect, &zvel, &sa, - atwith == SHOTSPARK1__STATIC && !WW2GI && !NAM, + atwith == SHOTSPARK1__STATIC && !NAM_WW2GI, 1); else A_PreFireHitscan(s, &srcvect, &zvel, &sa, 1);