[warps] Thanks for the assistance there Thai.
This commit is contained in:
+1
-1
@@ -3503,7 +3503,7 @@ void ScreenEdit::HandleAreaMenuChoice( AreaMenuChoice c, const vector<int> &iAns
|
|||||||
|
|
||||||
// don't move the step from where it is, just move everything later
|
// don't move the step from where it is, just move everything later
|
||||||
NoteDataUtil::InsertRows( m_NoteDataEdit, BeatToNoteRow(GAMESTATE->m_fSongBeat) + 1, BeatToNoteRow(fStopBeats) );
|
NoteDataUtil::InsertRows( m_NoteDataEdit, BeatToNoteRow(GAMESTATE->m_fSongBeat) + 1, BeatToNoteRow(fStopBeats) );
|
||||||
m_pSong->m_Timing.InsertRows( BeatToNoteRow(GAMESTATE->m_fSongBeat) + 1, BeatToNoteRow(fStopSeconds) );
|
m_pSong->m_Timing.InsertRows( BeatToNoteRow(GAMESTATE->m_fSongBeat) + 1, BeatToNoteRow(fStopBeats) );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case undo:
|
case undo:
|
||||||
|
|||||||
+25
-1
@@ -688,6 +688,25 @@ void TimingData::ScaleRegion( float fScale, int iStartIndex, int iEndIndex, bool
|
|||||||
m_StopSegments[i].m_iStartRow = lrintf((iSegStartRow - iStartIndex) * fScale) + iStartIndex;
|
m_StopSegments[i].m_iStartRow = lrintf((iSegStartRow - iStartIndex) * fScale) + iStartIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for( unsigned i = 0; i < m_WarpSegments.size(); i++ )
|
||||||
|
{
|
||||||
|
const int iSegStartRow = m_WarpSegments[i].m_iStartRow;
|
||||||
|
const int iSegEndRow = BeatToNoteRow( m_WarpSegments[i].m_fEndBeat );
|
||||||
|
if( iSegEndRow >= iStartIndex )
|
||||||
|
{
|
||||||
|
if( iSegEndRow > iEndIndex )
|
||||||
|
m_WarpSegments[i].m_fEndBeat += NoteRowToBeat(lrintf((iEndIndex - iStartIndex) * (fScale - 1)));
|
||||||
|
else
|
||||||
|
m_WarpSegments[i].m_fEndBeat = NoteRowToBeat(lrintf((iSegEndRow - iStartIndex) * fScale) + iStartIndex);
|
||||||
|
}
|
||||||
|
if( iSegStartRow < iStartIndex )
|
||||||
|
continue;
|
||||||
|
else if( iSegStartRow > iEndIndex )
|
||||||
|
m_WarpSegments[i].m_iStartRow += lrintf((iEndIndex - iStartIndex) * (fScale - 1));
|
||||||
|
else
|
||||||
|
m_WarpSegments[i].m_iStartRow = lrintf((iSegStartRow - iStartIndex) * fScale) + iStartIndex;
|
||||||
|
}
|
||||||
|
|
||||||
// adjust BPM changes to preserve timing
|
// adjust BPM changes to preserve timing
|
||||||
if( bAdjustBPM )
|
if( bAdjustBPM )
|
||||||
{
|
{
|
||||||
@@ -735,7 +754,9 @@ void TimingData::InsertRows( int iStartRow, int iRowsToAdd )
|
|||||||
for( unsigned i = 0; i < m_WarpSegments.size(); i++ )
|
for( unsigned i = 0; i < m_WarpSegments.size(); i++ )
|
||||||
{
|
{
|
||||||
WarpSegment &warp = m_WarpSegments[i];
|
WarpSegment &warp = m_WarpSegments[i];
|
||||||
if (warp.m_iStartRow < iStartRow )
|
if( BeatToNoteRow(warp.m_fEndBeat) >= iStartRow )
|
||||||
|
warp.m_fEndBeat += NoteRowToBeat(iRowsToAdd);
|
||||||
|
if( warp.m_iStartRow < iStartRow )
|
||||||
continue;
|
continue;
|
||||||
warp.m_iStartRow += iRowsToAdd;
|
warp.m_iStartRow += iRowsToAdd;
|
||||||
}
|
}
|
||||||
@@ -825,6 +846,9 @@ void TimingData::DeleteRows( int iStartRow, int iRowsToDelete )
|
|||||||
{
|
{
|
||||||
WarpSegment &warp = m_WarpSegments[i];
|
WarpSegment &warp = m_WarpSegments[i];
|
||||||
|
|
||||||
|
if( BeatToNoteRow(warp.m_fEndBeat) >= iStartRow )
|
||||||
|
warp.m_fEndBeat = max( NoteRowToBeat(iStartRow), warp.m_fEndBeat - NoteRowToBeat(iRowsToDelete) );
|
||||||
|
|
||||||
if( warp.m_iStartRow < iStartRow )
|
if( warp.m_iStartRow < iStartRow )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user