From 886a97593c1da1351f978c3dc39d9c1ea2ab57d9 Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Sat, 21 Oct 2017 14:26:40 +0200 Subject: First working path finding. --- src/common.hpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/common.hpp') 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 current_path, shortest_path; + + float shortest_dist; + std::deque 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 *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 *path); }; } -- cgit