From 9559ce8f4a60b795ffd24d97092e6cad812e4576 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Wed, 12 Sep 2007 11:01:43 +0000 Subject: [PATCH] move CrossedMine logic into CrossedRow --- stepmania/src/Player.cpp | 51 +++++++--------------------------------- 1 file changed, 9 insertions(+), 42 deletions(-) diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index 20280cd1bf..79bc67cefe 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -803,21 +803,6 @@ void Player::Update( float fDeltaTime ) } } - { - // TRICKY: - float fPositionSeconds = GAMESTATE->m_fMusicSeconds; - fPositionSeconds -= PREFSMAN->m_fPadStickSeconds; - const float fSongBeat = GAMESTATE->m_pCurSong ? GAMESTATE->m_pCurSong->GetBeatFromElapsedTime( fPositionSeconds ) : 0; - const int iRowNow = BeatToNoteRowNotRounded( fSongBeat ); - if( iRowNow >= 0 ) - { - // for each index we crossed since the last update - if( GAMESTATE->IsPlayerEnabled(m_pPlayerState) ) - FOREACH_NONEMPTY_ROW_ALL_TRACKS_RANGE( m_NoteData, r, m_iFirstUncrossedMineRow, iRowNow+1 ) - CrossedMineRow( r, now ); - m_iFirstUncrossedMineRow = iRowNow+1; - } - } // Check for completely judged rows. UpdateJudgedRows(); @@ -2343,6 +2328,15 @@ void Player::CrossedRows( int iLastRowCrossed, const RageTimer &now ) case TapNote::hold_head: tn.HoldResult.fLife = INITIAL_HOLD_LIFE; break; + case TapNote::mine: + // Hold the panel while crossing a mine will cause the mine to explode + // TODO: Remove use of PlayerNumber. + PlayerNumber pn = m_pPlayerState->m_PlayerNumber; + GameInput GameI = GAMESTATE->GetCurrentStyle()->StyleInputToGameInput( iTrack, pn ); + float fSecsHeld = INPUTMAPPER->GetSecsHeld( GameI, m_pPlayerState->m_mp ); + if( fSecsHeld >= PREFSMAN->m_fPadStickSeconds ) + Step( iTrack, -1, now - PREFSMAN->m_fPadStickSeconds, true, false ); + break; } @@ -2440,33 +2434,6 @@ void Player::CrossedRows( int iLastRowCrossed, const RageTimer &now ) m_iFirstUncrossedRow = iLastRowCrossed+1; } -void Player::CrossedMineRow( int iNoteRow, const RageTimer &now ) -{ - // Hold the panel while crossing a mine will cause the mine to explode - for( int t=0; tm_PlayerNumber; - - GameInput GameI = GAMESTATE->GetCurrentStyle()->StyleInputToGameInput( t, pn ); - if( PREFSMAN->m_fPadStickSeconds > 0 ) - { - float fSecsHeld = INPUTMAPPER->GetSecsHeld( GameI, m_pPlayerState->m_mp ); - if( fSecsHeld >= PREFSMAN->m_fPadStickSeconds ) - Step( t, -1, now - PREFSMAN->m_fPadStickSeconds, true, false ); - } - else - { - bool bIsDown = INPUTMAPPER->IsBeingPressed( GameI, m_pPlayerState->m_mp ); - if( bIsDown ) - Step( t, iNoteRow, now, true, false ); - } - } - } -} - void Player::RandomizeNotes( int iNoteRow ) { // change the row to look ahead from based upon their speed mod