simplify: use GameInput

This commit is contained in:
Glenn Maynard
2007-05-08 00:49:30 +00:00
parent 70ce85851b
commit 82158244f2
3 changed files with 9 additions and 16 deletions
+3 -8
View File
@@ -486,22 +486,17 @@ CabinetLight LightsManager::GetFirstLitCabinetLight()
return CabinetLight_Invalid;
}
void LightsManager::GetFirstLitGameButtonLight( GameController &gcOut, GameButton &gbOut )
GameInput LightsManager::GetFirstLitGameButtonLight()
{
FOREACH_GameController( gc )
{
FOREACH_GameButton( gb )
{
if( m_LightsState.m_bGameButtonLights[gc][gb] )
{
gcOut = gc;
gbOut = gb;
return;
}
return GameInput( gc, gb );
}
}
gcOut = GameController_Invalid;
gbOut = GameButton_Invalid;
return GameInput();
}
bool LightsManager::IsEnabled() const
+1 -1
View File
@@ -80,7 +80,7 @@ public:
void NextTestGameButtonLight() { ChangeTestGameButtonLight(+1); }
CabinetLight GetFirstLitCabinetLight();
void GetFirstLitGameButtonLight( GameController &gcOut, GameButton &gbOut );
GameInput GetFirstLitGameButtonLight();
private:
void ChangeTestCabinetLight( int iDir );
+5 -7
View File
@@ -50,9 +50,7 @@ void ScreenTestLights::Update( float fDeltaTime )
CabinetLight cl = LIGHTSMAN->GetFirstLitCabinetLight();
GameController gc;
GameButton gb;
LIGHTSMAN->GetFirstLitGameButtonLight( gc, gb );
GameInput gi = LIGHTSMAN->GetFirstLitGameButtonLight();
RString s;
@@ -71,15 +69,15 @@ void ScreenTestLights::Update( float fDeltaTime )
else
s += ssprintf( CABINET_LIGHT.GetValue()+": %d %s\n", cl, CabinetLightToString(cl).c_str() );
if( gc == GameController_Invalid )
if( !gi.IsValid() )
{
s += ssprintf( CONTROLLER_LIGHT.GetValue()+": -----\n" );
}
else
{
RString sGameButton = GameButtonToLocalizedString( INPUTMAPPER->GetInputScheme(), gb );
PlayerNumber pn = (PlayerNumber)(gc);
s += ssprintf( CONTROLLER_LIGHT.GetValue()+": %s %d %s\n", PlayerNumberToString(pn).c_str(), gb, sGameButton.c_str() );
RString sGameButton = GameButtonToLocalizedString( INPUTMAPPER->GetInputScheme(), gi.button );
PlayerNumber pn = (PlayerNumber)(gi.controller);
s += ssprintf( CONTROLLER_LIGHT.GetValue()+": %s %d %s\n", PlayerNumberToString(pn).c_str(), gi.button, sGameButton.c_str() );
}
m_textInputs.SetText( s );