m_Foreground -> m_SongForeground, for consistency

work on pausing
OnCommand for m_SongBackground and m_SongForeground (eg. to
change draw order)
This commit is contained in:
Glenn Maynard
2005-03-11 02:52:40 +00:00
parent 4356df6b8f
commit 751b4ca4bb
2 changed files with 24 additions and 4 deletions
+21 -3
View File
@@ -110,6 +110,7 @@ void ScreenGameplay::Init()
LIGHTSMAN->SetLightsMode( LIGHTSMODE_GAMEPLAY );
m_pSoundMusic = NULL;
m_bPaused = false;
/* We do this ourself. */
SOUND->HandleSongTimer( false );
@@ -260,11 +261,15 @@ void ScreenGameplay::Init()
m_SongBackground.SetName( "SongBackground" );
m_SongBackground.SetDrawOrder( DRAW_ORDER_BEFORE_EVERYTHING );
ON_COMMAND( m_SongBackground );
this->AddChild( &m_SongBackground );
m_Foreground.SetDrawOrder( DRAW_ORDER_OVERLAY+1 ); // on top of the overlay, but under transitions
this->AddChild( &m_Foreground );
m_SongForeground.SetName( "SongForeground" );
m_SongForeground.SetDrawOrder( DRAW_ORDER_OVERLAY+1 ); // on top of the overlay, but under transitions
ON_COMMAND( m_SongBackground );
this->AddChild( &m_SongForeground );
if( PREFSMAN->m_bShowBeginnerHelper )
{
@@ -1060,7 +1065,7 @@ void ScreenGameplay::LoadNextSong()
else
m_BeginnerHelper.SetHidden( false );
m_Foreground.LoadFromSong( GAMESTATE->m_pCurSong );
m_SongForeground.LoadFromSong( GAMESTATE->m_pCurSong );
m_fTimeSinceLastDancingComment = 0;
@@ -1127,6 +1132,19 @@ float ScreenGameplay::StartPlayingSong(float MinTimeToNotes, float MinTimeToMusi
return fFirstSecond - fStartSecond;
}
void ScreenGameplay::PauseGame( bool bPause )
{
if( m_bPaused == bPause )
{
LOG->Trace( "ScreenGameplay::PauseGame(%i) received, but already in that state; ignored", bPause );
return;
}
m_bPaused = bPause;
m_pSoundMusic->Pause( bPause );
}
// play assist ticks
void ScreenGameplay::PlayTicks()
{
+3 -1
View File
@@ -54,6 +54,7 @@ protected:
void LoadNextSong();
void LoadCourseSongNumber( int SongNumber );
float StartPlayingSong(float MinTimeToNotes, float MinTimeToMusic);
void PauseGame( bool bPause );
void ShowSavePrompt( ScreenMessage SM_SendWhenDone );
void PlayAnnouncer( CString type, float fSeconds );
void UpdateLights();
@@ -73,6 +74,7 @@ protected:
STATE_OUTRO, // not allowed to press Back
NUM_DANCING_STATES
} m_DancingState;
bool m_bPaused;
vector<Song*> m_apSongsQueue; // size may be >1 if playing a course
vector<Steps*> m_vpStepsQueue[NUM_PLAYERS]; // size may be >1 if playing a course
vector<AttackArray> m_asModifiersQueue[NUM_PLAYERS];// size may be >1 if playing a course
@@ -83,7 +85,7 @@ protected:
LyricDisplay m_LyricDisplay;
Background m_SongBackground;
Foreground m_Foreground;
Foreground m_SongForeground;
Transition m_NextSongIn; // shows between songs in a course
Transition m_NextSongOut; // shows between songs in a course