This commit is contained in:
Glenn Maynard
2005-09-01 06:23:59 +00:00
parent a627262266
commit 204e399878
2 changed files with 6 additions and 7 deletions
+5 -5
View File
@@ -29,13 +29,13 @@ static bool CompareLayerNames( const CString& s1, const CString& s2 )
return i1 < i2; return i1 < i2;
} }
void BGAnimation::AddLayersFromAniDir( const CString &_sAniDir, const IniFile& ini ) void BGAnimation::AddLayersFromAniDir( const CString &_sAniDir, const XNode *pNode )
{ {
const CString& sAniDir = _sAniDir; const CString& sAniDir = _sAniDir;
{ {
vector<CString> vsLayerNames; vector<CString> vsLayerNames;
FOREACH_CONST_Child( &ini, pLayer ) FOREACH_CONST_Child( pNode, pLayer )
{ {
if( strncmp(pLayer->m_sName, "Layer", 5) == 0 ) if( strncmp(pLayer->m_sName, "Layer", 5) == 0 )
vsLayerNames.push_back( pLayer->m_sName ); vsLayerNames.push_back( pLayer->m_sName );
@@ -47,7 +47,7 @@ void BGAnimation::AddLayersFromAniDir( const CString &_sAniDir, const IniFile& i
FOREACH_CONST( CString, vsLayerNames, s ) FOREACH_CONST( CString, vsLayerNames, s )
{ {
const CString &sLayer = *s; const CString &sLayer = *s;
const XNode* pKey = ini.GetChild( sLayer ); const XNode* pKey = pNode->GetChild( sLayer );
ASSERT( pKey ); ASSERT( pKey );
CString sImportDir; CString sImportDir;
@@ -74,7 +74,7 @@ void BGAnimation::AddLayersFromAniDir( const CString &_sAniDir, const IniFile& i
IniFile ini2; IniFile ini2;
ini2.ReadFile( sPathToIni ); ini2.ReadFile( sPathToIni );
AddLayersFromAniDir( sImportDir, ini2 ); AddLayersFromAniDir( sImportDir, &ini2 );
} }
else else
{ {
@@ -108,7 +108,7 @@ void BGAnimation::LoadFromAniDir( const CString &_sAniDir )
IniFile ini; IniFile ini;
ini.ReadFile( sPathToIni ); ini.ReadFile( sPathToIni );
AddLayersFromAniDir( sAniDir, ini ); // TODO: Check for circular load AddLayersFromAniDir( sAniDir, &ini ); // TODO: Check for circular load
XNode* pBGAnimation = ini.GetChild( "BGAnimation" ); XNode* pBGAnimation = ini.GetChild( "BGAnimation" );
XNode dummy; XNode dummy;
+1 -2
View File
@@ -6,7 +6,6 @@
#include "ActorScroller.h" #include "ActorScroller.h"
struct XNode; struct XNode;
class IniFile;
class BGAnimation : public ActorScrollerAutoDeleteChildren class BGAnimation : public ActorScrollerAutoDeleteChildren
{ {
@@ -18,7 +17,7 @@ public:
void LoadFromNode( const CString& sDir, const XNode* pNode ); void LoadFromNode( const CString& sDir, const XNode* pNode );
protected: protected:
void AddLayersFromAniDir( const CString &_sAniDir, const IniFile& ini ); void AddLayersFromAniDir( const CString &_sAniDir, const XNode *pNode );
}; };
#endif #endif