From ad59a32a69d1f770cd486026d26382b8a63aacd2 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 7 Feb 2005 07:41:31 +0000 Subject: [PATCH] flush sound after first update --- stepmania/src/ScreenManager.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/stepmania/src/ScreenManager.cpp b/stepmania/src/ScreenManager.cpp index 1b734b3b97..a003683255 100644 --- a/stepmania/src/ScreenManager.cpp +++ b/stepmania/src/ScreenManager.cpp @@ -147,6 +147,8 @@ void ScreenManager::Update( float fDeltaTime ) Screen* pScreen = m_ScreenStack.empty() ? NULL : GetTopScreen(); + bool bFirstUpdate = pScreen && pScreen->IsFirstUpdate(); + /* Loading a new screen can take seconds and cause a big jump on the new * Screen's first update. Clamp the first update delta so that the * animations don't jump. */ @@ -164,6 +166,11 @@ void ScreenManager::Update( float fDeltaTime ) m_SystemLayer->Update( fDeltaTime ); + /* The music may be started on the first update. If we're reading from a CD, + * it might not start immediately. Make sure we start playing the sound before + * continuing, since it's strange to start rendering before the music starts. */ + if( bFirstUpdate ) + SOUND->Flush(); EmptyDeleteQueue();