diff options
author | bunnei <bunneidev@gmail.com> | 2023-05-19 03:10:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-19 03:10:38 +0200 |
commit | 1e398e6c36bf8839ca530497fee3772f51d62126 (patch) | |
tree | 9bc394d7aaf886b65ee18ba18088e0f057ae8225 /src/input_common/drivers | |
parent | externals: update cubeb (#10362) (diff) | |
parent | input_common: Fix pro controller amiibo support (diff) | |
download | yuzu-1e398e6c36bf8839ca530497fee3772f51d62126.tar yuzu-1e398e6c36bf8839ca530497fee3772f51d62126.tar.gz yuzu-1e398e6c36bf8839ca530497fee3772f51d62126.tar.bz2 yuzu-1e398e6c36bf8839ca530497fee3772f51d62126.tar.lz yuzu-1e398e6c36bf8839ca530497fee3772f51d62126.tar.xz yuzu-1e398e6c36bf8839ca530497fee3772f51d62126.tar.zst yuzu-1e398e6c36bf8839ca530497fee3772f51d62126.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); |