From f5d3b27450b910698f1d1c4a77db478011e5b787 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sun, 22 Aug 2004 02:16:31 +0000 Subject: [PATCH] name cleanup: Gaining -> Gain, Losing->Lose --- stepmania/src/Actor.cpp | 2 +- stepmania/src/Actor.h | 4 ++-- stepmania/src/ActorFrame.cpp | 12 ++++++------ stepmania/src/ActorFrame.h | 4 ++-- stepmania/src/BGAnimationLayer.cpp | 10 ++++++---- stepmania/src/BGAnimationLayer.h | 6 +++--- stepmania/src/Background.cpp | 4 ++-- 7 files changed, 22 insertions(+), 20 deletions(-) diff --git a/stepmania/src/Actor.cpp b/stepmania/src/Actor.cpp index 899e44e0a1..e9919019c4 100644 --- a/stepmania/src/Actor.cpp +++ b/stepmania/src/Actor.cpp @@ -745,7 +745,7 @@ void Actor::HandleCommand( const ParsedCommand &command ) /* These are commands intended for a Sprite commands, but they will get * sent to all sub-actors (which aren't necessarily Sprites) on - * GainingFocus and LosingFocus. So, don't run CheckHandledParams + * GainFocus and LoseFocus. So, don't run CheckHandledParams * on these commands. */ else if( sName=="customtexturerect" || sName=="texcoordvelocity" || sName=="scaletoclipped" || sName=="stretchtexcoords" || sName=="position" || sName=="loop" || sName=="play" || diff --git a/stepmania/src/Actor.h b/stepmania/src/Actor.h index 348bcbf0b7..bd0a5cc4ee 100644 --- a/stepmania/src/Actor.h +++ b/stepmania/src/Actor.h @@ -316,8 +316,8 @@ public: // // BGAnimation stuff // - virtual void GainingFocus( float fRate, bool bRewindMovie, bool bLoop ) {} - virtual void LosingFocus() {} + virtual void GainFocus( float fRate, bool bRewindMovie, bool bLoop ) {} + virtual void LoseFocus() {} virtual void PlayCommand( const CString &sCommandName ) {} virtual void PlayOffCommand( const CString &sCommandName ) {} diff --git a/stepmania/src/ActorFrame.cpp b/stepmania/src/ActorFrame.cpp index e8b363515f..126f899e52 100644 --- a/stepmania/src/ActorFrame.cpp +++ b/stepmania/src/ActorFrame.cpp @@ -151,20 +151,20 @@ void ActorFrame::HandleCommand( const ParsedCommand &command ) // don't propograte most commands to children } -void ActorFrame::GainingFocus( float fRate, bool bRewindMovie, bool bLoop ) +void ActorFrame::GainFocus( float fRate, bool bRewindMovie, bool bLoop ) { - Actor::GainingFocus( fRate, bRewindMovie, bLoop ); + Actor::GainFocus( fRate, bRewindMovie, bLoop ); for( unsigned i=0; iGainingFocus( fRate, bRewindMovie, bLoop ); + m_SubActors[i]->GainFocus( fRate, bRewindMovie, bLoop ); } -void ActorFrame::LosingFocus() +void ActorFrame::LoseFocus() { - Actor::LosingFocus(); + Actor::LoseFocus(); for( unsigned i=0; iLosingFocus(); + m_SubActors[i]->LoseFocus(); } void ActorFrame::PlayCommand( const CString &sCommandName ) diff --git a/stepmania/src/ActorFrame.h b/stepmania/src/ActorFrame.h index 7726881969..78aee909c9 100644 --- a/stepmania/src/ActorFrame.h +++ b/stepmania/src/ActorFrame.h @@ -35,8 +35,8 @@ public: /* Amount of time until all tweens (and all children's tweens) have stopped: */ virtual float GetTweenTimeLeft() const; - virtual void GainingFocus( float fRate, bool bRewindMovie, bool bLoop ); - virtual void LosingFocus(); + virtual void GainFocus( float fRate, bool bRewindMovie, bool bLoop ); + virtual void LoseFocus(); virtual void PlayCommand( const CString &sCommandName ); protected: diff --git a/stepmania/src/BGAnimationLayer.cpp b/stepmania/src/BGAnimationLayer.cpp index 4952cc013a..ce0e91f6cc 100644 --- a/stepmania/src/BGAnimationLayer.cpp +++ b/stepmania/src/BGAnimationLayer.cpp @@ -973,7 +973,7 @@ void BGAnimationLayer::DrawPrimitives() } } -void BGAnimationLayer::GainingFocus( float fRate, bool bRewindMovie, bool bLoop ) +void BGAnimationLayer::GainFocus( float fRate, bool bRewindMovie, bool bLoop ) { m_fUpdateRate = fRate; @@ -982,10 +982,12 @@ void BGAnimationLayer::GainingFocus( float fRate, bool bRewindMovie, bool bLoop // // The order of these actions is important. - // At this point, the movie is probably paused (by LosingFocus()). + // At this point, the movie is probably paused (by LoseFocus()). // Play the movie, then set the playback rate (which can // potentially pause the movie again). // + // TODO: Don't special case subActor[0]. The movie layer should be set up with + // a LoseFocusCommand that pauses, and a GainFocusCommand that plays. if( bRewindMovie ) m_SubActors[0]->Command( "position,0" ); m_SubActors[0]->Command( ssprintf("loop,%i",bLoop) ); @@ -996,7 +998,7 @@ void BGAnimationLayer::GainingFocus( float fRate, bool bRewindMovie, bool bLoop { /* Yuck. We send OnCommand on load, since that's what's wanted for * most backgrounds. However, gameplay backgrounds (loaded from Background) - * should run OnCommand when they're actually displayed, when GainingFocus + * should run OnCommand when they're actually displayed, when GainFocus * gets called. We've already run OnCommand; abort it so we don't run tweens * twice. */ RunCommandOnChildren( "stoptweening" ); @@ -1006,7 +1008,7 @@ void BGAnimationLayer::GainingFocus( float fRate, bool bRewindMovie, bool bLoop PlayCommand( "GainFocus" ); } -void BGAnimationLayer::LosingFocus() +void BGAnimationLayer::LoseFocus() { if( !m_SubActors.size() ) return; diff --git a/stepmania/src/BGAnimationLayer.h b/stepmania/src/BGAnimationLayer.h index 20c93d8525..782d3e275a 100644 --- a/stepmania/src/BGAnimationLayer.h +++ b/stepmania/src/BGAnimationLayer.h @@ -26,8 +26,8 @@ public: bool EarlyAbortDraw(); float GetMaxTweenTimeLeft() const; - void GainingFocus( float fRate, bool bRewindMovie, bool bLoop ); - void LosingFocus(); + void GainFocus( float fRate, bool bRewindMovie, bool bLoop ); + void LoseFocus(); void PlayCommand( const CString &sCommandName ); void PlayOffCommand() { PlayCommand( "Off" ); } @@ -84,7 +84,7 @@ protected: map m_asCommands; float m_fRepeatCommandEverySeconds; // -1 = no repeat float m_fSecondsUntilNextCommand; - float m_fUpdateRate; // set by GainingFocus + float m_fUpdateRate; // set by GainFocus float m_fFOV; // -1 = no change bool m_bLighting; diff --git a/stepmania/src/Background.cpp b/stepmania/src/Background.cpp index 61e5960d7f..dc89ae0f64 100644 --- a/stepmania/src/Background.cpp +++ b/stepmania/src/Background.cpp @@ -481,9 +481,9 @@ void Background::UpdateCurBGChange( float fCurrentTime ) m_pCurrentBGA = m_BGAnimations[ change.m_sBGName ]; if( pOld ) - pOld->LosingFocus(); + pOld->LoseFocus(); if( m_pCurrentBGA ) - m_pCurrentBGA->GainingFocus( change.m_fRate, change.m_bRewindMovie, change.m_bLoop ); + m_pCurrentBGA->GainFocus( change.m_fRate, change.m_bRewindMovie, change.m_bLoop ); m_fSecsLeftInFade = m_pFadingBGA!=NULL ? FADE_SECONDS : 0;