From 9ba250e9bb85b8ff61f5ebc06006161611d44bda Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Wed, 5 Nov 2014 05:07:44 -0800 Subject: [PATCH] GBA Video: Fix rendering of sprites with objwin passthrough (fixes #128) --- src/gba/renderers/video-software.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/gba/renderers/video-software.c b/src/gba/renderers/video-software.c index 2622b27a4..e11726156 100644 --- a/src/gba/renderers/video-software.c +++ b/src/gba/renderers/video-software.c @@ -1631,6 +1631,15 @@ static void _postprocessSprite(struct GBAVideoSoftwareRenderer* renderer, unsign } } return; + } else { + for (x = 0; x < VIDEO_HORIZONTAL_PIXELS; ++x, ++pixel) { + uint32_t color = renderer->spriteLayer[x] & ~FLAG_OBJWIN; + uint32_t current = *pixel; + if ((color & FLAG_UNWRITTEN) != FLAG_UNWRITTEN && (color & FLAG_PRIORITY) >> OFFSET_PRIORITY == priority) { + _compositeBlendObjwin(renderer, pixel, color | flags, current); + } + } + return; } } for (x = 0; x < VIDEO_HORIZONTAL_PIXELS; ++x, ++pixel) {