# HG changeset patch # User Edgar Simo # Date 1215449896 0 # Node ID 5356ca0c36a36beb714ea7a0eea8ea1ea4088cbf # Parent ff12f79dfc8d6662bc8ac2c3f41caff4a93746d7 Fixed linux directions being inverted. diff -r ff12f79dfc8d -r 5356ca0c36a3 include/SDL_haptic.h --- 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 diff -r ff12f79dfc8d -r 5356ca0c36a3 src/haptic/linux/SDL_syshaptic.c --- 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: