From 8278ef3103b5fe7a6be4d9cab0190092b7c70c16 Mon Sep 17 00:00:00 2001 From: Taylor Richards Date: Sat, 16 Nov 2013 13:17:22 -0500 Subject: [PATCH] remove calibration checks - assume SDL will handle it --- src/io/joy.cpp | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/src/io/joy.cpp b/src/io/joy.cpp index e76f945..3600b6f 100644 --- a/src/io/joy.cpp +++ b/src/io/joy.cpp @@ -239,13 +239,6 @@ int joy_get_unscaled_reading(int axn) return 0; } - // Make sure it's calibrated properly. - if (joystick.axis_center[axn] - joystick.axis_min[axn] < 5) - return 0; - - if (joystick.axis_max[axn] - joystick.axis_center[axn] < 5) - return 0; - int raw = joystick.axis_current[axn]; rng = joystick.axis_max[axn] - joystick.axis_min[axn]; @@ -283,15 +276,6 @@ int joy_get_scaled_reading(int axn) return 0; } - // Make sure it's calibrated properly. - if (joystick.axis_center[axn] - joystick.axis_min[axn] < 5) { - return 0; - } - - if (joystick.axis_max[axn] - joystick.axis_center[axn] < 5) { - return 0; - } - raw = joystick.axis_current[axn] - joystick.axis_center[axn]; dead_zone = (joystick.axis_max[axn] - joystick.axis_min[axn]) * Dead_zone_size / 100; @@ -443,11 +427,11 @@ void joy_set_cen() } for (int i = 0; i < JOY_NUM_AXES; i++) { - // if (i < joystick.num_axes) { - // joystick.axis_center[i] = SDL_JoystickGetAxis(sdljoy, i) + 32768; - // } else { + if (i < joystick.num_axes) { + joystick.axis_center[i] = SDL_JoystickGetAxis(sdljoy, i) + 32768; + } else { joystick.axis_center[i] = 32768; - // } + } } } -- 2.39.2