mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-22 11:18:14 +00:00
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:
@@ -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
|
||||
|
Reference in New Issue
Block a user