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: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2021-09-24 11:51:52 +02:00 committed by Alexandre Julliard
parent 6db01bcbbc
commit c3ee32e846

View file

@ -102,11 +102,11 @@ MAKE_FUNCPTR(SDL_HapticRumbleSupported);
MAKE_FUNCPTR(SDL_HapticRunEffect);
MAKE_FUNCPTR(SDL_HapticStopAll);
MAKE_FUNCPTR(SDL_JoystickIsHaptic);
MAKE_FUNCPTR(SDL_JoystickRumble);
MAKE_FUNCPTR(SDL_memset);
MAKE_FUNCPTR(SDL_GameControllerAddMapping);
MAKE_FUNCPTR(SDL_RegisterEvents);
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_JoystickGetProductVersion)(SDL_Joystick * joystick);
static Uint16 (*pSDL_JoystickGetVendor)(SDL_Joystick * joystick);
@ -181,7 +181,7 @@ static BOOL descriptor_add_haptic(struct sdl_device *impl)
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;
if (impl->effect_support & EFFECT_SUPPORT_HAPTICS)
@ -658,12 +658,12 @@ NTSTATUS sdl_bus_init(void *args)
LOAD_FUNCPTR(SDL_HapticRunEffect);
LOAD_FUNCPTR(SDL_HapticStopAll);
LOAD_FUNCPTR(SDL_JoystickIsHaptic);
LOAD_FUNCPTR(SDL_JoystickRumble);
LOAD_FUNCPTR(SDL_memset);
LOAD_FUNCPTR(SDL_GameControllerAddMapping);
LOAD_FUNCPTR(SDL_RegisterEvents);
LOAD_FUNCPTR(SDL_PushEvent);
#undef LOAD_FUNCPTR
pSDL_JoystickRumble = dlsym(sdl_handle, "SDL_JoystickRumble");
pSDL_JoystickGetProduct = dlsym(sdl_handle, "SDL_JoystickGetProduct");
pSDL_JoystickGetProductVersion = dlsym(sdl_handle, "SDL_JoystickGetProductVersion");
pSDL_JoystickGetVendor = dlsym(sdl_handle, "SDL_JoystickGetVendor");