Emscripten: Deactivated and corrected debug log messages on joystick events.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
diff --git a/src/joystick/emscripten/SDL_sysjoystick.c b/src/joystick/emscripten/SDL_sysjoystick.c
index 62283c9..324338c 100644
--- a/src/joystick/emscripten/SDL_sysjoystick.c
+++ b/src/joystick/emscripten/SDL_sysjoystick.c
@@ -105,7 +105,9 @@ Emscripten_JoyStickConnected(int eventType, const EmscriptenGamepadEvent *gamepa
}
++numjoysticks;
- SDL_Log("%d",numjoysticks);
+#ifdef DEBUG_JOYSTICK
+ SDL_Log("Number of joysticks is %d", numjoysticks);
+#endif
#if !SDL_EVENTS_DISABLED
event.type = SDL_JOYDEVICEADDED;
@@ -118,7 +120,9 @@ Emscripten_JoyStickConnected(int eventType, const EmscriptenGamepadEvent *gamepa
}
#endif /* !SDL_EVENTS_DISABLED */
+#ifdef DEBUG_JOYSTICK
SDL_Log("Added joystick with index %d", item->index);
+#endif
return 1;
}
@@ -144,7 +148,6 @@ Emscripten_JoyStickDisconnected(int eventType, const EmscriptenGamepadEvent *gam
return 1;
}
- const int retval = item->device_instance;
if (item->joystick) {
item->joystick->hwdata = NULL;
}
@@ -174,7 +177,9 @@ Emscripten_JoyStickDisconnected(int eventType, const EmscriptenGamepadEvent *gam
}
#endif /* !SDL_EVENTS_DISABLED */
- SDL_Log("Removed joystick with index %d", retval);
+#ifdef DEBUG_JOYSTICK
+ SDL_Log("Removed joystick with id %d", item->device_instance);
+#endif
SDL_free(item->name);
SDL_free(item->mapping);
SDL_free(item);