GB Video: Fix sprite palettes

This commit is contained in:
Jeffrey Pfau 2016-01-22 00:18:27 -08:00
parent ff2641cbcc
commit 6fb8e296d4
1 changed files with 2 additions and 1 deletions

View File

@ -256,6 +256,7 @@ static void GBVideoSoftwareRendererDrawObj(struct GBVideoSoftwareRenderer* rende
if (x < 0) {
x = 0;
}
int p = GBObjAttributesGetPalette(obj->attr);
for (; x < end; ++x) {
int bottomX;
if (GBObjAttributesIsXFlip(obj->attr)) {
@ -270,7 +271,7 @@ static void GBVideoSoftwareRendererDrawObj(struct GBVideoSoftwareRenderer* rende
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)];
}
}
}