From eb387e16f45fd1a5870584888231f3fed7c9f029 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Sat, 17 Oct 2015 14:38:22 +0200 Subject: [PATCH] onepad: fix compilation on SDL1 --- plugins/onepad/SDL/joystick.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/onepad/SDL/joystick.cpp b/plugins/onepad/SDL/joystick.cpp index 7d2acfdb6f..2a7b4a945d 100644 --- a/plugins/onepad/SDL/joystick.cpp +++ b/plugins/onepad/SDL/joystick.cpp @@ -78,6 +78,7 @@ void JoystickInfo::EnumerateJoysticks(vector& vjoysticks) void JoystickInfo::GenerateDefaultEffect() { +#if SDL_MAJOR_VERSION >= 2 for(int i=0;i= 2 + // This code just use standard rumble to check that SDL handles the pad correctly! --3kinox if(haptic == NULL) return; // Otherwise, core dump! SDL_HapticRumbleInit( haptic ); // Make the haptic pad rumble 60% strength for half a second, shoudld be enough for user to see if it works or not @@ -235,6 +239,7 @@ void JoystickInfo::TestForce() { fprintf(stderr,"ERROR: Rumble is not working! %s\n",SDL_GetError()); } +#endif } bool JoystickInfo::PollButtons(u32 &pkey)