mirror of
https://git.planet-casio.com/Lephenixnoir/gint.git
synced 2025-01-01 14:33:34 +01:00
display-fx: protect vertical lines against clipping out of bounds
This commit is contained in:
parent
9b462deca1
commit
2e8b1020cb
1 changed files with 2 additions and 0 deletions
|
@ -44,6 +44,8 @@ void gint_dvline(int y1, int y2, int x, int color)
|
||||||
if((uint)x >= 128) return;
|
if((uint)x >= 128) return;
|
||||||
if(y1 > y2) swap(y1, y2);
|
if(y1 > y2) swap(y1, y2);
|
||||||
if(y1 >= 64 || y2 < 0) return;
|
if(y1 >= 64 || y2 < 0) return;
|
||||||
|
if(y1 < 0) y1 = 0;
|
||||||
|
if(y2 >= 64) y2 = 63;
|
||||||
|
|
||||||
uint32_t *base = gint_vram + (y1 << 2) + (x >> 5);
|
uint32_t *base = gint_vram + (y1 << 2) + (x >> 5);
|
||||||
uint32_t *lword = base + ((y2 - y1 + 1) << 2);
|
uint32_t *lword = base + ((y2 - y1 + 1) << 2);
|
||||||
|
|
Loading…
Reference in a new issue