Update Ghoul

Adapted to new ghoul version
This commit is contained in:
Alexander Bock
2015-12-02 22:47:15 -05:00
parent 0006e83f4b
commit ba35b834f7
3 changed files with 16 additions and 8 deletions

View File

@@ -78,8 +78,10 @@ bool ConfigurationManager::loadFromFile(const std::string& filename) {
FileSys.registerPathToken(basePathToken, basePath);
// Loading the configuration file into ourselves
const bool loadingSuccess = ghoul::lua::loadDictionaryFromFile(filename, *this);
if (!loadingSuccess) {
try {
ghoul::lua::loadDictionaryFromFile(filename, *this);
}
catch (...) {
LERROR("Loading dictionary from file failed");
return false;
}

View File

@@ -90,9 +90,12 @@ bool SceneGraph::loadFromFile(const std::string& sceneDescription) {
// Load dictionary
ghoul::Dictionary sceneDictionary;
bool success = ghoul::lua::loadDictionaryFromFile(absSceneFile, sceneDictionary);
if (!success)
try {
ghoul::lua::loadDictionaryFromFile(absSceneFile, sceneDictionary);
}
catch (...) {
return false;
}
std::string sceneDescriptionDirectory =
ghoul::filesystem::File(absSceneFile, true).directoryName();
@@ -116,7 +119,7 @@ bool SceneGraph::loadFromFile(const std::string& sceneDescription) {
}
ghoul::Dictionary moduleDictionary;
success = sceneDictionary.getValue(KeyModules, moduleDictionary);
bool success = sceneDictionary.getValue(KeyModules, moduleDictionary);
if (!success)
// There are no modules that are loaded
return true;
@@ -182,9 +185,12 @@ bool SceneGraph::loadFromFile(const std::string& sceneDescription) {
}
ghoul::Dictionary moduleDictionary;
bool s = ghoul::lua::loadDictionaryFromFile(moduleFile, moduleDictionary, state);
if (!s)
try {
ghoul::lua::loadDictionaryFromFile(moduleFile, moduleDictionary, state);
}
catch (...) {
continue;
}
std::vector<std::string> keys = moduleDictionary.keys();
for (const std::string& key : keys) {