Patch from Nuke.YKT to clip Polymost spans to screen borders

git-svn-id: https://svn.eduke32.com/eduke32@7390 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2019-03-04 23:49:03 +00:00
parent e33fed3bf8
commit 0e6dd28573

View file

@ -3572,11 +3572,23 @@ static void polymost_domost(float x0, float y0, float x1, float y1)
return;
}
vec2f_t const dm0 = { x0, y0 };
vec2f_t const dm1 = { x1, y1 };
vec2f_t dm0 = { x0, y0 };
vec2f_t dm1 = { x1, y1 };
float const slop = (dm1.y - dm0.y) / (dm1.x - dm0.x);
if (dm0.x < xbl)
{
dm0.y += slop*(xbl-dm0.x);
dm0.x = xbl;
}
if (dm1.x > xbr)
{
dm1.y += slop*(xbr-dm1.x);
dm1.x = xbr;
}
drawpoly_alpha = 0.f;
drawpoly_blend = 0;