From 1ef97f5db57af648e3df026b528b3510edd7695c Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Wed, 1 Jun 2011 15:27:14 -0400 Subject: [PATCH] Allow song timing to be used when playing. Admitedly, this may not be the best implementation. As usual, if you can do better, go for it. --- src/ScreenEdit.cpp | 10 ++++++++++ src/ScreenEdit.h | 7 +++++++ 2 files changed, 17 insertions(+) diff --git a/src/ScreenEdit.cpp b/src/ScreenEdit.cpp index 9632d0431b..c6905545f4 100644 --- a/src/ScreenEdit.cpp +++ b/src/ScreenEdit.cpp @@ -2354,12 +2354,16 @@ void ScreenEdit::TransitionEditState( EditState em ) case STATE_PLAYING: AdjustSync::HandleSongEnd(); + if (!GAMESTATE->m_bIsUsingStepTiming) + GAMESTATE->m_pCurSteps[PLAYER_1]->m_Timing = backupStepTiming; if( AdjustSync::IsSyncDataChanged() ) ScreenSaveSync::PromptSaveSync(); break; case STATE_RECORDING: SetDirty( true ); + if (!GAMESTATE->m_bIsUsingStepTiming) + GAMESTATE->m_pCurSteps[PLAYER_1]->m_Timing = backupStepTiming; SaveUndo(); // delete old TapNotes in the range @@ -2410,6 +2414,12 @@ void ScreenEdit::TransitionEditState( EditState em ) GAMESTATE->UpdateSongPosition( fSeconds, GetAppropriateTiming(), RageZeroTimer, true ); GAMESTATE->m_bGameplayLeadIn.Set( false ); + + if (!GAMESTATE->m_bIsUsingStepTiming) + { + backupStepTiming = GetAppropriateTiming(); + GAMESTATE->m_pCurSteps[PLAYER_1]->m_Timing = GAMESTATE->m_pCurSong->m_SongTiming; + } /* Reset the note skin, in case preferences have changed. */ // XXX diff --git a/src/ScreenEdit.h b/src/ScreenEdit.h index 2fd6d9435d..2b92f8bbd5 100644 --- a/src/ScreenEdit.h +++ b/src/ScreenEdit.h @@ -251,6 +251,13 @@ protected: BitmapText m_textInputTips; + /** + * @brief Keep a backup of the present Step TimingData when + * entering a playing or recording state. + * + * This is mainly to allow playing a chart with Song Timing. */ + TimingData backupStepTiming; + /** @brief The current TapNote that would be inserted. */ TapNote m_selectedTap;