Don't create a loader.

This commit is contained in:
Steve Checkoway
2007-02-14 10:09:05 +00:00
parent 6c8ddaec73
commit 1b2c9da350
5 changed files with 7 additions and 11 deletions
+1 -2
View File
@@ -135,8 +135,7 @@ static void StartMusic( MusicToPlay &ToPlay )
{ {
LOG->Trace( "Found '%s'", ToPlay.m_sTimingFile.c_str() ); LOG->Trace( "Found '%s'", ToPlay.m_sTimingFile.c_str() );
Song song; Song song;
SMLoader sml; if( SMLoader::LoadFromSMFile(ToPlay.m_sTimingFile, song) )
if( sml.LoadFromSMFile( ToPlay.m_sTimingFile, song ) )
{ {
ToPlay.HasTiming = true; ToPlay.HasTiming = true;
ToPlay.m_TimingData = song.m_Timing; ToPlay.m_TimingData = song.m_Timing;
+1 -2
View File
@@ -18,9 +18,8 @@ void ScreenGameplaySyncMachine::Init()
GAMESTATE->SetCurrentStyle( GAMEMAN->GetHowToPlayStyleForGame(GAMESTATE->m_pCurGame) ); GAMESTATE->SetCurrentStyle( GAMEMAN->GetHowToPlayStyleForGame(GAMESTATE->m_pCurGame) );
AdjustSync::ResetOriginalSyncData(); AdjustSync::ResetOriginalSyncData();
SMLoader ld;
RString sFile = THEME->GetPathO("ScreenGameplaySyncMachine","music.sm"); RString sFile = THEME->GetPathO("ScreenGameplaySyncMachine","music.sm");
ld.LoadFromSMFile( sFile, m_Song ); SMLoader::LoadFromSMFile( sFile, m_Song );
m_Song.SetSongDir( Dirname(sFile) ); m_Song.SetSongDir( Dirname(sFile) );
m_Song.TidyUpData(); m_Song.TidyUpData();
+1 -2
View File
@@ -132,8 +132,7 @@ void ScreenHowToPlay::Init()
if( USEPLAYER ) if( USEPLAYER )
{ {
SMLoader smfile; SMLoader::LoadFromSMFile( THEME->GetPathO(m_sName, "steps"), m_Song, false );
smfile.LoadFromSMFile( THEME->GetPathO(m_sName, "steps"), m_Song, false );
m_Song.AddAutoGenNotes(); m_Song.AddAutoGenNotes();
const Style* pStyle = GAMESTATE->GetCurrentStyle(); const Style* pStyle = GAMESTATE->GetCurrentStyle();
+3 -3
View File
@@ -207,9 +207,9 @@ bool Song::LoadFromSongDir( RString sDir )
if( bUseCache ) if( bUseCache )
{ {
// LOG->Trace( "Loading '%s' from cache file '%s'.", m_sSongDir.c_str(), GetCacheFilePath().c_str() ); // LOG->Trace( "Loading '%s' from cache file '%s'.", m_sSongDir.c_str(), GetCacheFilePath().c_str() );
SMLoader ld; SMLoader::LoadFromSMFile( GetCacheFilePath(), *this, true );
ld.LoadFromSMFile( GetCacheFilePath(), *this, true ); // XXX: This shouldn't really be a non-static member function.
ld.TidyUpData( *this, true ); SMLoader().TidyUpData( *this, true );
} }
else else
{ {
+1 -2
View File
@@ -230,8 +230,7 @@ void Steps::Decompress() const
{ {
/* We have data on disk and not in memory. Load it. */ /* We have data on disk and not in memory. Load it. */
Song s; Song s;
SMLoader ld; if( !SMLoader::LoadFromSMFile(m_sFilename, s, true) )
if( !ld.LoadFromSMFile( m_sFilename, s, true ) )
{ {
LOG->Warn( "Couldn't load \"%s\"", m_sFilename.c_str() ); LOG->Warn( "Couldn't load \"%s\"", m_sFilename.c_str() );
return; return;