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 e7b514d8ff
commit 82af42761e
7 changed files with 61 additions and 1 deletions

View File

@@ -914,6 +914,12 @@ HIDAPI_DriverSwitch_NumJoysticks(SDL_HIDAPI_DriverData *context)
return 1;
}
static int
HIDAPI_DriverSwitch_PlayerIndexForIndex(SDL_HIDAPI_DriverData *context, int index)
{
return -1;
}
static SDL_JoystickID
HIDAPI_DriverSwitch_InstanceIDForIndex(SDL_HIDAPI_DriverData *context, int index)
{
@@ -931,6 +937,7 @@ SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverSwitch =
HIDAPI_DriverSwitch_QuitDriver,
HIDAPI_DriverSwitch_UpdateDriver,
HIDAPI_DriverSwitch_NumJoysticks,
HIDAPI_DriverSwitch_PlayerIndexForIndex,
HIDAPI_DriverSwitch_InstanceIDForIndex,
HIDAPI_DriverSwitch_OpenJoystick,
HIDAPI_DriverSwitch_Rumble