Skip to content

Commit

Permalink
- For status bars for the Unity iwad - only force offsets if the widt…
Browse files Browse the repository at this point in the history
…h is greater than 320.
  • Loading branch information
madame-rachelle committed Sep 4, 2020
1 parent 0204051 commit 6c514a4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/d_main.cpp
Expand Up @@ -2969,8 +2969,11 @@ static void FixUnityStatusBar()
FGameTexture* sbartex = TexMan.FindGameTexture("stbar", ETextureType::MiscPatch);
if (!sbartex)
return;
sbartex->SetOffsets(0, (sbartex->GetTexelWidth() - 320) / 2, 0);
sbartex->SetOffsets(1, (sbartex->GetTexelWidth() - 320) / 2, 0);
if (sbartex->GetTexelWidth() > 320)
{
sbartex->SetOffsets(0, (sbartex->GetTexelWidth() - 320) / 2, 0);
sbartex->SetOffsets(1, (sbartex->GetTexelWidth() - 320) / 2, 0);
}
}
}

Expand Down

1 comment on commit 6c514a4

@coelckers
Copy link
Member

@coelckers coelckers commented on 6c514a4 Sep 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't set offsets if the texture already has non-zero ones. Otherwise it may misalign some (rare) custom mods.
I also don't think that the flag here is a good idea because it won't allow wide status bars made for Unity to work with the original WADs. This should be 100% transparent, i.e. check what the graphic contains and position it properly.

Please sign in to comment.