diff --git a/stepmania/src/RageInputDevice.cpp b/stepmania/src/RageInputDevice.cpp index 518540c5df..45ec59c05a 100644 --- a/stepmania/src/RageInputDevice.cpp +++ b/stepmania/src/RageInputDevice.cpp @@ -305,6 +305,35 @@ DeviceButton StringToDeviceButton( InputDevice device, const CString& s ) } } +int GetNumDeviceButtons( InputDevice device ) +{ + switch( device ) + { + case DEVICE_KEYBOARD: return NUM_KEYS; + case DEVICE_JOY1: + case DEVICE_JOY2: + case DEVICE_JOY3: + case DEVICE_JOY4: + case DEVICE_JOY5: + case DEVICE_JOY6: + case DEVICE_JOY7: + case DEVICE_JOY8: + case DEVICE_JOY9: + case DEVICE_JOY10: + case DEVICE_JOY11: + case DEVICE_JOY12: + case DEVICE_JOY13: + case DEVICE_JOY14: + case DEVICE_JOY15: + case DEVICE_JOY16: return NUM_JOYSTICK_BUTTONS; + case DEVICE_PUMP1: + case DEVICE_PUMP2: return NUM_PUMP_PAD_BUTTONS; + case DEVICE_MIDI: return NUM_MIDI_CHANNELS; + case DEVICE_PARA1: return NUM_PARA_PAD_BUTTONS; + default: ASSERT_M(0,ssprintf("%d",device)); return 0; + } +}; + CString DeviceInput::toString() const { if( device == DEVICE_NONE ) diff --git a/stepmania/src/RageInputDevice.h b/stepmania/src/RageInputDevice.h index 481f8ef403..ea2307a82c 100644 --- a/stepmania/src/RageInputDevice.h +++ b/stepmania/src/RageInputDevice.h @@ -300,34 +300,8 @@ typedef int DeviceButton; //CString DeviceButtonToString( InputDevice device, DeviceButton i ); //DeviceButton StringToDeviceButton( InputDevice device, const CString& s ); -inline int GetNumDeviceButtons( InputDevice device ) -{ - switch( device ) - { - case DEVICE_KEYBOARD: return NUM_KEYS; - case DEVICE_JOY1: - case DEVICE_JOY2: - case DEVICE_JOY3: - case DEVICE_JOY4: - case DEVICE_JOY5: - case DEVICE_JOY6: - case DEVICE_JOY7: - case DEVICE_JOY8: - case DEVICE_JOY9: - case DEVICE_JOY10: - case DEVICE_JOY11: - case DEVICE_JOY12: - case DEVICE_JOY13: - case DEVICE_JOY14: - case DEVICE_JOY15: - case DEVICE_JOY16: return NUM_JOYSTICK_BUTTONS; - case DEVICE_PUMP1: - case DEVICE_PUMP2: return NUM_PUMP_PAD_BUTTONS; - case DEVICE_MIDI: return NUM_MIDI_CHANNELS; - case DEVICE_PARA1: return NUM_PARA_PAD_BUTTONS; - default: ASSERT(0); return 0; - } -}; +int GetNumDeviceButtons( InputDevice device ); + const int MAX_DEVICE_BUTTONS = NUM_KEYS; const DeviceButton DEVICE_BUTTON_INVALID = MAX_DEVICE_BUTTONS+1;