- 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.
This commit is contained in:
Christoph Oelckers 2020-10-24 16:59:57 +02:00
parent ce17f1aa49
commit 79944ca76a
2 changed files with 9 additions and 26 deletions

View file

@ -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); sbartex->SetOffsets(0, (sbartex->GetTexelWidth() - 320) / 2, 0);
sbartex->SetOffsets(1, (sbartex->GetTexelWidth() - 320) / 2, 0);
// 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);
}
} }
} }
@ -3374,7 +3358,7 @@ static int D_DoomMain_Internal (void)
TexAnim.Init(); TexAnim.Init();
C_InitConback(); C_InitConback();
FixUnityStatusBar(); FixWideStatusBar();
StartScreen->Progress(); StartScreen->Progress();
V_InitFonts(); V_InitFonts();

View file

@ -359,7 +359,6 @@ Intermission Inter_Bunny
Intermission TheEnd Intermission TheEnd
{ {
// no backgrounds are set here so this will reuse the previous one.
Image Image
{ {
Draw = "END0", 108, 68 Draw = "END0", 108, 68