mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-28 15:02:01 +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();
|
ClearSolidSegments();
|
||||||
MarkViewFrustum();
|
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)
|
for (const auto &sub : PvsSectors)
|
||||||
SubsectorDepths[sub->Index()] = 0xffffffff;
|
SubsectorDepths[sub->Index()] = 0xffffffff;
|
||||||
SubsectorDepths.resize(level.subsectors.Size(), 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)
|
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