Can now use -g to set a goal.

This commit is contained in:
Zed A. Shaw 2025-04-24 13:00:40 -04:00
parent 3d4ddde96e
commit 210b0e4d21
7 changed files with 40 additions and 13 deletions

View file

@ -6,13 +6,15 @@
#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:")) != -1) {
while((opt = getopt(argc, argv, "t:c:g:")) != -1) {
switch(opt) {
case 't':
timer_seconds = atoi(optarg) * 60;
@ -21,6 +23,10 @@ int main(int argc, char *argv[])
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;
}
}
@ -29,7 +35,7 @@ int main(int argc, char *argv[])
textures::init();
GameEngine game{100};
GUI gui(timer_seconds);
GUI gui(timer_seconds, goal);
auto builder = Builder(gui, game);
gui.startup();