Skip to content

Commit

Permalink
Merge pull request #40927 from 27thLiz/dinput-id
Browse files Browse the repository at this point in the history
DirectInput: Use correct joypad id
  • Loading branch information
akien-mga authored Aug 1, 2020
2 parents bc813fd + 802a031 commit ec9302c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions platform/windows/joypad_windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);
Expand Down

0 comments on commit ec9302c

Please sign in to comment.