[input] Correct balanced range calculation

Fixes axis inputs being half what they should be. Can't quite get +1,
though (need to figure something out for the positive axis range being
slightly smaller than the negative range).
This commit is contained in:
Bill Currie 2021-12-22 23:43:03 +09:00
parent 3ffdaccd50
commit dad19aa2ad

View file

@ -588,8 +588,8 @@ IMT_ProcessAxis (int axis, int value)
if (recipe->deadzone >= 0) {
// balanced axis: -1..1
int center = (recipe->min + recipe->max + 1) / 2;
minval += deadzone - center;
maxval -= deadzone + center;
minval += deadzone;
maxval -= deadzone;
input -= center;
if (input < -deadzone) {
input += deadzone;