diff --git a/stepmania/src/ActorUtil.cpp b/stepmania/src/ActorUtil.cpp index 1f408d9a4f..2334d21ceb 100644 --- a/stepmania/src/ActorUtil.cpp +++ b/stepmania/src/ActorUtil.cpp @@ -20,17 +20,13 @@ Actor* MakeActor( CString sPath ) { - CString sDir, sFName, sExt; - splitrelpath( sPath, sDir, sFName, sExt ); + CString sExt = GetExtension(sPath); sExt.MakeLower(); if( sExt=="actor" ) { // TODO: Check for recursive loading - CString sDir, sThrowAway; - splitrelpath( sPath, sDir, sThrowAway, sThrowAway ); - IniFile ini; ini.SetPath( sPath ); ini.ReadFile(); @@ -41,7 +37,7 @@ Actor* MakeActor( CString sPath ) CString sFileName; ini.GetValue( "Actor", "File", sFileName ); - CString sNewPath = sDir+sFileName; + CString sNewPath = Dirname( sPath ) + sFileName; if( !DoesFileExist(sNewPath) ) RageException::Throw( "The actor file '%s' references a file '%s' which doesn't exist.", sPath.c_str(), sNewPath.c_str() ); diff --git a/stepmania/src/Model.cpp b/stepmania/src/Model.cpp index 45120259d4..a76a19a4cf 100644 --- a/stepmania/src/Model.cpp +++ b/stepmania/src/Model.cpp @@ -51,9 +51,8 @@ void Model::Clear () bool Model::LoadMilkshapeAscii( CString sPath ) { - CString sDir, sThrowAway; FixSlashesInPlace(sPath); - splitrelpath( sPath, sDir, sThrowAway, sThrowAway ); + const CString sDir = Dirname( sPath ); FILE *file = fopen (sPath, "rt"); if (!file) @@ -419,9 +418,8 @@ bool Model::LoadMilkshapeAscii( CString sPath ) bool Model::LoadMilkshapeAsciiBones( CString sAniName, CString sPath ) { - CString sDir, sThrowAway; FixSlashesInPlace(sPath); - splitrelpath( sPath, sDir, sThrowAway, sThrowAway ); + const CString sDir = Dirname( sPath ); FILE *file = fopen (sPath, "rt"); if (!file)