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(+),
2 deletions(-)
M
CHANGES
→
CHANGES
@@ -12,6 +12,7 @@ - GBA Video: Don't draw sprites using unmapped VRAM in GL renderer (fixes mgba.io/i/1865)
- GBA Video: Fix rare regression blending semitransparent sprites (fixes mgba.io/i/1876) - 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) Other fixes: - 3DS: Redo video sync to be more precise - 3DS: Fix crash with libctru 2.0 when exiting
M
src/gba/renderers/gl.c
→
src/gba/renderers/gl.c
@@ -410,8 +410,11 @@ " discard;\n"
" }\n" " int address = charBase + (coord.x >> 8) + (coord.y >> 8) * size.x;\n" " vec4 twoEntries = texelFetch(vram, ivec2((address >> 1) & 255, address >> 9), 0);\n" - " ivec2 entry = ivec2(twoEntries[3 - 2 * (address & 1)] * 15.9, twoEntries[2 - 2 * (address & 1)] * 15.9);\n" - " int paletteEntry = palette[entry.y * 16 + entry.x];\n" + " int entry = int(twoEntries[2 - 2 * (address & 1)] * 15.9) * 16 + int(twoEntries[3 - 2 * (address & 1)] * 15.9);\n" + " if (entry == 0) {\n" + " discard;\n" + " }\n" + " int paletteEntry = palette[entry];\n" " color = vec4(PALETTE_ENTRY(paletteEntry), 1.);\n" " flags = inflags;\n" "}";