Added NoTrim for TEXTURES.

- This can be applied either in or outside of a definition of a sprite.
- Simply adding "NoTrim" inside a definition will apply it.
- Syntax outside of a sprite is `NoTrim <SpriteName>`.
This commit is contained in:
Major Cooke 2021-12-14 02:32:40 -06:00 committed by Christoph Oelckers
commit bbd91be5d5
5 changed files with 26 additions and 1 deletions

View file

@ -811,6 +811,22 @@ void FTextureManager::ParseTextureDef(int lump, FMultipatchTextureBuilder &build
}
//else Printf("Unable to define hires texture '%s'\n", tex->Name);
}
else if (sc.Compare("notrim"))
{
sc.MustGetString();
FTextureID id = TexMan.CheckForTexture(sc.String, ETextureType::Sprite);
if (id.isValid())
{
FGameTexture *tex = TexMan.GetGameTexture(id);
if (tex) tex->SetNoTrimming(true);
else sc.ScriptError("NoTrim: %s not found", sc.String);
}
else
sc.ScriptError("NoTrim: %s is not a sprite", sc.String);
}
else if (sc.Compare("texture"))
{
build.ParseTexture(sc, ETextureType::Override, lump);