[Scummvm-cvs-logs] scummvm master -> dc6c1a5cab2d27cd367b54b08d1cb0189c163fc8

sev- sev at scummvm.org
Mon Jan 12 00:36:55 CET 2015


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

Summary:
ee9b60676a SDL: Warn if the selected joystick does not exist
dc6c1a5cab Merge pull request #558 from klusark/patch-3


Commit: ee9b60676a3efe015638763eed69161ee76ed846
    https://github.com/scummvm/scummvm/commit/ee9b60676a3efe015638763eed69161ee76ed846
Author: Joel Teichroeb (joel at teichroeb.net)
Date: 2015-01-04T09:39:55-08:00

Commit Message:
SDL: Warn if the selected joystick does not exist

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 2480e7c..284e097 100644
--- a/backends/events/sdl/sdl-events.cpp
+++ b/backends/events/sdl/sdl-events.cpp
@@ -55,16 +55,18 @@ SdlEventSource::SdlEventSource()
 	memset(&_km, 0, sizeof(_km));
 
 	int joystick_num = ConfMan.getInt("joystick_num");
-	if (joystick_num > -1) {
+	if (joystick_num >= 0) {
 		// Initialize SDL joystick subsystem
 		if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) == -1) {
 			error("Could not initialize SDL: %s", SDL_GetError());
 		}
 
 		// Enable joystick
-		if (SDL_NumJoysticks() > 0) {
-			debug("Using joystick: %s", SDL_JoystickName(0));
+		if (SDL_NumJoysticks() > joystick_num) {
+			debug("Using joystick: %s", SDL_JoystickName(joystick_num));
 			_joystick = SDL_JoystickOpen(joystick_num);
+		} else {
+			warning("Invalid joystick: %d", joystick_num);
 		}
 	}
 }


Commit: dc6c1a5cab2d27cd367b54b08d1cb0189c163fc8
    https://github.com/scummvm/scummvm/commit/dc6c1a5cab2d27cd367b54b08d1cb0189c163fc8
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2015-01-12T00:36:01+01:00

Commit Message:
Merge pull request #558 from klusark/patch-3

SDL: Warn if the selected joystick does not exist

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









More information about the Scummvm-git-logs mailing list