Include strict lua file, throw error in configuration loading when overriding with unused variable

- Preventing True/true bug
 - Fix issue with unused variable in configuration_helper
This commit is contained in:
Alexander Bock
2021-04-01 23:37:35 +02:00
parent 7fefbf9ea0
commit 52b020d836
3 changed files with 45 additions and 1 deletions

View File

@@ -37,6 +37,7 @@ namespace {
// We can't use ${SCRIPTS} here as that hasn't been defined by this point
constexpr const char* InitialConfigHelper =
"${BASE}/scripts/configuration_helper.lua";
constexpr const char* StrictLuaScript = "${BASE}/scripts/strict.lua";
struct [[codegen::Dictionary(Configuration)]] Parameters {
// The SGCT configuration file that determines the window and view frustum
@@ -649,6 +650,9 @@ Configuration loadConfigurationFromFile(const std::string& filename,
if (FileSys.fileExists(absPath(InitialConfigHelper))) {
ghoul::lua::runScriptFile(result.state, absPath(InitialConfigHelper));
}
if (FileSys.fileExists(absPath(StrictLuaScript))) {
ghoul::lua::runScriptFile(result.state, absPath(StrictLuaScript));
}
// Load the configuration file into the state
ghoul::lua::runScriptFile(result.state, filename);