HandleParams -> BeginHandleParams

This commit is contained in:
Chris Danford
2004-11-06 03:09:29 +00:00
parent 40e692a32c
commit 2c314df898
8 changed files with 20 additions and 17 deletions
+3 -3
View File
@@ -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 )
+2 -2
View File
@@ -37,13 +37,13 @@ struct ParsedCommand
void ParseCommands( const CString &sCommands, vector<ParsedCommand> &vCommandsOut );
#define HandleParams int iMaxIndexAccessed = 0;
#define BeginHandleParams int iMaxIndexAccessed = 0;
#define sParam(i) (GetParam<CString>(command,i,iMaxIndexAccessed))
#define fParam(i) (GetParam<float>(command,i,iMaxIndexAccessed))
#define iParam(i) (GetParam<int>(command,i,iMaxIndexAccessed))
#define bParam(i) (GetParam<bool>(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<class T>
+2 -2
View File
@@ -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
+4 -1
View File
@@ -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") );
}
+3 -3
View File
@@ -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 )
+2 -2
View File
@@ -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;
}
/*
+2 -2
View File
@@ -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.
+2 -2
View File
@@ -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;
}
/*