From c421a12fea3276d7a9230364d01d7d158015f828 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Fri, 15 May 2020 16:41:39 -0300 Subject: [PATCH] Fix ASTBlendPixel outputting empty pixels if the background pixel was empty, BUT if the foreground pixel had no alpha at all --- src/r_data.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/r_data.c b/src/r_data.c index 831e75bef..21f382845 100644 --- a/src/r_data.c +++ b/src/r_data.c @@ -244,7 +244,13 @@ UINT32 ASTBlendPixel(RGBA_t background, RGBA_t foreground, int style, UINT8 alph // if the background pixel is empty, match software and don't blend anything if (!background.s.alpha) - output.rgba = 0; + { + // ...unless the foreground pixel ISN'T actually translucent. + if (alpha == 0xFF) + output.rgba = foreground.rgba; + else + output.rgba = 0; + } else { UINT8 beta = (0xFF - alpha);