diff options
Diffstat (limited to 'src/render.cpp')
-rw-r--r-- | src/render.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/render.cpp b/src/render.cpp index 66eeba8..9e3adfa 100644 --- a/src/render.cpp +++ b/src/render.cpp @@ -2,6 +2,7 @@ #include <list> static sf::RectangleShape wot_rect; +static sf::Font font; static void draw_tile(sf::RenderWindow *window, v2f_t x, world::tile_t *tile) { @@ -53,6 +54,8 @@ namespace render { state_t::state_t(sf::RenderWindow *window_) { window = window_; + + font.loadFromFile("assets/LiberationMono-Regular.ttf"); } void state_t::begin_frame(double time_) @@ -95,6 +98,14 @@ void state_t::render(game::state_t *game) for (world::entity_t *ent : ents) ent->render_to(this); + + 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.setColor(sf::Color::Red); + window->draw(text); + } } void state_t::render(animated_texture_t *anim, rectf_t bounds, bool mirror){ |