src/haptic/SDL_haptic.c
branchgsoc2008_force_feedback
changeset 2561 3696b9ce8a37
parent 2560 2274406ba792
child 2645 269ba4f28d0e
equal deleted inserted replaced
2560:2274406ba792 2561:3696b9ce8a37
   320    SDL_SYS_HapticClose(haptic);
   320    SDL_SYS_HapticClose(haptic);
   321 
   321 
   322    /* Remove from the list */
   322    /* Remove from the list */
   323    for (i = 0; SDL_haptics[i]; ++i) {
   323    for (i = 0; SDL_haptics[i]; ++i) {
   324       if (haptic == SDL_haptics[i]) {
   324       if (haptic == SDL_haptics[i]) {
       
   325          SDL_haptics[i] = NULL;
   325          SDL_memcpy(&SDL_haptics[i], &SDL_haptics[i + 1],
   326          SDL_memcpy(&SDL_haptics[i], &SDL_haptics[i + 1],
   326                (SDL_numhaptics - i) * sizeof(haptic));
   327                (SDL_numhaptics - i) * sizeof(haptic));
   327          break;
   328          break;
   328       }
   329       }
   329    }
   330    }