don't need to keep m_bGeneric around
This commit is contained in:
@@ -8,10 +8,8 @@
|
|||||||
#include "Foreach.h"
|
#include "Foreach.h"
|
||||||
|
|
||||||
|
|
||||||
BGAnimation::BGAnimation( bool bGeneric )
|
BGAnimation::BGAnimation()
|
||||||
{
|
{
|
||||||
/* See BGAnimationLayer::BGAnimationLayer for explanation. */
|
|
||||||
m_bGeneric = bGeneric;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BGAnimation::~BGAnimation()
|
BGAnimation::~BGAnimation()
|
||||||
@@ -36,7 +34,7 @@ static bool CompareLayerNames( const CString& s1, const CString& s2 )
|
|||||||
return i1 < i2;
|
return i1 < i2;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BGAnimation::AddLayersFromAniDir( const CString &_sAniDir, vector<Actor*> &layersAddTo )
|
void BGAnimation::AddLayersFromAniDir( const CString &_sAniDir, vector<Actor*> &layersAddTo, bool bGeneric )
|
||||||
{
|
{
|
||||||
if( _sAniDir.empty() )
|
if( _sAniDir.empty() )
|
||||||
return;
|
return;
|
||||||
@@ -91,12 +89,12 @@ void BGAnimation::AddLayersFromAniDir( const CString &_sAniDir, vector<Actor*> &
|
|||||||
// import a whole BGAnimation
|
// import a whole BGAnimation
|
||||||
sImportDir = sAniDir + sImportDir;
|
sImportDir = sAniDir + sImportDir;
|
||||||
CollapsePath( sImportDir );
|
CollapsePath( sImportDir );
|
||||||
AddLayersFromAniDir( sImportDir, layersAddTo );
|
AddLayersFromAniDir( sImportDir, layersAddTo, bGeneric );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// import as a single layer
|
// import as a single layer
|
||||||
BGAnimationLayer* pLayer = new BGAnimationLayer( m_bGeneric );
|
BGAnimationLayer* pLayer = new BGAnimationLayer( bGeneric );
|
||||||
pLayer->LoadFromNode( sAniDir, *pKey );
|
pLayer->LoadFromNode( sAniDir, *pKey );
|
||||||
layersAddTo.push_back( pLayer );
|
layersAddTo.push_back( pLayer );
|
||||||
}
|
}
|
||||||
@@ -104,7 +102,7 @@ void BGAnimation::AddLayersFromAniDir( const CString &_sAniDir, vector<Actor*> &
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BGAnimation::LoadFromAniDir( const CString &_sAniDir )
|
void BGAnimation::LoadFromAniDir( const CString &_sAniDir, bool bGeneric )
|
||||||
{
|
{
|
||||||
Unload();
|
Unload();
|
||||||
|
|
||||||
@@ -122,7 +120,7 @@ void BGAnimation::LoadFromAniDir( const CString &_sAniDir )
|
|||||||
if( DoesFileExist(sPathToIni) )
|
if( DoesFileExist(sPathToIni) )
|
||||||
{
|
{
|
||||||
// This is a new style BGAnimation (using .ini)
|
// This is a new style BGAnimation (using .ini)
|
||||||
AddLayersFromAniDir( sAniDir, m_SubActors ); // TODO: Check for circular load
|
AddLayersFromAniDir( sAniDir, m_SubActors, bGeneric ); // TODO: Check for circular load
|
||||||
|
|
||||||
IniFile ini;
|
IniFile ini;
|
||||||
ini.ReadFile( sPathToIni );
|
ini.ReadFile( sPathToIni );
|
||||||
@@ -161,7 +159,7 @@ void BGAnimation::LoadFromAniDir( const CString &_sAniDir )
|
|||||||
const CString sPath = asImagePaths[i];
|
const CString sPath = asImagePaths[i];
|
||||||
if( Basename(sPath).Left(1) == "_" )
|
if( Basename(sPath).Left(1) == "_" )
|
||||||
continue; // don't directly load files starting with an underscore
|
continue; // don't directly load files starting with an underscore
|
||||||
BGAnimationLayer* pLayer = new BGAnimationLayer( m_bGeneric );
|
BGAnimationLayer* pLayer = new BGAnimationLayer( bGeneric );
|
||||||
pLayer->LoadFromAniLayerFile( asImagePaths[i] );
|
pLayer->LoadFromAniLayerFile( asImagePaths[i] );
|
||||||
AddChild( pLayer );
|
AddChild( pLayer );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,17 +12,16 @@ struct XNode;
|
|||||||
class BGAnimation : public ActorScroller
|
class BGAnimation : public ActorScroller
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
BGAnimation( bool Generic=true );
|
BGAnimation();
|
||||||
virtual ~BGAnimation();
|
virtual ~BGAnimation();
|
||||||
|
|
||||||
void Unload();
|
void Unload();
|
||||||
|
|
||||||
void LoadFromAniDir( const CString &sAniDir );
|
void LoadFromAniDir( const CString &sAniDir, bool bGeneric=true );
|
||||||
void LoadFromNode( const CString &sDir, const XNode& node );
|
void LoadFromNode( const CString &sDir, const XNode& node );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void AddLayersFromAniDir( const CString &_sAniDir, vector<Actor*> &layersAddTo );
|
static void AddLayersFromAniDir( const CString &_sAniDir, vector<Actor*> &layersAddTo, bool bGeneric );
|
||||||
bool m_bGeneric;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -158,8 +158,8 @@ Actor *Background::CreateSongBGA( CString sBGName ) const
|
|||||||
GetDirListing( m_pSong->GetSongDir()+sBGName, asFiles, true, true );
|
GetDirListing( m_pSong->GetSongDir()+sBGName, asFiles, true, true );
|
||||||
if( !asFiles.empty() )
|
if( !asFiles.empty() )
|
||||||
{
|
{
|
||||||
pTempBGA = new BGAnimation( false );
|
pTempBGA = new BGAnimation;
|
||||||
pTempBGA->LoadFromAniDir( asFiles[0] );
|
pTempBGA->LoadFromAniDir( asFiles[0], false );
|
||||||
return pTempBGA;
|
return pTempBGA;
|
||||||
}
|
}
|
||||||
// Look for BG movies or static graphics in the song dir
|
// Look for BG movies or static graphics in the song dir
|
||||||
|
|||||||
Reference in New Issue
Block a user