Compare commits
1 Commits
controller
...
be_my_frie
Author | SHA1 | Date | |
---|---|---|---|
43a7bd18b2 |
@ -459,8 +459,12 @@ add_library(core STATIC
|
||||
hle/service/fgm/fgm.h
|
||||
hle/service/friend/friend.cpp
|
||||
hle/service/friend/friend.h
|
||||
hle/service/friend/friend_interface.cpp
|
||||
hle/service/friend/friend_interface.h
|
||||
hle/service/friend/friend_results.h
|
||||
hle/service/friend/friend_service.cpp
|
||||
hle/service/friend/friend_service.h
|
||||
hle/service/friend/friend_types.h
|
||||
hle/service/friend/notification_service.cpp
|
||||
hle/service/friend/notification_service.h
|
||||
hle/service/glue/arp.cpp
|
||||
hle/service/glue/arp.h
|
||||
hle/service/glue/bgtc.cpp
|
||||
|
@ -1,7 +1,6 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <queue>
|
||||
#include "common/logging/log.h"
|
||||
#include "common/uuid.h"
|
||||
#include "core/core.h"
|
||||
@ -14,6 +13,9 @@
|
||||
#include "core/hle/service/server_manager.h"
|
||||
|
||||
namespace Service::Friend {
|
||||
Module::Interface::Interface(std::shared_ptr<Module> module_, Core::System& system_,
|
||||
const char* name)
|
||||
: ServiceFramework{system_, name}, module{std::move(module_)} {}
|
||||
|
||||
class IFriendService final : public ServiceFramework<IFriendService> {
|
||||
public:
|
||||
@ -330,11 +332,17 @@ void Module::Interface::CreateNotificationService(HLERequestContext& ctx) {
|
||||
rb.PushIpcInterface<INotificationService>(system, uuid);
|
||||
}
|
||||
|
||||
Module::Interface::Interface(std::shared_ptr<Module> module_, Core::System& system_,
|
||||
const char* name)
|
||||
: ServiceFramework{system_, name}, module{std::move(module_)} {}
|
||||
Friend::Friend(std::shared_ptr<Module> module_, Core::System& system_, const char* name)
|
||||
: Interface(std::move(module_), system_, name) {
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &Friend::CreateFriendService, "CreateFriendService"},
|
||||
{1, &Friend::CreateNotificationService, "CreateNotificationService"},
|
||||
{2, nullptr, "CreateDaemonSuspendSessionService"},
|
||||
};
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
Module::Interface::~Interface() = default;
|
||||
Friend::~Friend() = default;
|
||||
|
||||
void LoopProcess(Core::System& system) {
|
||||
auto server_manager = std::make_unique<ServerManager>(system);
|
||||
|
@ -1,20 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "core/hle/service/friend/friend_interface.h"
|
||||
|
||||
namespace Service::Friend {
|
||||
|
||||
Friend::Friend(std::shared_ptr<Module> module_, Core::System& system_, const char* name)
|
||||
: Interface(std::move(module_), system_, name) {
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &Friend::CreateFriendService, "CreateFriendService"},
|
||||
{1, &Friend::CreateNotificationService, "CreateNotificationService"},
|
||||
{2, nullptr, "CreateDaemonSuspendSessionService"},
|
||||
};
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
Friend::~Friend() = default;
|
||||
|
||||
} // namespace Service::Friend
|
@ -1,16 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/service/friend/friend.h"
|
||||
|
||||
namespace Service::Friend {
|
||||
|
||||
class Friend final : public Module::Interface {
|
||||
public:
|
||||
explicit Friend(std::shared_ptr<Module> module_, Core::System& system_, const char* name);
|
||||
~Friend() override;
|
||||
};
|
||||
|
||||
} // namespace Service::Friend
|
14
src/core/hle/service/friend/friend_results.h
Normal file
14
src/core/hle/service/friend/friend_results.h
Normal file
@ -0,0 +1,14 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/result.h"
|
||||
|
||||
namespace Service::Friend {
|
||||
|
||||
constexpr Result NotInitialized{ErrorModule::Account, 1};
|
||||
constexpr Result InvalidArgument{ErrorModule::Account, 2};
|
||||
constexpr Result NoNotifications{ErrorModule::Account, 15};
|
||||
|
||||
} // namespace Service::Friend
|
184
src/core/hle/service/friend/friend_service.cpp
Normal file
184
src/core/hle/service/friend/friend_service.cpp
Normal file
@ -0,0 +1,184 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/logging/log.h"
|
||||
#include "common/uuid.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/service/friend/friend_results.h"
|
||||
#include "core/hle/service/friend/friend_service.h"
|
||||
#include "core/hle/service/friend/friend_types.h"
|
||||
|
||||
namespace Service::Friend {
|
||||
|
||||
IFriendService::IFriendService(Core::System& system_)
|
||||
: ServiceFramework{system_, "IFriendService"}, service_context{system, "IFriendService"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &IFriendService::GetCompletionEvent, "GetCompletionEvent"},
|
||||
{1, nullptr, "Cancel"},
|
||||
{10100, nullptr, "GetFriendListIds"},
|
||||
{10101, &IFriendService::GetFriendList, "GetFriendList"},
|
||||
{10102, nullptr, "UpdateFriendInfo"},
|
||||
{10110, nullptr, "GetFriendProfileImage"},
|
||||
{10120, &IFriendService::CheckFriendListAvailability, "CheckFriendListAvailability"},
|
||||
{10121, nullptr, "EnsureFriendListAvailable"},
|
||||
{10200, nullptr, "SendFriendRequestForApplication"},
|
||||
{10211, nullptr, "AddFacedFriendRequestForApplication"},
|
||||
{10400, &IFriendService::GetBlockedUserListIds, "GetBlockedUserListIds"},
|
||||
{10420, nullptr, "IsBlockedUserListCacheAvailable"},
|
||||
{10421, nullptr, "EnsureBlockedUserListAvailable"},
|
||||
{10500, nullptr, "GetProfileList"},
|
||||
{10600, nullptr, "DeclareOpenOnlinePlaySession"},
|
||||
{10601, &IFriendService::DeclareCloseOnlinePlaySession, "DeclareCloseOnlinePlaySession"},
|
||||
{10610, &IFriendService::UpdateUserPresence, "UpdateUserPresence"},
|
||||
{10700, &IFriendService::GetPlayHistoryRegistrationKey, "GetPlayHistoryRegistrationKey"},
|
||||
{10701, nullptr, "GetPlayHistoryRegistrationKeyWithNetworkServiceAccountId"},
|
||||
{10702, nullptr, "AddPlayHistory"},
|
||||
{11000, nullptr, "GetProfileImageUrl"},
|
||||
{20100, nullptr, "GetFriendCount"},
|
||||
{20101, nullptr, "GetNewlyFriendCount"},
|
||||
{20102, nullptr, "GetFriendDetailedInfo"},
|
||||
{20103, nullptr, "SyncFriendList"},
|
||||
{20104, nullptr, "RequestSyncFriendList"},
|
||||
{20110, nullptr, "LoadFriendSetting"},
|
||||
{20200, nullptr, "GetReceivedFriendRequestCount"},
|
||||
{20201, nullptr, "GetFriendRequestList"},
|
||||
{20300, nullptr, "GetFriendCandidateList"},
|
||||
{20301, nullptr, "GetNintendoNetworkIdInfo"},
|
||||
{20302, nullptr, "GetSnsAccountLinkage"},
|
||||
{20303, nullptr, "GetSnsAccountProfile"},
|
||||
{20304, nullptr, "GetSnsAccountFriendList"},
|
||||
{20400, nullptr, "GetBlockedUserList"},
|
||||
{20401, nullptr, "SyncBlockedUserList"},
|
||||
{20500, nullptr, "GetProfileExtraList"},
|
||||
{20501, nullptr, "GetRelationship"},
|
||||
{20600, nullptr, "GetUserPresenceView"},
|
||||
{20700, nullptr, "GetPlayHistoryList"},
|
||||
{20701, nullptr, "GetPlayHistoryStatistics"},
|
||||
{20800, nullptr, "LoadUserSetting"},
|
||||
{20801, nullptr, "SyncUserSetting"},
|
||||
{20900, nullptr, "RequestListSummaryOverlayNotification"},
|
||||
{21000, nullptr, "GetExternalApplicationCatalog"},
|
||||
{22000, nullptr, "GetReceivedFriendInvitationList"},
|
||||
{22001, nullptr, "GetReceivedFriendInvitationDetailedInfo"},
|
||||
{22010, nullptr, "GetReceivedFriendInvitationCountCache"},
|
||||
{30100, nullptr, "DropFriendNewlyFlags"},
|
||||
{30101, nullptr, "DeleteFriend"},
|
||||
{30110, nullptr, "DropFriendNewlyFlag"},
|
||||
{30120, nullptr, "ChangeFriendFavoriteFlag"},
|
||||
{30121, nullptr, "ChangeFriendOnlineNotificationFlag"},
|
||||
{30200, nullptr, "SendFriendRequest"},
|
||||
{30201, nullptr, "SendFriendRequestWithApplicationInfo"},
|
||||
{30202, nullptr, "CancelFriendRequest"},
|
||||
{30203, nullptr, "AcceptFriendRequest"},
|
||||
{30204, nullptr, "RejectFriendRequest"},
|
||||
{30205, nullptr, "ReadFriendRequest"},
|
||||
{30210, nullptr, "GetFacedFriendRequestRegistrationKey"},
|
||||
{30211, nullptr, "AddFacedFriendRequest"},
|
||||
{30212, nullptr, "CancelFacedFriendRequest"},
|
||||
{30213, nullptr, "GetFacedFriendRequestProfileImage"},
|
||||
{30214, nullptr, "GetFacedFriendRequestProfileImageFromPath"},
|
||||
{30215, nullptr, "SendFriendRequestWithExternalApplicationCatalogId"},
|
||||
{30216, nullptr, "ResendFacedFriendRequest"},
|
||||
{30217, nullptr, "SendFriendRequestWithNintendoNetworkIdInfo"},
|
||||
{30300, nullptr, "GetSnsAccountLinkPageUrl"},
|
||||
{30301, nullptr, "UnlinkSnsAccount"},
|
||||
{30400, nullptr, "BlockUser"},
|
||||
{30401, nullptr, "BlockUserWithApplicationInfo"},
|
||||
{30402, nullptr, "UnblockUser"},
|
||||
{30500, nullptr, "GetProfileExtraFromFriendCode"},
|
||||
{30700, nullptr, "DeletePlayHistory"},
|
||||
{30810, nullptr, "ChangePresencePermission"},
|
||||
{30811, nullptr, "ChangeFriendRequestReception"},
|
||||
{30812, nullptr, "ChangePlayLogPermission"},
|
||||
{30820, nullptr, "IssueFriendCode"},
|
||||
{30830, nullptr, "ClearPlayLog"},
|
||||
{30900, nullptr, "SendFriendInvitation"},
|
||||
{30910, nullptr, "ReadFriendInvitation"},
|
||||
{30911, nullptr, "ReadAllFriendInvitations"},
|
||||
{40100, nullptr, "DeleteFriendListCache"},
|
||||
{40400, nullptr, "DeleteBlockedUserListCache"},
|
||||
{49900, nullptr, "DeleteNetworkServiceAccountCache"},
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
RegisterHandlers(functions);
|
||||
|
||||
completion_event = service_context.CreateEvent("IFriendService:CompletionEvent");
|
||||
}
|
||||
|
||||
IFriendService::~IFriendService() {
|
||||
service_context.CloseEvent(completion_event);
|
||||
}
|
||||
|
||||
void IFriendService::GetCompletionEvent(Kernel::HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_Friend, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 1};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.PushCopyObjects(completion_event->GetReadableEvent());
|
||||
}
|
||||
|
||||
void IFriendService::GetBlockedUserListIds(Kernel::HLERequestContext& ctx) {
|
||||
// This is safe to stub, as there should be no adverse consequences from reporting no
|
||||
// blocked users.
|
||||
LOG_WARNING(Service_Friend, "(STUBBED) called");
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push<u32>(0); // Indicates there are no blocked users
|
||||
}
|
||||
|
||||
void IFriendService::DeclareCloseOnlinePlaySession(Kernel::HLERequestContext& ctx) {
|
||||
// Stub used by Splatoon 2
|
||||
LOG_WARNING(Service_Friend, "(STUBBED) called");
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void IFriendService::UpdateUserPresence(Kernel::HLERequestContext& ctx) {
|
||||
// Stub used by Retro City Rampage
|
||||
LOG_WARNING(Service_Friend, "(STUBBED) called");
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void IFriendService::GetPlayHistoryRegistrationKey(Kernel::HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto local_play = rp.Pop<bool>();
|
||||
const auto uuid = rp.PopRaw<Common::UUID>();
|
||||
|
||||
LOG_WARNING(Service_Friend, "(STUBBED) called, local_play={}, uuid=0x{}", local_play,
|
||||
uuid.RawString());
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void IFriendService::GetFriendList(Kernel::HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto friend_offset = rp.Pop<u32>();
|
||||
const auto uuid = rp.PopRaw<Common::UUID>();
|
||||
[[maybe_unused]] const auto filter = rp.PopRaw<SizedFriendFilter>();
|
||||
const auto pid = rp.Pop<u64>();
|
||||
LOG_WARNING(Service_Friend, "(STUBBED) called, offset={}, uuid=0x{}, pid={}", friend_offset,
|
||||
uuid.RawString(), pid);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
rb.Push(ResultSuccess);
|
||||
|
||||
rb.Push<u32>(0); // Friend count
|
||||
// TODO(ogniK): Return a buffer of u64s which are the "NetworkServiceAccountId"
|
||||
}
|
||||
|
||||
void IFriendService::CheckFriendListAvailability(Kernel::HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto uuid{rp.PopRaw<Common::UUID>()};
|
||||
|
||||
LOG_WARNING(Service_Friend, "(STUBBED) called, uuid=0x{}", uuid.RawString());
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(true);
|
||||
}
|
||||
|
||||
} // namespace Service::Friend
|
31
src/core/hle/service/friend/friend_service.h
Normal file
31
src/core/hle/service/friend/friend_service.h
Normal file
@ -0,0 +1,31 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/service/friend/friend.h"
|
||||
#include "core/hle/service/kernel_helpers.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Service::Friend {
|
||||
|
||||
class IFriendService final : public ServiceFramework<IFriendService> {
|
||||
public:
|
||||
explicit IFriendService(Core::System& system_);
|
||||
~IFriendService() override;
|
||||
|
||||
private:
|
||||
void GetCompletionEvent(Kernel::HLERequestContext& ctx);
|
||||
void GetFriendList(Kernel::HLERequestContext& ctx);
|
||||
void CheckFriendListAvailability(Kernel::HLERequestContext& ctx);
|
||||
void GetBlockedUserListIds(Kernel::HLERequestContext& ctx);
|
||||
void DeclareCloseOnlinePlaySession(Kernel::HLERequestContext& ctx);
|
||||
void UpdateUserPresence(Kernel::HLERequestContext& ctx);
|
||||
void GetPlayHistoryRegistrationKey(Kernel::HLERequestContext& ctx);
|
||||
|
||||
KernelHelpers::ServiceContext service_context;
|
||||
|
||||
Kernel::KEvent* completion_event;
|
||||
};
|
||||
|
||||
} // namespace Service::Friend
|
46
src/core/hle/service/friend/friend_types.h
Normal file
46
src/core/hle/service/friend/friend_types.h
Normal file
@ -0,0 +1,46 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include "common/common_types.h"
|
||||
|
||||
namespace Service::Friend {
|
||||
|
||||
enum class PresenceFilter : u32 {
|
||||
None = 0,
|
||||
Online = 1,
|
||||
OnlinePlay = 2,
|
||||
OnlineOrOnlinePlay = 3,
|
||||
};
|
||||
|
||||
struct SizedFriendFilter {
|
||||
PresenceFilter presence;
|
||||
u8 is_favorite;
|
||||
u8 same_app;
|
||||
u8 same_app_played;
|
||||
u8 arbitary_app_played;
|
||||
u64 group_id;
|
||||
};
|
||||
static_assert(sizeof(SizedFriendFilter) == 0x10, "SizedFriendFilter is an invalid size");
|
||||
|
||||
enum class NotificationTypes : u32 {
|
||||
HasUpdatedFriendsList = 0x65,
|
||||
HasReceivedFriendRequest = 0x1,
|
||||
};
|
||||
|
||||
struct SizedNotificationInfo {
|
||||
NotificationTypes notification_type;
|
||||
INSERT_PADDING_WORDS(
|
||||
1); // TODO(ogniK): This doesn't seem to be used within any IPC returns as of now
|
||||
u64_le account_id;
|
||||
};
|
||||
static_assert(sizeof(SizedNotificationInfo) == 0x10, "SizedNotificationInfo is an incorrect size");
|
||||
|
||||
struct States {
|
||||
bool has_updated_friends;
|
||||
bool has_received_friend_request;
|
||||
};
|
||||
|
||||
} // namespace Service::Friend
|
83
src/core/hle/service/friend/notification_service.cpp
Normal file
83
src/core/hle/service/friend/notification_service.cpp
Normal file
@ -0,0 +1,83 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/logging/log.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/service/friend/friend_results.h"
|
||||
#include "core/hle/service/friend/friend_types.h"
|
||||
#include "core/hle/service/friend/notification_service.h"
|
||||
|
||||
namespace Service::Friend {
|
||||
|
||||
INotificationService::INotificationService(Core::System& system_, Common::UUID uuid_)
|
||||
: ServiceFramework{system_, "INotificationService"}, uuid{uuid_}, service_context{
|
||||
system_,
|
||||
"INotificationService"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &INotificationService::GetEvent, "GetEvent"},
|
||||
{1, &INotificationService::Clear, "Clear"},
|
||||
{2, &INotificationService::Pop, "Pop"}
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
RegisterHandlers(functions);
|
||||
|
||||
notification_event = service_context.CreateEvent("INotificationService:NotifyEvent");
|
||||
}
|
||||
|
||||
INotificationService::~INotificationService() {
|
||||
service_context.CloseEvent(notification_event);
|
||||
}
|
||||
|
||||
void INotificationService::GetEvent(Kernel::HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_Friend, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 1};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.PushCopyObjects(notification_event->GetReadableEvent());
|
||||
}
|
||||
|
||||
void INotificationService::Clear(Kernel::HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_Friend, "called");
|
||||
while (!notifications.empty()) {
|
||||
notifications.pop();
|
||||
}
|
||||
std::memset(&states, 0, sizeof(States));
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void INotificationService::Pop(Kernel::HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_Friend, "called");
|
||||
|
||||
if (notifications.empty()) {
|
||||
LOG_ERROR(Service_Friend, "No notifications in queue!");
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(NoNotifications);
|
||||
return;
|
||||
}
|
||||
|
||||
const auto notification = notifications.front();
|
||||
notifications.pop();
|
||||
|
||||
switch (notification.notification_type) {
|
||||
case NotificationTypes::HasUpdatedFriendsList:
|
||||
states.has_updated_friends = false;
|
||||
break;
|
||||
case NotificationTypes::HasReceivedFriendRequest:
|
||||
states.has_received_friend_request = false;
|
||||
break;
|
||||
default:
|
||||
// HOS seems not have an error case for an unknown notification
|
||||
LOG_WARNING(Service_Friend, "Unknown notification {:08X}", notification.notification_type);
|
||||
break;
|
||||
}
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 6};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.PushRaw<SizedNotificationInfo>(notification);
|
||||
}
|
||||
|
||||
} // namespace Service::Friend
|
32
src/core/hle/service/friend/notification_service.h
Normal file
32
src/core/hle/service/friend/notification_service.h
Normal file
@ -0,0 +1,32 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
#include <queue>
|
||||
|
||||
#include "common/uuid.h"
|
||||
#include "core/hle/service/friend/friend_types.h"
|
||||
#include "core/hle/service/kernel_helpers.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Service::Friend {
|
||||
|
||||
class INotificationService final : public ServiceFramework<INotificationService> {
|
||||
public:
|
||||
explicit INotificationService(Core::System& system_, Common::UUID uuid_);
|
||||
~INotificationService() override;
|
||||
|
||||
private:
|
||||
void GetEvent(Kernel::HLERequestContext& ctx);
|
||||
void Clear(Kernel::HLERequestContext& ctx);
|
||||
void Pop(Kernel::HLERequestContext& ctx);
|
||||
|
||||
Common::UUID uuid;
|
||||
KernelHelpers::ServiceContext service_context;
|
||||
|
||||
Kernel::KEvent* notification_event;
|
||||
std::queue<SizedNotificationInfo> notifications;
|
||||
States states{};
|
||||
};
|
||||
|
||||
} // namespace Service::Friend
|
@ -199,14 +199,6 @@ add_executable(yuzu
|
||||
util/clickable_label.h
|
||||
util/controller_navigation.cpp
|
||||
util/controller_navigation.h
|
||||
util/controller_viewer/common_shapes.cpp
|
||||
util/controller_viewer/common_shapes.h
|
||||
util/controller_viewer/controller_base.cpp
|
||||
util/controller_viewer/controller_base.h
|
||||
util/controller_viewer/controller_viewer.cpp
|
||||
util/controller_viewer/controller_viewer.h
|
||||
util/controller_viewer/pro_controller.cpp
|
||||
util/controller_viewer/pro_controller.h
|
||||
util/limitable_input_dialog.cpp
|
||||
util/limitable_input_dialog.h
|
||||
util/overlay_dialog.cpp
|
||||
|
@ -1,407 +0,0 @@
|
||||
// Copyright 2020 yuzu Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <algorithm>
|
||||
#include <QMenu>
|
||||
#include <QPainter>
|
||||
#include <QTimer>
|
||||
|
||||
#include "common/input.h"
|
||||
#include "yuzu/util/controller_viewer/common_shapes.h"
|
||||
|
||||
namespace ControllerViewer {
|
||||
|
||||
void CommonShapes::DrawBattery(QPainter& p, QPointF center, Common::Input::BatteryLevel battery,
|
||||
QColor outline, QColor battery_color, QColor charging_outline,
|
||||
QColor charging_color) {
|
||||
if (battery == Common::Input::BatteryLevel::None) {
|
||||
return;
|
||||
}
|
||||
// Draw outline
|
||||
p.setPen(QPen(outline, 5));
|
||||
p.setBrush(Qt::transparent);
|
||||
p.drawRoundedRect(center.x(), center.y(), 34, 16, 2, 2);
|
||||
|
||||
p.setPen(QPen(outline, 3));
|
||||
p.drawRect(center.x() + 35, center.y() + 4.5f, 4, 7);
|
||||
|
||||
// Draw Battery shape
|
||||
p.setPen(QPen(battery_color, 3));
|
||||
p.setBrush(Qt::transparent);
|
||||
p.drawRoundedRect(center.x(), center.y(), 34, 16, 2, 2);
|
||||
|
||||
p.setPen(QPen(battery_color, 1));
|
||||
p.setBrush(battery_color);
|
||||
p.drawRect(center.x() + 35, center.y() + 4.5f, 4, 7);
|
||||
switch (battery) {
|
||||
case Common::Input::BatteryLevel::Charging:
|
||||
p.drawRect(center.x(), center.y(), 34, 16);
|
||||
p.setPen(charging_outline);
|
||||
p.setBrush(charging_color);
|
||||
DrawSymbol(p, center + QPointF(17.0f, 8.0f), Symbol::Charging, 2.1f);
|
||||
break;
|
||||
case Common::Input::BatteryLevel::Full:
|
||||
p.drawRect(center.x(), center.y(), 34, 16);
|
||||
break;
|
||||
case Common::Input::BatteryLevel::Medium:
|
||||
p.drawRect(center.x(), center.y(), 25, 16);
|
||||
break;
|
||||
case Common::Input::BatteryLevel::Low:
|
||||
p.drawRect(center.x(), center.y(), 17, 16);
|
||||
break;
|
||||
case Common::Input::BatteryLevel::Critical:
|
||||
p.drawRect(center.x(), center.y(), 6, 16);
|
||||
break;
|
||||
case Common::Input::BatteryLevel::Empty:
|
||||
p.drawRect(center.x(), center.y(), 3, 16);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void CommonShapes::DrawSymbol(QPainter& p, const QPointF center, Symbol symbol, float icon_size) {
|
||||
std::array<QPointF, house.size() / 2> house_icon;
|
||||
std::array<QPointF, symbol_a.size() / 2> a_icon;
|
||||
std::array<QPointF, symbol_b.size() / 2> b_icon;
|
||||
std::array<QPointF, symbol_x.size() / 2> x_icon;
|
||||
std::array<QPointF, symbol_y.size() / 2> y_icon;
|
||||
std::array<QPointF, symbol_l.size() / 2> l_icon;
|
||||
std::array<QPointF, symbol_r.size() / 2> r_icon;
|
||||
std::array<QPointF, symbol_c.size() / 2> c_icon;
|
||||
std::array<QPointF, symbol_zl.size() / 2> zl_icon;
|
||||
std::array<QPointF, symbol_sl.size() / 2> sl_icon;
|
||||
std::array<QPointF, symbol_zr.size() / 2> zr_icon;
|
||||
std::array<QPointF, symbol_sr.size() / 2> sr_icon;
|
||||
std::array<QPointF, symbol_charging.size() / 2> charging_icon;
|
||||
switch (symbol) {
|
||||
case Symbol::House:
|
||||
for (std::size_t point = 0; point < house.size() / 2; ++point) {
|
||||
house_icon[point] = center + QPointF(house[point * 2] * icon_size,
|
||||
(house[point * 2 + 1] - 0.025f) * icon_size);
|
||||
}
|
||||
p.drawPolygon(house_icon.data(), static_cast<int>(house_icon.size()));
|
||||
break;
|
||||
case Symbol::A:
|
||||
for (std::size_t point = 0; point < symbol_a.size() / 2; ++point) {
|
||||
a_icon[point] = center + QPointF(symbol_a[point * 2] * icon_size,
|
||||
symbol_a[point * 2 + 1] * icon_size);
|
||||
}
|
||||
p.drawPolygon(a_icon.data(), static_cast<int>(a_icon.size()));
|
||||
break;
|
||||
case Symbol::B:
|
||||
for (std::size_t point = 0; point < symbol_b.size() / 2; ++point) {
|
||||
b_icon[point] = center + QPointF(symbol_b[point * 2] * icon_size,
|
||||
symbol_b[point * 2 + 1] * icon_size);
|
||||
}
|
||||
p.drawPolygon(b_icon.data(), static_cast<int>(b_icon.size()));
|
||||
break;
|
||||
case Symbol::X:
|
||||
for (std::size_t point = 0; point < symbol_x.size() / 2; ++point) {
|
||||
x_icon[point] = center + QPointF(symbol_x[point * 2] * icon_size,
|
||||
symbol_x[point * 2 + 1] * icon_size);
|
||||
}
|
||||
p.drawPolygon(x_icon.data(), static_cast<int>(x_icon.size()));
|
||||
break;
|
||||
case Symbol::Y:
|
||||
for (std::size_t point = 0; point < symbol_y.size() / 2; ++point) {
|
||||
y_icon[point] = center + QPointF(symbol_y[point * 2] * icon_size,
|
||||
(symbol_y[point * 2 + 1] - 1.0f) * icon_size);
|
||||
}
|
||||
p.drawPolygon(y_icon.data(), static_cast<int>(y_icon.size()));
|
||||
break;
|
||||
case Symbol::L:
|
||||
for (std::size_t point = 0; point < symbol_l.size() / 2; ++point) {
|
||||
l_icon[point] = center + QPointF(symbol_l[point * 2] * icon_size,
|
||||
(symbol_l[point * 2 + 1] - 1.0f) * icon_size);
|
||||
}
|
||||
p.drawPolygon(l_icon.data(), static_cast<int>(l_icon.size()));
|
||||
break;
|
||||
case Symbol::R:
|
||||
for (std::size_t point = 0; point < symbol_r.size() / 2; ++point) {
|
||||
r_icon[point] = center + QPointF(symbol_r[point * 2] * icon_size,
|
||||
(symbol_r[point * 2 + 1] - 1.0f) * icon_size);
|
||||
}
|
||||
p.drawPolygon(r_icon.data(), static_cast<int>(r_icon.size()));
|
||||
break;
|
||||
case Symbol::C:
|
||||
for (std::size_t point = 0; point < symbol_c.size() / 2; ++point) {
|
||||
c_icon[point] = center + QPointF(symbol_c[point * 2] * icon_size,
|
||||
(symbol_c[point * 2 + 1] - 1.0f) * icon_size);
|
||||
}
|
||||
p.drawPolygon(c_icon.data(), static_cast<int>(c_icon.size()));
|
||||
break;
|
||||
case Symbol::ZL:
|
||||
for (std::size_t point = 0; point < symbol_zl.size() / 2; ++point) {
|
||||
zl_icon[point] = center + QPointF(symbol_zl[point * 2] * icon_size,
|
||||
symbol_zl[point * 2 + 1] * icon_size);
|
||||
}
|
||||
p.drawPolygon(zl_icon.data(), static_cast<int>(zl_icon.size()));
|
||||
break;
|
||||
case Symbol::SL:
|
||||
for (std::size_t point = 0; point < symbol_sl.size() / 2; ++point) {
|
||||
sl_icon[point] = center + QPointF(symbol_sl[point * 2] * icon_size,
|
||||
symbol_sl[point * 2 + 1] * icon_size);
|
||||
}
|
||||
p.drawPolygon(sl_icon.data(), static_cast<int>(sl_icon.size()));
|
||||
break;
|
||||
case Symbol::ZR:
|
||||
for (std::size_t point = 0; point < symbol_zr.size() / 2; ++point) {
|
||||
zr_icon[point] = center + QPointF(symbol_zr[point * 2] * icon_size,
|
||||
symbol_zr[point * 2 + 1] * icon_size);
|
||||
}
|
||||
p.drawPolygon(zr_icon.data(), static_cast<int>(zr_icon.size()));
|
||||
break;
|
||||
case Symbol::SR:
|
||||
for (std::size_t point = 0; point < symbol_sr.size() / 2; ++point) {
|
||||
sr_icon[point] = center + QPointF(symbol_sr[point * 2] * icon_size,
|
||||
symbol_sr[point * 2 + 1] * icon_size);
|
||||
}
|
||||
p.drawPolygon(sr_icon.data(), static_cast<int>(sr_icon.size()));
|
||||
break;
|
||||
case Symbol::Charging:
|
||||
for (std::size_t point = 0; point < symbol_charging.size() / 2; ++point) {
|
||||
charging_icon[point] = center + QPointF(symbol_charging[point * 2] * icon_size,
|
||||
symbol_charging[point * 2 + 1] * icon_size);
|
||||
}
|
||||
p.drawPolygon(charging_icon.data(), static_cast<int>(charging_icon.size()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void CommonShapes::DrawArrow(QPainter& p, const QPointF center, const Direction direction,
|
||||
float size) {
|
||||
|
||||
std::array<QPointF, up_arrow_symbol.size() / 2> arrow_symbol;
|
||||
|
||||
for (std::size_t point = 0; point < up_arrow_symbol.size() / 2; ++point) {
|
||||
const float up_arrow_x = up_arrow_symbol[point * 2 + 0];
|
||||
const float up_arrow_y = up_arrow_symbol[point * 2 + 1];
|
||||
|
||||
switch (direction) {
|
||||
case Direction::Up:
|
||||
arrow_symbol[point] = center + QPointF(up_arrow_x * size, up_arrow_y * size);
|
||||
break;
|
||||
case Direction::Left:
|
||||
arrow_symbol[point] = center + QPointF(up_arrow_y * size, up_arrow_x * size);
|
||||
break;
|
||||
case Direction::Right:
|
||||
arrow_symbol[point] = center + QPointF(-up_arrow_y * size, up_arrow_x * size);
|
||||
break;
|
||||
case Direction::Down:
|
||||
arrow_symbol[point] = center + QPointF(up_arrow_x * size, -up_arrow_y * size);
|
||||
break;
|
||||
case Direction::None:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DrawPolygon(p, arrow_symbol);
|
||||
}
|
||||
|
||||
template <size_t N>
|
||||
void CommonShapes::DrawPolygon(QPainter& p, const std::array<QPointF, N>& polygon) {
|
||||
p.drawPolygon(polygon.data(), static_cast<int>(polygon.size()));
|
||||
}
|
||||
|
||||
void CommonShapes::DrawCircle(QPainter& p, const QPointF center, float size) {
|
||||
p.drawEllipse(center, size, size);
|
||||
}
|
||||
|
||||
void CommonShapes::DrawRectangle(QPainter& p, const QPointF center, float width, float height) {
|
||||
const QRectF rect = QRectF(center.x() - (width / 2), center.y() - (height / 2), width, height);
|
||||
p.drawRect(rect);
|
||||
}
|
||||
void CommonShapes::DrawRoundRectangle(QPainter& p, const QPointF center, float width, float height,
|
||||
float round) {
|
||||
const QRectF rect = QRectF(center.x() - (width / 2), center.y() - (height / 2), width, height);
|
||||
p.drawRoundedRect(rect, round, round);
|
||||
}
|
||||
|
||||
void CommonShapes::DrawText(QPainter& p, const QPointF center, float text_size,
|
||||
const QString& text) {
|
||||
SetTextFont(p, text_size);
|
||||
const QFontMetrics fm(p.font());
|
||||
const QPointF offset = {fm.horizontalAdvance(text) / 2.0f, -text_size / 2.0f};
|
||||
p.drawText(center - offset, text);
|
||||
}
|
||||
|
||||
void CommonShapes::SetTextFont(QPainter& p, float text_size, const QString& font_family) {
|
||||
QFont font = p.font();
|
||||
font.setPointSizeF(text_size);
|
||||
font.setFamily(font_family);
|
||||
p.setFont(font);
|
||||
}
|
||||
|
||||
constexpr std::array<float, 13 * 2> symbol_a = {
|
||||
-1.085f, -5.2f, 1.085f, -5.2f, 5.085f, 5.0f, 2.785f, 5.0f, 1.785f,
|
||||
2.65f, -1.785f, 2.65f, -2.785f, 5.0f, -5.085f, 5.0f, -1.4f, 1.0f,
|
||||
0.0f, -2.8f, 1.4f, 1.0f, -1.4f, 1.0f, -5.085f, 5.0f,
|
||||
};
|
||||
|
||||
constexpr std::array<float, 134 * 2> symbol_b = {
|
||||
-4.0f, 0.0f, -4.0f, 0.0f, -4.0f, -0.1f, -3.8f, -5.1f, 1.8f, -5.0f, 2.3f, -4.9f, 2.6f,
|
||||
-4.8f, 2.8f, -4.7f, 2.9f, -4.6f, 3.1f, -4.5f, 3.2f, -4.4f, 3.4f, -4.3f, 3.4f, -4.2f,
|
||||
3.5f, -4.1f, 3.7f, -4.0f, 3.7f, -3.9f, 3.8f, -3.8f, 3.8f, -3.7f, 3.9f, -3.6f, 3.9f,
|
||||
-3.5f, 4.0f, -3.4f, 4.0f, -3.3f, 4.1f, -3.1f, 4.1f, -3.0f, 4.0f, -2.0f, 4.0f, -1.9f,
|
||||
3.9f, -1.7f, 3.9f, -1.6f, 3.8f, -1.5f, 3.8f, -1.4f, 3.7f, -1.3f, 3.7f, -1.2f, 3.6f,
|
||||
-1.1f, 3.6f, -1.0f, 3.5f, -0.9f, 3.3f, -0.8f, 3.3f, -0.7f, 3.2f, -0.6f, 3.0f, -0.5f,
|
||||
2.9f, -0.4f, 2.7f, -0.3f, 2.9f, -0.2f, 3.2f, -0.1f, 3.3f, 0.0f, 3.5f, 0.1f, 3.6f,
|
||||
0.2f, 3.8f, 0.3f, 3.9f, 0.4f, 4.0f, 0.6f, 4.1f, 0.7f, 4.3f, 0.8f, 4.3f, 0.9f,
|
||||
4.4f, 1.0f, 4.4f, 1.1f, 4.5f, 1.3f, 4.5f, 1.4f, 4.6f, 1.6f, 4.6f, 1.7f, 4.5f,
|
||||
2.8f, 4.5f, 2.9f, 4.4f, 3.1f, 4.4f, 3.2f, 4.3f, 3.4f, 4.3f, 3.5f, 4.2f, 3.6f,
|
||||
4.2f, 3.7f, 4.1f, 3.8f, 4.1f, 3.9f, 4.0f, 4.0f, 3.9f, 4.2f, 3.8f, 4.3f, 3.6f,
|
||||
4.4f, 3.6f, 4.5f, 3.4f, 4.6f, 3.3f, 4.7f, 3.1f, 4.8f, 2.8f, 4.9f, 2.6f, 5.0f,
|
||||
2.1f, 5.1f, -4.0f, 5.0f, -4.0f, 4.9f,
|
||||
|
||||
-4.0f, 0.0f, 1.1f, 3.4f, 1.1f, 3.4f, 1.5f, 3.3f, 1.8f, 3.2f, 2.0f, 3.1f, 2.1f,
|
||||
3.0f, 2.3f, 2.9f, 2.3f, 2.8f, 2.4f, 2.7f, 2.4f, 2.6f, 2.5f, 2.3f, 2.5f, 2.2f,
|
||||
2.4f, 1.7f, 2.4f, 1.6f, 2.3f, 1.4f, 2.3f, 1.3f, 2.2f, 1.2f, 2.2f, 1.1f, 2.1f,
|
||||
1.0f, 1.9f, 0.9f, 1.6f, 0.8f, 1.4f, 0.7f, -1.9f, 0.6f, -1.9f, 0.7f, -1.8f, 3.4f,
|
||||
1.1f, 3.4f, -4.0f, 0.0f,
|
||||
|
||||
0.3f, -1.1f, 0.3f, -1.1f, 1.3f, -1.2f, 1.5f, -1.3f, 1.8f, -1.4f, 1.8f, -1.5f, 1.9f,
|
||||
-1.6f, 2.0f, -1.8f, 2.0f, -1.9f, 2.1f, -2.0f, 2.1f, -2.1f, 2.0f, -2.7f, 2.0f, -2.8f,
|
||||
1.9f, -2.9f, 1.9f, -3.0f, 1.8f, -3.1f, 1.6f, -3.2f, 1.6f, -3.3f, 1.3f, -3.4f, -1.9f,
|
||||
-3.3f, -1.9f, -3.2f, -1.8f, -1.0f, 0.2f, -1.1f, 0.3f, -1.1f, -4.0f, 0.0f,
|
||||
};
|
||||
|
||||
constexpr std::array<float, 9 * 2> symbol_y = {
|
||||
-4.79f, -4.9f, -2.44f, -4.9f, 0.0f, -0.9f, 2.44f, -4.9f, 4.79f,
|
||||
-4.9f, 1.05f, 1.0f, 1.05f, 5.31f, -1.05f, 5.31f, -1.05f, 1.0f,
|
||||
|
||||
};
|
||||
|
||||
constexpr std::array<float, 12 * 2> symbol_x = {
|
||||
-4.4f, -5.0f, -2.0f, -5.0f, 0.0f, -1.7f, 2.0f, -5.0f, 4.4f, -5.0f, 1.2f, 0.0f,
|
||||
4.4f, 5.0f, 2.0f, 5.0f, 0.0f, 1.7f, -2.0f, 5.0f, -4.4f, 5.0f, -1.2f, 0.0f,
|
||||
|
||||
};
|
||||
|
||||
constexpr std::array<float, 7 * 2> symbol_l = {
|
||||
2.4f, -3.23f, 2.4f, 2.1f, 5.43f, 2.1f, 5.43f, 3.22f, 0.98f, 3.22f, 0.98f, -3.23f, 2.4f, -3.23f,
|
||||
};
|
||||
|
||||
constexpr std::array<float, 98 * 2> symbol_r = {
|
||||
1.0f, 0.0f, 1.0f, -0.1f, 1.1f, -3.3f, 4.3f, -3.2f, 5.1f, -3.1f, 5.4f, -3.0f, 5.6f, -2.9f,
|
||||
5.7f, -2.8f, 5.9f, -2.7f, 5.9f, -2.6f, 6.0f, -2.5f, 6.1f, -2.3f, 6.2f, -2.2f, 6.2f, -2.1f,
|
||||
6.3f, -2.0f, 6.3f, -1.9f, 6.2f, -0.8f, 6.2f, -0.7f, 6.1f, -0.6f, 6.1f, -0.5f, 6.0f, -0.4f,
|
||||
6.0f, -0.3f, 5.9f, -0.2f, 5.7f, -0.1f, 5.7f, 0.0f, 5.6f, 0.1f, 5.4f, 0.2f, 5.1f, 0.3f,
|
||||
4.7f, 0.4f, 4.7f, 0.5f, 4.9f, 0.6f, 5.0f, 0.7f, 5.2f, 0.8f, 5.2f, 0.9f, 5.3f, 1.0f,
|
||||
5.5f, 1.1f, 5.5f, 1.2f, 5.6f, 1.3f, 5.7f, 1.5f, 5.8f, 1.6f, 5.9f, 1.8f, 6.0f, 1.9f,
|
||||
6.1f, 2.1f, 6.2f, 2.2f, 6.2f, 2.3f, 6.3f, 2.4f, 6.4f, 2.6f, 6.5f, 2.7f, 6.6f, 2.9f,
|
||||
6.7f, 3.0f, 6.7f, 3.1f, 6.8f, 3.2f, 6.8f, 3.3f, 5.3f, 3.2f, 5.2f, 3.1f, 5.2f, 3.0f,
|
||||
5.1f, 2.9f, 5.0f, 2.7f, 4.9f, 2.6f, 4.8f, 2.4f, 4.7f, 2.3f, 4.6f, 2.1f, 4.5f, 2.0f,
|
||||
4.4f, 1.8f, 4.3f, 1.7f, 4.1f, 1.4f, 4.0f, 1.3f, 3.9f, 1.1f, 3.8f, 1.0f, 3.6f, 0.9f,
|
||||
3.6f, 0.8f, 3.5f, 0.7f, 3.3f, 0.6f, 2.9f, 0.5f, 2.3f, 0.6f, 2.3f, 0.7f, 2.2f, 3.3f,
|
||||
1.0f, 3.2f, 1.0f, 3.1f, 1.0f, 0.0f,
|
||||
|
||||
4.2f, -0.5f, 4.4f, -0.6f, 4.7f, -0.7f, 4.8f, -0.8f, 4.9f, -1.0f, 5.0f, -1.1f, 5.0f, -1.2f,
|
||||
4.9f, -1.7f, 4.9f, -1.8f, 4.8f, -1.9f, 4.8f, -2.0f, 4.6f, -2.1f, 4.3f, -2.2f, 2.3f, -2.1f,
|
||||
2.3f, -2.0f, 2.4f, -0.5f, 4.2f, -0.5f, 1.0f, 0.0f,
|
||||
};
|
||||
|
||||
constexpr std::array<float, 18 * 2> symbol_zl = {
|
||||
-2.6f, -2.13f, -5.6f, -2.13f, -5.6f, -3.23f, -0.8f, -3.23f, -0.8f, -2.13f, -4.4f, 2.12f,
|
||||
-0.7f, 2.12f, -0.7f, 3.22f, -6.0f, 3.22f, -6.0f, 2.12f, 2.4f, -3.23f, 2.4f, 2.1f,
|
||||
5.43f, 2.1f, 5.43f, 3.22f, 0.98f, 3.22f, 0.98f, -3.23f, 2.4f, -3.23f, -6.0f, 2.12f,
|
||||
};
|
||||
|
||||
constexpr std::array<float, 57 * 2> symbol_sl = {
|
||||
-3.0f, -3.65f, -2.76f, -4.26f, -2.33f, -4.76f, -1.76f, -5.09f, -1.13f, -5.26f, -0.94f,
|
||||
-4.77f, -0.87f, -4.11f, -1.46f, -3.88f, -1.91f, -3.41f, -2.05f, -2.78f, -1.98f, -2.13f,
|
||||
-1.59f, -1.61f, -0.96f, -1.53f, -0.56f, -2.04f, -0.38f, -2.67f, -0.22f, -3.31f, 0.0f,
|
||||
-3.93f, 0.34f, -4.49f, 0.86f, -4.89f, 1.49f, -5.05f, 2.14f, -4.95f, 2.69f, -4.6f,
|
||||
3.07f, -4.07f, 3.25f, -3.44f, 3.31f, -2.78f, 3.25f, -2.12f, 3.07f, -1.49f, 2.7f,
|
||||
-0.95f, 2.16f, -0.58f, 1.52f, -0.43f, 1.41f, -0.99f, 1.38f, -1.65f, 1.97f, -1.91f,
|
||||
2.25f, -2.49f, 2.25f, -3.15f, 1.99f, -3.74f, 1.38f, -3.78f, 1.06f, -3.22f, 0.88f,
|
||||
-2.58f, 0.71f, -1.94f, 0.49f, -1.32f, 0.13f, -0.77f, -0.4f, -0.4f, -1.04f, -0.25f,
|
||||
-1.69f, -0.32f, -2.28f, -0.61f, -2.73f, -1.09f, -2.98f, -1.69f, -3.09f, -2.34f,
|
||||
|
||||
3.23f, 2.4f, -2.1f, 2.4f, -2.1f, 5.43f, -3.22f, 5.43f, -3.22f, 0.98f, 3.23f,
|
||||
0.98f, 3.23f, 2.4f, -3.09f, -2.34f,
|
||||
};
|
||||
constexpr std::array<float, 109 * 2> symbol_zr = {
|
||||
-2.6f, -2.13f, -5.6f, -2.13f, -5.6f, -3.23f, -0.8f, -3.23f, -0.8f, -2.13f, -4.4f, 2.12f, -0.7f,
|
||||
2.12f, -0.7f, 3.22f, -6.0f, 3.22f, -6.0f, 2.12f,
|
||||
|
||||
1.0f, 0.0f, 1.0f, -0.1f, 1.1f, -3.3f, 4.3f, -3.2f, 5.1f, -3.1f, 5.4f, -3.0f, 5.6f,
|
||||
-2.9f, 5.7f, -2.8f, 5.9f, -2.7f, 5.9f, -2.6f, 6.0f, -2.5f, 6.1f, -2.3f, 6.2f, -2.2f,
|
||||
6.2f, -2.1f, 6.3f, -2.0f, 6.3f, -1.9f, 6.2f, -0.8f, 6.2f, -0.7f, 6.1f, -0.6f, 6.1f,
|
||||
-0.5f, 6.0f, -0.4f, 6.0f, -0.3f, 5.9f, -0.2f, 5.7f, -0.1f, 5.7f, 0.0f, 5.6f, 0.1f,
|
||||
5.4f, 0.2f, 5.1f, 0.3f, 4.7f, 0.4f, 4.7f, 0.5f, 4.9f, 0.6f, 5.0f, 0.7f, 5.2f,
|
||||
0.8f, 5.2f, 0.9f, 5.3f, 1.0f, 5.5f, 1.1f, 5.5f, 1.2f, 5.6f, 1.3f, 5.7f, 1.5f,
|
||||
5.8f, 1.6f, 5.9f, 1.8f, 6.0f, 1.9f, 6.1f, 2.1f, 6.2f, 2.2f, 6.2f, 2.3f, 6.3f,
|
||||
2.4f, 6.4f, 2.6f, 6.5f, 2.7f, 6.6f, 2.9f, 6.7f, 3.0f, 6.7f, 3.1f, 6.8f, 3.2f,
|
||||
6.8f, 3.3f, 5.3f, 3.2f, 5.2f, 3.1f, 5.2f, 3.0f, 5.1f, 2.9f, 5.0f, 2.7f, 4.9f,
|
||||
2.6f, 4.8f, 2.4f, 4.7f, 2.3f, 4.6f, 2.1f, 4.5f, 2.0f, 4.4f, 1.8f, 4.3f, 1.7f,
|
||||
4.1f, 1.4f, 4.0f, 1.3f, 3.9f, 1.1f, 3.8f, 1.0f, 3.6f, 0.9f, 3.6f, 0.8f, 3.5f,
|
||||
0.7f, 3.3f, 0.6f, 2.9f, 0.5f, 2.3f, 0.6f, 2.3f, 0.7f, 2.2f, 3.3f, 1.0f, 3.2f,
|
||||
1.0f, 3.1f, 1.0f, 0.0f,
|
||||
|
||||
4.2f, -0.5f, 4.4f, -0.6f, 4.7f, -0.7f, 4.8f, -0.8f, 4.9f, -1.0f, 5.0f, -1.1f, 5.0f,
|
||||
-1.2f, 4.9f, -1.7f, 4.9f, -1.8f, 4.8f, -1.9f, 4.8f, -2.0f, 4.6f, -2.1f, 4.3f, -2.2f,
|
||||
2.3f, -2.1f, 2.3f, -2.0f, 2.4f, -0.5f, 4.2f, -0.5f, 1.0f, 0.0f, -6.0f, 2.12f,
|
||||
};
|
||||
|
||||
constexpr std::array<float, 148 * 2> symbol_sr = {
|
||||
-3.0f, -3.65f, -2.76f, -4.26f, -2.33f, -4.76f, -1.76f, -5.09f, -1.13f, -5.26f, -0.94f, -4.77f,
|
||||
-0.87f, -4.11f, -1.46f, -3.88f, -1.91f, -3.41f, -2.05f, -2.78f, -1.98f, -2.13f, -1.59f, -1.61f,
|
||||
-0.96f, -1.53f, -0.56f, -2.04f, -0.38f, -2.67f, -0.22f, -3.31f, 0.0f, -3.93f, 0.34f, -4.49f,
|
||||
0.86f, -4.89f, 1.49f, -5.05f, 2.14f, -4.95f, 2.69f, -4.6f, 3.07f, -4.07f, 3.25f, -3.44f,
|
||||
3.31f, -2.78f, 3.25f, -2.12f, 3.07f, -1.49f, 2.7f, -0.95f, 2.16f, -0.58f, 1.52f, -0.43f,
|
||||
1.41f, -0.99f, 1.38f, -1.65f, 1.97f, -1.91f, 2.25f, -2.49f, 2.25f, -3.15f, 1.99f, -3.74f,
|
||||
1.38f, -3.78f, 1.06f, -3.22f, 0.88f, -2.58f, 0.71f, -1.94f, 0.49f, -1.32f, 0.13f, -0.77f,
|
||||
-0.4f, -0.4f, -1.04f, -0.25f, -1.69f, -0.32f, -2.28f, -0.61f, -2.73f, -1.09f, -2.98f, -1.69f,
|
||||
-3.09f, -2.34f,
|
||||
|
||||
-1.0f, 0.0f, 0.1f, 1.0f, 3.3f, 1.1f, 3.2f, 4.3f, 3.1f, 5.1f, 3.0f, 5.4f,
|
||||
2.9f, 5.6f, 2.8f, 5.7f, 2.7f, 5.9f, 2.6f, 5.9f, 2.5f, 6.0f, 2.3f, 6.1f,
|
||||
2.2f, 6.2f, 2.1f, 6.2f, 2.0f, 6.3f, 1.9f, 6.3f, 0.8f, 6.2f, 0.7f, 6.2f,
|
||||
0.6f, 6.1f, 0.5f, 6.1f, 0.4f, 6.0f, 0.3f, 6.0f, 0.2f, 5.9f, 0.1f, 5.7f,
|
||||
0.0f, 5.7f, -0.1f, 5.6f, -0.2f, 5.4f, -0.3f, 5.1f, -0.4f, 4.7f, -0.5f, 4.7f,
|
||||
-0.6f, 4.9f, -0.7f, 5.0f, -0.8f, 5.2f, -0.9f, 5.2f, -1.0f, 5.3f, -1.1f, 5.5f,
|
||||
-1.2f, 5.5f, -1.3f, 5.6f, -1.5f, 5.7f, -1.6f, 5.8f, -1.8f, 5.9f, -1.9f, 6.0f,
|
||||
-2.1f, 6.1f, -2.2f, 6.2f, -2.3f, 6.2f, -2.4f, 6.3f, -2.6f, 6.4f, -2.7f, 6.5f,
|
||||
-2.9f, 6.6f, -3.0f, 6.7f, -3.1f, 6.7f, -3.2f, 6.8f, -3.3f, 6.8f, -3.2f, 5.3f,
|
||||
-3.1f, 5.2f, -3.0f, 5.2f, -2.9f, 5.1f, -2.7f, 5.0f, -2.6f, 4.9f, -2.4f, 4.8f,
|
||||
-2.3f, 4.7f, -2.1f, 4.6f, -2.0f, 4.5f, -1.8f, 4.4f, -1.7f, 4.3f, -1.4f, 4.1f,
|
||||
-1.3f, 4.0f, -1.1f, 3.9f, -1.0f, 3.8f, -0.9f, 3.6f, -0.8f, 3.6f, -0.7f, 3.5f,
|
||||
-0.6f, 3.3f, -0.5f, 2.9f, -0.6f, 2.3f, -0.7f, 2.3f, -3.3f, 2.2f, -3.2f, 1.0f,
|
||||
-3.1f, 1.0f, 0.0f, 1.0f,
|
||||
|
||||
0.5f, 4.2f, 0.6f, 4.4f, 0.7f, 4.7f, 0.8f, 4.8f, 1.0f, 4.9f, 1.1f, 5.0f,
|
||||
1.2f, 5.0f, 1.7f, 4.9f, 1.8f, 4.9f, 1.9f, 4.8f, 2.0f, 4.8f, 2.1f, 4.6f,
|
||||
2.2f, 4.3f, 2.1f, 2.3f, 2.0f, 2.3f, 0.5f, 2.4f, 0.5f, 4.2f, -0.0f, 1.0f,
|
||||
-3.09f, -2.34f,
|
||||
|
||||
};
|
||||
|
||||
constexpr std::array<float, 30 * 2> symbol_c = {
|
||||
2.86f, 7.57f, 0.99f, 7.94f, -0.91f, 7.87f, -2.73f, 7.31f, -4.23f, 6.14f, -5.2f, 4.51f,
|
||||
-5.65f, 2.66f, -5.68f, 0.75f, -5.31f, -1.12f, -4.43f, -2.81f, -3.01f, -4.08f, -1.24f, -4.78f,
|
||||
0.66f, -4.94f, 2.54f, -4.67f, 4.33f, -4.0f, 4.63f, -2.27f, 3.37f, -2.7f, 1.6f, -3.4f,
|
||||
-0.3f, -3.5f, -2.09f, -2.87f, -3.34f, -1.45f, -3.91f, 0.37f, -3.95f, 2.27f, -3.49f, 4.12f,
|
||||
-2.37f, 5.64f, -0.65f, 6.44f, 1.25f, 6.47f, 3.06f, 5.89f, 4.63f, 4.92f, 4.63f, 6.83f,
|
||||
};
|
||||
|
||||
constexpr std::array<float, 6 * 2> symbol_charging = {
|
||||
6.5f, -1.0f, 1.0f, -1.0f, 1.0f, -3.0f, -6.5f, 1.0f, -1.0f, 1.0f, -1.0f, 3.0f,
|
||||
};
|
||||
|
||||
constexpr std::array<float, 12 * 2> house = {
|
||||
-1.3f, 0.0f, -0.93f, 0.0f, -0.93f, 1.15f, 0.93f, 1.15f, 0.93f, 0.0f, 1.3f, 0.0f,
|
||||
0.0f, -1.2f, -1.3f, 0.0f, -0.43f, 0.0f, -0.43f, .73f, 0.43f, .73f, 0.43f, 0.0f,
|
||||
};
|
||||
|
||||
constexpr std::array<float, 11 * 2> up_arrow_button = {
|
||||
9.1f, -9.1f, 9.1f, -30.0f, 8.1f, -30.1f, 7.7f, -30.1f, -8.6f, -30.0f, -9.0f,
|
||||
-29.8f, -9.3f, -29.5f, -9.5f, -29.1f, -9.1f, -28.7f, -9.1f, -9.1f, 0.0f, 0.6f,
|
||||
};
|
||||
|
||||
constexpr std::array<float, 3 * 2> up_arrow_symbol = {
|
||||
0.0f, -3.0f, -3.0f, 2.0f, 3.0f, 2.0f,
|
||||
};
|
||||
|
||||
} // namespace ControllerViewer
|
@ -1,65 +0,0 @@
|
||||
// Copyright 2020 yuzu Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <QColor>
|
||||
#include <QPointer>
|
||||
|
||||
#include "common\common_types.h"
|
||||
|
||||
namespace Common::Input {
|
||||
enum class BatteryLevel : u32;
|
||||
}
|
||||
|
||||
namespace ControllerViewer {
|
||||
|
||||
// Widget for representing controller animations
|
||||
class CommonShapes {
|
||||
|
||||
enum class Direction : std::size_t {
|
||||
None,
|
||||
Up,
|
||||
Right,
|
||||
Down,
|
||||
Left,
|
||||
};
|
||||
|
||||
enum class Symbol {
|
||||
House,
|
||||
A,
|
||||
B,
|
||||
X,
|
||||
Y,
|
||||
L,
|
||||
R,
|
||||
C,
|
||||
SL,
|
||||
ZL,
|
||||
ZR,
|
||||
SR,
|
||||
Charging,
|
||||
};
|
||||
|
||||
// Draw battery functions
|
||||
void DrawBattery(QPainter& p, QPointF center, Common::Input::BatteryLevel battery,
|
||||
QColor outline, QColor battery_color, QColor charging_outline,
|
||||
QColor charging_color);
|
||||
|
||||
// Draw icon functions
|
||||
void DrawSymbol(QPainter& p, QPointF center, Symbol symbol, float icon_size);
|
||||
void DrawArrow(QPainter& p, QPointF center, Direction direction, float size);
|
||||
|
||||
// Draw primitive types
|
||||
template <size_t N>
|
||||
void DrawPolygon(QPainter& p, const std::array<QPointF, N>& polygon);
|
||||
void DrawCircle(QPainter& p, QPointF center, float size);
|
||||
void DrawRectangle(QPainter& p, QPointF center, float width, float height);
|
||||
void DrawRoundRectangle(QPainter& p, QPointF center, float width, float height, float round);
|
||||
void DrawText(QPainter& p, QPointF center, float text_size, const QString& text);
|
||||
void SetTextFont(QPainter& p, float text_size,
|
||||
const QString& font_family = QStringLiteral("sans-serif"));
|
||||
};
|
||||
} // namespace ControllerViewer
|
@ -1,77 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <QColor>
|
||||
#include <QPainter>
|
||||
#include <QPointer>
|
||||
|
||||
#include "common/input.h"
|
||||
#include "common/settings_input.h"
|
||||
#include "core/hid/emulated_controller.h"
|
||||
#include "core/hid/hid_types.h"
|
||||
|
||||
namespace ControllerViewer {
|
||||
|
||||
using AnalogParam = std::array<Common::ParamPackage, Settings::NativeAnalog::NumAnalogs>;
|
||||
using ButtonParam = std::array<Common::ParamPackage, Settings::NativeButton::NumButtons>;
|
||||
|
||||
enum class Theme {
|
||||
White,
|
||||
Dark,
|
||||
Midnight,
|
||||
};
|
||||
|
||||
// Widget for representing controller animations
|
||||
class ControllerBase {
|
||||
struct ColorMapping {
|
||||
QColor outline{};
|
||||
QColor primary{};
|
||||
QColor left{};
|
||||
QColor right{};
|
||||
QColor button{};
|
||||
QColor button2{};
|
||||
QColor font{};
|
||||
QColor font2{};
|
||||
QColor highlight{};
|
||||
QColor highlight2{};
|
||||
QColor transparent{};
|
||||
QColor indicator{};
|
||||
QColor indicator2{};
|
||||
QColor led_on{};
|
||||
QColor led_off{};
|
||||
QColor slider{};
|
||||
QColor slider_button{};
|
||||
QColor slider_arrow{};
|
||||
QColor deadzone{};
|
||||
QColor charging{};
|
||||
};
|
||||
|
||||
void DrawRawJoystick(QPainter& p, QPointF center_left, QPointF center_right);
|
||||
void DrawJoystickProperties(QPainter& p, QPointF center,
|
||||
const Common::Input::AnalogProperties& properties);
|
||||
|
||||
bool is_controller_set{};
|
||||
bool is_connected{};
|
||||
bool needs_redraw{};
|
||||
Core::HID::NpadStyleIndex controller_type;
|
||||
|
||||
bool mapping_active{};
|
||||
int blink_counter{};
|
||||
int callback_key;
|
||||
QColor button_color{};
|
||||
ColorMapping colors{};
|
||||
Core::HID::LedPattern led_pattern{0, 0, 0, 0};
|
||||
std::size_t player_index{};
|
||||
Core::HID::EmulatedController* controller;
|
||||
std::size_t button_mapping_index{Settings::NativeButton::NumButtons};
|
||||
std::size_t analog_mapping_index{Settings::NativeAnalog::NumAnalogs};
|
||||
Core::HID::ButtonValues button_values{};
|
||||
Core::HID::SticksValues stick_values{};
|
||||
Core::HID::TriggerValues trigger_values{};
|
||||
Core::HID::BatteryValues battery_values{};
|
||||
};
|
||||
|
||||
} // namespace ControllerViewer
|
@ -1,112 +0,0 @@
|
||||
// Copyright 2022 yuzu Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <algorithm>
|
||||
#include <QMenu>
|
||||
#include <QPainter>
|
||||
#include <QTimer>
|
||||
|
||||
#include "core/hid/emulated_controller.h"
|
||||
#include "yuzu/util/controller_viewer/controller_viewer.h"
|
||||
|
||||
namespace ControllerViewer {
|
||||
ControllerViewer::ControllerViewer(QWidget* parent) : QFrame(parent) {
|
||||
is_controller_set = false;
|
||||
QTimer* timer = new QTimer(this);
|
||||
connect(timer, &QTimer::timeout, this, QOverload<>::of(&ControllerViewer::UpdateInput));
|
||||
|
||||
// refresh at 60hz
|
||||
timer->start(16);
|
||||
}
|
||||
|
||||
ControllerViewer::~ControllerViewer() {
|
||||
UnloadController();
|
||||
};
|
||||
|
||||
void ControllerViewer::SetController(Core::HID::EmulatedController* controller_) {
|
||||
UnloadController();
|
||||
is_controller_set = true;
|
||||
controller = controller_;
|
||||
Core::HID::ControllerUpdateCallback engine_callback{
|
||||
.on_change = [this](Core::HID::ControllerTriggerType type) { ControllerUpdate(type); },
|
||||
.is_npad_service = false,
|
||||
};
|
||||
callback_key = controller->SetCallback(engine_callback);
|
||||
ControllerUpdate(Core::HID::ControllerTriggerType::All);
|
||||
}
|
||||
|
||||
void ControllerViewer::UnloadController() {
|
||||
if (is_controller_set) {
|
||||
controller->DeleteCallback(callback_key);
|
||||
is_controller_set = false;
|
||||
}
|
||||
}
|
||||
|
||||
void ControllerViewer::BeginMappingButton(std::size_t button_id) {
|
||||
controller_view.BeginMappingButton(button_id);
|
||||
}
|
||||
|
||||
void ControllerViewer::BeginMappingAnalog(std::size_t stick_id) {
|
||||
controller_view.BeginMappingAnalog(stick_id);
|
||||
}
|
||||
|
||||
void ControllerViewer::EndMapping() {
|
||||
controller_view.EndMapping();
|
||||
}
|
||||
|
||||
void ControllerViewer::UpdateColors() {
|
||||
if (QIcon::themeName().contains(QStringLiteral("dark"))) {
|
||||
controller_view.UpdateColors(Theme::Midnight);
|
||||
return;
|
||||
}
|
||||
|
||||
if (QIcon::themeName().contains(QStringLiteral("midnight"))) {
|
||||
controller_view.UpdateColors(Theme::Midnight);
|
||||
return;
|
||||
}
|
||||
|
||||
controller_view.UpdateColors(Theme::White);
|
||||
}
|
||||
|
||||
void ControllerViewer::ResetInputs() {
|
||||
controller_view.ResetInputs();
|
||||
}
|
||||
|
||||
void ControllerViewer::ControllerUpdate(Core::HID::ControllerTriggerType type) {
|
||||
if (type == Core::HID::ControllerTriggerType::All) {
|
||||
ControllerUpdate(Core::HID::ControllerTriggerType::Color);
|
||||
ControllerUpdate(Core::HID::ControllerTriggerType::Type);
|
||||
ControllerUpdate(Core::HID::ControllerTriggerType::Connected);
|
||||
ControllerUpdate(Core::HID::ControllerTriggerType::Button);
|
||||
ControllerUpdate(Core::HID::ControllerTriggerType::Stick);
|
||||
ControllerUpdate(Core::HID::ControllerTriggerType::Trigger);
|
||||
ControllerUpdate(Core::HID::ControllerTriggerType::Battery);
|
||||
return;
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case Core::HID::ControllerTriggerType::Type:
|
||||
controller_type = controller->GetNpadStyleIndex(true);
|
||||
needs_redraw = true;
|
||||
break;
|
||||
default:
|
||||
controller_view.ControllerUpdate(type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void ControllerViewer::UpdateInput() {
|
||||
controller_view.UpdateInput();
|
||||
}
|
||||
|
||||
void ControllerViewer::paintEvent(QPaintEvent* event) {
|
||||
QFrame::paintEvent(event);
|
||||
QPainter p(this);
|
||||
p.setRenderHint(QPainter::Antialiasing);
|
||||
const QPointF center = rect().center();
|
||||
|
||||
controller_view.DrawController(p, center);
|
||||
}
|
||||
|
||||
} // namespace ControllerViewer
|
@ -1,64 +0,0 @@
|
||||
// Copyright 2022 yuzu Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <QFrame>
|
||||
#include <QPointer>
|
||||
|
||||
#include "common/input.h"
|
||||
#include "common/settings_input.h"
|
||||
#include "core/hid/emulated_controller.h"
|
||||
#include "core/hid/hid_types.h"
|
||||
#include "yuzu/util/controller_viewer/controller_base.h"
|
||||
|
||||
namespace ControllerViewer {
|
||||
|
||||
// Widget for representing controller animations
|
||||
class ControllerViewer : public QFrame {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ControllerViewer(QWidget* parent);
|
||||
~ControllerViewer() override;
|
||||
|
||||
// Sets the emulated controller to be displayed
|
||||
void SetController(Core::HID::EmulatedController* controller);
|
||||
|
||||
// Disables events from the emulated controller
|
||||
void UnloadController();
|
||||
|
||||
// Starts blinking animation at the button specified
|
||||
void BeginMappingButton(std::size_t button_id);
|
||||
|
||||
// Starts moving animation at the stick specified
|
||||
void BeginMappingAnalog(std::size_t stick_id);
|
||||
|
||||
// Stops any ongoing animation
|
||||
void EndMapping();
|
||||
|
||||
// Handles emulated controller events
|
||||
void ControllerUpdate(Core::HID::ControllerTriggerType type);
|
||||
|
||||
// Updates input on sheduled interval
|
||||
void UpdateInput();
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent* event) override;
|
||||
|
||||
private:
|
||||
void UpdateColors();
|
||||
void ResetInputs();
|
||||
|
||||
bool is_controller_set{};
|
||||
bool is_connected{};
|
||||
bool needs_redraw{};
|
||||
|
||||
int callback_key;
|
||||
ControllerBase controller_view;
|
||||
Core::HID::EmulatedController* controller;
|
||||
};
|
||||
|
||||
} // namespace ControllerViewer
|
File diff suppressed because it is too large
Load Diff
@ -1,28 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <QFrame>
|
||||
#include <QPointer>
|
||||
|
||||
#include "util\controller_viewer\controller_base.h"
|
||||
|
||||
// Widget for representing controller animations
|
||||
class ProController : public PlayerControllerBase {
|
||||
void UpdateColors();
|
||||
void ResetInputs();
|
||||
|
||||
void DrawProController(QPainter& p, QPointF center);
|
||||
|
||||
void DrawGCBody(QPainter& p, QPointF center);
|
||||
|
||||
// Draw triggers functions
|
||||
void DrawProTriggers(QPainter& p, QPointF center,
|
||||
const Common::Input::ButtonStatus& left_pressed,
|
||||
const Common::Input::ButtonStatus& right_pressed);
|
||||
|
||||
void DrawProJoystick(QPainter& p, QPointF center, QPointF offset, float scalar,
|
||||
const Common::Input::ButtonStatus& pressed);
|
||||
};
|
Reference in New Issue
Block a user