Skip to content

Commit

Permalink
Merge branch 'master' into hardpoly
Browse files Browse the repository at this point in the history
  • Loading branch information
dpjudas committed Sep 10, 2017
2 parents 96d6859 + 0924cc3 commit 7b640fa
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
23 changes: 17 additions & 6 deletions src/polyrenderer/scene/poly_cull.cpp
Expand Up @@ -33,13 +33,24 @@ void PolyCull::CullScene(const TriMatrix &worldToClip, const PolyClipPlane &port
ClearSolidSegments();
MarkViewFrustum();

for (const auto &sub : PvsSectors)
SubsectorDepths[sub->Index()] = 0xffffffff;
SubsectorDepths.resize(level.subsectors.Size(), 0xffffffff);
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);

for (const auto &sector : SeenSectors)
SectorSeen[sector->Index()] = false;
SectorSeen.resize(level.sectors.Size());
for (const auto &sector : SeenSectors)
SectorSeen[sector->Index()] = false;
SectorSeen.resize(level.sectors.Size());
}

PvsSectors.clear();
SeenSectors.clear();
Expand Down
2 changes: 2 additions & 0 deletions src/polyrenderer/scene/poly_cull.h
Expand Up @@ -70,6 +70,8 @@ class PolyCull

void MarkSegmentCulled(angle_t angle1, angle_t angle2);

FString lastLevelName;

std::vector<SolidSegment> SolidSegments;
std::vector<SolidSegment> TempInvertSolidSegments;
const int SolidCullScale = 3000;
Expand Down

0 comments on commit 7b640fa

Please sign in to comment.