From d8c4209dede1374281a86115bc24531ce38c36c7 Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Wed, 4 Jan 2023 17:21:40 +0200 Subject: [PATCH] Movement animation is now more smooth at high animation speeds --- client/battle/BattleAnimationClasses.cpp | 3 ++- client/gui/CGuiHandler.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/client/battle/BattleAnimationClasses.cpp b/client/battle/BattleAnimationClasses.cpp index ef306ce75..66677b959 100644 --- a/client/battle/BattleAnimationClasses.cpp +++ b/client/battle/BattleAnimationClasses.cpp @@ -368,7 +368,7 @@ bool MovementAnimation::init() begX = begPosition.x; begY = begPosition.y; - progress = 0; + //progress = 0; distanceX = endPosition.x - begPosition.x; distanceY = endPosition.y - begPosition.y; @@ -394,6 +394,7 @@ void MovementAnimation::nextFrame() if(progress >= 1.0) { + progress -= 1.0; // Sets the position of the creature animation sprites Point coords = owner.stacksController->getStackPositionAtHex(nextHex, stack); myAnim->pos.moveTo(coords); diff --git a/client/gui/CGuiHandler.cpp b/client/gui/CGuiHandler.cpp index 5e39465b3..060ce0570 100644 --- a/client/gui/CGuiHandler.cpp +++ b/client/gui/CGuiHandler.cpp @@ -489,7 +489,7 @@ CGuiHandler::CGuiHandler() statusbar = nullptr; // Creates the FPS manager and sets the framerate to 48 which is doubled the value of the original Heroes 3 FPS rate - mainFPSmng = new CFramerateManager(48); + mainFPSmng = new CFramerateManager(60); //do not init CFramerateManager here --AVS terminate_cond = new CondSh(false);