| 467 | } |
| 468 | |
| 469 | void AnimationSystem::StartNextAnimations() |
| 470 | { |
| 471 | if (m_animationChain.empty()) |
| 472 | return; |
| 473 | |
| 474 | m_animationChain.pop_front(); |
| 475 | if (!m_animationChain.empty()) |
| 476 | { |
| 477 | std::vector<std::weak_ptr<Animation>> startedAnimations; |
| 478 | startedAnimations.reserve(m_animationChain.front()->size()); |
| 479 | for (auto & anim : *(m_animationChain.front())) |
| 480 | startedAnimations.push_back(anim); |
| 481 | |
| 482 | for (auto & weak_anim : startedAnimations) |
| 483 | { |
| 484 | std::shared_ptr<Animation> anim = weak_anim.lock(); |
| 485 | if (anim != nullptr) |
| 486 | { |
| 487 | anim->Init(m_lastScreen, m_propertyCache); |
| 488 | anim->OnStart(); |
| 489 | } |
| 490 | } |
| 491 | } |
| 492 | } |
| 493 | } // namespace df |