Handle CrossedRow inside Player, so autoplay works correctly in the
editor.
This commit is contained in:
@@ -88,6 +88,7 @@ void Player::Load( PlayerNumber pn, NoteData* pNoteData, LifeMeter* pLM, ScoreDi
|
||||
m_pScore = pScore;
|
||||
m_pInventory = pInventory;
|
||||
m_pScoreKeeper = pScoreKeeper;
|
||||
m_iRowLastCrossed = -1;
|
||||
|
||||
/* Ensure that this is up-to-date. */
|
||||
GAMESTATE->m_pPosition->Load(pn);
|
||||
@@ -287,6 +288,14 @@ void Player::Update( float fDeltaTime )
|
||||
m_sLastSeenNoteSkin = GAMESTATE->m_PlayerOptions[m_PlayerNumber].m_sNoteSkin;
|
||||
} */
|
||||
|
||||
const int iRowNow = BeatToNoteRow( GAMESTATE->m_fSongBeat );
|
||||
if( iRowNow >= 0 )
|
||||
{
|
||||
for( ; m_iRowLastCrossed <= iRowNow; m_iRowLastCrossed++ ) // for each index we crossed since the last update
|
||||
if( GAMESTATE->IsPlayerEnabled(m_PlayerNumber) )
|
||||
CrossedRow( m_iRowLastCrossed );
|
||||
}
|
||||
|
||||
ActorFrame::Update( fDeltaTime );
|
||||
}
|
||||
|
||||
@@ -575,6 +584,10 @@ void Player::UpdateTapNotesMissedOlderThan( float fMissIfOlderThanSeconds )
|
||||
|
||||
void Player::CrossedRow( int iNoteRow )
|
||||
{
|
||||
// If we're doing random vanish, randomise notes on the fly.
|
||||
if(GAMESTATE->m_CurrentPlayerOptions[m_PlayerNumber].m_fAppearances[PlayerOptions::APPEARANCE_RANDOMVANISH]==1)
|
||||
RandomiseNotes( iNoteRow );
|
||||
|
||||
// check to see if there's at the crossed row
|
||||
for( int t=0; t<GetNumTracks(); t++ )
|
||||
if( GetTapNote(t, iNoteRow) != TAP_EMPTY )
|
||||
|
||||
@@ -88,7 +88,8 @@ protected:
|
||||
Inventory* m_pInventory;
|
||||
|
||||
CString m_sLastSeenNoteSkin;
|
||||
bool m_bShowJudgment;
|
||||
bool m_bShowJudgment;
|
||||
int m_iRowLastCrossed;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -591,8 +591,6 @@ bool ScreenGameplay::IsLastSong()
|
||||
|
||||
void ScreenGameplay::LoadNextSong()
|
||||
{
|
||||
m_iRowLastCrossed = -1;
|
||||
|
||||
GAMESTATE->ResetMusicStatistics();
|
||||
int p;
|
||||
for( p=0; p<NUM_PLAYERS; p++ )
|
||||
@@ -1012,28 +1010,6 @@ void ScreenGameplay::Update( float fDeltaTime )
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Send crossed row messages to Player
|
||||
//
|
||||
|
||||
// Why was this originally "BeatToNoteRowNotRounded"? It should be rounded. -Chris
|
||||
int iRowNow = BeatToNoteRow( GAMESTATE->m_fSongBeat );
|
||||
if( iRowNow >= 0 )
|
||||
{
|
||||
for( ; m_iRowLastCrossed <= iRowNow; m_iRowLastCrossed++ ) // for each index we crossed since the last update
|
||||
for( pn=0; pn<NUM_PLAYERS; pn++ )
|
||||
if( GAMESTATE->IsPlayerEnabled(pn) )
|
||||
{
|
||||
if(GAMESTATE->m_CurrentPlayerOptions[pn].m_fAppearances[PlayerOptions::APPEARANCE_RANDOMVANISH]==1) // if we're doing random vanish
|
||||
{
|
||||
m_Player[pn].RandomiseNotes( m_iRowLastCrossed ); // randomise notes on the fly
|
||||
}
|
||||
m_Player[pn].CrossedRow( m_iRowLastCrossed );
|
||||
}
|
||||
}
|
||||
|
||||
if( GAMESTATE->m_SongOptions.m_bAssistTick && IsTimeToPlayTicks())
|
||||
m_soundAssistTick.Play();
|
||||
|
||||
|
||||
@@ -192,7 +192,6 @@ protected:
|
||||
|
||||
bool m_bZeroDeltaOnNextUpdate;
|
||||
bool m_bDemonstration;
|
||||
int m_iRowLastCrossed;
|
||||
|
||||
RageSound m_soundAssistTick;
|
||||
RageSound m_soundMusic;
|
||||
|
||||
Reference in New Issue
Block a user