don't need to keep m_bGeneric around

This commit is contained in:
Glenn Maynard
2005-01-16 19:19:24 +00:00
parent c1e3239a5f
commit 77faa0d089
3 changed files with 12 additions and 15 deletions
+7 -9
View File
@@ -8,10 +8,8 @@
#include "Foreach.h"
BGAnimation::BGAnimation( bool bGeneric )
BGAnimation::BGAnimation()
{
/* See BGAnimationLayer::BGAnimationLayer for explanation. */
m_bGeneric = bGeneric;
}
BGAnimation::~BGAnimation()
@@ -36,7 +34,7 @@ static bool CompareLayerNames( const CString& s1, const CString& s2 )
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() )
return;
@@ -91,12 +89,12 @@ void BGAnimation::AddLayersFromAniDir( const CString &_sAniDir, vector<Actor*> &
// import a whole BGAnimation
sImportDir = sAniDir + sImportDir;
CollapsePath( sImportDir );
AddLayersFromAniDir( sImportDir, layersAddTo );
AddLayersFromAniDir( sImportDir, layersAddTo, bGeneric );
}
else
{
// import as a single layer
BGAnimationLayer* pLayer = new BGAnimationLayer( m_bGeneric );
BGAnimationLayer* pLayer = new BGAnimationLayer( bGeneric );
pLayer->LoadFromNode( sAniDir, *pKey );
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();
@@ -122,7 +120,7 @@ void BGAnimation::LoadFromAniDir( const CString &_sAniDir )
if( DoesFileExist(sPathToIni) )
{
// 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;
ini.ReadFile( sPathToIni );
@@ -161,7 +159,7 @@ void BGAnimation::LoadFromAniDir( const CString &_sAniDir )
const CString sPath = asImagePaths[i];
if( Basename(sPath).Left(1) == "_" )
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] );
AddChild( pLayer );
}
+3 -4
View File
@@ -12,17 +12,16 @@ struct XNode;
class BGAnimation : public ActorScroller
{
public:
BGAnimation( bool Generic=true );
BGAnimation();
virtual ~BGAnimation();
void Unload();
void LoadFromAniDir( const CString &sAniDir );
void LoadFromAniDir( const CString &sAniDir, bool bGeneric=true );
void LoadFromNode( const CString &sDir, const XNode& node );
protected:
void AddLayersFromAniDir( const CString &_sAniDir, vector<Actor*> &layersAddTo );
bool m_bGeneric;
static void AddLayersFromAniDir( const CString &_sAniDir, vector<Actor*> &layersAddTo, bool bGeneric );
};
#endif
+2 -2
View File
@@ -158,8 +158,8 @@ Actor *Background::CreateSongBGA( CString sBGName ) const
GetDirListing( m_pSong->GetSongDir()+sBGName, asFiles, true, true );
if( !asFiles.empty() )
{
pTempBGA = new BGAnimation( false );
pTempBGA->LoadFromAniDir( asFiles[0] );
pTempBGA = new BGAnimation;
pTempBGA->LoadFromAniDir( asFiles[0], false );
return pTempBGA;
}
// Look for BG movies or static graphics in the song dir