HandleParams -> BeginHandleParams
This commit is contained in:
@@ -632,7 +632,7 @@ void Actor::Command( const CString &sCommands )
|
|||||||
|
|
||||||
void Actor::HandleCommand( const ParsedCommand &command )
|
void Actor::HandleCommand( const ParsedCommand &command )
|
||||||
{
|
{
|
||||||
HandleParams;
|
BeginHandleParams;
|
||||||
|
|
||||||
const CString& sName = sParam(0);
|
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
|
/* These are commands intended for a Sprite commands, but they will get
|
||||||
* sent to all sub-actors (which aren't necessarily Sprites) on
|
* 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. */
|
* on these commands. */
|
||||||
else if( sName=="customtexturerect" || sName=="texcoordvelocity" || sName=="scaletoclipped" ||
|
else if( sName=="customtexturerect" || sName=="texcoordvelocity" || sName=="scaletoclipped" ||
|
||||||
sName=="stretchtexcoords" || sName=="position" || sName=="loop" ||
|
sName=="stretchtexcoords" || sName=="position" || sName=="loop" ||
|
||||||
@@ -757,7 +757,7 @@ void Actor::HandleCommand( const ParsedCommand &command )
|
|||||||
Dialog::OK( sError );
|
Dialog::OK( sError );
|
||||||
}
|
}
|
||||||
|
|
||||||
CheckHandledParams;
|
EndHandleParams;
|
||||||
}
|
}
|
||||||
|
|
||||||
float Actor::GetCommandLengthSeconds( const CString &sCommands )
|
float Actor::GetCommandLengthSeconds( const CString &sCommands )
|
||||||
|
|||||||
@@ -37,13 +37,13 @@ struct ParsedCommand
|
|||||||
void ParseCommands( const CString &sCommands, vector<ParsedCommand> &vCommandsOut );
|
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 sParam(i) (GetParam<CString>(command,i,iMaxIndexAccessed))
|
||||||
#define fParam(i) (GetParam<float>(command,i,iMaxIndexAccessed))
|
#define fParam(i) (GetParam<float>(command,i,iMaxIndexAccessed))
|
||||||
#define iParam(i) (GetParam<int>(command,i,iMaxIndexAccessed))
|
#define iParam(i) (GetParam<int>(command,i,iMaxIndexAccessed))
|
||||||
#define bParam(i) (GetParam<bool>(command,i,iMaxIndexAccessed))
|
#define bParam(i) (GetParam<bool>(command,i,iMaxIndexAccessed))
|
||||||
#define cParam(i) (ColorParam(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 );
|
void IncorrectActorParametersWarning( const ParsedCommand& command, int iMaxIndexAccessed );
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ void ActorFrame::DeleteAllChildren()
|
|||||||
|
|
||||||
void ActorFrame::HandleCommand( const ParsedCommand &command )
|
void ActorFrame::HandleCommand( const ParsedCommand &command )
|
||||||
{
|
{
|
||||||
HandleParams;
|
BeginHandleParams;
|
||||||
|
|
||||||
const CString& sName = sParam(0);
|
const CString& sName = sParam(0);
|
||||||
do
|
do
|
||||||
@@ -172,7 +172,7 @@ void ActorFrame::HandleCommand( const ParsedCommand &command )
|
|||||||
Actor::HandleCommand( command );
|
Actor::HandleCommand( command );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
CheckHandledParams;
|
EndHandleParams;
|
||||||
} while(0);
|
} while(0);
|
||||||
|
|
||||||
/* By default, don't propograte most commands to children; it makes no sense
|
/* By default, don't propograte most commands to children; it makes no sense
|
||||||
|
|||||||
@@ -298,9 +298,12 @@ void UtilCommand( Actor& actor, const CString &sClassName, const CString &sComma
|
|||||||
{
|
{
|
||||||
if( actor.GetID().empty() )
|
if( actor.GetID().empty() )
|
||||||
return;
|
return;
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
ASSERT_M( !actor.GetID().empty(), ssprintf("!actor.GetID().empty() ('%s', '%s')",
|
ASSERT_M( !actor.GetID().empty(), ssprintf("!actor.GetID().empty() ('%s', '%s')",
|
||||||
sClassName.c_str(), sCommandName.c_str()) );
|
sClassName.c_str(), sCommandName.c_str()) );
|
||||||
|
}
|
||||||
|
|
||||||
actor.Command( THEME->GetMetric(sClassName,actor.GetID()+sCommandName+"Command") );
|
actor.Command( THEME->GetMetric(sClassName,actor.GetID()+sCommandName+"Command") );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
#include "ThemeManager.h"
|
#include "ThemeManager.h"
|
||||||
#include "GameConstantsAndTypes.h"
|
#include "GameConstantsAndTypes.h"
|
||||||
#include "Font.h"
|
#include "Font.h"
|
||||||
#include "ActorUtil.h" // for HandleParams
|
#include "ActorUtil.h" // for BeginHandleParams
|
||||||
|
|
||||||
/* XXX:
|
/* XXX:
|
||||||
* We need some kind of font modifier string for metrics. For example,
|
* 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 )
|
void BitmapText::HandleCommand( const ParsedCommand &command )
|
||||||
{
|
{
|
||||||
HandleParams;
|
BeginHandleParams;
|
||||||
|
|
||||||
const CString& sName = sParam(0);
|
const CString& sName = sParam(0);
|
||||||
|
|
||||||
@@ -530,7 +530,7 @@ void BitmapText::HandleCommand( const ParsedCommand &command )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
CheckHandledParams;
|
EndHandleParams;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BitmapText::SetWrapWidthPixels( int iWrapWidthPixels )
|
void BitmapText::SetWrapWidthPixels( int iWrapWidthPixels )
|
||||||
|
|||||||
@@ -721,7 +721,7 @@ void Model::SetSecondsIntoAnimation( float fSeconds )
|
|||||||
|
|
||||||
void Model::HandleCommand( const ParsedCommand &command )
|
void Model::HandleCommand( const ParsedCommand &command )
|
||||||
{
|
{
|
||||||
HandleParams;
|
BeginHandleParams;
|
||||||
|
|
||||||
const CString& sName = sParam(0);
|
const CString& sName = sParam(0);
|
||||||
if( sName=="play" )
|
if( sName=="play" )
|
||||||
@@ -732,7 +732,7 @@ void Model::HandleCommand( const ParsedCommand &command )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
CheckHandledParams;
|
EndHandleParams;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -257,7 +257,7 @@ ScreenOptionsMaster::ScreenOptionsMaster( CString sClassName ):
|
|||||||
{
|
{
|
||||||
ParsedCommand& command = vCommands[part];
|
ParsedCommand& command = vCommands[part];
|
||||||
|
|
||||||
HandleParams;
|
BeginHandleParams;
|
||||||
|
|
||||||
const CString name = sParam(0);
|
const CString name = sParam(0);
|
||||||
|
|
||||||
@@ -282,7 +282,7 @@ ScreenOptionsMaster::ScreenOptionsMaster( CString sClassName ):
|
|||||||
else
|
else
|
||||||
RageException::Throw( "Unexpected type '%s' in %s::Line%i", name.c_str(), m_sName.c_str(), i );
|
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.
|
// TRICKY: Insert a down arrow as the first choice in the row.
|
||||||
|
|||||||
@@ -890,7 +890,7 @@ void Sprite::StretchTexCoords( float fX, float fY )
|
|||||||
|
|
||||||
void Sprite::HandleCommand( const ParsedCommand &command )
|
void Sprite::HandleCommand( const ParsedCommand &command )
|
||||||
{
|
{
|
||||||
HandleParams;
|
BeginHandleParams;
|
||||||
|
|
||||||
const CString& sName = sParam(0);
|
const CString& sName = sParam(0);
|
||||||
|
|
||||||
@@ -914,7 +914,7 @@ void Sprite::HandleCommand( const ParsedCommand &command )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
CheckHandledParams;
|
EndHandleParams;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user