aboutsummaryrefslogtreecommitdiff
path: root/src/core/hid/emulated_console.cpp
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2022-12-06 11:26:46 -0500
committerGitHub <noreply@github.com>2022-12-06 11:26:46 -0500
commitbbdb6d391e76845a9f2db57d05b2d0a85eeeba4e (patch)
tree14708267c324948a8164a19df7d992c764aaac27 /src/core/hid/emulated_console.cpp
parenta86af1b776fadb4d5804ef2c1fb74e0c197cc51d (diff)
parente4a16f50eff470d9c87a32143e559716171f12b2 (diff)
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.cpp10
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() {
touchscreen_param.Set("axis_x", i * 2);
touchscreen_param.Set("axis_y", (i * 2) + 1);
touchscreen_param.Set("button", i);
- touch_params[index++] = touchscreen_param;
+ touch_params[index++] = std::move(touchscreen_param);
}
const auto button_index =
@@ -59,7 +59,7 @@ void EmulatedConsole::SetTouchParams() {
touch_button_params.Set("button", params.Serialize());
touch_button_params.Set("x", x);
touch_button_params.Set("y", y);
- touch_params[index] = touch_button_params;
+ touch_params[index] = std::move(touch_button_params);
index++;
}
}
@@ -131,7 +131,7 @@ Common::ParamPackage EmulatedConsole::GetMotionParam() const {
}
void EmulatedConsole::SetMotionParam(Common::ParamPackage param) {
- motion_params = param;
+ motion_params = std::move(param);
ReloadInput();
}
@@ -199,7 +199,7 @@ void EmulatedConsole::SetTouch(const Common::Input::CallbackStatus& callback, st
if (is_new_input) {
touch_value.pressed.value = true;
- touch_value.id = static_cast<u32>(index);
+ touch_value.id = static_cast<int>(index);
}
touch_value.x = touch_input.x;
@@ -284,7 +284,7 @@ void EmulatedConsole::TriggerOnChange(ConsoleTriggerType type) {
int EmulatedConsole::SetCallback(ConsoleUpdateCallback update_callback) {
std::scoped_lock lock{callback_mutex};
- callback_list.insert_or_assign(last_callback_key, update_callback);
+ callback_list.insert_or_assign(last_callback_key, std::move(update_callback));
return last_callback_key++;
}