summaryrefslogtreecommitdiff
path: root/src/common.hpp
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/common.hpp
parent1c637e1ca5c0b1cf8a91f37c999aa7379fa08a8f (diff)
First working path finding.
Diffstat (limited to 'src/common.hpp')
-rw-r--r--src/common.hpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/common.hpp b/src/common.hpp
index bbf83cf..8f610a5 100644
--- a/src/common.hpp
+++ b/src/common.hpp
@@ -121,16 +121,19 @@ namespace world {
class path_finder_t {
public:
- v2f_t src, dst;
+ v2f_t src, dst, tile_center;
path_node_t *nodes;
size_t width, height;
tile_index_t base;
- std::stack<v2f_t> current_path, shortest_path;
+
+ float shortest_dist;
+ std::deque<tile_index_t> path, shortest_path;
~path_finder_t();
void setup_nodes(v2f_t src_, v2f_t dst_);
void find_r(tile_index_t index, float dist);
void find(void);
+ bool export_path(std::list<v2f_t> *list);
};
}
@@ -215,6 +218,8 @@ namespace render {
void render(game::state_t *game);
void render(animated_texture_t *anim, rectf_t bounds, bool mirror = false);
void render(oriented_sprite_t *sprite, rectf_t bounds, float angle);
+
+ void debug_path(std::list<v2f_t> *path);
};
}