Allow for the Music Select preview music to be delayed when the screen starts.

This commit is contained in:
Andrew Livy
2009-05-03 11:37:49 +00:00
parent 8edb137dad
commit 52aef5d6c8
3 changed files with 8 additions and 0 deletions
+1
View File
@@ -417,6 +417,7 @@ MusicWheelOffCommand=
TimerSeconds=60
ShowStyleIcon=true
SampleMusicDelay=0.25
SampleMusicDelayInit=0
DoRouletteOnMenuTimer=true
AlignMusicBeat=false
Codes=""
+6
View File
@@ -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;
+1
View File
@@ -71,6 +71,7 @@ protected:
vector<Trail*> m_vpTrails;
int m_iSelection[NUM_PLAYERS];
ThemeMetric<float> SAMPLE_MUSIC_DELAY_INIT;
ThemeMetric<float> SAMPLE_MUSIC_DELAY;
ThemeMetric<bool> SAMPLE_MUSIC_LOOPS;
ThemeMetric<float> SAMPLE_MUSIC_FALLBACK_FADE_IN_SECONDS;