From 6894be4ad14a704536a6692ef3a5c29bf0b6e0a0 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Sun, 11 Jul 2021 12:39:54 +1000 Subject: [PATCH] - Use the new `isSWALL()` wrapper everywhere. --- source/core/automap.cpp | 6 +++--- source/core/console/c_notifybuffer.cpp | 2 +- source/core/g_mapinfo.cpp | 2 +- source/core/gamecontrol.cpp | 2 +- source/core/gamecvars.cpp | 2 +- source/core/initfs.cpp | 2 +- source/core/inputstate.cpp | 2 +- source/core/menu/razemenu.cpp | 4 ++-- source/core/raze_music.cpp | 2 +- source/core/searchpaths.cpp | 2 +- source/core/statusbar2.cpp | 2 +- 11 files changed, 14 insertions(+), 14 deletions(-) diff --git a/source/core/automap.cpp b/source/core/automap.cpp index f9ef9e153..b28645f9a 100644 --- a/source/core/automap.cpp +++ b/source/core/automap.cpp @@ -372,7 +372,7 @@ CCMD(printpalcol) bool ShowRedLine(int j, int i) { auto wal = &wall[j]; - if (!(g_gameType & GAMEFLAG_SW)) + if (!isSWALL()) { return !gFullMap && !show2dsector[wal->nextsector]; } @@ -470,7 +470,7 @@ static void drawwhitelines(int cposx, int cposy, int czoom, int cang) for (int i = numsectors - 1; i >= 0; i--) { - if (!gFullMap && !show2dsector[i] && !(g_gameType & GAMEFLAG_SW)) continue; + if (!gFullMap && !show2dsector[i] && !isSWALL()) continue; int startwall = sector[i].wallptr; int endwall = sector[i].wallptr + sector[i].wallnum; @@ -483,7 +483,7 @@ static void drawwhitelines(int cposx, int cposy, int czoom, int cang) if (wal->nextwall >= 0) continue; if (!gFullMap && !tileGetTexture(wal->picnum)->isValid()) continue; - if ((g_gameType & GAMEFLAG_SW) && !gFullMap && !show2dwall[j]) + if (isSWALL() && !gFullMap && !show2dwall[j]) continue; int ox = wal->x - cposx; diff --git a/source/core/console/c_notifybuffer.cpp b/source/core/console/c_notifybuffer.cpp index e1698a6c7..f971a1e05 100644 --- a/source/core/console/c_notifybuffer.cpp +++ b/source/core/console/c_notifybuffer.cpp @@ -116,7 +116,7 @@ void FNotifyBuffer::DrawNative() FFont* font = isBlood() ? SmallFont2 : SmallFont; - double line = isBlood() ? Top : (g_gameType & GAMEFLAG_SW) ? 40 : font->GetDisplacement(); + double line = isBlood() ? Top : isSWALL() ? 40 : font->GetDisplacement(); bool canskip = isBlood(); double scale = 1 / (NotifyFontScale * con_notifyscale); double lineadv = font->GetHeight() / NotifyFontScale; diff --git a/source/core/g_mapinfo.cpp b/source/core/g_mapinfo.cpp index fd4f01d30..b0802a976 100644 --- a/source/core/g_mapinfo.cpp +++ b/source/core/g_mapinfo.cpp @@ -310,7 +310,7 @@ bool FMapInfoParser::CheckLegacyMapDefinition(FString& mapname) { sc.MustGetNumber(); int vol = sc.Number; - if (!(g_gameType & GAMEFLAG_SW)) + if (!isSWALL()) { // Blood and Duke use volume/level pairs sc.MustGetStringName(","); diff --git a/source/core/gamecontrol.cpp b/source/core/gamecontrol.cpp index f62502991..ffcfc5ea1 100644 --- a/source/core/gamecontrol.cpp +++ b/source/core/gamecontrol.cpp @@ -961,7 +961,7 @@ int RunGame() mus_redbook.SetGenericRepDefault(false, CVAR_Bool); // Blood should default to CD Audio off - all other games must default to on. am_showlabel.SetGenericRepDefault(true, CVAR_Bool); } - if (g_gameType & GAMEFLAG_SW) + if (isSWALL()) { cl_weaponswitch.SetGenericRepDefault(1, CVAR_Int); if (cl_weaponswitch > 1) cl_weaponswitch = 1; diff --git a/source/core/gamecvars.cpp b/source/core/gamecvars.cpp index 707c90ef8..0ce84ee70 100644 --- a/source/core/gamecvars.cpp +++ b/source/core/gamecvars.cpp @@ -93,7 +93,7 @@ CUSTOM_CVARD(Int, cl_autoaim, 1, CVAR_ARCHIVE|CVAR_USERINFO, "enable/disable wea CUSTOM_CVARD(Int, cl_weaponswitch, 3, CVAR_ARCHIVE|CVAR_USERINFO, "enable/disable auto weapon switching") { if (self < 0) self = 0; - if (self > 1 && (g_gameType & GAMEFLAG_SW)) self = 1; + if (self > 1 && isSWALL()) self = 1; if (self > 3 && isBlood()) self = 3; if (self > 7) self = 7; } diff --git a/source/core/initfs.cpp b/source/core/initfs.cpp index 3c1d3e473..790e5ba77 100644 --- a/source/core/initfs.cpp +++ b/source/core/initfs.cpp @@ -288,7 +288,7 @@ const char* iwad_reserved_ex[12] = { ".map", "menudef", "gldefs", "zscript", "ma const char** iwad_reserved() { return (g_gameType & GAMEFLAG_PSEXHUMED) ? iwad_reserved_ex : - (g_gameType & GAMEFLAG_SW) ? iwad_reserved_sw : + isSWALL() ? iwad_reserved_sw : (g_gameType & GAMEFLAG_BLOOD) ? iwad_reserved_blood : iwad_reserved_duke; } diff --git a/source/core/inputstate.cpp b/source/core/inputstate.cpp index a87a24219..d2c1b1333 100644 --- a/source/core/inputstate.cpp +++ b/source/core/inputstate.cpp @@ -291,7 +291,7 @@ CCMD(weapalt) CCMD(useitem) { - int max = (g_gameType & GAMEFLAG_PSEXHUMED)? 6 : (g_gameType & GAMEFLAG_SW)? 7 : isBlood() ? 4 : 5; + int max = (g_gameType & GAMEFLAG_PSEXHUMED)? 6 : isSWALL()? 7 : isBlood() ? 4 : 5; if (argv.argc() != 2) { Printf("useitem : activates an inventory item (1-%d)", max); diff --git a/source/core/menu/razemenu.cpp b/source/core/menu/razemenu.cpp index 4fd16e1f9..fddf91269 100644 --- a/source/core/menu/razemenu.cpp +++ b/source/core/menu/razemenu.cpp @@ -374,7 +374,7 @@ static DMenuItemBase* CreateCustomListMenuItemText(double x, double y, int heigh { const char* classname = isBlood() ? "ListMenuItemBloodTextItem" : - (g_gameType & GAMEFLAG_SW) ? "ListMenuItemSWTextItem" : + isSWALL() ? "ListMenuItemSWTextItem" : (g_gameType & GAMEFLAG_PSEXHUMED) ? "ListMenuItemExhumedTextItem" : "ListMenuItemDukeTextItem"; auto c = PClass::FindClass(classname); auto p = c->CreateNew(); @@ -602,7 +602,7 @@ void SetDefaultMenuColors() gameinfo.mSliderColor = "Red"; cls = PClass::FindClass("BloodMenuDelegate"); } - else if (g_gameType & GAMEFLAG_SW) + else if (isSWALL()) { OptionSettings.mFontColorHeader = CR_DARKRED; OptionSettings.mFontColorHighlight = CR_WHITE; diff --git a/source/core/raze_music.cpp b/source/core/raze_music.cpp index 4e7e941f5..a27b4146f 100644 --- a/source/core/raze_music.cpp +++ b/source/core/raze_music.cpp @@ -150,7 +150,7 @@ FileReader OpenMusic(const char* musicname) if (newlumpnum >= 0) lumpnum = newlumpnum; } - if (lumpnum == -1 && (g_gameType & GAMEFLAG_SW)) + if (lumpnum == -1 && isSWALL()) { // Some Shadow Warrior distributions have the music in a subfolder named 'classic'. Check that, too. FStringf aliasMusicname("classic/music/%s", musicname); diff --git a/source/core/searchpaths.cpp b/source/core/searchpaths.cpp index 0d9dd01be..ad51036f2 100644 --- a/source/core/searchpaths.cpp +++ b/source/core/searchpaths.cpp @@ -933,7 +933,7 @@ const char* G_DefaultDefFile(void) if (g_gameType & GAMEFLAG_WW2GI) return "ww2gi.def"; - if (g_gameType & GAMEFLAG_SW) + if (isSWALL()) return "sw.def"; if (g_gameType & GAMEFLAG_PSEXHUMED) diff --git a/source/core/statusbar2.cpp b/source/core/statusbar2.cpp index 1b9407820..870f21dba 100644 --- a/source/core/statusbar2.cpp +++ b/source/core/statusbar2.cpp @@ -166,7 +166,7 @@ void drawMapTitle() double alpha = levelTextTime > 16? 1.0 : levelTextTime / 16.; if (alpha > 0) { - double scale = (g_gameType & GAMEFLAG_RRALL)? 0.4 : (g_gameType & GAMEFLAG_SW)? 0.7 : 1.0; + double scale = (g_gameType & GAMEFLAG_RRALL)? 0.4 : isSWALL()? 0.7 : 1.0; auto text = currentLevel->DisplayName(); auto myfont = PickBigFont(text); double x = 160 - myfont->StringWidth(text) * scale / 2.;