Now mostly working with GUECS but shaders are still busted. Have to find out why they stopped working.

This commit is contained in:
Zed A. Shaw 2025-05-10 11:06:38 -04:00
parent a5f6a82611
commit ac22a11c9f
27 changed files with 162 additions and 1210 deletions

View file

@ -1,3 +1,5 @@
#include "backend.hpp"
#include "guecs/sfml/components.hpp"
#include "builder.hpp"
#include "gui.hpp"
#include "config.hpp"
@ -12,9 +14,11 @@ 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, "t:c:g:")) != -1) {
while((opt = getopt(argc, argv, "ht:c:g:H:M:")) != -1) {
switch(opt) {
case 't':
timer_seconds = atoi(optarg) * 60;
@ -23,18 +27,27 @@ 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);
case 'g': {
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> 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;
}
}
sound::init();
shaders::init();
textures::init();
sfml::Backend backend;
guecs::init(&backend);
GameEngine game{100};
GameEngine game{start_hp, max_hp};
GUI gui(timer_seconds, goal);
auto builder = Builder(gui, game);