diff --git a/stepmania/src/NoteDataUtil.cpp b/stepmania/src/NoteDataUtil.cpp index 60b3e40a27..4fa1d39bd5 100644 --- a/stepmania/src/NoteDataUtil.cpp +++ b/stepmania/src/NoteDataUtil.cpp @@ -1399,6 +1399,7 @@ void NoteDataUtil::AddTapAttacks( NoteData &nd, Song* pSong ) } } +#if 0 // undo this if ScaleRegion breaks more things than it fixes void NoteDataUtil::Scale( NoteData &nd, float fScale ) { ASSERT( fScale > 0 ); @@ -1422,6 +1423,42 @@ void NoteDataUtil::Scale( NoteData &nd, float fScale ) } } } +#endif + +// added to fix things in the editor +void NoteDataUtil::ScaleRegion( NoteData &nd, float fScale, float fStartBeat, float fEndBeat) { + ASSERT( fScale > 0 ); + + NoteData temp1, temp2; + temp1.Config( nd ); + temp2.Config( nd ); + + int iFirstRowAtEndOfRegion = (nd.GetLastRow() > (fEndBeat * ROWS_PER_BEAT)) ? + nd.GetLastRow() : + fEndBeat * ROWS_PER_BEAT; + + temp1.CopyRange( &nd, 0, fStartBeat * ROWS_PER_BEAT ); + temp1.CopyRange( &nd, (fEndBeat - fStartBeat) * fScale * ROWS_PER_BEAT, nd.GetLastRow(), iFirstRowAtEndOfRegion); + temp2.CopyRange( &nd, fStartBeat * ROWS_PER_BEAT, fEndBeat * ROWS_PER_BEAT ); + nd.ClearAll(); + + for( int r=0; r<=temp2.GetLastRow(); r++ ) + { + for( int t=0; t0, add blank rows. If fBeatsToShift<0, delete rows void ShiftRows( NoteData &nd, float fStartBeat, float fBeatsToShift );