mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 23:01:50 +00:00
- Fix crash when switching levels
This commit is contained in:
parent
4d671fb618
commit
0924cc3f0f
2 changed files with 19 additions and 6 deletions
|
@ -33,6 +33,16 @@ void PolyCull::CullScene(const TriMatrix &worldToClip, const PolyClipPlane &port
|
|||
ClearSolidSegments();
|
||||
MarkViewFrustum();
|
||||
|
||||
if (level.LevelName != lastLevelName) // Is this the best way to detect a level change?
|
||||
{
|
||||
lastLevelName = level.LevelName;
|
||||
SubsectorDepths.clear();
|
||||
SubsectorDepths.resize(level.subsectors.Size(), 0xffffffff);
|
||||
SectorSeen.clear();
|
||||
SectorSeen.resize(level.sectors.Size());
|
||||
}
|
||||
else
|
||||
{
|
||||
for (const auto &sub : PvsSectors)
|
||||
SubsectorDepths[sub->Index()] = 0xffffffff;
|
||||
SubsectorDepths.resize(level.subsectors.Size(), 0xffffffff);
|
||||
|
@ -40,6 +50,7 @@ void PolyCull::CullScene(const TriMatrix &worldToClip, const PolyClipPlane &port
|
|||
for (const auto §or : SeenSectors)
|
||||
SectorSeen[sector->Index()] = false;
|
||||
SectorSeen.resize(level.sectors.Size());
|
||||
}
|
||||
|
||||
PvsSectors.clear();
|
||||
SeenSectors.clear();
|
||||
|
|
|
@ -70,6 +70,8 @@ private:
|
|||
|
||||
void MarkSegmentCulled(angle_t angle1, angle_t angle2);
|
||||
|
||||
FString lastLevelName;
|
||||
|
||||
std::vector<SolidSegment> SolidSegments;
|
||||
std::vector<SolidSegment> TempInvertSolidSegments;
|
||||
const int SolidCullScale = 3000;
|
||||
|
|
Loading…
Reference in a new issue