Fix joystick initialization with Emscripten SDL [Justin Kerk]

This commit is contained in:
Justin Kerk 2018-12-30 21:52:45 +00:00
parent 56d8eeff86
commit 98d3d350cc

View File

@ -748,7 +748,11 @@ public:
{ {
SDL_SetHint(SDL_HINT_ACCELEROMETER_AS_JOYSTICK, "0"); SDL_SetHint(SDL_HINT_ACCELEROMETER_AS_JOYSTICK, "0");
#ifdef SDLMAME_EMSCRIPTEN
if (SDL_InitSubSystem(SDL_INIT_JOYSTICK))
#else
if (SDL_InitSubSystem(SDL_INIT_JOYSTICK|SDL_INIT_HAPTIC)) if (SDL_InitSubSystem(SDL_INIT_JOYSTICK|SDL_INIT_HAPTIC))
#endif
{ {
osd_printf_error("Could not initialize SDL Joystick: %s.\n", SDL_GetError()); osd_printf_error("Could not initialize SDL Joystick: %s.\n", SDL_GetError());
return; return;