From 572459bc253c05207509d1c77bd1afc09af90e0a Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Mon, 22 Sep 2025 14:45:53 -0500 Subject: WiimoteEmu: Require IRPassthrough has any bound inputs to operate. Users get confused and mistakenly enable it. --- .../InputCommon/ControllerEmu/ControlGroup/IRPassthrough.cpp | 11 +++++++---- .../InputCommon/ControllerEmu/ControlGroup/IRPassthrough.h | 3 ++- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'Source/Core/InputCommon/ControllerEmu') diff --git a/Source/Core/InputCommon/ControllerEmu/ControlGroup/IRPassthrough.cpp b/Source/Core/InputCommon/ControllerEmu/ControlGroup/IRPassthrough.cpp index 119f9bcb0e..14b4151615 100644 --- a/Source/Core/InputCommon/ControllerEmu/ControlGroup/IRPassthrough.cpp +++ b/Source/Core/InputCommon/ControllerEmu/ControlGroup/IRPassthrough.cpp @@ -3,15 +3,12 @@ #include "InputCommon/ControllerEmu/ControlGroup/IRPassthrough.h" -#include +#include #include #include "Common/Common.h" -#include "Common/MathUtil.h" -#include "InputCommon/ControlReference/ControlReference.h" #include "InputCommon/ControllerEmu/Control/Control.h" -#include "InputCommon/ControllerEmu/Control/Input.h" namespace ControllerEmu { @@ -48,4 +45,10 @@ ControlState IRPassthrough::GetObjectSize(size_t object_index) const return controls[object_index * 3 + 2]->GetState(); } +bool IRPassthrough::AreInputsBound() const +{ + return std::ranges::any_of( + controls, [](const auto& control) { return control->control_ref->BoundCount() > 0; }); +} + } // namespace ControllerEmu diff --git a/Source/Core/InputCommon/ControllerEmu/ControlGroup/IRPassthrough.h b/Source/Core/InputCommon/ControllerEmu/ControlGroup/IRPassthrough.h index 9e6bf9b5bb..b66fb014c1 100644 --- a/Source/Core/InputCommon/ControllerEmu/ControlGroup/IRPassthrough.h +++ b/Source/Core/InputCommon/ControllerEmu/ControlGroup/IRPassthrough.h @@ -6,7 +6,6 @@ #include #include "InputCommon/ControllerEmu/ControlGroup/ControlGroup.h" -#include "InputCommon/ControllerEmu/Setting/NumericSetting.h" #include "InputCommon/ControllerInterface/CoreDevice.h" namespace ControllerEmu @@ -19,5 +18,7 @@ public: ControlState GetObjectPositionX(size_t object_index) const; ControlState GetObjectPositionY(size_t object_index) const; ControlState GetObjectSize(size_t object_index) const; + + bool AreInputsBound() const; }; } // namespace ControllerEmu -- cgit v1.2.3