- remove m_filter and simplify related code
This commit is contained in:
parent
0a6cd28af9
commit
f1ad0961be
3 changed files with 2 additions and 18 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue