1
0
mirror of https://github.com/td512/re3.git synced 2026-03-09 06:15:48 +00:00

Detect joystick menu for XInput

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

View File

@@ -1028,8 +1028,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)