diff options
author | smix8 <52464204+smix8@users.noreply.github.com> | 2023-02-10 00:52:18 +0100 |
---|---|---|
committer | smix8 <52464204+smix8@users.noreply.github.com> | 2023-02-10 17:13:40 +0100 |
commit | f2c31965c04f17f05d534646ffb5056237a5cdde (patch) | |
tree | 6a307c71a8923760bb9a3f918fd8b446efa4c76f /scene/2d/tile_map.h | |
parent | 929ee61170ec4d431d6d2cfeddccdec2a59a11b7 (diff) |
Fix navigation support for multilayered TileMaps
Fixes support for multilayered TileMaps by creating dedicated navigation maps for each layer.
Diffstat (limited to 'scene/2d/tile_map.h')
-rw-r--r-- | scene/2d/tile_map.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scene/2d/tile_map.h b/scene/2d/tile_map.h index 7cf2a2eded..62d7612be2 100644 --- a/scene/2d/tile_map.h +++ b/scene/2d/tile_map.h @@ -211,6 +211,7 @@ private: HashMap<Vector2i, TileMapCell> tile_map; HashMap<Vector2i, TileMapQuadrant> quadrant_map; SelfList<TileMapQuadrant>::List dirty_quadrant_list; + RID navigation_map; }; LocalVector<TileMapLayer> layers; int selected_layer = -1; @@ -259,6 +260,8 @@ private: void _physics_draw_quadrant_debug(TileMapQuadrant *p_quadrant); void _navigation_notification(int p_what); + void _navigation_update_layer(int p_layer); + void _navigation_cleanup_layer(int p_layer); void _navigation_update_dirty_quadrants(SelfList<TileMapQuadrant>::List &r_dirty_quadrant_list); void _navigation_cleanup_quadrant(TileMapQuadrant *p_quadrant); void _navigation_draw_quadrant_debug(TileMapQuadrant *p_quadrant); @@ -339,6 +342,9 @@ public: void set_navigation_visibility_mode(VisibilityMode p_show_navigation); VisibilityMode get_navigation_visibility_mode(); + void set_navigation_map(int p_layer, RID p_map); + RID get_navigation_map(int p_layer) const; + // Cells accessors. void set_cell(int p_layer, const Vector2i &p_coords, int p_source_id = TileSet::INVALID_SOURCE, const Vector2i p_atlas_coords = TileSetSource::INVALID_ATLAS_COORDS, int p_alternative_tile = 0); void erase_cell(int p_layer, const Vector2i &p_coords); |