summaryrefslogtreecommitdiffstats
path: root/src/input_common
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2022-02-05 18:35:39 +0100
committerMorph <39850852+Morph1984@users.noreply.github.com>2022-02-05 19:56:21 +0100
commit25db62ce1534cbd8b93b4284869229e4bd7de54d (patch)
treedd74d3fc6ba14a0de5e88778cad5b5c65fcba248 /src/input_common
parentprofile: Migrate to the new UUID implementation (diff)
downloadyuzu-25db62ce1534cbd8b93b4284869229e4bd7de54d.tar
yuzu-25db62ce1534cbd8b93b4284869229e4bd7de54d.tar.gz
yuzu-25db62ce1534cbd8b93b4284869229e4bd7de54d.tar.bz2
yuzu-25db62ce1534cbd8b93b4284869229e4bd7de54d.tar.lz
yuzu-25db62ce1534cbd8b93b4284869229e4bd7de54d.tar.xz
yuzu-25db62ce1534cbd8b93b4284869229e4bd7de54d.tar.zst
yuzu-25db62ce1534cbd8b93b4284869229e4bd7de54d.zip
Diffstat (limited to '')
-rw-r--r--src/input_common/drivers/gc_adapter.cpp2
-rw-r--r--src/input_common/drivers/keyboard.cpp6
-rw-r--r--src/input_common/drivers/mouse.cpp2
-rw-r--r--src/input_common/drivers/sdl_driver.cpp2
-rw-r--r--src/input_common/drivers/tas_input.cpp4
-rw-r--r--src/input_common/drivers/touch_screen.cpp2
-rw-r--r--src/input_common/drivers/udp_client.cpp4
-rw-r--r--src/input_common/drivers/udp_client.h4
-rw-r--r--src/input_common/input_engine.h4
-rw-r--r--src/input_common/input_poller.cpp18
10 files changed, 24 insertions, 24 deletions
diff --git a/src/input_common/drivers/gc_adapter.cpp b/src/input_common/drivers/gc_adapter.cpp
index 7a269b526..155caae42 100644
--- a/src/input_common/drivers/gc_adapter.cpp
+++ b/src/input_common/drivers/gc_adapter.cpp
@@ -248,7 +248,7 @@ bool GCAdapter::Setup() {
std::size_t port = 0;
for (GCController& pad : pads) {
pad.identifier = {
- .guid = Common::NewUUID{},
+ .guid = Common::UUID{},
.port = port++,
.pad = 0,
};
diff --git a/src/input_common/drivers/keyboard.cpp b/src/input_common/drivers/keyboard.cpp
index 449509270..59e3d9cc0 100644
--- a/src/input_common/drivers/keyboard.cpp
+++ b/src/input_common/drivers/keyboard.cpp
@@ -9,17 +9,17 @@
namespace InputCommon {
constexpr PadIdentifier key_identifier = {
- .guid = Common::NewUUID{},
+ .guid = Common::UUID{},
.port = 0,
.pad = 0,
};
constexpr PadIdentifier keyboard_key_identifier = {
- .guid = Common::NewUUID{},
+ .guid = Common::UUID{},
.port = 1,
.pad = 0,
};
constexpr PadIdentifier keyboard_modifier_identifier = {
- .guid = Common::NewUUID{},
+ .guid = Common::UUID{},
.port = 1,
.pad = 1,
};
diff --git a/src/input_common/drivers/mouse.cpp b/src/input_common/drivers/mouse.cpp
index ae63088ba..3c9a4e747 100644
--- a/src/input_common/drivers/mouse.cpp
+++ b/src/input_common/drivers/mouse.cpp
@@ -20,7 +20,7 @@ constexpr int motion_wheel_y = 4;
constexpr int touch_axis_x = 10;
constexpr int touch_axis_y = 11;
constexpr PadIdentifier identifier = {
- .guid = Common::NewUUID{},
+ .guid = Common::UUID{},
.port = 0,
.pad = 0,
};
diff --git a/src/input_common/drivers/sdl_driver.cpp b/src/input_common/drivers/sdl_driver.cpp
index b9a8317d4..655eb5275 100644
--- a/src/input_common/drivers/sdl_driver.cpp
+++ b/src/input_common/drivers/sdl_driver.cpp
@@ -120,7 +120,7 @@ public:
*/
const PadIdentifier GetPadIdentifier() const {
return {
- .guid = Common::NewUUID{guid},
+ .guid = Common::UUID{guid},
.port = static_cast<std::size_t>(port),
.pad = 0,
};
diff --git a/src/input_common/drivers/tas_input.cpp b/src/input_common/drivers/tas_input.cpp
index 6d36cf5da..944e141bf 100644
--- a/src/input_common/drivers/tas_input.cpp
+++ b/src/input_common/drivers/tas_input.cpp
@@ -50,7 +50,7 @@ constexpr std::array<std::pair<std::string_view, TasButton>, 18> text_to_tas_but
Tas::Tas(std::string input_engine_) : InputEngine(std::move(input_engine_)) {
for (size_t player_index = 0; player_index < PLAYER_NUMBER; player_index++) {
PadIdentifier identifier{
- .guid = Common::NewUUID{},
+ .guid = Common::UUID{},
.port = player_index,
.pad = 0,
};
@@ -203,7 +203,7 @@ void Tas::UpdateThread() {
}
PadIdentifier identifier{
- .guid = Common::NewUUID{},
+ .guid = Common::UUID{},
.port = player_index,
.pad = 0,
};
diff --git a/src/input_common/drivers/touch_screen.cpp b/src/input_common/drivers/touch_screen.cpp
index 1030e74d9..30c727df4 100644
--- a/src/input_common/drivers/touch_screen.cpp
+++ b/src/input_common/drivers/touch_screen.cpp
@@ -8,7 +8,7 @@
namespace InputCommon {
constexpr PadIdentifier identifier = {
- .guid = Common::NewUUID{},
+ .guid = Common::UUID{},
.port = 0,
.pad = 0,
};
diff --git a/src/input_common/drivers/udp_client.cpp b/src/input_common/drivers/udp_client.cpp
index cbcfa7a4b..64162f431 100644
--- a/src/input_common/drivers/udp_client.cpp
+++ b/src/input_common/drivers/udp_client.cpp
@@ -351,10 +351,10 @@ PadIdentifier UDPClient::GetPadIdentifier(std::size_t pad_index) const {
};
}
-Common::NewUUID UDPClient::GetHostUUID(const std::string& host) const {
+Common::UUID UDPClient::GetHostUUID(const std::string& host) const {
const auto ip = boost::asio::ip::make_address_v4(host);
const auto hex_host = fmt::format("00000000-0000-0000-0000-0000{:06x}", ip.to_uint());
- return Common::NewUUID{hex_host};
+ return Common::UUID{hex_host};
}
void UDPClient::Reset() {
diff --git a/src/input_common/drivers/udp_client.h b/src/input_common/drivers/udp_client.h
index 98abeedd1..76e32bd04 100644
--- a/src/input_common/drivers/udp_client.h
+++ b/src/input_common/drivers/udp_client.h
@@ -126,7 +126,7 @@ private:
struct ClientConnection {
ClientConnection();
~ClientConnection();
- Common::NewUUID uuid{"00000000-0000-0000-0000-00007F000001"};
+ Common::UUID uuid{"00000000-0000-0000-0000-00007F000001"};
std::string host{"127.0.0.1"};
u16 port{26760};
s8 active{-1};
@@ -148,7 +148,7 @@ private:
void OnPadData(Response::PadData, std::size_t client);
void StartCommunication(std::size_t client, const std::string& host, u16 port);
PadIdentifier GetPadIdentifier(std::size_t pad_index) const;
- Common::NewUUID GetHostUUID(const std::string& host) const;
+ Common::UUID GetHostUUID(const std::string& host) const;
Common::Input::ButtonNames GetUIButtonName(const Common::ParamPackage& params) const;
diff --git a/src/input_common/input_engine.h b/src/input_common/input_engine.h
index 05e45b877..c6c027aef 100644
--- a/src/input_common/input_engine.h
+++ b/src/input_common/input_engine.h
@@ -10,13 +10,13 @@
#include "common/common_types.h"
#include "common/input.h"
-#include "common/new_uuid.h"
#include "common/param_package.h"
+#include "common/uuid.h"
#include "input_common/main.h"
// Pad Identifier of data source
struct PadIdentifier {
- Common::NewUUID guid{};
+ Common::UUID guid{};
std::size_t port{};
std::size_t pad{};
diff --git a/src/input_common/input_poller.cpp b/src/input_common/input_poller.cpp
index 313703f5f..2f3c0735a 100644
--- a/src/input_common/input_poller.cpp
+++ b/src/input_common/input_poller.cpp
@@ -691,7 +691,7 @@ private:
std::unique_ptr<Common::Input::InputDevice> InputFactory::CreateButtonDevice(
const Common::ParamPackage& params) {
const PadIdentifier identifier = {
- .guid = Common::NewUUID{params.Get("guid", "")},
+ .guid = Common::UUID{params.Get("guid", "")},
.port = static_cast<std::size_t>(params.Get("port", 0)),
.pad = static_cast<std::size_t>(params.Get("pad", 0)),
};
@@ -714,7 +714,7 @@ std::unique_ptr<Common::Input::InputDevice> InputFactory::CreateButtonDevice(
std::unique_ptr<Common::Input::InputDevice> InputFactory::CreateHatButtonDevice(
const Common::ParamPackage& params) {
const PadIdentifier identifier = {
- .guid = Common::NewUUID{params.Get("guid", "")},
+ .guid = Common::UUID{params.Get("guid", "")},
.port = static_cast<std::size_t>(params.Get("port", 0)),
.pad = static_cast<std::size_t>(params.Get("pad", 0)),
};
@@ -736,7 +736,7 @@ std::unique_ptr<Common::Input::InputDevice> InputFactory::CreateStickDevice(
const auto range = std::clamp(params.Get("range", 1.0f), 0.25f, 1.50f);
const auto threshold = std::clamp(params.Get("threshold", 0.5f), 0.0f, 1.0f);
const PadIdentifier identifier = {
- .guid = Common::NewUUID{params.Get("guid", "")},
+ .guid = Common::UUID{params.Get("guid", "")},
.port = static_cast<std::size_t>(params.Get("port", 0)),
.pad = static_cast<std::size_t>(params.Get("pad", 0)),
};
@@ -768,7 +768,7 @@ std::unique_ptr<Common::Input::InputDevice> InputFactory::CreateStickDevice(
std::unique_ptr<Common::Input::InputDevice> InputFactory::CreateAnalogDevice(
const Common::ParamPackage& params) {
const PadIdentifier identifier = {
- .guid = Common::NewUUID{params.Get("guid", "")},
+ .guid = Common::UUID{params.Get("guid", "")},
.port = static_cast<std::size_t>(params.Get("port", 0)),
.pad = static_cast<std::size_t>(params.Get("pad", 0)),
};
@@ -789,7 +789,7 @@ std::unique_ptr<Common::Input::InputDevice> InputFactory::CreateAnalogDevice(
std::unique_ptr<Common::Input::InputDevice> InputFactory::CreateTriggerDevice(
const Common::ParamPackage& params) {
const PadIdentifier identifier = {
- .guid = Common::NewUUID{params.Get("guid", "")},
+ .guid = Common::UUID{params.Get("guid", "")},
.port = static_cast<std::size_t>(params.Get("port", 0)),
.pad = static_cast<std::size_t>(params.Get("pad", 0)),
};
@@ -820,7 +820,7 @@ std::unique_ptr<Common::Input::InputDevice> InputFactory::CreateTouchDevice(
const auto range = std::clamp(params.Get("range", 1.0f), 0.25f, 1.50f);
const auto threshold = std::clamp(params.Get("threshold", 0.5f), 0.0f, 1.0f);
const PadIdentifier identifier = {
- .guid = Common::NewUUID{params.Get("guid", "")},
+ .guid = Common::UUID{params.Get("guid", "")},
.port = static_cast<std::size_t>(params.Get("port", 0)),
.pad = static_cast<std::size_t>(params.Get("pad", 0)),
};
@@ -857,7 +857,7 @@ std::unique_ptr<Common::Input::InputDevice> InputFactory::CreateTouchDevice(
std::unique_ptr<Common::Input::InputDevice> InputFactory::CreateBatteryDevice(
const Common::ParamPackage& params) {
const PadIdentifier identifier = {
- .guid = Common::NewUUID{params.Get("guid", "")},
+ .guid = Common::UUID{params.Get("guid", "")},
.port = static_cast<std::size_t>(params.Get("port", 0)),
.pad = static_cast<std::size_t>(params.Get("pad", 0)),
};
@@ -869,7 +869,7 @@ std::unique_ptr<Common::Input::InputDevice> InputFactory::CreateBatteryDevice(
std::unique_ptr<Common::Input::InputDevice> InputFactory::CreateMotionDevice(
Common::ParamPackage params) {
const PadIdentifier identifier = {
- .guid = Common::NewUUID{params.Get("guid", "")},
+ .guid = Common::UUID{params.Get("guid", "")},
.port = static_cast<std::size_t>(params.Get("port", 0)),
.pad = static_cast<std::size_t>(params.Get("pad", 0)),
};
@@ -963,7 +963,7 @@ OutputFactory::OutputFactory(std::shared_ptr<InputEngine> input_engine_)
std::unique_ptr<Common::Input::OutputDevice> OutputFactory::Create(
const Common::ParamPackage& params) {
const PadIdentifier identifier = {
- .guid = Common::NewUUID{params.Get("guid", "")},
+ .guid = Common::UUID{params.Get("guid", "")},
.port = static_cast<std::size_t>(params.Get("port", 0)),
.pad = static_cast<std::size_t>(params.Get("pad", 0)),
};