From 6f26ca2872ff4b1b943a97aeab3e26a49d05f891 Mon Sep 17 00:00:00 2001 From: John Bauer Date: Fri, 3 Nov 2006 04:33:26 +0000 Subject: [PATCH] Put "CourseMode" barriers in a couple more places in AdjustSync. Although AdjustSync would not alter anything in CourseMode, it would sometimes announce it had. It would be better to simply remove the Autosync line from the options in CourseMode, but I don't know how to do that. --- stepmania/src/AdjustSync.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/stepmania/src/AdjustSync.cpp b/stepmania/src/AdjustSync.cpp index 4fbc7d4158..96fbd06116 100644 --- a/stepmania/src/AdjustSync.cpp +++ b/stepmania/src/AdjustSync.cpp @@ -122,6 +122,8 @@ static LocalizedString AUTOSYNC_MACHINE ( "AdjustSync", "Autosync Machine" ); static LocalizedString AUTOSYNC_TEMPO ( "AdjustSync", "Autosync Tempo" ); void AdjustSync::HandleAutosync( float fNoteOffBySeconds, float fStepTime ) { + if( GAMESTATE->IsCourseMode() ) + return; switch( GAMESTATE->m_SongOptions.GetCurrent().m_AutosyncType ) { case SongOptions::AUTOSYNC_OFF: return; @@ -150,6 +152,8 @@ void AdjustSync::HandleAutosync( float fNoteOffBySeconds, float fStepTime ) void AdjustSync::HandleSongEnd() { + if( GAMESTATE->IsCourseMode() ) + return; if( GAMESTATE->m_SongOptions.GetCurrent().m_AutosyncType == SongOptions::AUTOSYNC_TEMPO ) { AutosyncTempo(); @@ -160,7 +164,6 @@ void AdjustSync::HandleSongEnd() void AdjustSync::AutosyncOffset() { - const float mean = calc_mean( s_fAutosyncOffset, s_fAutosyncOffset+OFFSET_SAMPLE_COUNT ); const float stddev = calc_stddev( s_fAutosyncOffset, s_fAutosyncOffset+OFFSET_SAMPLE_COUNT ); @@ -208,7 +211,10 @@ void AdjustSync::AutosyncTempo() float fIntercept = 0.0f; if( !CalcLeastSquares( s_vAutosyncTempoData, &fSlope, &fIntercept, &s_fAverageError ) ) + { + s_vAutosyncTempoData.clear(); return; + } if( s_fAverageError < ERROR_TOO_HIGH ) {