From f9a570154e08d65f7c1803104befdcb1b760a35a Mon Sep 17 00:00:00 2001 From: Edgar Simo Date: Mon, 7 Jul 2008 16:58:16 +0000 Subject: [PATCH] Fixed linux directions being inverted. --- include/SDL_haptic.h | 2 +- src/haptic/linux/SDL_syshaptic.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/SDL_haptic.h b/include/SDL_haptic.h index 2baf87ae9..d9fd9b85f 100644 --- a/include/SDL_haptic.h +++ b/include/SDL_haptic.h @@ -291,7 +291,7 @@ typedef struct _SDL_Haptic SDL_Haptic; * ^ * | * | - * (1) East <----[ HAPTIC ]----> West (-1) + * (1) West <----[ HAPTIC ]----> East (-1) * | * | * v diff --git a/src/haptic/linux/SDL_syshaptic.c b/src/haptic/linux/SDL_syshaptic.c index b8558baac..75137cf50 100644 --- a/src/haptic/linux/SDL_syshaptic.c +++ b/src/haptic/linux/SDL_syshaptic.c @@ -341,7 +341,8 @@ SDL_SYS_ToDirection( SDL_HapticDirection * dir ) 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: