From 513cf7cb1539eb1ce6f625f8df8fb41dc13cfc62 Mon Sep 17 00:00:00 2001 From: AShiningRay Date: Fri, 21 Feb 2025 14:28:46 -0300 Subject: [PATCH] PlatformGraphics: Properly handle transparency in drawPixels(short) Seems to fix basically all Karma Studios games. (See Issue #50) Note: They don't render properly unless FreeJ2ME matches their expected resolution, so keep that in mind. --- src/org/recompile/mobile/PlatformGraphics.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/org/recompile/mobile/PlatformGraphics.java b/src/org/recompile/mobile/PlatformGraphics.java index 3c95420a..65d25d1f 100644 --- a/src/org/recompile/mobile/PlatformGraphics.java +++ b/src/org/recompile/mobile/PlatformGraphics.java @@ -708,7 +708,7 @@ public void drawPixels(short[] pixels, boolean transparency, int offset, int sca { int index = offset + (col) + (row * scanlength); data[row * width + col] = pixelToColor(pixels[index], format); - if (!transparency) { data[row * width + col] &= 0x00FFFFFF; } // Clear the alpha channel + if (!transparency) { data[row * width + col] = (data[row * width + col] & 0x00FFFFFF) | 0xFF000000; } // Set alpha to 255 } }