From 1f4d289ef63cf76a9ff74c820ac15c7cf68814c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Lu=C3=ADs=20Vaz=20Silva?= Date: Sat, 18 Nov 2023 16:25:01 -0300 Subject: [PATCH] invert mouse again for movement, so that it cancels out the first inversion --- src/g_game.cpp | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/src/g_game.cpp b/src/g_game.cpp index 485980a488b..e8af5cf80e3 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -208,7 +208,10 @@ CVAR (Float, m_forward, 1.f, CVAR_GLOBALCONFIG|CVAR_ARCHIVE) CVAR (Float, m_side, 2.f, CVAR_GLOBALCONFIG|CVAR_ARCHIVE) int turnheld; // for accelerative turning - + +EXTERN_CVAR (Bool, invertmouse) +EXTERN_CVAR (Bool, invertmousex) + // mouse values are used once float mousex; float mousey; @@ -1035,9 +1038,23 @@ bool G_Responder (event_t *ev) break; // [RH] mouse buttons are sent as key up/down events - case EV_Mouse: - mousex = ev->x; - mousey = ev->y; + case EV_Mouse: + if(invertmousex) + { + mousex = -ev->x; + } + else + { + mousex = ev->x; + } + if(invertmouse) + { + mousey = -ev->y; + } + else + { + mousey = ev->y; + } break; }