comparison src/haptic/darwin/SDL_syshaptic.c @ 2608:7c7a63f22afa gsoc2008_force_feedback

Using same syntax as the windows port for updating effects.
author Edgar Simo <bobbens@gmail.com>
date Tue, 05 Aug 2008 18:01:09 +0000
parents 4eee4d565368
children eec0c81ede06
comparison
equal deleted inserted replaced
2607:e0ca521516f6 2608:7c7a63f22afa
81 FFStrError(HRESULT err) 81 FFStrError(HRESULT err)
82 { 82 {
83 switch (err) { 83 switch (err) {
84 case FFERR_DEVICEFULL: 84 case FFERR_DEVICEFULL:
85 return "device full"; 85 return "device full";
86 /* This should be valid, but for some reason isn't defined... */
86 /*case FFERR_DEVICENOTREG: 87 /*case FFERR_DEVICENOTREG:
87 return "device not registered";*/ 88 return "device not registered";*/
88 case FFERR_DEVICEPAUSED: 89 case FFERR_DEVICEPAUSED:
89 return "device paused"; 90 return "device paused";
90 case FFERR_DEVICERELEASED: 91 case FFERR_DEVICERELEASED:
267 return 0; 268 return 0;
268 } 269 }
269 270
270 271
271 #define FF_TEST(ff, s) \ 272 #define FF_TEST(ff, s) \
272 if (features.supportedEffects & ff) supported |= s 273 if (features.supportedEffects & (ff)) supported |= (s)
273 /* 274 /*
274 * Gets supported features. 275 * Gets supported features.
275 */ 276 */
276 static unsigned int 277 static unsigned int
277 GetSupportedFeatures(FFDeviceObjectReference device, 278 GetSupportedFeatures(FFDeviceObjectReference device,
1009 goto err_update; 1010 goto err_update;
1010 } 1011 }
1011 1012
1012 /* Set the flags. Might be worthwhile to diff temp with loaded effect and 1013 /* Set the flags. Might be worthwhile to diff temp with loaded effect and
1013 * only change those parameters. */ 1014 * only change those parameters. */
1014 flags = FFEP_ALLPARAMS; 1015 flags = FFEP_DIRECTION |
1016 FFEP_DURATION |
1017 FFEP_ENVELOPE |
1018 FFEP_STARTDELAY |
1019 FFEP_TRIGGERBUTTON |
1020 FFEP_TRIGGERREPEATINTERVAL |
1021 FFEP_TYPESPECIFICPARAMS;
1015 1022
1016 /* Create the actual effect. */ 1023 /* Create the actual effect. */
1017 ret = FFEffectSetParameters(effect->hweffect->ref, &temp, flags); 1024 ret = FFEffectSetParameters(effect->hweffect->ref, &temp, flags);
1018 if (ret != FF_OK) { 1025 if (ret != FF_OK) {
1019 SDL_SetError("Haptic: Unable to update effect: %s.", FFStrError(ret)); 1026 SDL_SetError("Haptic: Unable to update effect: %s.", FFStrError(ret));