Skip to content

Commit

Permalink
remove dead code relating to gameplay pausing
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed Jul 24, 2018
1 parent 24067c4 commit 2565009
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 83 deletions.
74 changes: 0 additions & 74 deletions src/ScreenGameplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;
Expand All @@ -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()
{
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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() )
Expand Down Expand Up @@ -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 );
}
Expand Down Expand Up @@ -2581,8 +2511,6 @@ class LunaScreenGameplay: public Luna<ScreenGameplay>
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);
Expand Down Expand Up @@ -2630,8 +2558,6 @@ class LunaScreenGameplay: public Luna<ScreenGameplay>
ADD_METHOD( GetPlayerInfo );
ADD_METHOD( GetDummyPlayerInfo );
// sm-ssc additions:
ADD_METHOD( PauseGame );
ADD_METHOD( IsPaused );
ADD_METHOD(begin_backing_out);
ADD_METHOD( GetTrueBPS );
}
Expand Down
9 changes: 0 additions & 9 deletions src/ScreenGameplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand All @@ -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.
*
Expand Down

0 comments on commit 2565009

Please sign in to comment.