From c8efe2e5c726ed5f5c9e6c54c0a7eec624bf4c80 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 25 Mar 2003 01:37:33 +0000 Subject: [PATCH] don't start tweening while we're still loading; it'll play transition sounds prematurely --- stepmania/src/MenuElements.cpp | 14 +++++++++++++- stepmania/src/MenuElements.h | 3 +++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/stepmania/src/MenuElements.cpp b/stepmania/src/MenuElements.cpp index d94424bac8..7c4e74b7fd 100644 --- a/stepmania/src/MenuElements.cpp +++ b/stepmania/src/MenuElements.cpp @@ -94,8 +94,20 @@ void MenuElements::Load( CString sClassName, bool bEnableTimer, bool bLoadStyleI m_soundBack.Load( THEME->GetPathTo("Sounds","Common back") ); + m_bStartedTransitionIn = false; +} - m_In.StartTransitioning( SM_None ); +void MenuElements::Update( float fDeltaTime ) +{ + if(!m_bStartedTransitionIn) + { + /* Start the transition on the first update, not in the ctor, so + * we don't play a sound while our parent is still loading. */ + m_bStartedTransitionIn = true; + m_In.StartTransitioning( SM_None ); + } + + ActorFrame::Update(fDeltaTime); } void MenuElements::StartTransitioning( ScreenMessage smSendWhenDone ) diff --git a/stepmania/src/MenuElements.h b/stepmania/src/MenuElements.h index 1be70771c9..adc451d420 100644 --- a/stepmania/src/MenuElements.h +++ b/stepmania/src/MenuElements.h @@ -38,6 +38,7 @@ public: void StartTransitioning( ScreenMessage smSendWhenDone ); void Back( ScreenMessage smSendWhenDone ); + void Update( float fDeltaTime ); bool IsTransitioning(); public: // let owner tinker with these objects @@ -57,6 +58,8 @@ public: // let owner tinker with these objects TransitionBGAnimation m_Back; RageSound m_soundBack; + + bool m_bStartedTransitionIn; }; #endif