From 8877c4ba98054d29e918c08d52dbbea7c8bd5303 Mon Sep 17 00:00:00 2001 From: Jason Date: Tue, 17 Nov 2020 21:07:24 -0800 Subject: [PATCH] input: Fix SDL haptic effect length and magnitude --- ui/xemu-input.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/xemu-input.c b/ui/xemu-input.c index 33e94f9bd9..2a3a27f2d9 100644 --- a/ui/xemu-input.c +++ b/ui/xemu-input.c @@ -339,9 +339,9 @@ void xemu_input_update_rumble(struct controller_state *state) memset(&state->sdl_haptic_effect, 0, sizeof(state->sdl_haptic_effect)); state->sdl_haptic_effect.type = SDL_HAPTIC_LEFTRIGHT; - state->sdl_haptic_effect.periodic.length = 16; - state->sdl_haptic_effect.leftright.large_magnitude = state->rumble_l; - state->sdl_haptic_effect.leftright.small_magnitude = state->rumble_r; + state->sdl_haptic_effect.leftright.length = SDL_HAPTIC_INFINITY; + state->sdl_haptic_effect.leftright.large_magnitude = state->rumble_l >> 1; + state->sdl_haptic_effect.leftright.small_magnitude = state->rumble_r >> 1; if (state->sdl_haptic_effect_id == -1) { state->sdl_haptic_effect_id = SDL_HapticNewEffect(state->sdl_haptic, &state->sdl_haptic_effect); SDL_HapticRunEffect(state->sdl_haptic, state->sdl_haptic_effect_id, 1);