changeset 2502:5356ca0c36a3 gsoc2008_force_feedback

Fixed linux directions being inverted.
author Edgar Simo <bobbens@gmail.com>
date Mon, 07 Jul 2008 16:58:16 +0000
parents ff12f79dfc8d
children 84a634009a83
files include/SDL_haptic.h src/haptic/linux/SDL_syshaptic.c
diffstat 2 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/include/SDL_haptic.h	Mon Jul 07 11:51:28 2008 +0000
+++ b/include/SDL_haptic.h	Mon Jul 07 16:58:16 2008 +0000
@@ -291,7 +291,7 @@
  *                    ^
  *                    |
  *                    |
- * (1)  East <----[ HAPTIC ]----> West (-1)
+ * (1)  West <----[ HAPTIC ]----> East (-1)
  *                    |
  *                    |
  *                    v
--- a/src/haptic/linux/SDL_syshaptic.c	Mon Jul 07 11:51:28 2008 +0000
+++ b/src/haptic/linux/SDL_syshaptic.c	Mon Jul 07 16:58:16 2008 +0000
@@ -341,7 +341,8 @@
 
    switch (dir->type) {
       case SDL_HAPTIC_POLAR:
-         tmp = ((dir->dir[0] % 36000) * 0xFFFF) / 36000;
+         /* Linux directions are inverted. */
+         tmp = (((18000 + dir->dir[0]) % 36000) * 0xFFFF) / 36000;
          return (Uint16) tmp;
          break;
       case SDL_HAPTIC_CARTESIAN: