Eliminate BGAnimation::LoadFromMovie and BGAnimationLayer::LoadFromMovie.

This commit is contained in:
Glenn Maynard
2005-01-15 20:37:46 +00:00
parent 66d39dd65c
commit 594587607c
5 changed files with 16 additions and 36 deletions
-9
View File
@@ -178,15 +178,6 @@ void BGAnimation::LoadFromAniDir( const CString &_sAniDir )
} }
} }
void BGAnimation::LoadFromMovie( const CString &sMoviePath )
{
Unload();
BGAnimationLayer* pLayer = new BGAnimationLayer( m_bGeneric );
pLayer->LoadFromMovie( sMoviePath );
AddChild( pLayer );
}
void BGAnimation::LoadFromNode( const CString &sDir, const XNode& node ) void BGAnimation::LoadFromNode( const CString &sDir, const XNode& node )
{ {
DEBUG_ASSERT( node.m_sName == "BGAnimation" ); DEBUG_ASSERT( node.m_sName == "BGAnimation" );
-1
View File
@@ -19,7 +19,6 @@ public:
void LoadFromStaticGraphic( const CString &sPath ); void LoadFromStaticGraphic( const CString &sPath );
void LoadFromAniDir( const CString &sAniDir ); void LoadFromAniDir( const CString &sAniDir );
void LoadFromMovie( const CString &sMoviePath );
void LoadFromNode( const CString &sDir, const XNode& node ); void LoadFromNode( const CString &sDir, const XNode& node );
protected: protected:
-11
View File
@@ -98,17 +98,6 @@ void BGAnimationLayer::LoadFromStaticGraphic( const CString& sPath )
this->AddChild( pSprite ); this->AddChild( pSprite );
} }
void BGAnimationLayer::LoadFromMovie( const CString& sMoviePath )
{
Init();
Sprite* pSprite = new Sprite;
pSprite->LoadBG( sMoviePath );
pSprite->StretchTo( FullScreenRectF );
pSprite->EnableAnimation( false );
this->AddChild( pSprite );
}
void BGAnimationLayer::LoadFromAniLayerFile( const CString& sPath ) void BGAnimationLayer::LoadFromAniLayerFile( const CString& sPath )
{ {
/* Generic BGAs are new. Animation directories with no INI are old and obsolete. /* Generic BGAs are new. Animation directories with no INI are old and obsolete.
-1
View File
@@ -19,7 +19,6 @@ public:
void LoadFromStaticGraphic( const CString& sPath ); void LoadFromStaticGraphic( const CString& sPath );
void LoadFromAniLayerFile( const CString& sPath ); void LoadFromAniLayerFile( const CString& sPath );
void LoadFromMovie( const CString& sMoviePath );
void LoadFromNode( const CString& sAniDir, const XNode& layer ); void LoadFromNode( const CString& sAniDir, const XNode& layer );
void Update( float fDeltaTime ); void Update( float fDeltaTime );
+16 -14
View File
@@ -136,6 +136,15 @@ Actor *MakeVisualization( const CString &sVisPath )
return pFrame; return pFrame;
} }
Actor *MakeMovie( const CString &sMoviePath )
{
Sprite *pSprite = new Sprite;
pSprite->LoadBG( sMoviePath );
pSprite->StretchTo( FullScreenRectF );
pSprite->EnableAnimation( false );
return pSprite;
}
Actor *Background::CreateSongBGA( CString sBGName ) const Actor *Background::CreateSongBGA( CString sBGName ) const
{ {
BGAnimation *pTempBGA; BGAnimation *pTempBGA;
@@ -162,19 +171,18 @@ Actor *Background::CreateSongBGA( CString sBGName ) const
if( sExt.CompareNoCase("avi")==0 || if( sExt.CompareNoCase("avi")==0 ||
sExt.CompareNoCase("mpg")==0 || sExt.CompareNoCase("mpg")==0 ||
sExt.CompareNoCase("mpeg")==0 ) sExt.CompareNoCase("mpeg")==0 )
pTempBGA->LoadFromMovie( asFiles[0] ); return MakeMovie( asFiles[0] );
else else
{
pTempBGA = new BGAnimation;
pTempBGA->LoadFromStaticGraphic( asFiles[0] ); pTempBGA->LoadFromStaticGraphic( asFiles[0] );
return pTempBGA; return pTempBGA;
}
} }
// Look for movies in the RandomMovies dir // Look for movies in the RandomMovies dir
GetDirListing( RANDOMMOVIES_DIR+sBGName, asFiles, false, true ); GetDirListing( RANDOMMOVIES_DIR+sBGName, asFiles, false, true );
if( !asFiles.empty() ) if( !asFiles.empty() )
{ return MakeMovie( asFiles[0] );
pTempBGA = new BGAnimation;
pTempBGA->LoadFromMovie( asFiles[0] );
return pTempBGA;
}
// Look for BGAnims in the BGAnims dir // Look for BGAnims in the BGAnims dir
GetDirListing( BG_ANIMS_DIR+sBGName, asFiles, true, true ); GetDirListing( BG_ANIMS_DIR+sBGName, asFiles, true, true );
@@ -272,13 +280,7 @@ CString Background::CreateRandomBGA()
break; break;
} }
case PrefsManager::BGMODE_MOVIEVIS: ret = MakeVisualization( file ); break; case PrefsManager::BGMODE_MOVIEVIS: ret = MakeVisualization( file ); break;
case PrefsManager::BGMODE_RANDOMMOVIES: case PrefsManager::BGMODE_RANDOMMOVIES: ret = MakeMovie( file ); break;
{
BGAnimation *p = new BGAnimation;
p->LoadFromMovie( file );
ret = p;
break;
}
default: FAIL_M( ssprintf("%i", PREFSMAN->m_iBackgroundMode) ); default: FAIL_M( ssprintf("%i", PREFSMAN->m_iBackgroundMode) );
} }
ret->PlayCommand( "On" ); ret->PlayCommand( "On" );