src/haptic/darwin/SDL_syshaptic.c
branchgsoc2008_force_feedback
changeset 2542 4e055fa7acb9
parent 2541 f2649eaa552e
child 2543 3544a632064c
equal deleted inserted replaced
2541:f2649eaa552e 2542:4e055fa7acb9
   299    ret = FFDeviceGetForceFeedbackProperty(device, FFPROP_FFGAIN,
   299    ret = FFDeviceGetForceFeedbackProperty(device, FFPROP_FFGAIN,
   300                                           &val, sizeof(val));
   300                                           &val, sizeof(val));
   301    if (ret == FF_OK) supported |= SDL_HAPTIC_GAIN;
   301    if (ret == FF_OK) supported |= SDL_HAPTIC_GAIN;
   302    else if (ret != FFERR_UNSUPPORTED) {
   302    else if (ret != FFERR_UNSUPPORTED) {
   303       SDL_SetError("Haptic: Unable to get if device supports gain: %s.",
   303       SDL_SetError("Haptic: Unable to get if device supports gain: %s.",
   304                    FFStrError(ret););
   304                    FFStrError(ret));
   305       return 0;
   305       return 0;
   306    }
   306    }
   307 
   307 
   308    /* Checks if supports autocenter. */
   308    /* Checks if supports autocenter. */
   309    ret = FFDeviceGetForceFeedbackProperty(device, FFPROP_AUTOCENTER,
   309    ret = FFDeviceGetForceFeedbackProperty(device, FFPROP_AUTOCENTER,
   940    /* Set the flags.  Might be worthwhile to diff temp with loaded effect and
   940    /* Set the flags.  Might be worthwhile to diff temp with loaded effect and
   941     *  only change those parameters. */
   941     *  only change those parameters. */
   942    flags = FFEP_ALLPARAMS;
   942    flags = FFEP_ALLPARAMS;
   943 
   943 
   944    /* Create the actual effect. */
   944    /* Create the actual effect. */
   945    ret = FFEffectSetParameters(haptic->hwdata->device, effect->hweffect->ref,
   945    ret = FFEffectSetParameters(effect->hweffect->ref, &temp, flags);
   946                                &temp, flags);
       
   947 
       
   948    if (ret != FF_OK) {
   946    if (ret != FF_OK) {
   949       SDL_SetError("Haptic: Unable to update effect: %s.", FFStrError(ret));
   947       SDL_SetError("Haptic: Unable to update effect: %s.", FFStrError(ret));
   950       goto err_update;
   948       goto err_update;
   951    }
   949    }
   952 
   950