comparison src/haptic/win32/SDL_syshaptic.c @ 2573:40b89e3d7ab5 gsoc2008_force_feedback

More windows haptic patches.
author Edgar Simo <bobbens@gmail.com>
date Thu, 31 Jul 2008 16:29:12 +0000
parents bb1481265341
children c1f07fdd1e2d
comparison
equal deleted inserted replaced
2572:bb1481265341 2573:40b89e3d7ab5
72 * Haptic system effect data. 72 * Haptic system effect data.
73 */ 73 */
74 struct haptic_hweffect 74 struct haptic_hweffect
75 { 75 {
76 DIEFFECT effect; 76 DIEFFECT effect;
77 LPDIRECTINPUTEFFECT ref;
77 }; 78 };
78 79
79 80
80 /* 81 /*
81 * Internal stuff. 82 * Internal stuff.
188 189
189 /* 190 /*
190 * Callback to get all supported effects. 191 * Callback to get all supported effects.
191 */ 192 */
192 #define EFFECT_TEST(e,s) \ 193 #define EFFECT_TEST(e,s) \
193 if (pei->guid == &(e)) \ 194 if (&pei->guid == &(e)) \
194 haptic->supported |= (s) 195 haptic->supported |= (s)
195 static BOOL CALLBACK 196 static BOOL CALLBACK
196 DI_EffectCallback(LPCDIEFFECTINFO pei, LPVOID pv) 197 DI_EffectCallback(LPCDIEFFECTINFO pei, LPVOID pv)
197 { 198 {
198 /* Prepare the haptic device. */ 199 /* Prepare the haptic device. */
976 DIEP_TRIGGERREPEATINTERVAL | 977 DIEP_TRIGGERREPEATINTERVAL |
977 DIEP_TYPESPECIFICPARAMS; 978 DIEP_TYPESPECIFICPARAMS;
978 979
979 /* Create the actual effect. */ 980 /* Create the actual effect. */
980 ret = IDirectInputDevice2_SetParameters(effect->hweffect->ref, &temp, flags); 981 ret = IDirectInputDevice2_SetParameters(effect->hweffect->ref, &temp, flags);
981 if (ret != FF_OK) { 982 if (FAILED(ret)) {
982 SDL_SetError("Haptic: Unable to update effect: %s.", FFStrError(ret)); 983 DI_SetError("Unable to update effect",ret);
983 goto err_update; 984 goto err_update;
984 } 985 }
985 986
986 /* Copy it over. */ 987 /* Copy it over. */
987 SDL_SYS_HapticFreeDIEFFECT(&effect->hweffect->effect, data->type); 988 SDL_SYS_HapticFreeDIEFFECT(&effect->hweffect->effect, data->type);