This commit is contained in:
Glenn Maynard
2005-04-29 01:35:44 +00:00
parent 213787ed2c
commit 1fa516935c
+14 -28
View File
@@ -1632,29 +1632,37 @@ void ScreenGameplay::UpdateLights()
// for each index we crossed since the last update: // for each index we crossed since the last update:
FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE( m_CabinetLightsNoteData, cl, r, iRowLastCrossed+1, iSongRow+1 ) FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE( m_CabinetLightsNoteData, cl, r, iRowLastCrossed+1, iSongRow+1 )
{ {
bool bBlink = (m_CabinetLightsNoteData.GetTapNote( cl, r ).type != TapNote::empty ); if( m_CabinetLightsNoteData.GetTapNote( cl, r ).type != TapNote::empty )
bBlinkCabinetLight[cl] |= bBlink; bBlinkCabinetLight[cl] = true;
} }
if( m_CabinetLightsNoteData.IsHoldNoteAtBeat( cl, iSongRow ) ) if( m_CabinetLightsNoteData.IsHoldNoteAtBeat( cl, iSongRow ) )
bBlinkCabinetLight[cl] |= true; bBlinkCabinetLight[cl] = true;
} }
FOREACH_EnabledPlayer( pn ) FOREACH_EnabledPlayer( pn )
{ {
for( int t=0; t<m_Player[pn].m_NoteData.GetNumTracks(); t++ ) for( int t=0; t<m_Player[pn].m_NoteData.GetNumTracks(); t++ )
{ {
bool bBlink = false;
// for each index we crossed since the last update: // for each index we crossed since the last update:
FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE( m_Player[pn].m_NoteData, t, r, iRowLastCrossed+1, iSongRow+1 ) FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE( m_Player[pn].m_NoteData, t, r, iRowLastCrossed+1, iSongRow+1 )
{ {
TapNote tn = m_Player[pn].m_NoteData.GetTapNote(t,r); TapNote tn = m_Player[pn].m_NoteData.GetTapNote(t,r);
bool bBlink = (tn.type != TapNote::empty && tn.type != TapNote::mine); if( tn.type != TapNote::empty && tn.type != TapNote::mine )
bBlink = true;
}
// check if a hold should be active
if( m_Player[pn].m_NoteData.IsHoldNoteAtBeat( t, iSongRow ) )
bBlink = true;
if( bBlink ) if( bBlink )
{ {
StyleInput si( pn, t ); StyleInput si( pn, t );
GameInput gi = pStyle->StyleInputToGameInput( si ); GameInput gi = pStyle->StyleInputToGameInput( si );
bBlinkGameButton[gi.controller][gi.button] |= bBlink; bBlinkGameButton[gi.controller][gi.button] = true;
}
} }
} }
} }
@@ -1662,28 +1670,6 @@ void ScreenGameplay::UpdateLights()
iRowLastCrossed = iSongRow; iRowLastCrossed = iSongRow;
} }
{
// check for active HoldNotes
float fPositionSeconds = GAMESTATE->m_fMusicSeconds + LIGHTS_FALLOFF_SECONDS/2; // trigger the light a tiny bit early
float fSongBeat = GAMESTATE->m_pCurSong->GetBeatFromElapsedTime( fPositionSeconds );
const int iSongRow = BeatToNoteRow( fSongBeat );
FOREACH_EnabledPlayer( pn )
{
// check if a hold should be active
for( int t=0; t < m_Player[pn].m_NoteData.GetNumTracks(); ++t )
{
if( m_Player[pn].m_NoteData.IsHoldNoteAtBeat( t, iSongRow ) )
{
StyleInput si( pn, t );
GameInput gi = pStyle->StyleInputToGameInput( si );
bBlinkGameButton[gi.controller][gi.button] |= true;
}
}
}
}
// Before the first beat of the song, blink all cabinet lights (except for // Before the first beat of the song, blink all cabinet lights (except for
// menu buttons) on the beat. // menu buttons) on the beat.
bool bOverrideCabinetBlink = (GAMESTATE->m_fSongBeat < GAMESTATE->m_pCurSong->m_fFirstBeat) && bCrossedABeat; bool bOverrideCabinetBlink = (GAMESTATE->m_fSongBeat < GAMESTATE->m_pCurSong->m_fFirstBeat) && bCrossedABeat;