summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-08-01 10:13:15 +0200
committerGitHub <noreply@github.com>2020-08-01 10:13:15 +0200
commitec9302ceccb75f44038db3695d2f9e7c82cfe951 (patch)
tree7977db9fe121889e1dcffa9e0c1dfcdd7385a82e
parentbc813fd0615cd4e43384fcd5403a32b139d60945 (diff)
parent802a0316c56c954d10c0d7f0c7bb44f3298d2c8f (diff)
Merge pull request #40927 from 27thLiz/dinput-id
DirectInput: Use correct joypad id
-rw-r--r--platform/windows/joypad_windows.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/platform/windows/joypad_windows.cpp b/platform/windows/joypad_windows.cpp
index 65caee3035..d1454c9096 100644
--- a/platform/windows/joypad_windows.cpp
+++ b/platform/windows/joypad_windows.cpp
@@ -146,8 +146,8 @@ bool JoypadWindows::setup_dinput_joypad(const DIDEVICEINSTANCE *instance) {
if (have_device(instance->guidInstance) || num == -1)
return false;
- d_joypads[joypad_count] = dinput_gamepad();
- dinput_gamepad *joy = &d_joypads[joypad_count];
+ d_joypads[num] = dinput_gamepad();
+ dinput_gamepad *joy = &d_joypads[num];
const DWORD devtype = (instance->dwDevType & 0xFF);
@@ -171,7 +171,7 @@ bool JoypadWindows::setup_dinput_joypad(const DIDEVICEINSTANCE *instance) {
WORD version = 0;
sprintf_s(uid, "%04x%04x%04x%04x%04x%04x%04x%04x", type, 0, vendor, 0, product, 0, version, 0);
- id_to_change = joypad_count;
+ id_to_change = num;
slider_count = 0;
joy->di_joy->SetDataFormat(&c_dfDIJoystick2);