summaryrefslogtreecommitdiff
path: root/src/helpers/AnimatedVariable.cpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2022-12-16 17:17:31 +0000
committerGitHub <noreply@github.com>2022-12-16 17:17:31 +0000
commit98a4fa2b0d79298fa29b048a3ba15c3bf5aed8cd (patch)
tree64e78342cf08e5f9ad87bd5f6ea36233133be7bb /src/helpers/AnimatedVariable.cpp
parent7c33c7fc64203c17b4f3625a16ae6b4774992c0e (diff)
Added clang format (#1239)
* clang-format stuff and format files
Diffstat (limited to 'src/helpers/AnimatedVariable.cpp')
-rw-r--r--src/helpers/AnimatedVariable.cpp25
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() {