name cleanup: Gaining -> Gain, Losing->Lose
This commit is contained in:
@@ -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" ||
|
||||
|
||||
@@ -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 ) {}
|
||||
|
||||
|
||||
@@ -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; i<m_SubActors.size(); i++ )
|
||||
m_SubActors[i]->GainingFocus( fRate, bRewindMovie, bLoop );
|
||||
m_SubActors[i]->GainFocus( fRate, bRewindMovie, bLoop );
|
||||
}
|
||||
|
||||
void ActorFrame::LosingFocus()
|
||||
void ActorFrame::LoseFocus()
|
||||
{
|
||||
Actor::LosingFocus();
|
||||
Actor::LoseFocus();
|
||||
|
||||
for( unsigned i=0; i<m_SubActors.size(); i++ )
|
||||
m_SubActors[i]->LosingFocus();
|
||||
m_SubActors[i]->LoseFocus();
|
||||
}
|
||||
|
||||
void ActorFrame::PlayCommand( const CString &sCommandName )
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<CString, CString> 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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user