summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2022-02-05 06:40:28 +0100
committerMorph <39850852+Morph1984@users.noreply.github.com>2022-02-05 19:18:41 +0100
commitcb30fe50cd074fe05dd1d6e4b0d58116d3d98489 (patch)
tree58450d743d317369266bbbea44734725d8b83ea6 /src/core
parentcommon: Implement NewUUID (diff)
downloadyuzu-cb30fe50cd074fe05dd1d6e4b0d58116d3d98489.tar
yuzu-cb30fe50cd074fe05dd1d6e4b0d58116d3d98489.tar.gz
yuzu-cb30fe50cd074fe05dd1d6e4b0d58116d3d98489.tar.bz2
yuzu-cb30fe50cd074fe05dd1d6e4b0d58116d3d98489.tar.lz
yuzu-cb30fe50cd074fe05dd1d6e4b0d58116d3d98489.tar.xz
yuzu-cb30fe50cd074fe05dd1d6e4b0d58116d3d98489.tar.zst
yuzu-cb30fe50cd074fe05dd1d6e4b0d58116d3d98489.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hid/emulated_controller.cpp23
-rw-r--r--src/core/hid/emulated_controller.h6
-rw-r--r--src/core/hid/hid_types.h2
3 files changed, 16 insertions, 15 deletions
diff --git a/src/core/hid/emulated_controller.cpp b/src/core/hid/emulated_controller.cpp
index a7cdf45e6..44e9f22b9 100644
--- a/src/core/hid/emulated_controller.cpp
+++ b/src/core/hid/emulated_controller.cpp
@@ -204,7 +204,7 @@ void EmulatedController::ReloadInput() {
if (!button_devices[index]) {
continue;
}
- const auto uuid = Common::UUID{button_params[index].Get("guid", "")};
+ const auto uuid = Common::NewUUID{button_params[index].Get("guid", "")};
button_devices[index]->SetCallback({
.on_change =
[this, index, uuid](const Common::Input::CallbackStatus& callback) {
@@ -218,7 +218,7 @@ void EmulatedController::ReloadInput() {
if (!stick_devices[index]) {
continue;
}
- const auto uuid = Common::UUID{stick_params[index].Get("guid", "")};
+ const auto uuid = Common::NewUUID{stick_params[index].Get("guid", "")};
stick_devices[index]->SetCallback({
.on_change =
[this, index, uuid](const Common::Input::CallbackStatus& callback) {
@@ -232,7 +232,7 @@ void EmulatedController::ReloadInput() {
if (!trigger_devices[index]) {
continue;
}
- const auto uuid = Common::UUID{trigger_params[index].Get("guid", "")};
+ const auto uuid = Common::NewUUID{trigger_params[index].Get("guid", "")};
trigger_devices[index]->SetCallback({
.on_change =
[this, index, uuid](const Common::Input::CallbackStatus& callback) {
@@ -269,7 +269,8 @@ void EmulatedController::ReloadInput() {
}
// Use a common UUID for TAS
- const auto tas_uuid = Common::UUID{0x0, 0x7A5};
+ static constexpr Common::NewUUID TAS_UUID = Common::NewUUID{
+ {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7, 0xA5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}};
// Register TAS devices. No need to force update
for (std::size_t index = 0; index < tas_button_devices.size(); ++index) {
@@ -278,8 +279,8 @@ void EmulatedController::ReloadInput() {
}
tas_button_devices[index]->SetCallback({
.on_change =
- [this, index, tas_uuid](const Common::Input::CallbackStatus& callback) {
- SetButton(callback, index, tas_uuid);
+ [this, index](const Common::Input::CallbackStatus& callback) {
+ SetButton(callback, index, TAS_UUID);
},
});
}
@@ -290,8 +291,8 @@ void EmulatedController::ReloadInput() {
}
tas_stick_devices[index]->SetCallback({
.on_change =
- [this, index, tas_uuid](const Common::Input::CallbackStatus& callback) {
- SetStick(callback, index, tas_uuid);
+ [this, index](const Common::Input::CallbackStatus& callback) {
+ SetStick(callback, index, TAS_UUID);
},
});
}
@@ -489,7 +490,7 @@ void EmulatedController::SetMotionParam(std::size_t index, Common::ParamPackage
}
void EmulatedController::SetButton(const Common::Input::CallbackStatus& callback, std::size_t index,
- Common::UUID uuid) {
+ Common::NewUUID uuid) {
if (index >= controller.button_values.size()) {
return;
}
@@ -638,7 +639,7 @@ void EmulatedController::SetButton(const Common::Input::CallbackStatus& callback
}
void EmulatedController::SetStick(const Common::Input::CallbackStatus& callback, std::size_t index,
- Common::UUID uuid) {
+ Common::NewUUID uuid) {
if (index >= controller.stick_values.size()) {
return;
}
@@ -688,7 +689,7 @@ void EmulatedController::SetStick(const Common::Input::CallbackStatus& callback,
}
void EmulatedController::SetTrigger(const Common::Input::CallbackStatus& callback,
- std::size_t index, Common::UUID uuid) {
+ std::size_t index, Common::NewUUID uuid) {
if (index >= controller.trigger_values.size()) {
return;
}
diff --git a/src/core/hid/emulated_controller.h b/src/core/hid/emulated_controller.h
index d8642c5b3..ed61e9522 100644
--- a/src/core/hid/emulated_controller.h
+++ b/src/core/hid/emulated_controller.h
@@ -354,7 +354,7 @@ private:
* @param index Button ID of the to be updated
*/
void SetButton(const Common::Input::CallbackStatus& callback, std::size_t index,
- Common::UUID uuid);
+ Common::NewUUID uuid);
/**
* Updates the analog stick status of the controller
@@ -362,7 +362,7 @@ private:
* @param index stick ID of the to be updated
*/
void SetStick(const Common::Input::CallbackStatus& callback, std::size_t index,
- Common::UUID uuid);
+ Common::NewUUID uuid);
/**
* Updates the trigger status of the controller
@@ -370,7 +370,7 @@ private:
* @param index trigger ID of the to be updated
*/
void SetTrigger(const Common::Input::CallbackStatus& callback, std::size_t index,
- Common::UUID uuid);
+ Common::NewUUID uuid);
/**
* Updates the motion status of the controller
diff --git a/src/core/hid/hid_types.h b/src/core/hid/hid_types.h
index 778b328b9..a4ccdf11c 100644
--- a/src/core/hid/hid_types.h
+++ b/src/core/hid/hid_types.h
@@ -7,8 +7,8 @@
#include "common/bit_field.h"
#include "common/common_funcs.h"
#include "common/common_types.h"
+#include "common/new_uuid.h"
#include "common/point.h"
-#include "common/uuid.h"
namespace Core::HID {