Ripped out the string based map and created a Matrix map drawing function.
This commit is contained in:
parent
d9219a8c64
commit
dd541ae59d
4 changed files with 11 additions and 28 deletions
|
@ -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>);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue