GB Video: Fix sprite palettes
Jeffrey Pfau jeffrey@endrift.com
Fri, 22 Jan 2016 00:18:27 -0800
1 files changed,
2 insertions(+),
1 deletions(-)
jump to
M
src/gb/renderers/software.c
→
src/gb/renderers/software.c
@@ -256,6 +256,7 @@ int x = obj->x - 8;
if (x < 0) { x = 0; } + int p = GBObjAttributesGetPalette(obj->attr); for (; x < end; ++x) { int bottomX; if (GBObjAttributesIsXFlip(obj->attr)) {@@ -270,7 +271,7 @@ tileDataUpper >>= bottomX;
tileDataLower >>= bottomX; color_t current = renderer->row[x]; if (((tileDataUpper | tileDataLower) & 1) && (!GBObjAttributesIsPriority(obj->attr) || current == GB_PALETTE[0])) { - renderer->row[x] = renderer->bgPalette[((tileDataUpper & 1) << 1) | (tileDataLower & 1)]; + renderer->row[x] = renderer->objPalette[p][((tileDataUpper & 1) << 1) | (tileDataLower & 1)]; } } }