Omit sprites that are off-screen vertically from OAM calculations

This commit is contained in:
Jeffrey Pfau 2014-01-31 22:40:21 -08:00
parent bab92ba659
commit 6ad2b673b1
1 changed files with 6 additions and 4 deletions

View File

@ -378,12 +378,14 @@ static void _cleanOAM(struct GBAVideoSoftwareRenderer* renderer) {
if (obj->transformed) {
height <<= ((struct GBATransformedObj*) obj)->doublesize;
}
if (obj->y < VIDEO_VERTICAL_PIXELS || obj->y + height >= VIDEO_VERTICAL_TOTAL_PIXELS) {
renderer->sprites[oamMax].y = obj->y;
renderer->sprites[oamMax].endY = obj->y + height;
renderer->sprites[oamMax].obj = *obj;
++oamMax;
}
}
}
renderer->oamMax = oamMax;
renderer->oamDirty = 0;
}