diff --git a/stepmania/Themes/default/metrics.ini b/stepmania/Themes/default/metrics.ini index 0b3dcf04c0..de96b1ddaf 100644 --- a/stepmania/Themes/default/metrics.ini +++ b/stepmania/Themes/default/metrics.ini @@ -417,6 +417,7 @@ MusicWheelOffCommand= TimerSeconds=60 ShowStyleIcon=true SampleMusicDelay=0.25 +SampleMusicDelayInit=0 DoRouletteOnMenuTimer=true AlignMusicBeat=false Codes="" diff --git a/stepmania/src/ScreenSelectMusic.cpp b/stepmania/src/ScreenSelectMusic.cpp index a8fdef1ef7..0c2fdfa49e 100644 --- a/stepmania/src/ScreenSelectMusic.cpp +++ b/stepmania/src/ScreenSelectMusic.cpp @@ -55,10 +55,12 @@ static RString g_sBannerPath; static bool g_bBannerWaiting = false; static bool g_bSampleMusicWaiting = false; static RageTimer g_StartedLoadingAt(RageZeroTimer); +static RageTimer g_ScreenStartedLoadingAt(RageZeroTimer); REGISTER_SCREEN_CLASS( ScreenSelectMusic ); void ScreenSelectMusic::Init() { + g_ScreenStartedLoadingAt.Touch(); if( PREFSMAN->m_sTestInitialScreen.Get() == m_sName ) { GAMESTATE->m_PlayMode.Set( PLAY_MODE_REGULAR ); @@ -67,6 +69,7 @@ void ScreenSelectMusic::Init() GAMESTATE->m_MasterPlayerNumber = PLAYER_1; } + SAMPLE_MUSIC_DELAY_INIT.Load( m_sName, "SampleMusicDelayInit" ); SAMPLE_MUSIC_DELAY.Load( m_sName, "SampleMusicDelay" ); SAMPLE_MUSIC_LOOPS.Load( m_sName, "SampleMusicLoops" ); SAMPLE_MUSIC_FALLBACK_FADE_IN_SECONDS.Load( m_sName, "SampleMusicFallbackFadeInSeconds" ); @@ -303,6 +306,9 @@ void ScreenSelectMusic::CheckBackgroundRequests( bool bForce ) /* Nothing else is going. Start the music, if we haven't yet. */ if( g_bSampleMusicWaiting ) { + if(g_ScreenStartedLoadingAt.Ago() < SAMPLE_MUSIC_DELAY_INIT) + return; + /* Don't start the music sample when moving fast. */ if( g_StartedLoadingAt.Ago() < SAMPLE_MUSIC_DELAY && !bForce ) return; diff --git a/stepmania/src/ScreenSelectMusic.h b/stepmania/src/ScreenSelectMusic.h index b2671c3291..1f528c8c75 100644 --- a/stepmania/src/ScreenSelectMusic.h +++ b/stepmania/src/ScreenSelectMusic.h @@ -71,6 +71,7 @@ protected: vector m_vpTrails; int m_iSelection[NUM_PLAYERS]; + ThemeMetric SAMPLE_MUSIC_DELAY_INIT; ThemeMetric SAMPLE_MUSIC_DELAY; ThemeMetric SAMPLE_MUSIC_LOOPS; ThemeMetric SAMPLE_MUSIC_FALLBACK_FADE_IN_SECONDS;