From 1f7389a7a4a5534b9d2f66b700ca8cf515cc1b6a Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Mon, 16 May 2011 10:49:55 -0400 Subject: [PATCH 1/3] [splittiming] Don't do variable swapping. Next up: fixing the editor. --- src/TimingData.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/TimingData.h b/src/TimingData.h index 655a39a2a7..60ac6ae8a8 100644 --- a/src/TimingData.h +++ b/src/TimingData.h @@ -328,8 +328,8 @@ struct WarpSegment * @param s the starting row of this segment. * @param r the number of rows to jump ahead. */ - WarpSegment( int s, int r ): m_iStartRow(max(0, (s < r ? s : r))), - m_fEndBeat(max(0, NoteRowToBeat((r > s ? r : s)))) {} + WarpSegment( int s, int r ): m_iStartRow(s), + m_fEndBeat(NoteRowToBeat(r)) {} /** * @brief Creates a Warp Segment with the specified starting row and beat to warp to. * @param s the starting row of this segment. @@ -351,8 +351,8 @@ struct WarpSegment * @param b the number of beats to jump ahead. */ WarpSegment( float s, float b ): - m_iStartRow(max(0, BeatToNoteRow((s < b ? s : b)))), - m_fEndBeat(max(0, (b > s ? b : s))) {} + m_iStartRow(BeatToNoteRow(s)), + m_fEndBeat(b) {} /** * @brief The row in which the WarpSegment activates. */ @@ -801,8 +801,8 @@ struct FakeSegment * @param s the starting row of this segment. * @param r the number of rows this segment lasts. */ - FakeSegment( int s, int r ): m_iStartRow(max(0, (s < r ? s : r))), - m_fEndBeat(max(0, NoteRowToBeat((r > s ? r : s)))) {} + FakeSegment( int s, int r ): m_iStartRow(s), + m_fEndBeat(NoteRowToBeat(r)) {} /** * @brief Creates a Fake Segment with the specified values. * @param s the starting row of this segment. @@ -824,8 +824,8 @@ struct FakeSegment * @param b the number of beats this segment lasts. */ FakeSegment( float s, float b ): - m_iStartRow(max(0, BeatToNoteRow((s < b ? s : b)))), - m_fEndBeat(max(0, (b > s ? b : s))) {} + m_iStartRow(BeatToNoteRow(s)), + m_fEndBeat(b) {} /** * @brief The row in which the FakeSegment activates. */ From fc72f2de90c857347097a06f6171e8675ee721d0 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Mon, 16 May 2011 10:56:00 -0400 Subject: [PATCH 2/3] [splittiming] Prepare the editor. --- Themes/_fallback/Languages/en.ini | 2 +- src/ScreenEdit.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Themes/_fallback/Languages/en.ini b/Themes/_fallback/Languages/en.ini index 4267bfe208..2c5192464e 100644 --- a/Themes/_fallback/Languages/en.ini +++ b/Themes/_fallback/Languages/en.ini @@ -1231,7 +1231,7 @@ Enter a new Time Signature denominator value.=Enter the note value that represen Enter a new Tickcount value.=Enter a new Tickcount value. Enter a new Combo value.=Enter a new Combo value. Enter a new Label value.=Enter a name for this section of the chart. -Enter a new Warp value.=Enter the beat you will warp to when you reach this point. +Enter a new Warp value.=Enter the number of beats you will warp over. Enter a new Speed percent value.=Enter the ratio for speed scrolling.\n\n1 is the default scroll. Enter a new Speed wait value.=Enter how long in seconds/beats it takes to change.\n\n0 is instant. Enter a new Speed mode value.=Enter how this segment is handled.\n\nType "0" for beats, "1" for seconds. diff --git a/src/ScreenEdit.cpp b/src/ScreenEdit.cpp index 95e51299b0..aa3dd8ca3f 100644 --- a/src/ScreenEdit.cpp +++ b/src/ScreenEdit.cpp @@ -2763,8 +2763,11 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM ) else if ( SM == SM_BackFromWarpChange ) { float fWarp = StringToFloat( ScreenTextEntry::s_sLastAnswer ); - GetAppropriateTiming().SetWarpAtBeat( GetBeat(), fWarp ); - SetDirty( true ); + if( fWarp > 0 ) + { + GetAppropriateTiming().SetWarpAtBeat( GetBeat(), fWarp ); + SetDirty( true ); + } } else if( SM == SM_BackFromSpeedPercentChange ) { From 388eb6bf1014f9f8234a6d5c5f69c4060c086281 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Mon, 16 May 2011 10:57:14 -0400 Subject: [PATCH 3/3] [splittiming] Updated comment. --- src/ScreenEdit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ScreenEdit.cpp b/src/ScreenEdit.cpp index aa3dd8ca3f..680a9598af 100644 --- a/src/ScreenEdit.cpp +++ b/src/ScreenEdit.cpp @@ -2763,7 +2763,7 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM ) else if ( SM == SM_BackFromWarpChange ) { float fWarp = StringToFloat( ScreenTextEntry::s_sLastAnswer ); - if( fWarp > 0 ) + if( fWarp >= 0 ) // allow 0 to kill a warp. { GetAppropriateTiming().SetWarpAtBeat( GetBeat(), fWarp ); SetDirty( true );