diff --git a/src/GameSoundManager.cpp b/src/GameSoundManager.cpp index 8b878c50ef..27933d5d82 100644 --- a/src/GameSoundManager.cpp +++ b/src/GameSoundManager.cpp @@ -145,7 +145,7 @@ static void StartMusic( MusicToPlay &ToPlay ) SSCLoader loaderSSC; SMLoader loaderSM; if(GetExtension(ToPlay.m_sTimingFile) == ".ssc" && - loaderSSC.LoadFromSSCFile(ToPlay.m_sTimingFile, song) ) + loaderSSC.LoadFromSimfile(ToPlay.m_sTimingFile, song) ) { ToPlay.HasTiming = true; ToPlay.m_TimingData = song.m_SongTiming; @@ -155,7 +155,7 @@ static void StartMusic( MusicToPlay &ToPlay ) pStepsCabinetLights->GetNoteData( ToPlay.m_LightsData ); } else if(GetExtension(ToPlay.m_sTimingFile) == ".sm" && - loaderSM.LoadFromSMFile(ToPlay.m_sTimingFile, song) ) + loaderSM.LoadFromSimfile(ToPlay.m_sTimingFile, song) ) { ToPlay.HasTiming = true; ToPlay.m_TimingData = song.m_SongTiming; diff --git a/src/NotesLoaderSM.cpp b/src/NotesLoaderSM.cpp index e75e1c5998..4e1b073a9b 100644 --- a/src/NotesLoaderSM.cpp +++ b/src/NotesLoaderSM.cpp @@ -30,7 +30,7 @@ bool SMLoader::LoadFromDir( const RString &sPath, Song &out ) ASSERT( aFileNames.size() == 1 ); //ASSERT( aFileNames.size() >= 1 ); - return LoadFromSMFile( sPath + aFileNames[0], out ); + return LoadFromSimfile( sPath + aFileNames[0], out ); } float SMLoader::RowToBeat( RString line, const int rowsPerBeat ) @@ -598,7 +598,7 @@ bool SMLoader::LoadFromBGChangesString( BackgroundChange &change, const RString return aBGChangeValues.size() >= 2; } -bool SMLoader::LoadFromSMFile( const RString &sPath, Song &out, bool bFromCache ) +bool SMLoader::LoadFromSimfile( const RString &sPath, Song &out, bool bFromCache ) { LOG->Trace( "Song::LoadFromSMFile(%s)", sPath.c_str() ); diff --git a/src/NotesLoaderSM.h b/src/NotesLoaderSM.h index 4a1f3bc7c0..f2c964a43a 100644 --- a/src/NotesLoaderSM.h +++ b/src/NotesLoaderSM.h @@ -28,7 +28,14 @@ struct SMLoader */ virtual void TidyUpData( Song &song, bool bFromCache ); - bool LoadFromSMFile( const RString &sPath, Song &out, bool bFromCache = false ); + /** + * @brief Attempt to load the specified sm file. + * @param sPath a const reference to the path on the hard drive to check. + * @param out a reference to the Song that will retrieve the song information. + * @param bFromCache a check to see if we are getting certain information from the cache file. + * @return its success or failure. + */ + virtual bool LoadFromSimfile( const RString &sPath, Song &out, bool bFromCache = false ); /** * @brief Retrieve the list of .sm files. * @param sPath a const reference to the path on the hard drive to check. diff --git a/src/NotesLoaderSMA.cpp b/src/NotesLoaderSMA.cpp index aa148933bc..a52c7db68b 100644 --- a/src/NotesLoaderSMA.cpp +++ b/src/NotesLoaderSMA.cpp @@ -30,7 +30,7 @@ bool SMALoader::LoadFromDir( const RString &sPath, Song &out ) return false; } ASSERT( aFileNames.size() == 1 ); - return LoadFromSMAFile( sPath + aFileNames[0], out ); + return LoadFromSimfile( sPath + aFileNames[0], out ); } void SMALoader::ProcessMultipliers( TimingData &out, const int iRowsPerBeat, const RString sParam ) @@ -142,7 +142,7 @@ void SMALoader::ProcessSpeeds( TimingData &out, const RString line, const int ro } } -bool SMALoader::LoadFromSMAFile( const RString &sPath, Song &out ) +bool SMALoader::LoadFromSimfile( const RString &sPath, Song &out, bool bFromCache ) { LOG->Trace( "Song::LoadFromSMAFile(%s)", sPath.c_str() ); diff --git a/src/NotesLoaderSMA.h b/src/NotesLoaderSMA.h index 040b1e9d38..71d307642b 100644 --- a/src/NotesLoaderSMA.h +++ b/src/NotesLoaderSMA.h @@ -25,7 +25,7 @@ struct SMALoader : public SMLoader { bool LoadFromDir( const RString &sPath, Song &out ); - bool LoadFromSMAFile( const RString &sPath, Song &out ); + virtual bool LoadFromSimfile( const RString &sPath, Song &out, bool bFromCache = false ); /** * @brief Retrieve the list of .sma files. * @param sPath a const reference to the path on the hard drive to check. diff --git a/src/NotesLoaderSSC.cpp b/src/NotesLoaderSSC.cpp index b5644b8243..ddac4631fe 100644 --- a/src/NotesLoaderSSC.cpp +++ b/src/NotesLoaderSSC.cpp @@ -31,7 +31,7 @@ bool SSCLoader::LoadFromDir( const RString &sPath, Song &out ) } ASSERT( aFileNames.size() == 1 ); - return LoadFromSSCFile( sPath + aFileNames[0], out ); + return LoadFromSimfile( sPath + aFileNames[0], out ); } void SSCLoader::ProcessWarps( TimingData &out, const RString sParam, const float fVersion ) @@ -149,7 +149,7 @@ void SSCLoader::ProcessScrolls( TimingData &out, const RString sParam ) } -bool SSCLoader::LoadFromSSCFile( const RString &sPath, Song &out, bool bFromCache ) +bool SSCLoader::LoadFromSimfile( const RString &sPath, Song &out, bool bFromCache ) { LOG->Trace( "Song::LoadFromSSCFile(%s)", sPath.c_str() ); diff --git a/src/NotesLoaderSSC.h b/src/NotesLoaderSSC.h index 7a5cd3f172..e535f8ac48 100644 --- a/src/NotesLoaderSSC.h +++ b/src/NotesLoaderSSC.h @@ -46,7 +46,7 @@ struct SSCLoader : public SMLoader * @param bFromCache a check to see if we are getting certain information from the cache file. * @return its success or failure. */ - bool LoadFromSSCFile( const RString &sPath, Song &out, bool bFromCache = false ); + virtual bool LoadFromSimfile( const RString &sPath, Song &out, bool bFromCache = false ); /** * @brief Retrieve the list of .ssc files. * @param sPath a const reference to the path on the hard drive to check. diff --git a/src/ScreenGameplaySyncMachine.cpp b/src/ScreenGameplaySyncMachine.cpp index f1202c3c13..3f72cd1976 100644 --- a/src/ScreenGameplaySyncMachine.cpp +++ b/src/ScreenGameplaySyncMachine.cpp @@ -24,9 +24,9 @@ void ScreenGameplaySyncMachine::Init() SSCLoader loaderSSC; SMLoader loaderSM; if(sFile.Right(4) == ".ssc") - loaderSSC.LoadFromSSCFile( sFile, m_Song ); + loaderSSC.LoadFromSimfile( sFile, m_Song ); else - loaderSM.LoadFromSMFile( sFile, m_Song ); + loaderSM.LoadFromSimfile( sFile, m_Song ); m_Song.SetSongDir( Dirname(sFile) ); m_Song.TidyUpData(); diff --git a/src/ScreenHowToPlay.cpp b/src/ScreenHowToPlay.cpp index 64ce65815c..bb5e021db2 100644 --- a/src/ScreenHowToPlay.cpp +++ b/src/ScreenHowToPlay.cpp @@ -138,9 +138,9 @@ void ScreenHowToPlay::Init() SSCLoader loaderSSC; SMLoader loaderSM; if( sStepsPath.Right(4) == ".ssc" ) - loaderSSC.LoadFromSSCFile( sStepsPath, m_Song, false ); + loaderSSC.LoadFromSimfile( sStepsPath, m_Song, false ); else - loaderSM.LoadFromSMFile( sStepsPath, m_Song, false ); + loaderSM.LoadFromSimfile( sStepsPath, m_Song, false ); m_Song.AddAutoGenNotes(); const Style* pStyle = GAMESTATE->GetCurrentStyle(); diff --git a/src/Song.cpp b/src/Song.cpp index d547a02e47..5bb35928f5 100644 --- a/src/Song.cpp +++ b/src/Song.cpp @@ -236,12 +236,12 @@ bool Song::LoadFromSongDir( RString sDir ) { // LOG->Trace( "Loading '%s' from cache file '%s'.", m_sSongDir.c_str(), GetCacheFilePath().c_str() ); SSCLoader loaderSSC; - bool bLoadedFromSSC = loaderSSC.LoadFromSSCFile( sCacheFilePath, *this, true ); + bool bLoadedFromSSC = loaderSSC.LoadFromSimfile( sCacheFilePath, *this, true ); if( !bLoadedFromSSC ) { // load from .sm SMLoader loaderSM; - loaderSM.LoadFromSMFile( sCacheFilePath, *this, true ); + loaderSM.LoadFromSimfile( sCacheFilePath, *this, true ); loaderSM.TidyUpData( *this, true ); } } diff --git a/src/Steps.cpp b/src/Steps.cpp index e78bed9c3f..ee7a27c98f 100644 --- a/src/Steps.cpp +++ b/src/Steps.cpp @@ -243,12 +243,12 @@ void Steps::Decompress() const // We have data on disk and not in memory. Load it. Song s; SSCLoader loaderSSC; - bool bLoadedFromSSC = loaderSSC.LoadFromSSCFile(m_sFilename, s, true); + bool bLoadedFromSSC = loaderSSC.LoadFromSimfile(m_sFilename, s, true); if( !bLoadedFromSSC ) { // try reading from .sm instead SMLoader loaderSM; - if( !loaderSM.LoadFromSMFile(m_sFilename, s, true) ) + if( !loaderSM.LoadFromSimfile(m_sFilename, s, true) ) { LOG->Warn( "Couldn't load \"%s\"", m_sFilename.c_str() ); return;