summaryrefslogtreecommitdiff
path: root/macosx/plugins/Common/SDL/src/haptic/darwin
diff options
context:
space:
mode:
authorSND\edgbla_cp <SND\edgbla_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2011-05-02 12:56:41 +0000
committerSND\edgbla_cp <SND\edgbla_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2011-05-02 12:56:41 +0000
commit1b994def069a2a09e792f88bb9287387a9a4cc97 (patch)
treec2436e7fc76bb7e834dc3a4a1c79390c8538fe54 /macosx/plugins/Common/SDL/src/haptic/darwin
parent2cd82c7b149157c303828d09ef44073c5ff169bf (diff)
downloadpcsxr-1b994def069a2a09e792f88bb9287387a9a4cc97.tar.gz
Patch 9232 (MaddTheSane).
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@66465 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/plugins/Common/SDL/src/haptic/darwin')
-rw-r--r--macosx/plugins/Common/SDL/src/haptic/darwin/SDL_syshaptic.c49
1 files changed, 30 insertions, 19 deletions
diff --git a/macosx/plugins/Common/SDL/src/haptic/darwin/SDL_syshaptic.c b/macosx/plugins/Common/SDL/src/haptic/darwin/SDL_syshaptic.c
index c5b1e54b..48a7c45c 100644
--- a/macosx/plugins/Common/SDL/src/haptic/darwin/SDL_syshaptic.c
+++ b/macosx/plugins/Common/SDL/src/haptic/darwin/SDL_syshaptic.c
@@ -1,23 +1,22 @@
/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 2008 Edgar Simo
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
+ Simple DirectMedia Layer
+ Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
*/
#include "SDL_config.h"
@@ -534,6 +533,18 @@ SDL_SYS_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick)
int
SDL_SYS_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick)
{
+ int i;
+ for (i=0; i<SDL_numhaptics; i++) {
+ if (IOObjectIsEqualTo((io_object_t) SDL_hapticlist[i].dev,
+ joystick->hwdata->ffservice)) {
+ haptic->index = i;
+ break;
+ }
+ }
+ if (i >= SDL_numhaptics) {
+ return -1;
+ }
+
return SDL_SYS_HapticOpenFromService(haptic, joystick->hwdata->ffservice);
}