mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-01-25 14:16:07 +00:00
committed by
Sam Lantinga
parent
e29c0661cc
commit
d0bbfdbfb8
@@ -160,8 +160,7 @@ int SDL_SYS_HapticInit(void)
|
||||
*/
|
||||
i = 0;
|
||||
for (j = 0; j < MAX_HAPTICS; ++j) {
|
||||
|
||||
SDL_snprintf(path, PATH_MAX, joydev_pattern, i++);
|
||||
(void)SDL_snprintf(path, PATH_MAX, joydev_pattern, i++);
|
||||
MaybeAddDevice(path);
|
||||
}
|
||||
|
||||
@@ -673,9 +672,9 @@ static int SDL_SYS_ToDirection(Uint16 *dest, SDL_HapticDirection *src)
|
||||
break;
|
||||
|
||||
case SDL_HAPTIC_CARTESIAN:
|
||||
if (!src->dir[1])
|
||||
if (!src->dir[1]) {
|
||||
*dest = (src->dir[0] >= 0 ? 0x4000 : 0xC000);
|
||||
else if (!src->dir[0])
|
||||
} else if (!src->dir[0]) {
|
||||
*dest = (src->dir[1] >= 0 ? 0x8000 : 0);
|
||||
else {
|
||||
float f = SDL_atan2(src->dir[1], src->dir[0]); /* Ideally we'd use fixed point math instead of floats... */
|
||||
|
||||
Reference in New Issue
Block a user