diff options
| author | MaranBr <maranbr@outlook.com> | 2026-09-26 02:21:45 +0200 |
|---|---|---|
| committer | crueter <crueter@eden-emu.dev> | 2026-09-26 02:21:45 +0200 |
| commit | 87d2f03c39bc441055d593a7913f63a017795359 (patch) | |
| tree | edcbfebed063374771f23535137677cc43883db9 /src/hid_core | |
| parent | bebc19da3253f13ceb5abfe8560cdbdc32ea7d8a (diff) | |
[hid_core] Code cleanup (#4461)
- [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions).
- [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md)
- [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability.
-------------------
This is just a code cleanup. This is no longer necessary due to commit #4457.
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4461
Reviewed-by: lizzie <lizzie@eden-emu.dev>
Diffstat (limited to 'src/hid_core')
| -rw-r--r-- | src/hid_core/frontend/emulated_controller.cpp | 22 | ||||
| -rw-r--r-- | src/hid_core/frontend/emulated_controller.h | 2 |
2 files changed, 4 insertions, 20 deletions
diff --git a/src/hid_core/frontend/emulated_controller.cpp b/src/hid_core/frontend/emulated_controller.cpp index 1092970ee8..7b4af13232 100644 --- a/src/hid_core/frontend/emulated_controller.cpp +++ b/src/hid_core/frontend/emulated_controller.cpp @@ -761,9 +761,6 @@ void EmulatedController::StartMotionCalibration() { } void EmulatedController::SetButton(const Common::Input::CallbackStatus& callback, std::size_t index, Common::UUID uuid) { - const auto player_index = Service::HID::NpadIdTypeToIndex(npad_id_type); - const auto& player = Settings::values.players.GetValue()[player_index]; - if (index >= controller.button_values.size()) { return; } @@ -916,21 +913,10 @@ void EmulatedController::SetButton(const Common::Input::CallbackStatus& callback break; } - if (!is_connected) { - if (npad_type == NpadStyleIndex::Handheld) { - if (npad_id_type == NpadIdType::Handheld) { - Connect(); - controller_connected[player_index] = true; - } - } else if (npad_type != NpadStyleIndex::Handheld) { - if (npad_id_type == NpadIdType::Player1) { - Connect(); - controller_connected[player_index] = true; - } else if (player.connected && !controller_connected[player_index]) { - Connect(); - controller_connected[player_index] = true; - } - } + const auto player_index = Service::HID::NpadIdTypeToIndex(npad_id_type); + const auto& player = Settings::values.players.GetValue()[player_index]; + if (player.connected) { + Connect(); } TriggerOnChange(ControllerTriggerType::Button, true); diff --git a/src/hid_core/frontend/emulated_controller.h b/src/hid_core/frontend/emulated_controller.h index 7a2291b8a4..80ea633c63 100644 --- a/src/hid_core/frontend/emulated_controller.h +++ b/src/hid_core/frontend/emulated_controller.h @@ -22,7 +22,6 @@ #include "common/settings.h" #include "common/vector_math.h" #include "hid_core/frontend/motion_input.h" -#include "hid_core/hid_core.h" #include "hid_core/hid_types.h" #include "hid_core/irsensor/irs_types.h" @@ -585,7 +584,6 @@ private: std::array<VibrationValue, 2> last_vibration_value{DEFAULT_VIBRATION_VALUE, DEFAULT_VIBRATION_VALUE}; std::array<std::chrono::steady_clock::time_point, 2> last_vibration_timepoint{}; - std::array<bool, HIDCore::available_controllers> controller_connected{}; // Atomically synched values std::atomic<HID::NpadStyleIndex> npad_type{HID::NpadStyleIndex::None}; |
