GBA Video: Fix OpenGL sprite flag priority
Vicki Pfau vi@endrift.com
Wed, 29 Jan 2020 18:04:14 -0800
2 files changed,
4 insertions(+),
3 deletions(-)
M
CHANGES
→
CHANGES
@@ -12,6 +12,7 @@ - GBA Video: Fix OAM not invalidating after reset (fixes mgba.io/i/1630)
- GBA Video: Latch scanline at end of Hblank (fixes mgba.io/i/1319) - GBA Video: Fix Hblank timing - 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.c
→
src/gba/renderers/gl.c
@@ -1711,13 +1711,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 }); }