Mercurial > sdl-ios-xcode
comparison src/haptic/linux/SDL_syshaptic.c @ 2502:5356ca0c36a3 gsoc2008_force_feedback
Fixed linux directions being inverted.
author | Edgar Simo <bobbens@gmail.com> |
---|---|
date | Mon, 07 Jul 2008 16:58:16 +0000 |
parents | 5251d0510b7e |
children | 84a634009a83 |
comparison
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 */ |