- remove m_filter and simplify related code

This commit is contained in:
Rachael Alexanderson 2022-05-29 10:46:41 -04:00 committed by Christoph Oelckers
commit f1ad0961be
3 changed files with 2 additions and 18 deletions

View file

@ -52,7 +52,6 @@ event_t events[MAXEVENTS];
CVAR(Float, m_sensitivity_x, 4, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
CVAR(Float, m_sensitivity_y, 2, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
CVAR(Bool, m_filter, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
//==========================================================================
@ -165,24 +164,11 @@ void D_PostEvent(event_t* ev)
void PostMouseMove(int xx, int yy)
{
static float lastx = 0, lasty = 0;
event_t ev{};
float x = float(xx) * m_sensitivity_x;
float y = -float(yy) * m_sensitivity_y;
ev.x = float(xx) * m_sensitivity_x;
ev.y = -float(yy) * m_sensitivity_y;
if (m_filter)
{
ev.x = (x + lastx) / 2;
ev.y = (y + lasty) / 2;
}
else
{
ev.x = x;
ev.y = y;
}
lastx = x;
lasty = y;
if (ev.x || ev.y)
{
ev.type = EV_Mouse;