| 62 | bool leftStickNeedsScaling, rightStickNeedsScaling; |
| 63 | |
| 64 | void ScaleJoysticks() |
| 65 | { |
| 66 | constexpr float rightDeadzone = 0.07; |
| 67 | constexpr float leftDeadzone = 0.07; |
| 68 | |
| 69 | if (leftStickNeedsScaling) { |
| 70 | leftStickX = leftStickXUnscaled; |
| 71 | leftStickY = leftStickYUnscaled; |
| 72 | ScaleJoystickAxes(&leftStickX, &leftStickY, leftDeadzone); |
| 73 | leftStickNeedsScaling = false; |
| 74 | } |
| 75 | |
| 76 | if (rightStickNeedsScaling) { |
| 77 | rightStickX = rightStickXUnscaled; |
| 78 | rightStickY = rightStickYUnscaled; |
| 79 | ScaleJoystickAxes(&rightStickX, &rightStickY, rightDeadzone); |
| 80 | rightStickNeedsScaling = false; |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | // Updates motion state for mouse and joystick sticks. |
| 85 | bool ProcessControllerMotion(const SDL_Event &event) |
no test coverage detected