src/haptic/linux/SDL_syshaptic.c
branchgsoc2008_force_feedback
changeset 2502 5356ca0c36a3
parent 2500 5251d0510b7e
child 2503 84a634009a83
equal deleted inserted replaced
2501:ff12f79dfc8d 2502:5356ca0c36a3
   339 {
   339 {
   340    Uint32 tmp;
   340    Uint32 tmp;
   341 
   341 
   342    switch (dir->type) {
   342    switch (dir->type) {
   343       case SDL_HAPTIC_POLAR:
   343       case SDL_HAPTIC_POLAR:
   344          tmp = ((dir->dir[0] % 36000) * 0xFFFF) / 36000;
   344          /* Linux directions are inverted. */
       
   345          tmp = (((18000 + dir->dir[0]) % 36000) * 0xFFFF) / 36000;
   345          return (Uint16) tmp;
   346          return (Uint16) tmp;
   346          break;
   347          break;
   347       case SDL_HAPTIC_CARTESIAN:
   348       case SDL_HAPTIC_CARTESIAN:
   348          /* TODO implement cartesian for linux since it's not supported
   349          /* TODO implement cartesian for linux since it's not supported
   349           * by driver */
   350           * by driver */