Use IsJoystick() and IsPump().

This commit is contained in:
Steve Checkoway
2007-01-18 12:35:13 +00:00
parent ff32e1ff9d
commit 4f228d3a30
2 changed files with 4 additions and 4 deletions
@@ -252,11 +252,11 @@ void JoystickDevice::GetButtonPresses( vector<DeviceInput>& vPresses, int cookie
int JoystickDevice::AssignIDs( InputDevice startID ) int JoystickDevice::AssignIDs( InputDevice startID )
{ {
if( startID < DEVICE_JOY1 || startID > DEVICE_JOY16 ) if( !IsJoystick(startID) )
return -1; return -1;
FOREACH( Joystick, m_vSticks, i ) FOREACH( Joystick, m_vSticks, i )
{ {
if( startID > DEVICE_JOY16 ) if( !IsJoystick(startID) )
{ {
m_vSticks.erase( i, m_vSticks.end() ); m_vSticks.erase( i, m_vSticks.end() );
break; break;
@@ -274,7 +274,7 @@ void JoystickDevice::GetDevicesAndDescriptions( vector<InputDeviceInfo>& vDevice
} }
/* /*
* (c) 2005-2006 Steve Checkoway * (c) 2005-2007 Steve Checkoway
* All rights reserved. * All rights reserved.
* *
* Permission is hereby granted, free of charge, to any person obtaining a * Permission is hereby granted, free of charge, to any person obtaining a
@@ -52,7 +52,7 @@ void PumpDevice::GetButtonPresses( vector<DeviceInput>& vPresses, int cookie, in
int PumpDevice::AssignIDs( InputDevice startID ) int PumpDevice::AssignIDs( InputDevice startID )
{ {
if( startID < DEVICE_PUMP1 || startID > DEVICE_PUMP2 ) if( !IsPump(startID) )
return -1; return -1;
m_Id = startID; m_Id = startID;
return 1; return 1;