Flip sprites vertically after applying boundary operations

This commit is contained in:
Jeffrey Pfau 2013-04-25 01:55:47 -07:00
parent cea8109c06
commit fefbf7a296
1 changed files with 3 additions and 3 deletions

View File

@ -402,12 +402,12 @@ static void _drawSprite(struct GBAVideoSoftwareRenderer* renderer, struct GBAObj
};
int x = sprite->x;
int inY = y - sprite->y;
if (sprite->vflip) {
inY = height - inY - 1;
}
if (sprite->y + height - 256 >= 0) {
inY += 256;
}
if (sprite->vflip) {
inY = height - inY - 1;
}
unsigned charBase = BASE_TILE + sprite->tile * 0x20;
unsigned yBase = (inY & ~0x7) * 0x80 + (inY & 0x7) * 4;
for (int outX = x >= 0 ? x : 0; outX < x + width && outX < VIDEO_HORIZONTAL_PIXELS; ++outX) {