From 09e856e9ae57571d7eec50716dd14975e0a4c752 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 18 Nov 2003 17:50:50 +0000 Subject: [PATCH] add Actor::HurryTweening --- stepmania/src/Actor.cpp | 8 ++++++++ stepmania/src/Actor.h | 1 + stepmania/src/ActorFrame.cpp | 9 +++++++++ stepmania/src/ActorFrame.h | 1 + 4 files changed, 19 insertions(+) diff --git a/stepmania/src/Actor.cpp b/stepmania/src/Actor.cpp index 6a09cc14f2..097b68be01 100644 --- a/stepmania/src/Actor.cpp +++ b/stepmania/src/Actor.cpp @@ -361,6 +361,14 @@ void Actor::FinishTweening() StopTweening(); } +void Actor::HurryTweening( float factor ) +{ + for( unsigned i = 0; i < m_TweenInfo.size(); ++i ) + { + m_TweenInfo[i].m_fTimeLeftInTween *= factor; + m_TweenInfo[i].m_fTweenTime *= factor; + } +} void Actor::ScaleTo( const RectI &rect, StretchType st ) { diff --git a/stepmania/src/Actor.h b/stepmania/src/Actor.h index 227c5a1335..80ec7067ec 100644 --- a/stepmania/src/Actor.h +++ b/stepmania/src/Actor.h @@ -177,6 +177,7 @@ public: virtual void BeginTweening( float time, TweenType tt = TWEEN_LINEAR ); virtual void StopTweening(); virtual void FinishTweening(); + virtual void HurryTweening( float factor ); virtual float GetTweenTimeLeft() const; // Amount of time until all tweens have stopped virtual TweenState& DestTweenState() // where Actor will end when its tween finish { diff --git a/stepmania/src/ActorFrame.cpp b/stepmania/src/ActorFrame.cpp index 03c33aaa19..a49f0e724a 100644 --- a/stepmania/src/ActorFrame.cpp +++ b/stepmania/src/ActorFrame.cpp @@ -105,6 +105,15 @@ void ActorFrame::FinishTweening() m_SubActors[i]->FinishTweening(); } +void ActorFrame::HurryTweening( float factor ) +{ + Actor::HurryTweening( factor ); + + // set all sub-Actors + for( unsigned i=0; iHurryTweening( factor ); +} + float ActorFrame::GetTweenTimeLeft() const { float m = Actor::GetTweenTimeLeft(); diff --git a/stepmania/src/ActorFrame.h b/stepmania/src/ActorFrame.h index 7184087579..fad0a85720 100644 --- a/stepmania/src/ActorFrame.h +++ b/stepmania/src/ActorFrame.h @@ -30,6 +30,7 @@ public: virtual void SetUseZBuffer( bool b ); virtual void FinishTweening(); + virtual void HurryTweening( float factor ); /* Amount of time until all tweens (and all children's tweens) have stopped: */ virtual float GetTweenTimeLeft() const;