From 77faa0d089f231c10b854d891b64484171c2fffa Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sun, 16 Jan 2005 19:19:24 +0000 Subject: [PATCH] don't need to keep m_bGeneric around --- stepmania/src/BGAnimation.cpp | 16 +++++++--------- stepmania/src/BGAnimation.h | 7 +++---- stepmania/src/Background.cpp | 4 ++-- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/stepmania/src/BGAnimation.cpp b/stepmania/src/BGAnimation.cpp index ab0709b3bf..543bc51319 100644 --- a/stepmania/src/BGAnimation.cpp +++ b/stepmania/src/BGAnimation.cpp @@ -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 &layersAddTo ) +void BGAnimation::AddLayersFromAniDir( const CString &_sAniDir, vector &layersAddTo, bool bGeneric ) { if( _sAniDir.empty() ) return; @@ -91,12 +89,12 @@ void BGAnimation::AddLayersFromAniDir( const CString &_sAniDir, vector & // 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 & } } -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 ); } diff --git a/stepmania/src/BGAnimation.h b/stepmania/src/BGAnimation.h index 98e0a75b31..cae2183500 100644 --- a/stepmania/src/BGAnimation.h +++ b/stepmania/src/BGAnimation.h @@ -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 &layersAddTo ); - bool m_bGeneric; + static void AddLayersFromAniDir( const CString &_sAniDir, vector &layersAddTo, bool bGeneric ); }; #endif diff --git a/stepmania/src/Background.cpp b/stepmania/src/Background.cpp index 6cc0bd6036..b201330746 100644 --- a/stepmania/src/Background.cpp +++ b/stepmania/src/Background.cpp @@ -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