cleanup: variable name and const
This commit is contained in:
+90
-59
@@ -50,8 +50,8 @@ void NoteData::ClearRange( int rowBegin, int rowEnd )
|
|||||||
this->ConvertHoldNotesTo4s();
|
this->ConvertHoldNotesTo4s();
|
||||||
for( int t=0; t<GetNumTracks(); t++ )
|
for( int t=0; t<GetNumTracks(); t++ )
|
||||||
{
|
{
|
||||||
FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE( *this, t, i, rowBegin, rowEnd )
|
FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE( *this, t, r, rowBegin, rowEnd )
|
||||||
SetTapNote(t, i, TAP_EMPTY);
|
SetTapNote(t, r, TAP_EMPTY);
|
||||||
}
|
}
|
||||||
this->Convert4sToHoldNotes();
|
this->Convert4sToHoldNotes();
|
||||||
}
|
}
|
||||||
@@ -65,7 +65,7 @@ void NoteData::ClearAll()
|
|||||||
|
|
||||||
/* Copy a range from pFrom to this. (Note that this does *not* overlay;
|
/* Copy a range from pFrom to this. (Note that this does *not* overlay;
|
||||||
* all data in the range is overwritten.) */
|
* all data in the range is overwritten.) */
|
||||||
void NoteData::CopyRange( const NoteData& from, int iFromIndexBegin, int iFromIndexEnd, int iToIndexBegin )
|
void NoteData::CopyRange( const NoteData& from, int rowFromBegin, int rowFromEnd, int rowToBegin )
|
||||||
{
|
{
|
||||||
ASSERT( from.GetNumTracks() == GetNumTracks() );
|
ASSERT( from.GetNumTracks() == GetNumTracks() );
|
||||||
|
|
||||||
@@ -77,10 +77,10 @@ void NoteData::CopyRange( const NoteData& from, int iFromIndexBegin, int iFromIn
|
|||||||
|
|
||||||
for( int t=0; t<GetNumTracks(); t++ )
|
for( int t=0; t<GetNumTracks(); t++ )
|
||||||
{
|
{
|
||||||
FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE( From, t, iFrom, iFromIndexBegin, iFromIndexEnd )
|
FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE( From, t, iFrom, rowFromBegin, rowFromEnd )
|
||||||
{
|
{
|
||||||
int iTo = iToIndexBegin + iFrom - iFromIndexBegin;
|
int iTo = rowToBegin + iFrom - rowFromBegin;
|
||||||
TapNote tn = From.GetTapNote( t, iFrom );
|
const TapNote &tn = From.GetTapNote( t, iFrom );
|
||||||
To.SetTapNote( t, iTo, tn );
|
To.SetTapNote( t, iTo, tn );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -103,88 +103,119 @@ void NoteData::CopyAll( const NoteData& from )
|
|||||||
m_HoldNotes = from.m_HoldNotes;
|
m_HoldNotes = from.m_HoldNotes;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NoteData::IsRowEmpty( int index ) const
|
bool NoteData::IsRowEmpty( int row ) const
|
||||||
{
|
{
|
||||||
for( int t=0; t<GetNumTracks(); t++ )
|
for( int t=0; t<GetNumTracks(); t++ )
|
||||||
if( GetTapNoteX(t, index).type != TapNote::empty )
|
if( GetTapNoteX(t, row).type != TapNote::empty )
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NoteData::IsRangeEmpty( int track, int iIndexBegin, int iIndexEnd ) const
|
bool NoteData::IsRangeEmpty( int track, int rowBegin, int rowEnd ) const
|
||||||
{
|
{
|
||||||
ASSERT( track < GetNumTracks() );
|
ASSERT( track < GetNumTracks() );
|
||||||
|
|
||||||
FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE( *this, track, i, iIndexBegin, iIndexEnd )
|
FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE( *this, track, r, rowBegin, rowEnd )
|
||||||
if( GetTapNoteX(track,i).type != TapNote::empty )
|
if( GetTapNoteX(track,r).type != TapNote::empty )
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int NoteData::GetNumTapNonEmptyTracks( int index ) const
|
int NoteData::GetNumTapNonEmptyTracks( int row ) const
|
||||||
{
|
{
|
||||||
int iNum = 0;
|
int iNum = 0;
|
||||||
for( int t=0; t<GetNumTracks(); t++ )
|
for( int t=0; t<GetNumTracks(); t++ )
|
||||||
if( GetTapNote(t, index).type != TapNote::empty )
|
if( GetTapNote(t, row).type != TapNote::empty )
|
||||||
iNum++;
|
iNum++;
|
||||||
return iNum;
|
return iNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NoteData::GetTapNonEmptyTracks( int index, set<int>& addTo ) const
|
void NoteData::GetTapNonEmptyTracks( int row, set<int>& addTo ) const
|
||||||
{
|
{
|
||||||
for( int t=0; t<GetNumTracks(); t++ )
|
for( int t=0; t<GetNumTracks(); t++ )
|
||||||
if( GetTapNote(t, index).type != TapNote::empty )
|
if( GetTapNote(t, row).type != TapNote::empty )
|
||||||
addTo.insert(t);
|
addTo.insert(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
int NoteData::GetFirstNonEmptyTrack( int index ) const
|
bool NoteData::GetTapFirstNonEmptyTrack( int row, int &iNonEmptyTrackOut ) const
|
||||||
{
|
{
|
||||||
for( int t=0; t<GetNumTracks(); t++ )
|
for( int t=0; t<GetNumTracks(); t++ )
|
||||||
if( GetTapNoteX( t, index ).type != TapNote::empty )
|
{
|
||||||
return t;
|
if( GetTapNoteX( t, row ).type != TapNote::empty )
|
||||||
return -1;
|
{
|
||||||
|
iNonEmptyTrackOut = t;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int NoteData::GetNumTracksWithTap( int index ) const
|
bool NoteData::GetTapFirstEmptyTrack( int row, int &iEmptyTrackOut ) const
|
||||||
|
{
|
||||||
|
for( int t=0; t<GetNumTracks(); t++ )
|
||||||
|
{
|
||||||
|
if( GetTapNoteX( t, row ).type == TapNote::empty )
|
||||||
|
{
|
||||||
|
iEmptyTrackOut = t;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NoteData::GetTapLastEmptyTrack( int row, int &iEmptyTrackOut ) const
|
||||||
|
{
|
||||||
|
for( int t=GetNumTracks()-1; t>=0; t-- )
|
||||||
|
{
|
||||||
|
if( GetTapNoteX( t, row ).type == TapNote::empty )
|
||||||
|
{
|
||||||
|
iEmptyTrackOut = t;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
int NoteData::GetNumTracksWithTap( int row ) const
|
||||||
{
|
{
|
||||||
int iNum = 0;
|
int iNum = 0;
|
||||||
for( int t=0; t<GetNumTracks(); t++ )
|
for( int t=0; t<GetNumTracks(); t++ )
|
||||||
{
|
{
|
||||||
TapNote tn = GetTapNoteX( t, index );
|
const TapNote &tn = GetTapNoteX( t, row );
|
||||||
if( tn.type == TapNote::tap )
|
if( tn.type == TapNote::tap )
|
||||||
iNum++;
|
iNum++;
|
||||||
}
|
}
|
||||||
return iNum;
|
return iNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
int NoteData::GetNumTracksWithTapOrHoldHead( int index ) const
|
int NoteData::GetNumTracksWithTapOrHoldHead( int row ) const
|
||||||
{
|
{
|
||||||
int iNum = 0;
|
int iNum = 0;
|
||||||
for( int t=0; t<GetNumTracks(); t++ )
|
for( int t=0; t<GetNumTracks(); t++ )
|
||||||
{
|
{
|
||||||
TapNote tn = GetTapNoteX( t, index );
|
const TapNote &tn = GetTapNoteX( t, row );
|
||||||
if( tn.type == TapNote::tap || tn.type == TapNote::hold_head )
|
if( tn.type == TapNote::tap || tn.type == TapNote::hold_head )
|
||||||
iNum++;
|
iNum++;
|
||||||
}
|
}
|
||||||
return iNum;
|
return iNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
int NoteData::GetFirstTrackWithTap( int index ) const
|
int NoteData::GetFirstTrackWithTap( int row ) const
|
||||||
{
|
{
|
||||||
for( int t=0; t<GetNumTracks(); t++ )
|
for( int t=0; t<GetNumTracks(); t++ )
|
||||||
{
|
{
|
||||||
TapNote tn = GetTapNoteX( t, index );
|
const TapNote &tn = GetTapNoteX( t, row );
|
||||||
if( tn.type == TapNote::tap )
|
if( tn.type == TapNote::tap )
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int NoteData::GetFirstTrackWithTapOrHoldHead( int index ) const
|
int NoteData::GetFirstTrackWithTapOrHoldHead( int row ) const
|
||||||
{
|
{
|
||||||
for( int t=0; t<GetNumTracks(); t++ )
|
for( int t=0; t<GetNumTracks(); t++ )
|
||||||
{
|
{
|
||||||
TapNote tn = GetTapNoteX( t, index );
|
const TapNote &tn = GetTapNoteX( t, row );
|
||||||
if( tn.type == TapNote::tap || tn.type == TapNote::hold_head )
|
if( tn.type == TapNote::tap || tn.type == TapNote::hold_head )
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
@@ -333,9 +364,9 @@ int NoteData::GetNumTapNotes( float fStartBeat, float fEndBeat ) const
|
|||||||
|
|
||||||
for( int t=0; t<GetNumTracks(); t++ )
|
for( int t=0; t<GetNumTracks(); t++ )
|
||||||
{
|
{
|
||||||
FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE( *this, t, i, iStartIndex, iEndIndex )
|
FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE( *this, t, r, iStartIndex, iEndIndex )
|
||||||
{
|
{
|
||||||
TapNote tn = GetTapNoteX(t, i);
|
const TapNote &tn = GetTapNoteX(t, r);
|
||||||
if( tn.type != TapNote::empty && tn.type != TapNote::mine )
|
if( tn.type != TapNote::empty && tn.type != TapNote::mine )
|
||||||
iNumNotes++;
|
iNumNotes++;
|
||||||
}
|
}
|
||||||
@@ -354,8 +385,8 @@ int NoteData::GetNumRowsWithTap( float fStartBeat, float fEndBeat ) const
|
|||||||
int iStartIndex = BeatToNoteRow( fStartBeat );
|
int iStartIndex = BeatToNoteRow( fStartBeat );
|
||||||
int iEndIndex = BeatToNoteRow( fEndBeat );
|
int iEndIndex = BeatToNoteRow( fEndBeat );
|
||||||
|
|
||||||
FOREACH_NONEMPTY_ROW_ALL_TRACKS_RANGE( *this, i, iStartIndex, iEndIndex )
|
FOREACH_NONEMPTY_ROW_ALL_TRACKS_RANGE( *this, r, iStartIndex, iEndIndex )
|
||||||
if( IsThereATapAtRow(i) )
|
if( IsThereATapAtRow(r) )
|
||||||
iNumNotes++;
|
iNumNotes++;
|
||||||
|
|
||||||
return iNumNotes;
|
return iNumNotes;
|
||||||
@@ -377,8 +408,8 @@ int NoteData::GetNumMines( float fStartBeat, float fEndBeat ) const
|
|||||||
|
|
||||||
for( int t=0; t<GetNumTracks(); t++ )
|
for( int t=0; t<GetNumTracks(); t++ )
|
||||||
{
|
{
|
||||||
FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE( *this, t, i, iStartIndex, iEndIndex )
|
FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE( *this, t, r, iStartIndex, iEndIndex )
|
||||||
if( GetTapNoteX(t, i).type == TapNote::mine )
|
if( GetTapNoteX(t, r).type == TapNote::mine )
|
||||||
iNumMines++;
|
iNumMines++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -395,8 +426,8 @@ int NoteData::GetNumRowsWithTapOrHoldHead( float fStartBeat, float fEndBeat ) co
|
|||||||
int iStartIndex = BeatToNoteRow( fStartBeat );
|
int iStartIndex = BeatToNoteRow( fStartBeat );
|
||||||
int iEndIndex = BeatToNoteRow( fEndBeat );
|
int iEndIndex = BeatToNoteRow( fEndBeat );
|
||||||
|
|
||||||
FOREACH_NONEMPTY_ROW_ALL_TRACKS_RANGE( *this, i, iStartIndex, iEndIndex )
|
FOREACH_NONEMPTY_ROW_ALL_TRACKS_RANGE( *this, r, iStartIndex, iEndIndex )
|
||||||
if( IsThereATapOrHoldHeadAtRow(i) )
|
if( IsThereATapOrHoldHeadAtRow(r) )
|
||||||
iNumNotes++;
|
iNumNotes++;
|
||||||
|
|
||||||
return iNumNotes;
|
return iNumNotes;
|
||||||
@@ -407,7 +438,7 @@ int NoteData::RowNeedsHands( const int row ) const
|
|||||||
int iNumNotesThisIndex = 0;
|
int iNumNotesThisIndex = 0;
|
||||||
for( int t=0; t<GetNumTracks(); t++ )
|
for( int t=0; t<GetNumTracks(); t++ )
|
||||||
{
|
{
|
||||||
TapNote tn = GetTapNoteX(t, row);
|
const TapNote &tn = GetTapNoteX(t, row);
|
||||||
switch( tn.type )
|
switch( tn.type )
|
||||||
{
|
{
|
||||||
case TapNote::mine:
|
case TapNote::mine:
|
||||||
@@ -454,9 +485,9 @@ int NoteData::GetNumHands( float fStartBeat, float fEndBeat ) const
|
|||||||
iEndIndex = min( iEndIndex, GetLastRow() );
|
iEndIndex = min( iEndIndex, GetLastRow() );
|
||||||
|
|
||||||
int iNum = 0;
|
int iNum = 0;
|
||||||
FOREACH_NONEMPTY_ROW_ALL_TRACKS_RANGE( *this, i, iStartIndex, iEndIndex )
|
FOREACH_NONEMPTY_ROW_ALL_TRACKS_RANGE( *this, r, iStartIndex, iEndIndex )
|
||||||
{
|
{
|
||||||
if( !RowNeedsHands(i) )
|
if( !RowNeedsHands(r) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
iNum++;
|
iNum++;
|
||||||
@@ -465,7 +496,7 @@ int NoteData::GetNumHands( float fStartBeat, float fEndBeat ) const
|
|||||||
return iNum;
|
return iNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
int NoteData::GetNumN( int MinTaps, float fStartBeat, float fEndBeat ) const
|
int NoteData::GetNumN( int iMinTaps, float fStartBeat, float fEndBeat ) const
|
||||||
{
|
{
|
||||||
if( fEndBeat == -1 )
|
if( fEndBeat == -1 )
|
||||||
fEndBeat = GetLastBeat();
|
fEndBeat = GetLastBeat();
|
||||||
@@ -478,16 +509,16 @@ int NoteData::GetNumN( int MinTaps, float fStartBeat, float fEndBeat ) const
|
|||||||
iEndIndex = min( iEndIndex, GetLastRow() );
|
iEndIndex = min( iEndIndex, GetLastRow() );
|
||||||
|
|
||||||
int iNum = 0;
|
int iNum = 0;
|
||||||
FOREACH_NONEMPTY_ROW_ALL_TRACKS_RANGE( *this, i, iStartIndex, iEndIndex )
|
FOREACH_NONEMPTY_ROW_ALL_TRACKS_RANGE( *this, r, iStartIndex, iEndIndex )
|
||||||
{
|
{
|
||||||
int iNumNotesThisIndex = 0;
|
int iNumNotesThisIndex = 0;
|
||||||
for( int t=0; t<GetNumTracks(); t++ )
|
for( int t=0; t<GetNumTracks(); t++ )
|
||||||
{
|
{
|
||||||
TapNote tn = GetTapNoteX(t, i);
|
const TapNote &tn = GetTapNoteX(t, r);
|
||||||
if( tn.type != TapNote::mine && tn.type != TapNote::empty ) // mines don't count
|
if( tn.type != TapNote::mine && tn.type != TapNote::empty ) // mines don't count
|
||||||
iNumNotesThisIndex++;
|
iNumNotesThisIndex++;
|
||||||
}
|
}
|
||||||
if( iNumNotesThisIndex >= MinTaps )
|
if( iNumNotesThisIndex >= iMinTaps )
|
||||||
iNum++;
|
iNum++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -519,15 +550,15 @@ void NoteData::Convert2sAnd3sToHoldNotes()
|
|||||||
|
|
||||||
for( int t=0; t<GetNumTracks(); t++ ) // foreach column
|
for( int t=0; t<GetNumTracks(); t++ ) // foreach column
|
||||||
{
|
{
|
||||||
FOREACH_NONEMPTY_ROW_IN_TRACK( *this, t, i )
|
FOREACH_NONEMPTY_ROW_IN_TRACK( *this, t, r )
|
||||||
{
|
{
|
||||||
if( GetTapNote(t,i).type != TapNote::hold_head )
|
if( GetTapNote(t,r).type != TapNote::hold_head )
|
||||||
continue; // skip
|
continue; // skip
|
||||||
|
|
||||||
SetTapNote(t, i, TAP_EMPTY); // clear the hold head marker
|
SetTapNote(t, r, TAP_EMPTY); // clear the hold head marker
|
||||||
|
|
||||||
// search for end of HoldNote
|
// search for end of HoldNote
|
||||||
FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE( *this, t, j, i+1, 999999 )
|
FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE( *this, t, j, r+1, 999999 )
|
||||||
{
|
{
|
||||||
// End hold on the next note we see. This should be a hold_tail if the
|
// End hold on the next note we see. This should be a hold_tail if the
|
||||||
// data is in a consistent state, but doesn't have to be.
|
// data is in a consistent state, but doesn't have to be.
|
||||||
@@ -536,7 +567,7 @@ void NoteData::Convert2sAnd3sToHoldNotes()
|
|||||||
|
|
||||||
SetTapNote(t, j, TAP_EMPTY);
|
SetTapNote(t, j, TAP_EMPTY);
|
||||||
|
|
||||||
AddHoldNote( HoldNote(t, i, j) );
|
AddHoldNote( HoldNote(t, r, j) );
|
||||||
break; // done searching for the end of this hold
|
break; // done searching for the end of this hold
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -598,19 +629,19 @@ void NoteData::Convert4sToHoldNotes()
|
|||||||
{
|
{
|
||||||
for( int t=0; t<GetNumTracks(); t++ ) // foreach column
|
for( int t=0; t<GetNumTracks(); t++ ) // foreach column
|
||||||
{
|
{
|
||||||
FOREACH_NONEMPTY_ROW_IN_TRACK( *this, t, i )
|
FOREACH_NONEMPTY_ROW_IN_TRACK( *this, t, r )
|
||||||
{
|
{
|
||||||
if( GetTapNote(t, i).type == TapNote::hold ) // this is a HoldNote body
|
if( GetTapNote(t, r).type == TapNote::hold ) // this is a HoldNote body
|
||||||
{
|
{
|
||||||
HoldNote hn( t, i, 0 );
|
HoldNote hn( t, r, 0 );
|
||||||
// search for end of HoldNote
|
// search for end of HoldNote
|
||||||
do {
|
do {
|
||||||
SetTapNote( t, i, TAP_EMPTY );
|
SetTapNote( t, r, TAP_EMPTY );
|
||||||
i++;
|
r++;
|
||||||
} while( GetTapNote(t, i).type == TapNote::hold );
|
} while( GetTapNote(t, r).type == TapNote::hold );
|
||||||
SetTapNote( t, i, TAP_EMPTY );
|
SetTapNote( t, r, TAP_EMPTY );
|
||||||
|
|
||||||
hn.iEndRow = i;
|
hn.iEndRow = r;
|
||||||
AddHoldNote( hn );
|
AddHoldNote( hn );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -656,19 +687,19 @@ void NoteData::LoadTransformed( const NoteData& original, int iNewNumTracks, con
|
|||||||
Convert4sToHoldNotes();
|
Convert4sToHoldNotes();
|
||||||
}
|
}
|
||||||
|
|
||||||
void NoteData::PadTapNotes(int rows)
|
void NoteData::PadTapNotes( int rows )
|
||||||
{
|
{
|
||||||
// Nothing to do for a track map.
|
// Nothing to do for a track map.
|
||||||
}
|
}
|
||||||
|
|
||||||
void NoteData::MoveTapNoteTrack(int dest, int src)
|
void NoteData::MoveTapNoteTrack( int dest, int src )
|
||||||
{
|
{
|
||||||
if(dest == src) return;
|
if(dest == src) return;
|
||||||
m_TapNotes[dest] = m_TapNotes[src];
|
m_TapNotes[dest] = m_TapNotes[src];
|
||||||
m_TapNotes[src].clear();
|
m_TapNotes[src].clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void NoteData::SetTapNote( int track, int row, TapNote t )
|
void NoteData::SetTapNote( int track, int row, const TapNote& t )
|
||||||
{
|
{
|
||||||
DEBUG_ASSERT( track>=0 && track<GetNumTracks() );
|
DEBUG_ASSERT( track>=0 && track<GetNumTracks() );
|
||||||
|
|
||||||
@@ -698,7 +729,7 @@ void NoteData::ReserveRows( int row )
|
|||||||
// Nothing to do for a track map.
|
// Nothing to do for a track map.
|
||||||
}
|
}
|
||||||
|
|
||||||
void NoteData::EliminateAllButOneTap(int row)
|
void NoteData::EliminateAllButOneTap( int row )
|
||||||
{
|
{
|
||||||
if(row < 0) return;
|
if(row < 0) return;
|
||||||
|
|
||||||
|
|||||||
+19
-17
@@ -44,7 +44,7 @@ public:
|
|||||||
|
|
||||||
/* Return the note at the given track and row. Row may be out of
|
/* Return the note at the given track and row. Row may be out of
|
||||||
* range; pretend the song goes on with TAP_EMPTYs indefinitely. */
|
* range; pretend the song goes on with TAP_EMPTYs indefinitely. */
|
||||||
inline TapNote GetTapNote(unsigned track, int row) const
|
inline const TapNote &GetTapNote(unsigned track, int row) const
|
||||||
{
|
{
|
||||||
return GetTapNoteX( track, row );
|
return GetTapNoteX( track, row );
|
||||||
}
|
}
|
||||||
@@ -52,7 +52,7 @@ public:
|
|||||||
|
|
||||||
/* GetTapNote is called a lot. This one doesn't do any bounds checking,
|
/* GetTapNote is called a lot. This one doesn't do any bounds checking,
|
||||||
* which is much faster. Be sure that 0 <= row < GetNumRows(). */
|
* which is much faster. Be sure that 0 <= row < GetNumRows(). */
|
||||||
inline TapNote GetTapNoteX(unsigned track, int row) const
|
inline const TapNote &GetTapNoteX(unsigned track, int row) const
|
||||||
{
|
{
|
||||||
const TrackMap &mapTrack = m_TapNotes[track];
|
const TrackMap &mapTrack = m_TapNotes[track];
|
||||||
TrackMap::const_iterator iter = mapTrack.find( row );
|
TrackMap::const_iterator iter = mapTrack.find( row );
|
||||||
@@ -69,30 +69,32 @@ public:
|
|||||||
bool GetNextTapNoteRowForAllTracks( int &rowInOut ) const;
|
bool GetNextTapNoteRowForAllTracks( int &rowInOut ) const;
|
||||||
|
|
||||||
void MoveTapNoteTrack( int dest, int src );
|
void MoveTapNoteTrack( int dest, int src );
|
||||||
void SetTapNote( int track, int row, TapNote tn );
|
void SetTapNote( int track, int row, const TapNote& tn );
|
||||||
|
|
||||||
void ClearRange( int rowBegin, int rowEnd );
|
void ClearRange( int rowBegin, int rowEnd );
|
||||||
void ClearAll();
|
void ClearAll();
|
||||||
void CopyRange( const NoteData& from, int iFromIndexBegin, int iFromIndexEnd, int iToIndexBegin = 0 );
|
void CopyRange( const NoteData& from, int rowFromBegin, int rowFromEnd, int rowToBegin = 0 );
|
||||||
void CopyAll( const NoteData& from );
|
void CopyAll( const NoteData& from );
|
||||||
|
|
||||||
bool IsRowEmpty( int index ) const;
|
bool IsRowEmpty( int row ) const;
|
||||||
bool IsRangeEmpty( int track, int iIndexBegin, int iIndexEnd ) const;
|
bool IsRangeEmpty( int track, int rowBegin, int rowEnd ) const;
|
||||||
int GetNumTapNonEmptyTracks( int index ) const;
|
int GetNumTapNonEmptyTracks( int row ) const;
|
||||||
void GetTapNonEmptyTracks( int index, set<int>& addTo ) const;
|
void GetTapNonEmptyTracks( int row, set<int>& addTo ) const;
|
||||||
int GetFirstNonEmptyTrack( int index ) const;
|
bool GetTapFirstNonEmptyTrack( int row, int &iNonEmptyTrackOut ) const; // return false if no non-empty tracks at row
|
||||||
int GetNumTracksWithTap( int index ) const;
|
bool GetTapFirstEmptyTrack( int row, int &iEmptyTrackOut ) const; // return false if no non-empty tracks at row
|
||||||
int GetNumTracksWithTapOrHoldHead( int index ) const;
|
bool GetTapLastEmptyTrack( int row, int &iEmptyTrackOut ) const; // return false if no empty tracks at row
|
||||||
int GetFirstTrackWithTap( int index ) const;
|
int GetNumTracksWithTap( int row ) const;
|
||||||
int GetFirstTrackWithTapOrHoldHead( int index ) const;
|
int GetNumTracksWithTapOrHoldHead( int row ) const;
|
||||||
|
int GetFirstTrackWithTap( int row ) const;
|
||||||
|
int GetFirstTrackWithTapOrHoldHead( int row ) const;
|
||||||
|
|
||||||
inline bool IsThereATapAtRow( int index ) const
|
inline bool IsThereATapAtRow( int row ) const
|
||||||
{
|
{
|
||||||
return GetFirstTrackWithTap( index ) != -1;
|
return GetFirstTrackWithTap( row ) != -1;
|
||||||
}
|
}
|
||||||
inline bool IsThereATapOrHoldHeadAtRow( int index ) const
|
inline bool IsThereATapOrHoldHeadAtRow( int row ) const
|
||||||
{
|
{
|
||||||
return GetFirstTrackWithTapOrHoldHead( index ) != -1;
|
return GetFirstTrackWithTapOrHoldHead( row ) != -1;
|
||||||
}
|
}
|
||||||
void GetTracksHeldAtRow( int row, set<int>& addTo );
|
void GetTracksHeldAtRow( int row, set<int>& addTo );
|
||||||
int GetNumTracksHeldAtRow( int row );
|
int GetNumTracksHeldAtRow( int row );
|
||||||
|
|||||||
+256
-254
File diff suppressed because it is too large
Load Diff
@@ -32,20 +32,20 @@ namespace NoteDataUtil
|
|||||||
|
|
||||||
void GetRadarValues( const NoteData &in, float fSongSeconds, RadarValues& out );
|
void GetRadarValues( const NoteData &in, float fSongSeconds, RadarValues& out );
|
||||||
|
|
||||||
void RemoveHoldNotes( NoteData &in, float fStartBeat = 0, float fEndBeat = 99999 );
|
void RemoveHoldNotes( NoteData &inout, float fStartBeat = 0, float fEndBeat = 99999 );
|
||||||
void RemoveSimultaneousNotes( NoteData &in, int iMaxSimultaneous, float fStartBeat = 0, float fEndBeat = 99999 );
|
void RemoveSimultaneousNotes( NoteData &inout, int iMaxSimultaneous, float fStartBeat = 0, float fEndBeat = 99999 );
|
||||||
void RemoveJumps( NoteData &in, float fStartBeat = 0, float fEndBeat = 99999 );
|
void RemoveJumps( NoteData &inout, float fStartBeat = 0, float fEndBeat = 99999 );
|
||||||
void RemoveHands( NoteData &in, float fStartBeat = 0, float fEndBeat = 99999 );
|
void RemoveHands( NoteData &inout, float fStartBeat = 0, float fEndBeat = 99999 );
|
||||||
void RemoveQuads( NoteData &in, float fStartBeat = 0, float fEndBeat = 99999 );
|
void RemoveQuads( NoteData &inout, float fStartBeat = 0, float fEndBeat = 99999 );
|
||||||
void RemoveMines( NoteData &in, float fStartBeat = 0, float fEndBeat = 99999 );
|
void RemoveMines( NoteData &inout, float fStartBeat = 0, float fEndBeat = 99999 );
|
||||||
enum TrackMapping { left, right, mirror, shuffle, super_shuffle, stomp, NUM_TRACK_MAPPINGS };
|
enum TrackMapping { left, right, mirror, shuffle, super_shuffle, stomp, NUM_TRACK_MAPPINGS };
|
||||||
void Turn( NoteData &in, StepsType st, TrackMapping tt, float fStartBeat = 0, float fEndBeat = -1 );
|
void Turn( NoteData &inout, StepsType st, TrackMapping tt, float fStartBeat = 0, float fEndBeat = -1 );
|
||||||
void Little( NoteData &in, float fStartBeat = 0, float fEndBeat = 99999 );
|
void Little( NoteData &inout, float fStartBeat = 0, float fEndBeat = 99999 );
|
||||||
void Wide( NoteData &in, float fStartBeat = 0, float fEndBeat = 99999 );
|
void Wide( NoteData &inout, float fStartBeat = 0, float fEndBeat = 99999 );
|
||||||
void Big( NoteData &in, float fStartBeat = 0, float fEndBeat = 99999 );
|
void Big( NoteData &inout, float fStartBeat = 0, float fEndBeat = 99999 );
|
||||||
void Quick( NoteData &in, float fStartBeat = 0, float fEndBeat = 99999 );
|
void Quick( NoteData &inout, float fStartBeat = 0, float fEndBeat = 99999 );
|
||||||
void BMRize( NoteData &in, float fStartBeat = 0, float fEndBeat = 99999 );
|
void BMRize( NoteData &inout, float fStartBeat = 0, float fEndBeat = 99999 );
|
||||||
void Skippy( NoteData &in, float fStartBeat = 0, float fEndBeat = 99999 );
|
void Skippy( NoteData &inout, float fStartBeat = 0, float fEndBeat = 99999 );
|
||||||
void InsertIntelligentTaps(
|
void InsertIntelligentTaps(
|
||||||
NoteData &in,
|
NoteData &in,
|
||||||
float fWindowSizeBeats,
|
float fWindowSizeBeats,
|
||||||
@@ -54,36 +54,36 @@ namespace NoteDataUtil
|
|||||||
bool bSkippy,
|
bool bSkippy,
|
||||||
float fStartBeat = 0,
|
float fStartBeat = 0,
|
||||||
float fEndBeat = 99999 );
|
float fEndBeat = 99999 );
|
||||||
void AddMines( NoteData &in, float fStartBeat = 0, float fEndBeat = 99999 );
|
void AddMines( NoteData &inout, float fStartBeat = 0, float fEndBeat = 99999 );
|
||||||
void Echo( NoteData &in, float fStartBeat = 0, float fEndBeat = 99999 );
|
void Echo( NoteData &inout, float fStartBeat = 0, float fEndBeat = 99999 );
|
||||||
void Stomp( NoteData &in, StepsType st, float fStartBeat = 0, float fEndBeat = 99999 );
|
void Stomp( NoteData &inout, StepsType st, float fStartBeat = 0, float fEndBeat = 99999 );
|
||||||
void Planted( NoteData &in, float fStartBeat = 0, float fEndBeat = 99999 );
|
void Planted( NoteData &inout, float fStartBeat = 0, float fEndBeat = 99999 );
|
||||||
void Floored( NoteData &in, float fStartBeat = 0, float fEndBeat = 99999 );
|
void Floored( NoteData &inout, float fStartBeat = 0, float fEndBeat = 99999 );
|
||||||
void Twister( NoteData &in, float fStartBeat = 0, float fEndBeat = 99999 );
|
void Twister( NoteData &inout, float fStartBeat = 0, float fEndBeat = 99999 );
|
||||||
void ConvertTapsToHolds( NoteData &in, int iSimultaneousHolds, float fStartBeat = 0, float fEndBeat = 99999 );
|
void ConvertTapsToHolds( NoteData &inout, int iSimultaneousHolds, float fStartBeat = 0, float fEndBeat = 99999 );
|
||||||
|
|
||||||
// change all TAP_ADDITIONs to TAP_TAPs
|
// change all TAP_ADDITIONs to TAP_TAPs
|
||||||
void ConvertAdditionsToRegular( NoteData &in );
|
void ConvertAdditionsToRegular( NoteData &inout );
|
||||||
|
|
||||||
void Backwards( NoteData &in );
|
void Backwards( NoteData &inout );
|
||||||
void SwapSides( NoteData &in );
|
void SwapSides( NoteData &inout );
|
||||||
void CopyLeftToRight( NoteData &in );
|
void CopyLeftToRight( NoteData &inout );
|
||||||
void CopyRightToLeft( NoteData &in );
|
void CopyRightToLeft( NoteData &inout );
|
||||||
void ClearLeft( NoteData &in );
|
void ClearLeft( NoteData &inout );
|
||||||
void ClearRight( NoteData &in );
|
void ClearRight( NoteData &inout );
|
||||||
void CollapseToOne( NoteData &in );
|
void CollapseToOne( NoteData &inout );
|
||||||
void CollapseLeft( NoteData &in );
|
void CollapseLeft( NoteData &inout );
|
||||||
void ShiftLeft( NoteData &in );
|
void ShiftLeft( NoteData &inout );
|
||||||
void ShiftRight( NoteData &in );
|
void ShiftRight( NoteData &inout );
|
||||||
|
|
||||||
void SnapToNearestNoteType( NoteData &in, NoteType nt1, NoteType nt2, float fBeginBeat, float fEndBeat );
|
void SnapToNearestNoteType( NoteData &inout, NoteType nt1, NoteType nt2, float fBeginBeat, float fEndBeat );
|
||||||
|
|
||||||
inline void SnapToNearestNoteType( NoteData &in, NoteType nt, float fBeginBeat, float fEndBeat ) { SnapToNearestNoteType( in, nt, (NoteType)-1, fBeginBeat, fEndBeat ); }
|
inline void SnapToNearestNoteType( NoteData &inout, NoteType nt, float fBeginBeat, float fEndBeat ) { SnapToNearestNoteType( inout, nt, (NoteType)-1, fBeginBeat, fEndBeat ); }
|
||||||
|
|
||||||
void FixImpossibleRows( NoteData &in, StepsType st );
|
void FixImpossibleRows( NoteData &inout, StepsType st );
|
||||||
|
|
||||||
// True if no notes in row that aren't true in the mask
|
// True if no notes in row that aren't true in the mask
|
||||||
bool RowPassesValidMask( NoteData &in, int row, const bool bValidMask[] );
|
bool RowPassesValidMask( NoteData &inout, int row, const bool bValidMask[] );
|
||||||
|
|
||||||
void TransformNoteData( NoteData &nd, const AttackArray &aa, StepsType st, Song* pSong );
|
void TransformNoteData( NoteData &nd, const AttackArray &aa, StepsType st, Song* pSong );
|
||||||
void TransformNoteData( NoteData &nd, const PlayerOptions &po, StepsType st, float fStartBeat = 0, float fEndBeat = 99999 );
|
void TransformNoteData( NoteData &nd, const PlayerOptions &po, StepsType st, float fStartBeat = 0, float fEndBeat = 99999 );
|
||||||
|
|||||||
@@ -32,9 +32,9 @@ int NoteDataWithScoring::GetNumTapNotesWithScore( TapNoteScore tns, const float
|
|||||||
|
|
||||||
for( int t=0; t<GetNumTracks(); t++ )
|
for( int t=0; t<GetNumTracks(); t++ )
|
||||||
{
|
{
|
||||||
FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE( *this, t, i, iStartIndex, iEndIndex )
|
FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE( *this, t, r, iStartIndex, iEndIndex )
|
||||||
{
|
{
|
||||||
if( GetTapNoteScore(t, i) >= tns )
|
if( GetTapNoteScore(t, r) >= tns )
|
||||||
iNumSuccessfulTapNotes++;
|
iNumSuccessfulTapNotes++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ struct TapNote
|
|||||||
bKeysound = bKeysound_;
|
bKeysound = bKeysound_;
|
||||||
iKeysoundIndex = iKeysoundIndex_;
|
iKeysoundIndex = iKeysoundIndex_;
|
||||||
}
|
}
|
||||||
bool operator==( const TapNote &other )
|
bool operator==( const TapNote &other ) const
|
||||||
{
|
{
|
||||||
#define COMPARE(x) if(x!=other.x) return false;
|
#define COMPARE(x) if(x!=other.x) return false;
|
||||||
COMPARE(type);
|
COMPARE(type);
|
||||||
@@ -69,13 +69,13 @@ struct TapNote
|
|||||||
|
|
||||||
const unsigned MAX_NUM_ATTACKS = 2*2*2; // 3 bits to hold the attack index currently
|
const unsigned MAX_NUM_ATTACKS = 2*2*2; // 3 bits to hold the attack index currently
|
||||||
|
|
||||||
extern TapNote TAP_EMPTY; // '0'
|
extern TapNote TAP_EMPTY; // '0'
|
||||||
extern TapNote TAP_ORIGINAL_TAP; // '1'
|
extern TapNote TAP_ORIGINAL_TAP; // '1'
|
||||||
extern TapNote TAP_ORIGINAL_HOLD_HEAD; // '2'
|
extern TapNote TAP_ORIGINAL_HOLD_HEAD; // '2'
|
||||||
extern TapNote TAP_ORIGINAL_HOLD_TAIL; // '3'
|
extern TapNote TAP_ORIGINAL_HOLD_TAIL; // '3'
|
||||||
extern TapNote TAP_ORIGINAL_HOLD; // '4'
|
extern TapNote TAP_ORIGINAL_HOLD; // '4'
|
||||||
extern TapNote TAP_ORIGINAL_MINE; // 'M'
|
extern TapNote TAP_ORIGINAL_MINE; // 'M'
|
||||||
extern TapNote TAP_ORIGINAL_ATTACK; // 'A'
|
extern TapNote TAP_ORIGINAL_ATTACK; // 'A'
|
||||||
extern TapNote TAP_ADDITION_TAP;
|
extern TapNote TAP_ADDITION_TAP;
|
||||||
extern TapNote TAP_ADDITION_MINE;
|
extern TapNote TAP_ADDITION_MINE;
|
||||||
|
|
||||||
|
|||||||
@@ -827,7 +827,6 @@ void ScreenGameplay::SetupSong( PlayerNumber p, int iSongIndex )
|
|||||||
m_pPrimaryScoreKeeper[p],
|
m_pPrimaryScoreKeeper[p],
|
||||||
m_pSecondaryScoreKeeper[p] );
|
m_pSecondaryScoreKeeper[p] );
|
||||||
|
|
||||||
|
|
||||||
// Put course options into effect. Do this after Player::Load so
|
// Put course options into effect. Do this after Player::Load so
|
||||||
// that mods aren't double-applied.
|
// that mods aren't double-applied.
|
||||||
GAMESTATE->m_ModsToApply[p].clear();
|
GAMESTATE->m_ModsToApply[p].clear();
|
||||||
@@ -899,7 +898,6 @@ void ScreenGameplay::LoadNextSong()
|
|||||||
|
|
||||||
m_textSongOptions.SetText( GAMESTATE->m_SongOptions.GetString() );
|
m_textSongOptions.SetText( GAMESTATE->m_SongOptions.GetString() );
|
||||||
|
|
||||||
|
|
||||||
FOREACH_EnabledPlayer( p )
|
FOREACH_EnabledPlayer( p )
|
||||||
{
|
{
|
||||||
SetupSong( p, iPlaySongIndex );
|
SetupSong( p, iPlaySongIndex );
|
||||||
@@ -1273,7 +1271,9 @@ void ScreenGameplay::Update( float fDeltaTime )
|
|||||||
m_bZeroDeltaOnNextUpdate = false;
|
m_bZeroDeltaOnNextUpdate = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
Screen::Update( fDeltaTime );
|
Screen::Update( fDeltaTime );
|
||||||
|
}
|
||||||
|
|
||||||
/* This happens if ScreenDemonstration::HandleScreenMessage sets a new screen when
|
/* This happens if ScreenDemonstration::HandleScreenMessage sets a new screen when
|
||||||
* PREFSMAN->m_bDelayedScreenLoad. */
|
* PREFSMAN->m_bDelayedScreenLoad. */
|
||||||
@@ -1292,7 +1292,6 @@ void ScreenGameplay::Update( float fDeltaTime )
|
|||||||
|
|
||||||
m_BeginnerHelper.Update(fDeltaTime);
|
m_BeginnerHelper.Update(fDeltaTime);
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// update GameState HealthState
|
// update GameState HealthState
|
||||||
//
|
//
|
||||||
@@ -1524,8 +1523,6 @@ void ScreenGameplay::Update( float fDeltaTime )
|
|||||||
{
|
{
|
||||||
FOREACH_CabinetLight( cl )
|
FOREACH_CabinetLight( cl )
|
||||||
{
|
{
|
||||||
// Somehow, step data was getting majorly corrupted, therefor causing light
|
|
||||||
// signals to be sent at incorrect times where notes were not even present.
|
|
||||||
bool bBlink = (m_CabinetLightsNoteData.GetTapNote( cl, r ).type != TapNote::empty );
|
bool bBlink = (m_CabinetLightsNoteData.GetTapNote( cl, r ).type != TapNote::empty );
|
||||||
bBlinkCabinetLight[cl] |= bBlink;
|
bBlinkCabinetLight[cl] |= bBlink;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user