- 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,34 +2964,18 @@ static void CheckForHacks(BuildInfo& buildinfo)
}
}
static void FixUnityStatusBar()
{
if (gameinfo.flags & GI_FIXUNITYSBAR)
static void FixWideStatusBar()
{
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 &&
if (sbartex && 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();
C_InitConback();
FixUnityStatusBar();
FixWideStatusBar();
StartScreen->Progress();
V_InitFonts();

View file

@ -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