mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-27 14:22:13 +00:00
- Fix overflows in AM_clipMline().
SVN r3182 (trunk)
This commit is contained in:
parent
37b7595db7
commit
ef69e2bbf0
1 changed files with 4 additions and 4 deletions
|
@ -1461,28 +1461,28 @@ bool AM_clipMline (mline_t *ml, fline_t *fl)
|
||||||
{
|
{
|
||||||
dy = fl->a.y - fl->b.y;
|
dy = fl->a.y - fl->b.y;
|
||||||
dx = fl->b.x - fl->a.x;
|
dx = fl->b.x - fl->a.x;
|
||||||
tmp.x = fl->a.x + (dx*(fl->a.y))/dy;
|
tmp.x = fl->a.x + Scale(dx, fl->a.y, dy);
|
||||||
tmp.y = 0;
|
tmp.y = 0;
|
||||||
}
|
}
|
||||||
else if (outside & BOTTOM)
|
else if (outside & BOTTOM)
|
||||||
{
|
{
|
||||||
dy = fl->a.y - fl->b.y;
|
dy = fl->a.y - fl->b.y;
|
||||||
dx = fl->b.x - fl->a.x;
|
dx = fl->b.x - fl->a.x;
|
||||||
tmp.x = fl->a.x + (dx*(fl->a.y-f_h))/dy;
|
tmp.x = fl->a.x + Scale(dx, fl->a.y - f_h, dy);
|
||||||
tmp.y = f_h-1;
|
tmp.y = f_h-1;
|
||||||
}
|
}
|
||||||
else if (outside & RIGHT)
|
else if (outside & RIGHT)
|
||||||
{
|
{
|
||||||
dy = fl->b.y - fl->a.y;
|
dy = fl->b.y - fl->a.y;
|
||||||
dx = fl->b.x - fl->a.x;
|
dx = fl->b.x - fl->a.x;
|
||||||
tmp.y = fl->a.y + (dy*(f_w-1 - fl->a.x))/dx;
|
tmp.y = fl->a.y + Scale(dy, f_w-1 - fl->a.x, dx);
|
||||||
tmp.x = f_w-1;
|
tmp.x = f_w-1;
|
||||||
}
|
}
|
||||||
else if (outside & LEFT)
|
else if (outside & LEFT)
|
||||||
{
|
{
|
||||||
dy = fl->b.y - fl->a.y;
|
dy = fl->b.y - fl->a.y;
|
||||||
dx = fl->b.x - fl->a.x;
|
dx = fl->b.x - fl->a.x;
|
||||||
tmp.y = fl->a.y + (dy*(-fl->a.x))/dx;
|
tmp.y = fl->a.y + Scale(dy, -fl->a.x, dx);
|
||||||
tmp.x = 0;
|
tmp.x = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue