IsHoldNoteAtBeat -> IsHoldNoteAtRow

This commit is contained in:
Glenn Maynard
2005-07-22 00:14:24 +00:00
parent ea8705fa9d
commit 4ec405f13b
7 changed files with 21 additions and 21 deletions
+3 -3
View File
@@ -338,7 +338,7 @@ void NoteData::AddHoldNote( int iTrack, int iStartRow, int iEndRow, TapNote tn )
} }
/* Return true if a hold note lies on or adjacent to the given spot. */ /* Return true if a hold note lies on or adjacent to the given spot. */
bool NoteData::IsHoldNoteAtBeat( int iTrack, int iRow, int *pHeadRow ) const bool NoteData::IsHoldNoteAtRow( int iTrack, int iRow, int *pHeadRow ) const
{ {
int iDummy; int iDummy;
if( pHeadRow == NULL ) if( pHeadRow == NULL )
@@ -512,7 +512,7 @@ bool NoteData::RowNeedsAtLeastSimultaneousPresses( int iMinSimultaneousPresses,
/* We have at least one, but not enough. Count holds. Do count adjacent holds. */ /* We have at least one, but not enough. Count holds. Do count adjacent holds. */
for( int t=0; t<GetNumTracks(); ++t ) for( int t=0; t<GetNumTracks(); ++t )
{ {
if( IsHoldNoteAtBeat(t, row) ) if( IsHoldNoteAtRow(t, row) )
++iNumNotesThisIndex; ++iNumNotesThisIndex;
} }
} }
@@ -649,7 +649,7 @@ void NoteData::SetTapNote( int track, int row, const TapNote& t )
void NoteData::GetTracksHeldAtRow( int row, set<int>& addTo ) void NoteData::GetTracksHeldAtRow( int row, set<int>& addTo )
{ {
for( int t=0; t<GetNumTracks(); ++t ) for( int t=0; t<GetNumTracks(); ++t )
if( IsHoldNoteAtBeat( t, row ) ) if( IsHoldNoteAtRow( t, row ) )
addTo.insert( t ); addTo.insert( t );
} }
+1 -1
View File
@@ -119,7 +119,7 @@ public:
/* Determine if a given spot is within a hold note (being on the tail doesn't count). /* Determine if a given spot is within a hold note (being on the tail doesn't count).
* Return true if so. If pHeadRow is non-NULL, return the row of the head. If pTailRow is * Return true if so. If pHeadRow is non-NULL, return the row of the head. If pTailRow is
* non-NULL, return the row of the tail. This function is faster if pTailRow is NULL. */ * non-NULL, return the row of the tail. This function is faster if pTailRow is NULL. */
bool IsHoldNoteAtBeat( int iTrack, int iRow, int *pHeadRow = NULL ) const; bool IsHoldNoteAtRow( int iTrack, int iRow, int *pHeadRow = NULL ) const;
// //
// statistics // statistics
+10 -10
View File
@@ -120,7 +120,7 @@ void NoteDataUtil::LoadFromSMNoteDataString( NoteData &out, CString sSMNoteData
{ {
/* This is the end of a hold. Search for the beginning. */ /* This is the end of a hold. Search for the beginning. */
int iHeadRow; int iHeadRow;
if( !out.IsHoldNoteAtBeat( iTrack, iIndex, &iHeadRow ) ) if( !out.IsHoldNoteAtRow( iTrack, iIndex, &iHeadRow ) )
{ {
LOG->Warn( "Unmatched 3 in \"%s\"", sMeasureLine.c_str() ); LOG->Warn( "Unmatched 3 in \"%s\"", sMeasureLine.c_str() );
} }
@@ -372,8 +372,8 @@ void NoteDataUtil::LoadTransformedSlidingWindow( const NoteData &in, NoteData &o
for( int t=0; t<in.GetNumTracks(); t++ ) for( int t=0; t<in.GetNumTracks(); t++ )
{ {
if( in.IsHoldNoteAtBeat( t, r-1 ) && if( in.IsHoldNoteAtRow( t, r-1 ) &&
in.IsHoldNoteAtBeat( t, r ) ) in.IsHoldNoteAtRow( t, r ) )
{ {
bHoldCrossesThisMeasure = true; bHoldCrossesThisMeasure = true;
break; break;
@@ -723,7 +723,7 @@ void NoteDataUtil::RemoveSimultaneousNotes( NoteData &in, int iMaxSimultaneous,
else if( tn.type == TapNote::hold_head ) else if( tn.type == TapNote::hold_head )
{ {
int iStartTrack; int iStartTrack;
if( !in.IsHoldNoteAtBeat( t, r, &iStartTrack ) ) if( !in.IsHoldNoteAtRow( t, r, &iStartTrack ) )
continue; continue;
in.SetTapNote( t, iStartTrack, TAP_EMPTY ); in.SetTapNote( t, iStartTrack, TAP_EMPTY );
@@ -942,7 +942,7 @@ static void SuperShuffleTaps( NoteData &inout, int iStartIndex, int iEndIndex )
} }
#if _DEBUG #if _DEBUG
ASSERT_M( !inout.IsHoldNoteAtBeat(t1,r), ssprintf("There is a tap.type = %d inside of a hold at row %d", tn1.type, r) ); ASSERT_M( !inout.IsHoldNoteAtRow(t1,r), ssprintf("There is a tap.type = %d inside of a hold at row %d", tn1.type, r) );
#endif #endif
// Probe for a spot to swap with. // Probe for a spot to swap with.
@@ -975,7 +975,7 @@ static void SuperShuffleTaps( NoteData &inout, int iStartIndex, int iEndIndex )
} }
// don't swap into the middle of a hold note // don't swap into the middle of a hold note
if( inout.IsHoldNoteAtBeat(t2,r) ) if( inout.IsHoldNoteAtRow(t2,r) )
continue; continue;
// do the swap // do the swap
@@ -1070,7 +1070,7 @@ void NoteDataUtil::Wide( NoteData &inout, int iStartIndex, int iEndIndex )
bool bHoldNoteAtBeat = false; bool bHoldNoteAtBeat = false;
for( int t = 0; !bHoldNoteAtBeat && t < inout.GetNumTracks(); ++t ) for( int t = 0; !bHoldNoteAtBeat && t < inout.GetNumTracks(); ++t )
if( inout.IsHoldNoteAtBeat(t, i) ) if( inout.IsHoldNoteAtRow(t, i) )
bHoldNoteAtBeat = true; bHoldNoteAtBeat = true;
if( bHoldNoteAtBeat ) if( bHoldNoteAtBeat )
continue; // skip. Don't place during holds continue; // skip. Don't place during holds
@@ -1176,7 +1176,7 @@ 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 t = 0; t < inout.GetNumTracks(); ++t ) for( int t = 0; t < inout.GetNumTracks(); ++t )
if( inout.IsHoldNoteAtBeat(t, iRowEarlier+1) ) if( inout.IsHoldNoteAtRow(t, iRowEarlier+1) )
bNoteInMiddle = true; bNoteInMiddle = true;
FOREACH_NONEMPTY_ROW_ALL_TRACKS_RANGE( inout, j, iRowEarlier+1, iRowLater-1 ) FOREACH_NONEMPTY_ROW_ALL_TRACKS_RANGE( inout, j, iRowEarlier+1, iRowLater-1 )
bNoteInMiddle = true; bNoteInMiddle = true;
@@ -1537,7 +1537,7 @@ void NoteDataUtil::SnapToNearestNoteType( NoteData &inout, NoteType nt1, NoteTyp
inout.SetTapNote(c, iOldIndex, TAP_EMPTY); inout.SetTapNote(c, iOldIndex, TAP_EMPTY);
if( tnNew.type == TapNote::tap && inout.IsHoldNoteAtBeat(c, iNewIndex) ) if( tnNew.type == TapNote::tap && inout.IsHoldNoteAtRow(c, iNewIndex) )
continue; // HoldNotes override TapNotes continue; // HoldNotes override TapNotes
if( tnNew.type == TapNote::hold_head ) if( tnNew.type == TapNote::hold_head )
@@ -1969,7 +1969,7 @@ bool NoteDataUtil::AnyTapsAndHoldsInTrackRange( const NoteData& in, int iTrack,
} }
} }
if( in.IsHoldNoteAtBeat( iTrack, iEnd ) ) if( in.IsHoldNoteAtRow( iTrack, iEnd ) )
return true; return true;
return false; return false;
+1 -1
View File
@@ -108,7 +108,7 @@ int GetSuccessfulHands( const NoteData &in, int iStartIndex = 0, int iEndIndex =
for( int t=0; t<in.GetNumTracks(); ++t ) for( int t=0; t<in.GetNumTracks(); ++t )
{ {
int iHeadRow; int iHeadRow;
if( !in.IsHoldNoteAtBeat( t, i, &iHeadRow ) ) if( !in.IsHoldNoteAtRow( t, i, &iHeadRow ) )
continue; continue;
const TapNote &tn = in.GetTapNote( t, iHeadRow ); const TapNote &tn = in.GetTapNote( t, iHeadRow );
+2 -2
View File
@@ -430,7 +430,7 @@ void Player::Update( float fDeltaTime )
{ {
// TODO: Make the CPU miss sometimes. // TODO: Make the CPU miss sometimes.
int iHeadRow; int iHeadRow;
if( !m_NoteData.IsHoldNoteAtBeat(iTrack, iSongRow, &iHeadRow) ) if( !m_NoteData.IsHoldNoteAtRow(iTrack, iSongRow, &iHeadRow) )
continue; continue;
const TapNote &tn = m_NoteData.GetTapNote( iTrack, iHeadRow ); const TapNote &tn = m_NoteData.GetTapNote( iTrack, iHeadRow );
@@ -1468,7 +1468,7 @@ void Player::RandomizeNotes( int iNoteRow )
continue; continue;
/* Make sure the destination row isn't in the middle of a hold. */ /* Make sure the destination row isn't in the middle of a hold. */
if( m_NoteData.IsHoldNoteAtBeat(iSwapWith, iNoteRow) ) if( m_NoteData.IsHoldNoteAtRow(iSwapWith, iNoteRow) )
continue; continue;
m_NoteData.SetTapNote( t, iNewNoteRow, t2 ); m_NoteData.SetTapNote( t, iNewNoteRow, t2 );
+2 -2
View File
@@ -1051,7 +1051,7 @@ void ScreenEdit::InputEdit( const DeviceInput& DeviceI, const InputEventType typ
// check for to see if the user intended to remove a HoldNote // check for to see if the user intended to remove a HoldNote
int iHeadRow; int iHeadRow;
if( m_NoteDataEdit.IsHoldNoteAtBeat( iCol, iSongIndex, &iHeadRow ) ) if( m_NoteDataEdit.IsHoldNoteAtRow( iCol, iSongIndex, &iHeadRow ) )
{ {
m_soundRemoveNote.Play(); m_soundRemoveNote.Play();
SaveUndo(); SaveUndo();
@@ -1650,7 +1650,7 @@ void ScreenEdit::InputRecord( const DeviceInput& DeviceI, const InputEventType t
// Remove hold if any so that we don't have taps inside of a hold. // Remove hold if any so that we don't have taps inside of a hold.
int iHeadRow; int iHeadRow;
if( m_NoteDataRecord.IsHoldNoteAtBeat( iCol, iRow, &iHeadRow ) ) if( m_NoteDataRecord.IsHoldNoteAtRow( iCol, iRow, &iHeadRow ) )
m_NoteDataRecord.SetTapNote( iCol, iHeadRow, TAP_EMPTY ); m_NoteDataRecord.SetTapNote( iCol, iHeadRow, TAP_EMPTY );
TapNote tn = TAP_ORIGINAL_TAP; TapNote tn = TAP_ORIGINAL_TAP;
+2 -2
View File
@@ -1663,7 +1663,7 @@ void ScreenGameplay::UpdateLights()
bBlinkCabinetLight[cl] = true; bBlinkCabinetLight[cl] = true;
} }
if( m_CabinetLightsNoteData.IsHoldNoteAtBeat( cl, iSongRow ) ) if( m_CabinetLightsNoteData.IsHoldNoteAtRow( cl, iSongRow ) )
bBlinkCabinetLight[cl] = true; bBlinkCabinetLight[cl] = true;
} }
@@ -1682,7 +1682,7 @@ void ScreenGameplay::UpdateLights()
} }
// check if a hold should be active // check if a hold should be active
if( m_Player[pn].m_NoteData.IsHoldNoteAtBeat( t, iSongRow ) ) if( m_Player[pn].m_NoteData.IsHoldNoteAtRow( t, iSongRow ) )
bBlink = true; bBlink = true;
if( bBlink ) if( bBlink )