From d03abba8e45c489a448a76b2653142cf04c89997 Mon Sep 17 00:00:00 2001 From: "Zed A. Shaw" Date: Wed, 26 Feb 2025 12:43:12 -0500 Subject: [PATCH] Now if you pass a simple t as an arg it will do a fast autowalk at the start, mostly for testing. --- gui_fsm.cpp | 6 +++++- gui_fsm.hpp | 1 + main.cpp | 6 +++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/gui_fsm.cpp b/gui_fsm.cpp index b9edf3a..02e6601 100644 --- a/gui_fsm.cpp +++ b/gui_fsm.cpp @@ -293,7 +293,7 @@ namespace gui { $main_ui.debug(); break; case KEY::O: - $autowalking = true; + start_autowalk(0.06); default: break; // ignored } @@ -510,4 +510,8 @@ namespace gui { } } + void FSM::start_autowalk(double rot_speed) { + $autowalking = true; + $main_ui.$camera.rot_speed = rot_speed; + } } diff --git a/gui_fsm.hpp b/gui_fsm.hpp index 70f2498..7fbc320 100644 --- a/gui_fsm.hpp +++ b/gui_fsm.hpp @@ -60,6 +60,7 @@ namespace gui { void event(Event ev); void autowalk(); + void start_autowalk(double rot_speed); void START(Event ); void MOVING(Event ); diff --git a/main.cpp b/main.cpp index 08623bd..acf01a4 100644 --- a/main.cpp +++ b/main.cpp @@ -2,13 +2,17 @@ #include "textures.hpp" #include "sound.hpp" -int main() { +int main(int argc, char* argv[]) { textures::init(); sound::init(); sound::mute(true); gui::FSM main; main.event(gui::Event::STARTED); + if(argc > 1 && argv[1][0] == 't') { + main.start_autowalk(0.1); + } + while(main.active()) { main.render();