all repos — mgba @ 3b8639aa0598d00f03bbecf5379ad3a2e3ac0c48

mGBA Game Boy Advance Emulator

GBA Video: Fix OBJWIN mosaic sprites
Jeffrey Pfau jeffrey@endrift.com
Sun, 20 Sep 2015 21:10:02 -0700
commit

3b8639aa0598d00f03bbecf5379ad3a2e3ac0c48

parent

2cbf40cc139713a2edd660b99f74b8f651dd6c0a

1 files changed, 12 insertions(+), 2 deletions(-)

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

@@ -236,7 +236,12 @@ palette = &palette[GBAObjAttributesCGetPalette(sprite->c) << 4];

if (flags & FLAG_OBJWIN) { SPRITE_NORMAL_LOOP(16, OBJWIN); } else if (GBAObjAttributesAIsMosaic(sprite->a)) { - SPRITE_MOSAIC_LOOP(16, NORMAL); + if (objwinSlowPath) { + objwinPalette = &objwinPalette[GBAObjAttributesCGetPalette(sprite->c) << 4]; + SPRITE_MOSAIC_LOOP(16, NORMAL_OBJWIN); + } else { + SPRITE_MOSAIC_LOOP(16, NORMAL); + } } else if (objwinSlowPath) { objwinPalette = &objwinPalette[GBAObjAttributesCGetPalette(sprite->c) << 4]; SPRITE_NORMAL_LOOP(16, NORMAL_OBJWIN);

@@ -247,7 +252,12 @@ } else {

if (flags & FLAG_OBJWIN) { SPRITE_NORMAL_LOOP(256, OBJWIN); } else if (GBAObjAttributesAIsMosaic(sprite->a)) { - SPRITE_MOSAIC_LOOP(256, NORMAL); + if (objwinSlowPath) { + objwinPalette = &objwinPalette[GBAObjAttributesCGetPalette(sprite->c) << 4]; + SPRITE_MOSAIC_LOOP(256, NORMAL_OBJWIN); + } else { + SPRITE_MOSAIC_LOOP(256, NORMAL); + } } else if (objwinSlowPath) { SPRITE_NORMAL_LOOP(256, NORMAL_OBJWIN); } else {