浏览代码

Make XInput joystick names match the numbers on the device.

(And how the Haptic code already names them.)
Ryan C. Gordon 12 年之前
父节点
当前提交
aa65211486
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/joystick/windows/SDL_dxjoystick.c

+ 1 - 1
src/joystick/windows/SDL_dxjoystick.c

@@ -745,7 +745,7 @@ AddXInputDevice(const Uint8 userid, JoyStick_DeviceData **pContext)
     }
     }
     SDL_zerop(pNewJoystick);
     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);
     pNewJoystick->joystickname = SDL_strdup(name);
     if (!pNewJoystick->joystickname) {
     if (!pNewJoystick->joystickname) {
         SDL_free(pNewJoystick);
         SDL_free(pNewJoystick);