From a71eb1afd269ef8f861c311c17780f9003d94e53 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Thu, 26 May 2011 15:38:15 -0400 Subject: [PATCH] Reverting sync seems alright. I think the rest is cleanup, but class is starting soon, so that will have to wait. --- src/AdjustSync.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/AdjustSync.cpp b/src/AdjustSync.cpp index 9afe8e8b06..69ac2fc662 100644 --- a/src/AdjustSync.cpp +++ b/src/AdjustSync.cpp @@ -136,11 +136,18 @@ void AdjustSync::RevertSyncChanges() if( GAMESTATE->IsCourseMode() ) return; PREFSMAN->m_fGlobalOffsetSeconds.Set( s_fGlobalOffsetSecondsOriginal ); - /* TODO: Return EACH TimingData back to normal. - * Hopefully on a loop ot always uses the same order. Either that, - * or we can loop through the vector and manually access the proper - * steps through GameState. */ - GAMESTATE->m_pCurSong->m_SongTiming = *s_pTimingDataOriginal; + + // The first one is ALWAYS the song timing. + GAMESTATE->m_pCurSong->m_SongTiming = *s_vpTimingDataOriginal[0]; + + unsigned location = 1; + const vector& vpSteps = GAMESTATE->m_pCurSong->GetAllSteps(); + FOREACH( Steps*, const_cast&>(vpSteps), s ) + { + (*s)->m_Timing = *s_vpTimingDataOriginal[location]; + location++; + } + ResetOriginalSyncData(); s_fStandardDeviation = 0.0f; s_fAverageError = 0.0f;