diff --git a/stepmania/src/Actor.cpp b/stepmania/src/Actor.cpp index 784dbf8f72..51e41667f3 100644 --- a/stepmania/src/Actor.cpp +++ b/stepmania/src/Actor.cpp @@ -55,6 +55,7 @@ void Actor::Reset() m_bShadow = false; m_fShadowLength = 4; m_bIsAnimating = true; + m_fHibernateSecondsLeft = 0; m_bTextureWrapping = false; m_BlendMode = BLEND_NORMAL; @@ -75,6 +76,8 @@ void Actor::Draw() { if( m_bHidden ) return; // early abort + if( m_fHibernateSecondsLeft > 0 ) + return; // early abort // call the most-derived versions this->BeginDraw(); @@ -295,6 +298,12 @@ void Actor::Update( float fDeltaTime ) { // LOG->Trace( "Actor::Update( %f )", fDeltaTime ); + m_fHibernateSecondsLeft -= fDeltaTime; + m_fHibernateSecondsLeft = max( 0, m_fHibernateSecondsLeft ); + + if( m_fHibernateSecondsLeft > 0 ) + return; + // update effect switch( m_Effect ) { @@ -816,6 +825,7 @@ void Actor::HandleCommand( const ParsedCommand &command ) else if( sName=="clearzbuffer" ) SetClearZBuffer( bParam(1) ); else if( sName=="backfacecull" ) SetUseBackfaceCull( bParam(1) ); else if( sName=="hidden" ) SetHidden( bParam(1) ); + else if( sName=="hibernate" ) SetHibernate( fParam(1) ); else if( sName=="playcommand" ) PlayCommand( sParam(1) ); /* These are commands intended for a Sprite commands, but they will get @@ -848,6 +858,8 @@ float Actor::GetTweenTimeLeft() const { float tot = 0; + tot += m_fHibernateSecondsLeft; + for( unsigned i=0; iEnableAnimation(true); }; - virtual void StopAnimating() { this->EnableAnimation(false); }; + virtual void StartAnimating() { this->EnableAnimation(true); }; + virtual void StopAnimating() { this->EnableAnimation(false); }; // @@ -367,6 +369,7 @@ protected: // other properties // bool m_bHidden; + float m_fHibernateSecondsLeft; bool m_bShadow; float m_fShadowLength; bool m_bIsAnimating; diff --git a/stepmania/src/ActorFrame.cpp b/stepmania/src/ActorFrame.cpp index da6e65f7a4..6462daab48 100644 --- a/stepmania/src/ActorFrame.cpp +++ b/stepmania/src/ActorFrame.cpp @@ -77,6 +77,9 @@ void ActorFrame::Update( float fDeltaTime ) // LOG->Trace( "ActorFrame::Update( %f )", fDeltaTime ); Actor::Update( fDeltaTime ); + if( m_fHibernateSecondsLeft > 0 ) + return; + // update all sub-Actors for( vector::iterator it=m_SubActors.begin(); it!=m_SubActors.end(); it++ ) (*it)->Update(fDeltaTime); @@ -121,7 +124,7 @@ float ActorFrame::GetTweenTimeLeft() const float m = Actor::GetTweenTimeLeft(); for( unsigned i=0; iGetTweenTimeLeft()); + m = max(m, m_fHibernateSecondsLeft + m_SubActors[i]->GetTweenTimeLeft()); return m; diff --git a/stepmania/src/ActorScroller.cpp b/stepmania/src/ActorScroller.cpp index 8b6c397603..3dd14e2e73 100644 --- a/stepmania/src/ActorScroller.cpp +++ b/stepmania/src/ActorScroller.cpp @@ -55,6 +55,9 @@ void ActorScroller::Update( float fDeltaTime ) { ActorFrame::Update( fDeltaTime ); + if( m_fHibernateSecondsLeft > 0 ) + return; // early abort + fapproach( m_fCurrentItem, m_fDestinationItem, fDeltaTime/m_fSecondsPerItem ); } diff --git a/stepmania/src/BGAnimationLayer.cpp b/stepmania/src/BGAnimationLayer.cpp index 0de7844343..ed9a6ac93f 100644 --- a/stepmania/src/BGAnimationLayer.cpp +++ b/stepmania/src/BGAnimationLayer.cpp @@ -653,6 +653,9 @@ void BGAnimationLayer::LoadFromIni( CString sAniDir, CString sLayer ) void BGAnimationLayer::Update( float fDeltaTime ) { + if( m_fHibernateSecondsLeft > 0 ) + return; + fDeltaTime *= m_fUpdateRate; const float fSongBeat = GAMESTATE->m_fSongBeat;