fix slow STestInput

This commit is contained in:
Glenn Maynard
2005-12-28 20:41:51 +00:00
parent 4664c25bee
commit 3193f1b774
+24 -32
View File
@@ -78,44 +78,36 @@ void ScreenTestInput::Update( float fDeltaTime )
vector<CString> asInputs; vector<CString> asInputs;
DeviceInput di; DeviceInput di;
vector<DeviceInput> DeviceInputs;
FOREACH_InputDevice( d ) INPUTFILTER->GetPressedButtons( DeviceInputs );
FOREACH( DeviceInput, DeviceInputs, di )
{ {
FOREACH_ENUM2( DeviceButton, b ) CString sTemp;
sTemp += INPUTMAN->GetDeviceSpecificInputString(*di);
GameInput gi;
if( INPUTMAPPER->DeviceToGame(*di,gi) )
{ {
di.device = d; CString sName = GAMESTATE->GetCurrentGame()->m_szButtonNames[gi.button];
di.button = b; sTemp += ssprintf(" - Controller %d %s", gi.controller+1, sName.c_str() );
if( !INPUTFILTER->IsBeingPressed(di) ) if( !PREFSMAN->m_bOnlyDedicatedMenuButtons )
continue;
CString sTemp;
sTemp += INPUTMAN->GetDeviceSpecificInputString(di);
GameInput gi;
if( INPUTMAPPER->DeviceToGame(di,gi) )
{ {
CString sName = GAMESTATE->GetCurrentGame()->m_szButtonNames[gi.button]; CString sSecondary = GAMEMAN->GetMenuButtonSecondaryFunction( GAMESTATE->GetCurrentGame(), gi.button );
sTemp += ssprintf(" - Controller %d %s", gi.controller+1, sName.c_str() ); if( !sSecondary.empty() )
sTemp += ssprintf(" - (%s secondary)", sSecondary.c_str() );
if( !PREFSMAN->m_bOnlyDedicatedMenuButtons )
{
CString sSecondary = GAMEMAN->GetMenuButtonSecondaryFunction( GAMESTATE->GetCurrentGame(), gi.button );
if( !sSecondary.empty() )
sTemp += ssprintf(" - (%s secondary)", sSecondary.c_str() );
}
} }
else
{
sTemp += " - not mapped";
}
CString sComment = INPUTFILTER->GetButtonComment( di );
if( sComment != "" )
sTemp += " - " + sComment;
asInputs.push_back( sTemp );
} }
else
{
sTemp += " - not mapped";
}
CString sComment = INPUTFILTER->GetButtonComment( *di );
if( sComment != "" )
sTemp += " - " + sComment;
asInputs.push_back( sTemp );
} }
m_textInputs.SetText( join( "\n", asInputs ) ); m_textInputs.SetText( join( "\n", asInputs ) );