diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2017-11-07 12:06:19 +0100 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2017-11-07 12:06:19 +0100 |
commit | 7471347839f30a85e985891b945a721967fcfb86 (patch) | |
tree | 762a37e4792672b0af7a0878b41b828508c91e2a /src/render.cpp | |
parent | f951af3cfdef3d23fd5875078a29c15ebf9120e9 (diff) |
Avoid walking into walls.
Diffstat (limited to 'src/render.cpp')
-rw-r--r-- | src/render.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/render.cpp b/src/render.cpp index 9fb1625..313bc4d 100644 --- a/src/render.cpp +++ b/src/render.cpp @@ -5,7 +5,8 @@ static sf::RectangleShape wot_rect; static sf::Font font; -static void draw_tile(sf::RenderWindow *window, v2f_t x, world::tile_t *tile) +static void draw_tile(sf::RenderWindow *window, v2f_t x, world::tile_t *tile, + world::tile_index_t local) { sf::Texture *texture; @@ -30,7 +31,7 @@ static void draw_tile(sf::RenderWindow *window, v2f_t x, world::tile_t *tile) window->draw(wot_rect); std::stringstream ss; - ss << tile->type << ":" << tile->neighbors; + ss << "L=" << local; sf::Text text(ss.str(), font, 20); text.setPosition(x); text.setScale(0.005, 0.005); @@ -42,7 +43,8 @@ static void draw_sector(sf::RenderWindow *window, world::sector_t *sector) for (ssize_t y = 0; y < SECTOR_SIZE; y++) for (ssize_t x = 0; x < SECTOR_SIZE; x++) draw_tile(window, sector->bounds.v[0] + v2f_t(x, y), - sector->tiles + y * SECTOR_SIZE + x); + sector->tiles + y * SECTOR_SIZE + x, + world::tile_index_t(x, y)); } void interface::state_t::render() |