From ad57c494296c8a2d1cbbe4b169a9ee71e1691e0a Mon Sep 17 00:00:00 2001 From: Sacha Date: Sat, 31 May 2014 01:29:00 +1000 Subject: [PATCH] SDL: Enable up to 2 joysticks for everyone. --- base/PCMain.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/base/PCMain.cpp b/base/PCMain.cpp index c043b1406c..63dec38a87 100644 --- a/base/PCMain.cpp +++ b/base/PCMain.cpp @@ -20,8 +20,8 @@ #include "SDL_video.h" #ifndef _WIN32 #include "SDL/SDLJoystick.h" -//SDL_Joystick *ljoy = NULL; -//SDL_Joystick *rjoy = NULL; +SDL_Joystick *ljoy = NULL; +SDL_Joystick *rjoy = NULL; #endif #ifdef RPI @@ -316,7 +316,7 @@ void SimulateGamepad(const uint8 *keys, InputState *input) { input->pad_rstick_x = 0; input->pad_rstick_y = 0; -/*#ifndef _WIN32 +#ifndef _WIN32 if (ljoy || rjoy) { SDL_JoystickUpdate(); if (ljoy) { @@ -328,7 +328,7 @@ void SimulateGamepad(const uint8 *keys, InputState *input) { input->pad_rstick_y = std::max(std::min(SDL_JoystickGetAxis(rjoy, 1) / 32000.0f, 1.0f), -1.0f); } } -#endif*/ +#endif } extern void mixaudio(void *userdata, Uint8 *stream, int len) { @@ -611,13 +611,13 @@ int main(int argc, char *argv[]) { // Audio must be unpaused _after_ NativeInit() SDL_PauseAudio(0); #ifndef _WIN32 -/* int numjoys = SDL_NumJoysticks(); + int numjoys = SDL_NumJoysticks(); // Joysticks init if (numjoys > 0) { ljoy = SDL_JoystickOpen(0); if (numjoys > 1) rjoy = SDL_JoystickOpen(1); - }*/ + } #endif EnableFZ(); @@ -831,12 +831,12 @@ int main(int argc, char *argv[]) { t = time_now(); framecount++; } -/*#ifndef _WIN32 +#ifndef _WIN32 if (ljoy) delete ljoy; if (rjoy) delete rjoy; -#endif*/ +#endif // Faster exit, thanks to the OS. Remove this if you want to debug shutdown // The speed difference is only really noticable on Linux. On Windows you do notice it though #ifndef MOBILE_DEVICE