0
0
Fork 0
mirror of https://github.com/ZDoom/Raze.git synced 2025-04-02 22:10:48 +00:00

- 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 20:01:21 +10:00
parent 12c50b4af0
commit d454455d22
2 changed files with 5 additions and 4 deletions
source
common/engine
core

View file

@ -50,6 +50,8 @@ event_t events[MAXEVENTS];
CVAR(Float, m_sensitivity_x, 4.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;

View file

@ -37,8 +37,6 @@ CVAR(Float, m_pitch, 1.f, CVAR_GLOBALCONFIG | CVAR_ARCHIVE)
CVAR(Float, m_yaw, 1.f, CVAR_GLOBALCONFIG | CVAR_ARCHIVE)
CVAR(Float, m_forward, 1.f, CVAR_GLOBALCONFIG | CVAR_ARCHIVE)
CVAR(Float, m_side, 1.f, CVAR_GLOBALCONFIG | CVAR_ARCHIVE)
CVARD(Bool, invertmousex, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG, "invert horizontal mouse movement")
CVARD(Bool, invertmouse, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG, "invert vertical mouse movement")
//---------------------------------------------------------------------------
@ -230,8 +228,6 @@ void GameInput::processVehicle(PlayerAngles* const plrAngles, const float scaleA
void GameInput::prepareHidInput()
{
I_GetAxes(joyAxes);
if (invertmousex) mouseInput.X = -mouseInput.X;
if (invertmouse) mouseInput.Y = -mouseInput.Y;
}
void GameInput::resetHidInput()