input: Fix SDL haptic effect length and magnitude

This commit is contained in:
Jason 2020-11-17 21:07:24 -08:00 committed by GitHub
parent 8d2ebd6cd8
commit 8877c4ba98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -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);