comparison src/haptic/win32/SDL_syshaptic.c @ 2621:83659de20bf2 gsoc2008_force_feedback

Forgot to alloc the hwdata when opening from joystick.
author Edgar Simo <bobbens@gmail.com>
date Wed, 06 Aug 2008 09:28:07 +0000
parents 4d91a53c6f8a
children 6deba05725ac
comparison
equal deleted inserted replaced
2620:4d91a53c6f8a 2621:83659de20bf2
563 int 563 int
564 SDL_SYS_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick) 564 SDL_SYS_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick)
565 { 565 {
566 int ret; 566 int ret;
567 567
568 /* Allocate the hwdata */
569 haptic->hwdata = (struct haptic_hwdata *)
570 SDL_malloc(sizeof(*haptic->hwdata));
571 if (haptic->hwdata == NULL) {
572 SDL_OutOfMemory();
573 return -1;
574 }
575 SDL_memset(haptic->hwdata, 0, sizeof(*haptic->hwdata));
576
577 /* Now open the device. */
568 ret = SDL_SYS_HapticOpenFromDevice2( haptic, joystick->hwdata->InputDevice ); 578 ret = SDL_SYS_HapticOpenFromDevice2( haptic, joystick->hwdata->InputDevice );
569 if (ret < 0) { 579 if (ret < 0) {
570 return -1; 580 return -1;
571 } 581 }
572 582