Light radius calculation fix (was broken by CColor changes)

This commit is contained in:
parax0 2015-12-16 17:47:50 -07:00
parent 6e3deb836c
commit b4ac78fd62
1 changed files with 3 additions and 7 deletions

View File

@ -55,15 +55,11 @@ float CLight::CalculateRadius() const
// This function is also reverse engineered from the kiosk demo's code // This function is also reverse engineered from the kiosk demo's code
float CLight::CalculateIntensity() const 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 // Get the color component with the greatest numeric value
float Greatest = (ColorG >= ColorB) ? ColorG : ColorB; float Greatest = (mColor.g >= mColor.b) ? mColor.g : mColor.b;
Greatest = (ColorR >= Greatest) ? ColorR : Greatest; Greatest = (mColor.r >= Greatest) ? mColor.r : Greatest;
float Multiplier = (mType == eCustom) ? mAngleAttenCoefficients.x : 1.0f;
return Greatest * Multiplier; return Greatest * Multiplier;
} }