From b6894bfc5b86c2fae0b401f2cfc294a08994781d Mon Sep 17 00:00:00 2001 From: lat9nq <22451773+lat9nq@users.noreply.github.com> Date: Fri, 3 Sep 2021 20:16:20 -0400 Subject: discord_impl: Remove global system instances --- src/yuzu/discord_impl.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/yuzu/discord_impl.cpp') diff --git a/src/yuzu/discord_impl.cpp b/src/yuzu/discord_impl.cpp index a93733b26..66f928af6 100644 --- a/src/yuzu/discord_impl.cpp +++ b/src/yuzu/discord_impl.cpp @@ -13,7 +13,7 @@ namespace DiscordRPC { -DiscordImpl::DiscordImpl() { +DiscordImpl::DiscordImpl(Core::System& system_) : system{system_} { DiscordEventHandlers handlers{}; // The number is the client ID for yuzu, it's used for images and the @@ -35,12 +35,13 @@ void DiscordImpl::Update() { std::chrono::system_clock::now().time_since_epoch()) .count(); std::string title; - if (Core::System::GetInstance().IsPoweredOn()) - Core::System::GetInstance().GetAppLoader().ReadTitle(title); + if (system.IsPoweredOn()) { + system.GetAppLoader().ReadTitle(title); + } DiscordRichPresence presence{}; presence.largeImageKey = "yuzu_logo"; presence.largeImageText = "yuzu is an emulator for the Nintendo Switch"; - if (Core::System::GetInstance().IsPoweredOn()) { + if (system.IsPoweredOn()) { presence.state = title.c_str(); presence.details = "Currently in game"; } else { -- cgit v1.2.3