From e7db656fa70b0934a61b7f855f4986cdecc30b3a Mon Sep 17 00:00:00 2001 From: "Devin J. Pohly" Date: Wed, 2 Jan 2013 10:56:34 -0500 Subject: [PATCH] ScreenEdit: fix assertion when recording past selection --- src/ScreenEdit.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/ScreenEdit.cpp b/src/ScreenEdit.cpp index 437d8e84aa..0913918d0d 100644 --- a/src/ScreenEdit.cpp +++ b/src/ScreenEdit.cpp @@ -1361,14 +1361,20 @@ void ScreenEdit::Update( float fDeltaTime ) if( fSecsHeld == 0 ) continue; + // TODO: Currently, this will ignore a hold note that's + // held past the end of selection. Ideally the hold + // note should be created, ending right at the end of + // selection (or appropriate quantization). float fStartPlayingAtBeat = NoteRowToBeat(m_iStartPlayingAt); - if( GAMESTATE->m_pPlayerState[PLAYER_1]->m_Position.m_fSongBeat <= fStartPlayingAtBeat ) + float fStopPlayingAtBeat = NoteRowToBeat(m_iStopPlayingAt); + if( GAMESTATE->m_pPlayerState[PLAYER_1]->m_Position.m_fSongBeat <= fStartPlayingAtBeat || + GAMESTATE->m_pPlayerState[PLAYER_1]->m_Position.m_fSongBeat >= fStopPlayingAtBeat ) continue; float fStartedHoldingSeconds = m_pSoundMusic->GetPositionSeconds() - fSecsHeld; float fStartBeat = max( fStartPlayingAtBeat, m_pSteps->m_Timing.GetBeatFromElapsedTime(fStartedHoldingSeconds) ); float fEndBeat = max( fStartBeat, GetBeat() ); - fEndBeat = min( fEndBeat, NoteRowToBeat(m_iStopPlayingAt) ); + fEndBeat = min( fEndBeat, fStopPlayingAtBeat ); // Round start and end to the nearest snap interval fStartBeat = Quantize( fStartBeat, NoteTypeToBeat(m_SnapDisplay.GetNoteType()) );