Fix sorting in _composite

This commit is contained in:
Jeffrey Pfau 2013-09-26 10:35:26 -07:00
parent a7182b8df9
commit 187e099f25
1 changed files with 1 additions and 1 deletions

View File

@ -635,7 +635,7 @@ static void _composite(struct GBAVideoSoftwareRenderer* renderer, int offset, ui
// We stash the priority on the top bits so we can do a one-operator comparison // We stash the priority on the top bits so we can do a one-operator comparison
// The lower the number, the higher the priority, and sprites take precendence over backgrounds // The lower the number, the higher the priority, and sprites take precendence over backgrounds
// We want to do special processing if the color pixel is target 1, however // We want to do special processing if the color pixel is target 1, however
if (color < current) { if ((color & 0xF8000000) < (current & 0xF8000000)) {
if (current & FLAG_UNWRITTEN) { if (current & FLAG_UNWRITTEN) {
renderer->row[offset] = color; renderer->row[offset] = color;
} else if (!(color & FLAG_TARGET_1) || !(current & FLAG_TARGET_2)) { } else if (!(color & FLAG_TARGET_1) || !(current & FLAG_TARGET_2)) {