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,13 +33,24 @@ void PolyCull::CullScene(const TriMatrix &worldToClip, const PolyClipPlane &port
|
||||||
ClearSolidSegments();
|
ClearSolidSegments();
|
||||||
MarkViewFrustum();
|
MarkViewFrustum();
|
||||||
|
|
||||||
for (const auto &sub : PvsSectors)
|
if (level.LevelName != lastLevelName) // Is this the best way to detect a level change?
|
||||||
SubsectorDepths[sub->Index()] = 0xffffffff;
|
{
|
||||||
SubsectorDepths.resize(level.subsectors.Size(), 0xffffffff);
|
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);
|
||||||
|
|
||||||
for (const auto §or : SeenSectors)
|
for (const auto §or : SeenSectors)
|
||||||
SectorSeen[sector->Index()] = false;
|
SectorSeen[sector->Index()] = false;
|
||||||
SectorSeen.resize(level.sectors.Size());
|
SectorSeen.resize(level.sectors.Size());
|
||||||
|
}
|
||||||
|
|
||||||
PvsSectors.clear();
|
PvsSectors.clear();
|
||||||
SeenSectors.clear();
|
SeenSectors.clear();
|
||||||
|
|
|
@ -70,6 +70,8 @@ private:
|
||||||
|
|
||||||
void MarkSegmentCulled(angle_t angle1, angle_t angle2);
|
void MarkSegmentCulled(angle_t angle1, angle_t angle2);
|
||||||
|
|
||||||
|
FString lastLevelName;
|
||||||
|
|
||||||
std::vector<SolidSegment> SolidSegments;
|
std::vector<SolidSegment> SolidSegments;
|
||||||
std::vector<SolidSegment> TempInvertSolidSegments;
|
std::vector<SolidSegment> TempInvertSolidSegments;
|
||||||
const int SolidCullScale = 3000;
|
const int SolidCullScale = 3000;
|
||||||
|
|
Loading…
Reference in a new issue