summaryrefslogtreecommitdiff
path: root/src/render.cpp
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2017-10-21 14:26:40 +0200
committerPaweł Redman <pawel.redman@gmail.com>2017-10-21 14:26:40 +0200
commit886a97593c1da1351f978c3dc39d9c1ea2ab57d9 (patch)
tree4d8c5d456c8c78a7d7639b4cd608435a5f103f01 /src/render.cpp
parent1c637e1ca5c0b1cf8a91f37c999aa7379fa08a8f (diff)
First working path finding.
Diffstat (limited to 'src/render.cpp')
-rw-r--r--src/render.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/render.cpp b/src/render.cpp
index 9e3adfa..87f4216 100644
--- a/src/render.cpp
+++ b/src/render.cpp
@@ -146,6 +146,24 @@ void state_t::render(oriented_sprite_t *sprite, rectf_t bounds, float angle)
render(sprite->textures + index, bounds, mirror);
}
+void state_t::debug_path(std::list<v2f_t> *path)
+{
+ bool first = true;
+ sf::Vertex line[2];
+
+ for (v2f_t &point : *path) {
+ line[1] = line[0];
+ line[0] = sf::Vertex(point, sf::Color::Blue);
+
+ if (first) {
+ first = false;
+ continue;
+ }
+
+ window->draw(line, 2, sf::Lines);
+ }
+}
+
animated_texture_t::~animated_texture_t(void)
{
delete[] frames;