mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-11 07:11:39 +00:00
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:
parent
e33fed3bf8
commit
0e6dd28573
1 changed files with 14 additions and 2 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue