diff options
| author | 2021-10-15 19:07:47 -0500 | |
|---|---|---|
| committer | 2021-11-24 20:30:24 -0600 | |
| commit | e0da5c1bbcdf85676f968b63c8ae2587f0464193 (patch) | |
| tree | 588837d1181d6b9d3bd4536fd4d2c5877335632d /src/core/hid/emulated_controller.cpp | |
| parent | core/hid: Add output devices (diff) | |
| download | yuzu-e0da5c1bbcdf85676f968b63c8ae2587f0464193.tar.gz yuzu-e0da5c1bbcdf85676f968b63c8ae2587f0464193.tar.xz yuzu-e0da5c1bbcdf85676f968b63c8ae2587f0464193.zip | |
kraken: Fix errors from rebase and format files
Diffstat (limited to 'src/core/hid/emulated_controller.cpp')
| -rw-r--r-- | src/core/hid/emulated_controller.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/core/hid/emulated_controller.cpp b/src/core/hid/emulated_controller.cpp index b9d16657a..b04ab4cd8 100644 --- a/src/core/hid/emulated_controller.cpp +++ b/src/core/hid/emulated_controller.cpp | |||
| @@ -91,6 +91,7 @@ void EmulatedController::ReloadFromSettings() { | |||
| 91 | } | 91 | } |
| 92 | 92 | ||
| 93 | void EmulatedController::ReloadInput() { | 93 | void EmulatedController::ReloadInput() { |
| 94 | // If you load any device here add the equivalent to the UnloadInput() function | ||
| 94 | const auto player_index = NpadIdTypeToIndex(npad_id_type); | 95 | const auto player_index = NpadIdTypeToIndex(npad_id_type); |
| 95 | const auto left_side = button_params[Settings::NativeButton::ZL]; | 96 | const auto left_side = button_params[Settings::NativeButton::ZL]; |
| 96 | const auto right_side = button_params[Settings::NativeButton::ZR]; | 97 | const auto right_side = button_params[Settings::NativeButton::ZR]; |
| @@ -113,7 +114,7 @@ void EmulatedController::ReloadInput() { | |||
| 113 | battery_devices[0] = Input::CreateDevice<Input::InputDevice>(left_side); | 114 | battery_devices[0] = Input::CreateDevice<Input::InputDevice>(left_side); |
| 114 | battery_devices[1] = Input::CreateDevice<Input::InputDevice>(right_side); | 115 | battery_devices[1] = Input::CreateDevice<Input::InputDevice>(right_side); |
| 115 | 116 | ||
| 116 | button_params[Settings::NativeButton::ZL].Set("output",true); | 117 | button_params[Settings::NativeButton::ZL].Set("output", true); |
| 117 | output_devices[0] = | 118 | output_devices[0] = |
| 118 | Input::CreateDevice<Input::OutputDevice>(button_params[Settings::NativeButton::ZL]); | 119 | Input::CreateDevice<Input::OutputDevice>(button_params[Settings::NativeButton::ZL]); |
| 119 | 120 | ||
| @@ -179,6 +180,9 @@ void EmulatedController::UnloadInput() { | |||
| 179 | for (auto& battery : battery_devices) { | 180 | for (auto& battery : battery_devices) { |
| 180 | battery.reset(); | 181 | battery.reset(); |
| 181 | } | 182 | } |
| 183 | for (auto& output : output_devices) { | ||
| 184 | output.reset(); | ||
| 185 | } | ||
| 182 | } | 186 | } |
| 183 | 187 | ||
| 184 | void EmulatedController::EnableConfiguration() { | 188 | void EmulatedController::EnableConfiguration() { |