add OffCommand to BGAnimation

This commit is contained in:
Chris Danford
2003-07-10 03:37:13 +00:00
parent f0a69fb1fc
commit 5b3a0330b9
6 changed files with 38 additions and 8 deletions
+7 -1
View File
@@ -173,4 +173,10 @@ void BGAnimation::SetDiffuse( const RageColor &c )
{
for( unsigned i=0; i<m_Layers.size(); i++ )
m_Layers[i]->SetDiffuse(c);
}
}
void BGAnimation::PlayOffCommand()
{
for( unsigned i=0; i<m_Layers.size(); i++ )
m_Layers[i]->PlayOffCommand();
}
+2
View File
@@ -42,6 +42,8 @@ public:
float GetLengthSeconds() { return m_fLengthSeconds; }
void PlayOffCommand();
protected:
vector<BGAnimationLayer*> m_Layers;
float m_fLengthSeconds;
+15 -4
View File
@@ -522,7 +522,8 @@ void BGAnimationLayer::LoadFromIni( CString sAniDir, CString sLayer )
}
ini.GetValueI( sLayer, "Type", (int&)m_Type );
ini.GetValue ( sLayer, "Command", m_sCommand );
ini.GetValue ( sLayer, "Command", m_sOnCommand );
ini.GetValue ( sLayer, "OffCommand", m_sOffCommand );
ini.GetValueF( sLayer, "FOV", m_fFOV );
ini.GetValueB( sLayer, "Lighting", m_bLighting );
ini.GetValueF( sLayer, "StretchTexCoordVelocityX", m_fStretchTexCoordVelocityX );
@@ -627,10 +628,10 @@ void BGAnimationLayer::LoadFromIni( CString sAniDir, CString sLayer )
m_pActors[i]->SetState( rand()%m_pActors[i]->GetNumStates() );
}
if( m_sCommand != "" )
if( m_sOnCommand != "" )
{
for( unsigned i=0; i<m_pActors.size(); i++ )
m_pActors[i]->Command( m_sCommand );
m_pActors[i]->Command( m_sOnCommand );
}
}
@@ -962,7 +963,7 @@ void BGAnimationLayer::GainingFocus( float fRate, bool bRewindMovie, bool bLoop
pSprite->GetTexture()->Play();
for( unsigned i=0; i<m_pActors.size(); i++ )
m_pActors[i]->Command( m_sCommand );
m_pActors[i]->Command( m_sOnCommand );
}
void BGAnimationLayer::LosingFocus()
@@ -972,3 +973,13 @@ void BGAnimationLayer::LosingFocus()
pSprite->GetTexture()->Pause();
}
void BGAnimationLayer::PlayOffCommand()
{
if( m_sOffCommand != "" )
{
for( unsigned i=0; i<m_pActors.size(); i++ )
m_pActors[i]->Command( m_sOffCommand );
}
}
+4 -1
View File
@@ -44,6 +44,8 @@ public:
void GainingFocus( float fRate, bool bRewindMovie, bool bLoop );
void LosingFocus();
void PlayOffCommand();
protected:
vector<Actor*> m_pActors;
RageVector3 m_vParticleVelocity[MAX_SPRITES];
@@ -95,7 +97,8 @@ protected:
//
// common stuff
CString m_sCommand;
CString m_sOnCommand;
CString m_sOffCommand;
float m_fUpdateRate; // get by GainingFocus
float m_fFOV; // -1 = no change
bool m_bLighting;
+2
View File
@@ -112,6 +112,8 @@ void MenuElements::StartTransitioning( ScreenMessage smSendWhenDone )
m_sprFooter.Command( FOOTER_OFF_COMMAND );
m_textHelp.Command( HELP_OFF_COMMAND );
m_Background.PlayOffCommand();
m_Out.StartTransitioning(smSendWhenDone);
/* Ack. If the transition finishes transparent (eg. _options to options),
+8 -2
View File
@@ -70,8 +70,11 @@ void ScreenCaution::HandleScreenMessage( const ScreenMessage SM )
switch( SM )
{
case SM_StartClosing:
if( !m_Out.IsTransitioning() )
if( !m_In.IsTransitioning() && !m_Out.IsTransitioning() )
{
m_Background.PlayOffCommand();
m_Out.StartTransitioning( SM_GoToNextScreen );
}
break;
case SM_DoneOpening:
SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("caution") );
@@ -87,8 +90,11 @@ void ScreenCaution::HandleScreenMessage( const ScreenMessage SM )
void ScreenCaution::MenuStart( PlayerNumber pn )
{
if( !m_Out.IsTransitioning() )
if( !m_In.IsTransitioning() && !m_Out.IsTransitioning() )
{
m_Background.PlayOffCommand();
m_Out.StartTransitioning( SM_GoToNextScreen );
}
}
void ScreenCaution::MenuBack( PlayerNumber pn )