Skip to content

Commit

Permalink
invert mouse again for movement, so that it cancels out the first inv…
Browse files Browse the repository at this point in the history
…ersion
  • Loading branch information
RicardoLuis0 authored and madame-rachelle committed Nov 18, 2023
1 parent a6ff639 commit 11f2fc1
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions src/g_game.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 11f2fc1

Please sign in to comment.