I can now create any tiles I want. First version is just one room will have a circular pool in it.
This commit is contained in:
parent
89e31279be
commit
03fe9b3d01
3 changed files with 19 additions and 7 deletions
15
tilemap.cpp
15
tilemap.cpp
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue