From 1b2c9da350aa2acdbc4e0814585cdf94c188a572 Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Wed, 14 Feb 2007 10:09:05 +0000 Subject: [PATCH] Don't create a loader. --- stepmania/src/GameSoundManager.cpp | 3 +-- stepmania/src/ScreenGameplaySyncMachine.cpp | 3 +-- stepmania/src/ScreenHowToPlay.cpp | 3 +-- stepmania/src/Song.cpp | 6 +++--- stepmania/src/Steps.cpp | 3 +-- 5 files changed, 7 insertions(+), 11 deletions(-) diff --git a/stepmania/src/GameSoundManager.cpp b/stepmania/src/GameSoundManager.cpp index bf3f1f61fd..afceb236ca 100644 --- a/stepmania/src/GameSoundManager.cpp +++ b/stepmania/src/GameSoundManager.cpp @@ -135,8 +135,7 @@ static void StartMusic( MusicToPlay &ToPlay ) { LOG->Trace( "Found '%s'", ToPlay.m_sTimingFile.c_str() ); Song song; - SMLoader sml; - if( sml.LoadFromSMFile( ToPlay.m_sTimingFile, song ) ) + if( SMLoader::LoadFromSMFile(ToPlay.m_sTimingFile, song) ) { ToPlay.HasTiming = true; ToPlay.m_TimingData = song.m_Timing; diff --git a/stepmania/src/ScreenGameplaySyncMachine.cpp b/stepmania/src/ScreenGameplaySyncMachine.cpp index 88c91de4da..17625d8aab 100644 --- a/stepmania/src/ScreenGameplaySyncMachine.cpp +++ b/stepmania/src/ScreenGameplaySyncMachine.cpp @@ -18,9 +18,8 @@ void ScreenGameplaySyncMachine::Init() GAMESTATE->SetCurrentStyle( GAMEMAN->GetHowToPlayStyleForGame(GAMESTATE->m_pCurGame) ); AdjustSync::ResetOriginalSyncData(); - SMLoader ld; RString sFile = THEME->GetPathO("ScreenGameplaySyncMachine","music.sm"); - ld.LoadFromSMFile( sFile, m_Song ); + SMLoader::LoadFromSMFile( sFile, m_Song ); m_Song.SetSongDir( Dirname(sFile) ); m_Song.TidyUpData(); diff --git a/stepmania/src/ScreenHowToPlay.cpp b/stepmania/src/ScreenHowToPlay.cpp index 2900c6163f..b616b95702 100644 --- a/stepmania/src/ScreenHowToPlay.cpp +++ b/stepmania/src/ScreenHowToPlay.cpp @@ -132,8 +132,7 @@ void ScreenHowToPlay::Init() if( USEPLAYER ) { - SMLoader smfile; - smfile.LoadFromSMFile( THEME->GetPathO(m_sName, "steps"), m_Song, false ); + SMLoader::LoadFromSMFile( THEME->GetPathO(m_sName, "steps"), m_Song, false ); m_Song.AddAutoGenNotes(); const Style* pStyle = GAMESTATE->GetCurrentStyle(); diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index ee6a314464..d4bf4dc524 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -207,9 +207,9 @@ bool Song::LoadFromSongDir( RString sDir ) if( bUseCache ) { // LOG->Trace( "Loading '%s' from cache file '%s'.", m_sSongDir.c_str(), GetCacheFilePath().c_str() ); - SMLoader ld; - ld.LoadFromSMFile( GetCacheFilePath(), *this, true ); - ld.TidyUpData( *this, true ); + SMLoader::LoadFromSMFile( GetCacheFilePath(), *this, true ); + // XXX: This shouldn't really be a non-static member function. + SMLoader().TidyUpData( *this, true ); } else { diff --git a/stepmania/src/Steps.cpp b/stepmania/src/Steps.cpp index 4d150d1dbc..9fbcfeb082 100644 --- a/stepmania/src/Steps.cpp +++ b/stepmania/src/Steps.cpp @@ -230,8 +230,7 @@ void Steps::Decompress() const { /* We have data on disk and not in memory. Load it. */ Song s; - SMLoader ld; - if( !ld.LoadFromSMFile( m_sFilename, s, true ) ) + if( !SMLoader::LoadFromSMFile(m_sFilename, s, true) ) { LOG->Warn( "Couldn't load \"%s\"", m_sFilename.c_str() ); return;