| 281 | } |
| 282 | |
| 283 | void XInputController::setJoystickX(XInputControl joy, int32_t x, boolean invert) { |
| 284 | const XInputMap_Joystick * joyData = getJoyFromEnum(joy); |
| 285 | if (joyData == nullptr) return; // Not a joystick |
| 286 | |
| 287 | x = rescaleInput(x, *getRangeFromEnum(joy), XInputMap_Joystick::range); |
| 288 | if (invert) x = invertInput(x, XInputMap_Joystick::range); |
| 289 | |
| 290 | if (getJoystickX(joy) == x) return; // Axis hasn't changed |
| 291 | |
| 292 | tx[joyData->x_low] = lowByte(x); |
| 293 | tx[joyData->x_high] = highByte(x); |
| 294 | |
| 295 | newData = true; |
| 296 | autosend(); |
| 297 | } |
| 298 | |
| 299 | void XInputController::setJoystickY(XInputControl joy, int32_t y, boolean invert) { |
| 300 | const XInputMap_Joystick * joyData = getJoyFromEnum(joy); |
nothing calls this directly
no test coverage detected