diff --git a/stepmania/src/Actor.cpp b/stepmania/src/Actor.cpp index 35f3996c29..ae5857c329 100644 --- a/stepmania/src/Actor.cpp +++ b/stepmania/src/Actor.cpp @@ -48,7 +48,6 @@ Actor::Actor() } - void Actor::Draw() { // call the most-derived versions @@ -522,3 +521,12 @@ void Actor::Fade( float fSleepSeconds, CString sFadeString, float fFadeSeconds, LatestTween() = bOnToScreenOrOffOfScreen ? mod : original; } +float Actor::TweenTime() const +{ + float tot = 0; + + for(int i = 0; i < m_iNumTweenStates; ++i) + tot += m_TweenInfo[i].m_fTimeLeftInTween; + + return tot; +} diff --git a/stepmania/src/Actor.h b/stepmania/src/Actor.h index c946fc90f3..6128dfcda3 100644 --- a/stepmania/src/Actor.h +++ b/stepmania/src/Actor.h @@ -104,9 +104,9 @@ public: virtual void BeginTweening( float time, TweenType tt = TWEEN_LINEAR ); - // Tweening is now queued by default - // virtual void BeginTweening( float time, TweenType tt = TWEEN_LINEAR ); virtual void StopTweening(); + /* Amount of time until all tweens have stopped: */ + virtual float TweenTime() const; virtual void SetTweenX( float x ); virtual void SetTweenY( float y ); virtual void SetTweenZ( float z ); @@ -237,7 +237,6 @@ protected: int m_iNumTweenStates; TweenState& LatestTween() { ASSERT(m_iNumTweenStates>0 && m_iNumTweenStatesSetDiffuse(c ); } + +float ActorFrame::TweenTime() const +{ + float m = Actor::TweenTime(); + + for( unsigned i=0; iTweenTime()); + + return m; + +} + diff --git a/stepmania/src/ActorFrame.h b/stepmania/src/ActorFrame.h index 4f062cd88c..58003f5203 100644 --- a/stepmania/src/ActorFrame.h +++ b/stepmania/src/ActorFrame.h @@ -24,6 +24,9 @@ public: virtual void SetDiffuse( RageColor c ); + /* Amount of time until all tweens (and all children's tweens) have stopped: */ + virtual float TweenTime() const; + protected: CArray m_SubActors; };