More windows haptic patches. gsoc2008_force_feedback
authorEdgar Simo <bobbens@gmail.com>
Thu, 31 Jul 2008 16:29:12 +0000
branchgsoc2008_force_feedback
changeset 257340b89e3d7ab5
parent 2572 bb1481265341
child 2574 c1f07fdd1e2d
More windows haptic patches.
src/haptic/win32/SDL_syshaptic.c
     1.1 --- a/src/haptic/win32/SDL_syshaptic.c	Thu Jul 31 16:23:52 2008 +0000
     1.2 +++ b/src/haptic/win32/SDL_syshaptic.c	Thu Jul 31 16:29:12 2008 +0000
     1.3 @@ -74,6 +74,7 @@
     1.4  struct haptic_hweffect
     1.5  {
     1.6     DIEFFECT effect;
     1.7 +   LPDIRECTINPUTEFFECT ref;
     1.8  };
     1.9  
    1.10  
    1.11 @@ -190,7 +191,7 @@
    1.12   * Callback to get all supported effects.
    1.13   */
    1.14  #define EFFECT_TEST(e,s)   \
    1.15 -if (pei->guid == &(e))      \
    1.16 +if (&pei->guid == &(e))      \
    1.17     haptic->supported |= (s)
    1.18  static BOOL CALLBACK
    1.19  DI_EffectCallback(LPCDIEFFECTINFO pei, LPVOID pv)
    1.20 @@ -978,8 +979,8 @@
    1.21  
    1.22     /* Create the actual effect. */
    1.23     ret = IDirectInputDevice2_SetParameters(effect->hweffect->ref, &temp, flags);
    1.24 -   if (ret != FF_OK) {
    1.25 -      SDL_SetError("Haptic: Unable to update effect: %s.", FFStrError(ret));
    1.26 +   if (FAILED(ret)) {
    1.27 +      DI_SetError("Unable to update effect",ret);
    1.28        goto err_update;
    1.29     }
    1.30