From 43c260a156a5f8ea2ab27ae4f5613f5a5b46a0fc Mon Sep 17 00:00:00 2001 From: Steam Deck User Date: Sun, 5 Mar 2023 00:24:17 -0500 Subject: [PATCH] Restore support for WAD3 Alpha Masking --- source/psp/wad3.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/psp/wad3.cpp b/source/psp/wad3.cpp index a61b5e4..30426f2 100644 --- a/source/psp/wad3.cpp +++ b/source/psp/wad3.cpp @@ -177,6 +177,11 @@ int ConvertWad3ToRGBA(miptex_t *tex) rgbaData[i * 4 + 1] = palette[colorIndex * 3 + 1]; rgbaData[i * 4 + 2] = palette[colorIndex * 3 + 2]; rgbaData[i * 4 + 3] = 255; // Set alpha to opaque + + if (rgbaData[i * 4] == 0 && rgbaData[i * 4 + 1] == 0 && rgbaData[i * 4 + 2] == 255) { + rgbaData[i * 4] = rgbaData[i * 4 + 1] = rgbaData[i * 4 + 2] = 128; + rgbaData[i * 4 + 3] = 0; + } } int index = GL_LoadImages(tex->name, tex->width, tex->height, rgbaData, qtrue, GU_LINEAR, 0, 4);