First batch of changes merged back from Under. Fixes the router, adds magic_enum to FSM, and makes it easy to reset the world.

This commit is contained in:
Zed A. Shaw 2026-05-09 23:52:40 -04:00
parent d583a28b9c
commit 110612c33a
11 changed files with 44 additions and 19 deletions

View file

@ -174,7 +174,7 @@ namespace animator {
while(const auto ev = $window.pollEvent()) {
using enum game::Event;
using KEY = sf::Keyboard::Scan;
auto gui_ev = $router.process_event(ev);
auto [gui_ev, mods] = $router.process_event(ev);
auto mouse_pos = $window.mapPixelToCoords($router.position);
switch(gui_ev) {

View file

@ -31,13 +31,13 @@ int main(int, char*[]) {
main.render(window);
while(const auto ev = window.pollEvent()) {
auto gui_ev = router.process_event(ev);
auto [gui_ev, mods] = router.process_event(ev);
auto mouse_pos = window.mapPixelToCoords(router.position);
if(gui_ev == game::Event::QUIT) {
return 0;
} else if(gui_ev == game::Event::MOUSE_CLICK) {
main.mouse(mouse_pos.x, mouse_pos.y, guecs::NO_MODS);
main.mouse(mouse_pos.x, mouse_pos.y, mods);
}
}