fix PlayCommand doesn't propogate
This commit is contained in:
@@ -815,11 +815,13 @@ void Actor::HandleCommand( const ParsedCommand &command )
|
||||
else if( sName=="zwrite" ) SetZWrite( bParam(1) );
|
||||
else if( sName=="clearzbuffer" ) SetClearZBuffer( bParam(1) );
|
||||
else if( sName=="hidden" ) SetHidden( bParam(1) );
|
||||
else if( sName=="playcommand" ) sParam(1); /* nop: only BGAnimation handles this but everyone receives it */
|
||||
else if( sName=="customtexturerect" || sName=="texcoordvelocity" || sName=="scaletoclipped" ||
|
||||
sName=="stretchtexcoords" || sName=="position" || sName=="loop" || sName=="play" ||
|
||||
sName=="pause" || sName=="rate" )
|
||||
return; /* sprite commands; don't run CheckHandledParams */
|
||||
else if( sName=="playcommand" ) PlayCommand( sParam(1) );
|
||||
// Commands to Sprite should have been handled by Sprite and shouldn't be
|
||||
// passed to Actor. -Chris
|
||||
// else if( sName=="customtexturerect" || sName=="texcoordvelocity" || sName=="scaletoclipped" ||
|
||||
// sName=="stretchtexcoords" || sName=="position" || sName=="loop" || sName=="play" ||
|
||||
// sName=="pause" || sName=="rate" )
|
||||
// return; /* sprite commands; don't run CheckHandledParams */
|
||||
else
|
||||
{
|
||||
CString sError = ssprintf( "Actor::HandleCommand: Unrecognized command name '%s'.", sName.c_str() );
|
||||
|
||||
@@ -93,11 +93,20 @@ void ActorFrame::Update( float fDeltaTime )
|
||||
}
|
||||
|
||||
PropagateActorFrameCommand( SetDiffuse, RageColor )
|
||||
PropagateActorFrameCommand( SetDiffuseAlpha, float )
|
||||
PropagateActorFrameCommand( SetZTest, bool )
|
||||
PropagateActorFrameCommand( SetZWrite, bool )
|
||||
PropagateActorFrameCommand( HurryTweening, float )
|
||||
|
||||
void ActorFrame::SetDiffuseAlpha( float f )
|
||||
{
|
||||
Actor::SetDiffuseAlpha( f );
|
||||
|
||||
/* set all sub-Actors */
|
||||
for( unsigned i=0; i<m_SubActors.size(); i++ )
|
||||
m_SubActors[i]->SetDiffuseAlpha( f );
|
||||
}
|
||||
|
||||
|
||||
void ActorFrame::FinishTweening()
|
||||
{
|
||||
Actor::FinishTweening();
|
||||
@@ -138,15 +147,6 @@ void ActorFrame::DeleteAllChildren()
|
||||
|
||||
void ActorFrame::HandleCommand( const ParsedCommand &command )
|
||||
{
|
||||
// pass "PlayCommand" on to children
|
||||
if( command.vTokens[0].s=="playcommand" )
|
||||
{
|
||||
for( unsigned i=0; i<m_SubActors.size(); i++ )
|
||||
m_SubActors[i]->HandleCommand( command );
|
||||
return; // handled
|
||||
}
|
||||
|
||||
// base class handles the rest...
|
||||
Actor::HandleCommand( command );
|
||||
}
|
||||
|
||||
|
||||
@@ -651,13 +651,6 @@ void BGAnimationLayer::LoadFromIni( CString sAniDir, CString sLayer )
|
||||
PlayCommand( "On" );
|
||||
}
|
||||
|
||||
|
||||
void BGAnimationLayer::FinishTweening()
|
||||
{
|
||||
for( unsigned i=0; i<m_SubActors.size(); i++ )
|
||||
m_SubActors[i]->FinishTweening();
|
||||
}
|
||||
|
||||
void BGAnimationLayer::Update( float fDeltaTime )
|
||||
{
|
||||
fDeltaTime *= m_fUpdateRate;
|
||||
@@ -964,12 +957,6 @@ void BGAnimationLayer::DrawPrimitives()
|
||||
}
|
||||
}
|
||||
|
||||
void BGAnimationLayer::SetDiffuse( RageColor c )
|
||||
{
|
||||
for(unsigned i=0; i<m_SubActors.size(); i++)
|
||||
m_SubActors[i]->SetDiffuse(c);
|
||||
}
|
||||
|
||||
void BGAnimationLayer::GainingFocus( float fRate, bool bRewindMovie, bool bLoop )
|
||||
{
|
||||
m_fUpdateRate = fRate;
|
||||
@@ -1001,15 +988,16 @@ void BGAnimationLayer::LosingFocus()
|
||||
m_SubActors[0]->Command( "pause" );
|
||||
}
|
||||
|
||||
void BGAnimationLayer::PlayCommand( CString cmd )
|
||||
void BGAnimationLayer::PlayCommand( const CString &sCommandName )
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
for( i=0; i<m_SubActors.size(); i++ )
|
||||
m_SubActors[i]->Command( ssprintf("playcommand,%s", cmd.c_str()) );
|
||||
m_SubActors[i]->Command( ssprintf("playcommand,%s", sCommandName.c_str()) );
|
||||
|
||||
cmd.MakeLower();
|
||||
map<CString, CString>::const_iterator it = m_asCommands.find( cmd );
|
||||
CString sKey = sCommandName;
|
||||
sKey.MakeLower();
|
||||
map<CString, CString>::const_iterator it = m_asCommands.find( sKey );
|
||||
|
||||
if( it == m_asCommands.end() )
|
||||
return;
|
||||
|
||||
@@ -33,14 +33,11 @@ public:
|
||||
void Update( float fDeltaTime );
|
||||
void DrawPrimitives();
|
||||
|
||||
void SetDiffuse( RageColor c );
|
||||
|
||||
float GetMaxTweenTimeLeft() const;
|
||||
void FinishTweening();
|
||||
void GainingFocus( float fRate, bool bRewindMovie, bool bLoop );
|
||||
void LosingFocus();
|
||||
|
||||
void PlayCommand( CString cmd );
|
||||
void PlayCommand( const CString &sCommandName );
|
||||
void PlayOffCommand() { PlayCommand( "Off" ); }
|
||||
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user