Skip to content

Commit

Permalink
Make SDL_SYS_HapticMouse() count device indexes like HapticByDevIndex().
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Feb 5, 2014
1 parent 7f94268 commit ccbf694
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/haptic/darwin/SDL_syshaptic.c
Expand Up @@ -571,15 +571,15 @@ SDL_SYS_HapticOpen(SDL_Haptic * haptic)
int
SDL_SYS_HapticMouse(void)
{
int device_index = 0;
int device_index = numhaptics-1;
SDL_hapticlist_item *item;

for (item = SDL_hapticlist; item; item = item->next) {
if ((item->usagePage == kHIDPage_GenericDesktop) &&
(item->usage == kHIDUsage_GD_Mouse))
(item->usage == kHIDUsage_GD_Mouse)) {
return device_index;

++device_index;
}
device_index--;
}

return -1;
Expand Down

0 comments on commit ccbf694

Please sign in to comment.