From 60b5be592c9f439f52ef6d07b64d9c7b74d3e248 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Sat, 12 Feb 2011 17:57:27 -0500 Subject: [PATCH] Attempt to fix Editor bug with Delays. --- src/NotesLoaderKSF.cpp | 6 ++---- src/ScreenEdit.cpp | 9 ++++----- src/TimingData.cpp | 21 ++++----------------- src/TimingData.h | 4 +--- 4 files changed, 11 insertions(+), 29 deletions(-) diff --git a/src/NotesLoaderKSF.cpp b/src/NotesLoaderKSF.cpp index 497e778052..22656c43a8 100644 --- a/src/NotesLoaderKSF.cpp +++ b/src/NotesLoaderKSF.cpp @@ -529,16 +529,14 @@ static bool LoadGlobalData( const RString &sPath, Song &out, bool &bKIUCompliant else if (BeginsWith(NoteRowString, "|E")) { // Finally! the |E| tag is working as it should. I can die happy now -DaisuMaster - bool bDelay = true; float fCurDelay = 60 / out.m_Timing.GetBPMAtBeat(fCurBeat) * (float)numTemp / iTickCount; - fCurDelay += out.m_Timing.GetStopAtRow(BeatToNoteRow(fCurBeat), bDelay); + fCurDelay += out.m_Timing.GetStopAtRow(BeatToNoteRow(fCurBeat) ); out.m_Timing.SetStopAtBeat( fCurBeat, fCurDelay, true ); continue; } else if (BeginsWith(NoteRowString, "|D")) { - bool bDelay = true; - float fCurDelay = out.m_Timing.GetStopAtRow(BeatToNoteRow(fCurBeat), bDelay); + float fCurDelay = out.m_Timing.GetStopAtRow(BeatToNoteRow(fCurBeat) ); fCurDelay += (float)numTemp / 1000; out.m_Timing.SetStopAtBeat( fCurBeat, fCurDelay, true ); continue; diff --git a/src/ScreenEdit.cpp b/src/ScreenEdit.cpp index 5b196d8bcc..f2e2594e6c 100644 --- a/src/ScreenEdit.cpp +++ b/src/ScreenEdit.cpp @@ -3454,8 +3454,8 @@ void ScreenEdit::HandleAreaMenuChoice( AreaMenuChoice c, const vector &iAns } case convert_pause_to_beat: { - bool bThrowaway; // is it? - float fStopSeconds = m_pSong->m_Timing.GetStopAtRow( BeatToNoteRow(GAMESTATE->m_fSongBeat), bThrowaway ); + // TODO: Convert both Delays and Stops at once. + float fStopSeconds = m_pSong->m_Timing.GetStopAtRow( BeatToNoteRow(GAMESTATE->m_fSongBeat) ); m_pSong->m_Timing.SetStopAtBeat( GAMESTATE->m_fSongBeat, 0 ); float fStopBeats = fStopSeconds * m_pSong->GetBPMAtBeat(GAMESTATE->m_fSongBeat) / 60; @@ -3581,11 +3581,10 @@ void ScreenEdit::HandleTimingDataInformationChoice( TimingDataInformationChoice break; case stop: // todo: Call a screen with class ScreenTextEntry instead. -aj - bool bThrowaway; // is it? ScreenTextEntry::TextEntry( SM_BackFromStopChange, ENTER_STOP_VALUE, - ssprintf( "%.4f", m_pSong->m_Timing.GetStopAtRow( BeatToNoteRow(GAMESTATE->m_fSongBeat), bThrowaway ) ), + ssprintf( "%.4f", m_pSong->m_Timing.GetStopAtRow( BeatToNoteRow(GAMESTATE->m_fSongBeat) ) ), 10 ); break; @@ -3594,7 +3593,7 @@ void ScreenEdit::HandleTimingDataInformationChoice( TimingDataInformationChoice ScreenTextEntry::TextEntry( SM_BackFromDelayChange, ENTER_DELAY_VALUE, - ssprintf( "%.4f", m_pSong->m_Timing.GetStopAtRow( BeatToNoteRow(GAMESTATE->m_fSongBeat), bThrowaway ) ), + ssprintf( "%.4f", m_pSong->m_Timing.GetDelayAtRow( BeatToNoteRow(GAMESTATE->m_fSongBeat) ) ), 10 ); break; diff --git a/src/TimingData.cpp b/src/TimingData.cpp index ee1ed79d5c..773be72a58 100644 --- a/src/TimingData.cpp +++ b/src/TimingData.cpp @@ -176,40 +176,27 @@ void TimingData::SetTickcountAtRow( int iRow, int iTicks ) } } -float TimingData::GetStopAtRow( int iNoteRow, bool &bDelayOut ) const +float TimingData::GetStopAtRow( int iNoteRow, bool bDelay ) const { - bDelayOut = false; // not a delay by default for( unsigned i=0; i