mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-04-03 08:51:08 +00:00
Apply expo to gamepad axes with joy_expo cvar
Expo makes gamepad stick input non-linear such that small movements on the stick are less pronounced. This enables both precise and fast movements, even at higher sensitivity levels. Expo is applied to all axes equally.
This commit is contained in:
parent
bab977fa74
commit
aafc2eb4f9
1 changed files with 5 additions and 0 deletions
|
@ -128,6 +128,7 @@ static cvar_t *joy_pitchsensitivity;
|
|||
static cvar_t *joy_forwardsensitivity;
|
||||
static cvar_t *joy_sidesensitivity;
|
||||
static cvar_t *joy_upsensitivity;
|
||||
static cvar_t *joy_expo;
|
||||
|
||||
// Joystick direction settings
|
||||
static cvar_t *joy_axis_leftx;
|
||||
|
@ -681,6 +682,9 @@ IN_Update(void)
|
|||
fix_value = 0.0f;
|
||||
}
|
||||
|
||||
// Apply expo
|
||||
fix_value = pow(fix_value, joy_expo->value);
|
||||
|
||||
axis_value = (int) (32767 * ((axis_value < 0) ? -fix_value : fix_value));
|
||||
|
||||
if (cls.key_dest == key_game && (int) cl_paused->value == 0)
|
||||
|
@ -1348,6 +1352,7 @@ IN_Init(void)
|
|||
joy_forwardsensitivity = Cvar_Get("joy_forwardsensitivity", "1.0", CVAR_ARCHIVE);
|
||||
joy_sidesensitivity = Cvar_Get("joy_sidesensitivity", "1.0", CVAR_ARCHIVE);
|
||||
joy_upsensitivity = Cvar_Get("joy_upsensitivity", "1.0", CVAR_ARCHIVE);
|
||||
joy_expo = Cvar_Get("joy_expo", "2.0", CVAR_ARCHIVE);
|
||||
|
||||
joy_axis_leftx = Cvar_Get("joy_axis_leftx", "sidemove", CVAR_ARCHIVE);
|
||||
joy_axis_lefty = Cvar_Get("joy_axis_lefty", "forwardmove", CVAR_ARCHIVE);
|
||||
|
|
Loading…
Reference in a new issue