naming cleanup: iNoteIndex -> row
This commit is contained in:
@@ -44,13 +44,13 @@ void NoteData::SetNumTracks( int iNewNumTracks )
|
||||
}
|
||||
|
||||
|
||||
/* Clear [iNoteIndexBegin,iNoteIndexEnd]; that is, including iNoteIndexEnd. */
|
||||
void NoteData::ClearRange( int iNoteIndexBegin, int iNoteIndexEnd )
|
||||
/* Clear [rowBegin,rowEnd]; that is, including rowEnd. */
|
||||
void NoteData::ClearRange( int rowBegin, int rowEnd )
|
||||
{
|
||||
this->ConvertHoldNotesTo4s();
|
||||
for( int t=0; t<GetNumTracks(); t++ )
|
||||
{
|
||||
FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE( *this, t, i, iNoteIndexBegin, iNoteIndexEnd )
|
||||
FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE( *this, t, i, rowBegin, rowEnd )
|
||||
SetTapNote(t, i, TAP_EMPTY);
|
||||
}
|
||||
this->Convert4sToHoldNotes();
|
||||
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
void MoveTapNoteTrack( int dest, int src );
|
||||
void SetTapNote( int track, int row, TapNote tn );
|
||||
|
||||
void ClearRange( int iNoteIndexBegin, int iNoteIndexEnd );
|
||||
void ClearRange( int rowBegin, int rowEnd );
|
||||
void ClearAll();
|
||||
void CopyRange( const NoteData& from, int iFromIndexBegin, int iFromIndexEnd, int iToIndexBegin = 0 );
|
||||
void CopyAll( const NoteData& from );
|
||||
|
||||
@@ -1291,13 +1291,13 @@ void NoteDataUtil::SnapToNearestNoteType( NoteData &in, NoteType nt1, NoteType n
|
||||
default: ASSERT( false ); return;
|
||||
}
|
||||
|
||||
int iNoteIndexBegin = BeatToNoteRow( fBeginBeat );
|
||||
int iNoteIndexEnd = BeatToNoteRow( fEndBeat );
|
||||
int rowBegin = BeatToNoteRow( fBeginBeat );
|
||||
int rowEnd = BeatToNoteRow( fEndBeat );
|
||||
|
||||
in.ConvertHoldNotesTo2sAnd3s();
|
||||
|
||||
// iterate over all TapNotes in the interval and snap them
|
||||
for( int i=iNoteIndexBegin; i<=iNoteIndexEnd; i++ )
|
||||
for( int i=rowBegin; i<=rowEnd; i++ )
|
||||
{
|
||||
int iOldIndex = i;
|
||||
float fOldBeat = NoteRowToBeat( iOldIndex );
|
||||
|
||||
+11
-11
@@ -34,16 +34,16 @@ float NoteTypeToBeat( NoteType nt )
|
||||
}
|
||||
}
|
||||
|
||||
NoteType GetNoteType( int iNoteIndex )
|
||||
NoteType GetNoteType( int row )
|
||||
{
|
||||
if( iNoteIndex % (ROWS_PER_MEASURE/4) == 0) return NOTE_TYPE_4TH;
|
||||
else if( iNoteIndex % (ROWS_PER_MEASURE/8) == 0) return NOTE_TYPE_8TH;
|
||||
else if( iNoteIndex % (ROWS_PER_MEASURE/12) == 0) return NOTE_TYPE_12TH;
|
||||
else if( iNoteIndex % (ROWS_PER_MEASURE/16) == 0) return NOTE_TYPE_16TH;
|
||||
else if( iNoteIndex % (ROWS_PER_MEASURE/24) == 0) return NOTE_TYPE_24TH;
|
||||
else if( iNoteIndex % (ROWS_PER_MEASURE/32) == 0) return NOTE_TYPE_32ND;
|
||||
else if( iNoteIndex % (ROWS_PER_MEASURE/48) == 0) return NOTE_TYPE_48TH;
|
||||
else if( iNoteIndex % (ROWS_PER_MEASURE/64) == 0) return NOTE_TYPE_64TH;
|
||||
if( row % (ROWS_PER_MEASURE/4) == 0) return NOTE_TYPE_4TH;
|
||||
else if( row % (ROWS_PER_MEASURE/8) == 0) return NOTE_TYPE_8TH;
|
||||
else if( row % (ROWS_PER_MEASURE/12) == 0) return NOTE_TYPE_12TH;
|
||||
else if( row % (ROWS_PER_MEASURE/16) == 0) return NOTE_TYPE_16TH;
|
||||
else if( row % (ROWS_PER_MEASURE/24) == 0) return NOTE_TYPE_24TH;
|
||||
else if( row % (ROWS_PER_MEASURE/32) == 0) return NOTE_TYPE_32ND;
|
||||
else if( row % (ROWS_PER_MEASURE/48) == 0) return NOTE_TYPE_48TH;
|
||||
else if( row % (ROWS_PER_MEASURE/64) == 0) return NOTE_TYPE_64TH;
|
||||
else return NOTE_TYPE_INVALID;
|
||||
};
|
||||
|
||||
@@ -70,9 +70,9 @@ NoteType BeatToNoteType( float fBeat )
|
||||
return GetNoteType( BeatToNoteRow(fBeat) );
|
||||
}
|
||||
|
||||
bool IsNoteOfType( int iNoteIndex, NoteType t )
|
||||
bool IsNoteOfType( int row, NoteType t )
|
||||
{
|
||||
return GetNoteType(iNoteIndex) == t;
|
||||
return GetNoteType(row) == t;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -109,15 +109,15 @@ enum NoteType
|
||||
};
|
||||
|
||||
float NoteTypeToBeat( NoteType nt );
|
||||
NoteType GetNoteType( int iNoteIndex );
|
||||
NoteType GetNoteType( int row );
|
||||
NoteType BeatToNoteType( float fBeat );
|
||||
bool IsNoteOfType( int iNoteIndex, NoteType t );
|
||||
bool IsNoteOfType( int row, NoteType t );
|
||||
CString NoteTypeToString( NoteType nt );
|
||||
|
||||
inline int BeatToNoteRow( float fBeatNum ) { return int( fBeatNum * ROWS_PER_BEAT + 0.5f); }; // round
|
||||
inline int BeatToNoteRowNotRounded( float fBeatNum ) { return (int)( fBeatNum * ROWS_PER_BEAT ); };
|
||||
inline float NoteRowToBeat( float fNoteIndex ) { return fNoteIndex / (float)ROWS_PER_BEAT; };
|
||||
inline float NoteRowToBeat( int iNoteIndex ) { return NoteRowToBeat( (float)iNoteIndex ); };
|
||||
inline float NoteRowToBeat( int row ) { return NoteRowToBeat( (float)row ); };
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -300,7 +300,7 @@ bool BMSLoader::LoadFromBMSFile( const CString &sPath, Steps &out, const map<CSt
|
||||
{
|
||||
float fPercentThroughMeasure = (float)j/(float)uNumNotesInThisMeasure;
|
||||
|
||||
const int iNoteIndex = (int) ( (iMeasureNo + fPercentThroughMeasure)
|
||||
const int row = (int) ( (iMeasureNo + fPercentThroughMeasure)
|
||||
* BEATS_PER_MEASURE * ROWS_PER_BEAT );
|
||||
BmsTrack bmsTrack;
|
||||
bool bIsHold;
|
||||
@@ -313,7 +313,7 @@ bool BMSLoader::LoadFromBMSFile( const CString &sPath, Steps &out, const map<CSt
|
||||
{
|
||||
TapNote tn = vTapNotes[j];
|
||||
tn.type = bIsHold ? TapNote::hold_head : TapNote::tap;
|
||||
ndNotes.SetTapNote( bmsTrack, iNoteIndex, tn );
|
||||
ndNotes.SetTapNote( bmsTrack, row, tn );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1317,13 +1317,13 @@ void ScreenEdit::TransitionFromRecordToEdit()
|
||||
{
|
||||
TransitionToEdit();
|
||||
|
||||
int iNoteIndexBegin = BeatToNoteRow( m_NoteFieldEdit.m_fBeginMarker );
|
||||
int iNoteIndexEnd = BeatToNoteRow( m_NoteFieldEdit.m_fEndMarker );
|
||||
int rowBegin = BeatToNoteRow( m_NoteFieldEdit.m_fBeginMarker );
|
||||
int rowEnd = BeatToNoteRow( m_NoteFieldEdit.m_fEndMarker );
|
||||
|
||||
// delete old TapNotes in the range
|
||||
m_NoteFieldEdit.ClearRange( iNoteIndexBegin, iNoteIndexEnd );
|
||||
m_NoteFieldEdit.ClearRange( rowBegin, rowEnd );
|
||||
|
||||
m_NoteFieldEdit.CopyRange( m_NoteFieldRecord, iNoteIndexBegin, iNoteIndexEnd, iNoteIndexBegin );
|
||||
m_NoteFieldEdit.CopyRange( m_NoteFieldRecord, rowBegin, rowEnd, rowBegin );
|
||||
}
|
||||
|
||||
/* Helper for SM_DoReloadFromDisk */
|
||||
|
||||
Reference in New Issue
Block a user