From 11eec4b0f8bcc41da8d84a7a9b16404a19979517 Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Wed, 14 Feb 2007 10:26:30 +0000 Subject: [PATCH] Merge these. --- stepmania/src/NotesLoaderDWI.cpp | 44 +++++++++++++++----------------- stepmania/src/NotesLoaderDWI.h | 1 - 2 files changed, 20 insertions(+), 25 deletions(-) diff --git a/stepmania/src/NotesLoaderDWI.cpp b/stepmania/src/NotesLoaderDWI.cpp index 40fd8a7d1b..b89c3390a4 100644 --- a/stepmania/src/NotesLoaderDWI.cpp +++ b/stepmania/src/NotesLoaderDWI.cpp @@ -357,8 +357,27 @@ static float ParseBrokenDWITimestamp(const RString &arg1, const RString &arg2, c return HHMMSSToSeconds( arg1+":"+arg2+":"+arg3 ); } -bool DWILoader::LoadFromDWIFile( const RString &sPath, Song &out ) + +void DWILoader::GetApplicableFiles( const RString &sPath, vector &out ) { + GetDirListing( sPath + RString("*.dwi"), out ); +} + +bool DWILoader::LoadFromDir( const RString &sPath_, Song &out ) +{ + vector aFileNames; + GetApplicableFiles( sPath_, aFileNames ); + + if( aFileNames.size() > 1 ) + { + LOG->UserLog( "Song", sPath_, "has more than one DWI file. There should be only one!" ); + return false; + } + + /* We should have exactly one; if we had none, we shouldn't have been called to begin with. */ + ASSERT( aFileNames.size() == 1 ); + const RString sPath = sPath_ + aFileNames[0]; + LOG->Trace( "Song::LoadFromDWIFile(%s)", sPath.c_str() ); MsdFile msd; @@ -553,29 +572,6 @@ bool DWILoader::LoadFromDWIFile( const RString &sPath, Song &out ) return true; } -void DWILoader::GetApplicableFiles( const RString &sPath, vector &out ) -{ - GetDirListing( sPath + RString("*.dwi"), out ); -} - -bool DWILoader::LoadFromDir( const RString &sPath, Song &out ) -{ - vector aFileNames; - GetApplicableFiles( sPath, aFileNames ); - - if( aFileNames.size() > 1 ) - { - LOG->UserLog( "Song", sPath, "has more than one DWI file. There should be only one!" ); - return false; - } - - /* We should have exactly one; if we had none, we shouldn't have been - * called to begin with. */ - ASSERT( aFileNames.size() == 1 ); - - return LoadFromDWIFile( sPath + aFileNames[0], out ); -} - /* * (c) 2001-2004 Chris Danford, Glenn Maynard * All rights reserved. diff --git a/stepmania/src/NotesLoaderDWI.h b/stepmania/src/NotesLoaderDWI.h index 9a0426f043..0cf2acf231 100644 --- a/stepmania/src/NotesLoaderDWI.h +++ b/stepmania/src/NotesLoaderDWI.h @@ -10,7 +10,6 @@ class Song; class DWILoader: public NotesLoader { - bool LoadFromDWIFile( const RString &sPath, Song &out ); public: static void GetApplicableFiles( const RString &sPath, vector &out ); bool LoadFromDir( const RString &sPath, Song &out );