From a33b3d4ffc1defda5bdcd3348036ce48ef5b0085 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Thu, 27 Apr 2017 17:40:12 -0400 Subject: modernized ui --- main.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp index 2cc5786..967050c 100644 --- a/main.cpp +++ b/main.cpp @@ -17,6 +17,7 @@ using namespace std::literals::chrono_literals; #include #include #include +#include #include #include #include @@ -95,16 +96,15 @@ int main(int argc, char *argv[]) } // either load the given XML, or find one - auto worldSys = game::engine.getSystem(); if (!worldActuallyUseThisXMLFile.empty()) { - worldSys->load(worldActuallyUseThisXMLFile); + WorldSystem::load(worldActuallyUseThisXMLFile); } else { // load the first valid XML file for the world for (const auto &xf : xmlFiles) { if (xf[0] != '.') { // read it in std::cout << "File to load: " << xf << '\n'; - worldSys->load(xf); + WorldSystem::load(xf); break; } } @@ -133,9 +133,6 @@ int main(int argc, char *argv[]) extern int worldShade; // TODO kill worldShade = 50 * sin((game::time::getTickCount() + (DAY_CYCLE / 2)) / (DAY_CYCLE / PI)); - // update fades - //ui::fadeUpdate(); - // increment game ticker game::time::tick(); } @@ -157,10 +154,10 @@ int main(int argc, char *argv[]) std::this_thread::sleep_for(1s); }); - GameThread gtFade ([&] { + /*GameThread gtFade ([&] { ui::fadeUpdate(); std::this_thread::sleep_for(20ms); - }); + });*/ // the render loop, renders const bool &run = game::engine.shouldRun; @@ -176,19 +173,18 @@ int main(int argc, char *argv[]) // on game end, get back together gtMain.stop(); gtDebug.stop(); - gtFade.stop(); + //gtFade.stop(); //game::engine.getSystem()->thAmbient.join(); // segfault or something } // save game::briceSave(); - worldSys->save(); + WorldSystem::save(); // exit Mix_HaltMusic(); Mix_CloseAudio(); - ui::destroyFonts(); unloadTextures(); game::engine.getSystem()->die(); -- cgit v1.2.3