move "first update" stuff into ScreenGameplay::BeginScreen

This commit is contained in:
Glenn Maynard
2006-01-18 20:45:05 +00:00
parent b8ed7366c7
commit 48e9ff0f22
2 changed files with 58 additions and 57 deletions
+13 -13
View File
@@ -806,10 +806,6 @@ void ScreenGameplay::Init()
this->SortByDrawOrder();
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 );
}
void ScreenGameplay::Update( float fDeltaTime )
void ScreenGameplay::BeginScreen()
{
ScreenWithMenuElements::BeginScreen();
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;
}
if( m_bFirstUpdate )
{
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 );
+1
View File
@@ -100,6 +100,7 @@ public:
ScreenGameplay();
virtual void Init();
virtual ~ScreenGameplay();
virtual void BeginScreen();
virtual void Update( float fDeltaTime );
virtual void Input( const InputEventPlus &input );