From 66cf30c2de4f12c1b99b8d51ea5d77b62b373907 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Mon, 6 Nov 2023 19:33:22 -0800
Subject: [PATCH] Removed misleading comment
Fixes https://github.com/libsdl-org/SDL/issues/5069
---
src/haptic/linux/SDL_syshaptic.c | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/src/haptic/linux/SDL_syshaptic.c b/src/haptic/linux/SDL_syshaptic.c
index 549354e395b7..a32e391f6067 100644
--- a/src/haptic/linux/SDL_syshaptic.c
+++ b/src/haptic/linux/SDL_syshaptic.c
@@ -640,17 +640,6 @@ static int SDL_SYS_ToDirection(Uint16 *dest, SDL_HapticDirection *src)
switch (src->type) {
case SDL_HAPTIC_POLAR:
- /* Linux directions start from south.
- (and range from 0 to 0xFFFF)
- Quoting include/linux/input.h, line 926:
- Direction of the effect is encoded as follows:
- 0 deg -> 0x0000 (down)
- 90 deg -> 0x4000 (left)
- 180 deg -> 0x8000 (up)
- 270 deg -> 0xC000 (right)
- The force pulls into the direction specified by Linux directions,
- i.e. the opposite convention of SDL directions.
- */
tmp = ((src->dir[0] % 36000) * 0x8000) / 18000; /* convert to range [0,0xFFFF] */
*dest = (Uint16)tmp;
break;