diff options
Diffstat (limited to 'arm9/source/devices')
-rw-r--r-- | arm9/source/devices/screen.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/arm9/source/devices/screen.c b/arm9/source/devices/screen.c index f1aa7f9..e394b55 100644 --- a/arm9/source/devices/screen.c +++ b/arm9/source/devices/screen.c @@ -244,11 +244,11 @@ void scr_draw_line(ScreenDevice *scr, u16 *layer, u8 draw) { s16 x_end = (s16) scr->px; s16 y_end = (s16) scr->py; - s16 dx = abs(x_end - x); - s16 dy = -abs(y_end - y); + s32 dx = abs(x_end - x); + s32 dy = -abs(y_end - y); s16 sx = x < x_end ? 1 : -1; s16 sy = y < y_end ? 1 : -1; - s16 e1 = dx + dy; + s32 e1 = dx + dy; if (draw & 0x10) { // Draw 1-bit textured line. @@ -260,7 +260,7 @@ void scr_draw_line(ScreenDevice *scr, u16 *layer, u8 draw) { if (scr->sprite.sprite[y%8][x%8]) { draw_pixel(layer, x, y, c1); } else if (opaque) { draw_pixel(layer, x, y, c0); } if (x == x_end && y == y_end) return; - s16 e2 = e1 << 1; + s32 e2 = e1 << 1; if (e2 >= dy) { e1 += dy; x += sx; } if (e2 <= dx) { e1 += dx; y += sy; } } @@ -270,7 +270,7 @@ void scr_draw_line(ScreenDevice *scr, u16 *layer, u8 draw) { while (1) { draw_pixel(layer, x, y, colour); if (x == x_end && y == y_end) return; - s16 e2 = e1 << 1; + s32 e2 = e1 << 1; if (e2 >= dy) { e1 += dy; x += sx; } if (e2 <= dx) { e1 += dx; y += sy; } } |