mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-13 16:07:55 +00:00
Minor bug fix
This commit is contained in:
parent
80a5f81f9a
commit
0361e912cb
2 changed files with 13 additions and 10 deletions
|
@ -35,18 +35,12 @@ void PolyCull::CullScene(const TriMatrix &worldToClip)
|
||||||
frustumPlanes = FrustumPlanes(worldToClip);
|
frustumPlanes = FrustumPlanes(worldToClip);
|
||||||
|
|
||||||
// Cull front to back
|
// Cull front to back
|
||||||
|
MaxCeilingHeight = 0.0;
|
||||||
|
MinFloorHeight = 0.0;
|
||||||
if (numnodes == 0)
|
if (numnodes == 0)
|
||||||
{
|
CullSubsector(subsectors);
|
||||||
PvsSectors.push_back(subsectors);
|
|
||||||
MaxCeilingHeight = subsectors->sector->ceilingplane.Zat0();
|
|
||||||
MinFloorHeight = subsectors->sector->floorplane.Zat0();
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
MaxCeilingHeight = 0.0;
|
|
||||||
MinFloorHeight = 0.0;
|
|
||||||
CullNode(nodes + numnodes - 1); // The head node is the last node output.
|
CullNode(nodes + numnodes - 1); // The head node is the last node output.
|
||||||
}
|
|
||||||
|
|
||||||
ClearSolidSegments();
|
ClearSolidSegments();
|
||||||
}
|
}
|
||||||
|
@ -65,16 +59,24 @@ void PolyCull::CullNode(void *node)
|
||||||
|
|
||||||
// Possibly divide back space (away from the viewer).
|
// Possibly divide back space (away from the viewer).
|
||||||
side ^= 1;
|
side ^= 1;
|
||||||
|
|
||||||
if (!CheckBBox(bsp->bbox[side]))
|
if (!CheckBBox(bsp->bbox[side]))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
node = bsp->children[side];
|
node = bsp->children[side];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mark that we need to render this
|
|
||||||
subsector_t *sub = (subsector_t *)((BYTE *)node - 1);
|
subsector_t *sub = (subsector_t *)((BYTE *)node - 1);
|
||||||
|
CullSubsector(sub);
|
||||||
|
}
|
||||||
|
|
||||||
|
void PolyCull::CullSubsector(subsector_t *sub)
|
||||||
|
{
|
||||||
|
// Update sky heights for the scene
|
||||||
MaxCeilingHeight = MAX(MaxCeilingHeight, sub->sector->ceilingplane.Zat0());
|
MaxCeilingHeight = MAX(MaxCeilingHeight, sub->sector->ceilingplane.Zat0());
|
||||||
MinFloorHeight = MIN(MinFloorHeight, sub->sector->floorplane.Zat0());
|
MinFloorHeight = MIN(MinFloorHeight, sub->sector->floorplane.Zat0());
|
||||||
|
|
||||||
|
// Mark that we need to render this
|
||||||
PvsSectors.push_back(sub);
|
PvsSectors.push_back(sub);
|
||||||
|
|
||||||
// Update culling info for further bsp clipping
|
// Update culling info for further bsp clipping
|
||||||
|
|
|
@ -46,6 +46,7 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
void CullNode(void *node);
|
void CullNode(void *node);
|
||||||
|
void CullSubsector(subsector_t *sub);
|
||||||
int PointOnSide(const DVector2 &pos, const node_t *node);
|
int PointOnSide(const DVector2 &pos, const node_t *node);
|
||||||
|
|
||||||
// Checks BSP node/subtree bounding box.
|
// Checks BSP node/subtree bounding box.
|
||||||
|
|
Loading…
Reference in a new issue