combine .actor and BGALayer loading

make BGAniLayer derive from ActorFrame
This commit is contained in:
Chris Danford
2004-01-25 22:22:40 +00:00
parent e829a93f8d
commit 88cca70487
8 changed files with 236 additions and 230 deletions
+21
View File
@@ -122,6 +122,27 @@ void BGAnimation::LoadFromAniDir( CString sAniDir )
m_fLengthSeconds = max(m_fLengthSeconds, m_Layers[i]->GetMaxTweenTimeLeft());
}
bool bUseScroller;
if( ini.GetValue( "BGAnimation", "UseScroller", bUseScroller ) && bUseScroller )
{
#define REQUIRED_GET_VALUE( szName, valueOut ) \
if( !ini.GetValue( "BGAnimation", szName, valueOut ) ) \
RageException::Throw( "File '%s' is missing the value BGAnimation::%s", sPathToIni.c_str(), szName );
float fScrollSecondsPerItem, fSpacingX, fSpacingY;
REQUIRED_GET_VALUE( "ScrollSecondsPerItem", fScrollSecondsPerItem );
REQUIRED_GET_VALUE( "ScrollSpacingX", fSpacingX );
REQUIRED_GET_VALUE( "ScrollSpacingY", fSpacingY );
#undef REQUIRED_GET_VALUE
m_Scroller.Load( fScrollSecondsPerItem, fSpacingX, fSpacingY );
for( unsigned i=0; i<m_Layers.size(); i++ )
m_Scroller.AddChild( m_Layers[i] );
m_Scroller.SetCurrentAndDestinationItem( 0 );
m_Scroller.SetDestinationItem( m_Layers.size()-1 );
this->AddChild( &m_Scroller );
}
CString InitCommand;
if( ini.GetValue( "BGAnimation", "InitCommand", InitCommand ) )
{