mirror of https://github.com/mgba-emu/mgba.git
Omit sprites that are off-screen vertically from OAM calculations
This commit is contained in:
parent
bab92ba659
commit
6ad2b673b1
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue