diff options
| author | iwubcode <iwubcode@users.noreply.github.com> | 2020-05-17 14:30:11 -0500 |
|---|---|---|
| committer | iwubcode <iwubcode@users.noreply.github.com> | 2021-03-17 20:58:33 -0500 |
| commit | 80559199059bd010a2bc6ad976b400921e6754ab (patch) | |
| tree | 08a82202738fbb5d8c4b7e0b5cd2a5070af270f6 /Source/Core/InputCommon/ControllerEmu/ControlGroup | |
| parent | db4b4e40cb5c9d00940cdb76478b632804cdf244 (diff) | |
InputCommon: Allow for partial gyro mapping; for Free Look, this allows you to only pitch or only yaw
Diffstat (limited to 'Source/Core/InputCommon/ControllerEmu/ControlGroup')
| -rw-r--r-- | Source/Core/InputCommon/ControllerEmu/ControlGroup/IMUGyroscope.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
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 <algorithm> #include <memory> #include "Common/Common.h" @@ -124,7 +125,8 @@ auto IMUGyroscope::GetRawState() const -> StateData std::optional<IMUGyroscope::StateData> 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 = {}; |
