mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
Tweak the deadzone code to work better with pre-amp.
Everthing was fine with pre-amp == 1, but if it was anything else, the offset would become invalid.
This commit is contained in:
parent
f5e1983e0f
commit
173af3a992
1 changed files with 5 additions and 7 deletions
|
@ -140,13 +140,11 @@ JOY_Move (void)
|
|||
|
||||
for (i = 0; i < JOY_MAX_AXES; i++) {
|
||||
ja = &joy_axes[i];
|
||||
if (abs (ja->offset) + abs (ja->current) <
|
||||
abs (ja->offset) + abs (ja->deadzone))
|
||||
ja->current = -ja->offset;
|
||||
|
||||
value =
|
||||
amp * ja->amp * (ja->offset +
|
||||
ja->current * pre * ja->pre_amp) / 100.0f;
|
||||
value = ja->current * pre * ja->pre_amp;
|
||||
if (fabs (value) < ja->deadzone)
|
||||
value = -ja->offset;
|
||||
value += ja->offset;
|
||||
value *= amp * ja->amp / 100.0f;
|
||||
switch (ja->dest) {
|
||||
case js_none:
|
||||
// ignore axis
|
||||
|
|
Loading…
Reference in a new issue