Remove CommandRepeatSeconds. Instead, do:
OnCommand=x;y;z;queuecommand,playcommand,On
This commit is contained in:
@@ -53,8 +53,6 @@ void BGAnimationLayer::Init()
|
|||||||
{
|
{
|
||||||
Unload();
|
Unload();
|
||||||
|
|
||||||
m_fRepeatCommandEverySeconds = -1;
|
|
||||||
m_fSecondsUntilNextCommand = 0;
|
|
||||||
m_fUpdateRate = 1;
|
m_fUpdateRate = 1;
|
||||||
m_fFOV = -1; // no change
|
m_fFOV = -1; // no change
|
||||||
m_bLighting = false;
|
m_bLighting = false;
|
||||||
@@ -418,8 +416,6 @@ void BGAnimationLayer::LoadFromNode( const CString& sAniDir_, const XNode& layer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
layer.GetAttrValue( "CommandRepeatSeconds", m_fRepeatCommandEverySeconds );
|
|
||||||
m_fSecondsUntilNextCommand = m_fRepeatCommandEverySeconds;
|
|
||||||
layer.GetAttrValue( "FOV", m_fFOV );
|
layer.GetAttrValue( "FOV", m_fFOV );
|
||||||
layer.GetAttrValue( "Lighting", m_bLighting );
|
layer.GetAttrValue( "Lighting", m_bLighting );
|
||||||
layer.GetAttrValue( "TexCoordVelocityX", m_fTexCoordVelocityX );
|
layer.GetAttrValue( "TexCoordVelocityX", m_fTexCoordVelocityX );
|
||||||
@@ -659,19 +655,6 @@ void BGAnimationLayer::Update( float fDeltaTime )
|
|||||||
default:
|
default:
|
||||||
ASSERT(0);
|
ASSERT(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if( m_fRepeatCommandEverySeconds != -1 ) // if repeating
|
|
||||||
{
|
|
||||||
m_fSecondsUntilNextCommand -= fDeltaTime;
|
|
||||||
if( m_fSecondsUntilNextCommand <= 0 )
|
|
||||||
{
|
|
||||||
PlayCommand( "On" );
|
|
||||||
m_fSecondsUntilNextCommand += m_fRepeatCommandEverySeconds;
|
|
||||||
|
|
||||||
/* In case we delayed a long time, don't queue two repeats at once. */
|
|
||||||
wrap( m_fSecondsUntilNextCommand, m_fRepeatCommandEverySeconds );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BGAnimationLayer::EarlyAbortDraw()
|
bool BGAnimationLayer::EarlyAbortDraw()
|
||||||
@@ -722,17 +705,6 @@ void BGAnimationLayer::GainFocus( float fRate, bool bRewindMovie, bool bLoop )
|
|||||||
{
|
{
|
||||||
m_fUpdateRate = fRate;
|
m_fUpdateRate = fRate;
|
||||||
|
|
||||||
if( m_fRepeatCommandEverySeconds == -1 ) // if not repeating
|
|
||||||
{
|
|
||||||
/* Yuck. We send OnCommand on load, since that's what's wanted for
|
|
||||||
* most backgrounds. However, gameplay backgrounds (loaded from Background)
|
|
||||||
* 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( ParseCommands("stoptweening") );
|
|
||||||
PlayCommand( "On" );
|
|
||||||
}
|
|
||||||
|
|
||||||
ActorFrame::GainFocus( fRate, bRewindMovie, bLoop );
|
ActorFrame::GainFocus( fRate, bRewindMovie, bLoop );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -76,8 +76,6 @@ protected:
|
|||||||
|
|
||||||
// common stuff
|
// common stuff
|
||||||
bool m_bGeneric;
|
bool m_bGeneric;
|
||||||
float m_fRepeatCommandEverySeconds; // -1 = no repeat
|
|
||||||
float m_fSecondsUntilNextCommand;
|
|
||||||
float m_fUpdateRate; // set by GainFocus
|
float m_fUpdateRate; // set by GainFocus
|
||||||
float m_fFOV; // -1 = no change
|
float m_fFOV; // -1 = no change
|
||||||
bool m_bLighting;
|
bool m_bLighting;
|
||||||
|
|||||||
Reference in New Issue
Block a user