From 3a3da1b41e87cec8c86ca217fe50565faaf553fd Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 23 Jan 2023 11:38:48 +0100 Subject: [PATCH] SDL: Allow joystick init to fail It's not critical so can be skipped --- backends/events/sdl/sdl-events.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/backends/events/sdl/sdl-events.cpp b/backends/events/sdl/sdl-events.cpp index 11a8f6849d6..e69f694ecaa 100644 --- a/backends/events/sdl/sdl-events.cpp +++ b/backends/events/sdl/sdl-events.cpp @@ -81,12 +81,14 @@ SdlEventSource::SdlEventSource() if (joystick_num >= 0) { // Initialize SDL joystick subsystem if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) == -1) { - error("Could not initialize SDL: %s", SDL_GetError()); + warning("Could not initialize SDL joystick: %s", SDL_GetError()); + return; } #if SDL_VERSION_ATLEAST(2, 0, 0) if (SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER) == -1) { - error("Could not initialize SDL: %s", SDL_GetError()); + warning("Could not initialize SDL game controller: %s", SDL_GetError()); + return; } loadGameControllerMappingFile(); #endif