mirror of
https://forgejo.xatacraft.ru/Sunshine/mkxp-sunshine.git
synced 2026-08-19 13:29:54 +00:00
Disable Chroma API stuff on non-Windows platforms
This commit is contained in:
parent
d4121948cd
commit
397a15cdf7
1 changed files with 40 additions and 35 deletions
|
|
@ -6,7 +6,11 @@
|
|||
|
||||
bool INIT_SUCCESS = false;
|
||||
|
||||
HINSTANCE hLib = NULL;
|
||||
#ifdef _WIN32
|
||||
HINSTANCE hLib = NULL;
|
||||
#else
|
||||
int* hLib = NULL;
|
||||
#endif
|
||||
|
||||
//dynamic-loaded proc pointers
|
||||
PluginPlayAnimation _playAnimation = NULL;
|
||||
|
|
@ -20,14 +24,7 @@ int lastAnimId = -1;
|
|||
|
||||
void _attemptLinkSdk() {
|
||||
Debug() << "Attempting to bind Chroma SDK";
|
||||
#if !defined(_WIN32) && !defined(_WIN64)
|
||||
// currently razr chroma is windows-only.
|
||||
// so, if we are not building for windows platform
|
||||
// then don't bother with chroma stuff
|
||||
Debug() << "Chroma: Unsupported Platform";
|
||||
return;
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
hLib = LoadLibrary(L"ChromaApi.dll");
|
||||
if (hLib != NULL) {
|
||||
Debug() << "Chroma Impl @" << hLib;
|
||||
|
|
@ -53,6 +50,12 @@ void _attemptLinkSdk() {
|
|||
INIT_SUCCESS &= _pluginUninit != NULL;
|
||||
Debug() << "Plugin init success:" << INIT_SUCCESS;
|
||||
}
|
||||
#else
|
||||
// Currently the Razor Chroma API is Windows-only.
|
||||
// So, if we are not building for Windows platform,
|
||||
// then don't bother with Chroma stuff.
|
||||
Debug() << "Chroma: Unsupported Platform";
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -83,10 +86,12 @@ void chromaBindingInit() {
|
|||
}
|
||||
|
||||
void chromaBindingRelease() {
|
||||
#ifdef _WIN32
|
||||
if (hLib != NULL) {
|
||||
_pluginUninit();
|
||||
FreeLibrary(hLib);
|
||||
hLib = NULL;
|
||||
INIT_SUCCESS = false;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue