mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-04 10:40:09 -06:00
Load common module automatically without the need to declare it in the scenefile
Drastically remove the amount of false-positive errors during runtime
This commit is contained in:
Submodule ext/ghoul updated: f8e1ba97c3...1f1386215e
@@ -91,8 +91,9 @@ public:
|
||||
* more <code>.</code>, the first part of the name will be recursively extracted and
|
||||
* used as a name for a sub-owner and only the last part of the identifier is
|
||||
* referring to a Property owned by PropertyOwner named by the second-but-last name.
|
||||
* \param URI The identifier of the Property that should be extracted. If the Property
|
||||
* cannot be found, <code>nullptr</code> is returned
|
||||
* \param URI The identifier of the Property that should be extracted
|
||||
* \return If the Property cannot be found, <code>nullptr</code> is returned,
|
||||
* otherwise the pointer to the Property is returned
|
||||
*/
|
||||
Property* property(const std::string& URI) const;
|
||||
|
||||
|
||||
Submodule openspace-data updated: 5100d9e5b8...4d3fc5402c
@@ -77,8 +77,6 @@ Property* PropertyOwner::property(const std::string& id) const
|
||||
const size_t ownerSeparator = id.find(URISeparator);
|
||||
if (ownerSeparator == std::string::npos) {
|
||||
// if we do not own the property and there is no separator, it does not exist
|
||||
LERROR("The identifier '" << id << "' did not exist in PropertyOwner '" <<
|
||||
name() << "'");
|
||||
return nullptr;
|
||||
}
|
||||
else {
|
||||
@@ -87,8 +85,6 @@ Property* PropertyOwner::property(const std::string& id) const
|
||||
|
||||
PropertyOwner* owner = subOwner(ownerName);
|
||||
if (owner == nullptr) {
|
||||
LERROR("Sub PropertyOwner '" << owner
|
||||
<< "' did not exist for PropertyOwner '" << name() << "'");
|
||||
return nullptr;
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -367,6 +367,9 @@ bool SceneGraph::loadSceneInternal(const std::string& sceneDescriptionFilePath)
|
||||
return false;
|
||||
}
|
||||
|
||||
LDEBUG("Loading common module folder '" << commonDirectory << "'");
|
||||
loadModule(FileSys.pathByAppendingComponent(moduleDirectory, commonDirectory));
|
||||
|
||||
Dictionary moduleDictionary;
|
||||
if (dictionary.getValue(constants::scenegraph::keyModules, moduleDictionary)) {
|
||||
std::vector<std::string> keys = moduleDictionary.keys();
|
||||
@@ -374,7 +377,7 @@ bool SceneGraph::loadSceneInternal(const std::string& sceneDescriptionFilePath)
|
||||
for (const std::string& key : keys) {
|
||||
std::string moduleFolder;
|
||||
if (moduleDictionary.getValue(key, moduleFolder))
|
||||
loadModule(moduleDirectory + "/" + moduleFolder);
|
||||
loadModule(FileSys.pathByAppendingComponent(moduleDirectory, moduleFolder));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -465,7 +468,7 @@ bool SceneGraph::loadSceneInternal(const std::string& sceneDescriptionFilePath)
|
||||
|
||||
void SceneGraph::loadModule(const std::string& modulePath)
|
||||
{
|
||||
auto pos = modulePath.find_last_of("/");
|
||||
auto pos = modulePath.find_last_of(ghoul::filesystem::FileSystem::PathSeparator);
|
||||
if (pos == modulePath.npos) {
|
||||
LERROR("Bad format for module path: " << modulePath);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user