diff options
author | Clyne Sullivan <tullivan99@gmail.com> | 2016-06-10 15:33:02 -0400 |
---|---|---|
committer | Clyne Sullivan <tullivan99@gmail.com> | 2016-06-10 15:33:02 -0400 |
commit | 076c984c438bea2b34f8dd3a62bb31ebd2eb5282 (patch) | |
tree | b0252c6c054a86eebdf00afccd0afa83e7ff911a /main.cpp | |
parent | 1e9f6aaddb2d21045f5e7dc63d6312a4407b3a08 (diff) |
actual game making
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -20,6 +20,8 @@ using namespace tinyxml2; #include <ui.hpp> #include <gametime.hpp> +#include <fstream> + /* ---------------------------------------------------------------------------- ** Variables section ** --------------------------------------------------------------------------*/ @@ -118,7 +120,7 @@ void mainLoop(void); int main(int argc, char *argv[]) { static SDL_GLContext mainGLContext = NULL; - static bool worldReset = false; + static bool worldReset = false, worldDontReallyRun = false; // handle command line arguments if (argc > 1) { @@ -129,6 +131,8 @@ int main(int argc, char *argv[]) for (const auto &s : args) { if (s == "--reset" || s == "-r") worldReset = true; + else if (s == "--dontrun" || s == "-d") + worldDontReallyRun = true; } } @@ -286,8 +290,14 @@ int main(int argc, char *argv[]) } game::briceClear(); + + std::ofstream pdat ("xml/.main.dat", std::ios::out); + pdat.close(); } + if (worldDontReallyRun) + return 0; + if (currentWorld == nullptr) { // load the first valid XML file for the world @@ -372,7 +382,7 @@ void mainLoop(void){ if (game::time::tickHasPassed()) logic(); - currentWorld->update(player, game::time::getDeltaTime(), game::time::getTickCount()); + currentWorld->update(player, game::time::getDeltaTime()); currentWorld->detect(player); } } |