summaryrefslogtreecommitdiffstats
path: root/src/core/hid/emulated_controller.cpp
diff options
context:
space:
mode:
authorgerman77 <juangerman-13@hotmail.com>2021-11-02 02:49:14 +0100
committerNarr the Reg <juangerman-13@hotmail.com>2021-11-25 03:30:27 +0100
commit136eb9c4c2b2425c2dd45a79cf444dee7170714d (patch)
tree74a055a08126fdd33b2071baa08125177847db6e /src/core/hid/emulated_controller.cpp
parentsecond commit lion review (diff)
downloadyuzu-136eb9c4c2b2425c2dd45a79cf444dee7170714d.tar
yuzu-136eb9c4c2b2425c2dd45a79cf444dee7170714d.tar.gz
yuzu-136eb9c4c2b2425c2dd45a79cf444dee7170714d.tar.bz2
yuzu-136eb9c4c2b2425c2dd45a79cf444dee7170714d.tar.lz
yuzu-136eb9c4c2b2425c2dd45a79cf444dee7170714d.tar.xz
yuzu-136eb9c4c2b2425c2dd45a79cf444dee7170714d.tar.zst
yuzu-136eb9c4c2b2425c2dd45a79cf444dee7170714d.zip
Diffstat (limited to '')
-rw-r--r--src/core/hid/emulated_controller.cpp11
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::
});
emulated.UpdateRotation(raw_status.delta_timestamp);
emulated.UpdateOrientation(raw_status.delta_timestamp);
+ force_update_motion = raw_status.force_update;
if (is_configuring) {
TriggerOnChange(ControllerTriggerType::Motion, false);
@@ -653,7 +654,7 @@ void EmulatedController::SetMotion(Common::Input::CallbackStatus callback, std::
auto& motion = controller.motion_state[index];
motion.accel = emulated.GetAcceleration();
motion.gyro = emulated.GetGyroscope();
- motion.rotation = emulated.GetGyroscope();
+ motion.rotation = emulated.GetRotations();
motion.orientation = emulated.GetOrientation();
motion.is_at_rest = emulated.IsMoving(motion_sensitivity);
@@ -962,6 +963,14 @@ NpadGcTriggerState EmulatedController::GetTriggers() const {
}
MotionState EmulatedController::GetMotions() const {
+ if (force_update_motion) {
+ for (auto& device : motion_devices) {
+ if (!device) {
+ continue;
+ }
+ device->ForceUpdate();
+ }
+ }
return controller.motion_state;
}