src/haptic/linux/SDL_syshaptic.c
changeset 9249 35a4fab04296
parent 9070 8973a237f360
child 9251 198989b162d3
equal deleted inserted replaced
9248:dabd5df43970 9249:35a4fab04296
   667                    Direction of the effect is encoded as follows:
   667                    Direction of the effect is encoded as follows:
   668                         0 deg -> 0x0000 (down)
   668                         0 deg -> 0x0000 (down)
   669                         90 deg -> 0x4000 (left)
   669                         90 deg -> 0x4000 (left)
   670                         180 deg -> 0x8000 (up)
   670                         180 deg -> 0x8000 (up)
   671                         270 deg -> 0xC000 (right)
   671                         270 deg -> 0xC000 (right)
       
   672                    The force pulls into the direction specified by Linux directions,
       
   673                    i.e. the opposite convention of SDL directions.
   672                     */
   674                     */
   673         tmp = ((src->dir[0] % 36000) * 0x8000) / 18000; /* convert to range [0,0xFFFF] */
   675         tmp = ((src->dir[0] % 36000) * 0x8000) / 18000; /* convert to range [0,0xFFFF] */
   674         *dest = (Uint16) tmp;
   676         *dest = (Uint16) tmp;
   675         break;
   677         break;
   676 
   678