mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-22 20:41:20 +00:00
More tweaks to joystick code. amp settings have a far greater effect now...
This commit is contained in:
parent
3cfd2c0a8e
commit
29b48c594e
1 changed files with 22 additions and 42 deletions
|
@ -86,8 +86,8 @@ JOY_Move (void)
|
||||||
if (!joy_active || !joy_enable->int_val)
|
if (!joy_active || !joy_enable->int_val)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
mult_joy = 1 / (201 - (4 * joy_amp->value * joy_pre_amp->value *
|
mult_joy = (joy_amp->value * joy_pre_amp->value *
|
||||||
in_amp->value * in_pre_amp->value));
|
in_amp->value * in_pre_amp->value) / 200.0;
|
||||||
// Yes, mult_joy looks like a mess, but use of pre_amp values is useful in
|
// Yes, mult_joy looks like a mess, but use of pre_amp values is useful in
|
||||||
// scripts, and *_pre_amp will matter once joystick filtering/acceleration
|
// scripts, and *_pre_amp will matter once joystick filtering/acceleration
|
||||||
// is implemented
|
// is implemented
|
||||||
|
@ -95,64 +95,44 @@ JOY_Move (void)
|
||||||
for (i = 0; i < JOY_MAX_AXES; i++) {
|
for (i = 0; i < JOY_MAX_AXES; i++) {
|
||||||
switch (joy_axes[i].axis->int_val) {
|
switch (joy_axes[i].axis->int_val) {
|
||||||
case 1:
|
case 1:
|
||||||
if (joy_axes[i].current) {
|
if (joy_axes[i].current)
|
||||||
viewdelta.angles[YAW] -=
|
viewdelta.angles[YAW] -= joy_axes[i].current * mult_joy;
|
||||||
(float) (joy_axes[i].current * mult_joy);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case -1:
|
case -1:
|
||||||
if (joy_axes[i].current) {
|
if (joy_axes[i].current)
|
||||||
viewdelta.angles[YAW] +=
|
viewdelta.angles[YAW] += joy_axes[i].current * mult_joy;
|
||||||
(float) (joy_axes[i].current * mult_joy);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
if (joy_axes[i].current) {
|
if (joy_axes[i].current)
|
||||||
viewdelta.position[2] -=
|
viewdelta.position[2] -= joy_axes[i].current * mult_joy;
|
||||||
(float) (joy_axes[i].current * mult_joy);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case -2:
|
case -2:
|
||||||
if (joy_axes[i].current) {
|
if (joy_axes[i].current)
|
||||||
viewdelta.position[2] +=
|
viewdelta.position[2] += joy_axes[i].current * mult_joy;
|
||||||
(float) (joy_axes[i].current * mult_joy);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
if (joy_axes[i].current) {
|
if (joy_axes[i].current)
|
||||||
viewdelta.position[0] +=
|
viewdelta.position[0] += joy_axes[i].current * mult_joy;
|
||||||
(float) (joy_axes[i].current * mult_joy);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case -3:
|
case -3:
|
||||||
if (joy_axes[i].current) {
|
if (joy_axes[i].current)
|
||||||
viewdelta.position[0] -=
|
viewdelta.position[0] -= joy_axes[i].current * mult_joy;
|
||||||
(float) (joy_axes[i].current * mult_joy);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
if (joy_axes[i].current) {
|
if (joy_axes[i].current)
|
||||||
viewdelta.angles[PITCH] -=
|
viewdelta.angles[PITCH] -= joy_axes[i].current * mult_joy;
|
||||||
(float) (joy_axes[i].current * mult_joy);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case -4:
|
case -4:
|
||||||
if (joy_axes[i].current) {
|
if (joy_axes[i].current)
|
||||||
viewdelta.angles[PITCH] +=
|
viewdelta.angles[PITCH] += joy_axes[i].current * mult_joy;
|
||||||
(float) (joy_axes[i].current * mult_joy);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
if (joy_axes[i].current) {
|
if (joy_axes[i].current)
|
||||||
viewdelta.position[1] -=
|
viewdelta.position[1] -= joy_axes[i].current * mult_joy;
|
||||||
(float) (joy_axes[i].current * mult_joy);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case -5:
|
case -5:
|
||||||
if (joy_axes[i].current) {
|
if (joy_axes[i].current)
|
||||||
viewdelta.position[1] +=
|
viewdelta.position[1] += joy_axes[i].current * mult_joy;
|
||||||
(float) (joy_axes[i].current * mult_joy);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue