Make SDL_SYS_HapticMouse() count device indexes like HapticByDevIndex().

This commit is contained in:
Ryan C. Gordon 2014-02-05 18:36:40 -05:00
parent 7f94268805
commit ccbf6943e7
1 changed files with 4 additions and 4 deletions

View File

@ -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;