Allow one Player to share the NoteField of another Player. Also calculate the distance to the closest note or -1 if no note is close.
This commit is contained in:
@@ -443,6 +443,12 @@ void Player::Load( const NoteData& noteData )
|
||||
}
|
||||
}
|
||||
|
||||
void Player::SetSharedNoteField( Player *pPlayer )
|
||||
{
|
||||
ASSERT( m_pNoteField );
|
||||
m_pNoteField->SetSharedNoteField( pPlayer->m_pNoteField );
|
||||
}
|
||||
|
||||
void Player::Update( float fDeltaTime )
|
||||
{
|
||||
// Don't update if we havn't been loaded yet.
|
||||
@@ -923,6 +929,16 @@ int Player::GetClosestNote( int col, int iNoteRow, int iMaxRowsAhead, int iMaxRo
|
||||
return iNextIndex;
|
||||
}
|
||||
|
||||
int Player::GetClosestNoteDistance( int col, int row ) const
|
||||
{
|
||||
const int iStepSearchRows = BeatToNoteRow( StepSearchDistance * GAMESTATE->m_fCurBPS * GAMESTATE->m_SongOptions.m_fMusicRate );
|
||||
int iIndexOverlappingNote = GetClosestNote( col, row, iStepSearchRows, iStepSearchRows, false );
|
||||
|
||||
if( iIndexOverlappingNote <= 0 )
|
||||
return iIndexOverlappingNote;
|
||||
return abs( iIndexOverlappingNote - row );
|
||||
}
|
||||
|
||||
|
||||
void Player::Step( int col, const RageTimer &tm, bool bHeld )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user