AlignMusicBeat only aligns the fractional part of the beat. This aligned
to every four beats, so the light jumps when changing music.
This commit is contained in:
@@ -230,10 +230,16 @@ void LightsManager::Update( float fDeltaTime )
|
||||
FOREACH_CabinetLight( cl )
|
||||
m_LightsState.m_bCabinetLights[cl] = false;
|
||||
|
||||
int iBeat = (int)(GAMESTATE->m_fLightSongBeat);
|
||||
int iTopIndex = iBeat;
|
||||
wrap( iTopIndex, 4 );
|
||||
switch( iTopIndex )
|
||||
static float fLastBeat;
|
||||
static int iLight;
|
||||
|
||||
if( fracf(GAMESTATE->m_fLightSongBeat) < fracf(fLastBeat) )
|
||||
{
|
||||
++iLight;
|
||||
wrap( iLight, 4 );
|
||||
}
|
||||
fLastBeat = GAMESTATE->m_fLightSongBeat;
|
||||
switch( iLight )
|
||||
{
|
||||
case 0: m_LightsState.m_bCabinetLights[LIGHT_MARQUEE_UP_LEFT] = true; break;
|
||||
case 1: m_LightsState.m_bCabinetLights[LIGHT_MARQUEE_LR_RIGHT] = true; break;
|
||||
|
||||
Reference in New Issue
Block a user