eliminate LoadFromStaticGraphic
This commit is contained in:
@@ -29,15 +29,6 @@ void BGAnimation::Unload()
|
||||
DeleteAllChildren();
|
||||
}
|
||||
|
||||
void BGAnimation::LoadFromStaticGraphic( const CString &sPath )
|
||||
{
|
||||
Unload();
|
||||
|
||||
BGAnimationLayer* pLayer = new BGAnimationLayer( m_bGeneric );
|
||||
pLayer->LoadFromStaticGraphic( sPath );
|
||||
AddChild( pLayer );
|
||||
}
|
||||
|
||||
static bool CompareLayerNames( const CString& s1, const CString& s2 )
|
||||
{
|
||||
int i1, i2;
|
||||
|
||||
@@ -17,7 +17,6 @@ public:
|
||||
|
||||
void Unload();
|
||||
|
||||
void LoadFromStaticGraphic( const CString &sPath );
|
||||
void LoadFromAniDir( const CString &sAniDir );
|
||||
void LoadFromNode( const CString &sDir, const XNode& node );
|
||||
|
||||
|
||||
@@ -86,18 +86,6 @@ void BGAnimationLayer::Init()
|
||||
m_fTileVelocityY = 0;
|
||||
}
|
||||
|
||||
/* Static background layers are simple, uncomposited background images with nothing
|
||||
* behind them. Since they have nothing behind them, they have no need for alpha,
|
||||
* so turn that off. */
|
||||
void BGAnimationLayer::LoadFromStaticGraphic( const CString& sPath )
|
||||
{
|
||||
Init();
|
||||
Sprite* pSprite = new Sprite;
|
||||
pSprite->LoadBG( sPath );
|
||||
pSprite->StretchTo( FullScreenRectF );
|
||||
this->AddChild( pSprite );
|
||||
}
|
||||
|
||||
void BGAnimationLayer::LoadFromAniLayerFile( const CString& sPath )
|
||||
{
|
||||
/* Generic BGAs are new. Animation directories with no INI are old and obsolete.
|
||||
@@ -116,7 +104,11 @@ void BGAnimationLayer::LoadFromAniLayerFile( const CString& sPath )
|
||||
else
|
||||
sSongBGPath = THEME->GetPathToG("Common fallback background");
|
||||
|
||||
LoadFromStaticGraphic( sSongBGPath );
|
||||
Sprite* pSprite = new Sprite;
|
||||
pSprite->LoadBG( sSongBGPath );
|
||||
pSprite->StretchTo( FullScreenRectF );
|
||||
this->AddChild( pSprite );
|
||||
|
||||
return; // this will ignore other effects in the file name
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@ public:
|
||||
void Init();
|
||||
void Unload();
|
||||
|
||||
void LoadFromStaticGraphic( const CString& sPath );
|
||||
void LoadFromAniLayerFile( const CString& sPath );
|
||||
void LoadFromNode( const CString& sAniDir, const XNode& layer );
|
||||
|
||||
|
||||
@@ -166,7 +166,6 @@ Actor *Background::CreateSongBGA( CString sBGName ) const
|
||||
GetDirListing( m_pSong->GetSongDir()+sBGName, asFiles, false, true );
|
||||
if( !asFiles.empty() )
|
||||
{
|
||||
pTempBGA = new BGAnimation;
|
||||
const CString sExt = GetExtension( asFiles[0]) ;
|
||||
if( sExt.CompareNoCase("avi")==0 ||
|
||||
sExt.CompareNoCase("mpg")==0 ||
|
||||
@@ -174,9 +173,10 @@ Actor *Background::CreateSongBGA( CString sBGName ) const
|
||||
return MakeMovie( asFiles[0] );
|
||||
else
|
||||
{
|
||||
pTempBGA = new BGAnimation;
|
||||
pTempBGA->LoadFromStaticGraphic( asFiles[0] );
|
||||
return pTempBGA;
|
||||
Sprite *pSprite = new Sprite;
|
||||
pSprite->LoadBG( asFiles[0] );
|
||||
pSprite->StretchTo( FullScreenRectF );
|
||||
return pSprite;
|
||||
}
|
||||
}
|
||||
// Look for movies in the RandomMovies dir
|
||||
@@ -400,10 +400,10 @@ void Background::LoadFromSong( const Song* pSong )
|
||||
if( bStaticBackgroundUsed )
|
||||
{
|
||||
CString sSongBGPath = pSong->HasBackground() ? pSong->GetBackgroundPath() : THEME->GetPathToG("Common fallback background");
|
||||
BGAnimation *pTempBGA = new BGAnimation;
|
||||
pTempBGA->LoadFromStaticGraphic( sSongBGPath );
|
||||
pTempBGA->PlayCommand( "On" );
|
||||
m_BGAnimations[STATIC_BACKGROUND] = pTempBGA;
|
||||
Sprite* pSprite = new Sprite;
|
||||
pSprite->LoadBG( sSongBGPath );
|
||||
pSprite->StretchTo( FullScreenRectF );
|
||||
m_BGAnimations[STATIC_BACKGROUND] = pSprite;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user