mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Enable Discord integration for Mac and Linux.
This commit is contained in:
parent
ec5b0c21a8
commit
e34378a1c1
5 changed files with 39 additions and 4 deletions
|
@ -1757,6 +1757,9 @@ if(FFmpeg_FOUND)
|
|||
)
|
||||
endif()
|
||||
|
||||
# Discord integration
|
||||
target_link_libraries(${CoreLibName} discord-rpc)
|
||||
|
||||
setup_target_project(${CoreLibName} Core)
|
||||
|
||||
# Generate git-version.cpp at build time.
|
||||
|
|
|
@ -310,7 +310,7 @@ bool TranslateShader(std::string *dest, ShaderLanguage destLang, TranslatedShade
|
|||
spirv_cross::CompilerGLSL::Options options;
|
||||
options.version = 140;
|
||||
options.es = true;
|
||||
glsl.set_options(options);
|
||||
glsl.set_common_options(options);
|
||||
|
||||
// Compile to GLSL, ready to give to GL driver.
|
||||
*dest = glsl.compile();
|
||||
|
@ -324,7 +324,7 @@ bool TranslateShader(std::string *dest, ShaderLanguage destLang, TranslatedShade
|
|||
// Set some options.
|
||||
spirv_cross::CompilerGLSL::Options options;
|
||||
options.version = gl_extensions.GLSLVersion();
|
||||
glsl.set_options(options);
|
||||
glsl.set_common_options(options);
|
||||
// Compile to GLSL, ready to give to GL driver.
|
||||
*dest = glsl.compile();
|
||||
return true;
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include "DiscordIntegration.h"
|
||||
#include "i18n/i18n.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#if (PPSSPP_PLATFORM(WINDOWS) || PPSSPP_PLATFORM(MAC) || PPSSPP_PLATFORM(LINUX)) && !PPSSPP_PLATFORM(ANDROID)
|
||||
|
||||
#define ENABLE_DISCORD
|
||||
|
||||
|
@ -29,7 +29,7 @@ static const char *ppsspp_app_id = "423397985041383434";
|
|||
|
||||
// No context argument? What?
|
||||
static void handleDiscordError(int errCode, const char *message) {
|
||||
ERROR_LOG(SYSTEM, "Discord error code %d: '%s'", message);
|
||||
ERROR_LOG(SYSTEM, "Discord error code %d: '%s'", errCode, message);
|
||||
}
|
||||
|
||||
Discord::~Discord() {
|
||||
|
@ -48,6 +48,7 @@ void Discord::Init() {
|
|||
DiscordEventHandlers eventHandlers{};
|
||||
eventHandlers.errored = &handleDiscordError;
|
||||
Discord_Initialize(ppsspp_app_id, &eventHandlers, 0, nullptr);
|
||||
INFO_LOG(SYSTEM, "Discord connection initialized");
|
||||
#endif
|
||||
|
||||
initialized_ = true;
|
||||
|
|
|
@ -12,3 +12,4 @@ add_subdirectory(glslang)
|
|||
add_subdirectory(snappy)
|
||||
add_subdirectory(udis86)
|
||||
add_subdirectory(SPIRV-Cross-build)
|
||||
add_subdirectory(discord-rpc-build)
|
||||
|
|
30
ext/discord-rpc-build/CMakeLists.txt
Normal file
30
ext/discord-rpc-build/CMakeLists.txt
Normal file
|
@ -0,0 +1,30 @@
|
|||
cmake_minimum_required (VERSION 3.2.0)
|
||||
project (DiscordRPC)
|
||||
|
||||
set(SRC_DIR ../discord-rpc/src)
|
||||
|
||||
|
||||
# format
|
||||
set(ALL_SOURCE_FILES
|
||||
${SRC_DIR}/backoff.h
|
||||
${SRC_DIR}/connection.h
|
||||
${SRC_DIR}/msg_queue.h
|
||||
${SRC_DIR}/rpc_connection.h
|
||||
${SRC_DIR}/serialization.h
|
||||
${SRC_DIR}/discord_rpc.cpp
|
||||
${SRC_DIR}/rpc_connection.cpp
|
||||
${SRC_DIR}/serialization.cpp
|
||||
${SRC_DIR}/discord_register_osx.m
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
set(ALL_SOURCE_FILES ${ALL_SOURCE_FILES} ${SRC_DIR}/connection_win.cpp)
|
||||
set(ALL_SOURCE_FILES ${ALL_SOURCE_FILES} ${SRC_DIR}/discord_register_win.cpp)
|
||||
else()
|
||||
set(ALL_SOURCE_FILES ${ALL_SOURCE_FILES} ${SRC_DIR}/connection_unix.cpp)
|
||||
set(ALL_SOURCE_FILES ${ALL_SOURCE_FILES} ${SRC_DIR}/discord_register_linux.cpp)
|
||||
endif()
|
||||
|
||||
add_library(discord-rpc STATIC ${ALL_SOURCE_FILES})
|
||||
|
||||
target_include_directories(discord-rpc PUBLIC ../discord-rpc/src ../discord-rpc/include ../rapidjson/include)
|
Loading…
Add table
Reference in a new issue