From 079926c6c30ef76f8ad991178eaae32aad70f510 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 21 Jul 2005 06:50:39 +0000 Subject: [PATCH] cleanup; always commit recorded data when exiting record, not just when entering edit (though we only go from record -> edit currently) --- stepmania/src/ScreenEdit.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/stepmania/src/ScreenEdit.cpp b/stepmania/src/ScreenEdit.cpp index 6abcb859ce..8132a4344b 100644 --- a/stepmania/src/ScreenEdit.cpp +++ b/stepmania/src/ScreenEdit.cpp @@ -1771,6 +1771,17 @@ void ScreenEdit::TransitionEditState( EditState em ) if( GAMESTATE->IsSyncDataChanged() ) SCREENMAN->AddNewScreenToTop( "ScreenSaveSync" ); break; + + case STATE_RECORDING: + SaveUndo(); + + // delete old TapNotes in the range + m_NoteDataEdit.ClearRange( m_iStartPlayingAt, m_iStopPlayingAt ); + m_NoteDataEdit.CopyRange( m_NoteDataRecord, m_iStartPlayingAt, m_iStopPlayingAt, m_iStartPlayingAt ); + m_NoteDataRecord.ClearAll(); + + CheckNumberOfNotesAndUndo(); + break; } switch( em ) @@ -1789,20 +1800,9 @@ void ScreenEdit::TransitionEditState( EditState em ) GAMESTATE->m_fSongBeat = Quantize( GAMESTATE->m_fSongBeat, NoteTypeToBeat(m_SnapDisplay.GetNoteType()) ); /* Playing and recording have lead-ins, which may start before beat 0; - * make sure we don't stay there if we escaped out early. */ + * make sure we don't stay there if we escaped out early. */ GAMESTATE->m_fSongBeat = max( GAMESTATE->m_fSongBeat, 0 ); - if( old == STATE_RECORDING ) - { - SaveUndo(); - - // delete old TapNotes in the range - m_NoteDataEdit.ClearRange( m_iStartPlayingAt, m_iStopPlayingAt ); - m_NoteDataEdit.CopyRange( m_NoteDataRecord, m_iStartPlayingAt, m_iStopPlayingAt, m_iStartPlayingAt ); - m_NoteDataRecord.ClearAll(); - - CheckNumberOfNotesAndUndo(); - } break; case STATE_RECORDING: break;