general: Rename NewUUID to UUID, and remove the previous UUID impl
This completes the removal of the old UUID implementation.
This commit is contained in:
parent
26f74468c4
commit
e47b5e6a26
41 changed files with 415 additions and 598 deletions
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
namespace InputCommon {
|
||||
|
||||
constexpr PadIdentifier identifier = {
|
||||
.guid = Common::NewUUID{},
|
||||
.guid = Common::UUID{},
|
||||
.port = 0,
|
||||
.pad = 0,
|
||||
};
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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{};
|
||||
|
||||
|
|
|
@ -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)),
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue