Ripped out the string based map and created a Matrix map drawing function.

This commit is contained in:
Zed A. Shaw 2025-07-12 10:51:55 -04:00
parent d9219a8c64
commit dd541ae59d
4 changed files with 11 additions and 28 deletions

View file

@ -46,23 +46,21 @@ namespace gui {
}
void MapViewUI::render(sf::RenderWindow &window, int compass_dir) {
(void)compass_dir;
window.draw(*$paper.sprite);
auto grid = $gui.entity("map_grid");
std::wstring map_out = System::draw_map($level, 23, 9, compass_dir);
// System::draw_map
auto& map_text = $gui.get<Textual>(grid);
map_text.update(map_out);
map_text.update(L"MAP BROKEN");
$gui.render(window);
// $gui.debug_layout(window);
}
void MapViewUI::save_map(const std::string& outfile, int compass_dir) {
std::wstring map_out = System::draw_map(
$level, $level.map->width(), $level.map->height(), compass_dir);
dbc::check(map_out.size() > 0, "WHAT? printed map has nothing in it.");
(void)compass_dir;
std::wstring map_out = L"I'M BROKEN";
std::wofstream out(outfile, std::ios::binary);
std::locale loc(std::locale::classic(), new std::codecvt_utf8<wchar_t>);

View file

@ -32,8 +32,8 @@ namespace gui {
}
void MiniMapUI::render(sf::RenderWindow &window, int compass_dir) {
std::wstring map_out = System::draw_map($level, 5, 3, compass_dir);
$map_grid.update(map_out);
(void)compass_dir;
$map_grid.update(L"I'M BROKEN");
window.draw(*$map_grid.text);
}
}