Skip to content

Commit

Permalink
Rely on xbox input subsystem to attach/detach gamepads
Browse files Browse the repository at this point in the history
  • Loading branch information
inactive123 committed Jan 19, 2018
1 parent 0731a79 commit b4b5ed1
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions input/drivers_joypad/xdk_joypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,13 @@ static void xdk_joypad_autodetect_add(unsigned autoconf_pad)

static bool xdk_joypad_init(void *data)
{
unsigned autoconf_pad;
#ifdef _XBOX1
XInitDevices(0, NULL);
#endif
#else
unsigned autoconf_pad;
for (autoconf_pad = 0; autoconf_pad < MAX_USERS; autoconf_pad++)
xdk_joypad_autodetect_add(autoconf_pad);
#endif

(void)data;

Expand Down Expand Up @@ -134,11 +135,9 @@ static int16_t xdk_joypad_axis(unsigned port_num, uint32_t joyaxis)
static void xdk_joypad_poll(void)
{
unsigned port;
#ifdef _XBOX1
#if defined(_XBOX1)
unsigned int dwInsertions, dwRemovals;
#endif

#if defined(_XBOX1)
#ifdef __cplusplus
XGetDeviceChanges(XDEVICE_TYPE_GAMEPAD,
reinterpret_cast<PDWORD>(&dwInsertions),
Expand All @@ -152,7 +151,7 @@ static void xdk_joypad_poll(void)

for (port = 0; port < MAX_PADS; port++)
{
unsigned i, j;
unsigned i, j;
XINPUT_STATE state_tmp;
uint64_t *state_cur = NULL;
#ifdef _XBOX1
Expand Down

0 comments on commit b4b5ed1

Please sign in to comment.