From c4d334783f2965d06646ad5600dc736b35ea2597 Mon Sep 17 00:00:00 2001 From: Nate Weibley Date: Wed, 18 Jan 2017 15:05:46 -0500 Subject: [PATCH] SDL: warn with SDL error string when joystick feature detection fails --- src/Joystick/JoystickSDL.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Joystick/JoystickSDL.cc b/src/Joystick/JoystickSDL.cc index 854ac4407..57ac14405 100644 --- a/src/Joystick/JoystickSDL.cc +++ b/src/Joystick/JoystickSDL.cc @@ -41,9 +41,13 @@ QMap JoystickSDL::discover(MultiVehicleManager* _multiVehicl hatCount = 0; } else { isGameController = false; + SDL_ClearError(); axisCount = SDL_JoystickNumAxes(sdlJoystick); buttonCount = SDL_JoystickNumButtons(sdlJoystick); hatCount = SDL_JoystickNumHats(sdlJoystick); + if (axisCount < 0 || buttonCount < 0 || hatCount < 0) { + qCWarning(JoystickLog) << "\t libsdl error parsing joystick features:" << SDL_GetError(); + } } SDL_JoystickClose(sdlJoystick); -- 2.22.0