Detect joystick menu for XInput

This commit is contained in:
erorcun
2021-02-05 17:51:57 +03:00
parent 425f360363
commit 675aef29cf
10 changed files with 112 additions and 14 deletions

View File

@@ -1585,8 +1585,14 @@ void CPad::AddToPCCheatString(char c)
}
#ifdef XINPUT
int CPad::XInputJoy1 = 0;
int CPad::XInputJoy2 = 1;
void CPad::AffectFromXinput(uint32 pad)
{
pad = pad == 0 ? XInputJoy1 : XInputJoy2;
if (pad == -1) // LoadINIControllerSettings can set it to -1
return;
XINPUT_STATE xstate;
memset(&xstate, 0, sizeof(XINPUT_STATE));
if (XInputGetState(pad, &xstate) == ERROR_SUCCESS)