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:
parent
d583a28b9c
commit
110612c33a
11 changed files with 44 additions and 19 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue