Remove BGAnimation::GetLengthSeconds; use GetTweenTimeLeft instead.

This commit is contained in:
Glenn Maynard
2005-01-15 18:31:14 +00:00
parent 8cd0d9e04c
commit 78800818e3
8 changed files with 18 additions and 17 deletions
+8 -6
View File
@@ -17,7 +17,6 @@ BGAnimation::BGAnimation( bool Generic )
{
/* See BGAnimationLayer::BGAnimationLayer for explanation. */
m_bGeneric = Generic;
m_fLengthSeconds = 10;
}
BGAnimation::~BGAnimation()
@@ -242,12 +241,15 @@ void BGAnimation::LoadFromNode( const CString &sDir, const XNode& node )
if( !m_bGeneric )
PlayCommand( "On" );
if( !node.GetAttrValue( "LengthSeconds", m_fLengthSeconds ) )
/* Backwards-compatibility: if a "LengthSeconds" value is present, create a dummy
* actor that sleeps for the given length of time. This will extend GetTweenTimeLeft. */
float fLengthSeconds = 0;
if( node.GetAttrValue( "LengthSeconds", fLengthSeconds ) )
{
/* XXX: if m_bGeneric, simply constructing the BG layer won't run "On",
* so at this point GetMaxTweenTimeLeft is probably 0 */
m_fLengthSeconds = this->GetTweenTimeLeft();
Actor *pActor = new Actor;
pActor->SetHidden( true );
pActor->BeginTweening( fLengthSeconds );
AddChild( pActor );
}
}