all repos — mgba @ 8f77c9ffab8cf2e61691395c00dd3e3a45534c8e

mGBA Game Boy Advance Emulator

GBA Video: Fix regression with sprite visibility
Jeffrey Pfau jeffrey@endrift.com
Wed, 17 Jun 2015 22:49:09 -0700
commit

8f77c9ffab8cf2e61691395c00dd3e3a45534c8e

parent

e84a01f219b0b40cbf8c892a0d2af48ad2c6ed30

1 files changed, 6 insertions(+), 1 deletions(-)

jump to
M src/gba/renderers/video-software.csrc/gba/renderers/video-software.c

@@ -736,7 +736,7 @@ for (w = 0; w < renderer->nWindows; ++w) {

renderer->start = renderer->end; renderer->end = renderer->windows[w].endX; renderer->currentWindow = renderer->windows[w].control; - if (GBAWindowControlIsObjEnable(renderer->currentWindow.packed) && spriteLayers & (1 << priority)) { + if (spriteLayers & (1 << priority)) { _postprocessSprite(renderer, priority); } if (TEST_LAYER_ENABLED(0) && GBARegisterDISPCNTGetMode(renderer->dispcnt) < 2) {

@@ -1883,6 +1883,9 @@ bool objwinOnly = false;

if (objwinSlowPath) { objwinDisable = !GBAWindowControlIsObjEnable(renderer->objwin.packed); objwinOnly = !objwinDisable && !GBAWindowControlIsObjEnable(renderer->currentWindow.packed); + if (objwinDisable && !GBAWindowControlIsObjEnable(renderer->currentWindow.packed)) { + return; + } if (objwinDisable) { for (x = renderer->start; x < renderer->end; ++x, ++pixel) {

@@ -1912,6 +1915,8 @@ }

} return; } + } else if (!GBAWindowControlIsObjEnable(renderer->currentWindow.packed)) { + return; } for (x = renderer->start; x < renderer->end; ++x, ++pixel) { uint32_t color = renderer->spriteLayer[x] & ~FLAG_OBJWIN;