GBA Video: Fix mode 4 transparency in OpenGL (fixes #1907)
Vicki Pfau vi@endrift.com
Sun, 11 Oct 2020 16:37:49 -0700
2 files changed,
6 insertions(+),
1 deletions(-)
M
CHANGES
→
CHANGES
@@ -49,6 +49,7 @@ - GBA Video: Fix rare regression blending semitransparent sprites (fixes mgba.io/i/1876)
- GBA Video: Emulate sprite cycle limits in OpenGL renderer (fixes mgba.io/i/1635) - GBA Video: Do not affect OBJ pixel priority when writing OBJWIN (fixes mgba.io/i/1890) - GBA Video: Fix deferred blending when OBJWIN matches window (fixes mgba.io/i/1905) + - GBA Video: Fix mode 4 transparency in OpenGL (fixes mgba.io/i/1907) - SM83: Emulate HALT bug Other fixes: - 3DS: Redo video sync to be more precise
M
src/gba/renderers/gl.c
→
src/gba/renderers/gl.c
@@ -391,7 +391,11 @@ " discard;\n"
" }\n" " int address = charBase + (coord.x >> 8) + (coord.y >> 8) * size.x;\n" " int twoEntries = texelFetch(vram, ivec2((address >> 1) & 255, address >> 9), 0).r;\n" - " int paletteEntry = palette[(twoEntries >> (8 * (address & 1)) & 255)];\n" + " int entry = (twoEntries >> (8 * (address & 1))) & 255;\n" + " if (entry == 0) {\n" + " discard;\n" + " }\n" + " int paletteEntry = palette[entry];\n" " color = vec4(PALETTE_ENTRY(paletteEntry), 1.);\n" "}";