diff --git a/stepmania/src/Actor.cpp b/stepmania/src/Actor.cpp index 0b54bd980a..35108b533b 100644 --- a/stepmania/src/Actor.cpp +++ b/stepmania/src/Actor.cpp @@ -632,7 +632,7 @@ void Actor::Command( const CString &sCommands ) void Actor::HandleCommand( const ParsedCommand &command ) { - HandleParams; + BeginHandleParams; const CString& sName = sParam(0); @@ -744,7 +744,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 - * GainFocus and LoseFocus. So, don't run CheckHandledParams + * GainFocus and LoseFocus. So, don't run EndHandleParams * on these commands. */ else if( sName=="customtexturerect" || sName=="texcoordvelocity" || sName=="scaletoclipped" || sName=="stretchtexcoords" || sName=="position" || sName=="loop" || @@ -757,7 +757,7 @@ void Actor::HandleCommand( const ParsedCommand &command ) Dialog::OK( sError ); } - CheckHandledParams; + EndHandleParams; } float Actor::GetCommandLengthSeconds( const CString &sCommands ) diff --git a/stepmania/src/ActorCommands.h b/stepmania/src/ActorCommands.h index 242a02e837..ecf3893d3e 100644 --- a/stepmania/src/ActorCommands.h +++ b/stepmania/src/ActorCommands.h @@ -37,13 +37,13 @@ struct ParsedCommand void ParseCommands( const CString &sCommands, vector &vCommandsOut ); -#define HandleParams int iMaxIndexAccessed = 0; +#define BeginHandleParams int iMaxIndexAccessed = 0; #define sParam(i) (GetParam(command,i,iMaxIndexAccessed)) #define fParam(i) (GetParam(command,i,iMaxIndexAccessed)) #define iParam(i) (GetParam(command,i,iMaxIndexAccessed)) #define bParam(i) (GetParam(command,i,iMaxIndexAccessed)) #define cParam(i) (ColorParam(command,i,iMaxIndexAccessed)) -#define CheckHandledParams if( iMaxIndexAccessed != (int)command.vTokens.size()-1 ) { IncorrectActorParametersWarning( command, iMaxIndexAccessed ); } +#define EndHandleParams if( iMaxIndexAccessed != (int)command.vTokens.size()-1 ) { IncorrectActorParametersWarning( command, iMaxIndexAccessed ); } void IncorrectActorParametersWarning( const ParsedCommand& command, int iMaxIndexAccessed ); template diff --git a/stepmania/src/ActorFrame.cpp b/stepmania/src/ActorFrame.cpp index 1670edc4d7..08ebf5d7e3 100644 --- a/stepmania/src/ActorFrame.cpp +++ b/stepmania/src/ActorFrame.cpp @@ -157,7 +157,7 @@ void ActorFrame::DeleteAllChildren() void ActorFrame::HandleCommand( const ParsedCommand &command ) { - HandleParams; + BeginHandleParams; const CString& sName = sParam(0); do @@ -172,7 +172,7 @@ void ActorFrame::HandleCommand( const ParsedCommand &command ) Actor::HandleCommand( command ); break; } - CheckHandledParams; + EndHandleParams; } while(0); /* By default, don't propograte most commands to children; it makes no sense diff --git a/stepmania/src/ActorUtil.cpp b/stepmania/src/ActorUtil.cpp index f8368597f2..fc977cc279 100644 --- a/stepmania/src/ActorUtil.cpp +++ b/stepmania/src/ActorUtil.cpp @@ -298,9 +298,12 @@ void UtilCommand( Actor& actor, const CString &sClassName, const CString &sComma { if( actor.GetID().empty() ) return; - } else + } + else + { ASSERT_M( !actor.GetID().empty(), ssprintf("!actor.GetID().empty() ('%s', '%s')", sClassName.c_str(), sCommandName.c_str()) ); + } actor.Command( THEME->GetMetric(sClassName,actor.GetID()+sCommandName+"Command") ); } diff --git a/stepmania/src/BitmapText.cpp b/stepmania/src/BitmapText.cpp index 0b2c6bb198..a3e15d25fd 100644 --- a/stepmania/src/BitmapText.cpp +++ b/stepmania/src/BitmapText.cpp @@ -9,7 +9,7 @@ #include "ThemeManager.h" #include "GameConstantsAndTypes.h" #include "Font.h" -#include "ActorUtil.h" // for HandleParams +#include "ActorUtil.h" // for BeginHandleParams /* XXX: * We need some kind of font modifier string for metrics. For example, @@ -516,7 +516,7 @@ void BitmapText::SetVertAlign( VertAlign va ) void BitmapText::HandleCommand( const ParsedCommand &command ) { - HandleParams; + BeginHandleParams; const CString& sName = sParam(0); @@ -530,7 +530,7 @@ void BitmapText::HandleCommand( const ParsedCommand &command ) return; } - CheckHandledParams; + EndHandleParams; } void BitmapText::SetWrapWidthPixels( int iWrapWidthPixels ) diff --git a/stepmania/src/Model.cpp b/stepmania/src/Model.cpp index 7cf5106a69..c1a7ca4bfe 100644 --- a/stepmania/src/Model.cpp +++ b/stepmania/src/Model.cpp @@ -721,7 +721,7 @@ void Model::SetSecondsIntoAnimation( float fSeconds ) void Model::HandleCommand( const ParsedCommand &command ) { - HandleParams; + BeginHandleParams; const CString& sName = sParam(0); if( sName=="play" ) @@ -732,7 +732,7 @@ void Model::HandleCommand( const ParsedCommand &command ) return; } - CheckHandledParams; + EndHandleParams; } /* diff --git a/stepmania/src/ScreenOptionsMaster.cpp b/stepmania/src/ScreenOptionsMaster.cpp index 8a82037b18..b0e04122ce 100644 --- a/stepmania/src/ScreenOptionsMaster.cpp +++ b/stepmania/src/ScreenOptionsMaster.cpp @@ -257,7 +257,7 @@ ScreenOptionsMaster::ScreenOptionsMaster( CString sClassName ): { ParsedCommand& command = vCommands[part]; - HandleParams; + BeginHandleParams; const CString name = sParam(0); @@ -282,7 +282,7 @@ ScreenOptionsMaster::ScreenOptionsMaster( CString sClassName ): else RageException::Throw( "Unexpected type '%s' in %s::Line%i", name.c_str(), m_sName.c_str(), i ); - CheckHandledParams; + EndHandleParams; } // TRICKY: Insert a down arrow as the first choice in the row. diff --git a/stepmania/src/Sprite.cpp b/stepmania/src/Sprite.cpp index 46d2d7b360..03ed121a95 100644 --- a/stepmania/src/Sprite.cpp +++ b/stepmania/src/Sprite.cpp @@ -890,7 +890,7 @@ void Sprite::StretchTexCoords( float fX, float fY ) void Sprite::HandleCommand( const ParsedCommand &command ) { - HandleParams; + BeginHandleParams; const CString& sName = sParam(0); @@ -914,7 +914,7 @@ void Sprite::HandleCommand( const ParsedCommand &command ) return; } - CheckHandledParams; + EndHandleParams; } /*