| 150 | } |
| 151 | |
| 152 | void Tr2GrannyAnimationLayer::ConsumeAnimationQueue( const Tr2GrannyAnimation* animationController ) |
| 153 | { |
| 154 | CCP_ASSERT( animationController->IsUsingCMF() == m_useCMF ); |
| 155 | |
| 156 | // PlayAnimation will clear the animation queue if the replace flag is set. |
| 157 | // We really should be searching backwards through the queue here to find the |
| 158 | // last entry with replace set, then go forward from there. In reality we |
| 159 | // rarely have more than one entry here, and this approach is much simpler: |
| 160 | // Make a copy of the queue, iterate through that and be done with it... |
| 161 | std::vector<AnimationRequest> queueSnapshot = m_animationQueue; |
| 162 | for( auto it = queueSnapshot.cbegin(); it != queueSnapshot.cend(); ++it ) |
| 163 | { |
| 164 | PlayAnimation( animationController, it->m_animationName.c_str(), it->m_replace, it->m_loopCount, it->m_start, it->m_speed, it->m_clearWhenDone ); |
| 165 | } |
| 166 | m_animationQueue.clear(); |
| 167 | } |
| 168 | |
| 169 | void Tr2GrannyAnimationLayer::QueueAnimation( const char* animName, bool replace, int loopCount, float delay, float speed, bool clearWhenDone ) |
| 170 | { |
no test coverage detected