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)
TEXTURE_FIX ?= 0
# Enable Discord Rich Presence
DISCORDRPC ?= 0
DISCORDRPC ?= 1
# Various workarounds for weird toolchains
NO_BZERO_BCOPY ?= 0
NO_LDIV ?= 0

View File

@ -22,8 +22,8 @@
# define DISCORDLIBEXT ".dll"
# define dlopen(lib, flag) LoadLibrary(TEXT(lib))
# define dlerror() ""
# define dlsym(handle, func) (void *)GetProcAddress(handle, func)
# define dlclose(handle) FreeLibrary(handle)
# define dlsym(handle, func) (void *)GetProcAddress(reinterpret_cast<HMODULE>(handle), func);
# define dlclose(handle) FreeLibrary(reinterpret_cast<HMODULE>(handle))
#elif defined(__APPLE__)
# include <dlfcn.h>
# define DISCORDLIBEXT ".dylib"
@ -241,11 +241,17 @@ void discord_init(void) {
return;
}
#if defined(_WIN32)
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");
#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();
discordRichPresence.details = stage;