From 06c3b710fa048d6785f30803da1e5c487e2ca347 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sun, 25 Jul 2004 08:40:01 +0000 Subject: [PATCH] Start attract music in first update, not ScreenAttract's ctor; we may have more to load in the derived class, and it's better to wait for loads to finish before starting music (starting music in the middle of a load then delaying some more is ugly and emphasizes the load time) --- stepmania/src/ScreenAttract.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/stepmania/src/ScreenAttract.cpp b/stepmania/src/ScreenAttract.cpp index a341614b9b..fc42f7af43 100644 --- a/stepmania/src/ScreenAttract.cpp +++ b/stepmania/src/ScreenAttract.cpp @@ -46,11 +46,6 @@ ScreenAttract::ScreenAttract( CString sName, bool bResetGameState ) : Screen( sN SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo(m_sName) ); - if( GAMESTATE->IsTimeToPlayAttractSounds() ) - SOUND->PlayMusic( THEME->GetPathToS(m_sName + " music") ); - else - SOUND->PlayMusic( "" ); // stop music - float fTimeUntilBeginFadingOut = m_Background.GetLengthSeconds() - m_Out.GetLengthSeconds(); if( fTimeUntilBeginFadingOut < 0 ) { @@ -134,6 +129,13 @@ void ScreenAttract::AttractInput( const DeviceInput& DeviceI, const InputEventTy void ScreenAttract::Update( float fDelta ) { + if( IsFirstUpdate() ) + { + if( GAMESTATE->IsTimeToPlayAttractSounds() ) + SOUND->PlayMusic( THEME->GetPathToS(m_sName + " music") ); + else + SOUND->PlayMusic( "" ); // stop music + } Screen::Update(fDelta); }