From 923c805fe5d9283497747e2ccfc581abb6cca177 Mon Sep 17 00:00:00 2001 From: frank Date: Thu, 28 Dec 2023 16:11:35 -0800 Subject: [PATCH] reset animation object before calling animation function in case the animation function reenables the animation --- src/Animation.cpp | 2 +- src/Color.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Animation.cpp b/src/Animation.cpp index d9dc022..636b025 100644 --- a/src/Animation.cpp +++ b/src/Animation.cpp @@ -77,11 +77,11 @@ bool Animation::update(float timestamp) { overflow = timer.elapsed() - previous_step_time + overflow - _frame_length; previous_step_time = timer.elapsed(); - step(); if (ending) { reset(); } + step(); if (overflow > _frame_length) { overflow = 0; diff --git a/src/Color.hpp b/src/Color.hpp index 69e98f7..129c7ab 100644 --- a/src/Color.hpp +++ b/src/Color.hpp @@ -2,7 +2,7 @@ ____/ \____ /| - Open source game framework licensed to freely use, | \ / / | copy, modify and sell without restriction | +--\ ^__^ /--+ | | -| ~/ \~ | | - created for | +| ~/ \~ | | - created for | | ~~~~~~~~~~~~ | +------------------------------------------------------+ | SPACE ~~~~~ | / | ~~~~~~~ BOX |/