Permalink
Browse files
Add option to disable joystick input
- Loading branch information...
Showing
with
10 additions
and
7 deletions.
-
+5
−0
src/options.cpp
-
+5
−7
src/sdltiles.cpp
|
|
@@ -710,6 +710,11 @@ void initOptions() |
|
|
|
false |
|
|
|
); |
|
|
|
|
|
|
|
OPTIONS["ENABLE_JOYSTICK"] = cOpt("interface", _("Enable Joystick"), |
|
|
|
_("SDL ONLY: Enable input from joystick."), |
|
|
|
true |
|
|
|
); |
|
|
|
|
|
|
|
//~ show mouse cursor |
|
|
|
optionNames["show"] = _("Show"); |
|
|
|
//~ hide mouse cursor |
|
|
|
|
|
@@ -284,18 +284,16 @@ bool WinCreate() |
|
|
|
// Initialize joysticks. |
|
|
|
int numjoy = SDL_NumJoysticks(); |
|
|
|
|
|
|
|
if(numjoy > 1) { |
|
|
|
DebugLog() << "You have more than one gamepads/joysticks plugged in, only the first will be used.\n"; |
|
|
|
} |
|
|
|
|
|
|
|
if(numjoy >= 1) { |
|
|
|
if( OPTIONS["ENABLE_JOYSTICK"] && numjoy >= 1 ) { |
|
|
|
if( numjoy > 1 ) { |
|
|
|
DebugLog() << "You have more than one gamepads/joysticks plugged in, only the first will be used.\n"; |
|
|
|
} |
|
|
|
joystick = SDL_JoystickOpen(0); |
|
|
|
SDL_JoystickEventState(SDL_ENABLE); |
|
|
|
} else { |
|
|
|
joystick = NULL; |
|
|
|
} |
|
|
|
|
|
|
|
SDL_JoystickEventState(SDL_ENABLE); |
|
|
|
|
|
|
|
// Set up audio mixer. |
|
|
|
#ifdef SDL_SOUND |
|
|
|
int audio_rate = 22050; |
|
|
|
0 comments on commit
aafb6d7