From b6f23cd3661b7195f1068a4aff162e7518130beb Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Sat, 27 Oct 2018 13:27:25 +0300 Subject: [PATCH] Make constants usage more obvious --- apps/openmw/mwrender/animation.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/openmw/mwrender/animation.cpp b/apps/openmw/mwrender/animation.cpp index 8ae8800a6c..8463b7bfe5 100644 --- a/apps/openmw/mwrender/animation.cpp +++ b/apps/openmw/mwrender/animation.cpp @@ -15,13 +15,13 @@ #include -#include - #include #include #include #include +#include + #include // KeyframeHolder #include @@ -1791,10 +1791,10 @@ namespace MWRender { // TODO: use global attenuation settings - // 1 pt of Light effect magnitude corresponds to 1 foot of light source radius, which is about 21.33 game units, - // but Morrowind uses imprecise value of foot for magic effects. - float radius = effect * 22.f; - float linearAttenuation = 3.f / radius; + // 1 pt of Light magnitude corresponds to 1 foot of radius + float radius = effect * std::ceil(Constants::UnitsPerFoot); + const float linearValue = 3.f; // Currently hardcoded: unmodified Morrowind attenuation settings + float linearAttenuation = linearValue / radius; if (!mGlowLight || linearAttenuation != mGlowLight->getLight(0)->getLinearAttenuation()) {