Browse Source

SDL: warn with SDL error string when joystick feature detection fails

QGC4.4
Nate Weibley 8 years ago
parent
commit
c4d334783f
  1. 4
      src/Joystick/JoystickSDL.cc

4
src/Joystick/JoystickSDL.cc

@ -41,9 +41,13 @@ QMap<QString, Joystick*> JoystickSDL::discover(MultiVehicleManager* _multiVehicl @@ -41,9 +41,13 @@ QMap<QString, Joystick*> 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);

Loading…
Cancel
Save