From b62308a3015194da14c65aea00d4fe5ec2d843a8 Mon Sep 17 00:00:00 2001 From: wraitii Date: Sun, 7 Jun 2020 20:11:37 +0000 Subject: [PATCH] Fix error in e9361705ae. The HWDetect changes were not working properly. Reported by: Nescio Tested by: Nescio Differential Revision: https://code.wildfiregames.com/D2799 This was SVN commit r23748. --- binaries/data/mods/mod/hwdetect/hwdetect.js | 32 ++++++++++----------- source/ps/GameSetup/HWDetect.cpp | 2 ++ 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/binaries/data/mods/mod/hwdetect/hwdetect.js b/binaries/data/mods/mod/hwdetect/hwdetect.js index 300d601e99..9f21a1c829 100644 --- a/binaries/data/mods/mod/hwdetect/hwdetect.js +++ b/binaries/data/mods/mod/hwdetect/hwdetect.js @@ -359,37 +359,37 @@ global.RunHardwareDetection = function(settings) Engine.SetDisableAudio(output.disable_audio); if (output.disable_shadows !== undefined) - Engine.ConfigDB_CreateValue("hwdetect", "shadows", !output.disable_shadows); + Engine.ConfigDB_CreateValue("hwdetect", "shadows", (!output.disable_shadows).toString()); - if (output.disable_shadowpcf !== undefined) - Engine.ConfigDB_CreateValue("hwdetect", "shadowpcf", !output.disable_shadowpcf); + //if (output.disable_shadowpcf !== undefined) + Engine.ConfigDB_CreateValue("hwdetect", "shadowpcf", (!output.disable_shadowpcf).toString()); if (output.disable_allwater !== undefined) { - Engine.ConfigDB_CreateValue("hwdetect", "watereffects", !output.disable_allwater); - Engine.ConfigDB_CreateValue("hwdetect", "waterfancyeffects", !output.disable_allwater); - Engine.ConfigDB_CreateValue("hwdetect", "waterrealdepth", !output.disable_allwater); - Engine.ConfigDB_CreateValue("hwdetect", "watershadows", !output.disable_allwater); - Engine.ConfigDB_CreateValue("hwdetect", "waterrefraction", !output.disable_allwater); - Engine.ConfigDB_CreateValue("hwdetect", "waterreflection", !output.disable_allwater); + Engine.ConfigDB_CreateValue("hwdetect", "watereffects", (!output.disable_allwater).toString()); + Engine.ConfigDB_CreateValue("hwdetect", "waterfancyeffects", (!output.disable_allwater).toString()); + Engine.ConfigDB_CreateValue("hwdetect", "waterrealdepth", (!output.disable_allwater).toString()); + Engine.ConfigDB_CreateValue("hwdetect", "watershadows", (!output.disable_allwater).toString()); + Engine.ConfigDB_CreateValue("hwdetect", "waterrefraction", (!output.disable_allwater).toString()); + Engine.ConfigDB_CreateValue("hwdetect", "waterreflection", (!output.disable_allwater).toString()); } if (output.disable_fancywater !== undefined) { - Engine.ConfigDB_CreateValue("hwdetect", "waterfancyeffects", !output.disable_fancywater); - Engine.ConfigDB_CreateValue("hwdetect", "waterrealdepth", !output.disable_fancywater); - Engine.ConfigDB_CreateValue("hwdetect", "watershadows", !output.disable_fancywater); + Engine.ConfigDB_CreateValue("hwdetect", "waterfancyeffects", (!output.disable_fancywater).toString()); + Engine.ConfigDB_CreateValue("hwdetect", "waterrealdepth", (!output.disable_fancywater).toString()); + Engine.ConfigDB_CreateValue("hwdetect", "watershadows", (!output.disable_fancywater).toString()); } if (output.enable_glsl !== undefined) - Engine.ConfigDB_CreateValue("hwdetect", "preferglsl", output.enable_glsl); + Engine.ConfigDB_CreateValue("hwdetect", "preferglsl", (output.enable_glsl).toString()); if (output.enable_postproc !== undefined) - Engine.ConfigDB_CreateValue("hwdetect", "postproc", output.enable_postproc); + Engine.ConfigDB_CreateValue("hwdetect", "postproc", (output.enable_postproc).toString()); if (output.enable_smoothlos !== undefined) - Engine.ConfigDB_CreateValue("hwdetect", "smoothlos", output.enable_smoothlos); + Engine.ConfigDB_CreateValue("hwdetect", "smoothlos", (output.enable_smoothlos).toString()); if (output.override_renderpath !== undefined) - Engine.ConfigDB_CreateValue("hwdetect", "renderpath", output.override_renderpath); + Engine.ConfigDB_CreateValue("hwdetect", "renderpath", (output.override_renderpath).toString()); }; diff --git a/source/ps/GameSetup/HWDetect.cpp b/source/ps/GameSetup/HWDetect.cpp index fcc016f708..78acc1c5ff 100644 --- a/source/ps/GameSetup/HWDetect.cpp +++ b/source/ps/GameSetup/HWDetect.cpp @@ -40,6 +40,7 @@ #include "ps/Filesystem.h" #include "ps/GameSetup/Config.h" #include "ps/Profile.h" +#include "ps/scripting/JSInterface_ConfigDB.h" #include "ps/scripting/JSInterface_Debug.h" #include "ps/UserReport.h" #include "ps/VideoMode.h" @@ -154,6 +155,7 @@ void RunHardwareDetection() JSAutoRequest rq(cx); JSI_Debug::RegisterScriptFunctions(scriptInterface); // Engine.DisplayErrorDialog + JSI_ConfigDB::RegisterScriptFunctions(scriptInterface); scriptInterface.RegisterFunction("SetDisableAudio");