diff --git a/stepmania/src/LightsManager.cpp b/stepmania/src/LightsManager.cpp index acf71e4481..d25b508826 100644 --- a/stepmania/src/LightsManager.cpp +++ b/stepmania/src/LightsManager.cpp @@ -9,9 +9,14 @@ #include "Game.h" #include "PrefsManager.h" #include "Actor.h" +#include "Preference.h" #include "arch/arch.h" +Preference g_fLightsFalloffSeconds( Options, "LightsFalloffSeconds", 0.1f ); +Preference g_fLightsAheadSeconds( Options, "LightsAheadSeconds", 0.05f ); + + static const CString CabinetLightNames[NUM_CABINET_LIGHTS] = { "MarqueeUpLeft", "MarqueeUpRight", @@ -182,6 +187,7 @@ void LightsManager::Update( float fDeltaTime ) default: ASSERT(0); } + /* Flash the button lights for active players. */ bool bBlinkOn = (iBeat%2)==0; FOREACH_PlayerNumber( pn ) @@ -341,12 +347,12 @@ void LightsManager::Update( float fDeltaTime ) void LightsManager::BlinkCabinetLight( CabinetLight cl ) { - m_fSecsLeftInCabinetLightBlink[cl] = LIGHTS_FALLOFF_SECONDS; + m_fSecsLeftInCabinetLightBlink[cl] = g_fLightsFalloffSeconds; } void LightsManager::BlinkGameButton( GameInput gi ) { - m_fSecsLeftInGameButtonBlink[gi.controller][gi.button] = LIGHTS_FALLOFF_SECONDS; + m_fSecsLeftInGameButtonBlink[gi.controller][gi.button] = g_fLightsFalloffSeconds; } void LightsManager::SetLightsMode( LightsMode lm ) diff --git a/stepmania/src/LightsManager.h b/stepmania/src/LightsManager.h index 625089d337..17d18b3031 100644 --- a/stepmania/src/LightsManager.h +++ b/stepmania/src/LightsManager.h @@ -6,8 +6,12 @@ #include "PlayerNumber.h" #include "GameInput.h" #include "EnumHelper.h" +#include "Preference.h" +const float LIGHTS_AHEAD_SECONDS = 0.1f; const float LIGHTS_FALLOFF_SECONDS = 0.1f; +extern Preference g_fLightsFalloffSeconds; +extern Preference g_fLightsAheadSeconds; enum CabinetLight { diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index 10cbb6018d..19e2069a42 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -1650,7 +1650,7 @@ void ScreenGameplay::UpdateLights() ZERO( bBlinkGameButton ); bool bCrossedABeat = false; { - float fPositionSeconds = GAMESTATE->m_fMusicSeconds + LIGHTS_FALLOFF_SECONDS/2; // trigger the light a tiny bit early + float fPositionSeconds = GAMESTATE->m_fMusicSeconds + g_fLightsAheadSeconds; // trigger the light a tiny bit early float fSongBeat = GAMESTATE->m_pCurSong->GetBeatFromElapsedTime( fPositionSeconds ); const int iSongRow = BeatToNoteRowNotRounded( fSongBeat );