diff options
| author | 2022-01-07 16:55:55 -0600 | |
|---|---|---|
| committer | 2022-01-07 16:56:36 -0600 | |
| commit | 873d26b335d9b43d51100083a1b53f8733cb93b0 (patch) | |
| tree | a9fae58bb8e8cb8072d72809b6ffed2916a7db7e /src | |
| parent | input_common: Fix udp motion not automapping to both sides (diff) | |
| download | yuzu-873d26b335d9b43d51100083a1b53f8733cb93b0.tar.gz yuzu-873d26b335d9b43d51100083a1b53f8733cb93b0.tar.xz yuzu-873d26b335d9b43d51100083a1b53f8733cb93b0.zip | |
yuzu: Use pad parameter to choose the correct controller
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hid/emulated_controller.cpp | 8 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_input_player.cpp | 15 |
2 files changed, 14 insertions, 9 deletions
diff --git a/src/core/hid/emulated_controller.cpp b/src/core/hid/emulated_controller.cpp index 71fc05807..52a56ef1a 100644 --- a/src/core/hid/emulated_controller.cpp +++ b/src/core/hid/emulated_controller.cpp | |||
| @@ -389,7 +389,8 @@ std::vector<Common::ParamPackage> EmulatedController::GetMappedDevices( | |||
| 389 | devices.begin(), devices.end(), [param](const Common::ParamPackage param_) { | 389 | devices.begin(), devices.end(), [param](const Common::ParamPackage param_) { |
| 390 | return param.Get("engine", "") == param_.Get("engine", "") && | 390 | return param.Get("engine", "") == param_.Get("engine", "") && |
| 391 | param.Get("guid", "") == param_.Get("guid", "") && | 391 | param.Get("guid", "") == param_.Get("guid", "") && |
| 392 | param.Get("port", 0) == param_.Get("port", 0); | 392 | param.Get("port", 0) == param_.Get("port", 0) && |
| 393 | param.Get("pad", 0) == param_.Get("pad", 0); | ||
| 393 | }); | 394 | }); |
| 394 | if (devices_it != devices.end()) { | 395 | if (devices_it != devices.end()) { |
| 395 | continue; | 396 | continue; |
| @@ -398,6 +399,7 @@ std::vector<Common::ParamPackage> EmulatedController::GetMappedDevices( | |||
| 398 | device.Set("engine", param.Get("engine", "")); | 399 | device.Set("engine", param.Get("engine", "")); |
| 399 | device.Set("guid", param.Get("guid", "")); | 400 | device.Set("guid", param.Get("guid", "")); |
| 400 | device.Set("port", param.Get("port", 0)); | 401 | device.Set("port", param.Get("port", 0)); |
| 402 | device.Set("pad", param.Get("pad", 0)); | ||
| 401 | devices.push_back(device); | 403 | devices.push_back(device); |
| 402 | } | 404 | } |
| 403 | 405 | ||
| @@ -412,7 +414,8 @@ std::vector<Common::ParamPackage> EmulatedController::GetMappedDevices( | |||
| 412 | devices.begin(), devices.end(), [param](const Common::ParamPackage param_) { | 414 | devices.begin(), devices.end(), [param](const Common::ParamPackage param_) { |
| 413 | return param.Get("engine", "") == param_.Get("engine", "") && | 415 | return param.Get("engine", "") == param_.Get("engine", "") && |
| 414 | param.Get("guid", "") == param_.Get("guid", "") && | 416 | param.Get("guid", "") == param_.Get("guid", "") && |
| 415 | param.Get("port", 0) == param_.Get("port", 0); | 417 | param.Get("port", 0) == param_.Get("port", 0) && |
| 418 | param.Get("pad", 0) == param_.Get("pad", 0); | ||
| 416 | }); | 419 | }); |
| 417 | if (devices_it != devices.end()) { | 420 | if (devices_it != devices.end()) { |
| 418 | continue; | 421 | continue; |
| @@ -421,6 +424,7 @@ std::vector<Common::ParamPackage> EmulatedController::GetMappedDevices( | |||
| 421 | device.Set("engine", param.Get("engine", "")); | 424 | device.Set("engine", param.Get("engine", "")); |
| 422 | device.Set("guid", param.Get("guid", "")); | 425 | device.Set("guid", param.Get("guid", "")); |
| 423 | device.Set("port", param.Get("port", 0)); | 426 | device.Set("port", param.Get("port", 0)); |
| 427 | device.Set("pad", param.Get("pad", 0)); | ||
| 424 | devices.push_back(device); | 428 | devices.push_back(device); |
| 425 | } | 429 | } |
| 426 | return devices; | 430 | return devices; |
diff --git a/src/yuzu/configuration/configure_input_player.cpp b/src/yuzu/configuration/configure_input_player.cpp index 8c6249fc2..b9342466e 100644 --- a/src/yuzu/configuration/configure_input_player.cpp +++ b/src/yuzu/configuration/configure_input_player.cpp | |||
| @@ -747,15 +747,16 @@ void ConfigureInputPlayer::UpdateInputDeviceCombobox() { | |||
| 747 | const auto first_engine = devices[0].Get("engine", ""); | 747 | const auto first_engine = devices[0].Get("engine", ""); |
| 748 | const auto first_guid = devices[0].Get("guid", ""); | 748 | const auto first_guid = devices[0].Get("guid", ""); |
| 749 | const auto first_port = devices[0].Get("port", 0); | 749 | const auto first_port = devices[0].Get("port", 0); |
| 750 | const auto first_pad = devices[0].Get("pad", 0); | ||
| 750 | 751 | ||
| 751 | if (devices.size() == 1) { | 752 | if (devices.size() == 1) { |
| 752 | const auto devices_it = | 753 | const auto devices_it = std::find_if( |
| 753 | std::find_if(input_devices.begin(), input_devices.end(), | 754 | input_devices.begin(), input_devices.end(), |
| 754 | [first_engine, first_guid, first_port](const Common::ParamPackage param) { | 755 | [first_engine, first_guid, first_port, first_pad](const Common::ParamPackage param) { |
| 755 | return param.Get("engine", "") == first_engine && | 756 | return param.Get("engine", "") == first_engine && |
| 756 | param.Get("guid", "") == first_guid && | 757 | param.Get("guid", "") == first_guid && param.Get("port", 0) == first_port && |
| 757 | param.Get("port", 0) == first_port; | 758 | param.Get("pad", 0) == first_pad; |
| 758 | }); | 759 | }); |
| 759 | const int device_index = | 760 | const int device_index = |
| 760 | devices_it != input_devices.end() | 761 | devices_it != input_devices.end() |
| 761 | ? static_cast<int>(std::distance(input_devices.begin(), devices_it)) | 762 | ? static_cast<int>(std::distance(input_devices.begin(), devices_it)) |