all repos — mgba @ 9e3a4f247273db1ec0d1bfb2848c44c363200fd7

mGBA Game Boy Advance Emulator

GBA Video: Fix OpenGL sprite flag priority
Vicki Pfau vi@endrift.com
Wed, 29 Jan 2020 18:04:14 -0800
commit

9e3a4f247273db1ec0d1bfb2848c44c363200fd7

parent

33d1633ada1e250b49dd9365681c99fc239ab290

2 files changed, 4 insertions(+), 3 deletions(-)

jump to
M CHANGESCHANGES

@@ -5,6 +5,7 @@ - GBA Serialize: Fix serializing DMA transfer register

- GBA Serialize: Fix audio DMA timing deserialization - GBA Video: Fix OAM not invalidating after reset (fixes mgba.io/i/1630) - GBA Video: Fix backdrop blending on lines without sprites (fixes mgba.io/i/1647) + - GBA Video: Fix OpenGL sprite flag priority Other fixes: - Qt: Only dynamically reset video scale if a game is running - Qt: Fix race condition with proxied video events
M src/gba/renderers/gl.csrc/gba/renderers/gl.c

@@ -1728,13 +1728,13 @@ uniforms = shader->uniforms;

glStencilFunc(GL_EQUAL, 1, 1); glUseProgram(shader->program); glDrawBuffers(2, (GLenum[]) { GL_NONE, GL_COLOR_ATTACHMENT1 }); - glColorMask(GL_TRUE, GL_FALSE, GL_FALSE, GL_FALSE); glBindVertexArray(shader->vao); glUniform2i(uniforms[GBA_GL_VS_LOC], totalHeight, 0); glUniform2i(uniforms[GBA_GL_VS_MAXPOS], totalWidth, totalHeight); - glUniform4i(uniforms[GBA_GL_OBJ_INFLAGS], GBAObjAttributesCGetPriority(sprite->c), 0, 0, 0); + glUniform4i(uniforms[GBA_GL_OBJ_INFLAGS], GBAObjAttributesCGetPriority(sprite->c), + (renderer->target1Obj || GBAObjAttributesAGetMode(sprite->a) == OBJ_MODE_SEMITRANSPARENT) | (renderer->target2Obj * 2) | (renderer->blendEffect * 4), + renderer->blda, GBAObjAttributesAGetMode(sprite->a) == OBJ_MODE_SEMITRANSPARENT); glDrawArrays(GL_TRIANGLE_FAN, 0, 4); - glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); glDrawBuffers(1, (GLenum[]) { GL_COLOR_ATTACHMENT0 }); }