src/haptic/win32/SDL_syshaptic.c
branchgsoc2008_force_feedback
changeset 2621 83659de20bf2
parent 2620 4d91a53c6f8a
child 2623 6deba05725ac
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