mirror of
https://gitlab.com/Mr_Goldberg/goldberg_emulator.git
synced 2025-12-05 03:34:52 +01:00
Fixed issue where GetAnalogActionData magnitude of joystick was always maximum.
This commit is contained in:
parent
663728edca
commit
09704ae243
2 changed files with 11 additions and 0 deletions
|
|
@ -495,9 +495,16 @@ ControllerAnalogActionData_t GetAnalogActionData( ControllerHandle_t controllerH
|
|||
if (a >= 10) {
|
||||
int joystick_id = a - 10;
|
||||
GamepadStickNormXY((GAMEPAD_DEVICE)(controllerHandle - 1), (GAMEPAD_STICK) joystick_id, &data.x, &data.y);
|
||||
float length = GamepadStickLength((GAMEPAD_DEVICE)(controllerHandle - 1), (GAMEPAD_STICK) joystick_id);
|
||||
data.x = data.x * length;
|
||||
data.y = data.y * length;
|
||||
} else {
|
||||
data.x = GamepadTriggerLength((GAMEPAD_DEVICE)(controllerHandle - 1), (GAMEPAD_TRIGGER) a);
|
||||
}
|
||||
|
||||
if (data.x || data.y) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return data;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue