comparison src/haptic/SDL_haptic.c @ 2483:9d52368ebcf5 gsoc2008_force_feedback

Setting effects memory to 0. Added SDL_HapticSetGain().
author Edgar Simo <bobbens@gmail.com>
date Tue, 01 Jul 2008 14:09:53 +0000
parents b883974445fc
children 666472fd4cb0
comparison
equal deleted inserted replaced
2482:b51ad78812d5 2483:9d52368ebcf5
322 } 322 }
323 323
324 SDL_SYS_HapticDestroyEffect(haptic, &haptic->effects[effect]); 324 SDL_SYS_HapticDestroyEffect(haptic, &haptic->effects[effect]);
325 } 325 }
326 326
327 327 /*
328 * Sets the global gain of the device.
329 */
330 int
331 SDL_HapticSetGain(SDL_Haptic * haptic, int gain )
332 {
333 if (!ValidHaptic(&haptic)) {
334 return -1;
335 }
336
337 if ((gain < 0) || (gain > 100)) {
338 SDL_SetError("Haptic gain must be between 0 and 100.");
339 return -1;
340 }
341
342 if (SDL_SYS_HapticSetGain(haptic,gain) < 0) {
343 return -1;
344 }
345
346 return 0;
347 }
348
349