From ccbf6943e7ed110480600327e9d43af27d5c6eb3 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 5 Feb 2014 18:36:40 -0500 Subject: [PATCH] Make SDL_SYS_HapticMouse() count device indexes like HapticByDevIndex(). --- src/haptic/darwin/SDL_syshaptic.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/haptic/darwin/SDL_syshaptic.c b/src/haptic/darwin/SDL_syshaptic.c index 75bafc029..c4fce9ceb 100644 --- a/src/haptic/darwin/SDL_syshaptic.c +++ b/src/haptic/darwin/SDL_syshaptic.c @@ -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;