add InputMapper::GetLevel

This commit is contained in:
Glenn Maynard
2007-01-13 06:55:47 +00:00
parent 4b16146370
commit 5bc8fc0ad2
2 changed files with 28 additions and 0 deletions
+25
View File
@@ -933,6 +933,31 @@ void InputMapper::ResetKeyRepeat( GameButton MenuI, PlayerNumber pn )
ResetKeyRepeat( GameI[i] );
}
float InputMapper::GetLevel( const GameInput &GameI )
{
float fLevel = 0;
for( int i=0; i<NUM_GAME_TO_DEVICE_SLOTS; i++ )
{
DeviceInput DeviceI;
if( GameToDevice( GameI, i, DeviceI ) )
fLevel = max( fLevel, INPUTFILTER->GetLevel(DeviceI) );
}
return fLevel;
}
float InputMapper::GetLevel( GameButton MenuI, PlayerNumber pn )
{
vector<GameInput> GameI;
MenuToGame( MenuI, pn, GameI );
float fLevel = 0;
for( size_t i=0; i<GameI.size(); i++ )
fLevel = max( fLevel, GetLevel(GameI[i]) );
return fLevel;
}
InputDevice InputMapper::MultiPlayerToInputDevice( MultiPlayer mp )
{
if( mp == MultiPlayer_Invalid )