From 8a902dd14d485ff2c1c5449b88cda4babd7beb20 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Sun, 1 May 2011 17:28:36 -0400 Subject: [PATCH] Remember to scale Tickcounts and Combos. --- src/TimingData.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/TimingData.cpp b/src/TimingData.cpp index 0c22562f9f..8efd8ec0e6 100644 --- a/src/TimingData.cpp +++ b/src/TimingData.cpp @@ -720,6 +720,28 @@ void TimingData::ScaleRegion( float fScale, int iStartIndex, int iEndIndex, bool m_WarpSegments[i].m_iStartRow = lrintf((iSegStartRow - iStartIndex) * fScale) + iStartIndex; } + for ( unsigned i = 0; i < m_TickcountSegments.size(); i++ ) + { + const int iSegStart = m_TickcountSegments[i].m_iStartRow; + if( iSegStart < iStartIndex ) + continue; + else if( iSegStart > iEndIndex ) + m_TickcountSegments[i].m_iStartRow += lrintf( (iEndIndex - iStartIndex) * (fScale - 1) ); + else + m_TickcountSegments[i].m_iStartRow = lrintf( (iSegStart - iStartIndex) * fScale ) + iStartIndex; + } + + for ( unsigned i = 0; i < m_ComboSegments.size(); i++ ) + { + const int iSegStart = m_ComboSegments[i].m_iStartRow; + if( iSegStart < iStartIndex ) + continue; + else if( iSegStart > iEndIndex ) + m_ComboSegments[i].m_iStartRow += lrintf( (iEndIndex - iStartIndex) * (fScale - 1) ); + else + m_ComboSegments[i].m_iStartRow = lrintf( (iSegStart - iStartIndex) * fScale ) + iStartIndex; + } + // adjust BPM changes to preserve timing if( bAdjustBPM ) {