mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-02-09 01:01:05 +00:00
- 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;
|
||||
|
|
|
@ -82,7 +82,6 @@ protected:
|
|||
void ClearButtonState();
|
||||
|
||||
int WheelMove[2];
|
||||
int LastX, LastY; // for m_filter
|
||||
int ButtonState; // bit mask of current button states (1=down, 0=up)
|
||||
};
|
||||
|
||||
|
|
|
@ -305,7 +305,6 @@ void I_CheckNativeMouse(bool preferNative, bool eventhandlerresult)
|
|||
|
||||
FMouse::FMouse()
|
||||
{
|
||||
LastX = LastY = 0;
|
||||
ButtonState = 0;
|
||||
WheelMove[0] = 0;
|
||||
WheelMove[1] = 0;
|
||||
|
|
Loading…
Reference in a new issue