|
|
|
@ -30,10 +30,7 @@ void TileMap::dump(int show_x, int show_y) { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void TileMap::load(matrix::Matrix &walls) { |
|
|
|
|
for(matrix::each_cell it{walls}; it.next();) { |
|
|
|
|
string tile_name = walls[it.y][it.x] == SPACE_VALUE ? "FLOOR_TILE" : "WALL_TILE"; |
|
|
|
|
|
|
|
|
|
void TileMap::set_tile(size_t x, size_t y, string tile_name) { |
|
|
|
|
std::wstring tile_id = $config.wstring(tile_name, "display"); |
|
|
|
|
json tile_conf = $config[tile_name]; |
|
|
|
|
TileCell tile{ |
|
|
|
@ -45,8 +42,14 @@ void TileMap::load(matrix::Matrix &walls) { |
|
|
|
|
tile_conf["background"][1], |
|
|
|
|
tile_conf["background"][2]}; |
|
|
|
|
|
|
|
|
|
$tile_ids[it.y][it.x] = tile_id[0]; |
|
|
|
|
$display[it.y][it.x] = tile; |
|
|
|
|
$tile_ids[y][x] = tile_id[0]; |
|
|
|
|
$display[y][x] = tile; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void TileMap::load(matrix::Matrix &walls) { |
|
|
|
|
for(matrix::each_cell it{walls}; it.next();) { |
|
|
|
|
string tile_name = walls[it.y][it.x] == SPACE_VALUE ? "FLOOR_TILE" : "WALL_TILE"; |
|
|
|
|
set_tile(it.x, it.y, tile_name); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|