mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2024-11-10 07:21:58 +00:00
tweak joystick a bit
This commit is contained in:
parent
8f252a7ff7
commit
bd06857a5e
1 changed files with 12 additions and 5 deletions
|
@ -132,10 +132,10 @@ static dualAxis_t _rawDualAxis = {0};
|
|||
static int total_dx, total_dy = 0;
|
||||
|
||||
/* joystick variables */
|
||||
cvar_t joy_sensitivity = { "joy_sensitivity", "32", CVAR_NONE };
|
||||
cvar_t joy_sensitivity = { "joy_sensitivity", "10", CVAR_NONE };
|
||||
cvar_t joy_filter = { "joy_filter", "1", CVAR_NONE };
|
||||
cvar_t joy_deadzone = { "joy_deadzone", "0.125", CVAR_NONE };
|
||||
cvar_t joy_function = { "joy_function", "0", CVAR_NONE };
|
||||
cvar_t joy_function = { "joy_function", "2", CVAR_NONE };
|
||||
cvar_t joy_axismove_x = { "joy_axismove_x", "0", CVAR_NONE };
|
||||
cvar_t joy_axismove_y = { "joy_axismove_y", "1", CVAR_NONE };
|
||||
cvar_t joy_axislook_x = { "joy_axislook_x", "3", CVAR_NONE };
|
||||
|
@ -509,6 +509,9 @@ void IN_JoyAxisMove(Uint8 axis, Sint16 value)
|
|||
|
||||
if ( axis == 2)
|
||||
Key_Event(K_CTRL, value >= 0);
|
||||
|
||||
if ( axis == 5)
|
||||
Key_Event(K_SPACE, value >= 0);
|
||||
}
|
||||
|
||||
void IN_Move (usercmd_t *cmd)
|
||||
|
@ -532,6 +535,10 @@ void IN_Move (usercmd_t *cmd)
|
|||
_rawDualAxis._oldleft = _rawDualAxis.left;
|
||||
_rawDualAxis._oldright = _rawDualAxis.right;
|
||||
|
||||
// scale look speed before easing
|
||||
moveDualAxis.right.x *= joy_sensitivity.value;
|
||||
moveDualAxis.right.y *= joy_sensitivity.value;
|
||||
|
||||
switch ( (int)joy_function.value ) {
|
||||
default:
|
||||
case 0: break;
|
||||
|
@ -567,8 +574,8 @@ void IN_Move (usercmd_t *cmd)
|
|||
}
|
||||
|
||||
// add the joy look axis to mouse look
|
||||
total_dx += moveDualAxis.right.x * joy_sensitivity.value;
|
||||
total_dy += moveDualAxis.right.y * joy_sensitivity.value;
|
||||
total_dx += moveDualAxis.right.x;
|
||||
total_dy += moveDualAxis.right.y;
|
||||
//
|
||||
// jeremiah sypult -- ENDjoystick
|
||||
|
||||
|
|
Loading…
Reference in a new issue