diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-06-08 09:11:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-08 09:11:49 +0200 |
commit | f35115309b59604064e008d2ed303e966995d28d (patch) | |
tree | 02b71d77ac448baecb1e8e1a19dae8d9ca912d7e /scene/2d | |
parent | 185ac7acd9eae17c5d4c14c43052379ec96d9215 (diff) | |
parent | 6cbafdea163e96ef81df33f1ed7451484c535f43 (diff) |
Merge pull request #19314 from Jellonator/master
Added autotile override
Diffstat (limited to 'scene/2d')
-rw-r--r-- | scene/2d/tile_map.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index d88e148b2c..050a3f245d 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -977,6 +977,14 @@ void TileMap::set_cell_autotile_coord(int p_x, int p_y, const Vector2 &p_coord) c.autotile_coord_x = p_coord.x; c.autotile_coord_y = p_coord.y; tile_map[pk] = c; + + PosKey qk(p_x / _get_quadrant_size(), p_y / _get_quadrant_size()); + Map<PosKey, Quadrant>::Element *Q = quadrant_map.find(qk); + + if (!Q) + return; + + _make_quadrant_dirty(Q); } Vector2 TileMap::get_cell_autotile_coord(int p_x, int p_y) const { |