[splittiming] Let's break things again! (222)

We introduced a new class, called "SongPosition", that replaces some instance variables in the GameState class. (GameState::m_Position).
Then, you also have it in PlayerState class which keeps track of the position based on their steps. (PlayerState::m_Position).

Fixing the build errors:
- GAMESTATE->m_fSomething should now be:
  - GAMESTATE->m_Position.m_fSomething
  - pPlayerState->m_Position.m_fSomething (or m_pPlayerState for some instance!)
This commit is contained in:
Thai Pangsakulyanont
2011-05-10 19:54:05 +07:00
parent ce91d1a431
commit 241738c18b
7 changed files with 156 additions and 71 deletions
+3 -3
View File
@@ -506,7 +506,7 @@ void Player::Load()
m_LastTapNoteScore = TNS_None;
// The editor can start playing in the middle of the song.
const int iNoteRow = BeatToNoteRowNotRounded( GAMESTATE->m_fSongBeat );
const int iNoteRow = BeatToNoteRowNotRounded( m_pPlayerState->m_Position.m_fSongBeat );
m_iFirstUncrossedRow = iNoteRow - 1;
m_pJudgedRows->Reset( iNoteRow );
@@ -695,7 +695,7 @@ void Player::Update( float fDeltaTime )
return;
}
const float fSongBeat = GAMESTATE->m_fSongBeat;
const float fSongBeat = m_pPlayerState->m_Position.m_fSongBeat;
const int iSongRow = BeatToNoteRow( fSongBeat );
// Optimization: Don't spend time processing the things below that won't show
@@ -797,7 +797,7 @@ void Player::Update( float fDeltaTime )
// Check for a strum miss
if( m_pPlayerState->m_fLastStrumMusicSeconds != -1 &&
m_pPlayerState->m_fLastStrumMusicSeconds + g_fTimingWindowStrum < GAMESTATE->m_fMusicSeconds )
m_pPlayerState->m_fLastStrumMusicSeconds + g_fTimingWindowStrum < m_pPlayerState->m_Position.m_fMusicSeconds )
{
DoStrumMiss();
}