mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 23:32:02 +00:00
Fix segment culling bug
This commit is contained in:
parent
cfc977f9e6
commit
a90a22e056
1 changed files with 3 additions and 3 deletions
|
@ -119,18 +119,18 @@ void PolyCull::MarkSegmentCulled(int x1, int x2)
|
||||||
x1 = clamp(x1, -0x7ffe, 0x7ffd);
|
x1 = clamp(x1, -0x7ffe, 0x7ffd);
|
||||||
x2 = clamp(x2, -0x7ffd, 0x7ffe);
|
x2 = clamp(x2, -0x7ffd, 0x7ffe);
|
||||||
|
|
||||||
int cur = 1;
|
int cur = 0;
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
if (SolidSegments[cur].X1 <= x1 && SolidSegments[cur].X2 >= x2) // Already fully marked
|
if (SolidSegments[cur].X1 <= x1 && SolidSegments[cur].X2 >= x2) // Already fully marked
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if (cur + 1 != SolidSegments.size() && SolidSegments[cur].X2 >= x1 && SolidSegments[cur].X1 <= x2) // Merge segments
|
else if (SolidSegments[cur].X2 >= x1 && SolidSegments[cur].X1 <= x2) // Merge segments
|
||||||
{
|
{
|
||||||
// Find last segment
|
// Find last segment
|
||||||
int merge = cur;
|
int merge = cur;
|
||||||
while (merge + 2 != SolidSegments.size() && SolidSegments[merge + 1].X1 <= x2)
|
while (merge + 1 != SolidSegments.size() && SolidSegments[merge + 1].X1 <= x2)
|
||||||
merge++;
|
merge++;
|
||||||
|
|
||||||
// Apply new merged range
|
// Apply new merged range
|
||||||
|
|
Loading…
Reference in a new issue