From f7e30acf85082f350fc5fd5fba0273fae4b16daa Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Sun, 8 Nov 2020 21:59:46 +1100 Subject: [PATCH] - gamecontrol.h: Define `GAMEFLAG_WHALL` as bitwise or of `GAMEFLAG_WH` and `GAMEFLAG_WH2`. --- source/core/console/c_notifybuffer.cpp | 4 ++-- source/core/gamecontrol.cpp | 2 +- source/core/gamecontrol.h | 1 + source/core/menu/razemenu.cpp | 2 +- source/core/searchpaths.cpp | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/source/core/console/c_notifybuffer.cpp b/source/core/console/c_notifybuffer.cpp index ff1c8869f..de9ad2709 100644 --- a/source/core/console/c_notifybuffer.cpp +++ b/source/core/console/c_notifybuffer.cpp @@ -116,11 +116,11 @@ void FNotifyBuffer::DrawNative() FFont* font = g_gameType & GAMEFLAG_BLOOD ? SmallFont2 : SmallFont; - int line = (g_gameType & GAMEFLAG_BLOOD)? Top : (g_gameType & GAMEFLAG_SW) ? 40 : (g_gameType & (GAMEFLAG_WH | GAMEFLAG_WH2))? 18 : font->GetDisplacement(); + int line = (g_gameType & GAMEFLAG_BLOOD)? Top : (g_gameType & GAMEFLAG_SW) ? 40 : (g_gameType & GAMEFLAG_WHALL)? 18 : font->GetDisplacement(); bool canskip = (g_gameType & GAMEFLAG_BLOOD); double scale = 1 / (NotifyFontScale * con_notifyscale); int lineadv = font->GetHeight() / NotifyFontScale; - int textleft = (g_gameType & (GAMEFLAG_WH | GAMEFLAG_WH2)) ? 18 : 0; + int textleft = (g_gameType & GAMEFLAG_WHALL) ? 18 : 0; for (unsigned i = topline; i < Text.Size(); ++i) { diff --git a/source/core/gamecontrol.cpp b/source/core/gamecontrol.cpp index cac9d2624..af65cf7bf 100644 --- a/source/core/gamecontrol.cpp +++ b/source/core/gamecontrol.cpp @@ -489,7 +489,7 @@ void CheckFrontend(int flags) { gi = Exhumed::CreateInterface(); } - else if (flags & (GAMEFLAG_WH| GAMEFLAG_WH2)) + else if (flags & GAMEFLAG_WHALL) { gi = Witchaven::CreateInterface(); } diff --git a/source/core/gamecontrol.h b/source/core/gamecontrol.h index aaec5e095..fee494364 100644 --- a/source/core/gamecontrol.h +++ b/source/core/gamecontrol.h @@ -124,6 +124,7 @@ enum GAMEFLAG_DUKEDC = 0x00010000, GAMEFLAG_WH = 0x00020000, GAMEFLAG_WH2 = 0x00040000, + GAMEFLAG_WHALL = GAMEFLAG_WH | GAMEFLAG_WH2, GAMEFLAGMASK = 0x0000FFFF, // flags allowed from grpinfo // We still need these for the parsers. diff --git a/source/core/menu/razemenu.cpp b/source/core/menu/razemenu.cpp index 7c236694d..0e2426312 100644 --- a/source/core/menu/razemenu.cpp +++ b/source/core/menu/razemenu.cpp @@ -589,7 +589,7 @@ void SetDefaultMenuColors() gameinfo.mSliderColor = "Yellow"; cls = PClass::FindClass("ExhumedMenuDelegate"); } - else if (g_gameType & (GAMEFLAG_WH | GAMEFLAG_WH2)) + else if (g_gameType & GAMEFLAG_WHALL) { OptionSettings.mFontColorHeader = CR_DARKGREEN; OptionSettings.mFontColorHighlight = CR_GRAY; diff --git a/source/core/searchpaths.cpp b/source/core/searchpaths.cpp index d74f558c0..b04d577cb 100644 --- a/source/core/searchpaths.cpp +++ b/source/core/searchpaths.cpp @@ -562,7 +562,7 @@ static TArray ParseGrpInfo(const char *fn, FileReader &fr, TMap