From 2b3e145a301912651857c6c72718cdb65543540e Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 3 Dec 2004 23:30:50 +0000 Subject: [PATCH] split UpdateLights() from monster ScreenGameplay::Update() --- stepmania/src/ScreenGameplay.cpp | 52 +++++++++++++++++--------------- stepmania/src/ScreenGameplay.h | 1 + 2 files changed, 29 insertions(+), 24 deletions(-) diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index ac1110ccb6..04d4562060 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -1509,6 +1509,34 @@ void ScreenGameplay::Update( float fDeltaTime ) // // update lights // + UpdateLights(); + // + // update song position meter + // + // IMHHO, The song position bar is best used to represent where in the + // step sequence the players are. It looks "better" that way, showing a + // song "depleting" as the players wear on. So, it starts "ticking" at + // the first arrow and winds down to the very end. + float fPercentPositionSong = SCALE( GAMESTATE->m_fMusicSeconds, m_fSongPosMeterOffset, + m_fSongPosMeterEnd, 0.0f, 1.0f ); + + CLAMP( fPercentPositionSong, 0, 1 ); + m_meterSongPosition.SetPercent( fPercentPositionSong ); + + if( NSMAN->useSMserver ) + { + FOREACH_EnabledPlayer( pn2 ) + if( m_pLifeMeter[pn2] ) + NSMAN->m_playerLife[pn2] = int(m_pLifeMeter[pn2]->GetLife()*10000); + + FOREACH_NSScoreBoardColumn(cn) + if( m_ShowScoreboard && NSMAN->ChangedScoreboard(cn) ) + m_Scoreboard[cn].SetText( NSMAN->m_Scoreboard[cn] ); + } +} + +void ScreenGameplay::UpdateLights() +{ const Style* pStyle = GAMESTATE->GetCurrentStyle(); bool bBlinkCabinetLight[NUM_CABINET_LIGHTS]; bool bBlinkGameButton[MAX_GAME_CONTROLLERS][MAX_GAME_BUTTONS]; @@ -1609,30 +1637,6 @@ void ScreenGameplay::Update( float fDeltaTime ) LIGHTSMAN->BlinkGameButton( GameInput(gc,gb) ); } } - - // - // update song position meter - // - // IMHHO, The song position bar is best used to represent where in the - // step sequence the players are. It looks "better" that way, showing a - // song "depleting" as the players wear on. So, it starts "ticking" at - // the first arrow and winds down to the very end. - float fPercentPositionSong = SCALE( GAMESTATE->m_fMusicSeconds, m_fSongPosMeterOffset, - m_fSongPosMeterEnd, 0.0f, 1.0f ); - - CLAMP( fPercentPositionSong, 0, 1 ); - m_meterSongPosition.SetPercent( fPercentPositionSong ); - - if( NSMAN->useSMserver ) - { - FOREACH_EnabledPlayer( pn2 ) - if( m_pLifeMeter[pn2] ) - NSMAN->m_playerLife[pn2] = int(m_pLifeMeter[pn2]->GetLife()*10000); - - FOREACH_NSScoreBoardColumn(cn) - if( m_ShowScoreboard && NSMAN->ChangedScoreboard(cn) ) - m_Scoreboard[cn].SetText( NSMAN->m_Scoreboard[cn] ); - } } void ScreenGameplay::AbortGiveUp() diff --git a/stepmania/src/ScreenGameplay.h b/stepmania/src/ScreenGameplay.h index 103d3b219d..743f5d4bca 100644 --- a/stepmania/src/ScreenGameplay.h +++ b/stepmania/src/ScreenGameplay.h @@ -76,6 +76,7 @@ protected: float StartPlayingSong(float MinTimeToNotes, float MinTimeToMusic); void ShowSavePrompt( ScreenMessage SM_SendWhenDone ); void PlayAnnouncer( CString type, float fSeconds ); + void UpdateLights(); void PlayTicks(); void UpdateSongPosition( float fDeltaTime );