mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-03-12 12:12:38 +00:00
Merged https://github.com/coelckers/gzdoom/pull/1520 (Trim Sprite Borders)
This commit is contained in:
parent
2b367a6657
commit
74342513fc
1 changed files with 11 additions and 1 deletions
|
@ -325,6 +325,16 @@ void FGameTexture::SetupSpriteData()
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
CUSTOM_CVAR(Bool, r_trimspriteborders, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
|
||||
{
|
||||
for (int i = 0; i < TexMan.NumTextures(); i++)
|
||||
{
|
||||
auto tex = TexMan.GetGameTexture(FSetTextureID(i));
|
||||
if (tex->GetUseType() == ETextureType::Sprite)
|
||||
tex->SetupSpriteData();
|
||||
}
|
||||
}
|
||||
|
||||
void FGameTexture::SetSpriteRect()
|
||||
{
|
||||
|
||||
|
@ -362,7 +372,7 @@ void FGameTexture::SetSpriteRect()
|
|||
spi.mSpriteRect.width = (float)spi.spriteWidth / fxScale;
|
||||
spi.mSpriteRect.height = (float)spi.spriteHeight / fyScale;
|
||||
|
||||
if (spi.mTrimResult > 0)
|
||||
if (spi.mTrimResult > 0 && r_trimspriteborders)
|
||||
{
|
||||
spi.mSpriteRect.left += (float)spi.trim[0] / fxScale;
|
||||
spi.mSpriteRect.top += (float)spi.trim[1] / fyScale;
|
||||
|
|
Loading…
Reference in a new issue