From 8a63b99eca0825c3a6dc0574e1404ded4c0eaad1 Mon Sep 17 00:00:00 2001 From: Yuxiao Mao Date: Wed, 15 Nov 2023 12:46:31 +0100 Subject: [PATCH] Revert commit a502906: let haxe manage sdl device id (#631) --- libs/sdl/sdl.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libs/sdl/sdl.c b/libs/sdl/sdl.c index 92ff16e57..af50fca3b 100644 --- a/libs/sdl/sdl.c +++ b/libs/sdl/sdl.c @@ -275,13 +275,11 @@ HL_PRIM bool HL_NAME(event_loop)( event_data *event ) { break; case SDL_CONTROLLERDEVICEADDED: event->type = GControllerAdded; - SDL_GameController * controller = SDL_GameControllerOpen(e.cdevice.which); - SDL_Joystick* j = SDL_GameControllerGetJoystick(controller); - event->controller = SDL_JoystickInstanceID(j); + event->controller = e.jdevice.which; break; case SDL_CONTROLLERDEVICEREMOVED: event->type = GControllerRemoved; - event->controller = e.cdevice.which; + event->controller = e.jdevice.which; break; case SDL_CONTROLLERBUTTONDOWN: event->type = GControllerDown;