mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-11 15:22:16 +00:00
Clamp segment range
This commit is contained in:
parent
5f1b822523
commit
3b397183ac
1 changed files with 6 additions and 0 deletions
|
@ -102,6 +102,9 @@ void PolyCull::ClearSolidSegments()
|
||||||
|
|
||||||
bool PolyCull::IsSegmentCulled(int x1, int x2) const
|
bool PolyCull::IsSegmentCulled(int x1, int x2) const
|
||||||
{
|
{
|
||||||
|
x1 = clamp(x1, -0x7ffe, 0x7ffd);
|
||||||
|
x2 = clamp(x2, -0x7ffd, 0x7ffe);
|
||||||
|
|
||||||
int next = 0;
|
int next = 0;
|
||||||
while (SolidSegments[next].X2 <= x2)
|
while (SolidSegments[next].X2 <= x2)
|
||||||
next++;
|
next++;
|
||||||
|
@ -113,6 +116,9 @@ void PolyCull::MarkSegmentCulled(int x1, int x2)
|
||||||
if (x1 >= x2)
|
if (x1 >= x2)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
x1 = clamp(x1, -0x7ffe, 0x7ffd);
|
||||||
|
x2 = clamp(x2, -0x7ffd, 0x7ffe);
|
||||||
|
|
||||||
int cur = 1;
|
int cur = 1;
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue