diff options
| author | 2022-12-06 11:26:46 -0500 | |
|---|---|---|
| committer | 2022-12-06 11:26:46 -0500 | |
| commit | bbdb6d391e76845a9f2db57d05b2d0a85eeeba4e (patch) | |
| tree | 14708267c324948a8164a19df7d992c764aaac27 /src/core/hid/emulated_console.cpp | |
| parent | Merge pull request #9386 from lioncash/init (diff) | |
| parent | emulated_controller: Remove unused parameter in GetMappedDevices() (diff) | |
| download | yuzu-bbdb6d391e76845a9f2db57d05b2d0a85eeeba4e.tar.gz yuzu-bbdb6d391e76845a9f2db57d05b2d0a85eeeba4e.tar.xz yuzu-bbdb6d391e76845a9f2db57d05b2d0a85eeeba4e.zip | |
Merge pull request #9389 from lioncash/emumove
emulated_console/emulated_controller: std::move ParamPackage instances where applicable
Diffstat (limited to 'src/core/hid/emulated_console.cpp')
| -rw-r--r-- | src/core/hid/emulated_console.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/core/hid/emulated_console.cpp b/src/core/hid/emulated_console.cpp index b6c8cc58d..30c2e9d17 100644 --- a/src/core/hid/emulated_console.cpp +++ b/src/core/hid/emulated_console.cpp | |||
| @@ -37,7 +37,7 @@ void EmulatedConsole::SetTouchParams() { | |||
| 37 | touchscreen_param.Set("axis_x", i * 2); | 37 | touchscreen_param.Set("axis_x", i * 2); |
| 38 | touchscreen_param.Set("axis_y", (i * 2) + 1); | 38 | touchscreen_param.Set("axis_y", (i * 2) + 1); |
| 39 | touchscreen_param.Set("button", i); | 39 | touchscreen_param.Set("button", i); |
| 40 | touch_params[index++] = touchscreen_param; | 40 | touch_params[index++] = std::move(touchscreen_param); |
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | const auto button_index = | 43 | const auto button_index = |
| @@ -59,7 +59,7 @@ void EmulatedConsole::SetTouchParams() { | |||
| 59 | touch_button_params.Set("button", params.Serialize()); | 59 | touch_button_params.Set("button", params.Serialize()); |
| 60 | touch_button_params.Set("x", x); | 60 | touch_button_params.Set("x", x); |
| 61 | touch_button_params.Set("y", y); | 61 | touch_button_params.Set("y", y); |
| 62 | touch_params[index] = touch_button_params; | 62 | touch_params[index] = std::move(touch_button_params); |
| 63 | index++; | 63 | index++; |
| 64 | } | 64 | } |
| 65 | } | 65 | } |
| @@ -131,7 +131,7 @@ Common::ParamPackage EmulatedConsole::GetMotionParam() const { | |||
| 131 | } | 131 | } |
| 132 | 132 | ||
| 133 | void EmulatedConsole::SetMotionParam(Common::ParamPackage param) { | 133 | void EmulatedConsole::SetMotionParam(Common::ParamPackage param) { |
| 134 | motion_params = param; | 134 | motion_params = std::move(param); |
| 135 | ReloadInput(); | 135 | ReloadInput(); |
| 136 | } | 136 | } |
| 137 | 137 | ||
| @@ -199,7 +199,7 @@ void EmulatedConsole::SetTouch(const Common::Input::CallbackStatus& callback, st | |||
| 199 | 199 | ||
| 200 | if (is_new_input) { | 200 | if (is_new_input) { |
| 201 | touch_value.pressed.value = true; | 201 | touch_value.pressed.value = true; |
| 202 | touch_value.id = static_cast<u32>(index); | 202 | touch_value.id = static_cast<int>(index); |
| 203 | } | 203 | } |
| 204 | 204 | ||
| 205 | touch_value.x = touch_input.x; | 205 | touch_value.x = touch_input.x; |
| @@ -284,7 +284,7 @@ void EmulatedConsole::TriggerOnChange(ConsoleTriggerType type) { | |||
| 284 | 284 | ||
| 285 | int EmulatedConsole::SetCallback(ConsoleUpdateCallback update_callback) { | 285 | int EmulatedConsole::SetCallback(ConsoleUpdateCallback update_callback) { |
| 286 | std::scoped_lock lock{callback_mutex}; | 286 | std::scoped_lock lock{callback_mutex}; |
| 287 | callback_list.insert_or_assign(last_callback_key, update_callback); | 287 | callback_list.insert_or_assign(last_callback_key, std::move(update_callback)); |
| 288 | return last_callback_key++; | 288 | return last_callback_key++; |
| 289 | } | 289 | } |
| 290 | 290 | ||