From 4fed009b6bc1c9bac57467b0a7e0db2036c9c8a7 Mon Sep 17 00:00:00 2001 From: Edgar Simo Date: Thu, 31 Jul 2008 16:29:12 +0000 Subject: [PATCH] More windows haptic patches. --- src/haptic/win32/SDL_syshaptic.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/haptic/win32/SDL_syshaptic.c b/src/haptic/win32/SDL_syshaptic.c index 884014e5b..f90240309 100644 --- a/src/haptic/win32/SDL_syshaptic.c +++ b/src/haptic/win32/SDL_syshaptic.c @@ -74,6 +74,7 @@ struct haptic_hwdata struct haptic_hweffect { DIEFFECT effect; + LPDIRECTINPUTEFFECT ref; }; @@ -190,7 +191,7 @@ SDL_SYS_HapticName(int index) * Callback to get all supported effects. */ #define EFFECT_TEST(e,s) \ -if (pei->guid == &(e)) \ +if (&pei->guid == &(e)) \ haptic->supported |= (s) static BOOL CALLBACK DI_EffectCallback(LPCDIEFFECTINFO pei, LPVOID pv) @@ -978,8 +979,8 @@ SDL_SYS_HapticUpdateEffect(SDL_Haptic * haptic, /* Create the actual effect. */ ret = IDirectInputDevice2_SetParameters(effect->hweffect->ref, &temp, flags); - if (ret != FF_OK) { - SDL_SetError("Haptic: Unable to update effect: %s.", FFStrError(ret)); + if (FAILED(ret)) { + DI_SetError("Unable to update effect",ret); goto err_update; }