diff options
Diffstat (limited to 'src/helpers/AnimatedVariable.cpp')
| -rw-r--r-- | src/helpers/AnimatedVariable.cpp | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/helpers/AnimatedVariable.cpp b/src/helpers/AnimatedVariable.cpp index 18162c99..f3b1d1e4 100644 --- a/src/helpers/AnimatedVariable.cpp +++ b/src/helpers/AnimatedVariable.cpp @@ -7,10 +7,10 @@ CAnimatedVariable::CAnimatedVariable() { } void CAnimatedVariable::create(ANIMATEDVARTYPE type, SAnimationPropertyConfig* pAnimConfig, void* pWindow, AVARDAMAGEPOLICY policy) { - m_eVarType = type; + m_eVarType = type; m_eDamagePolicy = policy; - m_pConfig = pAnimConfig; - m_pWindow = pWindow; + m_pConfig = pAnimConfig; + m_pWindow = pWindow; m_bDummy = false; } @@ -22,25 +22,23 @@ void CAnimatedVariable::create(ANIMATEDVARTYPE type, std::any val, SAnimationPro switch (type) { case AVARTYPE_FLOAT: { const auto V = std::any_cast<float>(val); - m_fValue = V; - m_fGoal = V; + m_fValue = V; + m_fGoal = V; break; } case AVARTYPE_VECTOR: { const auto V = std::any_cast<Vector2D>(val); - m_vValue = V; - m_vGoal = V; + m_vValue = V; + m_vGoal = V; break; } case AVARTYPE_COLOR: { const auto V = std::any_cast<CColor>(val); - m_cValue = V; - m_cGoal = V; + m_cValue = V; + m_cGoal = V; break; } - default: - ASSERT(false); - break; + default: ASSERT(false); break; } } catch (std::exception& e) { Debug::log(ERR, "CAnimatedVariable create error: %s", e.what()); @@ -64,7 +62,8 @@ void CAnimatedVariable::registerVar() { } int CAnimatedVariable::getDurationLeftMs() { - return std::max((int)(m_pConfig->pValues->internalSpeed * 100) - (int)std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now() - animationBegin).count(), 0); + return std::max( + (int)(m_pConfig->pValues->internalSpeed * 100) - (int)std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now() - animationBegin).count(), 0); } float CAnimatedVariable::getPercent() { |
