mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-11 15:47:55 +00:00
ref_soft: draw: check screen bounds in Draw_Fill
This commit is contained in:
parent
3589537147
commit
a3a0db447b
10
r_draw.c
10
r_draw.c
@ -216,12 +216,20 @@ void Draw_Fill (int x, int y, int w, int h)
|
|||||||
if( x + w > vid.width )
|
if( x + w > vid.width )
|
||||||
w = vid.width - x;
|
w = vid.width - x;
|
||||||
|
|
||||||
|
if( w <= 0 )
|
||||||
|
return;
|
||||||
|
|
||||||
if( y + h > vid.height )
|
if( y + h > vid.height )
|
||||||
h = vid.height - y;
|
h = vid.height - y;
|
||||||
|
|
||||||
|
if( h <= 0 )
|
||||||
|
return;
|
||||||
|
|
||||||
height = h;
|
height = h;
|
||||||
if (y < 0)
|
if( y < 0 )
|
||||||
{
|
{
|
||||||
|
if( h <= -y )
|
||||||
|
return;
|
||||||
skip = -y;
|
skip = -y;
|
||||||
height += y;
|
height += y;
|
||||||
y = 0;
|
y = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user