Fix rx = 0 crash
This commit is contained in:
parent
5a98d30a8f
commit
134869d5e2
@ -3633,9 +3633,6 @@ void render_cursor(pixel *vid, int x, int y, int t, int rx, int ry)
|
|||||||
if (rx<=0)
|
if (rx<=0)
|
||||||
for (j = y - ry; j <= y + ry; j++)
|
for (j = y - ry; j <= y + ry; j++)
|
||||||
xor_pixel(x, j, vid);
|
xor_pixel(x, j, vid);
|
||||||
else if (ry<=0)
|
|
||||||
for (i = x - rx; i <= x + rx; i++)
|
|
||||||
xor_pixel(i, y, vid);
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int tempy = y, i, j, jmax, oldy;
|
int tempy = y, i, j, jmax, oldy;
|
||||||
|
@ -3086,9 +3086,10 @@ int create_parts(int x, int y, int rx, int ry, int c, int flags, int fill)
|
|||||||
else // normal draw
|
else // normal draw
|
||||||
fn = 3;
|
fn = 3;
|
||||||
|
|
||||||
if (rx==0&&ry==0)
|
if (rx<=0) //workaround for rx == 0 crashing. todo: find a better fix later.
|
||||||
{
|
{
|
||||||
if (create_parts2(fn,i,j,c,rx,ry,flags))
|
for (j = y - ry; j <= y + ry; j++)
|
||||||
|
if (create_parts2(fn,x,j,c,rx,ry,flags))
|
||||||
f = 1;
|
f = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user