From 80559199059bd010a2bc6ad976b400921e6754ab Mon Sep 17 00:00:00 2001 From: iwubcode Date: Sun, 17 May 2020 14:30:11 -0500 Subject: [PATCH] InputCommon: Allow for partial gyro mapping; for Free Look, this allows you to only pitch or only yaw --- .../InputCommon/ControllerEmu/ControlGroup/IMUGyroscope.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/Core/InputCommon/ControllerEmu/ControlGroup/IMUGyroscope.cpp b/Source/Core/InputCommon/ControllerEmu/ControlGroup/IMUGyroscope.cpp index ef0e10d168..b5408cfe34 100644 --- a/Source/Core/InputCommon/ControllerEmu/ControlGroup/IMUGyroscope.cpp +++ b/Source/Core/InputCommon/ControllerEmu/ControlGroup/IMUGyroscope.cpp @@ -4,6 +4,7 @@ #include "InputCommon/ControllerEmu/ControlGroup/IMUGyroscope.h" +#include #include #include "Common/Common.h" @@ -124,7 +125,8 @@ auto IMUGyroscope::GetRawState() const -> StateData std::optional IMUGyroscope::GetState() const { - if (controls[0]->control_ref->BoundCount() == 0) + if (std::all_of(controls.begin(), controls.end(), + [](const auto& control) { return control->control_ref->BoundCount() == 0; })) { // Set calibration to zero. m_calibration = {};