mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-11 15:22:15 +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);
|
||||
x2 = clamp(x2, -0x7ffd, 0x7ffe);
|
||||
|
||||
int cur = 1;
|
||||
int cur = 0;
|
||||
while (true)
|
||||
{
|
||||
if (SolidSegments[cur].X1 <= x1 && SolidSegments[cur].X2 >= x2) // Already fully marked
|
||||
{
|
||||
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
|
||||
int merge = cur;
|
||||
while (merge + 2 != SolidSegments.size() && SolidSegments[merge + 1].X1 <= x2)
|
||||
while (merge + 1 != SolidSegments.size() && SolidSegments[merge + 1].X1 <= x2)
|
||||
merge++;
|
||||
|
||||
// Apply new merged range
|
||||
|
|
Loading…
Reference in a new issue