diff --git a/libs/util/include/psemek/util/animation_manager.hpp b/libs/util/include/psemek/util/animation_manager.hpp index 16edfd85..98b01bf5 100644 --- a/libs/util/include/psemek/util/animation_manager.hpp +++ b/libs/util/include/psemek/util/animation_manager.hpp @@ -38,16 +38,19 @@ namespace psemek::util std::push_heap(animations_.begin(), animations_.end(), compare{}); } - void update(Time dt) + std::vector update(Time dt) { for (auto & animation : animations_) animation.time += dt; + std::vector finished; while (!animations_.empty() && animations_.front().finished()) { std::pop_heap(animations_.begin(), animations_.end(), compare{}); + finished.push_back(std::move(animations_.back().data)); animations_.pop_back(); } + return finished; } animation const * begin() const