From 45ef7bca4fab838ff562ab3d99c2f70423e03e6a Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 17 Nov 2018 18:55:44 +0100 Subject: [PATCH] - fixed: FTexture::SmoothEdges must forward its result to the base texture in case a redirection is in effect. Both need the bMasked flag, or some code will think that the texture is not fully opaque if no holes were found. --- src/hwrenderer/textures/hw_material.h | 2 +- src/textures/texture.cpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/hwrenderer/textures/hw_material.h b/src/hwrenderer/textures/hw_material.h index 581368b55..c35b23c08 100644 --- a/src/hwrenderer/textures/hw_material.h +++ b/src/hwrenderer/textures/hw_material.h @@ -76,7 +76,7 @@ public: } bool isMasked() const { - return !!sourcetex->bMasked; + return sourcetex->bMasked; } bool isExpanded() const { diff --git a/src/textures/texture.cpp b/src/textures/texture.cpp index 75b7e5e7d..85b57798d 100644 --- a/src/textures/texture.cpp +++ b/src/textures/texture.cpp @@ -1351,6 +1351,11 @@ bool FTexture::ProcessData(unsigned char * buffer, int w, int h, bool ispatch) if (bMasked) { bMasked = SmoothEdges(buffer, w, h); + if (!bMasked) + { + auto stex = GetRedirect(); + stex->bMasked = false; // also clear in the base texture if there is a redirection. + } if (bMasked && !ispatch) FindHoles(buffer, w, h); } return true;