UpdateSongPositions
It is useful to have Player SongPositions update off of ScreenGameplay for use with things like ArrowEffects. ScreenGameplay, ScreenHowToPlay, and ScreenEdit stop GameSoundManager from running GameState:UpdateSongPosition and do it themselves, so this has no impact on the screen classes that cared about, and thus updated, player SongPositions.
This commit is contained in:
+5
-8
@@ -998,7 +998,7 @@ void GameState::ResetStageStatistics()
|
||||
m_iStageSeed = rand();
|
||||
}
|
||||
|
||||
void GameState::UpdateSongPosition( float fPositionSeconds, const TimingData &timing, const RageTimer ×tamp, bool bUpdatePlayers )
|
||||
void GameState::UpdateSongPosition( float fPositionSeconds, const TimingData &timing, const RageTimer ×tamp )
|
||||
{
|
||||
/* It's not uncommon to get a lot of duplicated positions from the sound
|
||||
* driver, like so: 13.120953,13.130975,13.130975,13.130975,13.140998,...
|
||||
@@ -1017,15 +1017,12 @@ void GameState::UpdateSongPosition( float fPositionSeconds, const TimingData &ti
|
||||
|
||||
m_Position.UpdateSongPosition( fPositionSeconds, timing, timestamp );
|
||||
|
||||
if( bUpdatePlayers )
|
||||
FOREACH_EnabledPlayer( pn )
|
||||
{
|
||||
FOREACH_EnabledPlayer( pn )
|
||||
if( m_pCurSteps[pn] )
|
||||
{
|
||||
if( m_pCurSteps[pn] )
|
||||
{
|
||||
m_pPlayerState[pn]->m_Position.UpdateSongPosition( fPositionSeconds, *m_pCurSteps[pn]->GetTimingData(), timestamp );
|
||||
Actor::SetPlayerBGMBeat( pn, m_pPlayerState[pn]->m_Position.m_fSongBeatVisible, m_pPlayerState[pn]->m_Position.m_fSongBeatNoOffset );
|
||||
}
|
||||
m_pPlayerState[pn]->m_Position.UpdateSongPosition( fPositionSeconds, *m_pCurSteps[pn]->GetTimingData(), timestamp );
|
||||
Actor::SetPlayerBGMBeat( pn, m_pPlayerState[pn]->m_Position.m_fSongBeatVisible, m_pPlayerState[pn]->m_Position.m_fSongBeatNoOffset );
|
||||
}
|
||||
}
|
||||
Actor::SetBGMTime( GAMESTATE->m_Position.m_fMusicSecondsVisible, GAMESTATE->m_Position.m_fSongBeatVisible, fPositionSeconds, GAMESTATE->m_Position.m_fSongBeatNoOffset );
|
||||
|
||||
+1
-1
@@ -254,7 +254,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, const TimingData &timing, const RageTimer ×tamp = RageZeroTimer, bool bUpdatePlayers = false );
|
||||
void UpdateSongPosition( float fPositionSeconds, const TimingData &timing, const RageTimer ×tamp = RageZeroTimer );
|
||||
float GetSongPercent( float beat ) const;
|
||||
|
||||
bool AllAreInDangerOrWorse() const;
|
||||
|
||||
+2
-2
@@ -1345,7 +1345,7 @@ void ScreenEdit::Update( float fDeltaTime )
|
||||
{
|
||||
RageTimer tm;
|
||||
const float fSeconds = m_pSoundMusic->GetPositionSeconds( NULL, &tm );
|
||||
GAMESTATE->UpdateSongPosition( fSeconds, GAMESTATE->m_pCurSong->m_SongTiming, tm, true );
|
||||
GAMESTATE->UpdateSongPosition( fSeconds, GAMESTATE->m_pCurSong->m_SongTiming, tm );
|
||||
}
|
||||
|
||||
if( m_EditState == STATE_RECORDING )
|
||||
@@ -3037,7 +3037,7 @@ void ScreenEdit::TransitionEditState( EditState em )
|
||||
/* Give a 1 second lead-in. If we're loading Player, this must be done first.
|
||||
* Also be sure to get the right timing. */
|
||||
float fSeconds = GetAppropriateTiming().GetElapsedTimeFromBeat( NoteRowToBeat(m_iStartPlayingAt) ) - 1;
|
||||
GAMESTATE->UpdateSongPosition( fSeconds, GetAppropriateTiming(), RageZeroTimer, true );
|
||||
GAMESTATE->UpdateSongPosition( fSeconds, GetAppropriateTiming(), RageZeroTimer );
|
||||
|
||||
GAMESTATE->m_bGameplayLeadIn.Set( false );
|
||||
|
||||
|
||||
@@ -1468,7 +1468,7 @@ void ScreenGameplay::UpdateSongPosition( float fDeltaTime )
|
||||
RageTimer tm;
|
||||
const float fSeconds = m_pSoundMusic->GetPositionSeconds( NULL, &tm );
|
||||
const float fAdjust = SOUND->GetFrameTimingAdjustment( fDeltaTime );
|
||||
GAMESTATE->UpdateSongPosition( fSeconds+fAdjust, GAMESTATE->m_pCurSong->m_SongTiming, tm+fAdjust, true );
|
||||
GAMESTATE->UpdateSongPosition( fSeconds+fAdjust, GAMESTATE->m_pCurSong->m_SongTiming, tm+fAdjust );
|
||||
}
|
||||
|
||||
void ScreenGameplay::BeginScreen()
|
||||
|
||||
@@ -251,7 +251,7 @@ void ScreenHowToPlay::Update( float fDelta )
|
||||
if( GAMESTATE->m_pCurSong != NULL )
|
||||
{
|
||||
RageTimer tm;
|
||||
GAMESTATE->UpdateSongPosition( m_fFakeSecondsIntoSong, GAMESTATE->m_pCurSong->m_SongTiming, tm, true );
|
||||
GAMESTATE->UpdateSongPosition( m_fFakeSecondsIntoSong, GAMESTATE->m_pCurSong->m_SongTiming, tm );
|
||||
m_fFakeSecondsIntoSong += fDelta;
|
||||
|
||||
static int iLastNoteRowCounted = 0;
|
||||
|
||||
Reference in New Issue
Block a user