aboutsummaryrefslogtreecommitdiffstats
path: root/main.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2017-04-27 17:40:12 -0400
committerClyne Sullivan <tullivan99@gmail.com>2017-04-27 17:40:12 -0400
commita33b3d4ffc1defda5bdcd3348036ce48ef5b0085 (patch)
tree87070680ba9c8a02a2c9a6184f22e5cb0f466b55 /main.cpp
parent00f879600bcea8f1ec1775c941041ee6346a60ba (diff)
modernized ui
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp18
1 files changed, 7 insertions, 11 deletions
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 <engine.hpp>
#include <error.hpp>
#include <fileio.hpp>
+#include <font.hpp>
#include <gametime.hpp>
#include <window.hpp>
#include <world.hpp>
@@ -95,16 +96,15 @@ int main(int argc, char *argv[])
}
// either load the given XML, or find one
- auto worldSys = game::engine.getSystem<WorldSystem>();
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<WorldSystem>()->thAmbient.join(); // segfault or something
}
// save
game::briceSave();
- worldSys->save();
+ WorldSystem::save();
// exit
Mix_HaltMusic();
Mix_CloseAudio();
- ui::destroyFonts();
unloadTextures();
game::engine.getSystem<WindowSystem>()->die();