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

This commit is contained in:
Rachael Alexanderson 2020-09-05 06:18:41 -04:00
parent d1a6831f06
commit 91a4e6aed4
2 changed files with 15 additions and 1 deletions

View file

@ -2967,8 +2967,21 @@ static void FixUnityStatusBar()
if (gameinfo.flags & GI_ALWAYSCENTERSBAR) if (gameinfo.flags & GI_ALWAYSCENTERSBAR)
{ {
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) if (!sbartex)
return; 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->GetTexelWidth() > 320 &&
!sbartex->GetTexelLeftOffset(0) && !sbartex->GetTexelTopOffset(0)) !sbartex->GetTexelLeftOffset(0) && !sbartex->GetTexelTopOffset(0))
{ {

View file

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