Skip to content

Commit

Permalink
Merge pull request godotengine#69713 from groud/rename_get_surroundin…
Browse files Browse the repository at this point in the history
…g_tiles

Rename get_surrounding_tiles to get_surrounding_cells
  • Loading branch information
akien-mga committed Dec 7, 2022
2 parents 5c635e8 + 3ea54bb commit de2d0f1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion doc/classes/TileMap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
Creates a new [TileMapPattern] from the given layer and set of cells.
</description>
</method>
<method name="get_surrounding_tiles">
<method name="get_surrounding_cells">
<return type="Vector2i[]" />
<param index="0" name="coords" type="Vector2i" />
<description>
Expand Down
4 changes: 2 additions & 2 deletions editor/plugins/tiles/tile_map_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1164,7 +1164,7 @@ HashMap<Vector2i, TileMapCell> TileMapEditorTilesPlugin::_draw_bucket_fill(Vecto
}

// Get surrounding tiles (handles different tile shapes).
TypedArray<Vector2i> around = tile_map->get_surrounding_tiles(coords);
TypedArray<Vector2i> around = tile_map->get_surrounding_cells(coords);
for (int i = 0; i < around.size(); i++) {
to_check.push_back(around[i]);
}
Expand Down Expand Up @@ -2547,7 +2547,7 @@ RBSet<Vector2i> TileMapEditorTerrainsPlugin::_get_cells_for_bucket_fill(Vector2i
output.insert(coords);

// Get surrounding tiles (handles different tile shapes).
TypedArray<Vector2i> around = tile_map->get_surrounding_tiles(coords);
TypedArray<Vector2i> around = tile_map->get_surrounding_cells(coords);
for (int i = 0; i < around.size(); i++) {
to_check.push_back(around[i]);
}
Expand Down
4 changes: 2 additions & 2 deletions scene/2d/tile_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3838,7 +3838,7 @@ void TileMap::set_texture_repeat(CanvasItem::TextureRepeat p_texture_repeat) {
}
}

TypedArray<Vector2i> TileMap::get_surrounding_tiles(Vector2i coords) {
TypedArray<Vector2i> TileMap::get_surrounding_cells(Vector2i coords) {
if (!tile_set.is_valid()) {
return TypedArray<Vector2i>();
}
Expand Down Expand Up @@ -4012,7 +4012,7 @@ void TileMap::_bind_methods() {

ClassDB::bind_method(D_METHOD("force_update", "layer"), &TileMap::force_update, DEFVAL(-1));

ClassDB::bind_method(D_METHOD("get_surrounding_tiles", "coords"), &TileMap::get_surrounding_tiles);
ClassDB::bind_method(D_METHOD("get_surrounding_cells", "coords"), &TileMap::get_surrounding_cells);

ClassDB::bind_method(D_METHOD("get_used_cells", "layer"), &TileMap::get_used_cells);
ClassDB::bind_method(D_METHOD("get_used_rect"), &TileMap::get_used_rect);
Expand Down
2 changes: 1 addition & 1 deletion scene/2d/tile_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ class TileMap : public Node2D {
void force_update(int p_layer = -1);

// Helpers?
TypedArray<Vector2i> get_surrounding_tiles(Vector2i coords);
TypedArray<Vector2i> get_surrounding_cells(Vector2i coords);
void draw_cells_outline(Control *p_control, RBSet<Vector2i> p_cells, Color p_color, Transform2D p_transform = Transform2D());

// Virtual function to modify the TileData at runtime
Expand Down

0 comments on commit de2d0f1

Please sign in to comment.