Better, cleaner solution for conditionally initializing the BeginnerHelper.

This commit is contained in:
Thad Ward
2003-08-24 23:43:42 +00:00
parent 0d74c0d864
commit d834608f0d
+3 -7
View File
@@ -776,18 +776,14 @@ void ScreenGameplay::LoadNextSong()
/* Set up song-specific graphics. */ /* Set up song-specific graphics. */
bool UseBeginnerhelper = false;
// Beginner steps are always the same on both players.. Just get the # of 1 player that's using the Beginner steps, and go on. // Beginner steps are always the same on both players.. Just get the # of 1 player that's using the Beginner steps, and go on.
m_iPOB = 0; m_iPOB = -1;
for( int pb=0; pb<NUM_PLAYERS; pb++ ) for( int pb=0; pb<NUM_PLAYERS; pb++ )
if( GAMESTATE->IsPlayerEnabled(pb) && GAMESTATE->m_PreferredDifficulty[pb] == DIFFICULTY_BEGINNER ) if( GAMESTATE->IsPlayerEnabled(pb) && GAMESTATE->m_PreferredDifficulty[pb] == DIFFICULTY_BEGINNER )
{
UseBeginnerhelper = true;
m_iPOB = pb; m_iPOB = pb;
}
/* TODO: fall back on m_Background if nobody is on beginner. */ /* TODO: fall back on m_Background if nobody is on beginner. */
if( PREFSMAN->m_bShowBeginnerHelper && UseBeginnerhelper) if( PREFSMAN->m_bShowBeginnerHelper && m_iPOB != -1)
{ {
m_Background.Unload(); // BeginnerHelper has it's own BG control. m_Background.Unload(); // BeginnerHelper has it's own BG control.
m_Background.StopAnimating(); m_Background.StopAnimating();
@@ -997,7 +993,7 @@ void ScreenGameplay::Update( float fDeltaTime )
// Check to see what we animate on this one // Check to see what we animate on this one
/* tip: Store a NoteData inside BeginnerHelper, Load it above and handle all of this /* tip: Store a NoteData inside BeginnerHelper, Load it above and handle all of this
* within BeginnerHelper::Update. */ * within BeginnerHelper::Update. */
if( PREFSMAN->m_bShowBeginnerHelper ) if( PREFSMAN->m_bShowBeginnerHelper && m_iPOB != -1)
{ {
int iStep = 0; int iStep = 0;
if( (m_Player[m_iPOB].IsThereATapAtRow( BeatToNoteRowNotRounded((GAMESTATE->m_fSongBeat+0.1f)) ) ) ) if( (m_Player[m_iPOB].IsThereATapAtRow( BeatToNoteRowNotRounded((GAMESTATE->m_fSongBeat+0.1f)) ) ) )