diff options
Diffstat (limited to 'src/core/hid/emulated_controller.cpp')
| -rw-r--r-- | src/core/hid/emulated_controller.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/core/hid/emulated_controller.cpp b/src/core/hid/emulated_controller.cpp index 7bab00bb1..2db2b4da0 100644 --- a/src/core/hid/emulated_controller.cpp +++ b/src/core/hid/emulated_controller.cpp | |||
| @@ -644,6 +644,7 @@ void EmulatedController::SetMotion(Common::Input::CallbackStatus callback, std:: | |||
| 644 | }); | 644 | }); |
| 645 | emulated.UpdateRotation(raw_status.delta_timestamp); | 645 | emulated.UpdateRotation(raw_status.delta_timestamp); |
| 646 | emulated.UpdateOrientation(raw_status.delta_timestamp); | 646 | emulated.UpdateOrientation(raw_status.delta_timestamp); |
| 647 | force_update_motion = raw_status.force_update; | ||
| 647 | 648 | ||
| 648 | if (is_configuring) { | 649 | if (is_configuring) { |
| 649 | TriggerOnChange(ControllerTriggerType::Motion, false); | 650 | TriggerOnChange(ControllerTriggerType::Motion, false); |
| @@ -653,7 +654,7 @@ void EmulatedController::SetMotion(Common::Input::CallbackStatus callback, std:: | |||
| 653 | auto& motion = controller.motion_state[index]; | 654 | auto& motion = controller.motion_state[index]; |
| 654 | motion.accel = emulated.GetAcceleration(); | 655 | motion.accel = emulated.GetAcceleration(); |
| 655 | motion.gyro = emulated.GetGyroscope(); | 656 | motion.gyro = emulated.GetGyroscope(); |
| 656 | motion.rotation = emulated.GetGyroscope(); | 657 | motion.rotation = emulated.GetRotations(); |
| 657 | motion.orientation = emulated.GetOrientation(); | 658 | motion.orientation = emulated.GetOrientation(); |
| 658 | motion.is_at_rest = emulated.IsMoving(motion_sensitivity); | 659 | motion.is_at_rest = emulated.IsMoving(motion_sensitivity); |
| 659 | 660 | ||
| @@ -962,6 +963,14 @@ NpadGcTriggerState EmulatedController::GetTriggers() const { | |||
| 962 | } | 963 | } |
| 963 | 964 | ||
| 964 | MotionState EmulatedController::GetMotions() const { | 965 | MotionState EmulatedController::GetMotions() const { |
| 966 | if (force_update_motion) { | ||
| 967 | for (auto& device : motion_devices) { | ||
| 968 | if (!device) { | ||
| 969 | continue; | ||
| 970 | } | ||
| 971 | device->ForceUpdate(); | ||
| 972 | } | ||
| 973 | } | ||
| 965 | return controller.motion_state; | 974 | return controller.motion_state; |
| 966 | } | 975 | } |
| 967 | 976 | ||