diff src/haptic/linux/SDL_syshaptic.c @ 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 5251d0510b7e
children 84a634009a83
line wrap: on
line diff
--- 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: