From 9cf3f9b3316a80d7faceabf58a7e363d325d07b7 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 11 Oct 2003 00:16:32 +0000 Subject: [PATCH] support 6 joysticks --- stepmania/src/RageInputDevice.cpp | 4 ++++ stepmania/src/RageInputDevice.h | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/stepmania/src/RageInputDevice.cpp b/stepmania/src/RageInputDevice.cpp index b7c52e6f40..e5dd4aba97 100644 --- a/stepmania/src/RageInputDevice.cpp +++ b/stepmania/src/RageInputDevice.cpp @@ -24,6 +24,8 @@ int DeviceInput::NumButtons(InputDevice device) case DEVICE_JOY2: case DEVICE_JOY3: case DEVICE_JOY4: + case DEVICE_JOY5: + case DEVICE_JOY6: return NUM_JOYSTICK_BUTTONS; case DEVICE_PUMP1: case DEVICE_PUMP2: @@ -48,6 +50,8 @@ CString DeviceInput::GetDescription() case DEVICE_JOY2: case DEVICE_JOY3: case DEVICE_JOY4: + case DEVICE_JOY5: + case DEVICE_JOY6: sReturn = ssprintf("Joy%d ", device - DEVICE_JOY1 + 1 ); switch( button ) diff --git a/stepmania/src/RageInputDevice.h b/stepmania/src/RageInputDevice.h index 5fe18ab495..3e5b305fe3 100644 --- a/stepmania/src/RageInputDevice.h +++ b/stepmania/src/RageInputDevice.h @@ -5,7 +5,7 @@ #include "RageTimer.h" const int NUM_KEYBOARD_BUTTONS = SDLK_LAST; -const int NUM_JOYSTICKS = 4; +const int NUM_JOYSTICKS = 6; const int NUM_JOYSTICK_HATS = 1; const int NUM_PUMPS = 2; @@ -15,6 +15,8 @@ enum InputDevice { DEVICE_JOY2, DEVICE_JOY3, DEVICE_JOY4, + DEVICE_JOY5, + DEVICE_JOY6, DEVICE_PUMP1, DEVICE_PUMP2, NUM_INPUT_DEVICES, // leave this at the end @@ -62,6 +64,8 @@ const int NUM_DEVICE_BUTTONS[NUM_INPUT_DEVICES] = NUM_JOYSTICK_BUTTONS, // DEVICE_JOY2 NUM_JOYSTICK_BUTTONS, // DEVICE_JOY3 NUM_JOYSTICK_BUTTONS, // DEVICE_JOY4 + NUM_JOYSTICK_BUTTONS, // DEVICE_JOY5 + NUM_JOYSTICK_BUTTONS, // DEVICE_JOY6 NUM_PUMP_PAD_BUTTONS, // DEVICE_PUMP1 NUM_PUMP_PAD_BUTTONS, // DEVICE_PUMP2 }; @@ -95,7 +99,7 @@ public: char ToChar() const; - bool IsJoystick() const { return DEVICE_JOY1 <= device && device <= DEVICE_JOY4; } + bool IsJoystick() const { return DEVICE_JOY1 <= device && device < DEVICE_JOY1+NUM_JOYSTICKS; } static int NumButtons(InputDevice device); };