diff --git a/input/input_driver.c b/input/input_driver.c index 570cd152fe..ed7ec8b1fb 100644 --- a/input/input_driver.c +++ b/input/input_driver.c @@ -288,7 +288,8 @@ void input_poll(void) #ifdef HAVE_OVERLAY if (overlay_ptr && input_overlay_is_alive(overlay_ptr)) - input_poll_overlay(overlay_ptr, settings->input.overlay_opacity); + input_poll_overlay(overlay_ptr, settings->input.overlay_opacity, + settings->input.analog_dpad_mode[0], settings->input.axis_threshold); #endif #ifdef HAVE_COMMAND diff --git a/input/input_overlay.c b/input/input_overlay.c index 645c2e88d8..331cbf3822 100644 --- a/input/input_overlay.c +++ b/input/input_overlay.c @@ -36,7 +36,6 @@ #include "../menu/menu_driver.h" #endif -#include "../configuration.h" #include "../verbosity.h" #include "input_overlay.h" @@ -574,13 +573,13 @@ bool input_overlay_key_pressed(input_overlay_t *ol, int key) * * Poll pressed buttons/keys on currently active overlay. **/ -void input_poll_overlay(input_overlay_t *ol, float opacity) +void input_poll_overlay(input_overlay_t *ol, float opacity, unsigned analog_dpad_mode, + float axis_threshold) { input_overlay_state_t old_key_state; unsigned i, j, device; uint16_t key_mod = 0; bool polled = false; - settings_t *settings = config_get_ptr(); input_overlay_state_t *ol_state = &ol->overlay_state; if (!ol_state) @@ -673,16 +672,15 @@ void input_poll_overlay(input_overlay_t *ol, float opacity) /* Check for analog_dpad_mode. * Map analogs to d-pad buttons when configured. */ - switch (settings->input.analog_dpad_mode[0]) + switch (analog_dpad_mode) { case ANALOG_DPAD_LSTICK: case ANALOG_DPAD_RSTICK: { float analog_x, analog_y; unsigned analog_base = 2; - float axis_threshold = settings->input.axis_threshold; - if (settings->input.analog_dpad_mode[0] == ANALOG_DPAD_LSTICK) + if (analog_dpad_mode == ANALOG_DPAD_LSTICK) analog_base = 0; analog_x = (float)ol_state->analog[analog_base + 0] / 0x7fff; diff --git a/input/input_overlay.h b/input/input_overlay.h index f802a19517..9eac1af6ce 100644 --- a/input/input_overlay.h +++ b/input/input_overlay.h @@ -236,7 +236,8 @@ void input_overlay_next(input_overlay_t *ol, float opacity); * * Poll pressed buttons/keys on currently active overlay. **/ -void input_poll_overlay(input_overlay_t *ol, float opacity); +void input_poll_overlay(input_overlay_t *ol, float opacity, unsigned analog_dpad_mode, + float axis_threshold); void input_state_overlay(input_overlay_t *ol, int16_t *ret, unsigned port, unsigned device, unsigned idx,