diff --git a/stepmania/src/MenuTimer.cpp b/stepmania/src/MenuTimer.cpp index 3b58b51fb4..808e4ea807 100644 --- a/stepmania/src/MenuTimer.cpp +++ b/stepmania/src/MenuTimer.cpp @@ -94,7 +94,10 @@ void MenuTimer::Update( float fDeltaTime ) } if( iNewDisplay <= WARNING_BEEP_START ) - m_soundBeep.Play(); + { + if( m_soundBeep.IsLoaded() ) + m_soundBeep.Play(); + } } diff --git a/stepmania/src/RageSound.cpp b/stepmania/src/RageSound.cpp index b532ecc416..2855f3c015 100644 --- a/stepmania/src/RageSound.cpp +++ b/stepmania/src/RageSound.cpp @@ -136,6 +136,11 @@ void RageSound::Unload() databuf.clear(); } +bool RageSound::IsLoaded() +{ + return Sample != NULL; +} + void RageSound::Fail(CString reason) { LOG->Warn("Decoding %s failed: %s", GetLoadedFilePath().c_str(), reason.c_str() ); diff --git a/stepmania/src/RageSound.h b/stepmania/src/RageSound.h index 162233dceb..bdd479a44b 100644 --- a/stepmania/src/RageSound.h +++ b/stepmania/src/RageSound.h @@ -97,6 +97,7 @@ public: * be set up only if needed. Doesn't fail. */ void LoadSoundReader( SoundReader *pSound ); void Unload(); + bool IsLoaded(); void StartPlaying(); void StopPlaying(); diff --git a/stepmania/src/ScreenWithMenuElements.cpp b/stepmania/src/ScreenWithMenuElements.cpp index 4db9f9f3dd..51a66e11c7 100644 --- a/stepmania/src/ScreenWithMenuElements.cpp +++ b/stepmania/src/ScreenWithMenuElements.cpp @@ -10,6 +10,7 @@ #include "ScreenManager.h" #define TIMER_SECONDS THEME->GetMetricI(m_sName,"TimerSeconds") +#define TIMER_STEALTH THEME->GetMetricB(m_sName,"TimerStealth") #define STYLE_ICON THEME->GetMetricB(m_sName,"StyleIcon") #define MEMORY_CARD_ICONS THEME->GetMetricB(m_sName,"MemoryCardIcons") @@ -65,6 +66,8 @@ ScreenWithMenuElements::ScreenWithMenuElements( CString sClassName ) : Screen( s if( m_bTimerEnabled ) { m_MenuTimer->SetName( "Timer" ); + if( TIMER_STEALTH ) + m_MenuTimer->EnableStealth( true ); UtilSetXY( m_MenuTimer, m_sName ); UtilOnCommand( m_MenuTimer, m_sName ); ResetTimer();