From 0bff2928278be99adcc21b7b08218631b31b1cae Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sun, 1 Feb 2004 23:07:13 +0000 Subject: [PATCH] don't stop music if the next Attract screen is playing the same sound --- stepmania/src/ScreenAttract.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/stepmania/src/ScreenAttract.cpp b/stepmania/src/ScreenAttract.cpp index dc0e3b64b3..0b9ea6b0b4 100644 --- a/stepmania/src/ScreenAttract.cpp +++ b/stepmania/src/ScreenAttract.cpp @@ -156,7 +156,7 @@ void ScreenAttract::HandleScreenMessage( const ScreenMessage SM ) m_Out.StartTransitioning( SM_GoToNextScreen ); break; case SM_GoToNextScreen: - /* XXX: Look at the def of the screen we're going to; if it has a + /* Look at the def of the screen we're going to; if it has a * music theme element and it's the same as the one we're playing * now, don't stop. (However, if we're going to interrupt it * when we fade in, it's cleaner to stop it before we fade out.) */ @@ -167,7 +167,13 @@ void ScreenAttract::HandleScreenMessage( const ScreenMessage SM ) /* But if you don't stop it, for screens that have their own unique * music, it will constantly loop even after the screen has gone on * to the next attract screen. -- Miryokuteki */ - SOUND->PlayMusic( "" ); + bool bGoingToPlayTheSameMusic = + THEME->GetPathToS( NEXT_SCREEN, "music", false) == THEME->GetPathToS( m_sName, "music", false); + if( bGoingToPlayTheSameMusic ) + ; // do nothing + else + SOUND->PlayMusic( "" ); // stop the music + SCREENMAN->SetNewScreen( NEXT_SCREEN ); break; }