- do unity data status bar correction only if stbar is in an iwad

# Conflicts:
#	src/d_main.cpp
#	wadsrc_extra/static/iwadinfo.txt
This commit is contained in:
Rachael Alexanderson 2020-09-05 06:18:41 -04:00 committed by drfrag
parent 258d9dde25
commit 904926e778
2 changed files with 26 additions and 3 deletions

View file

@ -2402,6 +2402,29 @@ static void NewFailure ()
I_FatalError ("Failed to allocate memory from system heap");
}
static void FixUnityStatusBar()
{
if (gameinfo.flags & GI_ALWAYSCENTERSBAR)
{
FTexture* sbartex = TexMan.FindTexture("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 < Wads.GetNumLumps())
{
int wadno = Wads.GetLumpFile(lumpnum);
if (wadno != Wads.GetIwadNum())
return;
}
fixunitystatusbar = true;
}
}
//==========================================================================
//
// D_DoomMain
@ -2641,8 +2664,7 @@ static int D_DoomMain_Internal (void)
TexMan.Init();
C_InitConback();
if (gameinfo.flags & GI_ALWAYSCENTERSBAR)
fixunitystatusbar = true;
FixUnityStatusBar();
StartScreen->Progress();
V_InitFonts();

View file

@ -335,6 +335,7 @@ IWad
"E3M1","E3M2","E3M3","E3M4","E3M5","E3M6","E3M7","E3M8","E3M9",
"DPHOOF","BFGGA0","HEADA1","CYBRA1","SPIDA1D1", "E4M2",
"DMENUPIC"
Load = "extras.wad", "soundtrack"
BannerColors = "00 7c 00", "a8 a8 a8"
AlwaysCenterStatusbar = 1
}
@ -502,7 +503,7 @@ IWad
Compatibility = "Shorttex"
MustContain = "MAP01", "DMENUPIC"
BannerColors = "00 7c 00", "a8 a8 a8"
Load = "nerveunity.wad"
Load = "nerveunity.wad", "extras.wad", "soundtrack"
AlwaysCenterStatusbar = 1
}