From 2565009258461f4214766c00b9a11ebf155523bb Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 23 Jul 2018 20:58:54 -0400 Subject: [PATCH] remove dead code relating to gameplay pausing --- src/ScreenGameplay.cpp | 74 ------------------------------------------ src/ScreenGameplay.h | 9 ----- 2 files changed, 83 deletions(-) diff --git a/src/ScreenGameplay.cpp b/src/ScreenGameplay.cpp index 655ee0faac..b94236bc19 100644 --- a/src/ScreenGameplay.cpp +++ b/src/ScreenGameplay.cpp @@ -329,7 +329,6 @@ void ScreenGameplay::Init() } m_pSoundMusic = NULL; - set_paused_internal(false); if( GAMESTATE->m_pCurSong == NULL) return; // ScreenDemonstration will move us to the next screen. We just need to survive for one update without crashing. @@ -1168,8 +1167,6 @@ void ScreenGameplay::StartPlayingSong( float fMinTimeToNotes, float fMinTimeToMu } } m_pSoundMusic->Play(false, &p); - if( m_bPaused ) - m_pSoundMusic->Pause( true ); /* Make sure GAMESTATE->m_fMusicSeconds is set up. */ GAMESTATE->m_Position.m_fMusicSeconds = -5000; @@ -1185,42 +1182,6 @@ void ScreenGameplay::StartPlayingSong( float fMinTimeToNotes, float fMinTimeToMu } } -void ScreenGameplay::set_paused_internal(bool p) -{ - m_bPaused= p; - GAMESTATE->SetPaused(p); -} - -void ScreenGameplay::PauseGame( bool bPause, GameController gc ) { - return; // completely disable the functionality of this rather than various avenues to it (pending full removal) -mina - - if( m_bPaused == bPause ) - { - LOG->Trace( "ScreenGameplay::PauseGame(%i) received, but already in that state; ignored", bPause ); - return; - } - - // Don't pause if we're already tweening out. - if( bPause && m_DancingState == STATE_OUTRO ) - return; - - ResetGiveUpTimers(false); - - set_paused_internal(bPause); - m_PauseController = gc; - - m_pSoundMusic->Pause( bPause ); - if( bPause ) - this->PlayCommand( "Pause" ); - else - this->PlayCommand( "Unpause" ); - - FOREACH_EnabledPlayerInfo( m_vPlayerInfo, pi ) - { - pi->m_pPlayer->SetPaused( m_bPaused ); - } -} - // play assist ticks void ScreenGameplay::PlayTicks() { @@ -1374,10 +1335,6 @@ void ScreenGameplay::Update( float fDeltaTime ) if( SCREENMAN->GetTopScreen() != this ) return; - /* Update actors when paused, but never move on to another state. */ - if( m_bPaused ) - return; - //LOG->Trace( "m_fOffsetInBeats = %f, m_fBeatsPerSecond = %f, m_Music.GetPositionSeconds = %f", m_fOffsetInBeats, m_fBeatsPerSecond, m_Music.GetPositionSeconds() ); m_AutoKeysounds.Update(fDeltaTime); @@ -1869,24 +1826,6 @@ bool ScreenGameplay::Input( const InputEventPlus &input ) if( m_Codes.InputMessage(input, msg) ) this->HandleMessage( msg ); - if( m_bPaused ) - { - /* If we're paused, only accept GAME_BUTTON_START to unpause. */ - if( GAMESTATE->IsHumanPlayer(input.pn) && input.MenuI == GAME_BUTTON_START && input.type == IET_FIRST_PRESS ) - { - if( m_PauseController == GameController_Invalid || m_PauseController == input.GameI.controller ) - { - // IMO, it's better to have this configurable. -DaisuMaster - if( UNPAUSE_WITH_START ) - { - this->PauseGame( false ); - return true; - } - } - } - return false; - } - if(m_DancingState != STATE_OUTRO && GAMESTATE->IsHumanPlayer(input.pn) && !m_Cancel.IsTransitioning() ) @@ -2382,15 +2321,6 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM ) SOUND->PlayOnceFromAnnouncer( "gameplay failed" ); } - else if( SM == SM_Pause ) - { - // Ignore SM_Pause when in demonstration. - if( GAMESTATE->m_bDemonstrationOrJukebox ) - return; - - if( !m_bPaused ) - PauseGame( true ); - } ScreenWithMenuElements::HandleScreenMessage( SM ); } @@ -2581,8 +2511,6 @@ class LunaScreenGameplay: public Luna pi->PushSelf( L ); return 1; } - static int PauseGame( T* p, lua_State *L ) { p->Pause( BArg(1)); return 0; } - static int IsPaused( T* p, lua_State *L ) { lua_pushboolean( L, p->IsPaused() ); return 1; } static bool TurningPointsValid(lua_State* L, int index) { size_t size= lua_objlen(L, index); @@ -2630,8 +2558,6 @@ class LunaScreenGameplay: public Luna ADD_METHOD( GetPlayerInfo ); ADD_METHOD( GetDummyPlayerInfo ); // sm-ssc additions: - ADD_METHOD( PauseGame ); - ADD_METHOD( IsPaused ); ADD_METHOD(begin_backing_out); ADD_METHOD( GetTrueBPS ); } diff --git a/src/ScreenGameplay.h b/src/ScreenGameplay.h index 61cfdaf34e..b60ab35895 100644 --- a/src/ScreenGameplay.h +++ b/src/ScreenGameplay.h @@ -151,8 +151,6 @@ class ScreenGameplay : public ScreenWithMenuElements LifeMeter *GetLifeMeter( PlayerNumber pn ); PlayerInfo *GetPlayerInfo( PlayerNumber pn ); PlayerInfo *GetDummyPlayerInfo( int iDummyIndex ); - void Pause(bool bPause) { PauseGame(bPause); } - bool IsPaused() const { return m_bPaused; } void FailFadeRemovePlayer(PlayerInfo* pi); void FailFadeRemovePlayer(PlayerNumber pn); @@ -192,7 +190,6 @@ class ScreenGameplay : public ScreenWithMenuElements virtual void LoadNextSong(); void StartPlayingSong( float fMinTimeToNotes, float fMinTimeToMusic ); void GetMusicEndTiming( float &fSecondsToStartFadingOutMusic, float &fSecondsToStartTransitioningOut ); - void PauseGame( bool bPause, GameController gc = GameController_Invalid ); void PlayAnnouncer( const RString &type, float fSeconds, float *fDeltaSeconds ); void PlayAnnouncer( const RString &type, float fSeconds ) { PlayAnnouncer(type, fSeconds, &m_fTimeSinceLastDancingComment); } void SendCrossedMessages(); @@ -218,13 +215,7 @@ class ScreenGameplay : public ScreenWithMenuElements } /** @brief The specific point within ScreenGameplay. */ m_DancingState; private: - bool m_bPaused; - // set_paused_internal exists because GameState's pause variable needs to - // be kept in sync with ScreenGameplay's. - void set_paused_internal(bool p); protected: - - GameController m_PauseController; /** * @brief The songs left to play. *