From 0be892ba0d93a5856dd114e4c5edd38fad8863bf Mon Sep 17 00:00:00 2001 From: Sryder Date: Sat, 9 Jan 2021 12:09:00 +0000 Subject: [PATCH] Turn the aim axis into a digital one, as we only use it for throwing items and the vote screen Turn axis still has the same deadzone handling as before, meaning it gradients away from the deadzone properly. --- src/g_game.c | 7 ++++++- src/g_game.h | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index b0fcf7bf3..7919ffad0 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -925,9 +925,14 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer) turnleft = PlayerInputDown(ssplayer, gc_turnleft); joystickvector.xaxis = PlayerJoyAxis(ssplayer, AXISTURN); - joystickvector.yaxis = PlayerJoyAxis(ssplayer, AXISAIM); G_HandleAxisDeadZone(forplayer, &joystickvector); + // For kart, I've turned the aim axis into a digital axis because we only + // use it for aiming to throw items forward/backward and the vote screen + // This mean that the turn axis will still be gradient but up/down will be 0 + // until the stick is pushed far enough + joystickvector.yaxis = PlayerJoyAxis(ssplayer, AXISAIM); + if (encoremode) { turnright ^= turnleft; // swap these using three XORs diff --git a/src/g_game.h b/src/g_game.h index 78812a72c..89156b82f 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -102,7 +102,6 @@ typedef enum AXISTURN, AXISMOVE, AXISBRAKE, - AXISAIM, AXISLOOK, AXISDIGITAL, // axes below this use digital deadzone @@ -110,6 +109,7 @@ typedef enum AXISFIRE = AXISDIGITAL, AXISDRIFT, AXISLOOKBACK, + AXISAIM, } axis_input_e; INT32 PlayerJoyAxis(UINT8 player, axis_input_e axissel);