src/haptic/linux/SDL_syshaptic.c
branchgsoc2008_force_feedback
changeset 2502 5356ca0c36a3
parent 2500 5251d0510b7e
child 2503 84a634009a83
--- 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: