Another set of fixes to try to get haptic subsystem compiling on windows. gsoc2008_force_feedback
authorEdgar Simo <bobbens@gmail.com>
Thu, 31 Jul 2008 16:13:37 +0000
branchgsoc2008_force_feedback
changeset 2569806919b319d4
parent 2568 5ad98a77bacb
child 2570 53bb7d21928d
Another set of fixes to try to get haptic subsystem compiling on windows.
src/haptic/win32/SDL_syshaptic.c
     1.1 --- a/src/haptic/win32/SDL_syshaptic.c	Thu Jul 31 15:57:49 2008 +0000
     1.2 +++ b/src/haptic/win32/SDL_syshaptic.c	Thu Jul 31 16:13:37 2008 +0000
     1.3 @@ -200,6 +200,48 @@
     1.4     haptic->supported = 0;
     1.5  
     1.6     /* Get supported. */
     1.7 +   switch (pei->guid) {
     1.8 +      case GUID_Spring:
     1.9 +         haptic->supported |= SDL_HAPTIC_SPRING;
    1.10 +         break;
    1.11 +      case GUID_Damper:
    1.12 +         haptic->supported |= SDL_HAPTIC_DAMPER;
    1.13 +         break;
    1.14 +      case GUID_Inertia:
    1.15 +         haptic->supported |= SDL_HAPTIC_INERTIA;
    1.16 +         break;
    1.17 +      case GUID_Friction:
    1.18 +         haptic->supported |= SDL_HAPTIC_FRICTION;
    1.19 +         break;
    1.20 +      case GUID_ConstantForce:
    1.21 +         haptic->supported |= SDL_HAPTIC_CONSTANT;
    1.22 +         break;
    1.23 +      case GUID_CustomForce:
    1.24 +         haptic->supported |= SDL_HAPTIC_CUSTOM;
    1.25 +         break;
    1.26 +      case GUID_Sine:
    1.27 +         haptic->supported |= SDL_HAPTIC_SINE;
    1.28 +         break;
    1.29 +      case GUID_Square:
    1.30 +         haptic->supported |= SDL_HAPTIC_SQUARE;
    1.31 +         break;
    1.32 +      case GUID_Triangle:
    1.33 +         haptic->supported |= SDL_HAPTIC_TRIANGLE;
    1.34 +         break;
    1.35 +      case GUID_SawtoothUp:
    1.36 +         haptic->supported |= SDL_HAPTIC_SAWTOOTHUP;
    1.37 +         break;
    1.38 +      case GUID_SawtoothDown:
    1.39 +         haptic->supported |= SDL_HAPTIC_SAWTOOTHDOWN;
    1.40 +         break;
    1.41 +      case GUID_RampForce:
    1.42 +         haptic->supported |= SDL_HAPTIC_RAMP;
    1.43 +         break;
    1.44 +
    1.45 +      default:
    1.46 +         break;
    1.47 +   }
    1.48 +/*
    1.49     EFFECT_TEST(GUID_Spring,         SDL_HAPTIC_SPRING);
    1.50     EFFECT_TEST(GUID_Damper,         SDL_HAPTIC_DAMPER);
    1.51     EFFECT_TEST(GUID_Inertia,        SDL_HAPTIC_INERTIA);
    1.52 @@ -212,6 +254,7 @@
    1.53     EFFECT_TEST(GUID_SawtoothUp,     SDL_HAPTIC_SAWTOOTHUP);
    1.54     EFFECT_TEST(GUID_SawtoothDown,   SDL_HAPTIC_SAWTOOTHDOWN);
    1.55     EFFECT_TEST(GUID_RampForce,      SDL_HAPTIC_RAMP);
    1.56 +*/
    1.57    
    1.58     /* Check for more. */
    1.59     return DIENUM_CONTINUE;
    1.60 @@ -246,8 +289,8 @@
    1.61     SDL_memset(haptic->hwdata, 0, sizeof(*haptic->hwdata));
    1.62    
    1.63     /* Open the device */
    1.64 -   ret = IDirectInput_CreateDevice( dinput, &instance,
    1.65 -                                    guidInstance, &device );
    1.66 +   ret = IDirectInput_CreateDevice( dinput, &instance.guidInstance,
    1.67 +                                    &device, NULL );
    1.68     if (FAILED(ret)) {
    1.69        DI_SetError("Creating DirectInput device",ret);
    1.70        goto creat_err;
    1.71 @@ -300,7 +343,7 @@
    1.72  
    1.73     /* Get capabilities. */
    1.74     ret = IDirectInputDevice2_GetCapabilities( haptic->hwdata->device,
    1.75 -                                              haptic->hwdata->capabilities );
    1.76 +                                              &haptic->hwdata->capabilities );
    1.77     if (FAILED(ret)) {
    1.78        DI_SetError("Getting device capabilities",ret);
    1.79        goto acquire_err;