Permalink
Browse files

Don't forget to update the other build systems and try to fix the

builds.
  • Loading branch information...
hrydgard committed Aug 12, 2018
1 parent 785858d commit 9c22f6ed55fabf299523c1a62989f55427ebd019
Showing with 26 additions and 8 deletions.
  1. +1 −0 CMakeLists.txt
  2. +18 −6 UI/DiscordIntegration.cpp
  3. +3 −1 UWP/UI_UWP/UI_UWP.vcxproj
  4. +3 −1 UWP/UI_UWP/UI_UWP.vcxproj.filters
  5. +1 −0 android/jni/Android.mk
@@ -822,6 +822,7 @@ endif()
list(APPEND NativeAppSource
android/jni/TestRunner.cpp
UI/DiscordIntegration.cpp
UI/NativeApp.cpp
UI/BackgroundAudio.cpp
UI/DevScreens.cpp
@@ -6,20 +6,22 @@
#include "Core/Config.h"
#include "DiscordIntegration.h"
#include "ext/discord-rpc/include/discord_rpc.h"
// TODO: Enable on more platforms. Make optional.
#ifdef _WIN32
const bool g_DiscordEnabled = true;
#define ENABLE_DISCORD
#else
const bool g_DiscordEnabled = true;
#endif
#ifdef ENABLE_DISCORD
#include "ext/discord-rpc/include/discord_rpc.h"
#endif
// TODO: Enable on more platforms. Make optional.
Discord g_Discord;
@@ -35,23 +37,27 @@ Discord::~Discord() {
}
bool Discord::IsEnabled() const {
return g_DiscordEnabled && g_Config.bDiscordPresence;
return g_Config.bDiscordPresence;
}
void Discord::Init() {
assert(IsEnabled());
assert(!initialized_);
#ifdef ENABLE_DISCORD
DiscordEventHandlers eventHandlers{};
eventHandlers.errored = &handleDiscordError;
Discord_Initialize(ppsspp_app_id, &eventHandlers, 0, nullptr);
#endif
initialized_ = true;
}
void Discord::Shutdown() {
assert(initialized_);
#ifdef ENABLE_DISCORD
Discord_Shutdown();
#endif
initialized_ = false;
}
@@ -67,10 +73,12 @@ void Discord::Update() {
}
}
#ifdef ENABLE_DISCORD
#ifdef DISCORD_DISABLE_IO_THREAD
Discord_UpdateConnection();
#endif
Discord_RunCallbacks();
#endif
}
void Discord::SetPresenceGame(const char *gameTitle) {
@@ -81,6 +89,7 @@ void Discord::SetPresenceGame(const char *gameTitle) {
Init();
}
#ifdef ENABLE_DISCORD
DiscordRichPresence discordPresence{};
discordPresence.state = gameTitle;
discordPresence.details = "Playing";
@@ -91,6 +100,7 @@ void Discord::SetPresenceGame(const char *gameTitle) {
discordPresence.largeImageKey = "icon_regular_png";
#endif
Discord_UpdatePresence(&discordPresence);
#endif
}
void Discord::SetPresenceMenu() {
@@ -101,6 +111,7 @@ void Discord::SetPresenceMenu() {
Init();
}
#ifdef ENABLE_DISCORD
DiscordRichPresence discordPresence{};
discordPresence.state = "In menu";
discordPresence.details = "";
@@ -111,4 +122,5 @@ void Discord::SetPresenceMenu() {
discordPresence.largeImageKey = "icon_regular_png";
#endif
Discord_UpdatePresence(&discordPresence);
#endif
}
@@ -304,6 +304,7 @@
<ClInclude Include="..\..\UI\ControlMappingScreen.h" />
<ClInclude Include="..\..\UI\CwCheatScreen.h" />
<ClInclude Include="..\..\UI\DevScreens.h" />
<ClInclude Include="..\..\UI\DiscordIntegration.h" />
<ClInclude Include="..\..\UI\DisplayLayoutEditor.h" />
<ClInclude Include="..\..\UI\DisplayLayoutScreen.h" />
<ClInclude Include="..\..\UI\EmuScreen.h" />
@@ -337,6 +338,7 @@
<ClCompile Include="..\..\UI\ControlMappingScreen.cpp" />
<ClCompile Include="..\..\UI\CwCheatScreen.cpp" />
<ClCompile Include="..\..\UI\DevScreens.cpp" />
<ClCompile Include="..\..\UI\DiscordIntegration.cpp" />
<ClCompile Include="..\..\UI\DisplayLayoutEditor.cpp" />
<ClCompile Include="..\..\UI\DisplayLayoutScreen.cpp" />
<ClCompile Include="..\..\UI\EmuScreen.cpp" />
@@ -376,4 +378,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
@@ -7,6 +7,7 @@
<ClCompile Include="..\..\UI\ControlMappingScreen.cpp" />
<ClCompile Include="..\..\UI\CwCheatScreen.cpp" />
<ClCompile Include="..\..\UI\DevScreens.cpp" />
<ClCompile Include="..\..\UI\DiscordIntegration.cpp" />
<ClCompile Include="..\..\UI\DisplayLayoutEditor.cpp" />
<ClCompile Include="..\..\UI\DisplayLayoutScreen.cpp" />
<ClCompile Include="..\..\UI\EmuScreen.cpp" />
@@ -40,6 +41,7 @@
<ClInclude Include="..\..\UI\ControlMappingScreen.h" />
<ClInclude Include="..\..\UI\CwCheatScreen.h" />
<ClInclude Include="..\..\UI\DevScreens.h" />
<ClInclude Include="..\..\UI\DiscordIntegration.h" />
<ClInclude Include="..\..\UI\DisplayLayoutEditor.h" />
<ClInclude Include="..\..\UI\DisplayLayoutScreen.h" />
<ClInclude Include="..\..\UI\EmuScreen.h" />
@@ -65,4 +67,4 @@
<ClInclude Include="..\..\UI\TouchControlVisibilityScreen.h" />
<ClInclude Include="..\..\UI\ui_atlas.h" />
</ItemGroup>
</Project>
</Project>
@@ -485,6 +485,7 @@ LOCAL_SRC_FILES := \
$(SRC)/android/jni/native_audio.cpp \
$(SRC)/android/jni/native-audio-so.cpp \
$(SRC)/UI/BackgroundAudio.cpp \
$(SRC)/UI/DiscordIntegration.cpp \
$(SRC)/UI/DevScreens.cpp \
$(SRC)/UI/DisplayLayoutEditor.cpp \
$(SRC)/UI/DisplayLayoutScreen.cpp \

0 comments on commit 9c22f6e

Please sign in to comment.