From 79357a62e39df58982a9f39bd9f45e099ed2700d Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 26 Feb 2007 01:46:50 +0000 Subject: [PATCH] move start periods into metrics This was originally derived from the transitions, to make the start times automatically work when people change transitions. That doesn't give enough control, though. --- stepmania/src/ScreenGameplay.cpp | 24 ++++++------------------ stepmania/src/ScreenGameplay.h | 3 +++ 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index 25e7518aab..3f54f4f8ce 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -339,6 +339,9 @@ void ScreenGameplay::Init() GIVE_UP_BACK_TEXT.Load( m_sName, "GiveUpBackText" ); GIVE_UP_ABORTED_TEXT.Load( m_sName, "GiveUpAbortedText" ); MUSIC_FADE_OUT_SECONDS.Load( m_sName, "MusicFadeOutSeconds" ); + MIN_SECONDS_TO_STEP.Load( m_sName, "MinSecondsToStep" ); + MIN_SECONDS_TO_MUSIC.Load( m_sName, "MinSecondsToMusic" ); + MIN_SECONDS_TO_STEP_NEXT_SONG.Load( m_sName, "MinSecondsToStepNextSong" ); START_GIVES_UP.Load( m_sName, "StartGivesUp" ); BACK_GIVES_UP.Load( m_sName, "BackGivesUp" ); GIVING_UP_GOES_TO_PREV_SCREEN.Load( m_sName, "GivingUpGoesToPrevScreen" ); @@ -1409,7 +1412,7 @@ void ScreenGameplay::BeginScreen() // if( GAMESTATE->m_bDemonstrationOrJukebox ) { - StartPlayingSong( 0, 0 ); // *kick* (no transitions) + StartPlayingSong( MIN_SECONDS_TO_STEP, MIN_SECONDS_TO_MUSIC ); } else if( NSMAN->useSMserver ) { @@ -1435,20 +1438,7 @@ void ScreenGameplay::BeginScreen() } else { - float fMinTimeToMusic = m_In.GetLengthSeconds(); // start of m_Ready - float fMinTimeToNotes = fMinTimeToMusic + m_Ready.GetLengthSeconds() + m_Go.GetLengthSeconds()+2; // end of Go - - /* - * Tell the music to start, but don't actually make any noise for - * at least 2.5 (or 1.5) seconds. (This is so we scroll on screen smoothly.) - * - * This is only a minimum: the music might be started later, to meet - * the minimum-time-to-notes value. If you're writing song data, - * and you want to make sure we get ideal timing here, make sure there's - * a bit of space at the beginning of the music with no steps. - */ - - StartPlayingSong( fMinTimeToNotes, fMinTimeToMusic ); + StartPlayingSong( MIN_SECONDS_TO_STEP, MIN_SECONDS_TO_MUSIC ); } } @@ -2413,9 +2403,7 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM ) m_NextSong.PlayCommand( "Finish" ); m_NextSong.StartTransitioning( SM_None ); - /* We're fading in, so don't hit any notes for a few seconds; they'll be - * obscured by the fade. */ - StartPlayingSong( m_NextSong.GetLengthSeconds()+2, 0 ); + StartPlayingSong( MIN_SECONDS_TO_STEP_NEXT_SONG, 0 ); } else if( SM == SM_PlayToasty ) { diff --git a/stepmania/src/ScreenGameplay.h b/stepmania/src/ScreenGameplay.h index c65feb2b5d..41bbd92dd8 100644 --- a/stepmania/src/ScreenGameplay.h +++ b/stepmania/src/ScreenGameplay.h @@ -139,6 +139,9 @@ protected: LocalizedString GIVE_UP_BACK_TEXT; LocalizedString GIVE_UP_ABORTED_TEXT; ThemeMetric MUSIC_FADE_OUT_SECONDS; + ThemeMetric MIN_SECONDS_TO_STEP; + ThemeMetric MIN_SECONDS_TO_MUSIC; + ThemeMetric MIN_SECONDS_TO_STEP_NEXT_SONG; ThemeMetric START_GIVES_UP; ThemeMetric BACK_GIVES_UP; ThemeMetric GIVING_UP_GOES_TO_PREV_SCREEN;