50 lines
1.0 KiB
50 lines
1.0 KiB
#include "builder.hpp"
|
|
#include "gui.hpp"
|
|
#include "config.hpp"
|
|
#include <fmt/core.h>
|
|
#include "sound.hpp"
|
|
#include "textures.hpp"
|
|
#include "shaders.hpp"
|
|
#include <unistd.h>
|
|
#include <codecvt>
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
int opt = 0;
|
|
int timer_seconds = 60 * 60;
|
|
std::wstring goal{L"No Goal"};
|
|
|
|
while((opt = getopt(argc, argv, "t:c:g:")) != -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<std::codecvt_utf8_utf16<wchar_t>> converter;
|
|
goal = converter.from_bytes(optarg);
|
|
break;
|
|
}
|
|
}
|
|
|
|
sound::init();
|
|
shaders::init();
|
|
textures::init();
|
|
|
|
GameEngine game{100};
|
|
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;
|
|
}
|
|
|