Fixed DiscordRPC windows build and changed rpc flag to be true by default

This commit is contained in:
KiritoDv 2021-05-24 13:13:52 +00:00
parent e1402418e8
commit 4c25c904ec
2 changed files with 10 additions and 4 deletions

View File

@ -38,7 +38,7 @@ NODRAWINGDISTANCE ?= 0
# Disable texture fixes by default (helps with them purists) # Disable texture fixes by default (helps with them purists)
TEXTURE_FIX ?= 0 TEXTURE_FIX ?= 0
# Enable Discord Rich Presence # Enable Discord Rich Presence
DISCORDRPC ?= 0 DISCORDRPC ?= 1
# Various workarounds for weird toolchains # Various workarounds for weird toolchains
NO_BZERO_BCOPY ?= 0 NO_BZERO_BCOPY ?= 0
NO_LDIV ?= 0 NO_LDIV ?= 0

View File

@ -22,8 +22,8 @@
# define DISCORDLIBEXT ".dll" # define DISCORDLIBEXT ".dll"
# define dlopen(lib, flag) LoadLibrary(TEXT(lib)) # define dlopen(lib, flag) LoadLibrary(TEXT(lib))
# define dlerror() "" # define dlerror() ""
# define dlsym(handle, func) (void *)GetProcAddress(handle, func) # define dlsym(handle, func) (void *)GetProcAddress(reinterpret_cast<HMODULE>(handle), func);
# define dlclose(handle) FreeLibrary(handle) # define dlclose(handle) FreeLibrary(reinterpret_cast<HMODULE>(handle))
#elif defined(__APPLE__) #elif defined(__APPLE__)
# include <dlfcn.h> # include <dlfcn.h>
# define DISCORDLIBEXT ".dylib" # define DISCORDLIBEXT ".dylib"
@ -241,11 +241,17 @@ void discord_init(void) {
return; return;
} }
#if defined(_WIN32)
discordInit = (Discord_Initialize) dlsym(handle, "Discord_Initialize"); discordInit = (Discord_Initialize) dlsym(handle, "Discord_Initialize");
discordShutdown = (Discord_Shutdown) dlsym(handle, "Discord_Shutdown"); discordShutdown = (Discord_Shutdown) dlsym(handle, "Discord_Shutdown");
discordClearPresence = (Discord_ClearPresence) dlsym(handle, "Discord_ClearPresence"); discordClearPresence = (Discord_ClearPresence) dlsym(handle, "Discord_ClearPresence");
discordUpdatePresence = (Discord_UpdatePresence) dlsym(handle, "Discord_UpdatePresence"); discordUpdatePresence = (Discord_UpdatePresence) dlsym(handle, "Discord_UpdatePresence");
#else
discordInit = (Discord_Initialize) dlsym(handle, "Discord_Initialize");
discordShutdown = (Discord_Shutdown) dlsym(handle, "Discord_Shutdown");
discordClearPresence = (Discord_ClearPresence) dlsym(handle, "Discord_ClearPresence");
discordUpdatePresence = (Discord_UpdatePresence) dlsym(handle, "Discord_UpdatePresence");
#endif
init_discord(); init_discord();
discordRichPresence.details = stage; discordRichPresence.details = stage;