summaryrefslogtreecommitdiff
path: root/editor/plugins/tile_map_editor_plugin.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-02-20 22:24:58 +0100
committerGitHub <noreply@github.com>2019-02-20 22:24:58 +0100
commit8107fc98b6ceae749b3c10e6f0432e904961867b (patch)
tree6c0ab829b02aba47ff3dc27b9a14d3c3a0658a3b /editor/plugins/tile_map_editor_plugin.cpp
parent132e2f458df7a3551a251d68afeccd0362ca6be2 (diff)
parent8d51618949d5ea8a94e0f504401e8f852a393968 (diff)
Merge pull request #25853 from marxin/fix-25316-wshadow-local
Add -Wshadow=local to warnings and fix reported issues (#25316).
Diffstat (limited to 'editor/plugins/tile_map_editor_plugin.cpp')
-rw-r--r--editor/plugins/tile_map_editor_plugin.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp
index a967374eb9..3670c78f1f 100644
--- a/editor/plugins/tile_map_editor_plugin.cpp
+++ b/editor/plugins/tile_map_editor_plugin.cpp
@@ -477,17 +477,17 @@ void TileMapEditor::_update_palette() {
if (sel_tile != TileMap::INVALID_CELL) {
if ((manual_autotile && tileset->tile_get_tile_mode(sel_tile) == TileSet::AUTO_TILE) || tileset->tile_get_tile_mode(sel_tile) == TileSet::ATLAS_TILE) {
- const Map<Vector2, uint16_t> &tiles = tileset->autotile_get_bitmask_map(sel_tile);
+ const Map<Vector2, uint16_t> &tiles2 = tileset->autotile_get_bitmask_map(sel_tile);
- Vector<Vector2> entries;
- for (const Map<Vector2, uint16_t>::Element *E = tiles.front(); E; E = E->next()) {
- entries.push_back(E->key());
+ Vector<Vector2> entries2;
+ for (const Map<Vector2, uint16_t>::Element *E = tiles2.front(); E; E = E->next()) {
+ entries2.push_back(E->key());
}
- entries.sort();
+ entries2.sort();
Ref<Texture> tex = tileset->tile_get_texture(sel_tile);
- for (int i = 0; i < entries.size(); i++) {
+ for (int i = 0; i < entries2.size(); i++) {
manual_palette->add_item(String());
@@ -496,7 +496,7 @@ void TileMapEditor::_update_palette() {
Rect2 region = tileset->tile_get_region(sel_tile);
int spacing = tileset->autotile_get_spacing(sel_tile);
region.size = tileset->autotile_get_size(sel_tile); // !!
- region.position += (region.size + Vector2(spacing, spacing)) * entries[i];
+ region.position += (region.size + Vector2(spacing, spacing)) * entries2[i];
if (!region.has_no_area())
manual_palette->set_item_icon_region(manual_palette->get_item_count() - 1, region);
@@ -504,16 +504,16 @@ void TileMapEditor::_update_palette() {
manual_palette->set_item_icon(manual_palette->get_item_count() - 1, tex);
}
- manual_palette->set_item_metadata(manual_palette->get_item_count() - 1, entries[i]);
+ manual_palette->set_item_metadata(manual_palette->get_item_count() - 1, entries2[i]);
}
}
}
if (manual_palette->get_item_count() > 0) {
// Only show the manual palette if at least tile exists in it
- int selected = manual_palette->get_current();
- if (selected == -1) selected = 0;
- manual_palette->set_current(selected);
+ int selected2 = manual_palette->get_current();
+ if (selected2 == -1) selected2 = 0;
+ manual_palette->set_current(selected2);
manual_palette->show();
}