fix play starting past end of notes causes goofy looping

This commit is contained in:
Chris Danford
2006-04-24 22:03:59 +00:00
parent ee0f16cee8
commit 92605c07df
+4 -4
View File
@@ -1812,7 +1812,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
if( g_iDefaultRecordLength.Get() == -1 ) if( g_iDefaultRecordLength.Get() == -1 )
{ {
m_iStartPlayingAt = BeatToNoteRow(GAMESTATE->m_fSongBeat); m_iStartPlayingAt = BeatToNoteRow(GAMESTATE->m_fSongBeat);
m_iStopPlayingAt = m_NoteDataEdit.GetLastRow() + 1; m_iStopPlayingAt = max( m_iStartPlayingAt, m_NoteDataEdit.GetLastRow() + 1 );
} }
else else
{ {
@@ -1834,7 +1834,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
break; break;
case EDIT_BUTTON_RECORD_FROM_CURSOR: case EDIT_BUTTON_RECORD_FROM_CURSOR:
m_iStartPlayingAt = BeatToNoteRow(GAMESTATE->m_fSongBeat); m_iStartPlayingAt = BeatToNoteRow(GAMESTATE->m_fSongBeat);
m_iStopPlayingAt = m_NoteDataEdit.GetLastRow(); m_iStopPlayingAt = max( m_iStartPlayingAt, m_NoteDataEdit.GetLastRow() );
TransitionEditState( STATE_RECORDING ); TransitionEditState( STATE_RECORDING );
break; break;
@@ -2657,14 +2657,14 @@ void ScreenEdit::HandleMainMenuChoice( MainMenuChoice c, const vector<int> &iAns
case play_selection_start_to_end: case play_selection_start_to_end:
{ {
m_iStartPlayingAt = m_NoteFieldEdit.m_iBeginMarker; m_iStartPlayingAt = m_NoteFieldEdit.m_iBeginMarker;
m_iStopPlayingAt = m_NoteDataEdit.GetLastRow(); m_iStopPlayingAt = max( m_iStartPlayingAt, m_NoteDataEdit.GetLastRow() );
TransitionEditState( STATE_PLAYING ); TransitionEditState( STATE_PLAYING );
} }
break; break;
case play_current_beat_to_end: case play_current_beat_to_end:
{ {
m_iStartPlayingAt = BeatToNoteRow(GAMESTATE->m_fSongBeat); m_iStartPlayingAt = BeatToNoteRow(GAMESTATE->m_fSongBeat);
m_iStopPlayingAt = m_NoteDataEdit.GetLastRow(); m_iStopPlayingAt = max( m_iStartPlayingAt, m_NoteDataEdit.GetLastRow() );
TransitionEditState( STATE_PLAYING ); TransitionEditState( STATE_PLAYING );
} }
break; break;