From 313359c2d7d91e69ac299e773603ed51645d59f4 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 4 Sep 2002 21:53:43 +0000 Subject: [PATCH] bump tween update into a separate function --- stepmania/src/Actor.cpp | 109 +++++++++++++++++++++------------------- stepmania/src/Actor.h | 4 ++ 2 files changed, 60 insertions(+), 53 deletions(-) diff --git a/stepmania/src/Actor.cpp b/stepmania/src/Actor.cpp index 3e83808518..7da70cdce0 100644 --- a/stepmania/src/Actor.cpp +++ b/stepmania/src/Actor.cpp @@ -141,6 +141,61 @@ void Actor::EndDraw() DISPLAY->PopMatrix(); } +void Actor::UpdateTweening( float fDeltaTime ) +{ + // update tweening + if( m_iNumTweenStates == 0 ) + return; + + // we are performing a tween + TweenState &TS = m_TweenStates[0]; // earliest tween + TweenInfo &TI = m_TweenInfo[0]; // earliest tween + + if( TI.m_fTimeLeftInTween == TI.m_fTweenTime ) // we are just beginning this tween + { + // set the start position + m_start = m_current; + } + + TI.m_fTimeLeftInTween -= fDeltaTime; + + if( TI.m_fTimeLeftInTween <= 0 ) // The tweening is over. Stop the tweening + { + m_current = TS; + + // delete the head tween + for( int i=0; i 0 ) // we are performing a tween - { - TweenState &TS = m_TweenStates[0]; // earliest tween - TweenInfo &TI = m_TweenInfo[0]; // earliest tween - - if( TI.m_fTimeLeftInTween == TI.m_fTweenTime ) // we are just beginning this tween - { - // set the start position - m_start = m_current; - } - - TI.m_fTimeLeftInTween -= fDeltaTime; - - if( TI.m_fTimeLeftInTween <= 0 ) // The tweening is over. Stop the tweening - { - m_current = TS; - - // delete the head tween - for( int i=0; i