From 595be623a0e138c17eb9bbb89859bfdbf44de1c1 Mon Sep 17 00:00:00 2001 From: IvanDSM Date: Mon, 11 May 2020 01:51:17 -0300 Subject: [PATCH] Fix analogue camera axis inversion, mouse now obeys inversion. --- src/game/bettercamera.inc.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/game/bettercamera.inc.h b/src/game/bettercamera.inc.h index 8ad4cef7..5b68ebc3 100644 --- a/src/game/bettercamera.inc.h +++ b/src/game/bettercamera.inc.h @@ -232,7 +232,7 @@ static s16 newcam_approach_s16(s16 var, s16 val, s16 inc) return min(var - inc, val); } -static u8 ivrt(u8 axis) +static int ivrt(u8 axis) { if (axis == 0) { @@ -378,8 +378,8 @@ static void newcam_rotate_button(void) if (newcam_mouse == 1) { - newcam_yaw += mouse_x * 16; - newcam_tilt += mouse_y * 16; + newcam_yaw += ivrt(0) * mouse_x * 16; + newcam_tilt += ivrt(1) * mouse_y * 16; } }