From b4ac78fd6285265f140b8410c1b17ce5f189fb6d Mon Sep 17 00:00:00 2001 From: parax0 Date: Wed, 16 Dec 2015 17:47:50 -0700 Subject: [PATCH] Light radius calculation fix (was broken by CColor changes) --- src/Core/Resource/CLight.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/Core/Resource/CLight.cpp b/src/Core/Resource/CLight.cpp index 66e3e3e8..d791db38 100644 --- a/src/Core/Resource/CLight.cpp +++ b/src/Core/Resource/CLight.cpp @@ -55,15 +55,11 @@ float CLight::CalculateRadius() const // This function is also reverse engineered from the kiosk demo's code float CLight::CalculateIntensity() const { - float Multiplier = (mType == eCustom) ? mAngleAttenCoefficients.x : 1.0f; - float ColorR = float(mColor.r) / 255.f; - float ColorG = float(mColor.g) / 255.f; - float ColorB = float(mColor.b) / 255.f; - // Get the color component with the greatest numeric value - float Greatest = (ColorG >= ColorB) ? ColorG : ColorB; - Greatest = (ColorR >= Greatest) ? ColorR : Greatest; + float Greatest = (mColor.g >= mColor.b) ? mColor.g : mColor.b; + Greatest = (mColor.r >= Greatest) ? mColor.r : Greatest; + float Multiplier = (mType == eCustom) ? mAngleAttenCoefficients.x : 1.0f; return Greatest * Multiplier; }