hook up MonkeyInput and DebugLights to debug menu

This commit is contained in:
Chris Danford
2005-05-16 18:17:06 +00:00
parent 9754852418
commit 9de6862130
5 changed files with 22 additions and 11 deletions
+12 -3
View File
@@ -10,6 +10,7 @@
#include "PrefsManager.h"
#include "Actor.h"
#include "Preference.h"
#include "Foreach.h"
#include "arch/arch.h"
@@ -54,7 +55,7 @@ LightsManager::LightsManager(CString sDriver)
ZERO( m_fSecsLeftInActorLightBlink );
m_LightsMode = LIGHTSMODE_JOINING;
m_pDriver = MakeLightsDriver(sDriver);
MakeLightsDrivers( sDriver, m_vpDrivers );
m_fTestAutoCycleCurrentIndex = 0;
m_clTestManualCycleCurrent = LIGHT_INVALID;
m_gcTestManualCycleCurrent = GAME_CONTROLLER_INVALID;
@@ -63,7 +64,9 @@ LightsManager::LightsManager(CString sDriver)
LightsManager::~LightsManager()
{
SAFE_DELETE( m_pDriver );
FOREACH( LightsDriver*, m_vpDrivers, iter )
SAFE_DELETE( *iter );
m_vpDrivers.clear();
}
// XXX: make themable
@@ -342,7 +345,8 @@ void LightsManager::Update( float fDeltaTime )
}
// apply new light values we set above
m_pDriver->Set( &m_LightsState );
FOREACH( LightsDriver*, m_vpDrivers, iter )
(*iter)->Set( &m_LightsState );
}
void LightsManager::BlinkCabinetLight( CabinetLight cl )
@@ -416,6 +420,11 @@ void LightsManager::GetFirstLitGameButtonLight( GameController &gcOut, GameButto
gbOut = GAME_BUTTON_INVALID;
}
bool LightsManager::IsEnabled() const
{
return m_vpDrivers.size() > 1 || PREFSMAN->m_bDebugLights;
}
/*
* (c) 2003-2004 Chris Danford
+2 -2
View File
@@ -58,7 +58,7 @@ public:
~LightsManager();
void Update( float fDeltaTime );
bool IsEnabled() const { return m_pDriver != NULL; }
bool IsEnabled() const;
void BlinkCabinetLight( CabinetLight cl );
void BlinkGameButton( GameInput gi );
@@ -85,7 +85,7 @@ private:
float m_fActorLights[NUM_CABINET_LIGHTS]; // current "power" of each actor light
float m_fSecsLeftInActorLightBlink[NUM_CABINET_LIGHTS]; // duration to "power" an actor light
LightsDriver* m_pDriver;
vector<LightsDriver*> m_vpDrivers;
LightsMode m_LightsMode;
LightsState m_LightsState;
+2
View File
@@ -289,6 +289,8 @@ PrefsManager::PrefsManager() :
m_bThreadedInput ( Options, "ThreadedInput", true ),
m_bThreadedMovieDecode ( Options, "ThreadedMovieDecode", true ),
m_bScreenTestMode ( Options, "ScreenTestMode", false ),
m_bDebugLights ( Options, "DebugLights", false ),
m_bMonkeyInput ( Options, "MonkeyInput", false ),
m_sMachineName ( Options, "MachineName", "" ),
m_sIgnoredMessageWindows ( Options, "IgnoredMessageWindows", "" ),
m_sCoursesToShowRanking ( Options, "CoursesToShowRanking", "" ),
+2 -2
View File
@@ -304,10 +304,10 @@ public:
Preference<bool> m_bThreadedInput;
Preference<bool> m_bThreadedMovieDecode;
Preference<bool> m_bScreenTestMode;
Preference<bool> m_bDebugLights;
Preference<bool> m_bMonkeyInput;
Preference<CString> m_sMachineName;
Preference<CString> m_sIgnoredMessageWindows;
Preference<CString> m_sCoursesToShowRanking;
/* Debug: */
+4 -4
View File
@@ -161,8 +161,8 @@ void ScreenDebugOverlay::Update( float fDeltaTime )
case DebugLine_CoinMode: bOn=true; break;
case DebugLine_Slow: bOn=g_bIsSlow; break;
case DebugLine_Halt: bOn=g_bIsHalt; break;
case DebugLine_LightsDebug: bOn=false; break;
case DebugLine_MonkeyInput: bOn=false; break;
case DebugLine_LightsDebug: bOn=PREFSMAN->m_bDebugLights; break;
case DebugLine_MonkeyInput: bOn=PREFSMAN->m_bMonkeyInput; break;
case DebugLine_Stats: bOn=PREFSMAN->m_bShowStats; break;
case DebugLine_Vsync: bOn=PREFSMAN->m_bVsync; break;
case DebugLine_ScreenTestMode: bOn=PREFSMAN->m_bScreenTestMode;break;
@@ -242,10 +242,10 @@ bool ScreenDebugOverlay::OverlayInput( const DeviceInput& DeviceI, const InputEv
SetSpeed();
break;
case DebugLine_LightsDebug:
ASSERT(0); // TODO
PREFSMAN->m_bDebugLights.Set( !PREFSMAN->m_bDebugLights );
break;
case DebugLine_MonkeyInput:
ASSERT(0); // TODO
PREFSMAN->m_bMonkeyInput.Set( !PREFSMAN->m_bMonkeyInput );
break;
case DebugLine_Stats:
PREFSMAN->m_bShowStats.Set( !PREFSMAN->m_bShowStats );