mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 14:51:40 +00:00
- 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:
parent
ce17f1aa49
commit
79944ca76a
2 changed files with 9 additions and 26 deletions
|
@ -2964,34 +2964,18 @@ static void CheckForHacks(BuildInfo& buildinfo)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void FixUnityStatusBar()
|
static void FixWideStatusBar()
|
||||||
{
|
|
||||||
if (gameinfo.flags & GI_FIXUNITYSBAR)
|
|
||||||
{
|
{
|
||||||
FGameTexture* sbartex = TexMan.FindGameTexture("stbar", ETextureType::MiscPatch);
|
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
|
// only adjust offsets if none already exist
|
||||||
if (sbartex->GetTexelWidth() > 320 &&
|
if (sbartex && sbartex->GetTexelWidth() > 320 &&
|
||||||
!sbartex->GetTexelLeftOffset(0) && !sbartex->GetTexelTopOffset(0))
|
!sbartex->GetTexelLeftOffset(0) && !sbartex->GetTexelTopOffset(0))
|
||||||
{
|
{
|
||||||
sbartex->SetOffsets(0, (sbartex->GetTexelWidth() - 320) / 2, 0);
|
sbartex->SetOffsets(0, (sbartex->GetTexelWidth() - 320) / 2, 0);
|
||||||
sbartex->SetOffsets(1, (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();
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue