mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
Merge pull request #13500 from jordan-woyak/accel-gyro-any-mapping
InputCommon: Activate IMU Accelerometer and Gyroscope mappings when any direction has a bound input.
This commit is contained in:
@ -4,7 +4,6 @@
|
|||||||
#include "InputCommon/ControllerEmu/ControlGroup/IMUAccelerometer.h"
|
#include "InputCommon/ControllerEmu/ControlGroup/IMUAccelerometer.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <memory>
|
|
||||||
|
|
||||||
#include "Common/Common.h"
|
#include "Common/Common.h"
|
||||||
#include "Core/HW/WiimoteEmu/WiimoteEmu.h"
|
#include "Core/HW/WiimoteEmu/WiimoteEmu.h"
|
||||||
@ -25,7 +24,7 @@ IMUAccelerometer::IMUAccelerometer(std::string name_, std::string ui_name_)
|
|||||||
|
|
||||||
bool IMUAccelerometer::AreInputsBound() const
|
bool IMUAccelerometer::AreInputsBound() const
|
||||||
{
|
{
|
||||||
return std::ranges::all_of(
|
return std::ranges::any_of(
|
||||||
controls, [](const auto& control) { return control->control_ref->BoundCount() > 0; });
|
controls, [](const auto& control) { return control->control_ref->BoundCount() > 0; });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
#include "InputCommon/ControllerEmu/ControlGroup/IMUGyroscope.h"
|
#include "InputCommon/ControllerEmu/ControlGroup/IMUGyroscope.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <memory>
|
|
||||||
|
|
||||||
#include "Common/Common.h"
|
#include "Common/Common.h"
|
||||||
#include "Common/MathUtil.h"
|
#include "Common/MathUtil.h"
|
||||||
@ -123,7 +122,7 @@ auto IMUGyroscope::GetRawState() const -> StateData
|
|||||||
|
|
||||||
bool IMUGyroscope::AreInputsBound() const
|
bool IMUGyroscope::AreInputsBound() const
|
||||||
{
|
{
|
||||||
return std::ranges::all_of(
|
return std::ranges::any_of(
|
||||||
controls, [](const auto& control) { return control->control_ref->BoundCount() > 0; });
|
controls, [](const auto& control) { return control->control_ref->BoundCount() > 0; });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user