Change: Different code for starting song in sync. It seems to work better, but it's still in progess.

This commit is contained in:
Charles Lohr
2005-01-25 05:11:18 +00:00
parent 40d4733cd9
commit d45ab3d89a
+24 -4
View File
@@ -1135,10 +1135,6 @@ float ScreenGameplay::StartPlayingSong(float MinTimeToNotes, float MinTimeToMusi
p.StopMode = RageSoundParams::M_CONTINUE;
p.m_StartSecond = fStartSecond;
//Secondary (Precice) start request
//used for syncing up songs.
NSMAN->StartRequest(1);
m_pSoundMusic->Play( &p );
/* Make sure GAMESTATE->m_fMusicSeconds is set up. */
@@ -1252,6 +1248,30 @@ void ScreenGameplay::Update( float fDeltaTime )
{
StartPlayingSong( 0, 0 ); // *kick* (no transitions)
}
else if ( NSMAN->useSMserver )
{
//If we're using networking, we must not have any
//delay. If we do this can cause inconsistancy
//on different computers and differet themes
StartPlayingSong( 0, 0 );
m_pSoundMusic->Stop();
NSMAN->StartRequest(1);
RageSoundParams p;
p.AccurateSync = true;
p.SetPlaybackRate( 1.0 ); //Force 1.0 playback speed
p.StopMode = RageSoundParams::M_CONTINUE;
p.m_StartSecond = 0.0;
m_pSoundMusic->Play( &p );
UpdateSongPosition(0);
//We need to artifically trigger the sm_playeready so we can end game
//We want to post so this happens only after we're done what we're doing.
SCREENMAN->PostMessageToTopScreen( SM_PlayReady, 0.0 );
}
else
{
float fMinTimeToMusic = m_In.GetLengthSeconds(); // start of m_Ready