| 347 | } |
| 348 | |
| 349 | void AnimationSystem::Advance(double elapsedSeconds) |
| 350 | { |
| 351 | if (!HasAnimations()) |
| 352 | return; |
| 353 | |
| 354 | TAnimationList finishedAnimations; |
| 355 | TAnimationList & frontList = *(m_animationChain.front()); |
| 356 | for (auto it = frontList.begin(); it != frontList.end();) |
| 357 | { |
| 358 | auto & anim = *it; |
| 359 | anim->Advance(elapsedSeconds); |
| 360 | if (anim->IsFinished()) |
| 361 | finishedAnimations.splice(finishedAnimations.end(), frontList, it++); |
| 362 | else |
| 363 | ++it; |
| 364 | } |
| 365 | for (auto & anim : finishedAnimations) |
| 366 | { |
| 367 | anim->OnFinish(); |
| 368 | SaveAnimationResult(*anim); |
| 369 | } |
| 370 | if (frontList.empty()) |
| 371 | StartNextAnimations(); |
| 372 | } |
| 373 | |
| 374 | #ifdef DEBUG_ANIMATIONS |
| 375 | void AnimationSystem::Print() |
no test coverage detected