[Scummvm-git-logs] scummvm master -> 1fa80ea3a35a4086c627228b834c0e17c4aa3cc1

bgK bastien.bouclet at gmail.com
Wed Dec 27 07:31:00 CET 2017


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
1fa80ea3a3 SDL: Add debug traces for joystick hotplug


Commit: 1fa80ea3a35a4086c627228b834c0e17c4aa3cc1
    https://github.com/scummvm/scummvm/commit/1fa80ea3a35a4086c627228b834c0e17c4aa3cc1
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2017-12-27T07:30:53+01:00

Commit Message:
SDL: Add debug traces for joystick hotplug

Changed paths:
    backends/events/sdl/sdl-events.cpp


diff --git a/backends/events/sdl/sdl-events.cpp b/backends/events/sdl/sdl-events.cpp
index 8a59aeb..258f51a 100644
--- a/backends/events/sdl/sdl-events.cpp
+++ b/backends/events/sdl/sdl-events.cpp
@@ -924,8 +924,12 @@ bool SdlEventSource::handleJoyAxisMotion(SDL_Event &ev, Common::Event &event) {
 
 #if SDL_VERSION_ATLEAST(2, 0, 0)
 bool SdlEventSource::handleJoystickAdded(const SDL_JoyDeviceEvent &device) {
+	debug(5, "SdlEventSource: Received joystick added event for index '%d'", device.which);
+
 	int joystick_num = ConfMan.getInt("joystick_num");
 	if (joystick_num == device.which) {
+		debug(5, "SdlEventSource: Newly added joystick with index '%d' matches 'joysticky_num', trying to use it", device.which);
+
 		closeJoystick();
 		openJoystick(joystick_num);
 	}
@@ -934,6 +938,8 @@ bool SdlEventSource::handleJoystickAdded(const SDL_JoyDeviceEvent &device) {
 }
 
 bool SdlEventSource::handleJoystickRemoved(const SDL_JoyDeviceEvent &device) {
+	debug(5, "SdlEventSource: Received joystick removed event for instance id '%d'", device.which);
+
 	SDL_Joystick *joystick;
 	if (_controller) {
 		joystick = SDL_GameControllerGetJoystick(_controller);
@@ -946,6 +952,8 @@ bool SdlEventSource::handleJoystickRemoved(const SDL_JoyDeviceEvent &device) {
 	}
 
 	if (SDL_JoystickInstanceID(joystick) == device.which) {
+		debug(5, "SdlEventSource: Newly removed joystick with instance id '%d' matches currently used joystick, closing current joystick", device.which);
+
 		closeJoystick();
 	}
 





More information about the Scummvm-git-logs mailing list