Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fixed linux directions being inverted.
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbens committed Jul 7, 2008
1 parent aec0052 commit f9a5701
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/SDL_haptic.h
Expand Up @@ -291,7 +291,7 @@ typedef struct _SDL_Haptic SDL_Haptic;
* ^
* |
* |
* (1) East <----[ HAPTIC ]----> West (-1)
* (1) West <----[ HAPTIC ]----> East (-1)
* |
* |
* v
Expand Down
3 changes: 2 additions & 1 deletion src/haptic/linux/SDL_syshaptic.c
Expand Up @@ -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:
Expand Down

0 comments on commit f9a5701

Please sign in to comment.