eliminate LoadFromStaticGraphic
This commit is contained in:
@@ -29,15 +29,6 @@ void BGAnimation::Unload()
|
|||||||
DeleteAllChildren();
|
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 )
|
static bool CompareLayerNames( const CString& s1, const CString& s2 )
|
||||||
{
|
{
|
||||||
int i1, i2;
|
int i1, i2;
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ public:
|
|||||||
|
|
||||||
void Unload();
|
void Unload();
|
||||||
|
|
||||||
void LoadFromStaticGraphic( const CString &sPath );
|
|
||||||
void LoadFromAniDir( const CString &sAniDir );
|
void LoadFromAniDir( const CString &sAniDir );
|
||||||
void LoadFromNode( const CString &sDir, const XNode& node );
|
void LoadFromNode( const CString &sDir, const XNode& node );
|
||||||
|
|
||||||
|
|||||||
@@ -86,18 +86,6 @@ void BGAnimationLayer::Init()
|
|||||||
m_fTileVelocityY = 0;
|
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 )
|
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.
|
||||||
@@ -116,7 +104,11 @@ void BGAnimationLayer::LoadFromAniLayerFile( const CString& sPath )
|
|||||||
else
|
else
|
||||||
sSongBGPath = THEME->GetPathToG("Common fallback background");
|
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
|
return; // this will ignore other effects in the file name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ public:
|
|||||||
void Init();
|
void Init();
|
||||||
void Unload();
|
void Unload();
|
||||||
|
|
||||||
void LoadFromStaticGraphic( const CString& sPath );
|
|
||||||
void LoadFromAniLayerFile( const CString& sPath );
|
void LoadFromAniLayerFile( const CString& sPath );
|
||||||
void LoadFromNode( const CString& sAniDir, const XNode& layer );
|
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 );
|
GetDirListing( m_pSong->GetSongDir()+sBGName, asFiles, false, true );
|
||||||
if( !asFiles.empty() )
|
if( !asFiles.empty() )
|
||||||
{
|
{
|
||||||
pTempBGA = new BGAnimation;
|
|
||||||
const CString sExt = GetExtension( asFiles[0]) ;
|
const CString sExt = GetExtension( asFiles[0]) ;
|
||||||
if( sExt.CompareNoCase("avi")==0 ||
|
if( sExt.CompareNoCase("avi")==0 ||
|
||||||
sExt.CompareNoCase("mpg")==0 ||
|
sExt.CompareNoCase("mpg")==0 ||
|
||||||
@@ -174,9 +173,10 @@ Actor *Background::CreateSongBGA( CString sBGName ) const
|
|||||||
return MakeMovie( asFiles[0] );
|
return MakeMovie( asFiles[0] );
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pTempBGA = new BGAnimation;
|
Sprite *pSprite = new Sprite;
|
||||||
pTempBGA->LoadFromStaticGraphic( asFiles[0] );
|
pSprite->LoadBG( asFiles[0] );
|
||||||
return pTempBGA;
|
pSprite->StretchTo( FullScreenRectF );
|
||||||
|
return pSprite;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Look for movies in the RandomMovies dir
|
// Look for movies in the RandomMovies dir
|
||||||
@@ -400,10 +400,10 @@ void Background::LoadFromSong( const Song* pSong )
|
|||||||
if( bStaticBackgroundUsed )
|
if( bStaticBackgroundUsed )
|
||||||
{
|
{
|
||||||
CString sSongBGPath = pSong->HasBackground() ? pSong->GetBackgroundPath() : THEME->GetPathToG("Common fallback background");
|
CString sSongBGPath = pSong->HasBackground() ? pSong->GetBackgroundPath() : THEME->GetPathToG("Common fallback background");
|
||||||
BGAnimation *pTempBGA = new BGAnimation;
|
Sprite* pSprite = new Sprite;
|
||||||
pTempBGA->LoadFromStaticGraphic( sSongBGPath );
|
pSprite->LoadBG( sSongBGPath );
|
||||||
pTempBGA->PlayCommand( "On" );
|
pSprite->StretchTo( FullScreenRectF );
|
||||||
m_BGAnimations[STATIC_BACKGROUND] = pTempBGA;
|
m_BGAnimations[STATIC_BACKGROUND] = pSprite;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user