Support OBJWIN in mode 4

This commit is contained in:
Jeffrey Pfau 2013-10-26 02:26:08 -07:00
parent 38116f0ead
commit 6376a1ff7f
1 changed files with 6 additions and 5 deletions

View File

@ -1103,11 +1103,12 @@ static void _drawBackgroundMode4(struct GBAVideoSoftwareRenderer* renderer, stru
color = ((uint8_t*)renderer->d.vram)[offset + (localX >> 8) + (localY >> 8) * VIDEO_HORIZONTAL_PIXELS]; color = ((uint8_t*)renderer->d.vram)[offset + (localX >> 8) + (localY >> 8) * VIDEO_HORIZONTAL_PIXELS];
uint32_t current = renderer->row[outX]; uint32_t current = renderer->row[outX];
if (color && !(current & FLAG_FINALIZED) && (!objwinSlowPath || !(current & FLAG_OBJWIN) != objwinOnly)) { if (color && !(current & FLAG_FINALIZED)) {
if (!variant) { if (!objwinSlowPath) {
_composite(renderer, outX, renderer->normalPalette[color] | flags, current); _composite(renderer, outX, palette[color] | flags, current);
} else { } else if (objwinForceEnable || !(current & FLAG_OBJWIN) == objwinOnly) {
_composite(renderer, outX, renderer->variantPalette[color] | flags, current); color_t* currentPalette = (current & FLAG_OBJWIN) ? objwinPalette : palette;
_composite(renderer, outX, currentPalette[color] | flags, current);
} }
} }
} }