mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-02-26 05:41:07 +00:00
- fixed the substitution logic in FTexture::GetRawTexture.
This may only perform a substitution if the offset is not 0 and if the size matches.
This commit is contained in:
parent
6ba8067499
commit
7606b22d0b
1 changed files with 10 additions and 1 deletions
|
@ -226,7 +226,7 @@ FTexture *FTexture::GetRawTexture()
|
||||||
if (OffsetLess) return OffsetLess;
|
if (OffsetLess) return OffsetLess;
|
||||||
// Reject anything that cannot have been a single-patch multipatch texture in vanilla.
|
// Reject anything that cannot have been a single-patch multipatch texture in vanilla.
|
||||||
auto image = static_cast<FMultiPatchTexture *>(GetImage());
|
auto image = static_cast<FMultiPatchTexture *>(GetImage());
|
||||||
if (bMultiPatch != 1 || UseType != ETextureType::Wall || Scale.X != 1 || Scale.Y != 1 || bWorldPanning || image == nullptr || image->NumParts != 1)
|
if (bMultiPatch != 1 || UseType != ETextureType::Wall || Scale.X != 1 || Scale.Y != 1 || bWorldPanning || image == nullptr || image->NumParts != 1 || _TopOffset[0] == 0)
|
||||||
{
|
{
|
||||||
OffsetLess = this;
|
OffsetLess = this;
|
||||||
return this;
|
return this;
|
||||||
|
@ -234,6 +234,15 @@ FTexture *FTexture::GetRawTexture()
|
||||||
// Set up a new texture that directly references the underlying patch.
|
// Set up a new texture that directly references the underlying patch.
|
||||||
// From here we cannot retrieve the original texture made for it, so just create a new one.
|
// From here we cannot retrieve the original texture made for it, so just create a new one.
|
||||||
FImageSource *source = image->Parts[0].Image;
|
FImageSource *source = image->Parts[0].Image;
|
||||||
|
|
||||||
|
// Size must match for this to work as intended
|
||||||
|
if (source->GetWidth() != Width || source->GetHeight() != Height)
|
||||||
|
{
|
||||||
|
OffsetLess = this;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
OffsetLess = new FImageTexture(source, "");
|
OffsetLess = new FImageTexture(source, "");
|
||||||
TexMan.AddTexture(OffsetLess);
|
TexMan.AddTexture(OffsetLess);
|
||||||
return OffsetLess;
|
return OffsetLess;
|
||||||
|
|
Loading…
Reference in a new issue