Commit aa652114862aeb4e7800738cff6388a5ee62cce7

Ryan C. Gordon 2013-08-28T17:17:21

Make XInput joystick names match the numbers on the device. (And how the Haptic code already names them.)

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/joystick/windows/SDL_dxjoystick.c b/src/joystick/windows/SDL_dxjoystick.c
index 6d4ed24..9399ee6 100644
--- a/src/joystick/windows/SDL_dxjoystick.c
+++ b/src/joystick/windows/SDL_dxjoystick.c
@@ -745,7 +745,7 @@ AddXInputDevice(const Uint8 userid, JoyStick_DeviceData **pContext)
     }
     SDL_zerop(pNewJoystick);
 
-    SDL_snprintf(name, sizeof (name), "XInput Controller #%d", (int) userid);
+    SDL_snprintf(name, sizeof (name), "XInput Controller #%u", ((unsigned int) userid) + 1);
     pNewJoystick->joystickname = SDL_strdup(name);
     if (!pNewJoystick->joystickname) {
         SDL_free(pNewJoystick);