move "first update" stuff into ScreenGameplay::BeginScreen
This commit is contained in:
@@ -806,10 +806,6 @@ void ScreenGameplay::Init()
|
|||||||
this->SortByDrawOrder();
|
this->SortByDrawOrder();
|
||||||
|
|
||||||
m_GiveUpTimer.SetZero();
|
m_GiveUpTimer.SetZero();
|
||||||
|
|
||||||
// Get the transitions rolling on the first update.
|
|
||||||
// We can't do this in the constructor because ScreenGameplay is constructed
|
|
||||||
// in the middle of ScreenStage.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -1470,19 +1466,13 @@ void ScreenGameplay::UpdateSongPosition( float fDeltaTime )
|
|||||||
GAMESTATE->UpdateSongPosition( fSeconds+fAdjust, GAMESTATE->m_pCurSong->m_Timing, tm+fAdjust );
|
GAMESTATE->UpdateSongPosition( fSeconds+fAdjust, GAMESTATE->m_pCurSong->m_Timing, tm+fAdjust );
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenGameplay::Update( float fDeltaTime )
|
void ScreenGameplay::BeginScreen()
|
||||||
{
|
{
|
||||||
|
ScreenWithMenuElements::BeginScreen();
|
||||||
|
|
||||||
if( GAMESTATE->m_pCurSong == NULL )
|
if( GAMESTATE->m_pCurSong == NULL )
|
||||||
{
|
|
||||||
/* ScreenDemonstration will move us to the next screen. We just need to
|
|
||||||
* survive for one update without crashing. We need to call Screen::Update
|
|
||||||
* to make sure we receive the next-screen message. */
|
|
||||||
Screen::Update( fDeltaTime );
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
if( m_bFirstUpdate )
|
|
||||||
{
|
|
||||||
SOUND->PlayOnceFromAnnouncer( "gameplay intro" ); // crowd cheer
|
SOUND->PlayOnceFromAnnouncer( "gameplay intro" ); // crowd cheer
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -1533,6 +1523,16 @@ void ScreenGameplay::Update( float fDeltaTime )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ScreenGameplay::Update( float fDeltaTime )
|
||||||
|
{
|
||||||
|
if( GAMESTATE->m_pCurSong == NULL )
|
||||||
|
{
|
||||||
|
/* ScreenDemonstration will move us to the next screen. We just need to
|
||||||
|
* survive for one update without crashing. We need to call Screen::Update
|
||||||
|
* to make sure we receive the next-screen message. */
|
||||||
|
Screen::Update( fDeltaTime );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
UpdateSongPosition( fDeltaTime );
|
UpdateSongPosition( fDeltaTime );
|
||||||
|
|
||||||
|
|||||||
@@ -100,6 +100,7 @@ public:
|
|||||||
ScreenGameplay();
|
ScreenGameplay();
|
||||||
virtual void Init();
|
virtual void Init();
|
||||||
virtual ~ScreenGameplay();
|
virtual ~ScreenGameplay();
|
||||||
|
virtual void BeginScreen();
|
||||||
|
|
||||||
virtual void Update( float fDeltaTime );
|
virtual void Update( float fDeltaTime );
|
||||||
virtual void Input( const InputEventPlus &input );
|
virtual void Input( const InputEventPlus &input );
|
||||||
|
|||||||
Reference in New Issue
Block a user