From 7a0b2f988d5907e380db471feea6fbdd0529c7ca Mon Sep 17 00:00:00 2001 From: "Zed A. Shaw" Date: Sun, 18 May 2025 01:00:47 -0400 Subject: [PATCH] Add a terrible maze generation algorithm to test if a maze style map looks/feels better. The walls are disabled so you can walk around. --- Makefile | 4 +- gui/status_ui.cpp | 16 ++--- levelmanager.cpp | 4 +- matrix.cpp | 2 + maze.cpp | 145 ++++++++++++++++++++++++++++++++++++++++++++++ maze.hpp | 7 +++ meson.build | 2 + tests/mazes.cpp | 23 ++++++++ worldbuilder.cpp | 60 +++++++------------ 9 files changed, 209 insertions(+), 54 deletions(-) create mode 100644 maze.cpp create mode 100644 maze.hpp create mode 100644 tests/mazes.cpp diff --git a/Makefile b/Makefile index 6b74d7b..cf97b8f 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ tracy_build: meson compile -j 10 -C builddir test: build - ./builddir/runtests + ./builddir/runtests "[maze-gen]" run: build test ifeq '$(OS)' 'Windows_NT' @@ -49,7 +49,7 @@ clean: meson compile --clean -C builddir debug_test: build - gdb --nx -x .gdbinit --ex run --args builddir/runtests -e + gdb --nx -x .gdbinit --ex run --args builddir/runtests -e "[maze-gen]" win_installer: powershell 'start "C:\Program Files (x86)\solicus\InstallForge\bin\ifbuilderenvx86.exe" scripts\win_installer.ifp' diff --git a/gui/status_ui.cpp b/gui/status_ui.cpp index 5c6c8b7..b3173b4 100644 --- a/gui/status_ui.cpp +++ b/gui/status_ui.cpp @@ -15,11 +15,11 @@ namespace gui { $gui.position(STATUS_UI_X, STATUS_UI_Y, STATUS_UI_WIDTH, STATUS_UI_HEIGHT); $gui.layout( "[ ritual_ui ]" - "[inv_slot1 | inv_slot2 | inv_slot3]" - "[inv_slot4 | inv_slot5 | inv_slot6]" - "[*%(200,300)character_view|_|stat1]" - "[_|_|stat2]" - "[_|_|stat3]"); + "[inv_1|inv_2|inv_3]" + "[inv_4|*%(200,300)character_view|_|inv_5]" + "[inv_6|_|_ |inv_7]" + "[inv_8|_|_ |inv_9]" + "[inv_10|inv_11|inv_12]"); size_t inv_id = 0; for(auto [name, entity] : $gui.$name_ents) { @@ -37,14 +37,9 @@ namespace gui { auto char_view = $gui.entity(name); $gui.set(char_view, {}); $gui.set(char_view, {"peasant_girl"}); - } else if(name.starts_with("stat")) { - auto stat = $gui.entity(name); - $gui.set(stat, {}); - $gui.set