comparison src/haptic/win32/SDL_syshaptic.c @ 2619:fb71df34124f gsoc2008_force_feedback

Made prototypes for all static functions. Should compile again.
author Edgar Simo <bobbens@gmail.com>
date Wed, 06 Aug 2008 09:23:22 +0000
parents a168397d6549
children 4d91a53c6f8a
comparison
equal deleted inserted replaced
2618:51cadb844a9e 2619:fb71df34124f
96 96
97 97
98 /* 98 /*
99 * Prototypes. 99 * Prototypes.
100 */ 100 */
101 static void DI_SetError(const char *str, HRESULT err);
102 static int DI_GUIDIsSame(const GUID * a, const GUID * b);
103 static int SDL_SYS_HapticOpenFromInstance(SDL_Haptic * haptic, DIDEVICEINSTANCE instance);
104 static int SDL_SYS_HapticOpenFromDevice2(SDL_Haptic * haptic, LPDIRECTINPUTDEVICE2 device2);
105 static DWORD DIGetTriggerButton( Uint16 button );
106 static int SDL_SYS_SetDirection( DIEFFECT * effect, SDL_HapticDirection *dir, int naxes );
107 static int SDL_SYS_ToDIEFFECT( SDL_Haptic * haptic, DIEFFECT * dest, SDL_HapticEffect * src );
108 static void SDL_SYS_HapticFreeDIEFFECT( DIEFFECT * effect, int type );
109 static REFGUID SDL_SYS_HapticEffectType(SDL_HapticEffect * effect);
110 /* Callbacks. */
101 static BOOL CALLBACK EnumHapticsCallback(const DIDEVICEINSTANCE * pdidInstance, VOID * pContext); 111 static BOOL CALLBACK EnumHapticsCallback(const DIDEVICEINSTANCE * pdidInstance, VOID * pContext);
112 static BOOL CALLBACK DI_EffectCallback(LPCDIEFFECTINFO pei, LPVOID pv);
102 113
103 114
104 /* 115 /*
105 * Like SDL_SetError but for DX error codes. 116 * Like SDL_SetError but for DX error codes.
106 */ 117 */
115 126
116 /* 127 /*
117 * Checks to see if two GUID are the same. 128 * Checks to see if two GUID are the same.
118 */ 129 */
119 static int 130 static int
120 DI_GUIDIsSame(GUID * a, GUID * b) 131 DI_GUIDIsSame(const GUID * a, const GUID * b)
121 { 132 {
122 if (((a)->Data1 == (b)->Data1) && 133 if (((a)->Data1 == (b)->Data1) &&
123 ((a)->Data2 == (b)->Data2) && 134 ((a)->Data2 == (b)->Data2) &&
124 ((a)->Data3 == (b)->Data3) && 135 ((a)->Data3 == (b)->Data3) &&
125 (SDL_strcmp((a)->Data4, (b)->Data4)==0)) 136 (SDL_strcmp((a)->Data4, (b)->Data4)==0))
299 SDL_SYS_HapticOpenFromInstance(SDL_Haptic * haptic, DIDEVICEINSTANCE instance) 310 SDL_SYS_HapticOpenFromInstance(SDL_Haptic * haptic, DIDEVICEINSTANCE instance)
300 { 311 {
301 HRESULT ret; 312 HRESULT ret;
302 int ret2; 313 int ret2;
303 LPDIRECTINPUTDEVICE device; 314 LPDIRECTINPUTDEVICE device;
304 DIPROPDWORD dipdw;
305 315
306 /* Allocate the hwdata */ 316 /* Allocate the hwdata */
307 haptic->hwdata = (struct haptic_hwdata *) 317 haptic->hwdata = (struct haptic_hwdata *)
308 SDL_malloc(sizeof(*haptic->hwdata)); 318 SDL_malloc(sizeof(*haptic->hwdata));
309 if (haptic->hwdata == NULL) { 319 if (haptic->hwdata == NULL) {
361 static int 371 static int
362 SDL_SYS_HapticOpenFromDevice2(SDL_Haptic * haptic, LPDIRECTINPUTDEVICE2 device2) 372 SDL_SYS_HapticOpenFromDevice2(SDL_Haptic * haptic, LPDIRECTINPUTDEVICE2 device2)
363 373
364 { 374 {
365 HRESULT ret; 375 HRESULT ret;
376 DIPROPDWORD dipdw;
366 377
367 /* We'll use the device2 from now on. */ 378 /* We'll use the device2 from now on. */
368 haptic->hwdata->device = device2; 379 haptic->hwdata->device = device2;
369 380
370 /* Grab it exclusively to use force feedback stuff. */ 381 /* Grab it exclusively to use force feedback stuff. */