From e3839b01bc979fe498b627d7caf476f659b5ffa3 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 29 Aug 2020 18:37:22 +0200 Subject: [PATCH] - removed in_mousesmoothing. This not only was redundant with m_filter, even worse, it was in the wrong place. Control_GetInput is used to read the current input state from the backend and can get called at uneven intervals, or even multiple times during the same frame, so smoothing the movement here can lead to erratic behavior. With this change CONTROL_GetInput will return the same data unless it gets updated between calls. --- source/core/inputstate.cpp | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/source/core/inputstate.cpp b/source/core/inputstate.cpp index 3880e7e4f..4feaab77e 100644 --- a/source/core/inputstate.cpp +++ b/source/core/inputstate.cpp @@ -55,22 +55,9 @@ bool sendPause; void InputState::GetMouseDelta(ControlInfo * info) { - vec2f_t input, finput; - - input = g_mousePos; + vec2f_t finput = g_mousePos; g_mousePos = {}; - if (in_mousesmoothing) - { - static vec2f_t last; - finput = { (input.x + last.x) * 0.5f, (input.y + last.y) * 0.5f }; - last = input; - } - else - { - finput = { input.x, input.y }; - } - info->mousex = finput.x * (16.f / 32.f) * in_mousesensitivity * in_mousescalex / 3.f; info->mousey = finput.y * (16.f / 64.f) * in_mousesensitivity * in_mousescaley;