summaryrefslogtreecommitdiff
path: root/src/core/hid/emulated_controller.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hid/emulated_controller.cpp')
-rw-r--r--src/core/hid/emulated_controller.cpp6
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
93void EmulatedController::ReloadInput() { 93void 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
184void EmulatedController::EnableConfiguration() { 188void EmulatedController::EnableConfiguration() {