From cd64154623a1fdf76834ff526fb4e26dd59a094d Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Tue, 31 Oct 2006 17:29:32 +0000 Subject: [PATCH] Warning instead of exit when joystick init fails. Fixes bug:1577125 Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2716 --- src/gui/sdlmain.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/gui/sdlmain.cpp b/src/gui/sdlmain.cpp index 69e12a93..f4268761 100644 --- a/src/gui/sdlmain.cpp +++ b/src/gui/sdlmain.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: sdlmain.cpp,v 1.122 2006-10-08 19:26:04 qbix79 Exp $ */ +/* $Id: sdlmain.cpp,v 1.123 2006-10-31 17:29:32 qbix79 Exp $ */ #ifndef _GNU_SOURCE #define _GNU_SOURCE @@ -1355,10 +1355,14 @@ int main(int argc, char* argv[]) { if ( SDL_Init( SDL_INIT_AUDIO|SDL_INIT_VIDEO|SDL_INIT_TIMER|SDL_INIT_CDROM |SDL_INIT_NOPARACHUTE -#ifndef DISABLE_JOYSTICK - |SDL_INIT_JOYSTICK -#endif ) < 0 ) E_Exit("Can't init SDL %s",SDL_GetError()); + +#ifndef DISABLE_JOYSTICK + //Initialise Joystick seperately. This way we can warn when it fails instead + //of exiting the application + if( SDL_InitSubSystem(SDL_INIT_JOYSTICK) < 0 ) LOG_MSG("Failed to init joystick support"); +#endif + #if defined (WIN32) #if SDL_VERSION_ATLEAST(1, 2, 10) sdl.using_windib=true;