Changeset View
Changeset View
Standalone View
Standalone View
source/ps/GameSetup/HWDetect.cpp
Show First 20 Lines • Show All 135 Lines • ▼ Show 20 Lines | |||||
// has explicitly set a config variable to override that. | // has explicitly set a config variable to override that. | ||||
// (TODO: This is an ugly abuse of the config system) | // (TODO: This is an ugly abuse of the config system) | ||||
static bool IsOverridden(const char* setting) | static bool IsOverridden(const char* setting) | ||||
{ | { | ||||
EConfigNamespace ns = g_ConfigDB.GetValueNamespace(CFG_COMMAND, setting); | EConfigNamespace ns = g_ConfigDB.GetValueNamespace(CFG_COMMAND, setting); | ||||
return !(ns == CFG_LAST || ns == CFG_DEFAULT); | return !(ns == CFG_LAST || ns == CFG_DEFAULT); | ||||
} | } | ||||
void SetDisableAudio(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), bool disabled) | void SetDisableAudio(bool disabled) | ||||
{ | { | ||||
g_DisableAudio = disabled; | g_DisableAudio = disabled; | ||||
} | } | ||||
void RunHardwareDetection() | void RunHardwareDetection() | ||||
{ | { | ||||
TIMER(L"RunHardwareDetection"); | TIMER(L"RunHardwareDetection"); | ||||
ScriptInterface scriptInterface("Engine", "HWDetect", g_ScriptRuntime); | ScriptInterface scriptInterface("Engine", "HWDetect", g_ScriptRuntime); | ||||
JSContext* cx = scriptInterface.GetContext(); | JSContext* cx = scriptInterface.GetContext(); | ||||
JSAutoRequest rq(cx); | JSAutoRequest rq(cx); | ||||
JSI_Debug::RegisterScriptFunctions(scriptInterface); // Engine.DisplayErrorDialog | JSI_Debug::RegisterScriptFunctions(scriptInterface); // Engine.DisplayErrorDialog | ||||
JSI_ConfigDB::RegisterScriptFunctions(scriptInterface); | JSI_ConfigDB::RegisterScriptFunctions(scriptInterface); | ||||
scriptInterface.RegisterFunction<void, bool, &SetDisableAudio>("SetDisableAudio"); | scriptInterface.RegisterGlobalFunction<decltype(&SetDisableAudio), &SetDisableAudio>("SetDisableAudio"); | ||||
// Load the detection script: | // Load the detection script: | ||||
const wchar_t* scriptName = L"hwdetect/hwdetect.js"; | const wchar_t* scriptName = L"hwdetect/hwdetect.js"; | ||||
CVFSFile file; | CVFSFile file; | ||||
if (file.Load(g_VFS, scriptName) != PSRETURN_OK) | if (file.Load(g_VFS, scriptName) != PSRETURN_OK) | ||||
{ | { | ||||
LOGERROR("Failed to load hardware detection script"); | LOGERROR("Failed to load hardware detection script"); | ||||
▲ Show 20 Lines • Show All 558 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator