Commit c3ee32e8 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

winebus.sys: Check for SDL_JoystickRumble presence at runtime.

It's been introduced in SDL2 2.0.9, released on 2018/10/31. Signed-off-by: 's avatarRémi Bernon <rbernon@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 6db01bcb
...@@ -102,11 +102,11 @@ MAKE_FUNCPTR(SDL_HapticRumbleSupported); ...@@ -102,11 +102,11 @@ MAKE_FUNCPTR(SDL_HapticRumbleSupported);
MAKE_FUNCPTR(SDL_HapticRunEffect); MAKE_FUNCPTR(SDL_HapticRunEffect);
MAKE_FUNCPTR(SDL_HapticStopAll); MAKE_FUNCPTR(SDL_HapticStopAll);
MAKE_FUNCPTR(SDL_JoystickIsHaptic); MAKE_FUNCPTR(SDL_JoystickIsHaptic);
MAKE_FUNCPTR(SDL_JoystickRumble);
MAKE_FUNCPTR(SDL_memset); MAKE_FUNCPTR(SDL_memset);
MAKE_FUNCPTR(SDL_GameControllerAddMapping); MAKE_FUNCPTR(SDL_GameControllerAddMapping);
MAKE_FUNCPTR(SDL_RegisterEvents); MAKE_FUNCPTR(SDL_RegisterEvents);
MAKE_FUNCPTR(SDL_PushEvent); MAKE_FUNCPTR(SDL_PushEvent);
static int (*pSDL_JoystickRumble)(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms);
static Uint16 (*pSDL_JoystickGetProduct)(SDL_Joystick * joystick); static Uint16 (*pSDL_JoystickGetProduct)(SDL_Joystick * joystick);
static Uint16 (*pSDL_JoystickGetProductVersion)(SDL_Joystick * joystick); static Uint16 (*pSDL_JoystickGetProductVersion)(SDL_Joystick * joystick);
static Uint16 (*pSDL_JoystickGetVendor)(SDL_Joystick * joystick); static Uint16 (*pSDL_JoystickGetVendor)(SDL_Joystick * joystick);
...@@ -181,7 +181,7 @@ static BOOL descriptor_add_haptic(struct sdl_device *impl) ...@@ -181,7 +181,7 @@ static BOOL descriptor_add_haptic(struct sdl_device *impl)
pSDL_HapticRumbleInit(impl->sdl_haptic); pSDL_HapticRumbleInit(impl->sdl_haptic);
} }
if (!pSDL_JoystickRumble(impl->sdl_joystick, 0, 0, 0)) if (pSDL_JoystickRumble && !pSDL_JoystickRumble(impl->sdl_joystick, 0, 0, 0))
impl->effect_support |= WINE_SDL_JOYSTICK_RUMBLE; impl->effect_support |= WINE_SDL_JOYSTICK_RUMBLE;
if (impl->effect_support & EFFECT_SUPPORT_HAPTICS) if (impl->effect_support & EFFECT_SUPPORT_HAPTICS)
...@@ -658,12 +658,12 @@ NTSTATUS sdl_bus_init(void *args) ...@@ -658,12 +658,12 @@ NTSTATUS sdl_bus_init(void *args)
LOAD_FUNCPTR(SDL_HapticRunEffect); LOAD_FUNCPTR(SDL_HapticRunEffect);
LOAD_FUNCPTR(SDL_HapticStopAll); LOAD_FUNCPTR(SDL_HapticStopAll);
LOAD_FUNCPTR(SDL_JoystickIsHaptic); LOAD_FUNCPTR(SDL_JoystickIsHaptic);
LOAD_FUNCPTR(SDL_JoystickRumble);
LOAD_FUNCPTR(SDL_memset); LOAD_FUNCPTR(SDL_memset);
LOAD_FUNCPTR(SDL_GameControllerAddMapping); LOAD_FUNCPTR(SDL_GameControllerAddMapping);
LOAD_FUNCPTR(SDL_RegisterEvents); LOAD_FUNCPTR(SDL_RegisterEvents);
LOAD_FUNCPTR(SDL_PushEvent); LOAD_FUNCPTR(SDL_PushEvent);
#undef LOAD_FUNCPTR #undef LOAD_FUNCPTR
pSDL_JoystickRumble = dlsym(sdl_handle, "SDL_JoystickRumble");
pSDL_JoystickGetProduct = dlsym(sdl_handle, "SDL_JoystickGetProduct"); pSDL_JoystickGetProduct = dlsym(sdl_handle, "SDL_JoystickGetProduct");
pSDL_JoystickGetProductVersion = dlsym(sdl_handle, "SDL_JoystickGetProductVersion"); pSDL_JoystickGetProductVersion = dlsym(sdl_handle, "SDL_JoystickGetProductVersion");
pSDL_JoystickGetVendor = dlsym(sdl_handle, "SDL_JoystickGetVendor"); pSDL_JoystickGetVendor = dlsym(sdl_handle, "SDL_JoystickGetVendor");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment