diff --git a/src/NotesLoaderSMA.cpp b/src/NotesLoaderSMA.cpp index d5ca88124a..bda8926bbd 100644 --- a/src/NotesLoaderSMA.cpp +++ b/src/NotesLoaderSMA.cpp @@ -164,6 +164,7 @@ bool SMALoader::LoadFromSimfile( const RString &sPath, Song &out, bool bFromCach int state = SMA_GETTING_SONG_INFO; Steps* pNewNotes = NULL; int iRowsPerBeat = -1; // Start with an invalid value: needed for checking. + vector< pair > vBPMChanges, vStops; for( unsigned i=0; im_Timing : out.m_SongTiming); + ProcessBPMs( timing, vBPMChanges ); + ProcessStops( timing, vStops ); + state = SMA_GETTING_STEP_INFO; pNewNotes = new Steps(&out); } @@ -363,20 +370,14 @@ bool SMALoader::LoadFromSimfile( const RString &sPath, Song &out, bool bFromCach else if( sValueName=="BPMS" ) { - TimingData &timing = (state == SMA_GETTING_STEP_INFO - ? pNewNotes->m_Timing : out.m_SongTiming); - vector< pair > vBPMChanges; + vBPMChanges.clear(); ParseBPMs( vBPMChanges, sParams[1], iRowsPerBeat ); - ProcessBPMs( timing, vBPMChanges ); } else if( sValueName=="STOPS" || sValueName=="FREEZES" ) { - TimingData &timing = (state == SMA_GETTING_STEP_INFO - ? pNewNotes->m_Timing : out.m_SongTiming); - vector< pair > vStops; + vStops.clear(); ParseStops( vStops, sParams[1], iRowsPerBeat ); - ProcessStops( timing, vStops ); } else if( sValueName=="DELAYS" ) @@ -454,6 +455,12 @@ bool SMALoader::LoadFromSimfile( const RString &sPath, Song &out, bool bFromCach *pNewNotes ); pNewNotes->SetFilename(sPath); out.AddSteps( pNewNotes ); + + // Handle timing changes and convert negative bpms/stops + TimingData &timing = (state == SMA_GETTING_STEP_INFO + ? pNewNotes->m_Timing : out.m_SongTiming); + ProcessBPMs( timing, vBPMChanges ); + ProcessStops( timing, vStops ); } else if( sValueName=="TIMESIGNATURES" || sValueName=="LEADTRACK" ) ;