Light radius calculation fix (was broken by CColor changes)
This commit is contained in:
parent
6e3deb836c
commit
b4ac78fd62
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue