diff options
author | Narr the Reg <juangerman-13@hotmail.com> | 2023-05-16 06:44:50 +0200 |
---|---|---|
committer | Narr the Reg <juangerman-13@hotmail.com> | 2023-05-17 02:37:22 +0200 |
commit | 5693434b8ad74a5c46155f1e60fa0d3f475aa153 (patch) | |
tree | bc0741cea6d9365b6d44aa2642f701511fb034f4 /src/input_common/drivers | |
parent | Merge pull request #10181 from lat9nq/intel-compute-toggle (diff) | |
download | yuzu-5693434b8ad74a5c46155f1e60fa0d3f475aa153.tar yuzu-5693434b8ad74a5c46155f1e60fa0d3f475aa153.tar.gz yuzu-5693434b8ad74a5c46155f1e60fa0d3f475aa153.tar.bz2 yuzu-5693434b8ad74a5c46155f1e60fa0d3f475aa153.tar.lz yuzu-5693434b8ad74a5c46155f1e60fa0d3f475aa153.tar.xz yuzu-5693434b8ad74a5c46155f1e60fa0d3f475aa153.tar.zst yuzu-5693434b8ad74a5c46155f1e60fa0d3f475aa153.zip |
Diffstat (limited to 'src/input_common/drivers')
-rw-r--r-- | src/input_common/drivers/joycon.cpp | 9 | ||||
-rw-r--r-- | src/input_common/drivers/joycon.h | 3 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/input_common/drivers/joycon.cpp b/src/input_common/drivers/joycon.cpp index 8b57ebe07..653862a72 100644 --- a/src/input_common/drivers/joycon.cpp +++ b/src/input_common/drivers/joycon.cpp @@ -195,8 +195,8 @@ void Joycons::RegisterNewDevice(SDL_hid_device_info* device_info) { OnMotionUpdate(port, type, id, value); }}, .on_ring_data = {[this](f32 ring_data) { OnRingConUpdate(ring_data); }}, - .on_amiibo_data = {[this, port](const std::vector<u8>& amiibo_data) { - OnAmiiboUpdate(port, amiibo_data); + .on_amiibo_data = {[this, port, type](const std::vector<u8>& amiibo_data) { + OnAmiiboUpdate(port, type, amiibo_data); }}, .on_camera_data = {[this, port](const std::vector<u8>& camera_data, Joycon::IrsResolution format) { @@ -398,8 +398,9 @@ void Joycons::OnRingConUpdate(f32 ring_data) { SetAxis(identifier, 100, ring_data); } -void Joycons::OnAmiiboUpdate(std::size_t port, const std::vector<u8>& amiibo_data) { - const auto identifier = GetIdentifier(port, Joycon::ControllerType::Right); +void Joycons::OnAmiiboUpdate(std::size_t port, Joycon::ControllerType type, + const std::vector<u8>& amiibo_data) { + const auto identifier = GetIdentifier(port, type); const auto nfc_state = amiibo_data.empty() ? Common::Input::NfcState::AmiiboRemoved : Common::Input::NfcState::NewAmiibo; SetNfc(identifier, {nfc_state, amiibo_data}); diff --git a/src/input_common/drivers/joycon.h b/src/input_common/drivers/joycon.h index 5b40817e2..e3f0ad78f 100644 --- a/src/input_common/drivers/joycon.h +++ b/src/input_common/drivers/joycon.h @@ -81,7 +81,8 @@ private: void OnMotionUpdate(std::size_t port, Joycon::ControllerType type, int id, const Joycon::MotionData& value); void OnRingConUpdate(f32 ring_data); - void OnAmiiboUpdate(std::size_t port, const std::vector<u8>& amiibo_data); + void OnAmiiboUpdate(std::size_t port, Joycon::ControllerType type, + const std::vector<u8>& amiibo_data); void OnCameraUpdate(std::size_t port, const std::vector<u8>& camera_data, Joycon::IrsResolution format); |