"ParsedCommand" -> "ActorCommand"
This commit is contained in:
@@ -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<ParsedCommand> vCommands;
|
||||
vector<ActorCommand> vCommands;
|
||||
ParseCommands( sCommands, vCommands );
|
||||
|
||||
for( unsigned i=0; i<vCommands.size(); i++ )
|
||||
this->HandleCommand( 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;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#define ACTOR_H
|
||||
|
||||
#include "RageTypes.h"
|
||||
#include "ActorCommands.h" // for ParsedCommand
|
||||
#include "ActorCommands.h" // for ActorCommand
|
||||
#include <deque>
|
||||
|
||||
#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 );
|
||||
|
||||
//
|
||||
|
||||
@@ -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<vTokens.size(); i++ )
|
||||
@@ -52,7 +52,7 @@ CString ParsedCommand::GetOriginalCommandString() const
|
||||
return join( ",", asTokens );
|
||||
}
|
||||
|
||||
void ParseCommands( const CString &sCommands, vector<ParsedCommand> &vCommandsOut )
|
||||
void ParseCommands( const CString &sCommands, vector<ActorCommand> &vCommandsOut )
|
||||
{
|
||||
vCommandsOut.clear();
|
||||
CStringArray vsCommands;
|
||||
@@ -63,7 +63,7 @@ void ParseCommands( const CString &sCommands, vector<ParsedCommand> &vCommandsOu
|
||||
for( unsigned i=0; i<vsCommands.size(); i++ )
|
||||
{
|
||||
const CString &sCommand = vsCommands[i];
|
||||
ParsedCommand &pc = vCommandsOut[i];
|
||||
ActorCommand &pc = vCommandsOut[i];
|
||||
pc.Set( sCommand );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
#include "RageTypes.h"
|
||||
|
||||
struct ParsedCommandToken
|
||||
struct ActorCommandToken
|
||||
{
|
||||
void Set( const CString &sParam ); // fill in all the different types
|
||||
|
||||
@@ -23,18 +23,18 @@ struct ParsedCommandToken
|
||||
operator const RageColor &() const { return c; };
|
||||
};
|
||||
|
||||
struct ParsedCommand
|
||||
struct ActorCommand
|
||||
{
|
||||
void Set( const CString &sCommand );
|
||||
|
||||
vector<ParsedCommandToken> vTokens;
|
||||
vector<ActorCommandToken> 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<ParsedCommand> &vCommandsOut );
|
||||
void ParseCommands( const CString &sCommands, vector<ActorCommand> &vCommandsOut );
|
||||
|
||||
|
||||
#define BeginHandleParams int iMaxIndexAccessed = 0;
|
||||
@@ -44,10 +44,10 @@ void ParseCommands( const CString &sCommands, vector<ParsedCommand> &vCommandsOu
|
||||
#define bParam(i) (GetParam<bool>(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<class T>
|
||||
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<RageColor>(command,iIndex,iMaxIndexAccessed);
|
||||
|
||||
@@ -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; i<m_SubActors.size(); i++ )
|
||||
m_SubActors[i]->HandleCommand( cmd );
|
||||
@@ -155,7 +155,7 @@ void ActorFrame::DeleteAllChildren()
|
||||
m_SubActors.clear();
|
||||
}
|
||||
|
||||
void ActorFrame::HandleCommand( const ParsedCommand &command )
|
||||
void ActorFrame::HandleCommand( const ActorCommand &command )
|
||||
{
|
||||
BeginHandleParams;
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -514,7 +514,7 @@ void BitmapText::SetVertAlign( VertAlign va )
|
||||
BuildChars();
|
||||
}
|
||||
|
||||
void BitmapText::HandleCommand( const ParsedCommand &command )
|
||||
void BitmapText::HandleCommand( const ActorCommand &command )
|
||||
{
|
||||
BeginHandleParams;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -719,7 +719,7 @@ void Model::SetSecondsIntoAnimation( float fSeconds )
|
||||
}
|
||||
}
|
||||
|
||||
void Model::HandleCommand( const ParsedCommand &command )
|
||||
void Model::HandleCommand( const ActorCommand &command )
|
||||
{
|
||||
BeginHandleParams;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -246,7 +246,7 @@ ScreenOptionsMaster::ScreenOptionsMaster( CString sClassName ):
|
||||
|
||||
CString sRowCommands = LINE(sLineName);
|
||||
|
||||
vector<ParsedCommand> vCommands;
|
||||
vector<ActorCommand> 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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user