| 297 | } |
| 298 | |
| 299 | void XInputController::setJoystickY(XInputControl joy, int32_t y, boolean invert) { |
| 300 | const XInputMap_Joystick * joyData = getJoyFromEnum(joy); |
| 301 | if (joyData == nullptr) return; // Not a joystick |
| 302 | |
| 303 | y = rescaleInput(y, *getRangeFromEnum(joy), XInputMap_Joystick::range); |
| 304 | if (invert) y = invertInput(y, XInputMap_Joystick::range); |
| 305 | |
| 306 | if (getJoystickY(joy) == y) return; // Axis hasn't changed |
| 307 | |
| 308 | tx[joyData->y_low] = lowByte(y); |
| 309 | tx[joyData->y_high] = highByte(y); |
| 310 | |
| 311 | newData = true; |
| 312 | autosend(); |
| 313 | } |
| 314 | |
| 315 | void XInputController::setJoystick(XInputControl joy, boolean up, boolean down, boolean left, boolean right, boolean useSOCD) { |
| 316 | const XInputMap_Joystick * joyData = getJoyFromEnum(joy); |
nothing calls this directly
no test coverage detected