From 7134f53638de8e7b68f01961b642f33a8fbe645a Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Wed, 9 Mar 2016 13:17:42 +0200 Subject: [PATCH] - fixed: partial transparency wasn't taken into account Smoothing of edges could mark textures as non-transparent when hqNx upscale filter is used See http://forum.drdteam.org/viewtopic.php?t=6812 --- src/gl/textures/gl_texture.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/gl/textures/gl_texture.cpp b/src/gl/textures/gl_texture.cpp index cc2905bb9..0ad87fbfe 100644 --- a/src/gl/textures/gl_texture.cpp +++ b/src/gl/textures/gl_texture.cpp @@ -547,6 +547,7 @@ bool FTexture::SmoothEdges(unsigned char * buffer,int w, int h) int x,y; bool trans=buffer[MSB]==0; // If I set this to false here the code won't detect textures // that only contain transparent pixels. + bool semitrans = false; unsigned char * l1; if (h<=1 || w<=1) return false; // makes (a) no sense and (b) doesn't work with this code! @@ -555,35 +556,44 @@ bool FTexture::SmoothEdges(unsigned char * buffer,int w, int h) if (l1[MSB]==0 && !CHKPIX(1)) CHKPIX(w); + else if (l1[MSB]<255) semitrans=true; l1+=4; for(x=1;x