From 77d37cd72ab87f67dd47930c61fa0ad8792f26c2 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Thu, 5 May 2022 14:02:30 +0200 Subject: optimization: dont damage entire window on border anim --- src/helpers/AnimatedVariable.cpp | 7 ++++--- src/helpers/AnimatedVariable.hpp | 13 ++++++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) (limited to 'src/helpers') diff --git a/src/helpers/AnimatedVariable.cpp b/src/helpers/AnimatedVariable.cpp index 798e96e5..9e93ba3c 100644 --- a/src/helpers/AnimatedVariable.cpp +++ b/src/helpers/AnimatedVariable.cpp @@ -5,8 +5,9 @@ CAnimatedVariable::CAnimatedVariable() { ; // dummy var } -void CAnimatedVariable::create(ANIMATEDVARTYPE type, float* speed, int64_t* enabled, std::string* pBezier, void* pWindow) { +void CAnimatedVariable::create(ANIMATEDVARTYPE type, float* speed, int64_t* enabled, std::string* pBezier, void* pWindow, AVARDAMAGEPOLICY policy) { m_eVarType = type; + m_eDamagePolicy = policy; m_pSpeed = speed; m_pEnabled = enabled; m_pWindow = pWindow; @@ -17,8 +18,8 @@ void CAnimatedVariable::create(ANIMATEDVARTYPE type, float* speed, int64_t* enab m_bDummy = false; } -void CAnimatedVariable::create(ANIMATEDVARTYPE type, std::any val, float* speed, int64_t* enabled, std::string* pBezier, void* pWindow) { - create(type, speed, enabled, pBezier, pWindow); +void CAnimatedVariable::create(ANIMATEDVARTYPE type, std::any val, float* speed, int64_t* enabled, std::string* pBezier, void* pWindow, AVARDAMAGEPOLICY policy) { + create(type, speed, enabled, pBezier, pWindow, policy); try { switch (type) { diff --git a/src/helpers/AnimatedVariable.hpp b/src/helpers/AnimatedVariable.hpp index 6fb62654..008d0b84 100644 --- a/src/helpers/AnimatedVariable.hpp +++ b/src/helpers/AnimatedVariable.hpp @@ -10,14 +10,20 @@ enum ANIMATEDVARTYPE { AVARTYPE_COLOR }; +enum AVARDAMAGEPOLICY { + AVARDAMAGE_INVALID = -1, + AVARDAMAGE_ENTIRE = 0, + AVARDAMAGE_BORDER +}; + class CAnimationManager; class CAnimatedVariable { public: CAnimatedVariable(); // dummy var - void create(ANIMATEDVARTYPE, float* speed, int64_t* enabled, std::string* pBezier, void* pWindow); - void create(ANIMATEDVARTYPE, std::any val, float* speed, int64_t* enabled, std::string* pBezier, void* pWindow); + void create(ANIMATEDVARTYPE, float* speed, int64_t* enabled, std::string* pBezier, void* pWindow, AVARDAMAGEPOLICY); + void create(ANIMATEDVARTYPE, std::any val, float* speed, int64_t* enabled, std::string* pBezier, void* pWindow, AVARDAMAGEPOLICY); ~CAnimatedVariable(); @@ -165,7 +171,8 @@ private: std::chrono::system_clock::time_point animationBegin; - ANIMATEDVARTYPE m_eVarType = AVARTYPE_INVALID; + ANIMATEDVARTYPE m_eVarType = AVARTYPE_INVALID; + AVARDAMAGEPOLICY m_eDamagePolicy = AVARDAMAGE_INVALID; friend class CAnimationManager; }; \ No newline at end of file -- cgit v1.2.3