fix load function
This commit is contained in:
@@ -2,30 +2,26 @@
|
||||
|
||||
void ImguiEmbed::run() {
|
||||
|
||||
for(auto* m : modules) {
|
||||
std::cout << "Loading Module: " << m->getName() << std::endl;
|
||||
//if(m->getName() != "WindowModule")
|
||||
m->onLoad();
|
||||
}
|
||||
for(auto m : runOrder)
|
||||
modules[m]->onLoad();
|
||||
|
||||
// Main loop
|
||||
while (!done && !modules.empty()) {
|
||||
while (!done && !runOrder.empty()) {
|
||||
|
||||
for(auto* m : modules) {
|
||||
//std::cout << "Running Module: " << m->getName() << std::endl;
|
||||
//if(m->getName() != "WindowModule")
|
||||
m->run();
|
||||
for(auto m : runOrder) {
|
||||
modules[m]->run();
|
||||
}
|
||||
|
||||
for(auto it = toClose.begin(); it != toClose.end(); it++) {
|
||||
unload(it);
|
||||
for(auto m : toClose) {
|
||||
unload(m);
|
||||
}
|
||||
toClose.clear();
|
||||
|
||||
for(std::string s : toOpen) {
|
||||
load(s, modules.begin());
|
||||
for(std::string m : toOpen) {
|
||||
load(m);
|
||||
}
|
||||
toOpen.clear();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ class ImguiEmbed : public Archimedes::App {
|
||||
ImguiEmbed() {
|
||||
Archimedes::Module* m = (Archimedes::Module*) new TestImgui(nullptr, Get());
|
||||
|
||||
load(m, {});
|
||||
load(m);
|
||||
};
|
||||
~ImguiEmbed() {};
|
||||
|
||||
|
||||
@@ -2,17 +2,19 @@
|
||||
|
||||
void MinimalApp::run() {
|
||||
|
||||
for(auto m : runOrder)
|
||||
for(std::string m : runOrder) {
|
||||
std::cout << "onLoad module: " << m << std::endl;
|
||||
modules[m]->onLoad();
|
||||
}
|
||||
|
||||
// Main loop
|
||||
while (!done && !runOrder.empty()) {
|
||||
|
||||
for(auto m : runOrder) {
|
||||
for(std::string m : runOrder) {
|
||||
modules[m]->run();
|
||||
}
|
||||
|
||||
for(auto m : toClose) {
|
||||
for(std::string m : toClose) {
|
||||
unload(m);
|
||||
}
|
||||
toClose.clear();
|
||||
|
||||
@@ -13,8 +13,10 @@ class MinimalApp : public Archimedes::App {
|
||||
|
||||
void handleArgs(const int& argc, char* argv[]) {
|
||||
if(argc > 1) {
|
||||
for(int i = 1; i < argc; i++)
|
||||
for(int i = 1; i < argc; i++) {
|
||||
std::cout << "Attempting to load: " << argv[i] << std::endl;
|
||||
load(dynamicLoad(argv[i]));
|
||||
}
|
||||
} else {
|
||||
std::cout << "No modules to load\n";
|
||||
end();
|
||||
|
||||
Reference in New Issue
Block a user