fix load function

This commit is contained in:
2025-04-03 00:31:01 -05:00
parent 494085cdc1
commit 7cce8f6d8e
5 changed files with 36 additions and 26 deletions

View File

@@ -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();
}
}