Fixed linux directions being inverted. gsoc2008_force_feedback
authorEdgar Simo <bobbens@gmail.com>
Mon, 07 Jul 2008 16:58:16 +0000
branchgsoc2008_force_feedback
changeset 25025356ca0c36a3
parent 2501 ff12f79dfc8d
child 2503 84a634009a83
Fixed linux directions being inverted.
include/SDL_haptic.h
src/haptic/linux/SDL_syshaptic.c
     1.1 --- a/include/SDL_haptic.h	Mon Jul 07 11:51:28 2008 +0000
     1.2 +++ b/include/SDL_haptic.h	Mon Jul 07 16:58:16 2008 +0000
     1.3 @@ -291,7 +291,7 @@
     1.4   *                    ^
     1.5   *                    |
     1.6   *                    |
     1.7 - * (1)  East <----[ HAPTIC ]----> West (-1)
     1.8 + * (1)  West <----[ HAPTIC ]----> East (-1)
     1.9   *                    |
    1.10   *                    |
    1.11   *                    v
     2.1 --- a/src/haptic/linux/SDL_syshaptic.c	Mon Jul 07 11:51:28 2008 +0000
     2.2 +++ b/src/haptic/linux/SDL_syshaptic.c	Mon Jul 07 16:58:16 2008 +0000
     2.3 @@ -341,7 +341,8 @@
     2.4  
     2.5     switch (dir->type) {
     2.6        case SDL_HAPTIC_POLAR:
     2.7 -         tmp = ((dir->dir[0] % 36000) * 0xFFFF) / 36000;
     2.8 +         /* Linux directions are inverted. */
     2.9 +         tmp = (((18000 + dir->dir[0]) % 36000) * 0xFFFF) / 36000;
    2.10           return (Uint16) tmp;
    2.11           break;
    2.12        case SDL_HAPTIC_CARTESIAN: