fix some cases of transforms brute-force iterating over rows
This commit is contained in:
@@ -276,6 +276,8 @@ void NoteDataUtil::LoadTransformedSlidingWindow( const NoteData &in, NoteData &o
|
|||||||
int bOffsetIncreasing = true;
|
int bOffsetIncreasing = true;
|
||||||
|
|
||||||
int iLastRow = Original.GetLastRow();
|
int iLastRow = Original.GetLastRow();
|
||||||
|
|
||||||
|
int iLastMeasure = 0;
|
||||||
for( int r=0; r<=iLastRow; )
|
for( int r=0; r<=iLastRow; )
|
||||||
{
|
{
|
||||||
// copy notes in this measure
|
// copy notes in this measure
|
||||||
@@ -288,7 +290,8 @@ void NoteDataUtil::LoadTransformedSlidingWindow( const NoteData &in, NoteData &o
|
|||||||
}
|
}
|
||||||
r++;
|
r++;
|
||||||
|
|
||||||
if( r % (ROWS_PER_MEASURE*4) == 0 ) // adjust sliding window every 4 measures
|
const int iMeasure = r / ROWS_PER_MEASURE;
|
||||||
|
if( iMeasure / 4 != iLastMeasure / 4 ) // adjust sliding window every 4 measures
|
||||||
{
|
{
|
||||||
// See if there is a hold crossing the beginning of this measure
|
// See if there is a hold crossing the beginning of this measure
|
||||||
bool bHoldCrossesThisMeasure = false;
|
bool bHoldCrossesThisMeasure = false;
|
||||||
@@ -313,6 +316,8 @@ void NoteDataUtil::LoadTransformedSlidingWindow( const NoteData &in, NoteData &o
|
|||||||
CLAMP( iCurTrackOffset, iTrackOffsetMin, iTrackOffsetMax );
|
CLAMP( iCurTrackOffset, iTrackOffsetMin, iTrackOffsetMax );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
iLastMeasure = iMeasure;
|
||||||
}
|
}
|
||||||
|
|
||||||
out.Convert4sToHoldNotes();
|
out.Convert4sToHoldNotes();
|
||||||
@@ -894,7 +899,7 @@ void NoteDataUtil::Wide( NoteData &inout, float fStartBeat, float fEndBeat )
|
|||||||
continue; // skip
|
continue; // skip
|
||||||
|
|
||||||
bool bSpaceAroundIsEmpty = true; // no other notes with a 1/8th of this row
|
bool bSpaceAroundIsEmpty = true; // no other notes with a 1/8th of this row
|
||||||
for( int j=i-ROWS_PER_BEAT/2+1; j<i+ROWS_PER_BEAT/2-1; j++ )
|
FOREACH_NONEMPTY_ROW_ALL_TRACKS_RANGE( inout, j, i-ROWS_PER_BEAT/2+1, i+ROWS_PER_BEAT/2 )
|
||||||
if( j!=i && inout.GetNumTapNonEmptyTracks(j) > 0 )
|
if( j!=i && inout.GetNumTapNonEmptyTracks(j) > 0 )
|
||||||
{
|
{
|
||||||
bSpaceAroundIsEmpty = false;
|
bSpaceAroundIsEmpty = false;
|
||||||
@@ -994,16 +999,12 @@ void NoteDataUtil::InsertIntelligentTaps(
|
|||||||
|
|
||||||
// don't insert a new note if there's already one within this interval
|
// don't insert a new note if there's already one within this interval
|
||||||
bool bNoteInMiddle = false;
|
bool bNoteInMiddle = false;
|
||||||
for( int j=iRowEarlier+1; j<=iRowLater-1; j++ )
|
FOREACH_NONEMPTY_ROW_ALL_TRACKS_RANGE( inout, j, iRowEarlier+1, iRowLater-1 )
|
||||||
if( !inout.IsRowEmpty(j) )
|
|
||||||
{
|
|
||||||
bNoteInMiddle = true;
|
bNoteInMiddle = true;
|
||||||
break;
|
|
||||||
}
|
|
||||||
if( bNoteInMiddle )
|
if( bNoteInMiddle )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// add a note determinitsitcally somewhere on a track different from the two surrounding notes
|
// add a note deterministically somewhere on a track different from the two surrounding notes
|
||||||
int iTrackOfNoteEarlier = -1;
|
int iTrackOfNoteEarlier = -1;
|
||||||
bool bEarlierHasNonEmptyTrack = inout.GetTapFirstNonEmptyTrack( iRowEarlier, iTrackOfNoteEarlier );
|
bool bEarlierHasNonEmptyTrack = inout.GetTapFirstNonEmptyTrack( iRowEarlier, iTrackOfNoteEarlier );
|
||||||
int iTrackOfNoteLater = -1;
|
int iTrackOfNoteLater = -1;
|
||||||
@@ -1058,13 +1059,13 @@ void NoteDataUtil::AddMines( NoteData &inout, float fStartBeat, float fEndBeat )
|
|||||||
|
|
||||||
int iRowCount = 0;
|
int iRowCount = 0;
|
||||||
int iPlaceEveryRows = 6;
|
int iPlaceEveryRows = 6;
|
||||||
for( int r=first_row; r<=last_row; r++ )
|
FOREACH_NONEMPTY_ROW_ALL_TRACKS_RANGE( inout, r, first_row, last_row )
|
||||||
{
|
|
||||||
if( !inout.IsRowEmpty(r) )
|
|
||||||
{
|
{
|
||||||
iRowCount++;
|
iRowCount++;
|
||||||
|
|
||||||
// place every 6 or 7 rows
|
// place every 6 or 7 rows
|
||||||
|
// XXX: What is "6 or 7" derived from? Can we calculate that in a way
|
||||||
|
// that won't break if ROWS_PER_MEASURE changes?
|
||||||
if( iRowCount>=iPlaceEveryRows )
|
if( iRowCount>=iPlaceEveryRows )
|
||||||
{
|
{
|
||||||
for( int t=0; t<inout.GetNumTracks(); t++ )
|
for( int t=0; t<inout.GetNumTracks(); t++ )
|
||||||
@@ -1078,7 +1079,6 @@ void NoteDataUtil::AddMines( NoteData &inout, float fStartBeat, float fEndBeat )
|
|||||||
iPlaceEveryRows = 6;
|
iPlaceEveryRows = 6;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Place mines right after hold so player must lift their foot.
|
// Place mines right after hold so player must lift their foot.
|
||||||
for( int i=0; i<inout.GetNumHoldNotes(); i++ )
|
for( int i=0; i<inout.GetNumHoldNotes(); i++ )
|
||||||
@@ -1135,12 +1135,8 @@ void NoteDataUtil::Echo( NoteData &inout, float fStartBeat, float fEndBeat )
|
|||||||
|
|
||||||
// don't insert a new note if there's already a tap within this interval
|
// don't insert a new note if there's already a tap within this interval
|
||||||
bool bTapInMiddle = false;
|
bool bTapInMiddle = false;
|
||||||
for( int r2=iRowWindowBegin+1; r2<=iRowWindowEnd-1; r2++ )
|
FOREACH_NONEMPTY_ROW_ALL_TRACKS_RANGE( inout, r2, iRowWindowBegin+1, iRowWindowEnd-1 )
|
||||||
if( !inout.IsRowEmpty(r2) )
|
|
||||||
{
|
|
||||||
bTapInMiddle = true;
|
bTapInMiddle = true;
|
||||||
break;
|
|
||||||
}
|
|
||||||
if( bTapInMiddle )
|
if( bTapInMiddle )
|
||||||
continue; // don't lay
|
continue; // don't lay
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user