From b79622bcbad74094c18a61c468bc3157c21e02a3 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 1 Nov 2018 10:51:57 +0100 Subject: [PATCH] - added far stronger restrictions for when the Boom-Texture-Y-offset compatibility flag may trigger. This had absolutely no sanity checks and unconditionally picked the source texture if one existed. It should only be done for wall textures, only for those defined in TEXTUREx and only for those where the scale is identical with the underlying texture. --- src/textures/formats/multipatchtexture.cpp | 6 +++--- src/textures/textures.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/textures/formats/multipatchtexture.cpp b/src/textures/formats/multipatchtexture.cpp index 3027048d6..fb9381808 100644 --- a/src/textures/formats/multipatchtexture.cpp +++ b/src/textures/formats/multipatchtexture.cpp @@ -234,7 +234,7 @@ FMultiPatchTexture::FMultiPatchTexture (const void *texdef, FPatchLookup *patchl int i; mtexture.d = (const maptexture_t *)texdef; - bMultiPatch = true; + bMultiPatch = 1; if (strife) { @@ -713,7 +713,7 @@ FTexture *FMultiPatchTexture::GetRedirect() FTexture *FMultiPatchTexture::GetRawTexture() { - return NumParts == 1 ? Parts->Texture : this; + return NumParts == 1 && UseType == ETextureType::Wall && bMultiPatch == 1 && Scale == Parts->Texture->Scale ? Parts->Texture : this; } //========================================================================== @@ -1071,7 +1071,7 @@ FMultiPatchTexture::FMultiPatchTexture (FScanner &sc, ETextureType usetype) TArray inits; bool bSilent = false; - bMultiPatch = true; + bMultiPatch = 2; sc.SetCMode(true); sc.MustGetString(); const char* textureName = NULL; diff --git a/src/textures/textures.h b/src/textures/textures.h index e41c7a447..d064441d1 100644 --- a/src/textures/textures.h +++ b/src/textures/textures.h @@ -263,7 +263,7 @@ public: uint8_t bComplex:1; // Will be used to mark extended MultipatchTextures that have to be // fully composited before subjected to any kind of postprocessing instead of // doing it per patch. - uint8_t bMultiPatch:1; // This is a multipatch texture (we really could use real type info for textures...) + uint8_t bMultiPatch:2; // This is a multipatch texture (we really could use real type info for textures...) uint8_t bKeepAround:1; // This texture was used as part of a multi-patch texture. Do not free it. uint8_t bFullNameTexture : 1; uint8_t bBrightmapChecked : 1; // Set to 1 if brightmap has been checked