From 0204051381346a5edd9df7b2184d3be6fab231e1 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Thu, 3 Sep 2020 23:36:19 -0400 Subject: [PATCH] - add support for the (as of now) newest version of the Unity re-releases --- src/d_iwad.cpp | 7 +++++++ src/d_main.cpp | 14 ++++++++++++++ src/gamedata/gi.h | 1 + src/win32/i_steam.cpp | 4 +++- wadsrc/static/mapinfo/doom2unity.txt | 2 +- wadsrc_extra/static/iwadinfo.txt | 4 ++++ 6 files changed, 30 insertions(+), 2 deletions(-) diff --git a/src/d_iwad.cpp b/src/d_iwad.cpp index bbecbf81b..ceedcd51b 100644 --- a/src/d_iwad.cpp +++ b/src/d_iwad.cpp @@ -184,6 +184,13 @@ void FIWadManager::ParseIWadInfo(const char *fn, const char *data, int datasize, if (sc.Number) iwad->flags |= GI_IGNORETITLEPATCHES; else iwad->flags &= ~GI_IGNORETITLEPATCHES; } + else if (sc.Compare("AlwaysCenterStatusBar")) + { + sc.MustGetStringName("="); + sc.MustGetNumber(); + if (sc.Number) iwad->flags |= GI_ALWAYSCENTERSBAR; + else iwad->flags &= ~GI_ALWAYSCENTERSBAR; + } else if (sc.Compare("Load")) { sc.MustGetStringName("="); diff --git a/src/d_main.cpp b/src/d_main.cpp index f8f728ef2..8990c82bd 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -2962,6 +2962,18 @@ static void CheckForHacks(BuildInfo& buildinfo) } } +static void FixUnityStatusBar() +{ + if (gameinfo.flags & GI_ALWAYSCENTERSBAR) + { + FGameTexture* sbartex = TexMan.FindGameTexture("stbar", ETextureType::MiscPatch); + if (!sbartex) + return; + sbartex->SetOffsets(0, (sbartex->GetTexelWidth() - 320) / 2, 0); + sbartex->SetOffsets(1, (sbartex->GetTexelWidth() - 320) / 2, 0); + } +} + //========================================================================== // // @@ -3352,6 +3364,8 @@ static int D_DoomMain_Internal (void) TexAnim.Init(); C_InitConback(); + FixUnityStatusBar(); + StartScreen->Progress(); V_InitFonts(); V_LoadTranslations(); diff --git a/src/gamedata/gi.h b/src/gamedata/gi.h index d2fd86b1a..6f1eaa90f 100644 --- a/src/gamedata/gi.h +++ b/src/gamedata/gi.h @@ -50,6 +50,7 @@ enum GI_COMPATPOLY1 = 0x00000040, // Hexen's MAP36 needs old polyobject drawing GI_COMPATPOLY2 = 0x00000080, // so does HEXDD's MAP47 GI_IGNORETITLEPATCHES = 0x00000200, // Ignore the map name graphics when not runnning in English language + GI_ALWAYSCENTERSBAR = 0x00000400, // Always center the status bar }; #include "gametype.h" diff --git a/src/win32/i_steam.cpp b/src/win32/i_steam.cpp index ca0373474..5a4ee90ef 100644 --- a/src/win32/i_steam.cpp +++ b/src/win32/i_steam.cpp @@ -199,7 +199,9 @@ TArray I_GetSteamPath() "hexen deathkings of the dark citadel/base", "ultimate doom/base", "DOOM 3 BFG Edition/base/wads", - "Strife" + "Strife", + "Ultimate Doom/rerelease/DOOM_Data/StreamingAssets", + "Doom 2/rerelease/DOOM II_Data/StreamingAssets" }; FString path; diff --git a/wadsrc/static/mapinfo/doom2unity.txt b/wadsrc/static/mapinfo/doom2unity.txt index 079275486..b5bbb31a3 100644 --- a/wadsrc/static/mapinfo/doom2unity.txt +++ b/wadsrc/static/mapinfo/doom2unity.txt @@ -3,7 +3,7 @@ include "mapinfo/doom2.txt" gameinfo { - titlepage = "DMENUPIC" + } clearepisodes diff --git a/wadsrc_extra/static/iwadinfo.txt b/wadsrc_extra/static/iwadinfo.txt index 56a044445..52d6f699a 100644 --- a/wadsrc_extra/static/iwadinfo.txt +++ b/wadsrc_extra/static/iwadinfo.txt @@ -350,6 +350,7 @@ IWad "DMENUPIC" BannerColors = "00 7c 00", "a8 a8 a8" IgnoreTitlePatches = 1 + AlwaysCenterStatusbar = 1 } IWad @@ -438,6 +439,7 @@ IWad MustContain = "MAP01", "REDTNT2", "DMAPINFO" BannerColors = "00 7c 00", "a8 a8 a8" IgnoreTitlePatches = 1 + AlwaysCenterStatusbar = 1 } IWad @@ -466,6 +468,7 @@ IWad MustContain = "MAP01", "CAMO1", "DMAPINFO" BannerColors = "00 7c 00", "a8 a8 a8" IgnoreTitlePatches = 1 + AlwaysCenterStatusbar = 1 } IWad @@ -510,6 +513,7 @@ IWad BannerColors = "00 7c 00", "a8 a8 a8" IgnoreTitlePatches = 1 Load = "nerveunity.wad" + AlwaysCenterStatusbar = 1 } IWad