diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index dcf8ab4bcd..3541bd1ce3 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -65,7 +65,6 @@ static ThemeMetric SECONDS_BETWEEN_COMMENTS ("ScreenGameplay","SecondsBet /* Global, so it's accessible from ShowSavePrompt: */ static float g_fOldOffset; // used on offset screen to calculate difference -AutoScreenMessage( SM_PlayReady ) AutoScreenMessage( SM_PlayGo ) // received while STATE_DANCING @@ -572,11 +571,6 @@ void ScreenGameplay::Init() // } } - m_Overlay.Load( THEME->GetPathB(m_sName,"overlay") ); - m_Overlay->SetDrawOrder( DRAW_ORDER_OVERLAY ); - this->AddChild( m_Overlay ); - - if( !GAMESTATE->m_bDemonstrationOrJukebox ) // only load if we're going to use it { m_Ready.Load( THEME->GetPathB(m_sName,"ready") ); @@ -1250,10 +1244,6 @@ void ScreenGameplay::Update( float fDeltaTime ) m_pSoundMusic->Play( &p ); UpdateSongPosition(0); - - //We need to artifically trigger the sm_playeready so we can end game - //We want to post so this happens only after we're done what we're doing. - SCREENMAN->PostMessageToTopScreen( SM_PlayReady, 0.0 ); } else { @@ -1271,8 +1261,6 @@ void ScreenGameplay::Update( float fDeltaTime ) */ /*float delay =*/ StartPlayingSong( fMinTimeToNotes, fMinTimeToMusic ); - - m_In.StartTransitioning( SM_PlayReady ); } } @@ -2081,7 +2069,7 @@ void ScreenGameplay::StageFinished( bool bBackedOut ) void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM ) { CHECKPOINT_M( ssprintf("HandleScreenMessage(%i)", SM) ); - if( SM == SM_PlayReady ) + if( SM == SM_DoneFadingIn ) { SOUND->PlayOnceFromAnnouncer( "gameplay ready" ); m_Ready.StartTransitioning( SM_PlayGo ); @@ -2411,7 +2399,6 @@ void ScreenGameplay::TweenOnScreen() ON_COMMAND( m_DifficultyIcon[p] ); ON_COMMAND( m_DifficultyMeter[p] ); } - m_Overlay->PlayCommand("On"); if (m_ShowScoreboard) FOREACH_NSScoreBoardColumn( sc ) @@ -2420,6 +2407,8 @@ void ScreenGameplay::TweenOnScreen() void ScreenGameplay::TweenOffScreen() { + ScreenWithMenuElements::TweenOffScreen(); + OFF_COMMAND( m_sprLifeFrame ); OFF_COMMAND( m_sprStage ); OFF_COMMAND( m_sprCourseSongNumber ); @@ -2448,7 +2437,6 @@ void ScreenGameplay::TweenOffScreen() OFF_COMMAND( m_DifficultyIcon[p] ); OFF_COMMAND( m_DifficultyMeter[p] ); } - m_Overlay->PlayCommand("Off"); if (m_ShowScoreboard) FOREACH_NSScoreBoardColumn( sc ) diff --git a/stepmania/src/ScreenGameplay.h b/stepmania/src/ScreenGameplay.h index f556058e4e..05db700035 100644 --- a/stepmania/src/ScreenGameplay.h +++ b/stepmania/src/ScreenGameplay.h @@ -139,7 +139,6 @@ protected: Transition m_Toasty; // easter egg Transition m_Win[NUM_PLAYERS]; Transition m_Draw; - AutoActor m_Overlay; BitmapText m_textSurviveTime; // used in extra stage diff --git a/stepmania/src/ScreenMessage.h b/stepmania/src/ScreenMessage.h index 1a59764b8d..ae43fe459a 100644 --- a/stepmania/src/ScreenMessage.h +++ b/stepmania/src/ScreenMessage.h @@ -12,6 +12,7 @@ enum ScreenMessage { SM_DoneOpeningWipingLeft, SM_DoneOpeningWipingRight, SM_MenuTimer, + SM_DoneFadingIn, SM_BeginFadingOut, SM_GoToNextScreen, SM_GoToPrevScreen, diff --git a/stepmania/src/ScreenWithMenuElements.cpp b/stepmania/src/ScreenWithMenuElements.cpp index ece2015613..33d0659efa 100644 --- a/stepmania/src/ScreenWithMenuElements.cpp +++ b/stepmania/src/ScreenWithMenuElements.cpp @@ -116,7 +116,7 @@ void ScreenWithMenuElements::Init() m_Cancel.SetDrawOrder( DRAW_ORDER_TRANSITIONS ); this->AddChild( &m_Cancel ); - m_In.StartTransitioning(); + m_In.StartTransitioning( SM_DoneFadingIn ); } ScreenWithMenuElements::~ScreenWithMenuElements() @@ -164,6 +164,25 @@ void ScreenWithMenuElements::ResetTimer() } void ScreenWithMenuElements::StartTransitioning( ScreenMessage smSendWhenDone ) +{ + TweenOffScreen(); + + m_Out.StartTransitioning(smSendWhenDone); + + /* Ack. If the transition finishes transparent (eg. _options to options), + * then we don't want to send the message until all of the *actors* are + * done tweening. However, if it finishes with something onscreen (most + * of the rest), we have to send the message immediately after it finishes, + * or we'll draw a frame without the transition. + * + * For now, I'll make the SMMAX2 option tweening faster. */ + /* This includes all of the actors: */ +// float TimeUntilFinished = GetTweenTimeLeft(); +// TimeUntilFinished = max(TimeUntilFinished, m_Out.GetLengthSeconds()); +// SCREENMAN->PostMessageToTopScreen( smSendWhenDone, TimeUntilFinished ); +} + +void ScreenWithMenuElements::TweenOffScreen() { if( m_bTimerEnabled ) { @@ -183,19 +202,6 @@ void ScreenWithMenuElements::StartTransitioning( ScreenMessage smSendWhenDone ) SCREENMAN->PlaySharedBackgroundOffCommand(); - m_Out.StartTransitioning(smSendWhenDone); - - /* Ack. If the transition finishes transparent (eg. _options to options), - * then we don't want to send the message until all of the *actors* are - * done tweening. However, if it finishes with something onscreen (most - * of the rest), we have to send the message immediately after it finishes, - * or we'll draw a frame without the transition. - * - * For now, I'll make the SMMAX2 option tweening faster. */ - /* This includes all of the actors: */ -// float TimeUntilFinished = GetTweenTimeLeft(); -// TimeUntilFinished = max(TimeUntilFinished, m_Out.GetLengthSeconds()); -// SCREENMAN->PostMessageToTopScreen( smSendWhenDone, TimeUntilFinished ); } void ScreenWithMenuElements::Cancel( ScreenMessage smSendWhenDone ) diff --git a/stepmania/src/ScreenWithMenuElements.h b/stepmania/src/ScreenWithMenuElements.h index 627fe9557a..050ad40361 100644 --- a/stepmania/src/ScreenWithMenuElements.h +++ b/stepmania/src/ScreenWithMenuElements.h @@ -28,6 +28,8 @@ public: void StopTimer(); void ResetTimer(); + void TweenOffScreen(); + protected: virtual void StartPlayingMusic();