move m_sCommandName from TS to TI. Cleaner, and fixes queued commands being wiped

out by LuaExpressionTransform.
This commit is contained in:
Glenn Maynard
2005-10-14 01:46:00 +00:00
parent 1ab9ace450
commit 64504718d1
2 changed files with 9 additions and 14 deletions
+8 -13
View File
@@ -595,12 +595,12 @@ void Actor::UpdateTweening( float fDeltaTime )
m_start = m_current; // set the start position
// Execute the command in this tween (if any).
if( TS.sCommandName.size() )
if( !TI.m_sCommandName.empty() )
{
if( TS.sCommandName.Left(1) == "!" )
MESSAGEMAN->Broadcast( TS.sCommandName.substr(1) );
if( TI.m_sCommandName.Left(1) == "!" )
MESSAGEMAN->Broadcast( TI.m_sCommandName.substr(1) );
else
this->PlayCommand( TS.sCommandName );
this->PlayCommand( TI.m_sCommandName );
}
}
@@ -612,10 +612,6 @@ void Actor::UpdateTweening( float fDeltaTime )
{
m_current = TS;
// don't inherit the queued state's command. We keep having to do this.
// Does sCommandName belong in TweenInfo, instead of TweenState?
m_current.sCommandName = "";
// delete the head tween
delete m_Tweens.front();
m_Tweens.erase( m_Tweens.begin() );
@@ -764,9 +760,6 @@ void Actor::BeginTweening( float time, TweenType tt )
{
// initialize the new TS from the last TS in the list
TS = m_Tweens[m_Tweens.size()-2]->state;
// don't inherit the queued state's command
TS.sCommandName = "";
}
else
{
@@ -1239,7 +1232,8 @@ void Actor::Sleep( float time )
void Actor::QueueCommand( const CString& sCommandName )
{
BeginTweening( 0, TWEEN_LINEAR );
DestTweenState().sCommandName = sCommandName;
TweenInfo &TI = m_Tweens.back()->info;
TI.m_sCommandName = sCommandName;
}
void Actor::QueueMessage( const CString& sMessageName )
@@ -1248,7 +1242,8 @@ void Actor::QueueMessage( const CString& sMessageName )
// command, so we don't have to add yet another element to every tween
// state for this rarely-used command.
BeginTweening( 0, TWEEN_LINEAR );
DestTweenState().sCommandName = "!" + sMessageName;
TweenInfo &TI = m_Tweens.back()->info;
TI.m_sCommandName = "!" + sMessageName;
}
void Actor::AddCommand( const CString &sCmdName, apActorCommands apac )
+1 -1
View File
@@ -72,7 +72,6 @@ public:
RageColor diffuse[4];
RageColor glow;
float aux;
CString sCommandName; // command to execute when this TweenState goes into effect
};
enum EffectClock
@@ -382,6 +381,7 @@ protected:
TweenType m_TweenType;
float m_fTimeLeftInTween; // how far into the tween are we?
float m_fTweenTime; // seconds between Start and End positions/zooms
CString m_sCommandName; // command to execute when this TweenState goes into effect
};