- Move invertmouse CVARs into common code.

* Removes duplication of CVAR definitions between Raze and GZDoom.
This commit is contained in:
Mitchell Richters 2023-04-04 19:59:09 +10:00 committed by nashmuhandes
commit 534a7f8246
3 changed files with 5 additions and 7 deletions

View file

@ -50,6 +50,8 @@ event_t events[MAXEVENTS];
CVAR(Float, m_sensitivity_x, 2.f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
CVAR(Float, m_sensitivity_y, 2.f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
CVAR(Bool, invertmouse, false, CVAR_GLOBALCONFIG | CVAR_ARCHIVE); // Invert mouse look down/up?
CVAR(Bool, invertmousex, false, CVAR_GLOBALCONFIG | CVAR_ARCHIVE); // Invert mouse look left/right?
//==========================================================================
@ -171,6 +173,9 @@ void PostMouseMove(int xx, int yy)
ev.x = float(xx) * m_sensitivity_x;
ev.y = -float(yy) * m_sensitivity_y;
if (invertmousex) ev.x = -ev.x;
if (invertmouse) ev.y = -ev.y;
if (ev.x || ev.y)
{
ev.type = EV_Mouse;