diff --git a/cmake/BuildParameters.cmake b/cmake/BuildParameters.cmake index c8e0c6f8f3..5ec0f21feb 100644 --- a/cmake/BuildParameters.cmake +++ b/cmake/BuildParameters.cmake @@ -8,7 +8,6 @@ option(DISABLE_BUILD_DATE "Disable including the binary compile date") option(ENABLE_TESTS "Enables building the unit tests" ON) option(LTO_PCSX2_CORE "Enable LTO/IPO/LTCG on the subset of pcsx2 that benefits most from it but not anything else") option(USE_VTUNE "Plug VTUNE to profile GS JIT.") -option(USE_DISCORD_PRESENCE "Enable support for Discord Rich Presence" ON) #------------------------------------------------------------------------------- # Graphical option diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake index c17df0c50c..fe21b77fde 100644 --- a/cmake/SearchForStuff.cmake +++ b/cmake/SearchForStuff.cmake @@ -138,6 +138,8 @@ add_subdirectory(3rdparty/zydis EXCLUDE_FROM_ALL) add_subdirectory(3rdparty/zstd EXCLUDE_FROM_ALL) add_subdirectory(3rdparty/libzip EXCLUDE_FROM_ALL) add_subdirectory(3rdparty/rcheevos EXCLUDE_FROM_ALL) +add_subdirectory(3rdparty/rapidjson EXCLUDE_FROM_ALL) +add_subdirectory(3rdparty/discord-rpc EXCLUDE_FROM_ALL) if(USE_OPENGL) add_subdirectory(3rdparty/glad EXCLUDE_FROM_ALL) @@ -167,12 +169,6 @@ if (APPLE AND CMAKE_OSX_DEPLOYMENT_TARGET AND "${CMAKE_OSX_DEPLOYMENT_TARGET}" V endif() endif() -# Discord-RPC library for rich presence. -if(USE_DISCORD_PRESENCE) - add_subdirectory(3rdparty/rapidjson EXCLUDE_FROM_ALL) - add_subdirectory(3rdparty/discord-rpc EXCLUDE_FROM_ALL) -endif() - # Demangler for the debugger add_subdirectory(3rdparty/demangler EXCLUDE_FROM_ALL) diff --git a/pcsx2-qt/Settings/InterfaceSettingsWidget.cpp b/pcsx2-qt/Settings/InterfaceSettingsWidget.cpp index 393914dd9a..f89cd99814 100644 --- a/pcsx2-qt/Settings/InterfaceSettingsWidget.cpp +++ b/pcsx2-qt/Settings/InterfaceSettingsWidget.cpp @@ -81,6 +81,7 @@ InterfaceSettingsWidget::InterfaceSettingsWidget(SettingsDialog* dialog, QWidget SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.saveStateOnShutdown, "EmuCore", "SaveStateOnShutdown", false); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.pauseOnFocusLoss, "UI", "PauseOnFocusLoss", false); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.backupSaveStates, "EmuCore", "BackupSavestate", true); + SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.discordPresence, "EmuCore", "EnableDiscordPresence", false); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.startFullscreen, "UI", "StartFullscreen", false); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.doubleClickTogglesFullscreen, "UI", "DoubleClickTogglesFullscreen", @@ -129,12 +130,6 @@ InterfaceSettingsWidget::InterfaceSettingsWidget(SettingsDialog* dialog, QWidget m_ui.automaticUpdaterGroup->hide(); } -#ifdef ENABLE_DISCORD_PRESENCE - SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.discordPresence, "EmuCore", "EnableDiscordPresence", false); -#else - m_ui.discordPresence->setEnabled(false); -#endif - if (dialog->isPerGameSettings()) { // language/theme doesn't make sense to have in per-game settings diff --git a/pcsx2-qt/pcsx2-qt.vcxproj b/pcsx2-qt/pcsx2-qt.vcxproj index ee8aa3be43..e4d7d785c2 100644 --- a/pcsx2-qt/pcsx2-qt.vcxproj +++ b/pcsx2-qt/pcsx2-qt.vcxproj @@ -49,7 +49,7 @@ %(AdditionalIncludeDirectories);$(ProjectDir)\Settings;$(ProjectDir)\GameList;$(ProjectDir)\Tools\InputRecording;$(ProjectDir)\Debugger;$(ProjectDir)\Debugger\Models Use PrecompiledHeader.h - LZMA_API_STATIC;ENABLE_RAINTEGRATION;ENABLE_DISCORD_PRESENCE;ENABLE_OPENGL;ENABLE_VULKAN;%(PreprocessorDefinitions) + LZMA_API_STATIC;ENABLE_RAINTEGRATION;ENABLE_OPENGL;ENABLE_VULKAN;%(PreprocessorDefinitions) QT_NO_EXCEPTIONS;%(PreprocessorDefinitions) true diff --git a/pcsx2/CMakeLists.txt b/pcsx2/CMakeLists.txt index 9feae9b89e..679b498de8 100644 --- a/pcsx2/CMakeLists.txt +++ b/pcsx2/CMakeLists.txt @@ -863,10 +863,6 @@ if(WIN32) target_compile_definitions(PCSX2_FLAGS INTERFACE ENABLE_RAINTEGRATION) target_link_libraries(PCSX2_FLAGS INTERFACE rainterface) endif() -if(USE_DISCORD_PRESENCE) - target_compile_definitions(PCSX2_FLAGS INTERFACE ENABLE_DISCORD_PRESENCE) - target_link_libraries(PCSX2_FLAGS INTERFACE discord-rpc) -endif() if(WIN32) list(APPEND pcsx2InputSources Input/DInputSource.cpp @@ -1134,6 +1130,7 @@ target_link_libraries(PCSX2_FLAGS INTERFACE zydis cubeb rcheevos + discord-rpc SDL2::SDL2 ZLIB::ZLIB SoundTouch::SoundTouch diff --git a/pcsx2/ImGui/FullscreenUI.cpp b/pcsx2/ImGui/FullscreenUI.cpp index 215dcd7489..c9b710dc92 100644 --- a/pcsx2/ImGui/FullscreenUI.cpp +++ b/pcsx2/ImGui/FullscreenUI.cpp @@ -2765,10 +2765,8 @@ void FullscreenUI::DrawInterfaceSettingsPage() DrawToggleSetting(bsi, FSUI_ICONSTR(ICON_FA_MAGIC, "Inhibit Screensaver"), FSUI_CSTR("Prevents the screen saver from activating and the host from sleeping while emulation is running."), "EmuCore", "InhibitScreensaver", true); -#ifdef ENABLE_DISCORD_PRESENCE DrawToggleSetting(bsi, "Enable Discord Presence", FSUI_CSTR("Shows the game you are currently playing as part of your profile on Discord."), "UI", "DiscordPresence", false); -#endif DrawToggleSetting(bsi, FSUI_ICONSTR(ICON_FA_PAUSE, "Pause On Start"), FSUI_CSTR("Pauses the emulator when a game is started."), "UI", "StartPaused", false); DrawToggleSetting(bsi, FSUI_ICONSTR(ICON_FA_VIDEO, "Pause On Focus Loss"), diff --git a/pcsx2/VMManager.cpp b/pcsx2/VMManager.cpp index c9ceb2bfcc..2462736b83 100644 --- a/pcsx2/VMManager.cpp +++ b/pcsx2/VMManager.cpp @@ -65,6 +65,7 @@ #include "common/emitter/tools.h" #include "IconsFontAwesome5.h" +#include "discord_rpc.h" #include "fmt/core.h" #include @@ -85,10 +86,6 @@ #include "common/Darwin/DarwinMisc.h" #endif -#ifdef ENABLE_DISCORD_PRESENCE -#include "discord_rpc.h" -#endif - namespace VMManager { static void ApplyGameFixes(); @@ -192,9 +189,7 @@ static bool s_screensaver_inhibited = false; static PINEServer s_pine_server; -#ifdef ENABLE_DISCORD_PRESENCE static bool s_discord_presence_active = false; -#endif bool VMManager::PerformEarlyHardwareChecks(const char** error) { @@ -2966,8 +2961,6 @@ void VMManager::ReloadPINE() } } -#ifdef ENABLE_DISCORD_PRESENCE - void VMManager::InitializeDiscordPresence() { if (s_discord_presence_active) @@ -3028,22 +3021,3 @@ void VMManager::PollDiscordPresence() Discord_RunCallbacks(); } -#else // ENABLE_DISCORD_PRESENCE - -void VMManager::InitializeDiscordPresence() -{ -} - -void VMManager::ShutdownDiscordPresence() -{ -} - -void VMManager::UpdateDiscordPresence(const std::string& rich_presence) -{ -} - -void VMManager::PollDiscordPresence() -{ -} - -#endif // ENABLE_DISCORD_PRESENCE diff --git a/pcsx2/pcsx2.vcxproj b/pcsx2/pcsx2.vcxproj index 592dc8cee2..b648f8fbb2 100644 --- a/pcsx2/pcsx2.vcxproj +++ b/pcsx2/pcsx2.vcxproj @@ -64,7 +64,7 @@ Use PrecompiledHeader.h PrecompiledHeader.h;%(ForcedIncludeFiles) - LZMA_API_STATIC;ST_NO_EXCEPTION_HANDLING;ENABLE_DISCORD_PRESENCE;ENABLE_RAINTEGRATION;ENABLE_OPENGL;ENABLE_VULKAN;%(PreprocessorDefinitions) + LZMA_API_STATIC;ST_NO_EXCEPTION_HANDLING;ENABLE_RAINTEGRATION;ENABLE_OPENGL;ENABLE_VULKAN;%(PreprocessorDefinitions) XBYAK_NO_EXCEPTION;ZYCORE_STATIC_DEFINE;ZYDIS_STATIC_DEFINE;%(PreprocessorDefinitions) $(IntDir)%(RelativeDir)