1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Framerate manager is now in a separate file and private member of GH

This commit is contained in:
Ivan Savenko
2023-05-13 00:15:48 +03:00
parent 0a874cd89e
commit 03df274450
18 changed files with 156 additions and 111 deletions

View File

@@ -381,7 +381,7 @@ bool MovementAnimation::init()
void MovementAnimation::nextFrame()
{
progress += float(GH.mainFPSmng->getElapsedMilliseconds()) / 1000 * progressPerSecond;
progress += float(GH.getFrameDeltaMilliseconds()) / 1000 * progressPerSecond;
//moving instructions
myAnim->pos.x = static_cast<Sint16>(begX + distanceX * progress );
@@ -579,7 +579,7 @@ bool ColorTransformAnimation::init()
void ColorTransformAnimation::nextFrame()
{
float elapsed = GH.mainFPSmng->getElapsedMilliseconds() / 1000.f;
float elapsed = GH.getFrameDeltaMilliseconds() / 1000.f;
float fullTime = AnimationControls::getFadeInDuration();
float delta = elapsed / fullTime;
totalProgress += delta;
@@ -1029,7 +1029,7 @@ void EffectAnimation::playEffect()
{
if(elem.effectID == ID)
{
elem.currentFrame += AnimationControls::getSpellEffectSpeed() * GH.mainFPSmng->getElapsedMilliseconds() / 1000;
elem.currentFrame += AnimationControls::getSpellEffectSpeed() * GH.getFrameDeltaMilliseconds() / 1000;
if(elem.currentFrame >= elem.animation->size())
{