From 68d6b9e90c415c7a969390e8cfb0a9d5cde811c0 Mon Sep 17 00:00:00 2001 From: "Zed A. Shaw" Date: Sat, 28 Sep 2024 04:25:09 -0400 Subject: [PATCH] If you invert the walls and the input map then you might be able to use the dijkstra map to find interesting paths between rooms. --- map.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/map.cpp b/map.cpp index 713966c..8a450c9 100644 --- a/map.cpp +++ b/map.cpp @@ -38,7 +38,7 @@ inline void add_neighbors(PairList &neighbors, Matrix &closed, size_t j, size_t } Map::Map(size_t width, size_t height) : m_limit(1000) { - m_walls = Matrix(height, MatrixRow(width, 1)); + m_walls = Matrix(height, MatrixRow(width, 0)); m_input_map = Matrix(height, MatrixRow(width, 1)); } @@ -100,7 +100,10 @@ void Map::make_room(size_t origin_x, size_t origin_y, size_t w, size_t h) { dbc::check(y < m_walls.size(), "y is out of bounds"); for(size_t x = origin_x; x < origin_x + w; ++x) { dbc::check(x < m_walls[y].size(), "x is out of bounds"); - m_walls[y][x] = 0; + if(x == origin_x && y == origin_y) { + m_input_map[y-1][x] = 0; + } + m_walls[y][x] = 1; } } }