diff options
Diffstat (limited to 'src/render.cpp')
-rw-r--r-- | src/render.cpp | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/src/render.cpp b/src/render.cpp index 313bc4d..41bcd4b 100644 --- a/src/render.cpp +++ b/src/render.cpp @@ -29,13 +29,16 @@ static void draw_tile(sf::RenderWindow *window, v2f_t x, world::tile_t *tile, wot_rect.setFillColor(sf::Color::White); wot_rect.setOutlineColor(sf::Color::Transparent); window->draw(wot_rect); + wot_rect.setTexture(NULL); - std::stringstream ss; - ss << "L=" << local; - sf::Text text(ss.str(), font, 20); - text.setPosition(x); - text.setScale(0.005, 0.005); - window->draw(text); + if (debug_draw_tile_coords) { + std::stringstream ss; + ss << "L=" << local; + sf::Text text(ss.str(), font, 20); + text.setPosition(x); + text.setScale(0.005, 0.005); + window->draw(text); + } } static void draw_sector(sf::RenderWindow *window, world::sector_t *sector) @@ -49,6 +52,14 @@ static void draw_sector(sf::RenderWindow *window, world::sector_t *sector) void interface::state_t::render() { + if (select.selecting) { + wot_rect.setSize(select.rect.dims()); + wot_rect.setPosition(select.rect[0]); + wot_rect.setFillColor(sf::Color(200, 100, 50, 100)); + wot_rect.setOutlineThickness(0.02f); + wot_rect.setOutlineColor(sf::Color(200, 100, 50, 255)); + window->draw(wot_rect); + } } namespace render { @@ -147,15 +158,9 @@ void state_t::render(game::state_t *game) for (world::entity_t *ent : ents) { ent->render_to(this); - drender_entity(ent); - } - for (world::world_t::debug_t &debug : game->world.debug) { - sf::Text text(debug.text, font, 20); - text.setPosition(debug.x); - text.setScale(0.006, 0.006); - text.setFillColor(sf::Color::Red); - window->draw(text); + if (debug_draw_cmodels) + drender_entity(ent); } } |