Skip to content

Commit

Permalink
Fixed update of occlusion when settings are changed during runtime in…
Browse files Browse the repository at this point in the history
… packaged game
  • Loading branch information
BenPyton committed Mar 8, 2024
1 parent c2fd5bf commit c0b35af
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 1 addition & 2 deletions Source/ProceduralDungeon/Private/DungeonGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ void ADungeonGenerator::UpdateRoomVisibility()

const bool bIsOcclusionEnabled = Dungeon::OcclusionCulling();
const uint32 OcclusionDistance = Dungeon::OcclusionDistance();
#if WITH_EDITOR

// Detects occlusion setting changes and toggles on/off all room visibilities when occlusion is enabled/disabled.
if (bWasOcclusionEnabled != bIsOcclusionEnabled
|| PreviousOcclusionDistance != OcclusionDistance)
Expand All @@ -412,7 +412,6 @@ void ADungeonGenerator::UpdateRoomVisibility()
}
bWasOcclusionEnabled = bIsOcclusionEnabled;
PreviousOcclusionDistance = OcclusionDistance;
#endif

// Don't change room visibilities if occlusion is disabled.
if (!bIsOcclusionEnabled)
Expand Down
2 changes: 0 additions & 2 deletions Source/ProceduralDungeon/Public/DungeonGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -300,11 +300,9 @@ class PROCEDURALDUNGEON_API ADungeonGenerator : public AActor
TUniquePtr<FDungeonOctree> Octree;
TSet<URoom*> CurrentPlayerRooms;

#if WITH_EDITOR
// Transient. Only used to detect when occlusion setting is changed.
bool bWasOcclusionEnabled {false};

// Transient. Only used to detect when occlusion distance is changed.
uint32 PreviousOcclusionDistance {0};
#endif
};

0 comments on commit c0b35af

Please sign in to comment.