diff --git a/include/SDL3/SDL_haptic.h b/include/SDL3/SDL_haptic.h index bb6d606551670f..84f8c0c4f7695a 100644 --- a/include/SDL3/SDL_haptic.h +++ b/include/SDL3/SDL_haptic.h @@ -710,7 +710,7 @@ typedef struct SDL_HapticCondition /* Header */ Uint16 type; /**< SDL_HAPTIC_SPRING, SDL_HAPTIC_DAMPER, SDL_HAPTIC_INERTIA or SDL_HAPTIC_FRICTION */ - SDL_HapticDirection direction; /**< Direction of the effect - Not used ATM. */ + SDL_HapticDirection direction; /**< Direction of the effect. */ /* Replay */ Uint32 length; /**< Duration of the effect. */ diff --git a/src/haptic/linux/SDL_syshaptic.c b/src/haptic/linux/SDL_syshaptic.c index 1e38b9aabf4b98..cb1b3809466cc6 100644 --- a/src/haptic/linux/SDL_syshaptic.c +++ b/src/haptic/linux/SDL_syshaptic.c @@ -824,7 +824,9 @@ static bool SDL_SYS_ToFFEffect(struct ff_effect *dest, const SDL_HapticEffect *s dest->type = FF_FRICTION; } - dest->direction = 0; // Handled by the condition-specifics. + if (SDL_SYS_ToDirection(&dest->direction, &periodic->direction) == -1) { + return -1; + } // Replay dest->replay.length = (condition->length == SDL_HAPTIC_INFINITY) ? 0 : CLAMP(condition->length);