pass TimingData to GameState::UpdateSongPosition
This commit is contained in:
@@ -353,12 +353,10 @@ void GameState::ResetStageStatistics()
|
||||
}
|
||||
}
|
||||
|
||||
void GameState::UpdateSongPosition(float fPositionSeconds)
|
||||
void GameState::UpdateSongPosition( float fPositionSeconds, const TimingData &timing )
|
||||
{
|
||||
ASSERT(m_pCurSong);
|
||||
|
||||
m_fMusicSeconds = fPositionSeconds;
|
||||
m_pCurSong->GetBeatAndBPSFromElapsedTime( m_fMusicSeconds, m_fSongBeat, m_fCurBPS, m_bFreeze );
|
||||
timing.GetBeatAndBPSFromElapsedTime( m_fMusicSeconds, m_fSongBeat, m_fCurBPS, m_bFreeze );
|
||||
// LOG->Trace( "m_fMusicSeconds = %f, m_fSongBeat = %f, m_fCurBPS = %f, m_bFreeze = %f", m_fMusicSeconds, m_fSongBeat, m_fCurBPS, m_bFreeze );
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ class StyleDef;
|
||||
class NoteFieldPositioning;
|
||||
class Character;
|
||||
class UnlockSystem;
|
||||
class TimingData;
|
||||
|
||||
class GameState
|
||||
{
|
||||
@@ -155,7 +156,7 @@ public:
|
||||
static const float MUSIC_SECONDS_INVALID;
|
||||
|
||||
void ResetMusicStatistics(); // Call this when it's time to play a new song. Clears the values above.
|
||||
void UpdateSongPosition(float fPositionSeconds);
|
||||
void UpdateSongPosition( float fPositionSeconds, const TimingData &timing );
|
||||
float GetSongPercent( float beat ) const;
|
||||
|
||||
//
|
||||
|
||||
@@ -392,7 +392,7 @@ void ScreenEdit::PlayPreviewMusic()
|
||||
void ScreenEdit::Update( float fDeltaTime )
|
||||
{
|
||||
if( m_soundMusic.IsPlaying())
|
||||
GAMESTATE->UpdateSongPosition(m_soundMusic.GetPositionSeconds());
|
||||
GAMESTATE->UpdateSongPosition( m_soundMusic.GetPositionSeconds(), GAMESTATE->m_pCurSong->m_Timing );
|
||||
|
||||
if( m_EditMode == MODE_RECORDING )
|
||||
{
|
||||
|
||||
@@ -1066,7 +1066,7 @@ void ScreenGameplay::Update( float fDeltaTime )
|
||||
* a new ScreenJukebox and reset music statistics, and if we do this then
|
||||
* we'll un-reset them.) */
|
||||
if(m_soundMusic.IsPlaying())
|
||||
GAMESTATE->UpdateSongPosition(m_soundMusic.GetPositionSeconds());
|
||||
GAMESTATE->UpdateSongPosition( m_soundMusic.GetPositionSeconds(), GAMESTATE->m_pCurSong->m_Timing );
|
||||
|
||||
if( m_bZeroDeltaOnNextUpdate )
|
||||
{
|
||||
|
||||
@@ -249,7 +249,7 @@ void ScreenHowToPlay::Update( float fDelta )
|
||||
{
|
||||
if(GAMESTATE->m_pCurSong != NULL)
|
||||
{
|
||||
GAMESTATE->UpdateSongPosition( m_fFakeSecondsIntoSong );
|
||||
GAMESTATE->UpdateSongPosition( m_fFakeSecondsIntoSong, GAMESTATE->m_pCurSong->m_Timing );
|
||||
m_fFakeSecondsIntoSong += fDelta;
|
||||
|
||||
static int iLastNoteRowCounted = 0;
|
||||
|
||||
Reference in New Issue
Block a user