CLight: Prevent implicit double->float truncations

We can just mark these literals as floats to keep the arithmetic
operating on floats instead of doubles.
This commit is contained in:
Lioncash 2020-03-17 20:42:36 -04:00
parent 1dd1542106
commit 17a1f90a89
1 changed files with 3 additions and 3 deletions

View File

@ -70,10 +70,10 @@ CLight::CLight(ELightType type, const zeus::CVector3f& pos, const zeus::CVector3
, x4c_25_radiusDirty(true) {
switch (type) {
case ELightType::Spot: {
float cosCutoff = std::cos(zeus::degToRad(cutoff));
const float cosCutoff = std::cos(zeus::degToRad(cutoff));
x30_angleC = 0.f;
x34_angleL = -cosCutoff / (1.0 - cosCutoff);
x38_angleQ = 1.f / (1.0 - cosCutoff);
x34_angleL = -cosCutoff / (1.0f - cosCutoff);
x38_angleQ = 1.f / (1.0f - cosCutoff);
break;
}
case ELightType::Directional: {