From 57817f7252e3acbe48620b6764a77fecb6bb0ec1 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sun, 6 Nov 2022 17:52:09 +0000 Subject: Added resize transitions --- src/managers/AnimationManager.cpp | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'src/managers/AnimationManager.cpp') diff --git a/src/managers/AnimationManager.cpp b/src/managers/AnimationManager.cpp index 06fa60da..550278a5 100644 --- a/src/managers/AnimationManager.cpp +++ b/src/managers/AnimationManager.cpp @@ -42,16 +42,12 @@ void CAnimationManager::tick() { continue; if (av->m_eDamagePolicy == AVARDAMAGE_SHADOW && !*PSHADOWSENABLED) { - av->warp(); + av->warp(false); continue; } - // get speed - const auto SPEED = av->m_pConfig->pValues->internalSpeed; - // get the spent % (0 - 1) - const auto DURATIONPASSED = std::chrono::duration_cast(std::chrono::system_clock::now() - av->animationBegin).count(); - const float SPENT = std::clamp((DURATIONPASSED / 100.f) / SPEED, 0.f, 1.f); + const float SPENT = av->getPercent(); // window stuff const auto PWINDOW = (CWindow*)av->m_pWindow; @@ -80,12 +76,12 @@ void CAnimationManager::tick() { case AVARTYPE_FLOAT: { // for disabled anims just warp if (av->m_pConfig->pValues->internalEnabled == 0 || animationsDisabled) { - av->warp(); + av->warp(false); break; } if (SPENT >= 1.f) { - av->warp(); + av->warp(false); break; } @@ -101,12 +97,12 @@ void CAnimationManager::tick() { case AVARTYPE_VECTOR: { // for disabled anims just warp if (av->m_pConfig->pValues->internalEnabled == 0 || animationsDisabled) { - av->warp(); + av->warp(false); break; } if (SPENT >= 1.f) { - av->warp(); + av->warp(false); break; } @@ -122,12 +118,12 @@ void CAnimationManager::tick() { case AVARTYPE_COLOR: { // for disabled anims just warp if (av->m_pConfig->pValues->internalEnabled == 0 || animationsDisabled) { - av->warp(); + av->warp(false); break; } if (SPENT >= 1.f) { - av->warp(); + av->warp(false); break; } @@ -297,7 +293,7 @@ void CAnimationManager::animationPopin(CWindow* pWindow, bool close, float minPe } void CAnimationManager::animationSlide(CWindow* pWindow, std::string force, bool close) { - pWindow->m_vRealSize.warp(); // size we preserve in slide + pWindow->m_vRealSize.warp(false); // size we preserve in slide const auto GOALPOS = pWindow->m_vRealPosition.goalv(); const auto GOALSIZE = pWindow->m_vRealSize.goalv(); -- cgit v1.2.3