diff --git a/stepmania/src/Actor.cpp b/stepmania/src/Actor.cpp index 105a6980d9..90c5074a8a 100644 --- a/stepmania/src/Actor.cpp +++ b/stepmania/src/Actor.cpp @@ -1036,7 +1036,7 @@ void Actor::AddRotationR( float rot ) RageQuatMultiply( &DestTweenState().quat, DestTweenState().quat, RageQuatFromR(rot) ); } -void Actor::RunCommands( const LuaReference& cmds, Actor *pParent ) +void Actor::RunCommands( const LuaReference& cmds ) { Lua *L = LUA->Get(); @@ -1250,7 +1250,7 @@ const apActorCommands *Actor::GetCommand( const RString &sCommandName ) const return &it->second; } -void Actor::PlayCommand( const RString &sCommandName, Actor *pParent ) +void Actor::PlayCommand( const RString &sCommandName ) { const apActorCommands *pCmd = GetCommand( sCommandName ); if( pCmd != NULL ) @@ -1432,7 +1432,7 @@ public: static int hidden( T* p, lua_State *L ) { p->SetHidden(!!IArg(1)); return 0; } static int hibernate( T* p, lua_State *L ) { p->SetHibernate(FArg(1)); return 0; } static int draworder( T* p, lua_State *L ) { p->SetDrawOrder(IArg(1)); return 0; } - static int playcommand( T* p, lua_State *L ) { p->PlayCommand(SArg(1),NULL); return 0; } + static int playcommand( T* p, lua_State *L ) { p->PlayCommand(SArg(1)); return 0; } static int queuecommand( T* p, lua_State *L ) { p->QueueCommand(SArg(1)); return 0; } static int queuemessage( T* p, lua_State *L ) { p->QueueMessage(SArg(1)); return 0; } static int addcommand( T* p, lua_State *L ) diff --git a/stepmania/src/Actor.h b/stepmania/src/Actor.h index a83abcef52..1ac528112d 100644 --- a/stepmania/src/Actor.h +++ b/stepmania/src/Actor.h @@ -335,11 +335,11 @@ public: void AddCommand( const RString &sCmdName, apActorCommands apac ); bool HasCommand( const RString &sCmdName ); const apActorCommands *GetCommand( const RString &sCommandName ) const; - virtual void PlayCommand( const RString &sCommandName, Actor *pParent = NULL ); - virtual void RunCommands( const LuaReference& cmds, Actor *pParent = NULL ); - void RunCommands( const apActorCommands& cmds, Actor *pParent = NULL ) { this->RunCommands( *cmds, pParent ); } // convenience + virtual void PlayCommand( const RString &sCommandName ); + virtual void RunCommands( const LuaReference& cmds ); + void RunCommands( const apActorCommands& cmds ) { this->RunCommands( *cmds ); } // convenience // If we're a leaf, then execute this command. - virtual void RunCommandsOnLeaves( const LuaReference& cmds, Actor *pParent = NULL ) { RunCommands(cmds,pParent); } + virtual void RunCommandsOnLeaves( const LuaReference& cmds ) { RunCommands(cmds); } void SetParent( Actor *pParent ); diff --git a/stepmania/src/ActorFrame.cpp b/stepmania/src/ActorFrame.cpp index 7b86011b4d..1a32d19ae8 100644 --- a/stepmania/src/ActorFrame.cpp +++ b/stepmania/src/ActorFrame.cpp @@ -252,13 +252,13 @@ void ActorFrame::PlayCommandOnLeaves( const RString &sCommandName ) void ActorFrame::RunCommandsOnChildren( const LuaReference& cmds ) { for( unsigned i=0; iRunCommands( cmds, this ); + m_SubActors[i]->RunCommands( cmds ); } -void ActorFrame::RunCommandsOnLeaves( const LuaReference& cmds, Actor* pParent ) +void ActorFrame::RunCommandsOnLeaves( const LuaReference& cmds ) { for( unsigned i=0; iRunCommandsOnLeaves( cmds, this ); + m_SubActors[i]->RunCommandsOnLeaves( cmds ); } void ActorFrame::UpdateInternal( float fDeltaTime ) @@ -350,12 +350,12 @@ void ActorFrame::DeleteAllChildren() m_SubActors.clear(); } -void ActorFrame::RunCommands( const LuaReference& cmds, Actor* pParent ) +void ActorFrame::RunCommands( const LuaReference& cmds ) { if( m_bPropagateCommands ) RunCommandsOnChildren( cmds ); else - Actor::RunCommands( cmds, pParent ); + Actor::RunCommands( cmds ); } void ActorFrame::SetPropagateCommands( bool b ) @@ -363,9 +363,9 @@ void ActorFrame::SetPropagateCommands( bool b ) m_bPropagateCommands = b; } -void ActorFrame::PlayCommand( const RString &sCommandName, Actor* pParent ) +void ActorFrame::PlayCommand( const RString &sCommandName ) { - Actor::PlayCommand( sCommandName, pParent ); + Actor::PlayCommand( sCommandName ); // HACK: Don't propogate Init. It gets called once for every Actor when the // Actor is loaded, and we don't want to call it again. @@ -375,7 +375,7 @@ void ActorFrame::PlayCommand( const RString &sCommandName, Actor* pParent ) for( unsigned i=0; iPlayCommand( sCommandName, this ); + pActor->PlayCommand( sCommandName ); } } diff --git a/stepmania/src/ActorFrame.h b/stepmania/src/ActorFrame.h index 30c693e4e5..d1b2a74065 100644 --- a/stepmania/src/ActorFrame.h +++ b/stepmania/src/ActorFrame.h @@ -39,7 +39,7 @@ public: void PlayCommandOnLeaves( const RString &sCommandName ); virtual void RunCommandsOnChildren( const LuaReference& cmds ); /* but not on self */ void RunCommandsOnChildren( const apActorCommands& cmds ) { this->RunCommandsOnChildren( *cmds ); } // convenience - virtual void RunCommandsOnLeaves( const LuaReference& cmds, Actor* pParent=NULL ); /* but not on self */ + virtual void RunCommandsOnLeaves( const LuaReference& cmds ); /* but not on self */ virtual void UpdateInternal( float fDeltaTime ); virtual void ProcessMessages( float fDeltaTime ); @@ -63,9 +63,9 @@ public: /* Amount of time until all tweens (and all children's tweens) have stopped: */ virtual float GetTweenTimeLeft() const; - virtual void PlayCommand( const RString &sCommandName, Actor* pParent = NULL ); - virtual void RunCommands( const LuaReference& cmds, Actor* pParent = NULL ); - void RunCommands( const apActorCommands& cmds, Actor *pParent = NULL ) { this->RunCommands( *cmds, pParent ); } // convenience + virtual void PlayCommand( const RString &sCommandName ); + virtual void RunCommands( const LuaReference& cmds ); + void RunCommands( const apActorCommands& cmds ) { this->RunCommands( *cmds ); } // convenience protected: void LoadChildrenFromNode( const RString& sDir, const XNode* pNode ); diff --git a/stepmania/src/HelpDisplay.cpp b/stepmania/src/HelpDisplay.cpp index f4133a3343..64efa800cb 100644 --- a/stepmania/src/HelpDisplay.cpp +++ b/stepmania/src/HelpDisplay.cpp @@ -148,7 +148,7 @@ GenreDisplay::~GenreDisplay() { } -void GenreDisplay::PlayCommand( const RString &sCommandName, Actor* pParent ) +void GenreDisplay::PlayCommand( const RString &sCommandName ) { if( sCommandName == MessageToString(Message_CurrentSongChanged) ) { @@ -189,7 +189,7 @@ void GenreDisplay::PlayCommand( const RString &sCommandName, Actor* pParent ) } else { - Actor::PlayCommand( sCommandName, pParent ); + Actor::PlayCommand( sCommandName ); } } diff --git a/stepmania/src/HelpDisplay.h b/stepmania/src/HelpDisplay.h index e1a32708d2..add3af5fe9 100644 --- a/stepmania/src/HelpDisplay.h +++ b/stepmania/src/HelpDisplay.h @@ -42,7 +42,7 @@ class GenreDisplay : public HelpDisplay public: GenreDisplay(); ~GenreDisplay(); - void PlayCommand( const RString &sCommandName, Actor* pParent ); + void PlayCommand( const RString &sCommandName ); virtual Actor *Copy() const; }; diff --git a/stepmania/src/ScoreDisplayAliveTime.cpp b/stepmania/src/ScoreDisplayAliveTime.cpp index f20815347d..a0519bf154 100644 --- a/stepmania/src/ScoreDisplayAliveTime.cpp +++ b/stepmania/src/ScoreDisplayAliveTime.cpp @@ -39,11 +39,11 @@ void ScoreDisplayAliveTime::Update( float fDelta ) BitmapText::Update( fDelta ); } -void ScoreDisplayAliveTime::PlayCommand( const RString &sCommandName, Actor* pParent ) +void ScoreDisplayAliveTime::PlayCommand( const RString &sCommandName ) { // TODO: Add handling of GoalComplete message - BitmapText::PlayCommand( sCommandName, pParent ); + BitmapText::PlayCommand( sCommandName ); } void ScoreDisplayAliveTime::UpdateNumber() diff --git a/stepmania/src/ScoreDisplayAliveTime.h b/stepmania/src/ScoreDisplayAliveTime.h index 190b907820..bcb1e98eae 100644 --- a/stepmania/src/ScoreDisplayAliveTime.h +++ b/stepmania/src/ScoreDisplayAliveTime.h @@ -19,7 +19,7 @@ public: void LoadFromNode( const RString& sDir, const XNode* pNode ); virtual Actor *Copy() const; - void PlayCommand( const RString &sCommandName, Actor* pParent ); + void PlayCommand( const RString &sCommandName ); void UpdateNumber(); diff --git a/stepmania/src/ScoreDisplayCalories.cpp b/stepmania/src/ScoreDisplayCalories.cpp index 70477acb63..b8392f530e 100644 --- a/stepmania/src/ScoreDisplayCalories.cpp +++ b/stepmania/src/ScoreDisplayCalories.cpp @@ -48,14 +48,14 @@ void ScoreDisplayCalories::Update( float fDelta ) RollingNumbers::Update( fDelta ); } -void ScoreDisplayCalories::PlayCommand( const RString &sCommandName, Actor* pParent ) +void ScoreDisplayCalories::PlayCommand( const RString &sCommandName ) { if( sCommandName == m_sMessageOnStep ) { UpdateNumber(); } - RollingNumbers::PlayCommand( sCommandName, pParent ); + RollingNumbers::PlayCommand( sCommandName ); } void ScoreDisplayCalories::UpdateNumber() diff --git a/stepmania/src/ScoreDisplayCalories.h b/stepmania/src/ScoreDisplayCalories.h index 36fd536fe5..2c0de3d8ac 100644 --- a/stepmania/src/ScoreDisplayCalories.h +++ b/stepmania/src/ScoreDisplayCalories.h @@ -18,7 +18,7 @@ public: void LoadFromNode( const RString& sDir, const XNode* pNode ); virtual Actor *Copy() const; - void PlayCommand( const RString &sCommandName, Actor* pParent ); + void PlayCommand( const RString &sCommandName ); void UpdateNumber(); diff --git a/stepmania/src/Transition.cpp b/stepmania/src/Transition.cpp index b5d9587422..7fa15fa19f 100644 --- a/stepmania/src/Transition.cpp +++ b/stepmania/src/Transition.cpp @@ -66,12 +66,12 @@ bool Transition::EarlyAbortDraw() const /* Our parent might send us OnCommand. We do that ourself, because * we sometimes want to know GetLengthSeconds before StartTransitioning. * Make sure we don't process OnCommand twice. */ -void Transition::PlayCommand( const RString &sCommandName, Actor *pParent ) +void Transition::PlayCommand( const RString &sCommandName ) { if( sCommandName == "On" ) return; - ActorFrame::PlayCommand( sCommandName, pParent ); + ActorFrame::PlayCommand( sCommandName ); } void Transition::StartTransitioning( ScreenMessage send_when_done ) diff --git a/stepmania/src/Transition.h b/stepmania/src/Transition.h index dc07820875..c55e49304c 100644 --- a/stepmania/src/Transition.h +++ b/stepmania/src/Transition.h @@ -16,7 +16,7 @@ public: void Load( RString sBGAniDir ); virtual void UpdateInternal( float fDeltaTime ); - virtual void PlayCommand( const RString &sCommandName, Actor *pParent = NULL ); + virtual void PlayCommand( const RString &sCommandName ); virtual void StartTransitioning( ScreenMessage send_when_done = SM_None ); virtual bool EarlyAbortDraw() const;