Merge pull request #1034 from Scrumplex/detect-performance-features
This commit is contained in:
@ -113,6 +113,11 @@
|
||||
|
||||
#include <sys.h>
|
||||
|
||||
#ifdef Q_OS_LINUX
|
||||
#include <dlfcn.h>
|
||||
#include "gamemode_client.h"
|
||||
#endif
|
||||
|
||||
|
||||
#if defined Q_OS_WIN32
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
@ -920,6 +925,8 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
updateCapabilities();
|
||||
performMainStartupAction();
|
||||
}
|
||||
|
||||
@ -1568,14 +1575,30 @@ shared_qobject_ptr<Meta::Index> Application::metadataIndex()
|
||||
return m_metadataIndex;
|
||||
}
|
||||
|
||||
Application::Capabilities Application::currentCapabilities()
|
||||
void Application::updateCapabilities()
|
||||
{
|
||||
Capabilities c;
|
||||
m_capabilities = None;
|
||||
if (!getMSAClientID().isEmpty())
|
||||
c |= SupportsMSA;
|
||||
m_capabilities |= SupportsMSA;
|
||||
if (!getFlameAPIKey().isEmpty())
|
||||
c |= SupportsFlame;
|
||||
return c;
|
||||
m_capabilities |= SupportsFlame;
|
||||
|
||||
#ifdef Q_OS_LINUX
|
||||
if (gamemode_query_status() >= 0)
|
||||
m_capabilities |= SupportsGameMode;
|
||||
|
||||
{
|
||||
void *dummy = dlopen("libMangoHud_dlsym.so", RTLD_LAZY);
|
||||
// try normal variant as well
|
||||
if (dummy == NULL)
|
||||
dummy = dlopen("libMangoHud.so", RTLD_LAZY);
|
||||
|
||||
if (dummy != NULL) {
|
||||
dlclose(dummy);
|
||||
m_capabilities |= SupportsMangoHud;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
QString Application::getJarPath(QString jarFile)
|
||||
|
Reference in New Issue
Block a user