From 0a57cbbecfdea7555ffeb61b4f1f347cbee2917a Mon Sep 17 00:00:00 2001 From: Chandler Cox Date: Fri, 7 Jul 2023 17:48:16 -0500 Subject: [PATCH] Add not showing lights debug based on other light flags as well. --- Source/Engine/Level/Actors/PointLight.cpp | 2 +- Source/Engine/Level/Actors/SpotLight.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Engine/Level/Actors/PointLight.cpp b/Source/Engine/Level/Actors/PointLight.cpp index 0e7ea79ec..912d21a6a 100644 --- a/Source/Engine/Level/Actors/PointLight.cpp +++ b/Source/Engine/Level/Actors/PointLight.cpp @@ -146,7 +146,7 @@ void PointLight::OnDebugDrawSelected() void PointLight::DrawLightsDebug(RenderView& view) { const BoundingSphere sphere(_sphere.Center - view.Origin, _sphere.Radius); - if (!view.CullingFrustum.Intersects(sphere)) + if (!view.CullingFrustum.Intersects(sphere) || !EnumHasAnyFlags(view.Flags, ViewFlags::PointLights)) return; // Draw influence range diff --git a/Source/Engine/Level/Actors/SpotLight.cpp b/Source/Engine/Level/Actors/SpotLight.cpp index 557d69cd9..90878fc00 100644 --- a/Source/Engine/Level/Actors/SpotLight.cpp +++ b/Source/Engine/Level/Actors/SpotLight.cpp @@ -218,7 +218,7 @@ void SpotLight::OnDebugDrawSelected() void SpotLight::DrawLightsDebug(RenderView& view) { const BoundingSphere sphere(_sphere.Center - view.Origin, _sphere.Radius); - if (!view.CullingFrustum.Intersects(sphere)) + if (!view.CullingFrustum.Intersects(sphere) || !EnumHasAnyFlags(view.Flags, ViewFlags::SpotLights)) return; const auto color = Color::Yellow;