From 719169a625df0f9982b4528594c63c8cc1602773 Mon Sep 17 00:00:00 2001
From: Lactozilla <jp6781615@gmail.com>
Date: Sat, 17 Feb 2024 16:51:16 -0300
Subject: [PATCH] R_GenerateTexture: Fix translucent pixels being visible on
 empty pixels

---
 src/r_textures.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/r_textures.c b/src/r_textures.c
index 0175a080e7..59cc114139 100644
--- a/src/r_textures.c
+++ b/src/r_textures.c
@@ -193,6 +193,8 @@ static void R_DrawBlendColumnInCache(column_t *column, UINT8 *cache, texpatch_t
 		{
 			for (; dest < cache + position + count; source++, dest++, is_opaque++)
 			{
+				if (originPatch->alpha <= ASTTextureBlendingThreshold[1] && !(*is_opaque))
+					continue;
 				*dest = ASTBlendPaletteIndexes(*dest, *source, originPatch->style, originPatch->alpha);
 				*is_opaque = true;
 			}
@@ -237,6 +239,8 @@ static void R_DrawBlendFlippedColumnInCache(column_t *column, UINT8 *cache, texp
 		{
 			for (; dest < cache + position + count; --source, dest++, is_opaque++)
 			{
+				if (originPatch->alpha <= ASTTextureBlendingThreshold[1] && !(*is_opaque))
+					continue;
 				*dest = ASTBlendPaletteIndexes(*dest, *source, originPatch->style, originPatch->alpha);
 				*is_opaque = true;
 			}
-- 
GitLab