MCPcopy Create free account
hub / github.com/carbonengine/trinity / ConsumeAnimationQueue

Method ConsumeAnimationQueue

trinity/Tr2GrannyAnimationLayer.cpp:152–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150}
151
152void 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
169void Tr2GrannyAnimationLayer::QueueAnimation( const char* animName, bool replace, int loopCount, float delay, float speed, bool clearWhenDone )
170{

Callers 1

RebuildCachedDataMethod · 0.80

Calls 1

IsUsingCMFMethod · 0.45

Tested by

no test coverage detected