hidapi: Use GameCube adapter controller port for player index

The Nintendo USB GameCube adapter has four controller ports. Return
the port number as 0 to 3 from SDL_JoystickGetPlayerIndex() and
SDL_JoystickGetDevicePlayerIndex().
This commit is contained in:
Zack Middleton 2019-06-08 13:36:59 -07:00
parent d5cdd91525
commit 2b3540e8f2
7 changed files with 61 additions and 1 deletions

View file

@ -338,6 +338,12 @@ HIDAPI_DriverPS4_NumJoysticks(SDL_HIDAPI_DriverData *context)
return 1;
}
static int
HIDAPI_DriverPS4_PlayerIndexForIndex(SDL_HIDAPI_DriverData *context, int index)
{
return -1;
}
static SDL_JoystickID
HIDAPI_DriverPS4_InstanceIDForIndex(SDL_HIDAPI_DriverData *context, int index)
{
@ -592,6 +598,7 @@ SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverPS4 =
HIDAPI_DriverPS4_QuitDriver,
HIDAPI_DriverPS4_UpdateDriver,
HIDAPI_DriverPS4_NumJoysticks,
HIDAPI_DriverPS4_PlayerIndexForIndex,
HIDAPI_DriverPS4_InstanceIDForIndex,
HIDAPI_DriverPS4_OpenJoystick,
HIDAPI_DriverPS4_Rumble