rename: ActorCommand -> Command

Make Command smaller and more generic.
Parse arguments on use, not in Command::Load.
This commit is contained in:
Chris Danford
2004-12-03 05:19:46 +00:00
parent abb6a73e4b
commit ed19821e09
67 changed files with 592 additions and 581 deletions
+91 -91
View File
@@ -252,8 +252,8 @@ void Actor::UpdateTweening( float fDeltaTime )
m_start = m_current; // set the start position
// Execute the command in this tween (if any).
const ActorCommand &command = TS.command;
if( !command.vTokens.empty() )
const Command &command = TS.command;
if( command.m_vsArgs.size() )
this->HandleCommand( command );
}
@@ -617,22 +617,22 @@ void Actor::AddRotationR( float rot )
RageQuatMultiply( &DestTweenState().quat, DestTweenState().quat, RageQuatFromR(rot) );
}
void Actor::Command( const ActorCommands &vCommands )
void Actor::RunCommands( const Commands &vCommands )
{
FOREACH_CONST( ActorCommand, vCommands.v, c )
FOREACH_CONST( Command, vCommands.v, c )
this->HandleCommand( *c );
}
void Actor::HandleCommand( const ActorCommand &command )
void Actor::HandleCommand( const Command &command )
{
BeginHandleParams;
BeginHandleArgs;
const CString& sName = sParam(0);
const CString &sName = command.GetName();
#if defined(DEBUG)
if( sName == "x" || sName == "y" ) // an absolute X or Y position
{
if( isdigit(sParam(1)[0]) && sParam(1).Find('-') == -1 && sParam(1).Find('+') == -1 )
if( isdigit(sArg(1)[0]) && sArg(1).Find('-') == -1 && sArg(1).Find('+') == -1 )
{
LOG->Warn( "Command '%s' should contain a SCREEN_* constant", command.GetOriginalCommandString().c_str() );
}
@@ -640,63 +640,63 @@ void Actor::HandleCommand( const ActorCommand &command )
#endif
// Commands that go in the tweening queue:
if ( sName=="sleep" ) Sleep( fParam(1) );
else if( sName=="linear" ) BeginTweening( fParam(1), TWEEN_LINEAR );
else if( sName=="accelerate" ) BeginTweening( fParam(1), TWEEN_ACCELERATE );
else if( sName=="decelerate" ) BeginTweening( fParam(1), TWEEN_DECELERATE );
else if( sName=="bouncebegin" ) BeginTweening( fParam(1), TWEEN_BOUNCE_BEGIN );
else if( sName=="bounceend" ) BeginTweening( fParam(1), TWEEN_BOUNCE_END );
else if( sName=="spring" ) BeginTweening( fParam(1), TWEEN_SPRING );
if ( sName=="sleep" ) Sleep( fArg(1) );
else if( sName=="linear" ) BeginTweening( fArg(1), TWEEN_LINEAR );
else if( sName=="accelerate" ) BeginTweening( fArg(1), TWEEN_ACCELERATE );
else if( sName=="decelerate" ) BeginTweening( fArg(1), TWEEN_DECELERATE );
else if( sName=="bouncebegin" ) BeginTweening( fArg(1), TWEEN_BOUNCE_BEGIN );
else if( sName=="bounceend" ) BeginTweening( fArg(1), TWEEN_BOUNCE_END );
else if( sName=="spring" ) BeginTweening( fArg(1), TWEEN_SPRING );
else if( sName=="stoptweening" ) { StopTweening(); BeginTweening( 0.0001f, TWEEN_LINEAR ); } // Why BeginT again? -Chris
else if( sName=="finishtweening" ) FinishTweening();
else if( sName=="hurrytweening" ) HurryTweening( fParam(1) );
else if( sName=="x" ) SetX( fParam(1) );
else if( sName=="y" ) SetY( fParam(1) );
else if( sName=="z" ) SetZ( fParam(1) );
else if( sName=="addx" ) AddX( fParam(1) );
else if( sName=="addy" ) AddY( fParam(1) );
else if( sName=="addz" ) AddZ( fParam(1) );
else if( sName=="zoom" ) SetZoom( fParam(1) );
else if( sName=="zoomx" ) SetZoomX( fParam(1) );
else if( sName=="zoomy" ) SetZoomY( fParam(1) );
else if( sName=="zoomz" ) SetZoomZ( fParam(1) );
else if( sName=="zoomtowidth" ) ZoomToWidth( fParam(1) );
else if( sName=="zoomtoheight" ) ZoomToHeight( fParam(1) );
else if( sName=="stretchto" ) StretchTo( RectF( fParam(1), fParam(2), fParam(3), fParam(4) ) );
else if( sName=="cropleft" ) SetCropLeft( fParam(1) );
else if( sName=="croptop" ) SetCropTop( fParam(1) );
else if( sName=="cropright" ) SetCropRight( fParam(1) );
else if( sName=="cropbottom" ) SetCropBottom( fParam(1) );
else if( sName=="fadeleft" ) SetFadeLeft( fParam(1) );
else if( sName=="fadetop" ) SetFadeTop( fParam(1) );
else if( sName=="faderight" ) SetFadeRight( fParam(1) );
else if( sName=="fadebottom" ) SetFadeBottom( fParam(1) );
else if( sName=="fadecolor" ) SetFadeDiffuseColor( cParam(1) );
else if( sName=="diffuse" ) SetDiffuse( cParam(1) );
else if( sName=="diffuseleftedge" ) SetDiffuseLeftEdge( cParam(1) );
else if( sName=="diffuserightedge" ) SetDiffuseRightEdge( cParam(1) );
else if( sName=="diffusetopedge" ) SetDiffuseTopEdge( cParam(1) );
else if( sName=="diffusebottomedge" ) SetDiffuseBottomEdge( cParam(1) );
else if( sName=="hurrytweening" ) HurryTweening( fArg(1) );
else if( sName=="x" ) SetX( fArg(1) );
else if( sName=="y" ) SetY( fArg(1) );
else if( sName=="z" ) SetZ( fArg(1) );
else if( sName=="addx" ) AddX( fArg(1) );
else if( sName=="addy" ) AddY( fArg(1) );
else if( sName=="addz" ) AddZ( fArg(1) );
else if( sName=="zoom" ) SetZoom( fArg(1) );
else if( sName=="zoomx" ) SetZoomX( fArg(1) );
else if( sName=="zoomy" ) SetZoomY( fArg(1) );
else if( sName=="zoomz" ) SetZoomZ( fArg(1) );
else if( sName=="zoomtowidth" ) ZoomToWidth( fArg(1) );
else if( sName=="zoomtoheight" ) ZoomToHeight( fArg(1) );
else if( sName=="stretchto" ) StretchTo( RectF( fArg(1), fArg(2), fArg(3), fArg(4) ) );
else if( sName=="cropleft" ) SetCropLeft( fArg(1) );
else if( sName=="croptop" ) SetCropTop( fArg(1) );
else if( sName=="cropright" ) SetCropRight( fArg(1) );
else if( sName=="cropbottom" ) SetCropBottom( fArg(1) );
else if( sName=="fadeleft" ) SetFadeLeft( fArg(1) );
else if( sName=="fadetop" ) SetFadeTop( fArg(1) );
else if( sName=="faderight" ) SetFadeRight( fArg(1) );
else if( sName=="fadebottom" ) SetFadeBottom( fArg(1) );
else if( sName=="fadecolor" ) SetFadeDiffuseColor( cArg(1) );
else if( sName=="diffuse" ) SetDiffuse( cArg(1) );
else if( sName=="diffuseleftedge" ) SetDiffuseLeftEdge( cArg(1) );
else if( sName=="diffuserightedge" ) SetDiffuseRightEdge( cArg(1) );
else if( sName=="diffusetopedge" ) SetDiffuseTopEdge( cArg(1) );
else if( sName=="diffusebottomedge" ) SetDiffuseBottomEdge( cArg(1) );
/* Add left/right/top/bottom for alpha if needed. */
else if( sName=="diffusealpha" ) SetDiffuseAlpha( fParam(1) );
else if( sName=="diffusecolor" ) SetDiffuseColor( cParam(1) );
else if( sName=="glow" ) SetGlow( cParam(1) );
else if( sName=="diffusealpha" ) SetDiffuseAlpha( fArg(1) );
else if( sName=="diffusecolor" ) SetDiffuseColor( cArg(1) );
else if( sName=="glow" ) SetGlow( cArg(1) );
else if( sName=="glowmode" ) {
if(!sParam(1).CompareNoCase("whiten"))
if(!sArg(1).CompareNoCase("whiten"))
SetGlowMode( GLOW_WHITEN );
else if(!sParam(1).CompareNoCase("brighten"))
else if(!sArg(1).CompareNoCase("brighten"))
SetGlowMode( GLOW_BRIGHTEN );
else ASSERT(0);
}
else if( sName=="rotationx" ) SetRotationX( fParam(1) );
else if( sName=="rotationy" ) SetRotationY( fParam(1) );
else if( sName=="rotationz" ) SetRotationZ( fParam(1) );
else if( sName=="heading" ) AddRotationH( fParam(1) );
else if( sName=="pitch" ) AddRotationP( fParam(1) );
else if( sName=="roll" ) AddRotationR( fParam(1) );
else if( sName=="shadowlength" ) SetShadowLength( fParam(1) );
else if( sName=="horizalign" ) SetHorizAlign( sParam(1) );
else if( sName=="vertalign" ) SetVertAlign( sParam(1) );
else if( sName=="rotationx" ) SetRotationX( fArg(1) );
else if( sName=="rotationy" ) SetRotationY( fArg(1) );
else if( sName=="rotationz" ) SetRotationZ( fArg(1) );
else if( sName=="heading" ) AddRotationH( fArg(1) );
else if( sName=="pitch" ) AddRotationP( fArg(1) );
else if( sName=="roll" ) AddRotationR( fArg(1) );
else if( sName=="shadowlength" ) SetShadowLength( fArg(1) );
else if( sName=="horizalign" ) SetHorizAlign( sArg(1) );
else if( sName=="vertalign" ) SetVertAlign( sArg(1) );
else if( sName=="diffuseblink" ) SetEffectDiffuseBlink();
else if( sName=="diffuseshift" ) SetEffectDiffuseShift();
else if( sName=="glowblink" ) SetEffectGlowBlink();
@@ -709,45 +709,45 @@ void Actor::HandleCommand( const ActorCommand &command )
else if( sName=="spin" ) SetEffectSpin();
else if( sName=="vibrate" ) SetEffectVibrate();
else if( sName=="stopeffect" ) SetEffectNone();
else if( sName=="effectcolor1" ) SetEffectColor1( cParam(1) );
else if( sName=="effectcolor2" ) SetEffectColor2( cParam(1) );
else if( sName=="effectperiod" ) SetEffectPeriod( fParam(1) );
else if( sName=="effectoffset" ) SetEffectOffset( fParam(1) );
else if( sName=="effectdelay" ) SetEffectDelay( fParam(1) );
else if( sName=="effectclock" ) SetEffectClock( sParam(1) );
else if( sName=="effectmagnitude" ) SetEffectMagnitude( RageVector3(fParam(1),fParam(2),fParam(3)) );
else if( sName=="scaletocover" ) { RectF R(fParam(1), fParam(2), fParam(3), fParam(4)); ScaleToCover(R); }
else if( sName=="scaletofit" ) { RectF R(fParam(1), fParam(2), fParam(3), fParam(4)); ScaleToFitInside(R); }
else if( sName=="effectcolor1" ) SetEffectColor1( cArg(1) );
else if( sName=="effectcolor2" ) SetEffectColor2( cArg(1) );
else if( sName=="effectperiod" ) SetEffectPeriod( fArg(1) );
else if( sName=="effectoffset" ) SetEffectOffset( fArg(1) );
else if( sName=="effectdelay" ) SetEffectDelay( fArg(1) );
else if( sName=="effectclock" ) SetEffectClock( sArg(1) );
else if( sName=="effectmagnitude" ) SetEffectMagnitude( RageVector3(fArg(1),fArg(2),fArg(3)) );
else if( sName=="scaletocover" ) { RectF R(fArg(1), fArg(2), fArg(3), fArg(4)); ScaleToCover(R); }
else if( sName=="scaletofit" ) { RectF R(fArg(1), fArg(2), fArg(3), fArg(4)); ScaleToFitInside(R); }
// Commands that take effect immediately (ignoring the tweening queue):
else if( sName=="animate" ) EnableAnimation( bParam(1) );
else if( sName=="animate" ) EnableAnimation( bArg(1) );
else if( sName=="play" ) EnableAnimation( true );
else if( sName=="pause" ) EnableAnimation( false );
else if( sName=="setstate" ) SetState( iParam(1) );
else if( sName=="texturewrapping" ) SetTextureWrapping( bParam(1) );
else if( sName=="additiveblend" ) SetBlendMode( bParam(1) ? BLEND_ADD : BLEND_NORMAL );
else if( sName=="blend" ) SetBlendMode( sParam(1) );
else if( sName=="zbuffer" ) SetUseZBuffer( bParam(1) );
else if( sName=="ztest" ) SetZTestMode( bParam(1)?ZTEST_WRITE_ON_PASS:ZTEST_OFF );
else if( sName=="ztestmode" ) SetZTestMode( sParam(1) );
else if( sName=="zwrite" ) SetZWrite( bParam(1) );
else if( sName=="clearzbuffer" ) SetClearZBuffer( bParam(1) );
else if( sName=="backfacecull" ) SetCullMode( bParam(1) ? CULL_BACK : CULL_NONE );
else if( sName=="cullmode" ) SetCullMode( sParam(1) );
else if( sName=="hidden" ) SetHidden( bParam(1) );
else if( sName=="hibernate" ) SetHibernate( fParam(1) );
else if( sName=="draworder" ) SetDrawOrder( iParam(1) );
else if( sName=="playcommand" ) PlayCommand( sParam(1) );
else if( sName=="setstate" ) SetState( iArg(1) );
else if( sName=="texturewrapping" ) SetTextureWrapping( bArg(1) );
else if( sName=="additiveblend" ) SetBlendMode( bArg(1) ? BLEND_ADD : BLEND_NORMAL );
else if( sName=="blend" ) SetBlendMode( sArg(1) );
else if( sName=="zbuffer" ) SetUseZBuffer( bArg(1) );
else if( sName=="ztest" ) SetZTestMode( bArg(1)?ZTEST_WRITE_ON_PASS:ZTEST_OFF );
else if( sName=="ztestmode" ) SetZTestMode( sArg(1) );
else if( sName=="zwrite" ) SetZWrite( bArg(1) );
else if( sName=="clearzbuffer" ) SetClearZBuffer( bArg(1) );
else if( sName=="backfacecull" ) SetCullMode( bArg(1) ? CULL_BACK : CULL_NONE );
else if( sName=="cullmode" ) SetCullMode( sArg(1) );
else if( sName=="hidden" ) SetHidden( bArg(1) );
else if( sName=="hibernate" ) SetHibernate( fArg(1) );
else if( sName=="draworder" ) SetDrawOrder( iArg(1) );
else if( sName=="playcommand" ) PlayCommand( sArg(1) );
else if( sName=="queuecommand" )
{
ActorCommand newcommand = command;
newcommand.vTokens.erase( newcommand.vTokens.begin() );
Command newcommand = command;
newcommand.m_vsArgs.erase( newcommand.m_vsArgs.begin() );
QueueCommand( newcommand );
return; // don't do parameter number checking
return; // don't do argument count checking
}
/* 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 EndHandleParams
* GainFocus and LoseFocus. So, don't run EndHandleArgs
* on these commands. */
else if( sName=="customtexturerect" || sName=="texcoordvelocity" || sName=="scaletoclipped" ||
sName=="stretchtexcoords" || sName=="position" || sName=="loop" ||
@@ -760,13 +760,13 @@ void Actor::HandleCommand( const ActorCommand &command )
Dialog::OK( sError );
}
EndHandleParams;
EndHandleArgs;
}
float Actor::GetCommandsLengthSeconds( const ActorCommands &vCommands )
float Actor::GetCommandsLengthSeconds( const Commands &vCommands )
{
Actor temp;
temp.Command(vCommands);
temp.RunCommands(vCommands);
return temp.GetTweenTimeLeft();
}
@@ -785,7 +785,7 @@ float Actor::GetTweenTimeLeft() const
/* This is a hack to change all tween states while leaving existing tweens alone.
*
* Perhaps the regular Set methods should also take an optional parameter, eg.
* Perhaps the regular Set methods should also take an optional argument, eg.
* "SET_TWEEN" (normal behavior) or "SET_GLOBAL" to set regardless of tweens.
* That might be ugly, too.
*/
@@ -904,7 +904,7 @@ void Actor::Sleep( float time )
BeginTweening( 0, TWEEN_LINEAR );
}
void Actor::QueueCommand( ActorCommand command )
void Actor::QueueCommand( Command command )
{
BeginTweening( 0, TWEEN_LINEAR );
DestTweenState().command = command;
+6 -6
View File
@@ -4,7 +4,7 @@
#define ACTOR_H
#include "RageTypes.h"
#include "ActorCommands.h" // for ActorCommand
#include "Command.h"
#include <deque>
#define DRAW_ORDER_BEFORE_EVERYTHING -100
@@ -49,7 +49,7 @@ public:
RageColor diffuse[4];
RageColor glow;
GlowMode glowmode;
ActorCommand command; // command to execute when this
Command command; // command to execute when this
void Init();
static void MakeWeightedAverage( TweenState& average_out, const TweenState& ts1, const TweenState& ts2, float fPercentBetween );
@@ -186,7 +186,7 @@ public:
void BeginTweening( float time, TweenType tt = TWEEN_LINEAR );
void StopTweening();
void Sleep( float time );
void QueueCommand( ActorCommand command );
void QueueCommand( Command command );
virtual void FinishTweening();
virtual void HurryTweening( float factor );
// Let ActorFrame and BGAnimation override
@@ -305,9 +305,9 @@ public:
//
// Commands
//
void Command( const ActorCommands &vCommands );
virtual void HandleCommand( const ActorCommand &command ); // derivable
static float GetCommandsLengthSeconds( const ActorCommands &vCommands );
void RunCommands( const Commands &vCommands );
virtual void HandleCommand( const Command &command ); // derivable
static float GetCommandsLengthSeconds( const Commands &vCommands );
//
// Animation
-107
View File
@@ -1,107 +0,0 @@
/* ActorCommands - Actor command parsing and reading helpers. */
#ifndef ActorCommands_H
#define ActorCommands_H
#include "RageTypes.h"
struct ActorCommandToken
{
void Set( const CString &sParam ); // fill in all the different types
CString s;
float f;
RageColor c; // HTML-type color which is packed into one parameter
// true if c is a valid HTML-type color. Otherwise, this value is the red component
// and the next 3 params are the other components.
bool bColorIsValid;
operator const CString &() const { return s; };
operator const float () const { return f; };
operator const int () const { return (int)f; };
operator const bool () const { return ((int)f)!=0; };
operator const RageColor &() const { return c; };
};
struct ActorCommand
{
void Set( const CString &sCommand );
vector<ActorCommandToken> vTokens;
CString GetOriginalCommandString() const; // for when reporting an error in number of params
};
struct ActorCommands
{
vector<ActorCommand> v;
};
// 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 ';'.
// TODO: This is expensive to do during the game. Eventually,
// move all calls to ParseActorCommands to happen during load, then execute
// from the parsed ActorCommand structures.
void ParseActorCommands( const CString &sCommands, ActorCommands &vCommandsOut );
ActorCommands ParseActorCommands( const CString &sCommands );
#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 EndHandleParams if( iMaxIndexAccessed != (int)command.vTokens.size()-1 ) { IncorrectActorParametersWarning( command, iMaxIndexAccessed ); }
void IncorrectActorParametersWarning( const ActorCommand& command, int iMaxIndexAccessed );
template<class T>
inline T GetParam( const ActorCommand& command, int iIndex, int& iMaxIndexAccessedOut )
{
iMaxIndexAccessedOut = max( iIndex, iMaxIndexAccessedOut );
if( iIndex < int(command.vTokens.size()) )
{
return (T)command.vTokens[iIndex];
}
else
{
ActorCommandToken pct;
pct.Set( "" );
return (T)pct;
}
}
inline RageColor ColorParam( const ActorCommand& command, int iIndex, int& iMaxIndexAccessed )
{
if( command.vTokens[iIndex].bColorIsValid )
return GetParam<RageColor>(command,iIndex,iMaxIndexAccessed);
else
return RageColor( fParam(iIndex+0),fParam(iIndex+1),fParam(iIndex+2),fParam(iIndex+3) );
}
#endif
/*
* (c) 2004 Chris Danford
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, and/or sell copies of the Software, and to permit persons to
* whom the Software is furnished to do so, provided that the above
* copyright notice(s) and this permission notice appear in all copies of
* the Software and that both the above copyright notice(s) and this
* permission notice appear in supporting documentation.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
* THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
* INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
+8 -8
View File
@@ -67,13 +67,13 @@ void ActorFrame::DrawPrimitives()
m_SubActors[i]->Draw();
}
void ActorFrame::RunCommandOnChildren( const ActorCommands &cmd )
void ActorFrame::RunCommandOnChildren( const Commands &cmd )
{
for( unsigned i=0; i<m_SubActors.size(); i++ )
m_SubActors[i]->Command( cmd );
m_SubActors[i]->RunCommands( cmd );
}
void ActorFrame::RunCommandOnChildren( const ActorCommand &cmd )
void ActorFrame::RunCommandOnChildren( const Command &cmd )
{
for( unsigned i=0; i<m_SubActors.size(); i++ )
m_SubActors[i]->HandleCommand( cmd );
@@ -155,16 +155,16 @@ void ActorFrame::DeleteAllChildren()
m_SubActors.clear();
}
void ActorFrame::HandleCommand( const ActorCommand &command )
void ActorFrame::HandleCommand( const Command &command )
{
BeginHandleParams;
BeginHandleArgs;
const CString& sName = sParam(0);
const CString& sName = command.GetName();
do
{
if( sName=="propagate" )
{
m_bPropagateCommands = bParam(1);
m_bPropagateCommands = bArg(1);
RunCommandOnChildren( command );
}
else
@@ -172,7 +172,7 @@ void ActorFrame::HandleCommand( const ActorCommand &command )
Actor::HandleCommand( command );
break;
}
EndHandleParams;
EndHandleArgs;
} while(0);
/* By default, don't propograte most commands to children; it makes no sense
+3 -3
View File
@@ -19,9 +19,9 @@ public:
void DeleteAllChildren();
virtual void RunCommandOnChildren( const ActorCommands &cmds ); /* but not on self */
virtual void RunCommandOnChildren( const ActorCommand &cmd ); /* but not on self */
virtual void HandleCommand( const ActorCommand &command ); // derivable
virtual void RunCommandOnChildren( const Commands &cmds ); /* but not on self */
virtual void RunCommandOnChildren( const Command &cmd ); /* but not on self */
virtual void HandleCommand( const Command &command ); // derivable
virtual void Update( float fDeltaTime );
virtual void DrawPrimitives();
+3 -3
View File
@@ -290,8 +290,8 @@ void UtilCommand( Actor& actor, const CString &sClassName, const CString &sComma
// if( actor.GetHidden() )
// return 0;
ActorCommand ac;
ac.Set("playcommand,"+sCommandName);
Command ac;
ac.Load("playcommand,"+sCommandName);
actor.HandleCommand( ac );
// HACK: It's very often that we command things to TweenOffScreen
@@ -309,7 +309,7 @@ void UtilCommand( Actor& actor, const CString &sClassName, const CString &sComma
sClassName.c_str(), sCommandName.c_str()) );
}
actor.Command( THEME->GetMetricA(sClassName,actor.GetID()+sCommandName+"Command") );
actor.RunCommands( THEME->GetMetricA(sClassName,actor.GetID()+sCommandName+"Command") );
}
void AutoActor::Load( const CString &sPath )
+1 -1
View File
@@ -100,7 +100,7 @@ void AttackDisplay::SetAttack( const CString &sText )
m_sprAttack.SetDiffuseAlpha( 1 );
m_sprAttack.Load( path );
const CString sName = ssprintf( "%sP%i", sText.c_str(), m_PlayerNumber+1 );
m_sprAttack.Command( THEME->GetMetricA("AttackDisplay", sName + "OnCommand" ) );
m_sprAttack.RunCommands( THEME->GetMetricA("AttackDisplay", sName + "OnCommand" ) );
}
/*
+1 -1
View File
@@ -178,7 +178,7 @@ void BGAnimation::LoadFromAniDir( CString sAniDir )
/* There's an InitCommand. Run it now. This can be used to eg. change Z to
* modify draw order between BGAs in a Foreground. Most things should be done
* in metrics.ini commands, not here. */
this->Command( ParseActorCommands(sInitCommand) );
this->RunCommands( ParseCommands(sInitCommand) );
}
}
else
+8 -8
View File
@@ -991,10 +991,10 @@ void BGAnimationLayer::GainFocus( float fRate, bool bRewindMovie, bool bLoop )
// TODO: Don't special case subActor[0]. The movie layer should be set up with
// a LoseFocusCommand that pauses, and a GainFocusCommand that plays.
if( bRewindMovie )
RunCommandOnChildren( ParseActorCommands("position,0") );
RunCommandOnChildren( ParseActorCommands(ssprintf("loop,%i",bLoop)) );
RunCommandOnChildren( ParseActorCommands("play") );
RunCommandOnChildren( ParseActorCommands(ssprintf("rate,%f",fRate)) );
RunCommandOnChildren( ParseCommands("position,0") );
RunCommandOnChildren( ParseCommands(ssprintf("loop,%i",bLoop)) );
RunCommandOnChildren( ParseCommands("play") );
RunCommandOnChildren( ParseCommands(ssprintf("rate,%f",fRate)) );
if( m_fRepeatCommandEverySeconds == -1 ) // if not repeating
{
@@ -1003,7 +1003,7 @@ void BGAnimationLayer::GainFocus( float fRate, bool bRewindMovie, bool bLoop )
* should run OnCommand when they're actually displayed, when GainFocus
* gets called. We've already run OnCommand; abort it so we don't run tweens
* twice. */
RunCommandOnChildren( ParseActorCommands("stoptweening") );
RunCommandOnChildren( ParseCommands("stoptweening") );
PlayCommand( "On" );
}
@@ -1017,7 +1017,7 @@ void BGAnimationLayer::LoseFocus()
if( !m_SubActors.size() )
return;
RunCommandOnChildren( ParseActorCommands("pause") );
RunCommandOnChildren( ParseCommands("pause") );
PlayCommand( "LoseFocus" );
}
@@ -1025,7 +1025,7 @@ void BGAnimationLayer::LoseFocus()
void BGAnimationLayer::PlayCommand( const CString &sCommandName )
{
for( unsigned i=0; i<m_SubActors.size(); i++ )
m_SubActors[i]->Command( ParseActorCommands("playcommand,"+sCommandName) );
m_SubActors[i]->RunCommands( ParseCommands("playcommand,"+sCommandName) );
CString sKey = sCommandName;
sKey.MakeLower();
@@ -1035,7 +1035,7 @@ void BGAnimationLayer::PlayCommand( const CString &sCommandName )
return;
for( unsigned i=0; i<m_SubActors.size(); i++ )
m_SubActors[i]->Command( ParseActorCommands(it->second) );
m_SubActors[i]->RunCommands( ParseCommands(it->second) );
}
/*
+4 -4
View File
@@ -28,7 +28,7 @@ ThemeMetric<float> BOTTOM_EDGE ("Background","BottomEdge");
#define RECT_BACKGROUND RectF (LEFT_EDGE,TOP_EDGE,RIGHT_EDGE,BOTTOM_EDGE)
ThemeMetric<bool> BLINK_DANGER_ALL ("Background","BlinkDangerAll");
ThemeMetric<bool> DANGER_ALL_IS_OPAQUE ("Background","DangerAllIsOpaque");
ThemeMetric<ActorCommands> BRIGHTNESS_FADE_COMMAND ("Background","BrightnessFadeCommand");
ThemeMetric<Commands> BRIGHTNESS_FADE_COMMAND ("Background","BrightnessFadeCommand");
static float g_fBackgroundCenterWidth = 40;
const CString STATIC_BACKGROUND = "static background";
@@ -435,9 +435,9 @@ void Background::LoadFromSong( const Song* pSong )
* may look something like "BGAnimation, BGAnimationLayer, Sprite" or it
* may be deeper, like "BGAnimation, BGAnimationLayer, BGAnimation,
* BGAnimationLayer, Sprite". */
pBGA->Command( ParseActorCommands("propagate,1") );
pBGA->Command( ParseActorCommands("effectclock,music") );
pBGA->Command( ParseActorCommands("propagate,0") );
pBGA->RunCommands( ParseCommands("propagate,1") );
pBGA->RunCommands( ParseCommands("effectclock,music") );
pBGA->RunCommands( ParseCommands("propagate,0") );
}
}
+7 -7
View File
@@ -9,7 +9,7 @@
#include "ThemeManager.h"
#include "GameConstantsAndTypes.h"
#include "Font.h"
#include "ActorUtil.h" // for BeginHandleParams
#include "ActorUtil.h" // for BeginHandleArgs
/* XXX:
* We need some kind of font modifier string for metrics. For example,
@@ -514,23 +514,23 @@ void BitmapText::SetVertAlign( VertAlign va )
BuildChars();
}
void BitmapText::HandleCommand( const ActorCommand &command )
void BitmapText::HandleCommand( const Command &command )
{
BeginHandleParams;
BeginHandleArgs;
const CString& sName = sParam(0);
const CString& sName = command.GetName();
// Commands that go in the tweening queue:
// Commands that take effect immediately (ignoring the tweening queue):
if( sName=="wrapwidthpixels" ) SetWrapWidthPixels( iParam(1) );
else if( sName=="maxwidth" ) SetMaxWidth( fParam(1) );
if( sName=="wrapwidthpixels" ) SetWrapWidthPixels( iArg(1) );
else if( sName=="maxwidth" ) SetMaxWidth( fArg(1) );
else
{
Actor::HandleCommand( command );
return;
}
EndHandleParams;
EndHandleArgs;
}
void BitmapText::SetWrapWidthPixels( int iWrapWidthPixels )
+1 -1
View File
@@ -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 ActorCommand &command );
virtual void HandleCommand( const Command &command );
public:
Font* m_pFont;
+14 -14
View File
@@ -21,10 +21,10 @@ ThemeMetric<float> NUMBER_MAX_ZOOM ("Combo","NumberMaxZoom");
ThemeMetric<float> NUMBER_MAX_ZOOM_AT ("Combo","NumberMaxZoomAt");
ThemeMetric<float> PULSE_ZOOM ("Combo","PulseZoom");
ThemeMetric<float> C_TWEEN_SECONDS ("Combo","TweenSeconds");
ThemeMetric<ActorCommands> FULL_COMBO_GREATS_COMMAND ("Combo","FullComboGreatsCommand");
ThemeMetric<ActorCommands> FULL_COMBO_PERFECTS_COMMAND ("Combo","FullComboPerfectsCommand");
ThemeMetric<ActorCommands> FULL_COMBO_MARVELOUSES_COMMAND ("Combo","FullComboMarvelousesCommand");
ThemeMetric<ActorCommands> FULL_COMBO_BROKEN_COMMAND ("Combo","FullComboBrokenCommand");
ThemeMetric<Commands> FULL_COMBO_GREATS_COMMAND ("Combo","FullComboGreatsCommand");
ThemeMetric<Commands> FULL_COMBO_PERFECTS_COMMAND ("Combo","FullComboPerfectsCommand");
ThemeMetric<Commands> FULL_COMBO_MARVELOUSES_COMMAND ("Combo","FullComboMarvelousesCommand");
ThemeMetric<Commands> FULL_COMBO_BROKEN_COMMAND ("Combo","FullComboBrokenCommand");
ThemeMetric<bool> SHOW_MISS_COMBO ("Combo","ShowMissCombo");
@@ -102,29 +102,29 @@ void Combo::SetCombo( int iCombo, int iMisses )
{
if( g_CurStageStats.FullComboOfScore(m_PlayerNumber,TNS_MARVELOUS) )
{
sprLabel.Command( FULL_COMBO_MARVELOUSES_COMMAND );
m_textNumber.Command( FULL_COMBO_MARVELOUSES_COMMAND );
sprLabel.RunCommands( FULL_COMBO_MARVELOUSES_COMMAND );
m_textNumber.RunCommands( FULL_COMBO_MARVELOUSES_COMMAND );
}
else if( bPastMidpoint && g_CurStageStats.FullComboOfScore(m_PlayerNumber,TNS_PERFECT) )
{
sprLabel.Command( FULL_COMBO_PERFECTS_COMMAND );
m_textNumber.Command( FULL_COMBO_PERFECTS_COMMAND );
sprLabel.RunCommands( FULL_COMBO_PERFECTS_COMMAND );
m_textNumber.RunCommands( FULL_COMBO_PERFECTS_COMMAND );
}
else if( bPastMidpoint && g_CurStageStats.FullComboOfScore(m_PlayerNumber,TNS_GREAT) )
{
sprLabel.Command( FULL_COMBO_GREATS_COMMAND );
m_textNumber.Command( FULL_COMBO_GREATS_COMMAND );
sprLabel.RunCommands( FULL_COMBO_GREATS_COMMAND );
m_textNumber.RunCommands( FULL_COMBO_GREATS_COMMAND );
}
else
{
sprLabel.Command( FULL_COMBO_BROKEN_COMMAND );
m_textNumber.Command( FULL_COMBO_BROKEN_COMMAND );
sprLabel.RunCommands( FULL_COMBO_BROKEN_COMMAND );
m_textNumber.RunCommands( FULL_COMBO_BROKEN_COMMAND );
}
}
else
{
sprLabel.Command( FULL_COMBO_BROKEN_COMMAND );
m_textNumber.Command( FULL_COMBO_BROKEN_COMMAND );
sprLabel.RunCommands( FULL_COMBO_BROKEN_COMMAND );
m_textNumber.RunCommands( FULL_COMBO_BROKEN_COMMAND );
}
}
@@ -1,77 +1,88 @@
#include "global.h" // testing updates
#include "ActorCommands.h"
#include "Command.h"
#include "RageUtil.h"
#include "RageLog.h"
#include "arch/Dialog/Dialog.h"
#include "LuaHelpers.h"
void IncorrectActorParametersWarning( const ActorCommand &command, int iMaxIndexAccessed )
void IncorrectNumberArgsWarning( const Command &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()) );
const CString sError = ssprintf( "Actor::HandleCommand: Wrong number of arguments in command '%s'. Expected %d but there are %u.",
command.GetOriginalCommandString().c_str(), iMaxIndexAccessed+1, unsigned(command.m_vsArgs.size()) );
LOG->Warn( sError );
Dialog::OK( sError );
}
void ActorCommandToken::Set( const CString &sParam )
CString Command::GetName() const
{
if( m_vsArgs.empty() )
return "";
CString s = m_vsArgs[0];
s.MakeLower();
return s;
}
Command::Arg Command::GetArg( unsigned index ) const
{
Arg a;
if( index < m_vsArgs.size() )
a.s = m_vsArgs[index];
return a;
}
Command::Arg::operator CString ()
{
return s;
}
Command::Arg::operator float ()
{
s = sParam;
CString s = sParam;
Lua::PrepareExpression( s ); // strip invalid chars
f = Lua::RunExpressionF( s );
bColorIsValid = c.FromString( sParam );
return Lua::RunExpressionF( s );
}
void ActorCommand::Set( const CString &sCommand )
Command::Arg::operator int ()
{
CStringArray vsTokens;
split( sCommand, ",", vsTokens, false ); // don't ignore empty
vTokens.resize( vsTokens.size() );
for( unsigned i=0; i<vsTokens.size(); i++ )
{
CString &sToken = vsTokens[i];
// TRICKY: The first parameter is the command name. This is case
// insensitive. Convert it to lowercase now so that we can do
// case sensitive compares later.
if( i == 0 )
sToken.MakeLower();
vTokens[i].Set( sToken );
}
Lua::PrepareExpression( s ); // strip invalid chars
return (int)Lua::RunExpressionF( s );
}
CString ActorCommand::GetOriginalCommandString() const
Command::Arg::operator bool ()
{
CStringArray asTokens;
for( unsigned i=0; i<vTokens.size(); i++ )
asTokens.push_back( vTokens[i].s );
return join( ",", asTokens );
Lua::PrepareExpression( s ); // strip invalid chars
return Lua::RunExpressionF( s ) != 0.0f;
}
void ParseActorCommands( const CString &sCommands, ActorCommands &vCommandsOut )
void Command::Load( const CString &sCommand )
{
m_vsArgs.clear();
split( sCommand, ",", m_vsArgs, false ); // don't ignore empty
}
CString Command::GetOriginalCommandString() const
{
return join( ",", m_vsArgs );
}
void ParseCommands( const CString &sCommands, Commands &vCommandsOut )
{
vCommandsOut.v.clear();
CStringArray vsCommands;
split( sCommands, ";", vsCommands, true ); // do ignore empty
vCommandsOut.v.resize( vsCommands.size() );
for( unsigned i=0; i<vsCommands.size(); i++ )
{
const CString &sCommand = vsCommands[i];
ActorCommand &pc = vCommandsOut.v[i];
pc.Set( sCommand );
Command &cmd = vCommandsOut.v[i];
cmd.Load( vsCommands[i] );
}
}
ActorCommands ParseActorCommands( const CString &sCommands )
Commands ParseCommands( const CString &sCommands )
{
ActorCommands vCommands;
ParseActorCommands( sCommands, vCommands );
Commands vCommands;
ParseCommands( sCommands, vCommands );
return vCommands;
}
+96
View File
@@ -0,0 +1,96 @@
/* Commands - Actor command parsing and reading helpers. */
#ifndef Commands_H
#define Commands_H
#include "RageTypes.h"
class Command
{
public:
void Load( const CString &sCommand );
CString GetOriginalCommandString() const; // used when reporting an error in number of args
CString GetName() const; // the command name is the first argument in all-lowercase
struct Arg
{
CString s;
operator CString ();
operator float ();
operator int ();
operator bool ();
};
Arg GetArg( unsigned index ) const;
vector<CString> m_vsArgs;
};
class Commands
{
public:
vector<Command> v;
};
// 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 ';'.
// TODO: This is expensive to do during the game. Eventually,
// move all calls to ParseCommands to happen during load, then execute
// from the parsed Command structures.
void ParseCommands( const CString &sCmds, Commands &vCmdsOut );
Commands ParseCommands( const CString &sCmds );
#define BeginHandleArgs int iMaxIndexAccessed = 0;
#define GET_ARG(type,i) iMaxIndexAccessed = max( i, iMaxIndexAccessed ); command.GetArg##type( i );
#define sArg(i) GetArg<CString>(command,i,iMaxIndexAccessed)
#define fArg(i) GetArg<float>(command,i,iMaxIndexAccessed)
#define iArg(i) GetArg<int>(command,i,iMaxIndexAccessed)
#define bArg(i) GetArg<bool>(command,i,iMaxIndexAccessed)
#define cArg(i) GetColorArg(command,i,iMaxIndexAccessed)
#define EndHandleArgs if( iMaxIndexAccessed != (int)command.m_vsArgs.size()-1 ) { IncorrectNumberArgsWarning( command, iMaxIndexAccessed ); }
void IncorrectNumberArgsWarning( const Command& command, int iMaxIndexAccessed );
template<class T>
inline T GetArg( const Command& command, int iIndex, int& iMaxIndexAccessedOut )
{
iMaxIndexAccessedOut = max( iIndex, iMaxIndexAccessedOut );
return (T)command.GetArg(iIndex);
}
inline RageColor GetColorArg( const Command& command, int iIndex, int& iMaxIndexAccessed )
{
RageColor c;
if( c.FromString( GetArg<CString>(command,iIndex,iMaxIndexAccessed) ) )
return c;
else
return RageColor( fArg(iIndex+0),fArg(iIndex+1),fArg(iIndex+2),fArg(iIndex+3) );
}
#endif
/*
* (c) 2004 Chris Danford
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, and/or sell copies of the Software, and to permit persons to
* whom the Software is furnished to do so, provided that the above
* copyright notice(s) and this permission notice appear in all copies of
* the Software and that both the above copyright notice(s) and this
* permission notice appear in supporting documentation.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
* THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
* INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
+5 -5
View File
@@ -3,8 +3,8 @@
#include "song.h"
#include "ThemeMetric.h"
ThemeMetric<ActorCommands> ICONONCOMMAND ("DifficultyDisplay","IconOnCommand");
ThemeMetric<ActorCommands> ICONOFFCOMMAND ("DifficultyDisplay","IconOffCommand");
ThemeMetric<Commands> ICONONCOMMAND ("DifficultyDisplay","IconOnCommand");
ThemeMetric<Commands> ICONOFFCOMMAND ("DifficultyDisplay","IconOffCommand");
DifficultyDisplay::DifficultyDisplay()
{
@@ -34,16 +34,16 @@ void DifficultyDisplay::SetDifficulties( const Song* pSong, StepsType curType )
for( int diff = DIFFICULTY_BEGINNER; diff <= DIFFICULTY_CHALLENGE; ++diff )
{
if( pSong->HasStepsTypeAndDifficulty( curType, Difficulty(diff) ) )
m_difficulty[diff].Command( ICONONCOMMAND );
m_difficulty[diff].RunCommands( ICONONCOMMAND );
else
m_difficulty[diff].Command( ICONOFFCOMMAND );
m_difficulty[diff].RunCommands( ICONOFFCOMMAND );
}
}
void DifficultyDisplay::UnsetDifficulties()
{
for( int diff = DIFFICULTY_BEGINNER; diff <= DIFFICULTY_CHALLENGE; ++diff )
m_difficulty[diff].Command( ICONOFFCOMMAND );
m_difficulty[diff].RunCommands( ICONOFFCOMMAND );
}
/*
+12 -12
View File
@@ -216,10 +216,10 @@ void DifficultyList::PositionItems()
if( m_Lines[m].m_Number.GetDestY() != row.m_fY ||
m_Lines[m].m_Number.DestTweenState().diffuse[0][3] != DiffuseAlpha )
{
m_Lines[m].m_Description.Command( MOVE_COMMAND );
m_Lines[m].m_Meter.Command( MOVE_COMMAND );
m_Lines[m].m_Description.RunCommands( MOVE_COMMAND );
m_Lines[m].m_Meter.RunCommands( MOVE_COMMAND );
m_Lines[m].m_Meter.RunCommandOnChildren( MOVE_COMMAND );
m_Lines[m].m_Number.Command( MOVE_COMMAND );
m_Lines[m].m_Number.RunCommands( MOVE_COMMAND );
}
m_Lines[m].m_Description.SetY( row.m_fY );
@@ -233,10 +233,10 @@ void DifficultyList::PositionItems()
if( m_bShown && m < (int)m_Rows.size() )
bHidden = m_Rows[m].m_bHidden;
const ActorCommands cmds = ParseActorCommands( ssprintf("diffusealpha,%f",bHidden?0.0f:1.0f) );
m_Lines[m].m_Description.Command( cmds );
const Commands cmds = ParseCommands( ssprintf("diffusealpha,%f",bHidden?0.0f:1.0f) );
m_Lines[m].m_Description.RunCommands( cmds );
m_Lines[m].m_Meter.RunCommandOnChildren( cmds );
m_Lines[m].m_Number.Command( cmds );
m_Lines[m].m_Number.RunCommands( cmds );
}
@@ -356,10 +356,10 @@ void DifficultyList::HideRows()
{
for( unsigned m = 0; m < m_Rows.size(); ++m )
{
static const ActorCommands cmds = ParseActorCommands( "finishtweening;diffusealpha,0" );
m_Lines[m].m_Description.Command( cmds );
static const Commands cmds = ParseCommands( "finishtweening;diffusealpha,0" );
m_Lines[m].m_Description.RunCommands( cmds );
m_Lines[m].m_Meter.RunCommandOnChildren( cmds );
m_Lines[m].m_Number.Command( cmds );
m_Lines[m].m_Number.RunCommands( cmds );
}
}
@@ -369,10 +369,10 @@ void DifficultyList::TweenOnScreen()
m_bShown = true;
for( unsigned m = 0; m < m_Rows.size(); ++m )
{
static const ActorCommands cmds = ParseActorCommands( "finishtweening" );
m_Lines[m].m_Description.Command( cmds );
static const Commands cmds = ParseCommands( "finishtweening" );
m_Lines[m].m_Description.RunCommands( cmds );
m_Lines[m].m_Meter.RunCommandOnChildren( cmds );
m_Lines[m].m_Number.Command( cmds );
m_Lines[m].m_Number.RunCommands( cmds );
}
// PositionItems();
+1 -1
View File
@@ -63,7 +63,7 @@ private:
vector<Row> m_Rows;
ThemeMetric<ActorCommands> MOVE_COMMAND;
ThemeMetric<Commands> MOVE_COMMAND;
};
#endif
+2 -2
View File
@@ -14,14 +14,14 @@ class Trail;
class Character;
class Style;
class Game;
struct ActorCommands;
class Commands;
struct GameCommand // used in SelectMode
{
GameCommand() { Init(); }
void Init();
void Load( int iIndex, const ActorCommands& acs );
void Load( int iIndex, const Commands& acs );
void ApplyToAllPlayers() const;
void Apply( PlayerNumber pn ) const;
bool DescribesCurrentMode( PlayerNumber pn ) const;
+1 -1
View File
@@ -86,7 +86,7 @@ void GameState::ApplyCmdline()
for( int i = 0; GetCommandlineArgument( "mode", &sMode, i ); ++i )
{
GameCommand m;
m.Load( 0, ParseActorCommands(sMode) );
m.Load( 0, ParseCommands(sMode) );
CString why;
if( !m.IsPlayable(&why) )
RageException::Throw( "Can't apply mode \"%s\": %s", sMode.c_str(), why.c_str() );
+1 -1
View File
@@ -53,7 +53,7 @@ void GhostArrow::Step( TapNoteScore score )
m_spr[score].SetHidden( false );
m_spr[score].StopTweening();
m_spr[score].Command( m_acScoreCommand[score] );
m_spr[score].RunCommands( m_acScoreCommand[score] );
}
/*
+1 -1
View File
@@ -21,7 +21,7 @@ public:
protected:
PlayerNumber m_PlayerNumber;
Sprite m_spr[NUM_TAP_NOTE_SCORES];
ActorCommands m_acScoreCommand[NUM_TAP_NOTE_SCORES];
Commands m_acScoreCommand[NUM_TAP_NOTE_SCORES];
};
+4 -4
View File
@@ -11,9 +11,9 @@
#define LABEL_OFFSET_X( i ) THEME->GetMetricF("GrooveRadar",ssprintf("Label%dOffsetX",i+1))
#define LABEL_OFFSET_Y( i ) THEME->GetMetricF("GrooveRadar",ssprintf("Label%dOffsetY",i+1))
static const ThemeMetric<ActorCommands> LABEL_ON_COMMAND ("GrooveRadar","LabelOnCommand");
static const ThemeMetric<Commands> LABEL_ON_COMMAND ("GrooveRadar","LabelOnCommand");
static const ThemeMetric<float> LABEL_ON_DELAY ("GrooveRadar","LabelOnDelay");
static const ThemeMetric<ActorCommands> LABEL_ON_COMMAND_POST_DELAY ("GrooveRadar","LabelOnCommandPostDelay");
static const ThemeMetric<Commands> LABEL_ON_COMMAND_POST_DELAY ("GrooveRadar","LabelOnCommandPostDelay");
static const ThemeMetric<bool> DISABLE_RADAR ("GrooveRadar","DisableRadar");
float RADAR_VALUE_ROTATION( int iValueIndex ) { return PI/2 + PI*2 / 5.0f * iValueIndex; }
@@ -40,9 +40,9 @@ void GrooveRadar::TweenOnScreen()
for( int c=0; c<NUM_SHOWN_RADAR_CATEGORIES; c++ )
{
m_sprRadarLabels[c].SetX( LABEL_OFFSET_X(c) );
m_sprRadarLabels[c].Command( LABEL_ON_COMMAND );
m_sprRadarLabels[c].RunCommands( LABEL_ON_COMMAND );
m_sprRadarLabels[c].BeginTweening( LABEL_ON_DELAY*c ); // sleep
m_sprRadarLabels[c].Command( LABEL_ON_COMMAND_POST_DELAY );
m_sprRadarLabels[c].RunCommands( LABEL_ON_COMMAND_POST_DELAY );
}
m_GrooveRadarValueMap.TweenOnScreen();
}
+20 -20
View File
@@ -12,13 +12,13 @@ static const ThemeMetric<float> START_X ("GroupList","StartX");
static const ThemeMetric<float> START_Y ("GroupList","StartY");
static const ThemeMetric<float> SPACING_X ("GroupList","SpacingX");
static const ThemeMetric<float> SPACING_Y ("GroupList","SpacingY");
static const ThemeMetric<ActorCommands> SCROLL_TWEEN_COMMAND ("GroupList","ScrollTweenCommand");
static const ThemeMetric<ActorCommands> GAIN_FOCUS_ITEM_COMMAND ("GroupList","GainFocusItemCommand");
static const ThemeMetric<ActorCommands> LOSE_FOCUS_ITEM_COMMAND ("GroupList","LoseFocusItemCommand");
static const ThemeMetric<ActorCommands> GAIN_FOCUS_GROUP_COMMAND ("GroupList","GainFocusGroupCommand");
static const ThemeMetric<ActorCommands> LOSE_FOCUS_GROUP_COMMAND ("GroupList","LoseFocusGroupCommand");
static const ThemeMetric<ActorCommands> HIDE_ITEM_COMMAND ("GroupList","HideItemCommand");
static const ThemeMetric<ActorCommands> SHOW_ITEM_COMMAND ("GroupList","ShowItemCommand");
static const ThemeMetric<Commands> SCROLL_TWEEN_COMMAND ("GroupList","ScrollTweenCommand");
static const ThemeMetric<Commands> GAIN_FOCUS_ITEM_COMMAND ("GroupList","GainFocusItemCommand");
static const ThemeMetric<Commands> LOSE_FOCUS_ITEM_COMMAND ("GroupList","LoseFocusItemCommand");
static const ThemeMetric<Commands> GAIN_FOCUS_GROUP_COMMAND ("GroupList","GainFocusGroupCommand");
static const ThemeMetric<Commands> LOSE_FOCUS_GROUP_COMMAND ("GroupList","LoseFocusGroupCommand");
static const ThemeMetric<Commands> HIDE_ITEM_COMMAND ("GroupList","HideItemCommand");
static const ThemeMetric<Commands> SHOW_ITEM_COMMAND ("GroupList","ShowItemCommand");
const int MAX_GROUPS_ONSCREEN = 7;
@@ -105,16 +105,16 @@ void GroupList::ResetTextSize( int i )
void GroupList::BeforeChange()
{
m_sprButtons[m_iSelection]->Command( LOSE_FOCUS_ITEM_COMMAND );
m_textLabels[m_iSelection]->Command( LOSE_FOCUS_ITEM_COMMAND );
m_ButtonFrames[m_iSelection]->Command( LOSE_FOCUS_GROUP_COMMAND );
m_sprButtons[m_iSelection]->RunCommands( LOSE_FOCUS_ITEM_COMMAND );
m_textLabels[m_iSelection]->RunCommands( LOSE_FOCUS_ITEM_COMMAND );
m_ButtonFrames[m_iSelection]->RunCommands( LOSE_FOCUS_GROUP_COMMAND );
}
void GroupList::AfterChange()
{
m_Frame.StopTweening();
m_Frame.Command( SCROLL_TWEEN_COMMAND );
m_Frame.RunCommands( SCROLL_TWEEN_COMMAND );
m_Frame.SetY( -m_iTop*SPACING_Y );
for( int i=0; i < (int) m_asLabels.size(); i++ )
@@ -124,22 +124,22 @@ void GroupList::AfterChange()
if( IsHidden && !WasHidden )
{
m_sprButtons[i]->Command( HIDE_ITEM_COMMAND );
m_textLabels[i]->Command( HIDE_ITEM_COMMAND );
m_sprButtons[i]->RunCommands( HIDE_ITEM_COMMAND );
m_textLabels[i]->RunCommands( HIDE_ITEM_COMMAND );
}
else if( !IsHidden && WasHidden )
{
m_sprButtons[i]->Command( SHOW_ITEM_COMMAND );
m_textLabels[i]->Command( SHOW_ITEM_COMMAND );
m_sprButtons[i]->RunCommands( SHOW_ITEM_COMMAND );
m_textLabels[i]->RunCommands( SHOW_ITEM_COMMAND );
ResetTextSize( i );
}
m_bHidden[i] = IsHidden;
}
m_sprButtons[m_iSelection]->Command( GAIN_FOCUS_ITEM_COMMAND );
m_textLabels[m_iSelection]->Command( GAIN_FOCUS_ITEM_COMMAND );
m_ButtonFrames[m_iSelection]->Command( GAIN_FOCUS_GROUP_COMMAND );
m_sprButtons[m_iSelection]->RunCommands( GAIN_FOCUS_ITEM_COMMAND );
m_textLabels[m_iSelection]->RunCommands( GAIN_FOCUS_ITEM_COMMAND );
m_ButtonFrames[m_iSelection]->RunCommands( GAIN_FOCUS_GROUP_COMMAND );
}
void GroupList::Up()
@@ -206,8 +206,8 @@ void GroupList::TweenOnScreen()
/* If this item isn't visible, hide it and skip tweens. */
if( !ItemIsOnScreen(i) )
{
m_sprButtons[i]->Command( HIDE_ITEM_COMMAND );
m_textLabels[i]->Command( HIDE_ITEM_COMMAND );
m_sprButtons[i]->RunCommands( HIDE_ITEM_COMMAND );
m_textLabels[i]->RunCommands( HIDE_ITEM_COMMAND );
m_sprButtons[i]->FinishTweening();
m_textLabels[i]->FinishTweening();
+1 -1
View File
@@ -10,7 +10,7 @@ HoldGhostArrow::HoldGhostArrow()
void HoldGhostArrow::Load( CString sNoteSkin, CString sButton, CString sElement )
{
Sprite::Load( NOTESKIN->GetPathToFromNoteSkinAndButton(sNoteSkin, sButton, sElement) ); // not optional
this->Command( NOTESKIN->GetMetricA(sNoteSkin,"HoldGhostArrow","OnCommand") );
this->RunCommands( NOTESKIN->GetMetricA(sNoteSkin,"HoldGhostArrow","OnCommand") );
}
void HoldGhostArrow::Update( float fDeltaTime )
+10 -10
View File
@@ -6,12 +6,12 @@
#include "ThemeManager.h"
#include "ThemeMetric.h"
ThemeMetric<ActorCommands> OK_COMMAND ("HoldJudgment","OKCommand");
ThemeMetric<ActorCommands> NG_COMMAND ("HoldJudgment","NGCommand");
ThemeMetric<ActorCommands> OK_ODD_COMMAND ("HoldJudgment","OKOddCommand");
ThemeMetric<ActorCommands> NG_ODD_COMMAND ("HoldJudgment","NGOddCommand");
ThemeMetric<ActorCommands> OK_EVEN_COMMAND ("HoldJudgment","OKEvenCommand");
ThemeMetric<ActorCommands> NG_EVEN_COMMAND ("HoldJudgment","NGEvenCommand");
ThemeMetric<Commands> OK_COMMAND ("HoldJudgment","OKCommand");
ThemeMetric<Commands> NG_COMMAND ("HoldJudgment","NGCommand");
ThemeMetric<Commands> OK_ODD_COMMAND ("HoldJudgment","OKOddCommand");
ThemeMetric<Commands> NG_ODD_COMMAND ("HoldJudgment","NGOddCommand");
ThemeMetric<Commands> OK_EVEN_COMMAND ("HoldJudgment","OKEvenCommand");
ThemeMetric<Commands> NG_EVEN_COMMAND ("HoldJudgment","NGEvenCommand");
HoldJudgment::HoldJudgment()
@@ -54,13 +54,13 @@ void HoldJudgment::SetHoldJudgment( HoldNoteScore hns )
ASSERT(0);
case HNS_OK:
m_sprJudgment.SetState( 0 );
m_sprJudgment.Command( (m_iCount%2) ? OK_ODD_COMMAND : OK_EVEN_COMMAND );
m_sprJudgment.Command( OK_COMMAND );
m_sprJudgment.RunCommands( (m_iCount%2) ? OK_ODD_COMMAND : OK_EVEN_COMMAND );
m_sprJudgment.RunCommands( OK_COMMAND );
break;
case HNS_NG:
m_sprJudgment.SetState( 1 );
m_sprJudgment.Command( (m_iCount%2) ? NG_ODD_COMMAND : NG_EVEN_COMMAND );
m_sprJudgment.Command( NG_COMMAND );
m_sprJudgment.RunCommands( (m_iCount%2) ? NG_ODD_COMMAND : NG_EVEN_COMMAND );
m_sprJudgment.RunCommands( NG_COMMAND );
break;
default:
ASSERT(0);
+30 -30
View File
@@ -7,26 +7,26 @@
#include "ThemeManager.h"
#include "ThemeMetric.h"
static ThemeMetric<ActorCommands> MARVELOUS_COMMAND ("Judgment","MarvelousCommand");
static ThemeMetric<ActorCommands> PERFECT_COMMAND ("Judgment","PerfectCommand");
static ThemeMetric<ActorCommands> GREAT_COMMAND ("Judgment","GreatCommand");
static ThemeMetric<ActorCommands> GOOD_COMMAND ("Judgment","GoodCommand");
static ThemeMetric<ActorCommands> BOO_COMMAND ("Judgment","BooCommand");
static ThemeMetric<ActorCommands> MISS_COMMAND ("Judgment","MissCommand");
static ThemeMetric<Commands> MARVELOUS_COMMAND ("Judgment","MarvelousCommand");
static ThemeMetric<Commands> PERFECT_COMMAND ("Judgment","PerfectCommand");
static ThemeMetric<Commands> GREAT_COMMAND ("Judgment","GreatCommand");
static ThemeMetric<Commands> GOOD_COMMAND ("Judgment","GoodCommand");
static ThemeMetric<Commands> BOO_COMMAND ("Judgment","BooCommand");
static ThemeMetric<Commands> MISS_COMMAND ("Judgment","MissCommand");
static ThemeMetric<ActorCommands> MARVELOUS_ODD_COMMAND ("Judgment","MarvelousOddCommand");
static ThemeMetric<ActorCommands> PERFECT_ODD_COMMAND ("Judgment","PerfectOddCommand");
static ThemeMetric<ActorCommands> GREAT_ODD_COMMAND ("Judgment","GreatOddCommand");
static ThemeMetric<ActorCommands> GOOD_ODD_COMMAND ("Judgment","GoodOddCommand");
static ThemeMetric<ActorCommands> BOO_ODD_COMMAND ("Judgment","BooOddCommand");
static ThemeMetric<ActorCommands> MISS_ODD_COMMAND ("Judgment","MissOddCommand");
static ThemeMetric<Commands> MARVELOUS_ODD_COMMAND ("Judgment","MarvelousOddCommand");
static ThemeMetric<Commands> PERFECT_ODD_COMMAND ("Judgment","PerfectOddCommand");
static ThemeMetric<Commands> GREAT_ODD_COMMAND ("Judgment","GreatOddCommand");
static ThemeMetric<Commands> GOOD_ODD_COMMAND ("Judgment","GoodOddCommand");
static ThemeMetric<Commands> BOO_ODD_COMMAND ("Judgment","BooOddCommand");
static ThemeMetric<Commands> MISS_ODD_COMMAND ("Judgment","MissOddCommand");
static ThemeMetric<ActorCommands> MARVELOUS_EVEN_COMMAND ("Judgment","MarvelousEvenCommand");
static ThemeMetric<ActorCommands> PERFECT_EVEN_COMMAND ("Judgment","PerfectEvenCommand");
static ThemeMetric<ActorCommands> GREAT_EVEN_COMMAND ("Judgment","GreatEvenCommand");
static ThemeMetric<ActorCommands> GOOD_EVEN_COMMAND ("Judgment","GoodEvenCommand");
static ThemeMetric<ActorCommands> BOO_EVEN_COMMAND ("Judgment","BooEvenCommand");
static ThemeMetric<ActorCommands> MISS_EVEN_COMMAND ("Judgment","MissEvenCommand");
static ThemeMetric<Commands> MARVELOUS_EVEN_COMMAND ("Judgment","MarvelousEvenCommand");
static ThemeMetric<Commands> PERFECT_EVEN_COMMAND ("Judgment","PerfectEvenCommand");
static ThemeMetric<Commands> GREAT_EVEN_COMMAND ("Judgment","GreatEvenCommand");
static ThemeMetric<Commands> GOOD_EVEN_COMMAND ("Judgment","GoodEvenCommand");
static ThemeMetric<Commands> BOO_EVEN_COMMAND ("Judgment","BooEvenCommand");
static ThemeMetric<Commands> MISS_EVEN_COMMAND ("Judgment","MissEvenCommand");
Judgment::Judgment()
@@ -60,33 +60,33 @@ void Judgment::SetJudgment( TapNoteScore score )
{
case TNS_MARVELOUS:
m_sprJudgment.SetState( 0 );
m_sprJudgment.Command( (m_iCount%2) ? MARVELOUS_ODD_COMMAND : MARVELOUS_EVEN_COMMAND );
m_sprJudgment.Command( MARVELOUS_COMMAND );
m_sprJudgment.RunCommands( (m_iCount%2) ? MARVELOUS_ODD_COMMAND : MARVELOUS_EVEN_COMMAND );
m_sprJudgment.RunCommands( MARVELOUS_COMMAND );
break;
case TNS_PERFECT:
m_sprJudgment.SetState( 1 );
m_sprJudgment.Command( (m_iCount%2) ? PERFECT_ODD_COMMAND : PERFECT_EVEN_COMMAND );
m_sprJudgment.Command( PERFECT_COMMAND );
m_sprJudgment.RunCommands( (m_iCount%2) ? PERFECT_ODD_COMMAND : PERFECT_EVEN_COMMAND );
m_sprJudgment.RunCommands( PERFECT_COMMAND );
break;
case TNS_GREAT:
m_sprJudgment.SetState( 2 );
m_sprJudgment.Command( (m_iCount%2) ? GREAT_ODD_COMMAND : GREAT_EVEN_COMMAND );
m_sprJudgment.Command( GREAT_COMMAND );
m_sprJudgment.RunCommands( (m_iCount%2) ? GREAT_ODD_COMMAND : GREAT_EVEN_COMMAND );
m_sprJudgment.RunCommands( GREAT_COMMAND );
break;
case TNS_GOOD:
m_sprJudgment.SetState( 3 );
m_sprJudgment.Command( (m_iCount%2) ? GOOD_ODD_COMMAND : GOOD_EVEN_COMMAND );
m_sprJudgment.Command( GOOD_COMMAND );
m_sprJudgment.RunCommands( (m_iCount%2) ? GOOD_ODD_COMMAND : GOOD_EVEN_COMMAND );
m_sprJudgment.RunCommands( GOOD_COMMAND );
break;
case TNS_BOO:
m_sprJudgment.SetState( 4 );
m_sprJudgment.Command( (m_iCount%2) ? BOO_ODD_COMMAND : BOO_EVEN_COMMAND );
m_sprJudgment.Command( BOO_COMMAND );
m_sprJudgment.RunCommands( (m_iCount%2) ? BOO_ODD_COMMAND : BOO_EVEN_COMMAND );
m_sprJudgment.RunCommands( BOO_COMMAND );
break;
case TNS_MISS:
m_sprJudgment.SetState( 5 );
m_sprJudgment.Command( (m_iCount%2) ? MISS_ODD_COMMAND : MISS_EVEN_COMMAND );
m_sprJudgment.Command( MISS_COMMAND );
m_sprJudgment.RunCommands( (m_iCount%2) ? MISS_ODD_COMMAND : MISS_EVEN_COMMAND );
m_sprJudgment.RunCommands( MISS_COMMAND );
break;
default:
ASSERT(0);
+4 -4
View File
@@ -5,8 +5,8 @@
#include "GameState.h"
#include "ThemeMetric.h"
static ThemeMetric<ActorCommands> IN_COMMAND ("LyricDisplay","InCommand");
static ThemeMetric<ActorCommands> OUT_COMMAND ("LyricDisplay","OutCommand");
static ThemeMetric<Commands> IN_COMMAND ("LyricDisplay","InCommand");
static ThemeMetric<Commands> OUT_COMMAND ("LyricDisplay","OutCommand");
static ThemeMetric<RageColor> WIPE_DIM_FACTOR ("LyricDisplay","WipeDimFactor");
static float g_TweenInTime, g_TweenOutTime;
@@ -112,14 +112,14 @@ void LyricDisplay::Update( float fDeltaTime )
m_textLyrics[i].SetCropLeft(0);
if( i==1 )
m_textLyrics[i].SetCropRight(1);
m_textLyrics[i].Command(IN_COMMAND);
m_textLyrics[i].RunCommands(IN_COMMAND);
m_textLyrics[i].BeginTweening( fShowLength * 0.75f ); /* sleep */
if( i==0 )
m_textLyrics[i].SetCropLeft(1);
if( i==1 )
m_textLyrics[i].SetCropRight(0);
m_textLyrics[i].BeginTweening( fShowLength * 0.25f ); /* sleep */
m_textLyrics[i].Command(OUT_COMMAND);
m_textLyrics[i].RunCommands(OUT_COMMAND);
}
m_iCurLyricNumber++;
+3 -2
View File
@@ -54,7 +54,8 @@ ScreenTitleMenu.cpp ScreenTitleMenu.h ScreenUnlock.cpp ScreenUnlock.h ScreenWith
DataStructures = \
Attack.cpp Attack.h AutoKeysounds.cpp AutoKeysounds.h BannerCache.cpp BannerCache.h CatalogXml.cpp CatalogXml.h \
Character.cpp Character.h CharacterHead.cpp CharacterHead.h \
CodeDetector.cpp CodeDetector.h Difficulty.cpp Difficulty.h EnumHelper.cpp EnumHelper.h Course.cpp Course.h \
CodeDetector.cpp CodeDetector.h
Command.cpp Command.h Difficulty.cpp Difficulty.h EnumHelper.cpp EnumHelper.h Course.cpp Course.h \
CourseUtil.cpp CourseUtil.h DateTime.cpp DateTime.h Font.cpp Font.h FontCharAliases.cpp FontCharAliases.h \
FontCharmaps.cpp FontCharmaps.h Game.cpp Game.h GameCommand.cpp GameCommand.h \
GameConstantsAndTypes.cpp GameConstantsAndTypes.h \
@@ -251,7 +252,7 @@ RageTimer.cpp RageTimer.h RageTypes.h RageUtil.cpp RageUtil.h RageUtil_CharConve
RageUtil_BackgroundLoader.cpp RageUtil_BackgroundLoader.h RageUtil_FileDB.cpp RageUtil_FileDB.h RageUtil_CircularBuffer.h
Actors = \
Actor.cpp Actor.h ActorCollision.h ActorCommands.cpp ActorCommands.h ActorFrame.cpp ActorFrame.h \
Actor.cpp Actor.h ActorCollision.h ActorFrame.cpp ActorFrame.h \
ActorScroller.cpp ActorScroller.h ActorUtil.cpp ActorUtil.h BitmapText.cpp BitmapText.h Model.cpp Model.h \
ModelManager.cpp ModelManager.h ModelTypes.cpp ModelTypes.h Quad.h Sprite.cpp Sprite.h
+5 -5
View File
@@ -13,7 +13,7 @@
static const ThemeMetric<int> WARNING_START ("MenuTimer","WarningStart");
static const ThemeMetric<int> WARNING_BEEP_START ("MenuTimer","WarningBeepStart");
#define WARNING_COMMAND(i) THEME->GetMetricA ("MenuTimer", ssprintf("WarningCommand%i",i))
static const ThemeMetric<ActorCommands> ON_COMMAND ("MenuTimer","OnCommand");
static const ThemeMetric<Commands> ON_COMMAND ("MenuTimer","OnCommand");
static const int TIMER_SECONDS = 99;
static const int MAX_STALL_SECONDS = 30;
@@ -81,8 +81,8 @@ void MenuTimer::Update( float fDeltaTime )
if( iNewDisplay <= WARNING_START )
{
m_textDigit1.Command( WARNING_COMMAND(iNewDisplay) );
m_textDigit2.Command( WARNING_COMMAND(iNewDisplay) );
m_textDigit1.RunCommands( WARNING_COMMAND(iNewDisplay) );
m_textDigit2.RunCommands( WARNING_COMMAND(iNewDisplay) );
}
if( iNewDisplay == 0 )
@@ -134,8 +134,8 @@ void MenuTimer::SetSeconds( int iSeconds )
m_fSecondsLeft = (float)iSeconds;
CLAMP( m_fSecondsLeft, 0, 99 );
m_textDigit1.Command( ON_COMMAND );
m_textDigit2.Command( ON_COMMAND );
m_textDigit1.RunCommands( ON_COMMAND );
m_textDigit2.RunCommands( ON_COMMAND );
SetText( iSeconds );
}
+7 -5
View File
@@ -719,20 +719,22 @@ void Model::SetSecondsIntoAnimation( float fSeconds )
}
}
void Model::HandleCommand( const ActorCommand &command )
void Model::HandleCommand( const Command &command )
{
BeginHandleParams;
BeginHandleArgs;
const CString& sName = sParam(0);
const CString& sName = command.GetName();
if( sName=="play" )
PlayAnimation( sParam(1),fParam(2) );
{
PlayAnimation( sArg(1),fArg(2) );
}
else
{
Actor::HandleCommand( command );
return;
}
EndHandleParams;
EndHandleArgs;
}
/*
+1 -1
View File
@@ -43,7 +43,7 @@ public:
void SetDefaultAnimation( CString sAnimation, float fPlayRate = 1 );
bool m_bRevertToDefaultAnimation;
virtual void HandleCommand( const ActorCommand &command );
virtual void HandleCommand( const Command &command );
private:
RageModelGeometry *m_pGeometry;
+2 -2
View File
@@ -12,7 +12,7 @@ static const ThemeMetric<float> START_X ("MusicList","StartX");
static const ThemeMetric<float> START_Y ("MusicList","StartY");
static const ThemeMetric<float> SPACING_X ("MusicList","SpacingX");
static const ThemeMetric<float> CROP_WIDTH ("MusicList","CropWidth");
static const ThemeMetric<ActorCommands> INIT_COMMAND ("MusicList","InitCommand");
static const ThemeMetric<Commands> INIT_COMMAND ("MusicList","InitCommand");
MusicList::MusicList()
{
@@ -25,7 +25,7 @@ void MusicList::Load()
{
m_textTitles[i].LoadFromFont( THEME->GetPathToF("MusicList titles") );
m_textTitles[i].SetXY( START_X + i*SPACING_X, START_Y );
m_textTitles[i].Command( INIT_COMMAND );
m_textTitles[i].RunCommands( INIT_COMMAND );
this->AddChild( &m_textTitles[i] );
}
}
+1 -1
View File
@@ -437,7 +437,7 @@ void MusicWheel::BuildWheelItemDatas( vector<WheelItemData> &arrayWheelItemDatas
WheelItemData wid( TYPE_SORT, NULL, "", NULL, SORT_MENU_COLOR, so );
wid.m_sLabel = Names[i];
wid.m_Action.Load( i, ParseActorCommands(Actions[i]) );
wid.m_Action.Load( i, ParseCommands(Actions[i]) );
switch( so )
{
+4 -4
View File
@@ -76,8 +76,8 @@ void NoteFieldMode::Load(IniFile &ini, CString id, int pn)
GetValue( ini, pn, id, "PixelsDrawBehindScale", m_fLastPixelToDrawScale );
CString s;
if( GetValue( ini, pn, id, "Judgment", s ) ) m_JudgmentCmd = ParseActorCommands(s);
if( GetValue( ini, pn, id, "Combo", s ) ) m_ComboCmd = ParseActorCommands(s);
if( GetValue( ini, pn, id, "Judgment", s ) ) m_JudgmentCmd = ParseCommands(s);
if( GetValue( ini, pn, id, "Combo", s ) ) m_ComboCmd = ParseCommands(s);
/* Load per-track data: */
int t;
@@ -92,8 +92,8 @@ void NoteFieldMode::Load(IniFile &ini, CString id, int pn)
GetValue( ini, pn, id, ssprintf("GhostButton"), GhostButtonNames[t] );
GetValue( ini, pn, id, ssprintf("GhostButton%i", t+1), GhostButtonNames[t] );
if( GetValue( ini, pn, id, ssprintf("HoldJudgment"), s ) ) m_HoldJudgmentCmd[t] = ParseActorCommands(s);
if( GetValue( ini, pn, id, ssprintf("HoldJudgment%i",t+1), s ) ) m_HoldJudgmentCmd[t] = ParseActorCommands(s);
if( GetValue( ini, pn, id, ssprintf("HoldJudgment"), s ) ) m_HoldJudgmentCmd[t] = ParseCommands(s);
if( GetValue( ini, pn, id, ssprintf("HoldJudgment%i",t+1), s ) ) m_HoldJudgmentCmd[t] = ParseCommands(s);
}
}
+3 -3
View File
@@ -3,7 +3,7 @@
#include "PlayerNumber.h"
#include "Style.h"
#include "ActorCommands.h"
#include "Command.h"
class IniFile;
@@ -33,8 +33,8 @@ struct NoteFieldMode
float m_fFirstPixelToDrawScale, m_fLastPixelToDrawScale;
CString m_Backdrop;
ActorCommands m_JudgmentCmd, m_ComboCmd, m_AttackDisplayCmd;
ActorCommands m_HoldJudgmentCmd[MAX_NOTE_TRACKS];
Commands m_JudgmentCmd, m_ComboCmd, m_AttackDisplayCmd;
Commands m_HoldJudgmentCmd[MAX_NOTE_TRACKS];
};
class NoteFieldPositioning
+2 -2
View File
@@ -197,9 +197,9 @@ RageColor NoteSkinManager::GetMetricC( const CString &sNoteSkinName, const CStri
return c;
}
ActorCommands NoteSkinManager::GetMetricA( const CString &sNoteSkinName, const CString &sButtonName, const CString &sValueName )
Commands NoteSkinManager::GetMetricA( const CString &sNoteSkinName, const CString &sButtonName, const CString &sValueName )
{
return ParseActorCommands( GetMetric(sNoteSkinName,sButtonName,sValueName) );
return ParseCommands( GetMetric(sNoteSkinName,sButtonName,sValueName) );
}
CString NoteSkinManager::GetPathToFromNoteSkinAndButton( const CString &NoteSkin, const CString &sButtonName, const CString &sElement, bool bOptional )
+2 -2
View File
@@ -1,7 +1,7 @@
#ifndef NoteSkinMANAGER_H
#define NoteSkinMANAGER_H
#include "ActorCommands.h"
#include "Command.h"
#include "RageTypes.h"
#include "PlayerNumber.h"
#include "IniFile.h"
@@ -28,7 +28,7 @@ public:
float GetMetricF( const CString &sNoteSkinName, const CString &sButtonName, const CString &sValueName );
bool GetMetricB( const CString &sNoteSkinName, const CString &sButtonName, const CString &sValueName );
RageColor GetMetricC( const CString &sNoteSkinName, const CString &sButtonName, const CString &sValueName );
ActorCommands GetMetricA( const CString &sNoteSkinName, const CString &sButtonName, const CString &sValueName );
Commands GetMetricA( const CString &sNoteSkinName, const CString &sButtonName, const CString &sValueName );
CString GetNoteSkinDir( const CString &sSkinName );
+1 -1
View File
@@ -322,7 +322,7 @@ done:
continue;
spec.erase( spec.begin(), spec.begin()+1 );
m_textContents[c].Command( ParseActorCommands(join(";", spec)) );
m_textContents[c].RunCommands( ParseCommands(join(";", spec)) );
break;
}
}
+5 -5
View File
@@ -201,15 +201,15 @@ void PlayerMinus::Load(
m_ProTimingDisplay.SetY( bReverse ? SCREEN_BOTTOM-JUDGMENT_Y : SCREEN_TOP+JUDGMENT_Y );
/* These commands add to the above positioning, and are usually empty. */
m_Judgment.Command( g_NoteFieldMode[pn].m_JudgmentCmd );
m_ProTimingDisplay.Command( g_NoteFieldMode[pn].m_JudgmentCmd );
m_Combo.Command( g_NoteFieldMode[pn].m_ComboCmd );
m_AttackDisplay.Command( g_NoteFieldMode[pn].m_AttackDisplayCmd );
m_Judgment.RunCommands( g_NoteFieldMode[pn].m_JudgmentCmd );
m_ProTimingDisplay.RunCommands( g_NoteFieldMode[pn].m_JudgmentCmd );
m_Combo.RunCommands( g_NoteFieldMode[pn].m_ComboCmd );
m_AttackDisplay.RunCommands( g_NoteFieldMode[pn].m_AttackDisplayCmd );
for( int c=0; c<pStyle->m_iColsPerPlayer; c++ )
{
NoteFieldMode &mode = g_NoteFieldMode[pn];
m_HoldJudgment[c].Command( mode.m_HoldJudgmentCmd[c] );
m_HoldJudgment[c].RunCommands( mode.m_HoldJudgmentCmd[c] );
}
// Need to set Y positions of all these elements in Update since
+9 -9
View File
@@ -4,15 +4,15 @@
#include "RageUtil.h"
#include "ThemeMetric.h"
static const ThemeMetric<ActorCommands> MARVELOUS_COMMAND ("ProTimingDisplay","MarvelousCommand");
static const ThemeMetric<ActorCommands> PERFECT_COMMAND ("ProTimingDisplay","PerfectCommand");
static const ThemeMetric<ActorCommands> GREAT_COMMAND ("ProTimingDisplay","GreatCommand");
static const ThemeMetric<ActorCommands> GOOD_COMMAND ("ProTimingDisplay","GoodCommand");
static const ThemeMetric<ActorCommands> BOO_COMMAND ("ProTimingDisplay","BooCommand");
static const ThemeMetric<ActorCommands> MISS_COMMAND ("ProTimingDisplay","MissCommand");
static const ThemeMetric<ActorCommands> HIT_MINE_COMMAND ("ProTimingDisplay","HitMineCommand");
static const ThemeMetric<Commands> MARVELOUS_COMMAND ("ProTimingDisplay","MarvelousCommand");
static const ThemeMetric<Commands> PERFECT_COMMAND ("ProTimingDisplay","PerfectCommand");
static const ThemeMetric<Commands> GREAT_COMMAND ("ProTimingDisplay","GreatCommand");
static const ThemeMetric<Commands> GOOD_COMMAND ("ProTimingDisplay","GoodCommand");
static const ThemeMetric<Commands> BOO_COMMAND ("ProTimingDisplay","BooCommand");
static const ThemeMetric<Commands> MISS_COMMAND ("ProTimingDisplay","MissCommand");
static const ThemeMetric<Commands> HIT_MINE_COMMAND ("ProTimingDisplay","HitMineCommand");
static const ThemeMetric<ActorCommands> *g_Commands[NUM_TAP_NOTE_SCORES] =
static const ThemeMetric<Commands> *g_Commands[NUM_TAP_NOTE_SCORES] =
{
NULL, /* no TNS_NONE */
&HIT_MINE_COMMAND,
@@ -50,7 +50,7 @@ void ProTimingDisplay::SetJudgment( int ms, TapNoteScore score )
ASSERT( score != TNS_NONE );
ASSERT( score < NUM_TAP_NOTE_SCORES );
m_Judgment.Command( *g_Commands[score] );
m_Judgment.RunCommands( *g_Commands[score] );
}
/*
+13 -13
View File
@@ -235,25 +235,25 @@ void RageMatrixCommand( CString sCommandString, RageMatrix &mat )
int iMaxIndexAccessed = 0;
#define sParam(i) (GetParam(asTokens,i,iMaxIndexAccessed))
#define fParam(i) (strtof(sParam(i),NULL))
#define iParam(i) (atoi(sParam(i)))
#define bParam(i) (iParam(i)!=0)
#define sArg(i) (GetParam(asTokens,i,iMaxIndexAccessed))
#define fArg(i) (strtof(sArg(i),NULL))
#define iArg(i) (atoi(sArg(i)))
#define bArg(i) (iArg(i)!=0)
CString& sName = asTokens[0];
sName.MakeLower();
RageMatrix b;
// Act on command
if( sName=="x" ) RageMatrixTranslation( &b, fParam(1),0,0 );
else if( sName=="y" ) RageMatrixTranslation( &b, 0,fParam(1),0 );
else if( sName=="z" ) RageMatrixTranslation( &b, 0,0,fParam(1) );
else if( sName=="zoomx" ) RageMatrixScaling(&b, fParam(1),1,1 );
else if( sName=="zoomy" ) RageMatrixScaling(&b, 1,fParam(1),1 );
else if( sName=="zoomz" ) RageMatrixScaling(&b, 1,1,fParam(1) );
else if( sName=="rotationx" ) RageMatrixRotationX( &b, fParam(1) );
else if( sName=="rotationy" ) RageMatrixRotationY( &b, fParam(1) );
else if( sName=="rotationz" ) RageMatrixRotationZ( &b, fParam(1) );
if( sName=="x" ) RageMatrixTranslation( &b, fArg(1),0,0 );
else if( sName=="y" ) RageMatrixTranslation( &b, 0,fArg(1),0 );
else if( sName=="z" ) RageMatrixTranslation( &b, 0,0,fArg(1) );
else if( sName=="zoomx" ) RageMatrixScaling(&b, fArg(1),1,1 );
else if( sName=="zoomy" ) RageMatrixScaling(&b, 1,fArg(1),1 );
else if( sName=="zoomz" ) RageMatrixScaling(&b, 1,1,fArg(1) );
else if( sName=="rotationx" ) RageMatrixRotationX( &b, fArg(1) );
else if( sName=="rotationy" ) RageMatrixRotationY( &b, fArg(1) );
else if( sName=="rotationz" ) RageMatrixRotationZ( &b, fArg(1) );
else
{
CString sError = ssprintf( "MatrixCommand: Unrecognized matrix command name '%s' in command string '%s'.", sName.c_str(), sCommandString.c_str() );
+5 -5
View File
@@ -38,9 +38,9 @@ bool ReceptorArrow::Load( CString NoteSkin, PlayerNumber pn, int iColNo )
m_pPressBlock.Load( NOTESKIN->GetPathToFromNoteSkinAndButton(NoteSkin,sButton,"KeypressBlock") );
m_pReceptorWaiting->Command( ParseActorCommands("effectclock,beat") );
m_pReceptorGo->Command( ParseActorCommands("effectclock,beat") );
m_pPressBlock->Command( ParseActorCommands("effectclock,beat") );
m_pReceptorWaiting->RunCommands( ParseCommands("effectclock,beat") );
m_pReceptorGo->RunCommands( ParseCommands("effectclock,beat") );
m_pPressBlock->RunCommands( ParseCommands("effectclock,beat") );
// draw pressblock before receptors
this->AddChild( m_pPressBlock );
@@ -73,8 +73,8 @@ void ReceptorArrow::Step( TapNoteScore score )
{
m_pReceptorGo->FinishTweening();
m_pReceptorWaiting->FinishTweening();
m_pReceptorGo->Command( m_sScoreCommand[score] );
m_pReceptorWaiting->Command( m_sScoreCommand[score] );
m_pReceptorGo->RunCommands( m_sScoreCommand[score] );
m_pReceptorWaiting->RunCommands( m_sScoreCommand[score] );
}
/*
+1 -1
View File
@@ -25,7 +25,7 @@ private:
AutoActor m_pReceptorWaiting;
AutoActor m_pReceptorGo;
ActorCommands m_sScoreCommand[NUM_TAP_NOTE_SCORES];
Commands m_sScoreCommand[NUM_TAP_NOTE_SCORES];
AutoActor m_pPressBlock;
bool m_bIsPressed;
+2 -2
View File
@@ -51,14 +51,14 @@ void ScoreDisplayBattle::Update( float fDelta )
if( sNewModifier == "" )
{
m_ItemIcon[s].Command( ParseActorCommands("linear,0.25;zoom,0") );
m_ItemIcon[s].RunCommands( ParseCommands("linear,0.25;zoom,0") );
}
else
{
// TODO: Cache all of the icon graphics so we don't load them dynamically from disk.
m_ItemIcon[s].Load( THEME->GetPathToG("ScoreDisplayBattle icon "+sNewModifier) );
m_ItemIcon[s].StopTweening();
m_ItemIcon[s].Command( ParseActorCommands(
m_ItemIcon[s].RunCommands( ParseCommands(
"diffuse,1,1,1,1;zoom,1;"
"sleep,0.1;linear,0;diffusealpha,0;"
"sleep,0.1;linear,0;diffusealpha,1;"
+1 -1
View File
@@ -44,7 +44,7 @@ void ScreenBranch::HandleScreenMessage( const ScreenMessage SM )
LOG->Trace( "Branching to '%s'", sNextScreen.c_str() );
GameCommand mc;
mc.Load( 0, ParseActorCommands(sNextScreen) );
mc.Load( 0, ParseCommands(sNextScreen) );
if( mc.m_sScreen == "" )
RageException::Throw("Metric %s::%s must set \"screen\"",
m_sName.c_str(), ("NextScreen"+m_sChoice).c_str() );
+3 -3
View File
@@ -515,7 +515,7 @@ void ScreenEvaluation::Init()
m_Percent[p].Load( p, &g_CurStageStats, true );
m_Percent[p].SetXY( THEME->GetMetricF(m_sName, ssprintf("PercentP%dX",p+1)),
THEME->GetMetricF(m_sName,ssprintf("PercentP%dY",p+1)) );
m_Percent[p].Command( THEME->GetMetricA(m_sName,ssprintf("PercentP%dOnCommand",p+1)) );
m_Percent[p].RunCommands( THEME->GetMetricA(m_sName,ssprintf("PercentP%dOnCommand",p+1)) );
this->AddChild( &m_Percent[p] );
}
}
@@ -552,7 +552,7 @@ void ScreenEvaluation::Init()
// .99999 is fairly close to 1.00, so we use that
if( stageStats.radarActual[p][r] > 0.99999f )
m_sprActualBar[p][r].Command( BAR_ACTUAL_MAX_COMMAND );
m_sprActualBar[p][r].RunCommands( BAR_ACTUAL_MAX_COMMAND );
this->AddChild( &m_sprActualBar[p][r] );
}
}
@@ -1176,7 +1176,7 @@ void ScreenEvaluation::TweenOffScreen()
FOREACH_EnabledPlayer( p )
{
OFF_COMMAND( m_sprPercentFrame[p] );
m_Percent[p].Command( THEME->GetMetricA(m_sName,ssprintf("PercentP%dOffCommand",p+1)) );
m_Percent[p].RunCommands( THEME->GetMetricA(m_sName,ssprintf("PercentP%dOffCommand",p+1)) );
m_Percent[p].TweenOffScreen();
}
}
+17 -17
View File
@@ -412,28 +412,28 @@ void ScreenEz2SelectMusic::MenuBack( PlayerNumber pn )
void ScreenEz2SelectMusic::TweenOffScreen()
{
static const ActorCommands cmds = ParseActorCommands("linear,0.5;zoomy,0");
m_MusicBannerWheel.Command( cmds );
static const Commands cmds = ParseCommands("linear,0.5;zoomy,0");
m_MusicBannerWheel.RunCommands( cmds );
static const ActorCommands cmds2 = ParseActorCommands("Linear,1;DiffuseAlpha,0");
m_PumpDifficultyCircle.Command( cmds2 );
m_Guide.Command( cmds2 );
m_PumpDifficultyRating.Command( cmds2 );
m_Guide.Command( cmds2 );
m_ChoiceListFrame.Command( cmds2 );
m_ChoiceListHighlight.Command( cmds2 );
m_CurrentGroup.Command( cmds2 );
m_CurrentTitle.Command( cmds2 );
m_CurrentArtist.Command( cmds2 );
static const Commands cmds2 = ParseCommands("Linear,1;DiffuseAlpha,0");
m_PumpDifficultyCircle.RunCommands( cmds2 );
m_Guide.RunCommands( cmds2 );
m_PumpDifficultyRating.RunCommands( cmds2 );
m_Guide.RunCommands( cmds2 );
m_ChoiceListFrame.RunCommands( cmds2 );
m_ChoiceListHighlight.RunCommands( cmds2 );
m_CurrentGroup.RunCommands( cmds2 );
m_CurrentTitle.RunCommands( cmds2 );
m_CurrentArtist.RunCommands( cmds2 );
//This should be fixed and changed to OFF_COMMAND
for(int i=0; i<NUM_PLAYERS; i++)
{
m_SpeedIcon[i].Command( cmds2 );
m_MirrorIcon[i].Command( cmds2 );
m_ShuffleIcon[i].Command( cmds2 );
m_HiddenIcon[i].Command( cmds2 );
m_VanishIcon[i].Command( cmds2 );
m_SpeedIcon[i].RunCommands( cmds2 );
m_MirrorIcon[i].RunCommands( cmds2 );
m_ShuffleIcon[i].RunCommands( cmds2 );
m_HiddenIcon[i].RunCommands( cmds2 );
m_VanishIcon[i].RunCommands( cmds2 );
}
}
+6 -6
View File
@@ -15,10 +15,10 @@
#include "ScreenDimensions.h"
#include "ThemeMetric.h"
static const ThemeMetric<ActorCommands> EVEN_LINE_IN ("ScreenMapControllers","EvenLineIn");
static const ThemeMetric<ActorCommands> EVEN_LINE_OUT ("ScreenMapControllers","EvenLineOut");
static const ThemeMetric<ActorCommands> ODD_LINE_IN ("ScreenMapControllers","OddLineIn");
static const ThemeMetric<ActorCommands> ODD_LINE_OUT ("ScreenMapControllers","OddLineOut");
static const ThemeMetric<Commands> EVEN_LINE_IN ("ScreenMapControllers","EvenLineIn");
static const ThemeMetric<Commands> EVEN_LINE_OUT ("ScreenMapControllers","EvenLineOut");
static const ThemeMetric<Commands> ODD_LINE_IN ("ScreenMapControllers","OddLineIn");
static const ThemeMetric<Commands> ODD_LINE_OUT ("ScreenMapControllers","OddLineOut");
const int FramesToWaitForInput = 2;
@@ -79,7 +79,7 @@ ScreenMapControllers::ScreenMapControllers( CString sClassName ) : ScreenWithMen
m_Line[b].SetY( LINE_START_Y + b*LINE_GAP_Y );
this->AddChild( &m_Line[b] );
m_Line[b].Command( (b%2)? ODD_LINE_IN : EVEN_LINE_IN );
m_Line[b].RunCommands( (b%2)? ODD_LINE_IN : EVEN_LINE_IN );
}
m_textError.LoadFromFont( THEME->GetPathToF("Common normal") );
@@ -298,7 +298,7 @@ void ScreenMapControllers::Input( const DeviceInput& DeviceI, const InputEventTy
SCREENMAN->PlayStartSound();
StartTransitioning( SM_GoToNextScreen );
for( int b=0; b<GAMESTATE->GetCurrentGame()->m_iButtonsPerController; b++ )
m_Line[b].Command( (b%2)? ODD_LINE_OUT:EVEN_LINE_OUT );
m_Line[b].RunCommands( (b%2)? ODD_LINE_OUT:EVEN_LINE_OUT );
}
break;
case KEY_ENTER: /* Change the selection. */
+8 -8
View File
@@ -83,10 +83,10 @@ void HighScoreWheelItem::LoadBlank( int iRankIndex )
void HighScoreWheelItem::ShowFocus()
{
ActorCommands cmds = ParseActorCommands("diffuseshift;EffectColor1,1,1,0,1;EffectColor2,0,1,1,1");
m_textRank.Command( cmds );
m_textName.Command( cmds );
m_textScore.Command( cmds );
Commands cmds = ParseCommands("diffuseshift;EffectColor1,1,1,0,1;EffectColor2,0,1,1,1");
m_textRank.RunCommands( cmds );
m_textName.RunCommands( cmds );
m_textScore.RunCommands( cmds );
}
void HighScoreWheel::Load( const HighScoreList& hsl, int iIndexToFocus )
@@ -220,7 +220,7 @@ ScreenNameEntryTraditional::ScreenNameEntryTraditional( CString sClassName ) : S
Letter->SetText( ssprintf("%lc", Chars[ch]) );
m_textAlphabet[p].push_back( Letter );
m_Keyboard[p].AddChild( Letter );
Letter->Command( THEME->GetMetricA("ScreenNameEntryTraditional","AlphabetInitCommand") );
Letter->RunCommands( THEME->GetMetricA("ScreenNameEntryTraditional","AlphabetInitCommand") );
m_AlphabetLetter[p].push_back( Chars[ch] );
}
@@ -237,7 +237,7 @@ ScreenNameEntryTraditional::ScreenNameEntryTraditional( CString sClassName ) : S
m_Keyboard[p].AddChild( Letter );
m_AlphabetLetter[p].push_back( CHAR_BACK );
Letter->Command( THEME->GetMetricA("ScreenNameEntryTraditional","OKInitCommand") );
Letter->RunCommands( THEME->GetMetricA("ScreenNameEntryTraditional","OKInitCommand") );
}
/* Add "OK". */
@@ -252,7 +252,7 @@ ScreenNameEntryTraditional::ScreenNameEntryTraditional( CString sClassName ) : S
m_Keyboard[p].AddChild( Letter );
m_AlphabetLetter[p].push_back( CHAR_OK );
Letter->Command( THEME->GetMetricA("ScreenNameEntryTraditional","OKInitCommand") );
Letter->RunCommands( THEME->GetMetricA("ScreenNameEntryTraditional","OKInitCommand") );
}
m_sprCursor[p].SetName( ssprintf("CursorP%i",p+1) );
@@ -442,7 +442,7 @@ void ScreenNameEntryTraditional::PositionCharsAndCursor( int pn )
const bool hidden = ( Pos < First || Pos > Last );
const int ActualPos = clamp( Pos, First-1, Last+1 );
bt->Command( ParseActorCommands("stoptweening;decelerate,.12") );
bt->RunCommands( ParseCommands("stoptweening;decelerate,.12") );
bt->SetX( ActualPos * ALPHABET_GAP_X );
bt->SetDiffuseAlpha( hidden? 0.0f:1.0f );
}
+4 -4
View File
@@ -121,7 +121,7 @@ ScreenOptions::ScreenOptions( CString sClassName ) : ScreenWithMenuElements(sCla
m_bGotAtLeastOneStartPressed[p] = false;
}
m_framePage.Command( FRAME_ON_COMMAND );
m_framePage.RunCommands( FRAME_ON_COMMAND );
}
void ScreenOptions::LoadOptionIcon( PlayerNumber pn, int iRow, CString sText )
@@ -921,7 +921,7 @@ void ScreenOptions::HandleScreenMessage( const ScreenMessage SM )
SCREENMAN->PlayStartSound();
m_framePage.Command( FRAME_OFF_COMMAND );
m_framePage.RunCommands( FRAME_OFF_COMMAND );
break;
case SM_GainFocus:
INPUTFILTER->SetRepeatRate( 0.25f, 12, 0.25f, 12 );
@@ -1099,7 +1099,7 @@ void ScreenOptions::OnChange( PlayerNumber pn )
if( pText->GetText() != text )
{
pText->FinishTweening();
pText->Command( EXPLANATION_ON_COMMAND(pn) );
pText->RunCommands( EXPLANATION_ON_COMMAND(pn) );
pText->SetText( text );
}
break;
@@ -1108,7 +1108,7 @@ void ScreenOptions::OnChange( PlayerNumber pn )
if( pText->GetText() != text )
{
pText->FinishTweening();
pText->Command( EXPLANATION_TOGETHER_ON_COMMAND );
pText->RunCommands( EXPLANATION_TOGETHER_ON_COMMAND );
pText->SetText( text );
}
break;
+10 -10
View File
@@ -58,7 +58,7 @@ void ScreenOptionsMaster::SetList( OptionRowData &row, OptionRowHandler &hand, C
return;
}
hand.Default.Load( -1, ParseActorCommands(ENTRY_DEFAULT(ListName)) );
hand.Default.Load( -1, ParseCommands(ENTRY_DEFAULT(ListName)) );
/* Parse the basic configuration metric. */
CStringArray asParts;
@@ -79,7 +79,7 @@ void ScreenOptionsMaster::SetList( OptionRowData &row, OptionRowHandler &hand, C
for( int col = 0; col < NumCols; ++col )
{
GameCommand mc;
mc.Load( 0, ParseActorCommands(ENTRY_MODE(ListName, col)) );
mc.Load( 0, ParseCommands(ENTRY_MODE(ListName, col)) );
if( mc.m_sName == "" )
RageException::Throw( "List \"%s\", col %i has no name", ListName.c_str(), col );
@@ -247,8 +247,8 @@ ScreenOptionsMaster::ScreenOptionsMaster( CString sClassName ):
CString sRowCommands = LINE(sLineName);
ActorCommands vCommands;
ParseActorCommands( sRowCommands, vCommands );
Commands vCommands;
ParseCommands( sRowCommands, vCommands );
if( vCommands.v.size() < 1 )
RageException::Throw( "Parse error in %s::Line%i", m_sName.c_str(), i+1 );
@@ -256,15 +256,15 @@ ScreenOptionsMaster::ScreenOptionsMaster( CString sClassName ):
OptionRowHandler hand;
for( unsigned part = 0; part < vCommands.v.size(); ++part)
{
ActorCommand& command = vCommands.v[part];
Command& command = vCommands.v[part];
BeginHandleParams;
BeginHandleArgs;
const CString name = sParam(0);
const CString &name = command.GetName();
if( !name.CompareNoCase("list") )
{
SetList( row, hand, sParam(1), row.name );
SetList( row, hand, sArg(1), row.name );
}
else if( !name.CompareNoCase("steps") )
{
@@ -273,7 +273,7 @@ ScreenOptionsMaster::ScreenOptionsMaster( CString sClassName ):
}
else if( !name.CompareNoCase("conf") )
{
SetConf( row, hand, sParam(1), row.name );
SetConf( row, hand, sArg(1), row.name );
}
else if( !name.CompareNoCase("characters") )
{
@@ -283,7 +283,7 @@ ScreenOptionsMaster::ScreenOptionsMaster( CString sClassName ):
else
RageException::Throw( "Unexpected type '%s' in %s::Line%i", name.c_str(), m_sName.c_str(), i );
EndHandleParams;
EndHandleArgs;
}
// TRICKY: Insert a down arrow as the first choice in the row.
+2 -2
View File
@@ -51,7 +51,7 @@ ScreenSelect::ScreenSelect( CString sClassName ) : ScreenWithMenuElements(sClass
GameCommand mc;
mc.m_sName = sChoiceName;
mc.Load( c, ParseActorCommands(sChoice) );
mc.Load( c, ParseCommands(sChoice) );
m_aGameCommands.push_back( mc );
CString sBGAnimationDir = THEME->GetPath(BGAnimations, m_sName, mc.m_sName, true); // true="optional"
@@ -74,7 +74,7 @@ ScreenSelect::ScreenSelect( CString sClassName ) : ScreenWithMenuElements(sClass
m_aCodes.push_back( code );
m_aCodeActions.push_back( CODE_ACTION(c) );
GameCommand mc;
mc.Load( c, ParseActorCommands(CODE_ACTION(c)) );
mc.Load( c, ParseCommands(CODE_ACTION(c)) );
m_aCodeChoices.push_back( mc );
}
+14 -14
View File
@@ -94,15 +94,15 @@ ScreenSelectCharacter::ScreenSelectCharacter( CString sClassName ) : ScreenWithM
m_sprTitle[p].Load( THEME->GetPathToG("ScreenSelectCharacter title 2x2") );
m_sprTitle[p].SetState( GAMESTATE->IsHumanPlayer(p) ? p : 2+p );
m_sprTitle[p].StopAnimating();
m_sprTitle[p].Command( TITLE_ON_COMMAND(p) );
m_sprTitle[p].RunCommands( TITLE_ON_COMMAND(p) );
this->AddChild( &m_sprTitle[p] );
m_sprCard[p].Command( CARD_ON_COMMAND(p) );
m_sprCard[p].RunCommands( CARD_ON_COMMAND(p) );
this->AddChild( &m_sprCard[p] );
m_sprCardArrows[p].Load( THEME->GetPathToG("ScreenSelectCharacter card arrows") );
m_sprCardArrows[p].Command( CARD_ARROWS_ON_COMMAND(p) );
m_sprCardArrows[p].RunCommands( CARD_ARROWS_ON_COMMAND(p) );
this->AddChild( &m_sprCardArrows[p] );
for( unsigned i=0; i<MAX_CHAR_ICONS_TO_SHOW; i++ )
@@ -116,7 +116,7 @@ ScreenSelectCharacter::ScreenSelectCharacter( CString sClassName ) : ScreenWithM
m_sprAttackFrame[p].Load( THEME->GetPathToG("ScreenSelectCharacter attack frame 1x2") );
m_sprAttackFrame[p].StopAnimating();
m_sprAttackFrame[p].SetState( p );
m_sprAttackFrame[p].Command( ATTACK_FRAME_ON_COMMAND(p) );
m_sprAttackFrame[p].RunCommands( ATTACK_FRAME_ON_COMMAND(p) );
this->AddChild( &m_sprAttackFrame[p] );
for( int i=0; i<NUM_ATTACK_LEVELS; i++ )
@@ -125,14 +125,14 @@ ScreenSelectCharacter::ScreenSelectCharacter( CString sClassName ) : ScreenWithM
float fX = ATTACK_ICONS_START_X(p) + ATTACK_ICONS_SPACING_X*j;
float fY = ATTACK_ICONS_START_Y(p) + ATTACK_ICONS_SPACING_Y*i;
m_AttackIcons[p][i][j].SetXY( fX, fY );
m_AttackIcons[p][i][j].Command( ATTACK_ICONS_ON_COMMAND(p) );
m_AttackIcons[p][i][j].RunCommands( ATTACK_ICONS_ON_COMMAND(p) );
this->AddChild( &m_AttackIcons[p][i][j] );
}
}
}
m_sprExplanation.Load( THEME->GetPathToG("ScreenSelectCharacter explanation") );
m_sprExplanation.Command( EXPLANATION_ON_COMMAND );
m_sprExplanation.RunCommands( EXPLANATION_ON_COMMAND );
this->AddChild( &m_sprExplanation );
@@ -151,7 +151,7 @@ ScreenSelectCharacter::ScreenSelectCharacter( CString sClassName ) : ScreenWithM
}
for( unsigned i=0; i<MAX_CHAR_ICONS_TO_SHOW; i++ )
m_sprIcons[p][i].Command( ICONS_ON_COMMAND(p) );
m_sprIcons[p][i].RunCommands( ICONS_ON_COMMAND(p) );
}
TweenOnScreen();
@@ -374,20 +374,20 @@ void ScreenSelectCharacter::TweenOffScreen()
{
FOREACH_PlayerNumber( p )
{
m_sprCard[p].Command( CARD_OFF_COMMAND(p) );
m_sprTitle[p].Command( TITLE_OFF_COMMAND(p) );
m_sprCardArrows[p].Command( CARD_ARROWS_OFF_COMMAND(p) );
m_sprCard[p].RunCommands( CARD_OFF_COMMAND(p) );
m_sprTitle[p].RunCommands( TITLE_OFF_COMMAND(p) );
m_sprCardArrows[p].RunCommands( CARD_ARROWS_OFF_COMMAND(p) );
if(GAMESTATE->m_PlayMode == PLAY_MODE_BATTLE || GAMESTATE->m_PlayMode == PLAY_MODE_RAVE)
{
m_sprAttackFrame[p].Command( ATTACK_FRAME_OFF_COMMAND(p) );
m_sprAttackFrame[p].RunCommands( ATTACK_FRAME_OFF_COMMAND(p) );
for( int i=0; i<NUM_ATTACK_LEVELS; i++ )
for( int j=0; j<NUM_ATTACKS_PER_LEVEL; j++ )
m_AttackIcons[p][i][j].Command( ATTACK_ICONS_OFF_COMMAND(p) );
m_AttackIcons[p][i][j].RunCommands( ATTACK_ICONS_OFF_COMMAND(p) );
}
for( unsigned i=0; i<MAX_CHAR_ICONS_TO_SHOW; i++ )
m_sprIcons[p][i].Command( ICONS_OFF_COMMAND(p) );
m_sprIcons[p][i].RunCommands( ICONS_OFF_COMMAND(p) );
}
m_sprExplanation.Command( EXPLANATION_OFF_COMMAND );
m_sprExplanation.RunCommands( EXPLANATION_OFF_COMMAND );
}
void ScreenSelectCharacter::TweenOnScreen()
+5 -5
View File
@@ -447,8 +447,8 @@ void ScreenSelectDifficulty::MenuStart( PlayerNumber pn )
{
if( BothPlayersGameCommand(m_GameCommands[PAGE_1][c]) )
{
m_sprPicture[PAGE_1][c].Command( IGNORED_ELEMENT_COMMAND );
m_sprInfo[PAGE_1][c].Command( IGNORED_ELEMENT_COMMAND );
m_sprPicture[PAGE_1][c].RunCommands( IGNORED_ELEMENT_COMMAND );
m_sprInfo[PAGE_1][c].RunCommands( IGNORED_ELEMENT_COMMAND );
// IGNORED_ELEMENT_COMMAND
}
@@ -472,10 +472,10 @@ void ScreenSelectDifficulty::MenuStart( PlayerNumber pn )
}
m_sprCursor[pn].Command( CURSOR_CHOOSE_COMMAND );
m_sprCursor[pn].RunCommands( CURSOR_CHOOSE_COMMAND );
m_sprOK[pn].SetXY( m_sprShadow[pn].GetDestX(), m_sprShadow[pn].GetDestY() );
m_sprOK[pn].Command( OK_CHOOSE_COMMAND );
m_sprShadow[pn].Command( SHADOW_CHOOSE_COMMAND );
m_sprOK[pn].RunCommands( OK_CHOOSE_COMMAND );
m_sprShadow[pn].RunCommands( SHADOW_CHOOSE_COMMAND );
// check to see if everyone has chosen
+3 -3
View File
@@ -527,7 +527,7 @@ void ScreenSelectMusic::TweenOnScreen()
}
if( GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2() )
m_textSongOptions.Command( SONG_OPTIONS_EXTRA_COMMAND );
m_textSongOptions.RunCommands( SONG_OPTIONS_EXTRA_COMMAND );
}
void ScreenSelectMusic::TweenOffScreen()
@@ -623,8 +623,8 @@ void ScreenSelectMusic::TweenScoreOnAndOffAfterChangeSort()
{
if( !GAMESTATE->IsHumanPlayer(p) )
continue; // skip
m_textHighScore[p].Command( SCORE_SORT_CHANGE_COMMAND(p) );
m_sprHighScoreFrame[p].Command( SCORE_FRAME_SORT_CHANGE_COMMAND(p) );
m_textHighScore[p].RunCommands( SCORE_SORT_CHANGE_COMMAND(p) );
m_sprHighScoreFrame[p].RunCommands( SCORE_FRAME_SORT_CHANGE_COMMAND(p) );
}
switch( GAMESTATE->m_SortOrder )
+4 -4
View File
@@ -262,8 +262,8 @@ void ScreenSelectStyle::UpdateSelectableChoices()
void ScreenSelectStyle::BeforeChange()
{
// dim/hide old selection
m_sprIcon[m_iSelection].Command( ICON_LOSE_FOCUS_COMMAND );
m_textIcon[m_iSelection].Command( ICON_LOSE_FOCUS_COMMAND );
m_sprIcon[m_iSelection].RunCommands( ICON_LOSE_FOCUS_COMMAND );
m_textIcon[m_iSelection].RunCommands( ICON_LOSE_FOCUS_COMMAND );
m_sprPicture[m_iSelection].StopTweening();
m_sprInfo[m_iSelection].StopTweening();
m_sprPicture[m_iSelection].SetDiffuse( RageColor(1,1,1,0) );
@@ -274,8 +274,8 @@ void ScreenSelectStyle::BeforeChange()
void ScreenSelectStyle::AfterChange()
{
m_sprIcon[m_iSelection].Command( ICON_GAIN_FOCUS_COMMAND );
m_textIcon[m_iSelection].Command( ICON_GAIN_FOCUS_COMMAND );
m_sprIcon[m_iSelection].RunCommands( ICON_GAIN_FOCUS_COMMAND );
m_textIcon[m_iSelection].RunCommands( ICON_GAIN_FOCUS_COMMAND );
m_sprPicture[m_iSelection].SetDiffuse( RageColor(1,1,1,1) );
m_sprInfo[m_iSelection].SetDiffuse( RageColor(1,1,1,1) );
m_sprPicture[m_iSelection].SetZoom( 1 );
+2 -2
View File
@@ -97,8 +97,8 @@ void ScreenSystemLayer::ReloadCreditsText()
void ScreenSystemLayer::SystemMessage( const CString &sMessage )
{
m_textMessage.SetText( sMessage );
static const ActorCommands cmds = ParseActorCommands("finishtweening;diffusealpha,1;addx,-640;linear,0.5;addx,+640;sleep,5;linear,0.5;diffusealpha,0");
m_textMessage.Command( cmds );
static const Commands cmds = ParseCommands("finishtweening;diffusealpha,1;addx,-640;linear,0.5;addx,+640;sleep,5;linear,0.5;diffusealpha,0");
m_textMessage.RunCommands( cmds );
}
void ScreenSystemLayer::SystemMessageNoAnimate( const CString &sMessage )
+6 -6
View File
@@ -78,7 +78,7 @@ ScreenTitleMenu::ScreenTitleMenu( CString sClassName ) : ScreenSelect( sClassNam
m_sprLogo.Load( THEME->GetPathG("ScreenLogo",GAMESTATE->GetCurrentGame()->m_szName) );
m_sprLogo.Command( PREFSMAN->GetCoinMode()==COIN_HOME ? LOGO_HOME_ON_COMMAND : LOGO_ON_COMMAND );
m_sprLogo.RunCommands( PREFSMAN->GetCoinMode()==COIN_HOME ? LOGO_HOME_ON_COMMAND : LOGO_ON_COMMAND );
this->AddChild( &m_sprLogo );
if( PREFSMAN->GetCoinMode() != COIN_HOME )
@@ -97,13 +97,13 @@ ScreenTitleMenu::ScreenTitleMenu( CString sClassName ) : ScreenSelect( sClassNam
}
m_textVersion.LoadFromFont( THEME->GetPathToF("Common normal") );
m_textVersion.Command( VERSION_ON_COMMAND );
m_textVersion.RunCommands( VERSION_ON_COMMAND );
m_textVersion.SetText( PRODUCT_VER );
this->AddChild( &m_textVersion );
m_textSongs.LoadFromFont( THEME->GetPathToF("Common normal") );
m_textSongs.Command( SONGS_ON_COMMAND );
m_textSongs.RunCommands( SONGS_ON_COMMAND );
CString text = ssprintf("%d songs in %d groups, %d courses", SONGMAN->GetNumSongs(), SONGMAN->GetNumGroups(), SONGMAN->GetNumCourses() );
if( PREFSMAN->m_bUseUnlockSystem )
text += ssprintf(", %d unlocks", UNLOCKMAN->GetNumUnlocks() );
@@ -111,7 +111,7 @@ ScreenTitleMenu::ScreenTitleMenu( CString sClassName ) : ScreenSelect( sClassNam
this->AddChild( &m_textSongs );
m_textMaxStages.LoadFromFont( THEME->GetPathF(m_sName,"MaxStages") );
m_textMaxStages.Command( MAX_STAGES_ON_COMMAND );
m_textMaxStages.RunCommands( MAX_STAGES_ON_COMMAND );
CString sText =
PREFSMAN->m_bEventMode ?
CString("event mode") :
@@ -120,7 +120,7 @@ ScreenTitleMenu::ScreenTitleMenu( CString sClassName ) : ScreenSelect( sClassNam
this->AddChild( &m_textMaxStages );
m_textLifeDifficulty.LoadFromFont( THEME->GetPathF(m_sName,"LifeDifficulty") );
m_textLifeDifficulty.Command( LIFE_DIFFICULTY_ON_COMMAND );
m_textLifeDifficulty.RunCommands( LIFE_DIFFICULTY_ON_COMMAND );
int iLifeDifficulty;
const CStringArray dummy;
LifeDifficulty( iLifeDifficulty, true, dummy );
@@ -184,7 +184,7 @@ ScreenTitleMenu::ScreenTitleMenu( CString sClassName ) : ScreenSelect( sClassNam
if( i != m_Choice )
{
m_textChoice[i].SetZoom( ZOOM_NOT_SELECTED );
m_textChoice[i].Command( MENU_ITEM_CREATE );
m_textChoice[i].RunCommands( MENU_ITEM_CREATE );
}
else
GainFocus( m_Choice );
+8 -8
View File
@@ -45,7 +45,7 @@ ScreenUnlock::ScreenUnlock( CString sClassName ) : ScreenAttract( sClassName )
PointsUntilNextUnlock.LoadFromFont( THEME->GetPathToF("Common normal") );
PointsUntilNextUnlock.SetHorizAlign( Actor::align_left );
const ActorCommands IconCommand = ICON_COMMAND;
const Commands IconCommand = ICON_COMMAND;
for( unsigned i=1; i <= NumUnlocks; i++ )
{
// get pertaining UnlockEntry
@@ -72,7 +72,7 @@ ScreenUnlock::ScreenUnlock( CString sClassName ) : ScreenAttract( sClassName )
entry->SetName( ssprintf("Unlock%d",i) );
SET_XY( *entry );
entry->Command(IconCommand);
entry->RunCommands(IconCommand);
Unlocks.push_back(entry);
if ( !pSong->IsLocked() )
@@ -166,12 +166,12 @@ ScreenUnlock::ScreenUnlock( CString sClassName ) : ScreenAttract( sClassName )
LOG->Trace("Target Row: %f", TargetRow);
LOG->Trace("command for icon %d: %s", i, ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;linear,%f;y,%f;linear,0.1;diffusealpha,0", SECS_PER_CYCLE * (i - 1), FirstCycleTime, StopOffPoint, SecondCycleTime * 2, ScrollingTextEndY).c_str() );
CString sCommand = ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;linear,%f;y,%f;linear,0.1;diffusealpha,0", SECS_PER_CYCLE * (i - 1), FirstCycleTime, StopOffPoint, SecondCycleTime, ScrollingTextEndY);
text->Command( ParseActorCommands(sCommand) );
text->RunCommands( ParseCommands(sCommand) );
}
else
{
CString sCommand = ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;linear,0.1;diffusealpha,0", SECS_PER_CYCLE * (i - 1), SECS_PER_CYCLE * (ScrollingTextRows), ScrollingTextEndY);
text->Command( ParseActorCommands(sCommand) );
text->RunCommands( ParseCommands(sCommand) );
}
item.push_back(text);
@@ -198,12 +198,12 @@ ScreenUnlock::ScreenUnlock( CString sClassName ) : ScreenAttract( sClassName )
LOG->Trace("Target Row: %f", TargetRow);
LOG->Trace("command for icon %d: %s", i, ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;linear,%f;y,%f;linear,0.1;diffusealpha,0", SECS_PER_CYCLE * (i - 1), FirstCycleTime, StopOffPoint, SecondCycleTime * 2, ScrollingTextEndY).c_str() );
CString sCommand = ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;linear,%f;y,%f;linear,0.1;diffusealpha,0", SECS_PER_CYCLE * (i - 1), FirstCycleTime, StopOffPoint, SecondCycleTime, ScrollingTextEndY);
IconCount->Command( ParseActorCommands(sCommand) );
IconCount->RunCommands( ParseCommands(sCommand) );
}
else
{
CString sCommand = ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;linear,0.1;diffusealpha,0", SECS_PER_CYCLE * (i - 1), SECS_PER_CYCLE * (ScrollingTextRows), ScrollingTextEndY);
IconCount->Command( ParseActorCommands(sCommand) );
IconCount->RunCommands( ParseCommands(sCommand) );
}
ItemIcons.push_back(IconCount);
@@ -269,7 +269,7 @@ ScreenUnlock::ScreenUnlock( CString sClassName ) : ScreenAttract( sClassName )
NewText->SetXY(ScrollingTextX, ScrollingTextStartY);
{
CString sCommand = ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;", SECS_PER_CYCLE * (NumUnlocks + 2 * i - 2), SECS_PER_CYCLE * ((ScrollingTextRows - i) * 2 + 1 ), (ScrollingTextStartY + (ScrollingTextEndY - ScrollingTextStartY) * (ScrollingTextRows - i + 0.5) / ScrollingTextRows ));
NewText->Command( ParseActorCommands(sCommand) );
NewText->RunCommands( ParseCommands(sCommand) );
}
// new unlock graphic
@@ -280,7 +280,7 @@ ScreenUnlock::ScreenUnlock( CString sClassName ) : ScreenAttract( sClassName )
NewIcon->SetWidth(UNLOCK_TEXT_SCROLL_ICON_SIZE);
{
CString sCommand = ssprintf("diffusealpha,0;sleep,%f;diffusealpha,1;linear,%f;y,%f;", SECS_PER_CYCLE * (NumUnlocks + 2 * i - 2), SECS_PER_CYCLE * ((ScrollingTextRows - i) * 2 + 1 ), (ScrollingTextStartY + (ScrollingTextEndY - ScrollingTextStartY) * (ScrollingTextRows - i + 0.5) / ScrollingTextRows ));
NewIcon->Command( ParseActorCommands(sCommand) );
NewIcon->RunCommands( ParseCommands(sCommand) );
}
ItemIcons.push_back(NewIcon);
+11 -11
View File
@@ -888,33 +888,33 @@ void Sprite::StretchTexCoords( float fX, float fY )
SetCustomTextureCoords( fTexCoords );
}
void Sprite::HandleCommand( const ActorCommand &command )
void Sprite::HandleCommand( const Command &command )
{
BeginHandleParams;
BeginHandleArgs;
const CString& sName = sParam(0);
const CString& sName = command.GetName();
// Commands that go in the tweening queue:
// Commands that take effect immediately (ignoring the tweening queue):
if( sName=="customtexturerect" ) SetCustomTextureRect( RectF(fParam(1),fParam(2),fParam(3),fParam(4)) );
else if( sName=="texcoordvelocity" ) SetTexCoordVelocity( fParam(1),fParam(2) );
else if( sName=="scaletoclipped" ) ScaleToClipped( fParam(1),fParam(2) );
else if( sName=="stretchtexcoords" ) StretchTexCoords( fParam(1),fParam(2) );
if( sName=="customtexturerect" ) SetCustomTextureRect( RectF(fArg(1),fArg(2),fArg(3),fArg(4)) );
else if( sName=="texcoordvelocity" ) SetTexCoordVelocity( fArg(1),fArg(2) );
else if( sName=="scaletoclipped" ) ScaleToClipped( fArg(1),fArg(2) );
else if( sName=="stretchtexcoords" ) StretchTexCoords( fArg(1),fArg(2) );
/* Texture commands; these could be moved to RageTexture* (even though that's
* not an Actor) if these are needed for other things that use textures.
* We'd need to break the command helpers into a separate function; RageTexture
* shouldn't depend on Actor. */
else if( sName=="position" ) GetTexture()->SetPosition( fParam(1) );
else if( sName=="loop" ) GetTexture()->SetLooping( bParam(1) );
else if( sName=="rate" ) GetTexture()->SetPlaybackRate( fParam(1) );
else if( sName=="position" ) GetTexture()->SetPosition( fArg(1) );
else if( sName=="loop" ) GetTexture()->SetLooping( bArg(1) );
else if( sName=="rate" ) GetTexture()->SetPlaybackRate( fArg(1) );
else
{
Actor::HandleCommand( command );
return;
}
EndHandleParams;
EndHandleArgs;
}
/*
+1 -1
View File
@@ -60,7 +60,7 @@ public:
void ScaleToClipped( float fWidth, float fHeight );
static bool IsDiagonalBanner( int iWidth, int iHeight );
virtual void HandleCommand( const ActorCommand &command );
virtual void HandleCommand( const Command &command );
protected:
virtual bool LoadFromTexture( RageTextureID ID );
+10 -2
View File
@@ -62,7 +62,7 @@ IntDir=.\../Debug6
TargetDir=\stepmania\stepmania\Program
TargetName=StepMania-debug
SOURCE="$(InputPath)"
PreLink_Cmds=archutils\Win32\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
PreLink_Cmds=archutils\Win32\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
PostBuild_Cmds=archutils\Win32\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi
# End Special Build Tool
@@ -99,7 +99,7 @@ IntDir=.\../Release6
TargetDir=\stepmania\stepmania\Program
TargetName=StepMania
SOURCE="$(InputPath)"
PreLink_Cmds=archutils\Win32\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
PreLink_Cmds=archutils\Win32\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
PostBuild_Cmds=archutils\Win32\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi
# End Special Build Tool
@@ -664,6 +664,14 @@ SOURCE=.\CodeDetector.h
# End Source File
# Begin Source File
SOURCE=.\Command.cpp
# End Source File
# Begin Source File
SOURCE=.\Command.h
# End Source File
# Begin Source File
SOURCE=.\Course.cpp
# End Source File
# Begin Source File
+6 -6
View File
@@ -629,6 +629,12 @@ cl /Zl /nologo /c verstub.cpp /Fo&quot;$(IntDir)&quot;\
<File
RelativePath="CodeDetector.h">
</File>
<File
RelativePath="Command.cpp">
</File>
<File
RelativePath="Command.h">
</File>
<File
RelativePath="Course.cpp">
</File>
@@ -2216,12 +2222,6 @@ cl /Zl /nologo /c verstub.cpp /Fo&quot;$(IntDir)&quot;\
<File
RelativePath="ActorCollision.h">
</File>
<File
RelativePath="ActorCommands.cpp">
</File>
<File
RelativePath="ActorCommands.h">
</File>
<File
RelativePath=".\ActorFrame.cpp">
</File>
+12 -12
View File
@@ -10,12 +10,12 @@
#include "ThemeMetric.h"
ThemeMetric<CString> ARTIST_PREPEND_STRING ("TextBanner","ArtistPrependString");
ThemeMetric<ActorCommands> TWO_LINES_TITLE_COMMAND ("TextBanner","TwoLinesTitleCommand");
ThemeMetric<ActorCommands> TWO_LINES_SUBTITLE_COMMAND ("TextBanner","TwoLinesSubtitleCommand");
ThemeMetric<ActorCommands> TWO_LINES_ARTIST_COMMAND ("TextBanner","TwoLinesArtistCommand");
ThemeMetric<ActorCommands> THREE_LINES_TITLE_COMMAND ("TextBanner","ThreeLinesTitleCommand");
ThemeMetric<ActorCommands> THREE_LINES_SUBTITLE_COMMAND ("TextBanner","ThreeLinesSubtitleCommand");
ThemeMetric<ActorCommands> THREE_LINES_ARTIST_COMMAND ("TextBanner","ThreeLinesArtistCommand");
ThemeMetric<Commands> TWO_LINES_TITLE_COMMAND ("TextBanner","TwoLinesTitleCommand");
ThemeMetric<Commands> TWO_LINES_SUBTITLE_COMMAND ("TextBanner","TwoLinesSubtitleCommand");
ThemeMetric<Commands> TWO_LINES_ARTIST_COMMAND ("TextBanner","TwoLinesArtistCommand");
ThemeMetric<Commands> THREE_LINES_TITLE_COMMAND ("TextBanner","ThreeLinesTitleCommand");
ThemeMetric<Commands> THREE_LINES_SUBTITLE_COMMAND ("TextBanner","ThreeLinesSubtitleCommand");
ThemeMetric<Commands> THREE_LINES_ARTIST_COMMAND ("TextBanner","ThreeLinesArtistCommand");
void TextBanner::Init()
{
@@ -58,15 +58,15 @@ void TextBanner::LoadFromString(
if( bTwoLines )
{
m_textTitle.Command( TWO_LINES_TITLE_COMMAND );
m_textSubTitle.Command( TWO_LINES_SUBTITLE_COMMAND );
m_textArtist.Command( TWO_LINES_ARTIST_COMMAND );
m_textTitle.RunCommands( TWO_LINES_TITLE_COMMAND );
m_textSubTitle.RunCommands( TWO_LINES_SUBTITLE_COMMAND );
m_textArtist.RunCommands( TWO_LINES_ARTIST_COMMAND );
}
else
{
m_textTitle.Command( THREE_LINES_TITLE_COMMAND );
m_textSubTitle.Command( THREE_LINES_SUBTITLE_COMMAND );
m_textArtist.Command( THREE_LINES_ARTIST_COMMAND );
m_textTitle.RunCommands( THREE_LINES_TITLE_COMMAND );
m_textSubTitle.RunCommands( THREE_LINES_SUBTITLE_COMMAND );
m_textArtist.RunCommands( THREE_LINES_ARTIST_COMMAND );
}
m_textTitle.SetText( sDisplayTitle, sTranslitTitle );
+3 -3
View File
@@ -703,9 +703,9 @@ RageColor ThemeManager::GetMetricC( const CString &sClassName, const CString &sV
return ret;
}
ActorCommands ThemeManager::GetMetricA( const CString &sClassName, const CString &sValueName )
Commands ThemeManager::GetMetricA( const CString &sClassName, const CString &sValueName )
{
return ParseActorCommands( GetMetricRaw(sClassName,sValueName) );
return ParseCommands( GetMetricRaw(sClassName,sValueName) );
}
void ThemeManager::NextTheme()
@@ -765,7 +765,7 @@ void ThemeManager::GetModifierNames( set<CString>& AddTo )
}
}
void ThemeManager::GetMetric( const CString &sClassName, const CString &sValueName, ActorCommands &valueOut )
void ThemeManager::GetMetric( const CString &sClassName, const CString &sValueName, Commands &valueOut )
{
valueOut = GetMetricA( sClassName, sValueName );
}
+3 -3
View File
@@ -10,7 +10,7 @@
class IThemeMetric;
class IniFile;
struct ActorCommands;
class Commands;
enum ElementCategory { BGAnimations, Fonts, Graphics, Numbers, Sounds, Other, NUM_ELEMENT_CATEGORIES };
@@ -59,14 +59,14 @@ public:
float GetMetricF( const CString &sClassName, const CString &sValueName );
bool GetMetricB( const CString &sClassName, const CString &sValueName );
RageColor GetMetricC( const CString &sClassName, const CString &sValueName );
ActorCommands GetMetricA( const CString &sClassName, const CString &sValueName );
Commands GetMetricA( const CString &sClassName, const CString &sValueName );
void GetMetric( const CString &sClassName, const CString &sValueName, CString &valueOut ) { valueOut = GetMetric( sClassName, sValueName ); }
void GetMetric( const CString &sClassName, const CString &sValueName, int &valueOut ) { valueOut = GetMetricI( sClassName, sValueName ); }
void GetMetric( const CString &sClassName, const CString &sValueName, float &valueOut ) { valueOut = GetMetricF( sClassName, sValueName ); }
void GetMetric( const CString &sClassName, const CString &sValueName, bool &valueOut ) { valueOut = GetMetricB( sClassName, sValueName ); }
void GetMetric( const CString &sClassName, const CString &sValueName, RageColor &valueOut ) { valueOut = GetMetricC( sClassName, sValueName ); }
void GetMetric( const CString &sClassName, const CString &sValueName, ActorCommands &valueOut );
void GetMetric( const CString &sClassName, const CString &sValueName, Commands &valueOut );
//
// For self-registering metrics