From ebe5b97b4927711bd6f8a09c81e605b35786000b Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 16 Jan 2003 05:07:54 +0000 Subject: [PATCH] add GetDestTweenState and SetTweenState --- stepmania/src/Actor.cpp | 10 ++++++++++ stepmania/src/Actor.h | 17 +++++++++++------ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/stepmania/src/Actor.cpp b/stepmania/src/Actor.cpp index 8c5a006ac3..7776429b47 100644 --- a/stepmania/src/Actor.cpp +++ b/stepmania/src/Actor.cpp @@ -336,6 +336,16 @@ void Actor::SetTweenDiffuseBottomEdge( RageColor c ) { LatestTween().diffuse[2] void Actor::SetTweenDiffuseLeftEdge( RageColor c ) { LatestTween().diffuse[0] = LatestTween().diffuse[2] = c; }; void Actor::SetTweenGlow( RageColor c ) { LatestTween().glow = c; }; +Actor::TweenState Actor::GetDestTweenState() +{ + if(!m_iNumTweenStates) return m_current; + return LatestTween(); +} + +void Actor::SetTweenState( const Actor::TweenState &ts ) +{ + LatestTween() = ts; +} void Actor::ScaleTo( const RectI &rect, StretchType st ) { diff --git a/stepmania/src/Actor.h b/stepmania/src/Actor.h index ab6aa14cea..19c345deaa 100644 --- a/stepmania/src/Actor.h +++ b/stepmania/src/Actor.h @@ -131,8 +131,6 @@ public: virtual void SetTweenDiffuseBottomEdge( RageColor colorDiffuse ); virtual void SetTweenDiffuseLeftEdge( RageColor colorDiffuse ); virtual void SetTweenGlow( RageColor c ); - - enum StretchType { fit_inside, cover }; @@ -188,10 +186,6 @@ public: void FadeOff( float fSleepSeconds, CString sFadeString, float fFadeSeconds ) { Fade(fSleepSeconds,sFadeString,fFadeSeconds,true); }; -protected: - - bool m_bFirstUpdate; - // // Stuff for tweening // @@ -215,6 +209,15 @@ protected: }; }; + /* Intended for a very limited use: you can query the destination + * state (that is, where the actor would end up if its tween finished), + * stop tweening (possibly leaving it partially tweened), do something, + * then tween to the original destination. */ + virtual TweenState GetDestTweenState(); + virtual void SetTweenState( const TweenState &ts ); + +protected: + struct TweenInfo { // counters for tweening @@ -243,6 +246,8 @@ protected: RageColor m_temp_colorGlow; */ + bool m_bFirstUpdate; + // // Stuff for alignment //