summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerEmu/ControlGroup
diff options
context:
space:
mode:
authoriwubcode <iwubcode@users.noreply.github.com>2020-05-17 14:30:11 -0500
committeriwubcode <iwubcode@users.noreply.github.com>2021-03-17 20:58:33 -0500
commit80559199059bd010a2bc6ad976b400921e6754ab (patch)
tree08a82202738fbb5d8c4b7e0b5cd2a5070af270f6 /Source/Core/InputCommon/ControllerEmu/ControlGroup
parentdb4b4e40cb5c9d00940cdb76478b632804cdf244 (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.cpp4
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 = {};