diff --git a/stepmania/src/ActorUtil.cpp b/stepmania/src/ActorUtil.cpp index 291af74d54..df9b8bae5e 100644 --- a/stepmania/src/ActorUtil.cpp +++ b/stepmania/src/ActorUtil.cpp @@ -22,22 +22,6 @@ #include "arch/Dialog/Dialog.h" -Actor* LoadFromActorFile( const CString &sIniPath, const CString &sLayer ) -{ - // TODO: Check for recursive loading - IniFile ini; - if( !ini.ReadFile( sIniPath ) ) - RageException::Throw( "%s", ini.GetError().c_str() ); - - CString sDir = Dirname( sIniPath ); - - const XNode* pLayer = ini.GetChild(sLayer); - if( pLayer == NULL ) - RageException::Throw( "The file '%s' doesn't have layer '%s'.", sIniPath.c_str(), sLayer.c_str() ); - - return LoadFromActorFile( sDir, *pLayer ); -} - Actor* LoadFromActorFile( const CString& sAniDir, const XNode& layer ) { Actor* pActor = NULL; // fill this in before we return @@ -309,7 +293,18 @@ Actor* MakeActor( const RageTextureID &ID ) } else if( sExt=="actor" ) { - return LoadFromActorFile( ID.filename ); + // TODO: Check for recursive loading + IniFile ini; + if( !ini.ReadFile( ID.filename ) ) + RageException::Throw( "%s", ini.GetError().c_str() ); + + CString sDir = Dirname( ID.filename ); + + const XNode* pLayer = ini.GetChild( "Actor" ); + if( pLayer == NULL ) + RageException::Throw( "The file '%s' doesn't have layer 'Actor'.", ID.filename.c_str() ); + + return LoadFromActorFile( sDir, *pLayer ); } else if( sExt=="png" || sExt=="jpg" || diff --git a/stepmania/src/ActorUtil.h b/stepmania/src/ActorUtil.h index 9b36014e8a..753a4929c2 100644 --- a/stepmania/src/ActorUtil.h +++ b/stepmania/src/ActorUtil.h @@ -33,7 +33,6 @@ inline void UtilOffCommand( Actor* pActor, const CString &sScreenName ) { if(pAc inline void UtilSetXYAndOnCommand( Actor* pActor, const CString &sScreenName ) { if(pActor) UtilSetXYAndOnCommand( *pActor, sScreenName ); } // Return a Sprite, BitmapText, or Model depending on the file type -Actor* LoadFromActorFile( const CString &sIniPath, const CString &sLayer = "Actor" ); Actor* LoadFromActorFile( const CString& sAniDir, const XNode& layer ); Actor* MakeActor( const RageTextureID &ID );