Windows build should compile after this. gsoc2008_force_feedback
authorEdgar Simo <bobbens@gmail.com>
Thu, 31 Jul 2008 16:38:13 +0000
branchgsoc2008_force_feedback
changeset 2574 c1f07fdd1e2d
parent 2573 40b89e3d7ab5
child 2575 57ea8810b5f0
Windows build should compile after this.
src/haptic/win32/SDL_syshaptic.c
--- a/src/haptic/win32/SDL_syshaptic.c	Thu Jul 31 16:29:12 2008 +0000
+++ b/src/haptic/win32/SDL_syshaptic.c	Thu Jul 31 16:38:13 2008 +0000
@@ -908,7 +908,12 @@
       SDL_HapticEffect * base)
 {
    HRESULT ret;
-   REFGUID type;
+
+   /* Get the type. */
+   REFGUID type = SDL_SYS_HapticEffectType(effect);
+   if (type == NULL) {
+      goto err_hweffect;
+   }
 
    /* Alloc the effect. */
    effect->hweffect = (struct haptic_hweffect *)
@@ -918,12 +923,6 @@
       goto err_hweffect;
    }
 
-   /* Get the type. */
-   type = SDL_SYS_HapticEffectType(effect);
-   if (type == NULL) {
-      goto err_hweffect;
-   }
-
    /* Get the effect. */
    if (SDL_SYS_ToDIEFFECT(haptic, &effect->hweffect->effect, base) < 0) {
       goto err_effectdone;
@@ -978,7 +977,7 @@
            DIEP_TYPESPECIFICPARAMS;
 
    /* Create the actual effect. */
-   ret = IDirectInputDevice2_SetParameters(effect->hweffect->ref, &temp, flags);
+   ret = IDirectInputEffect_SetParameters(effect->hweffect->ref, &temp, flags);
    if (FAILED(ret)) {
       DI_SetError("Unable to update effect",ret);
       goto err_update;