Added an untested driver for the Nintendo GameCube adapter, based on code contributed by Ethan Lee

This commit is contained in:
Sam Lantinga 2019-12-19 15:01:35 -08:00
parent 15d30298cf
commit e22e77dadc
6 changed files with 34 additions and 5 deletions

View file

@ -33,6 +33,7 @@
#include "../events/SDL_events_c.h"
#endif
#include "../video/SDL_sysvideo.h"
#include "hidapi/SDL_hidapijoystick_c.h"
/* This is included in only one place because it has a large static list of controllers */
#include "controller_type.h"
@ -1043,6 +1044,11 @@ SDL_JoystickUpdate(void)
/* Make sure the list is unlocked while dispatching events to prevent application deadlocks */
SDL_UnlockJoysticks();
#ifdef SDL_JOYSTICK_HIDAPI
/* Special function for HIDAPI devices, as a single device can provide multiple SDL_Joysticks */
HIDAPI_UpdateDevices();
#endif /* SDL_JOYSTICK_HIDAPI */
for (joystick = SDL_joysticks; joystick; joystick = joystick->next) {
if (joystick->attached) {
/* This should always be true, but seeing a crash in the wild...? */