diff --git a/stepmania/src/Actor.cpp b/stepmania/src/Actor.cpp index 1ea626d18c..2c1a56b3bb 100644 --- a/stepmania/src/Actor.cpp +++ b/stepmania/src/Actor.cpp @@ -251,7 +251,7 @@ void Actor::UpdateTweening( float fDeltaTime ) m_start = m_current; // set the start position // Execute the command in this tween (if any). - const ParsedCommand &command = TS.command; + const ActorCommand &command = TS.command; if( !command.vTokens.empty() ) this->HandleCommand( command ); } @@ -618,14 +618,14 @@ void Actor::AddRotationR( float rot ) void Actor::Command( const CString &sCommands ) { - vector vCommands; + vector vCommands; ParseCommands( sCommands, vCommands ); for( unsigned i=0; iHandleCommand( vCommands[i] ); } -void Actor::HandleCommand( const ParsedCommand &command ) +void Actor::HandleCommand( const ActorCommand &command ) { BeginHandleParams; @@ -741,7 +741,7 @@ void Actor::HandleCommand( const ParsedCommand &command ) else if( sName=="playcommand" ) PlayCommand( sParam(1) ); else if( sName=="queuecommand" ) { - ParsedCommand newcommand = command; + ActorCommand newcommand = command; newcommand.vTokens.erase( newcommand.vTokens.begin() ); QueueCommand( newcommand ); return; // don't do parameter number checking @@ -906,7 +906,7 @@ void Actor::Sleep( float time ) BeginTweening( 0, TWEEN_LINEAR ); } -void Actor::QueueCommand( ParsedCommand command ) +void Actor::QueueCommand( ActorCommand command ) { BeginTweening( 0, TWEEN_LINEAR ); DestTweenState().command = command; diff --git a/stepmania/src/Actor.h b/stepmania/src/Actor.h index 3dcde8a5b4..f260daae35 100644 --- a/stepmania/src/Actor.h +++ b/stepmania/src/Actor.h @@ -4,7 +4,7 @@ #define ACTOR_H #include "RageTypes.h" -#include "ActorCommands.h" // for ParsedCommand +#include "ActorCommands.h" // for ActorCommand #include #define DRAW_ORDER_BEFORE_EVERYTHING -100 @@ -49,7 +49,7 @@ public: RageColor diffuse[4]; RageColor glow; GlowMode glowmode; - ParsedCommand command; // command to execute when this + ActorCommand command; // command to execute when this void Init(); static void MakeWeightedAverage( TweenState& average_out, const TweenState& ts1, const TweenState& ts2, float fPercentBetween ); @@ -183,7 +183,7 @@ public: void BeginTweening( float time, TweenType tt = TWEEN_LINEAR ); void StopTweening(); void Sleep( float time ); - void QueueCommand( ParsedCommand command ); + void QueueCommand( ActorCommand command ); virtual void FinishTweening(); virtual void HurryTweening( float factor ); // Let ActorFrame and BGAnimation override @@ -303,7 +303,7 @@ public: // Commands // void Command( const CString &sCommands ); - virtual void HandleCommand( const ParsedCommand &command ); // derivable + virtual void HandleCommand( const ActorCommand &command ); // derivable static float GetCommandLengthSeconds( const CString &sCommands ); // diff --git a/stepmania/src/ActorCommands.cpp b/stepmania/src/ActorCommands.cpp index f6baadcc36..1deae178f6 100644 --- a/stepmania/src/ActorCommands.cpp +++ b/stepmania/src/ActorCommands.cpp @@ -6,7 +6,7 @@ #include "LuaHelpers.h" -void IncorrectActorParametersWarning( const ParsedCommand &command, int iMaxIndexAccessed ) +void IncorrectActorParametersWarning( const ActorCommand &command, int iMaxIndexAccessed ) { const CString sError = ssprintf( "Actor::HandleCommand: Wrong number of parameters in command '%s'. Expected %d but there are %u.", command.GetOriginalCommandString().c_str(), iMaxIndexAccessed+1, unsigned(command.vTokens.size()) ); @@ -14,7 +14,7 @@ void IncorrectActorParametersWarning( const ParsedCommand &command, int iMaxInde Dialog::OK( sError ); } -void ParsedCommandToken::Set( const CString &sParam ) +void ActorCommandToken::Set( const CString &sParam ) { s = sParam; CString s = sParam; @@ -23,7 +23,7 @@ void ParsedCommandToken::Set( const CString &sParam ) bColorIsValid = c.FromString( sParam ); } -void ParsedCommand::Set( const CString &sCommand ) +void ActorCommand::Set( const CString &sCommand ) { CStringArray vsTokens; split( sCommand, ",", vsTokens, false ); // don't ignore empty @@ -44,7 +44,7 @@ void ParsedCommand::Set( const CString &sCommand ) } } -CString ParsedCommand::GetOriginalCommandString() const +CString ActorCommand::GetOriginalCommandString() const { CStringArray asTokens; for( unsigned i=0; i &vCommandsOut ) +void ParseCommands( const CString &sCommands, vector &vCommandsOut ) { vCommandsOut.clear(); CStringArray vsCommands; @@ -63,7 +63,7 @@ void ParseCommands( const CString &sCommands, vector &vCommandsOu for( unsigned i=0; i vTokens; + vector vTokens; CString GetOriginalCommandString() const; // for when reporting an error in number of params }; // Take a command list string and return pointers to each of the tokens in the // string. sCommand list is a list of commands separated by ';'. -void ParseCommands( const CString &sCommands, vector &vCommandsOut ); +void ParseCommands( const CString &sCommands, vector &vCommandsOut ); #define BeginHandleParams int iMaxIndexAccessed = 0; @@ -44,10 +44,10 @@ void ParseCommands( const CString &sCommands, vector &vCommandsOu #define bParam(i) (GetParam(command,i,iMaxIndexAccessed)) #define cParam(i) (ColorParam(command,i,iMaxIndexAccessed)) #define EndHandleParams if( iMaxIndexAccessed != (int)command.vTokens.size()-1 ) { IncorrectActorParametersWarning( command, iMaxIndexAccessed ); } -void IncorrectActorParametersWarning( const ParsedCommand& command, int iMaxIndexAccessed ); +void IncorrectActorParametersWarning( const ActorCommand& command, int iMaxIndexAccessed ); template -inline T GetParam( const ParsedCommand& command, int iIndex, int& iMaxIndexAccessedOut ) +inline T GetParam( const ActorCommand& command, int iIndex, int& iMaxIndexAccessedOut ) { iMaxIndexAccessedOut = max( iIndex, iMaxIndexAccessedOut ); if( iIndex < int(command.vTokens.size()) ) @@ -56,13 +56,13 @@ inline T GetParam( const ParsedCommand& command, int iIndex, int& iMaxIndexAcces } else { - ParsedCommandToken pct; + ActorCommandToken pct; pct.Set( "" ); return (T)pct; } } -inline RageColor ColorParam( const ParsedCommand& command, int iIndex, int& iMaxIndexAccessed ) +inline RageColor ColorParam( const ActorCommand& command, int iIndex, int& iMaxIndexAccessed ) { if( command.vTokens[iIndex].bColorIsValid ) return GetParam(command,iIndex,iMaxIndexAccessed); diff --git a/stepmania/src/ActorFrame.cpp b/stepmania/src/ActorFrame.cpp index 08ebf5d7e3..c0f349ef99 100644 --- a/stepmania/src/ActorFrame.cpp +++ b/stepmania/src/ActorFrame.cpp @@ -73,7 +73,7 @@ void ActorFrame::RunCommandOnChildren( const CString &cmd ) m_SubActors[i]->Command( cmd ); } -void ActorFrame::RunCommandOnChildren( const ParsedCommand &cmd ) +void ActorFrame::RunCommandOnChildren( const ActorCommand &cmd ) { for( unsigned i=0; iHandleCommand( cmd ); @@ -155,7 +155,7 @@ void ActorFrame::DeleteAllChildren() m_SubActors.clear(); } -void ActorFrame::HandleCommand( const ParsedCommand &command ) +void ActorFrame::HandleCommand( const ActorCommand &command ) { BeginHandleParams; diff --git a/stepmania/src/ActorFrame.h b/stepmania/src/ActorFrame.h index b381a947fa..1eed398891 100644 --- a/stepmania/src/ActorFrame.h +++ b/stepmania/src/ActorFrame.h @@ -20,8 +20,8 @@ public: void DeleteAllChildren(); virtual void RunCommandOnChildren( const CString &cmd ); /* but not on self */ - virtual void RunCommandOnChildren( const ParsedCommand &cmd ); /* but not on self */ - virtual void HandleCommand( const ParsedCommand &command ); // derivable + virtual void RunCommandOnChildren( const ActorCommand &cmd ); /* but not on self */ + virtual void HandleCommand( const ActorCommand &command ); // derivable virtual void Update( float fDeltaTime ); virtual void DrawPrimitives(); diff --git a/stepmania/src/BitmapText.cpp b/stepmania/src/BitmapText.cpp index a3e15d25fd..787e470e40 100644 --- a/stepmania/src/BitmapText.cpp +++ b/stepmania/src/BitmapText.cpp @@ -514,7 +514,7 @@ void BitmapText::SetVertAlign( VertAlign va ) BuildChars(); } -void BitmapText::HandleCommand( const ParsedCommand &command ) +void BitmapText::HandleCommand( const ActorCommand &command ) { BeginHandleParams; diff --git a/stepmania/src/BitmapText.h b/stepmania/src/BitmapText.h index 65f82d0ebd..bf8ebedae6 100644 --- a/stepmania/src/BitmapText.h +++ b/stepmania/src/BitmapText.h @@ -37,7 +37,7 @@ public: /* Return true if the string 's' will use an alternate string, if available. */ bool StringWillUseAlternate(CString sText, CString sAlternateText) const; - virtual void HandleCommand( const ParsedCommand &command ); + virtual void HandleCommand( const ActorCommand &command ); public: Font* m_pFont; diff --git a/stepmania/src/Model.cpp b/stepmania/src/Model.cpp index c1a7ca4bfe..6ae6e95b87 100644 --- a/stepmania/src/Model.cpp +++ b/stepmania/src/Model.cpp @@ -719,7 +719,7 @@ void Model::SetSecondsIntoAnimation( float fSeconds ) } } -void Model::HandleCommand( const ParsedCommand &command ) +void Model::HandleCommand( const ActorCommand &command ) { BeginHandleParams; diff --git a/stepmania/src/Model.h b/stepmania/src/Model.h index ec85316890..424b72f85e 100644 --- a/stepmania/src/Model.h +++ b/stepmania/src/Model.h @@ -43,7 +43,7 @@ public: void SetDefaultAnimation( CString sAnimation, float fPlayRate = 1 ); bool m_bRevertToDefaultAnimation; - virtual void HandleCommand( const ParsedCommand &command ); + virtual void HandleCommand( const ActorCommand &command ); private: RageModelGeometry *m_pGeometry; diff --git a/stepmania/src/ScreenOptionsMaster.cpp b/stepmania/src/ScreenOptionsMaster.cpp index b0e04122ce..8664258858 100644 --- a/stepmania/src/ScreenOptionsMaster.cpp +++ b/stepmania/src/ScreenOptionsMaster.cpp @@ -246,7 +246,7 @@ ScreenOptionsMaster::ScreenOptionsMaster( CString sClassName ): CString sRowCommands = LINE(sLineName); - vector vCommands; + vector vCommands; ParseCommands( sRowCommands, vCommands ); if( vCommands.size() < 1 ) @@ -255,7 +255,7 @@ ScreenOptionsMaster::ScreenOptionsMaster( CString sClassName ): OptionRowHandler hand; for( unsigned part = 0; part < vCommands.size(); ++part) { - ParsedCommand& command = vCommands[part]; + ActorCommand& command = vCommands[part]; BeginHandleParams; diff --git a/stepmania/src/Sprite.cpp b/stepmania/src/Sprite.cpp index 03ed121a95..8085bd5e7d 100644 --- a/stepmania/src/Sprite.cpp +++ b/stepmania/src/Sprite.cpp @@ -888,7 +888,7 @@ void Sprite::StretchTexCoords( float fX, float fY ) SetCustomTextureCoords( fTexCoords ); } -void Sprite::HandleCommand( const ParsedCommand &command ) +void Sprite::HandleCommand( const ActorCommand &command ) { BeginHandleParams; diff --git a/stepmania/src/Sprite.h b/stepmania/src/Sprite.h index 9fb1536a42..e700b663ee 100644 --- a/stepmania/src/Sprite.h +++ b/stepmania/src/Sprite.h @@ -60,7 +60,7 @@ public: void ScaleToClipped( float fWidth, float fHeight ); static bool IsDiagonalBanner( int iWidth, int iHeight ); - virtual void HandleCommand( const ParsedCommand &command ); + virtual void HandleCommand( const ActorCommand &command ); protected: virtual bool LoadFromTexture( RageTextureID ID );