Skip to content

Commit

Permalink
GBA Video: Fix disabling OBJWIN in GL renderer (fixes #1759)
Browse files Browse the repository at this point in the history
  • Loading branch information
endrift committed May 24, 2020
1 parent f78951b commit dd6ba85
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES
Expand Up @@ -23,6 +23,7 @@ Emulation fixes:
- GBA Video: Latch scanline at end of Hblank (fixes mgba.io/i/1319)
- GBA Video: Fix Hblank timing
- GBA Video: Fix mosaic objects drawing past the end (fixes mgba.io/i/1702)
- GBA Video: Fix disabling OBJWIN in GL renderer (fixes mgba.io/i/1759)
Other fixes:
- CMake: Always use devkitPro toolchain when applicable (fixes mgba.io/i/1755)
- Core: Ensure ELF regions can be written before trying
Expand Down
4 changes: 3 additions & 1 deletion src/gba/renderers/gl.c
Expand Up @@ -1704,7 +1704,9 @@ void GBAVideoGLRendererDrawSprite(struct GBAVideoGLRenderer* renderer, struct GB
glUniform4i(uniforms[GBA_GL_OBJ_MOSAIC], 0, 0, 0, 0);
}
glStencilFunc(GL_ALWAYS, 1, 1);
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
if (GBAObjAttributesAGetMode(sprite->a) != OBJ_MODE_OBJWIN || GBARegisterDISPCNTIsObjwinEnable(renderer->dispcnt)) {
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
}

shader = &renderer->objShader[2];
uniforms = shader->uniforms;
Expand Down

0 comments on commit dd6ba85

Please sign in to comment.