]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Flip turn left and turn right inputs on v_flipped 1
authorT <>
Mon, 24 Mar 2025 21:45:49 +0000 (22:45 +0100)
committerT <>
Mon, 24 Mar 2025 21:45:49 +0000 (22:45 +0100)
cl_input.c

index eb3118b0caf213e9c72437ba613ab77c8b8fb4b1..da79dde698110c4feb0924cf565743ffed994621 100644 (file)
@@ -121,6 +121,8 @@ static void KeyUp (cmd_state_t *cmd, kbutton_t *b)
        b->state |= 4;          // impulse up
 }
 
+extern cvar_t v_flipped;
+
 static void IN_KLookDown(cmd_state_t *cmd) {KeyDown(cmd, &in_klook);}
 static void IN_KLookUp(cmd_state_t *cmd) {KeyUp(cmd, &in_klook);}
 static void IN_MLookDown(cmd_state_t *cmd) {KeyDown(cmd, &in_mlook);}
@@ -134,10 +136,22 @@ static void IN_UpDown(cmd_state_t *cmd) {KeyDown(cmd, &in_up);}
 static void IN_UpUp(cmd_state_t *cmd) {KeyUp(cmd, &in_up);}
 static void IN_DownDown(cmd_state_t *cmd) {KeyDown(cmd, &in_down);}
 static void IN_DownUp(cmd_state_t *cmd) {KeyUp(cmd, &in_down);}
-static void IN_LeftDown(cmd_state_t *cmd) {KeyDown(cmd, &in_left);}
-static void IN_LeftUp(cmd_state_t *cmd) {KeyUp(cmd, &in_left);}
-static void IN_RightDown(cmd_state_t *cmd) {KeyDown(cmd, &in_right);}
-static void IN_RightUp(cmd_state_t *cmd) {KeyUp(cmd, &in_right);}
+static void IN_LeftDown(cmd_state_t *cmd)
+{
+       KeyDown(cmd, v_flipped.integer ? &in_right : &in_left);
+}
+static void IN_LeftUp(cmd_state_t *cmd)
+{
+       KeyUp(cmd, v_flipped.integer ? &in_right : &in_left);
+}
+static void IN_RightDown(cmd_state_t *cmd)
+{
+       KeyDown(cmd, v_flipped.integer ? &in_left : &in_right);
+}
+static void IN_RightUp(cmd_state_t *cmd)
+{
+       KeyUp(cmd, v_flipped.integer ? &in_left : &in_right);
+}
 static void IN_ForwardDown(cmd_state_t *cmd) {KeyDown(cmd, &in_forward);}
 static void IN_ForwardUp(cmd_state_t *cmd) {KeyUp(cmd, &in_forward);}
 static void IN_BackDown(cmd_state_t *cmd) {KeyDown(cmd, &in_back);}
@@ -419,8 +433,6 @@ cvar_t cl_nodelta = {CF_CLIENT, "cl_nodelta", "0", "disables delta compression o
 
 cvar_t cl_csqc_generatemousemoveevents = {CF_CLIENT, "cl_csqc_generatemousemoveevents", "1", "enables calls to CSQC_InputEvent with type 2, for compliance with EXT_CSQC spec"};
 
-extern cvar_t v_flipped;
-
 /*
 ================
 CL_AdjustAngles