aboutsummaryrefslogtreecommitdiffstats
path: root/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/main.cpp b/main.cpp
index 697452e..91a2759 100644
--- a/main.cpp
+++ b/main.cpp
@@ -194,7 +194,7 @@ int main(int argc, char *argv[])
}
if (worldDontReallyRun)
- return 0;
+ goto EXIT_ROUTINE;
if (!worldActuallyUseThisXMLFile.empty()) {
delete currentWorld;
@@ -219,6 +219,8 @@ int main(int argc, char *argv[])
ui::menu::init();
game::events.emit<BGMToggleEvent>(currentWorld->bgm);
+ game::engine.getSystem<WorldSystem>()->setWorld(currentWorld);
+
// spawn the arena
arena = new Arena();
arena->setStyle("");
@@ -248,6 +250,8 @@ int main(int argc, char *argv[])
render();
}
+EXIT_ROUTINE:
+
// put away the brice for later
game::briceSave();
@@ -264,6 +268,8 @@ int main(int argc, char *argv[])
delete arena;
//delete currentWorld;
+ game::engine.getSystem<WindowSystem>()->die();
+
return 0; // Calls everything passed to atexit
}
@@ -336,8 +342,9 @@ void render() {
Render::worldShader.unuse();
// draw the world and player
+ game::engine.getSystem<WorldSystem>()->render();
currentWorld->draw(player);
-
+
// draw the player's inventory
player->inv->draw();