#include "backend.hpp" #include "guecs/sfml/components.hpp" #include "builder.hpp" #include "gui.hpp" #include "config.hpp" #include #include "sound.hpp" #include "textures.hpp" #include "shaders.hpp" #include #include int main(int argc, char *argv[]) { int opt = 0; int timer_seconds = 60 * 60; int start_hp = 100; int max_hp = 100; std::wstring goal{L"No Goal"}; while((opt = getopt(argc, argv, "ht:c:g:H:M:")) != -1) { switch(opt) { case 't': timer_seconds = atoi(optarg) * 60; fmt::println("Setting count down timer to {} seconds.", timer_seconds); break; case 'c': Config::set_base_dir(optarg); break; case 'g': { std::wstring_convert> converter; goal = converter.from_bytes(optarg); } break; case 'H': { start_hp = std::atoi(optarg); } break; case 'M': { max_hp = std::atoi(optarg); } break; case 'h': fmt::println("USAGE: ttpit [-t time] [-c config_dir] [-g goal] [-H hp] [-M max_hp]"); return 0; break; } } sfml::Backend backend; guecs::init(&backend); GameEngine game{start_hp, max_hp}; GUI gui(timer_seconds, goal); auto builder = Builder(gui, game); gui.startup(); while(gui.is_open()) { builder.event(BuildEvent::GO); gui.main_loop(); } builder.event(BuildEvent::QUIT); return 0; }