From 79944ca76a26b0fc5ad9958a825da8ccda15e13e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 24 Oct 2020 16:59:57 +0200 Subject: [PATCH] - made status bar offset fixing unconditional. I think it is inevitable that such status bars will appear in mods sooner or later and with the old code it is virtually impossible to create a wide status bar that displays properly but gets subjected to this code. --- src/d_main.cpp | 34 +++++++++----------------------- wadsrc/static/mapinfo/common.txt | 1 - 2 files changed, 9 insertions(+), 26 deletions(-) diff --git a/src/d_main.cpp b/src/d_main.cpp index 2029cccb8..c9ad68870 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -2964,32 +2964,16 @@ static void CheckForHacks(BuildInfo& buildinfo) } } -static void FixUnityStatusBar() +static void FixWideStatusBar() { - if (gameinfo.flags & GI_FIXUNITYSBAR) + FGameTexture* sbartex = TexMan.FindGameTexture("stbar", ETextureType::MiscPatch); + + // only adjust offsets if none already exist + if (sbartex && sbartex->GetTexelWidth() > 320 && + !sbartex->GetTexelLeftOffset(0) && !sbartex->GetTexelTopOffset(0)) { - FGameTexture* sbartex = TexMan.FindGameTexture("stbar", ETextureType::MiscPatch); - - // texture not found, we're not here to operate on a non-existent texture so just exit - if (!sbartex) - return; - - // where is this texture located? if it's not in an iwad, then exit - int lumpnum = sbartex->GetSourceLump(); - if (lumpnum >= 0 && lumpnum < fileSystem.GetNumEntries()) - { - int wadno = fileSystem.GetFileContainer(lumpnum); - if (!(wadno >= fileSystem.GetIwadNum() && wadno <= fileSystem.GetMaxIwadNum())) - return; - } - - // only adjust offsets if none already exist - if (sbartex->GetTexelWidth() > 320 && - !sbartex->GetTexelLeftOffset(0) && !sbartex->GetTexelTopOffset(0)) - { - sbartex->SetOffsets(0, (sbartex->GetTexelWidth() - 320) / 2, 0); - sbartex->SetOffsets(1, (sbartex->GetTexelWidth() - 320) / 2, 0); - } + sbartex->SetOffsets(0, (sbartex->GetTexelWidth() - 320) / 2, 0); + sbartex->SetOffsets(1, (sbartex->GetTexelWidth() - 320) / 2, 0); } } @@ -3374,7 +3358,7 @@ static int D_DoomMain_Internal (void) TexAnim.Init(); C_InitConback(); - FixUnityStatusBar(); + FixWideStatusBar(); StartScreen->Progress(); V_InitFonts(); diff --git a/wadsrc/static/mapinfo/common.txt b/wadsrc/static/mapinfo/common.txt index 642eaeac8..6a31743b4 100644 --- a/wadsrc/static/mapinfo/common.txt +++ b/wadsrc/static/mapinfo/common.txt @@ -359,7 +359,6 @@ Intermission Inter_Bunny Intermission TheEnd { - // no backgrounds are set here so this will reuse the previous one. Image { Draw = "END0", 108, 68