mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-22 12:11:40 -06:00
Feature/cmake cleanup (#381)
* Rename OnScreenGui module to ImGui * Support multiple external module folders (closes #31) * Cleaning up CMake files * Restructure application specification * Add parameter for library mode to all modules * Add functions to handle global variable state * Misc/remove warnings (#383) * Increase build timeout and do a clean rebuild every commit
This commit is contained in:
@@ -56,27 +56,27 @@ void ModuleEngine::deinitialize() {
|
||||
LDEBUG("Finished destroying modules");
|
||||
}
|
||||
|
||||
void ModuleEngine::registerModule(std::unique_ptr<OpenSpaceModule> module) {
|
||||
ghoul_assert(module, "Module must not be nullptr");
|
||||
void ModuleEngine::registerModule(std::unique_ptr<OpenSpaceModule> m) {
|
||||
ghoul_assert(m, "Module must not be nullptr");
|
||||
|
||||
auto it = std::find_if(
|
||||
_modules.begin(),
|
||||
_modules.end(),
|
||||
[&module](std::unique_ptr<OpenSpaceModule>& rhs) {
|
||||
return rhs->name() == module->name();
|
||||
[&m](std::unique_ptr<OpenSpaceModule>& rhs) {
|
||||
return rhs->name() == m->name();
|
||||
}
|
||||
);
|
||||
if (it != _modules.end()) {
|
||||
throw ghoul::RuntimeError(
|
||||
"Module name '" + module->name() + "' was registered before",
|
||||
"Module name '" + m->name() + "' was registered before",
|
||||
"ModuleEngine"
|
||||
);
|
||||
}
|
||||
|
||||
LDEBUG("Registering module '" << module->name() << "'");
|
||||
module->initialize();
|
||||
LDEBUG("Registered module '" << module->name() << "'");
|
||||
_modules.push_back(std::move(module));
|
||||
LDEBUG("Registering module '" << m->name() << "'");
|
||||
m->initialize();
|
||||
LDEBUG("Registered module '" << m->name() << "'");
|
||||
_modules.push_back(std::move(m));
|
||||
}
|
||||
|
||||
std::vector<OpenSpaceModule*> ModuleEngine::modules() const {
|
||||
|
||||
Reference in New Issue
Block a user