Useless cleanup of a function I saw when investigating a problem

git-svn-id: https://svn.eduke32.com/eduke32@6773 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2018-03-17 03:44:05 +00:00
parent be5cf71c83
commit 9ea4f8f802

View file

@ -111,23 +111,22 @@ void CONTROL_FreeMouseBind(int i)
#ifndef __ANDROID__ #ifndef __ANDROID__
static void CONTROL_GetMouseDelta(void) static void CONTROL_GetMouseDelta(void)
{ {
int32_t x,y; vec2_t pos;
MOUSE_GetDelta(&x, &y); MOUSE_GetDelta(&pos.x, &pos.y);
if (CONTROL_SmoothMouse) if (CONTROL_SmoothMouse)
{ {
static int32_t lastx = 0, lasty = 0; static vec2_t last;
CONTROL_MouseAxes[0].analog = (int32_t)(((x + lastx) / 2.0f) * 4.0f * CONTROL_MouseSensitivity); CONTROL_MouseAxes[0].analog = (int32_t)(((float)(pos.x + last.x) / 2.0f) * 4.0f * CONTROL_MouseSensitivity);
CONTROL_MouseAxes[1].analog = (int32_t)((((y + lasty) / 2.0f) * 4.0f * CONTROL_MouseSensitivity) * 2.0f); CONTROL_MouseAxes[1].analog = (int32_t)(((float)(pos.y + last.y) / 2.0f) * 4.0f * CONTROL_MouseSensitivity * 2.0f);
lastx = x; last = pos;
lasty = y;
return; return;
} }
CONTROL_MouseAxes[0].analog = (int32_t)(x * 4.0f * CONTROL_MouseSensitivity); CONTROL_MouseAxes[0].analog = (int32_t)(pos.x * 4.0f * CONTROL_MouseSensitivity);
CONTROL_MouseAxes[1].analog = (int32_t)((y * 4.0f * CONTROL_MouseSensitivity) * 2.0f); CONTROL_MouseAxes[1].analog = (int32_t)(pos.y * 4.0f * CONTROL_MouseSensitivity * 2.0f);
} }
#endif #endif