From 94016a852a3c538774563f8b003cb2171886ebec Mon Sep 17 00:00:00 2001 From: Colin Cornaby Date: Mon, 2 Dec 2024 19:45:09 -0800 Subject: [PATCH] Metal max range code cleanup --- .../Plasma/FeatureLib/pfMetalPipeline/plMetalPipeline.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/Plasma/FeatureLib/pfMetalPipeline/plMetalPipeline.cpp b/Sources/Plasma/FeatureLib/pfMetalPipeline/plMetalPipeline.cpp index 42196da563..2ffc8ba3f7 100644 --- a/Sources/Plasma/FeatureLib/pfMetalPipeline/plMetalPipeline.cpp +++ b/Sources/Plasma/FeatureLib/pfMetalPipeline/plMetalPipeline.cpp @@ -2375,8 +2375,8 @@ void plMetalPipeline::IEnableLight(size_t i, plLightInfo* light) plOmniLightInfo* omniLight = nullptr; plSpotLightInfo* spotLight = nullptr; - const float maxRange = 32767.f; - fLights.lampSources[i].range = maxRange; + constexpr float kMaxRange = 32767.f; + fLights.lampSources[i].range = kMaxRange; if ((dirLight = plDirectionalLightInfo::ConvertNoRef(light)) != nullptr) { hsVector3 lightDir = dirLight->GetWorldDirection(); @@ -2386,7 +2386,7 @@ void plMetalPipeline::IEnableLight(size_t i, plLightInfo* light) fLights.lampSources[i].constAtten = 1.0f; fLights.lampSources[i].linAtten = 0.0f; fLights.lampSources[i].quadAtten = 0.0f; - + } else if ((omniLight = plOmniLightInfo::ConvertNoRef(light)) != nullptr) { hsPoint3 pos = omniLight->GetWorldPosition(); fLights.lampSources[i].position = {pos.fX, pos.fY, pos.fZ, 1.0}; @@ -2394,7 +2394,7 @@ void plMetalPipeline::IEnableLight(size_t i, plLightInfo* light) fLights.lampSources[i].constAtten = omniLight->GetConstantAttenuation(); fLights.lampSources[i].linAtten = omniLight->GetLinearAttenuation(); fLights.lampSources[i].quadAtten = omniLight->GetQuadraticAttenuation(); - + if (omniLight->GetRadius() != 0.f) { fLights.lampSources[i].range = omniLight->GetRadius(); }