diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-02-20 22:24:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-20 22:24:58 +0100 |
commit | 8107fc98b6ceae749b3c10e6f0432e904961867b (patch) | |
tree | 6c0ab829b02aba47ff3dc27b9a14d3c3a0658a3b /editor | |
parent | 132e2f458df7a3551a251d68afeccd0362ca6be2 (diff) | |
parent | 8d51618949d5ea8a94e0f504401e8f852a393968 (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')
41 files changed, 406 insertions, 406 deletions
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index bee8ddcea0..d92b745e26 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -132,7 +132,7 @@ public: if (existing != -1) { Variant v = animation->track_get_key_value(track, existing); - float trans = animation->track_get_key_transition(track, existing); + trans = animation->track_get_key_transition(track, existing); undo_redo->add_undo_method(animation.ptr(), "track_insert_key", track, new_time, v, trans); } @@ -384,12 +384,12 @@ public: if (name == "animation") { - StringName name = p_value; + StringName anim_name = p_value; setting = true; undo_redo->create_action(TTR("Anim Change Keyframe Value"), UndoRedo::MERGE_ENDS); StringName prev = animation->animation_track_get_key_animation(track, key); - undo_redo->add_do_method(animation.ptr(), "animation_track_set_key_animation", track, key, name); + undo_redo->add_do_method(animation.ptr(), "animation_track_set_key_animation", track, key, anim_name); undo_redo->add_undo_method(animation.ptr(), "animation_track_set_key_animation", track, key, prev); undo_redo->add_do_method(this, "_update_obj", animation); undo_redo->add_undo_method(this, "_update_obj", animation); @@ -2833,9 +2833,9 @@ void AnimationTrackEditor::insert_node_value_key(Node *p_node, const String &p_p if (animation->track_get_path(i) == np) { value = p_value; //all good } else { - String path = animation->track_get_path(i); - if (NodePath(path.get_basename()) == np) { - String subindex = path.get_extension(); + String tpath = animation->track_get_path(i); + if (NodePath(tpath.get_basename()) == np) { + String subindex = tpath.get_extension(); value = p_value.get(subindex); } else { continue; @@ -2928,9 +2928,9 @@ void AnimationTrackEditor::insert_value_key(const String &p_property, const Vari if (animation->track_get_path(i) == np) { value = p_value; //all good } else { - String path = animation->track_get_path(i); - if (NodePath(path.get_basename()) == np) { - String subindex = path.get_extension(); + String tpath = animation->track_get_path(i); + if (NodePath(tpath.get_basename()) == np) { + String subindex = tpath.get_extension(); value = p_value.get(subindex); } else { continue; @@ -4329,9 +4329,9 @@ void AnimationTrackEditor::_edit_menu_pressed(int p_option) { text = node->get_name(); Vector<StringName> sn = path.get_subnames(); - for (int i = 0; i < sn.size(); i++) { + for (int j = 0; j < sn.size(); j++) { text += "."; - text += sn[i]; + text += sn[j]; } path = NodePath(node->get_path().get_names(), path.get_subnames(), true); //store full path instead for copying diff --git a/editor/animation_track_editor_plugins.cpp b/editor/animation_track_editor_plugins.cpp index 8c2c2b7f38..bb0bd1b458 100644 --- a/editor/animation_track_editor_plugins.cpp +++ b/editor/animation_track_editor_plugins.cpp @@ -29,6 +29,7 @@ /*************************************************************************/ #include "animation_track_editor_plugins.h" + #include "editor/audio_stream_preview.h" #include "editor_resource_preview.h" #include "editor_scale.h" @@ -37,6 +38,7 @@ #include "scene/3d/sprite_3d.h" #include "scene/animation/animation_player.h" #include "servers/audio/audio_stream.h" + /// BOOL /// int AnimationTrackEditBool::get_key_height() const { @@ -247,9 +249,6 @@ void AnimationTrackEditAudio::draw_key(int p_index, float p_pixels_sec, int p_x, return; } - Ref<Font> font = get_font("font", "Label"); - float fh = int(font->get_height() * 1.5); - bool play = get_animation()->track_get_key_value(get_track(), p_index); if (play) { float len = stream->get_length(); @@ -285,8 +284,9 @@ void AnimationTrackEditAudio::draw_key(int p_index, float p_pixels_sec, int p_x, if (to_x <= from_x) return; - int h = get_size().height; - Rect2 rect = Rect2(from_x, (h - fh) / 2, to_x - from_x, fh); + Ref<Font> font = get_font("font", "Label"); + float fh = int(font->get_height() * 1.5); + Rect2 rect = Rect2(from_x, (get_size().height - fh) / 2, to_x - from_x, fh); draw_rect(rect, Color(0.25, 0.25, 0.25)); Vector<Vector2> lines; @@ -439,13 +439,13 @@ void AnimationTrackEditSpriteFrame::draw_key(int p_index, float p_pixels_sec, in return; } - int frame = get_animation()->track_get_key_value(get_track(), p_index); - Ref<Texture> texture; Rect2 region; if (Object::cast_to<Sprite>(object) || Object::cast_to<Sprite3D>(object)) { + int frame = get_animation()->track_get_key_value(get_track(), p_index); + texture = object->call("get_texture"); if (!texture.is_valid()) { AnimationTrackEdit::draw_key(p_index, p_pixels_sec, p_x, p_selected, p_clip_left, p_clip_right); diff --git a/editor/collada/collada.cpp b/editor/collada/collada.cpp index 2f80690ed1..94e6d4ded0 100644 --- a/editor/collada/collada.cpp +++ b/editor/collada/collada.cpp @@ -2071,17 +2071,17 @@ void Collada::_parse_library(XMLParser &parser) { } else if (name == "geometry") { String id = parser.get_attribute_value("id"); - String name = parser.get_attribute_value_safe("name"); + String name2 = parser.get_attribute_value_safe("name"); while (parser.read() == OK) { if (parser.get_node_type() == XMLParser::NODE_ELEMENT) { if (parser.get_node_name() == "mesh") { - state.mesh_name_map[id] = (name != "") ? name : id; - _parse_mesh_geometry(parser, id, name); + state.mesh_name_map[id] = (name2 != "") ? name2 : id; + _parse_mesh_geometry(parser, id, name2); } else if (parser.get_node_name() == "spline") { - state.mesh_name_map[id] = (name != "") ? name : id; - _parse_curve_geometry(parser, id, name); + state.mesh_name_map[id] = (name2 != "") ? name2 : id; + _parse_curve_geometry(parser, id, name2); } else if (!parser.is_empty()) parser.skip_section(); } else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && parser.get_node_name() == "geometry") diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp index 7a5ebc5c00..f775a0a14b 100644 --- a/editor/connections_dialog.cpp +++ b/editor/connections_dialog.cpp @@ -766,7 +766,7 @@ void ConnectionsDock::update_tree() { while (base) { - List<MethodInfo> node_signals; + List<MethodInfo> node_signals2; Ref<Texture> icon; String name; @@ -774,7 +774,7 @@ void ConnectionsDock::update_tree() { Ref<Script> scr = selectedNode->get_script(); if (scr.is_valid()) { - scr->get_script_signal_list(&node_signals); + scr->get_script_signal_list(&node_signals2); if (scr->get_path().is_resource_file()) name = scr->get_path().get_file(); else @@ -787,7 +787,7 @@ void ConnectionsDock::update_tree() { } else { - ClassDB::get_signal_list(base, &node_signals, true); + ClassDB::get_signal_list(base, &node_signals2, true); if (has_icon(base, "EditorIcons")) { icon = get_icon(base, "EditorIcons"); } @@ -796,17 +796,17 @@ void ConnectionsDock::update_tree() { TreeItem *pitem = NULL; - if (node_signals.size()) { + if (node_signals2.size()) { pitem = tree->create_item(root); pitem->set_text(0, name); pitem->set_icon(0, icon); pitem->set_selectable(0, false); pitem->set_editable(0, false); pitem->set_custom_bg_color(0, get_color("prop_subsection", "Editor")); - node_signals.sort(); + node_signals2.sort(); } - for (List<MethodInfo>::Element *E = node_signals.front(); E; E = E->next()) { + for (List<MethodInfo>::Element *E = node_signals2.front(); E; E = E->next()) { MethodInfo &mi = E->get(); diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp index 3c2bfdc04d..fbc23aa8e2 100644 --- a/editor/create_dialog.cpp +++ b/editor/create_dialog.cpp @@ -299,15 +299,15 @@ void CreateDialog::_update_search() { } else { bool found = false; - String type = I->get(); - while (type != "" && (cpp_type ? ClassDB::is_parent_class(type, base_type) : ed.script_class_is_parent(type, base_type)) && type != base_type) { - if (search_box->get_text().is_subsequence_ofi(type)) { + String type2 = I->get(); + while (type2 != "" && (cpp_type ? ClassDB::is_parent_class(type2, base_type) : ed.script_class_is_parent(type2, base_type)) && type2 != base_type) { + if (search_box->get_text().is_subsequence_ofi(type2)) { found = true; break; } - type = cpp_type ? ClassDB::get_parent_class(type) : ed.script_class_get_base(type); + type2 = cpp_type ? ClassDB::get_parent_class(type2) : ed.script_class_get_base(type2); } if (found) diff --git a/editor/doc/doc_data.cpp b/editor/doc/doc_data.cpp index 24a746d159..8f1d0d9677 100644 --- a/editor/doc/doc_data.cpp +++ b/editor/doc/doc_data.cpp @@ -497,9 +497,9 @@ void DocData::generate(bool p_basic_types) { method.name = mi.name; - for (int i = 0; i < mi.arguments.size(); i++) { + for (int j = 0; j < mi.arguments.size(); j++) { - PropertyInfo arginfo = mi.arguments[i]; + PropertyInfo arginfo = mi.arguments[j]; ArgumentDoc ad; ad.name = arginfo.name; @@ -509,7 +509,7 @@ void DocData::generate(bool p_basic_types) { else ad.type = Variant::get_type_name(arginfo.type); - int defarg = mi.default_arguments.size() - mi.arguments.size() + i; + int defarg = mi.default_arguments.size() - mi.arguments.size() + j; if (defarg >= 0) ad.default_value = mi.default_arguments[defarg]; @@ -620,12 +620,12 @@ void DocData::generate(bool p_basic_types) { return_doc_from_retinfo(md, mi.return_val); - for (int i = 0; i < mi.arguments.size(); i++) { + for (int j = 0; j < mi.arguments.size(); j++) { ArgumentDoc ad; - argument_doc_from_arginfo(ad, mi.arguments[i]); + argument_doc_from_arginfo(ad, mi.arguments[j]); - int darg_idx = i - (mi.arguments.size() - mi.default_arguments.size()); + int darg_idx = j - (mi.arguments.size() - mi.default_arguments.size()); if (darg_idx >= 0) { Variant default_arg = E->get().default_arguments[darg_idx]; @@ -734,9 +734,9 @@ Error DocData::load_classes(const String &p_dir) { while (path != String()) { if (!isdir && path.ends_with("xml")) { Ref<XMLParser> parser = memnew(XMLParser); - Error err = parser->open(p_dir.plus_file(path)); - if (err) - return err; + Error err2 = parser->open(p_dir.plus_file(path)); + if (err2) + return err2; _load(parser); } @@ -806,78 +806,78 @@ Error DocData::_load(Ref<XMLParser> parser) { if (parser->get_node_type() == XMLParser::NODE_ELEMENT) { - String name = parser->get_node_name(); + String name2 = parser->get_node_name(); - if (name == "brief_description") { + if (name2 == "brief_description") { parser->read(); if (parser->get_node_type() == XMLParser::NODE_TEXT) c.brief_description = parser->get_node_data(); - } else if (name == "description") { + } else if (name2 == "description") { parser->read(); if (parser->get_node_type() == XMLParser::NODE_TEXT) c.description = parser->get_node_data(); - } else if (name == "tutorials") { + } else if (name2 == "tutorials") { while (parser->read() == OK) { if (parser->get_node_type() == XMLParser::NODE_ELEMENT) { - String name = parser->get_node_name(); + String name3 = parser->get_node_name(); - if (name == "link") { + if (name3 == "link") { parser->read(); if (parser->get_node_type() == XMLParser::NODE_TEXT) c.tutorials.push_back(parser->get_node_data().strip_edges()); } else { - ERR_EXPLAIN("Invalid tag in doc file: " + name); + ERR_EXPLAIN("Invalid tag in doc file: " + name3); ERR_FAIL_V(ERR_FILE_CORRUPT); } } else if (parser->get_node_type() == XMLParser::NODE_ELEMENT_END && parser->get_node_name() == "tutorials") break; //end of <tutorials> } - } else if (name == "demos") { + } else if (name2 == "demos") { parser->read(); if (parser->get_node_type() == XMLParser::NODE_TEXT) c.demos = parser->get_node_data(); - } else if (name == "methods") { + } else if (name2 == "methods") { - Error err = _parse_methods(parser, c.methods); - ERR_FAIL_COND_V(err, err); + Error err2 = _parse_methods(parser, c.methods); + ERR_FAIL_COND_V(err2, err2); - } else if (name == "signals") { + } else if (name2 == "signals") { - Error err = _parse_methods(parser, c.signals); - ERR_FAIL_COND_V(err, err); - } else if (name == "members") { + Error err2 = _parse_methods(parser, c.signals); + ERR_FAIL_COND_V(err2, err2); + } else if (name2 == "members") { while (parser->read() == OK) { if (parser->get_node_type() == XMLParser::NODE_ELEMENT) { - String name = parser->get_node_name(); + String name3 = parser->get_node_name(); - if (name == "member") { + if (name3 == "member") { - PropertyDoc prop; + PropertyDoc prop2; ERR_FAIL_COND_V(!parser->has_attribute("name"), ERR_FILE_CORRUPT); - prop.name = parser->get_attribute_value("name"); + prop2.name = parser->get_attribute_value("name"); ERR_FAIL_COND_V(!parser->has_attribute("type"), ERR_FILE_CORRUPT); - prop.type = parser->get_attribute_value("type"); + prop2.type = parser->get_attribute_value("type"); if (parser->has_attribute("setter")) - prop.setter = parser->get_attribute_value("setter"); + prop2.setter = parser->get_attribute_value("setter"); if (parser->has_attribute("getter")) - prop.getter = parser->get_attribute_value("getter"); + prop2.getter = parser->get_attribute_value("getter"); if (parser->has_attribute("enum")) - prop.enumeration = parser->get_attribute_value("enum"); + prop2.enumeration = parser->get_attribute_value("enum"); parser->read(); if (parser->get_node_type() == XMLParser::NODE_TEXT) - prop.description = parser->get_node_data(); - c.properties.push_back(prop); + prop2.description = parser->get_node_data(); + c.properties.push_back(prop2); } else { - ERR_EXPLAIN("Invalid tag in doc file: " + name); + ERR_EXPLAIN("Invalid tag in doc file: " + name3); ERR_FAIL_V(ERR_FILE_CORRUPT); } @@ -885,28 +885,28 @@ Error DocData::_load(Ref<XMLParser> parser) { break; //end of <constants> } - } else if (name == "theme_items") { + } else if (name2 == "theme_items") { while (parser->read() == OK) { if (parser->get_node_type() == XMLParser::NODE_ELEMENT) { - String name = parser->get_node_name(); + String name3 = parser->get_node_name(); - if (name == "theme_item") { + if (name3 == "theme_item") { - PropertyDoc prop; + PropertyDoc prop2; ERR_FAIL_COND_V(!parser->has_attribute("name"), ERR_FILE_CORRUPT); - prop.name = parser->get_attribute_value("name"); + prop2.name = parser->get_attribute_value("name"); ERR_FAIL_COND_V(!parser->has_attribute("type"), ERR_FILE_CORRUPT); - prop.type = parser->get_attribute_value("type"); + prop2.type = parser->get_attribute_value("type"); parser->read(); if (parser->get_node_type() == XMLParser::NODE_TEXT) - prop.description = parser->get_node_data(); - c.theme_properties.push_back(prop); + prop2.description = parser->get_node_data(); + c.theme_properties.push_back(prop2); } else { - ERR_EXPLAIN("Invalid tag in doc file: " + name); + ERR_EXPLAIN("Invalid tag in doc file: " + name3); ERR_FAIL_V(ERR_FILE_CORRUPT); } @@ -914,30 +914,30 @@ Error DocData::_load(Ref<XMLParser> parser) { break; //end of <constants> } - } else if (name == "constants") { + } else if (name2 == "constants") { while (parser->read() == OK) { if (parser->get_node_type() == XMLParser::NODE_ELEMENT) { - String name = parser->get_node_name(); + String name3 = parser->get_node_name(); - if (name == "constant") { + if (name3 == "constant") { - ConstantDoc constant; + ConstantDoc constant2; ERR_FAIL_COND_V(!parser->has_attribute("name"), ERR_FILE_CORRUPT); - constant.name = parser->get_attribute_value("name"); + constant2.name = parser->get_attribute_value("name"); ERR_FAIL_COND_V(!parser->has_attribute("value"), ERR_FILE_CORRUPT); - constant.value = parser->get_attribute_value("value"); + constant2.value = parser->get_attribute_value("value"); if (parser->has_attribute("enum")) { - constant.enumeration = parser->get_attribute_value("enum"); + constant2.enumeration = parser->get_attribute_value("enum"); } parser->read(); if (parser->get_node_type() == XMLParser::NODE_TEXT) - constant.description = parser->get_node_data(); - c.constants.push_back(constant); + constant2.description = parser->get_node_data(); + c.constants.push_back(constant2); } else { - ERR_EXPLAIN("Invalid tag in doc file: " + name); + ERR_EXPLAIN("Invalid tag in doc file: " + name3); ERR_FAIL_V(ERR_FILE_CORRUPT); } @@ -947,7 +947,7 @@ Error DocData::_load(Ref<XMLParser> parser) { } else { - ERR_EXPLAIN("Invalid tag in doc file: " + name); + ERR_EXPLAIN("Invalid tag in doc file: " + name2); ERR_FAIL_V(ERR_FILE_CORRUPT); } diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp index f5cbc3861a..bc8aa7688a 100644 --- a/editor/editor_audio_buses.cpp +++ b/editor/editor_audio_buses.cpp @@ -385,9 +385,9 @@ void EditorAudioBus::_effect_selected() { if (effect->get_metadata(0) != Variant()) { int index = effect->get_metadata(0); - Ref<AudioEffect> effect = AudioServer::get_singleton()->get_bus_effect(get_index(), index); - if (effect.is_valid()) { - EditorNode::get_singleton()->push_item(effect.ptr()); + Ref<AudioEffect> effect2 = AudioServer::get_singleton()->get_bus_effect(get_index(), index); + if (effect2.is_valid()) { + EditorNode::get_singleton()->push_item(effect2.ptr()); } } diff --git a/editor/editor_autoload_settings.cpp b/editor/editor_autoload_settings.cpp index 9534410590..2f2b0d2cba 100644 --- a/editor/editor_autoload_settings.cpp +++ b/editor/editor_autoload_settings.cpp @@ -598,8 +598,8 @@ void EditorAutoloadSettings::drop_data_fw(const Point2 &p_point, const Variant & int i = 0; - for (List<AutoLoadInfo>::Element *E = autoload_cache.front(); E; E = E->next()) { - orders.write[i++] = E->get().order; + for (List<AutoLoadInfo>::Element *F = autoload_cache.front(); F; F = F->next()) { + orders.write[i++] = F->get().order; } orders.sort(); @@ -610,9 +610,9 @@ void EditorAutoloadSettings::drop_data_fw(const Point2 &p_point, const Variant & i = 0; - for (List<AutoLoadInfo>::Element *E = autoload_cache.front(); E; E = E->next()) { - undo_redo->add_do_method(ProjectSettings::get_singleton(), "set_order", "autoload/" + E->get().name, orders[i++]); - undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set_order", "autoload/" + E->get().name, E->get().order); + for (List<AutoLoadInfo>::Element *F = autoload_cache.front(); F; F = F->next()) { + undo_redo->add_do_method(ProjectSettings::get_singleton(), "set_order", "autoload/" + F->get().name, orders[i++]); + undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set_order", "autoload/" + F->get().name, F->get().order); } orders.clear(); diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index a262f1886c..ea36410cc3 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -260,12 +260,12 @@ void EditorFileSystem::_scan_filesystem() { if (FileAccess::exists(update_cache)) { { - FileAccessRef f = FileAccess::open(update_cache, FileAccess::READ); - String l = f->get_line().strip_edges(); + FileAccessRef f2 = FileAccess::open(update_cache, FileAccess::READ); + String l = f2->get_line().strip_edges(); while (l != String()) { file_cache.erase(l); //erase cache for this, so it gets updated - l = f->get_line().strip_edges(); + l = f2->get_line().strip_edges(); } } @@ -686,17 +686,17 @@ void EditorFileSystem::_scan_new_dir(EditorFileSystemDirectory *p_dir, DirAccess _scan_new_dir(efd, da, p_progress.get_sub(idx, total)); - int idx = 0; + int idx2 = 0; for (int i = 0; i < p_dir->subdirs.size(); i++) { if (efd->name < p_dir->subdirs[i]->name) break; - idx++; + idx2++; } - if (idx == p_dir->subdirs.size()) { + if (idx2 == p_dir->subdirs.size()) { p_dir->subdirs.push_back(efd); } else { - p_dir->subdirs.insert(idx, efd); + p_dir->subdirs.insert(idx2, efd); } da->change_dir(".."); diff --git a/editor/editor_folding.cpp b/editor/editor_folding.cpp index 6b13d19d33..77c0f7491e 100644 --- a/editor/editor_folding.cpp +++ b/editor/editor_folding.cpp @@ -171,9 +171,9 @@ void EditorFolding::load_scene_folding(Node *p_scene, const String &p_path) { ERR_FAIL_COND(res_unfolds.size() & 1); for (int i = 0; i < unfolds.size(); i += 2) { - NodePath path = unfolds[i]; + NodePath path2 = unfolds[i]; PoolVector<String> un = unfolds[i + 1]; - Node *node = p_scene->get_node_or_null(path); + Node *node = p_scene->get_node_or_null(path2); if (!node) { continue; } @@ -181,17 +181,17 @@ void EditorFolding::load_scene_folding(Node *p_scene, const String &p_path) { } for (int i = 0; i < res_unfolds.size(); i += 2) { - String path = res_unfolds[i]; + String path2 = res_unfolds[i]; RES res; - if (ResourceCache::has(path)) { - res = RES(ResourceCache::get(path)); + if (ResourceCache::has(path2)) { + res = RES(ResourceCache::get(path2)); } if (res.is_null()) { continue; } - PoolVector<String> unfolds = res_unfolds[i + 1]; - _set_unfolds(res.ptr(), unfolds); + PoolVector<String> unfolds2 = res_unfolds[i + 1]; + _set_unfolds(res.ptr(), unfolds2); } } diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index 94761cadef..e8ee5069a5 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -215,14 +215,14 @@ void EditorProperty::_notification(int p_what) { else checkbox = get_icon("unchecked", "CheckBox"); - Color color(1, 1, 1); + Color color2(1, 1, 1); if (check_hover) { - color.r *= 1.2; - color.g *= 1.2; - color.b *= 1.2; + color2.r *= 1.2; + color2.g *= 1.2; + color2.b *= 1.2; } check_rect = Rect2(ofs, ((size.height - checkbox->get_height()) / 2), checkbox->get_width(), checkbox->get_height()); - draw_texture(checkbox, check_rect.position, color); + draw_texture(checkbox, check_rect.position, color2); ofs += get_constant("hseparator", "Tree"); ofs += checkbox->get_width(); } else { @@ -236,14 +236,14 @@ void EditorProperty::_notification(int p_what) { text_limit -= reload_icon->get_width() + get_constant("hseparator", "Tree") * 2; revert_rect = Rect2(text_limit + get_constant("hseparator", "Tree"), (size.height - reload_icon->get_height()) / 2, reload_icon->get_width(), reload_icon->get_height()); - Color color(1, 1, 1); + Color color2(1, 1, 1); if (revert_hover) { - color.r *= 1.2; - color.g *= 1.2; - color.b *= 1.2; + color2.r *= 1.2; + color2.g *= 1.2; + color2.b *= 1.2; } - draw_texture(reload_icon, revert_rect.position, color); + draw_texture(reload_icon, revert_rect.position, color2); } else { revert_rect = Rect2(); } @@ -262,14 +262,14 @@ void EditorProperty::_notification(int p_what) { ofs = size.width - key->get_width() - get_constant("hseparator", "Tree"); - Color color(1, 1, 1); + Color color2(1, 1, 1); if (keying_hover) { - color.r *= 1.2; - color.g *= 1.2; - color.b *= 1.2; + color2.r *= 1.2; + color2.g *= 1.2; + color2.b *= 1.2; } keying_rect = Rect2(ofs, ((size.height - key->get_height()) / 2), key->get_width(), key->get_height()); - draw_texture(key, keying_rect.position, color); + draw_texture(key, keying_rect.position, color2); } else { keying_rect = Rect2(); } @@ -1482,19 +1482,19 @@ void EditorInspector::update_tree() { category->bg_color = get_color("prop_category", "Editor"); if (use_doc_hints) { - StringName type = p.name; - if (!class_descr_cache.has(type)) { + StringName type2 = p.name; + if (!class_descr_cache.has(type2)) { String descr; DocData *dd = EditorHelp::get_doc_data(); - Map<String, DocData::ClassDoc>::Element *E = dd->class_list.find(type); + Map<String, DocData::ClassDoc>::Element *E = dd->class_list.find(type2); if (E) { descr = E->get().brief_description; } - class_descr_cache[type] = descr.word_wrap(80); + class_descr_cache[type2] = descr.word_wrap(80); } - category->set_tooltip(p.name + "::" + (class_descr_cache[type] == "" ? "" : class_descr_cache[type])); + category->set_tooltip(p.name + "::" + (class_descr_cache[type2] == "" ? "" : class_descr_cache[type2])); } for (List<Ref<EditorInspectorPlugin> >::Element *E = valid_plugins.front(); E; E = E->next()) { @@ -1639,16 +1639,16 @@ void EditorInspector::update_tree() { if (!found) { DocData *dd = EditorHelp::get_doc_data(); - Map<String, DocData::ClassDoc>::Element *E = dd->class_list.find(classname); - while (E && descr == String()) { - for (int i = 0; i < E->get().properties.size(); i++) { - if (E->get().properties[i].name == propname.operator String()) { - descr = E->get().properties[i].description.strip_edges().word_wrap(80); + Map<String, DocData::ClassDoc>::Element *F = dd->class_list.find(classname); + while (F && descr == String()) { + for (int i = 0; i < F->get().properties.size(); i++) { + if (F->get().properties[i].name == propname.operator String()) { + descr = F->get().properties[i].description.strip_edges().word_wrap(80); break; } } - if (!E->get().inherits.empty()) { - E = dd->class_list.find(E->get().inherits); + if (!F->get().inherits.empty()) { + F = dd->class_list.find(F->get().inherits); } else { break; } diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 745be39df7..94c5470c83 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -880,9 +880,9 @@ bool EditorNode::_find_and_save_edited_subresources(Object *obj, Map<RES, bool> Dictionary d = obj->get(E->get().name); List<Variant> keys; d.get_key_list(&keys); - for (List<Variant>::Element *E = keys.front(); E; E = E->next()) { + for (List<Variant>::Element *F = keys.front(); F; F = F->next()) { - Variant v = d[E->get()]; + Variant v = d[F->get()]; RES res = v; if (_find_and_save_resource(res, processed, flags)) ret_changed = true; @@ -4900,9 +4900,9 @@ EditorNode::EditorNode() { import_collada.instance(); import_scene->add_importer(import_collada); - Ref<EditorOBJImporter> import_obj; - import_obj.instance(); - import_scene->add_importer(import_obj); + Ref<EditorOBJImporter> import_obj2; + import_obj2.instance(); + import_scene->add_importer(import_obj2); Ref<EditorSceneImporterGLTF> import_gltf; import_gltf.instance(); diff --git a/editor/editor_plugin_settings.cpp b/editor/editor_plugin_settings.cpp index ecc3b33a15..09577e39e1 100644 --- a/editor/editor_plugin_settings.cpp +++ b/editor/editor_plugin_settings.cpp @@ -92,9 +92,9 @@ void EditorPluginSettings::update_plugins() { cf.instance(); String path = "res://addons/" + plugins[i] + "/plugin.cfg"; - Error err = cf->load(path); + Error err2 = cf->load(path); - if (err != OK) { + if (err2 != OK) { WARN_PRINTS("Can't load plugin config: " + path); } else if (!cf->has_section_key("plugin", "name")) { WARN_PRINTS("Plugin misses plugin/name: " + path); @@ -108,7 +108,7 @@ void EditorPluginSettings::update_plugins() { WARN_PRINTS("Plugin misses plugin/script: " + path); } else { - String d = plugins[i]; + String d2 = plugins[i]; String name = cf->get_value("plugin", "name"); String author = cf->get_value("plugin", "author"); String version = cf->get_value("plugin", "version"); @@ -118,7 +118,7 @@ void EditorPluginSettings::update_plugins() { TreeItem *item = plugin_list->create_item(root); item->set_text(0, name); item->set_tooltip(0, "Name: " + name + "\nPath: " + path + "\nMain Script: " + script + "\nDescription: " + description); - item->set_metadata(0, d); + item->set_metadata(0, d2); item->set_text(1, version); item->set_metadata(1, script); item->set_text(2, author); @@ -129,7 +129,7 @@ void EditorPluginSettings::update_plugins() { item->set_editable(3, true); item->add_button(4, get_icon("Edit", "EditorIcons"), BUTTON_PLUGIN_EDIT, false, TTR("Edit Plugin")); - if (EditorNode::get_singleton()->is_addon_plugin_enabled(d)) { + if (EditorNode::get_singleton()->is_addon_plugin_enabled(d2)) { item->set_custom_color(3, get_color("success_color", "Editor")); item->set_range(3, 1); } else { diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index 614edda58c..98950023ce 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -665,10 +665,10 @@ public: uint32_t idx = i * 10 + j; bool on = value & (1 << idx); - Rect2 rect = Rect2(o, Size2(bsize, bsize)); + Rect2 rect2 = Rect2(o, Size2(bsize, bsize)); color.a = on ? 0.6 : 0.2; - draw_rect(rect, color); - flag_rects.push_back(rect); + draw_rect(rect2, color); + flag_rects.push_back(rect2); } } } @@ -2277,8 +2277,8 @@ void EditorPropertyResource::_update_menu_items() { List<StringName> inheritors; ClassDB::get_inheriters_from_class(base.strip_edges(), &inheritors); - for (int i = 0; i < custom_resources.size(); i++) { - inheritors.push_back(custom_resources[i].name); + for (int j = 0; j < custom_resources.size(); j++) { + inheritors.push_back(custom_resources[j].name); } List<StringName>::Element *E = inheritors.front(); @@ -2287,17 +2287,17 @@ void EditorPropertyResource::_update_menu_items() { E = E->next(); } - for (Set<String>::Element *E = valid_inheritors.front(); E; E = E->next()) { - String t = E->get(); + for (Set<String>::Element *F = valid_inheritors.front(); F; F = F->next()) { + String t = F->get(); bool is_custom_resource = false; Ref<Texture> icon; if (!custom_resources.empty()) { - for (int i = 0; i < custom_resources.size(); i++) { - if (custom_resources[i].name == t) { + for (int j = 0; j < custom_resources.size(); j++) { + if (custom_resources[j].name == t) { is_custom_resource = true; - if (custom_resources[i].icon.is_valid()) - icon = custom_resources[i].icon; + if (custom_resources[j].icon.is_valid()) + icon = custom_resources[j].icon; break; } } diff --git a/editor/editor_spin_slider.cpp b/editor/editor_spin_slider.cpp index 927ef9ab52..dcb106899e 100644 --- a/editor/editor_spin_slider.cpp +++ b/editor/editor_spin_slider.cpp @@ -213,14 +213,14 @@ void EditorSpinSlider::_notification(int p_what) { draw_string(font, Vector2(sb->get_offset().x + string_width + sep, vofs), numstr, fc, number_width); if (get_step() == 1) { - Ref<Texture> updown = get_icon("updown", "SpinBox"); - int updown_vofs = (get_size().height - updown->get_height()) / 2; - updown_offset = get_size().width - sb->get_margin(MARGIN_RIGHT) - updown->get_width(); + Ref<Texture> updown2 = get_icon("updown", "SpinBox"); + int updown_vofs = (get_size().height - updown2->get_height()) / 2; + updown_offset = get_size().width - sb->get_margin(MARGIN_RIGHT) - updown2->get_width(); Color c(1, 1, 1); if (hover_updown) { c *= Color(1.2, 1.2, 1.2); } - draw_texture(updown, Vector2(updown_offset, updown_vofs), c); + draw_texture(updown2, Vector2(updown_offset, updown_vofs), c); if (grabber->is_visible()) { grabber->hide(); } diff --git a/editor/editor_sub_scene.cpp b/editor/editor_sub_scene.cpp index 6a0a151aa9..e4807a37c6 100644 --- a/editor/editor_sub_scene.cpp +++ b/editor/editor_sub_scene.cpp @@ -187,8 +187,8 @@ void EditorSubScene::move(Node *p_new_parent, Node *p_new_owner) { } p_new_parent->add_child(selnode); - for (List<Node *>::Element *E = to_reown.front(); E; E = E->next()) { - E->get()->set_owner(p_new_owner); + for (List<Node *>::Element *F = to_reown.front(); F; F = F->next()) { + F->get()->set_owner(p_new_owner); } } if (!is_root) { diff --git a/editor/fileserver/editor_file_server.cpp b/editor/fileserver/editor_file_server.cpp index 3b402407df..2bea61fe04 100644 --- a/editor/fileserver/editor_file_server.cpp +++ b/editor/fileserver/editor_file_server.cpp @@ -80,9 +80,9 @@ void EditorFileServer::_subthread_start(void *s) { ERR_FAIL_COND(err != OK); } passutf8.write[passlen] = 0; - String s; - s.parse_utf8(passutf8.ptr()); - if (s != cd->efs->password) { + String s2; + s2.parse_utf8(passutf8.ptr()); + if (s2 != cd->efs->password) { encode_uint32(ERR_INVALID_DATA, buf4); cd->connection->put_data(buf4, 4); OS::get_singleton()->delay_usec(1000000); @@ -146,23 +146,23 @@ void EditorFileServer::_subthread_start(void *s) { ERR_FAIL_COND(err != OK); } fileutf8.write[namelen] = 0; - String s; - s.parse_utf8(fileutf8.ptr()); + String s2; + s2.parse_utf8(fileutf8.ptr()); if (cmd == FileAccessNetwork::COMMAND_FILE_EXISTS) { - print_verbose("FILE EXISTS: " + s); + print_verbose("FILE EXISTS: " + s2); } if (cmd == FileAccessNetwork::COMMAND_GET_MODTIME) { - print_verbose("MOD TIME: " + s); + print_verbose("MOD TIME: " + s2); } if (cmd == FileAccessNetwork::COMMAND_OPEN_FILE) { - print_verbose("OPEN: " + s); + print_verbose("OPEN: " + s2); } - if (!s.begins_with("res://")) { + if (!s2.begins_with("res://")) { _close_client(cd); - ERR_FAIL_COND(!s.begins_with("res://")); + ERR_FAIL_COND(!s2.begins_with("res://")); } ERR_CONTINUE(cd->files.has(id)); @@ -172,7 +172,7 @@ void EditorFileServer::_subthread_start(void *s) { cd->connection->put_data(buf4, 4); encode_uint32(FileAccessNetwork::RESPONSE_FILE_EXISTS, buf4); cd->connection->put_data(buf4, 4); - encode_uint32(FileAccess::exists(s), buf4); + encode_uint32(FileAccess::exists(s2), buf4); cd->connection->put_data(buf4, 4); DEBUG_TIME("open_file_end") break; @@ -184,13 +184,13 @@ void EditorFileServer::_subthread_start(void *s) { cd->connection->put_data(buf4, 4); encode_uint32(FileAccessNetwork::RESPONSE_GET_MODTIME, buf4); cd->connection->put_data(buf4, 4); - encode_uint64(FileAccess::get_modified_time(s), buf4); + encode_uint64(FileAccess::get_modified_time(s2), buf4); cd->connection->put_data(buf4, 8); DEBUG_TIME("open_file_end") break; } - FileAccess *fa = FileAccess::open(s, FileAccess::READ); + FileAccess *fa = FileAccess::open(s2, FileAccess::READ); if (!fa) { //not found, continue encode_uint32(id, buf4); diff --git a/editor/find_in_files.cpp b/editor/find_in_files.cpp index af4ba56aee..4dbba952bf 100644 --- a/editor/find_in_files.cpp +++ b/editor/find_in_files.cpp @@ -766,9 +766,9 @@ void FindInFilesPanel::_on_replace_all_clicked() { if (!item->is_checked(0)) continue; - Map<TreeItem *, Result>::Element *E = _result_items.find(item); - ERR_FAIL_COND(E == NULL); - locations.push_back(E->value()); + Map<TreeItem *, Result>::Element *F = _result_items.find(item); + ERR_FAIL_COND(F == NULL); + locations.push_back(F->value()); } if (locations.size() != 0) { diff --git a/editor/import/editor_import_collada.cpp b/editor/import/editor_import_collada.cpp index dbf63102cf..652f1ebac9 100644 --- a/editor/import/editor_import_collada.cpp +++ b/editor/import/editor_import_collada.cpp @@ -724,13 +724,13 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize, Ref<ArrayMesh> &p_me int _prim_ofs = 0; int vertidx = 0; - for (int p_i = 0; p_i < p.count; p_i++) { + for (int p_j = 0; p_j < p.count; p_j++) { int amount; if (p.polygons.size()) { - ERR_FAIL_INDEX_V(p_i, p.polygons.size(), ERR_INVALID_DATA); - amount = p.polygons[p_i]; + ERR_FAIL_INDEX_V(p_j, p.polygons.size(), ERR_INVALID_DATA); + amount = p.polygons[p_j]; } else { amount = 3; //triangles; } @@ -1100,7 +1100,7 @@ Error ColladaImport::_create_resources(Collada::Node *p_node, bool p_use_compres if (Object::cast_to<MeshInstance>(node)) { - Collada::NodeGeometry *ng = static_cast<Collada::NodeGeometry *>(p_node); + Collada::NodeGeometry *ng2 = static_cast<Collada::NodeGeometry *>(p_node); MeshInstance *mi = Object::cast_to<MeshInstance>(node); @@ -1113,16 +1113,16 @@ Error ColladaImport::_create_resources(Collada::Node *p_node, bool p_use_compres Vector<int> bone_remap; Vector<Ref<ArrayMesh> > morphs; - if (ng->controller) { + if (ng2->controller) { - String ngsource = ng->source; + String ngsource = ng2->source; if (collada.state.skin_controller_data_map.has(ngsource)) { ERR_FAIL_COND_V(!collada.state.skin_controller_data_map.has(ngsource), ERR_INVALID_DATA); skin = &collada.state.skin_controller_data_map[ngsource]; - Vector<String> skeletons = ng->skeletons; + Vector<String> skeletons = ng2->skeletons; ERR_FAIL_COND_V(skeletons.empty(), ERR_INVALID_DATA); @@ -1185,12 +1185,12 @@ Error ColladaImport::_create_resources(Collada::Node *p_node, bool p_use_compres Vector<String> names = morph->sources[target].sarray; for (int i = 0; i < names.size(); i++) { - String meshid = names[i]; - if (collada.state.mesh_data_map.has(meshid)) { + String meshid2 = names[i]; + if (collada.state.mesh_data_map.has(meshid2)) { Ref<ArrayMesh> mesh = Ref<ArrayMesh>(memnew(ArrayMesh)); - const Collada::MeshData &meshdata = collada.state.mesh_data_map[meshid]; + const Collada::MeshData &meshdata = collada.state.mesh_data_map[meshid2]; mesh->set_name(meshdata.name); - Error err = _create_mesh_surfaces(false, mesh, ng->material_map, meshdata, apply_xform, bone_remap, skin, NULL, Vector<Ref<ArrayMesh> >(), false); + Error err = _create_mesh_surfaces(false, mesh, ng2->material_map, meshdata, apply_xform, bone_remap, skin, NULL, Vector<Ref<ArrayMesh> >(), false); ERR_FAIL_COND_V(err, err); morphs.push_back(mesh); @@ -1212,7 +1212,7 @@ Error ColladaImport::_create_resources(Collada::Node *p_node, bool p_use_compres } } else { - meshid = ng->source; + meshid = ng2->source; } Ref<ArrayMesh> mesh; @@ -1226,7 +1226,7 @@ Error ColladaImport::_create_resources(Collada::Node *p_node, bool p_use_compres mesh = Ref<ArrayMesh>(memnew(ArrayMesh)); const Collada::MeshData &meshdata = collada.state.mesh_data_map[meshid]; mesh->set_name(meshdata.name); - Error err = _create_mesh_surfaces(morphs.size() == 0, mesh, ng->material_map, meshdata, apply_xform, bone_remap, skin, morph, morphs, p_use_compression, use_mesh_builtin_materials); + Error err = _create_mesh_surfaces(morphs.size() == 0, mesh, ng2->material_map, meshdata, apply_xform, bone_remap, skin, morph, morphs, p_use_compression, use_mesh_builtin_materials); ERR_FAIL_COND_V(err, err); mesh_cache[meshid] = mesh; @@ -1246,8 +1246,8 @@ Error ColladaImport::_create_resources(Collada::Node *p_node, bool p_use_compres String matname = meshdata.primitives[i].material; - if (ng->material_map.has(matname)) { - String target = ng->material_map[matname].target; + if (ng2->material_map.has(matname)) { + String target = ng2->material_map[matname].target; Ref<Material> material; if (!material_cache.has(target)) { @@ -1296,25 +1296,25 @@ Error ColladaImport::load(const String &p_path, int p_flags, bool p_force_make_t for (int i = 0; i < vs.root_nodes.size(); i++) { - Error err = _create_scene_skeletons(vs.root_nodes[i]); - if (err != OK) { + Error err2 = _create_scene_skeletons(vs.root_nodes[i]); + if (err2 != OK) { memdelete(scene); - ERR_FAIL_COND_V(err, err); + ERR_FAIL_COND_V(err2, err2); } } for (int i = 0; i < vs.root_nodes.size(); i++) { - Error err = _create_scene(vs.root_nodes[i], scene); - if (err != OK) { + Error err2 = _create_scene(vs.root_nodes[i], scene); + if (err2 != OK) { memdelete(scene); - ERR_FAIL_COND_V(err, err); + ERR_FAIL_COND_V(err2, err2); } - Error err2 = _create_resources(vs.root_nodes[i], p_use_compression); - if (err2 != OK) { + Error err3 = _create_resources(vs.root_nodes[i], p_use_compression); + if (err3 != OK) { memdelete(scene); - ERR_FAIL_COND_V(err2, err2); + ERR_FAIL_COND_V(err3, err3); } } @@ -1627,10 +1627,10 @@ void ColladaImport::create_animation(int p_clip, bool p_make_tracks_in_all_bones ERR_CONTINUE(xf.data.size() < 4); xf.data.write[3] = data[0]; } else if (at.component == "X" || at.component == "Y" || at.component == "Z") { - int cn = at.component[0] - 'X'; - ERR_CONTINUE(cn >= xf.data.size()); + int cn2 = at.component[0] - 'X'; + ERR_CONTINUE(cn2 >= xf.data.size()); ERR_CONTINUE(data.size() > 1); - xf.data.write[cn] = data[0]; + xf.data.write[cn2] = data[0]; } else if (data.size() == xf.data.size()) { xf.data = data; } else { @@ -1747,11 +1747,11 @@ void ColladaImport::create_animation(int p_clip, bool p_make_tracks_in_all_bones animation->track_set_path(track, path); animation->track_set_imported(track, true); //helps merging later - for (int i = 0; i < at.keys.size(); i++) { + for (int j = 0; j < at.keys.size(); j++) { - float time = at.keys[i].time; + float time = at.keys[j].time; Variant value; - Vector<float> data = at.keys[i].data; + Vector<float> data = at.keys[j].data; if (data.size() == 1) { //push a float value = data[0]; diff --git a/editor/import/editor_scene_importer_gltf.cpp b/editor/import/editor_scene_importer_gltf.cpp index c29e9281fa..ff2f68ffd3 100644 --- a/editor/import/editor_scene_importer_gltf.cpp +++ b/editor/import/editor_scene_importer_gltf.cpp @@ -244,8 +244,8 @@ Error EditorSceneImporterGLTF::_parse_nodes(GLTFState &state) { if (n.has("children")) { Array children = n["children"]; - for (int i = 0; i < children.size(); i++) { - node->children.push_back(children[i]); + for (int j = 0; j < children.size(); j++) { + node->children.push_back(children[j]); } } @@ -879,7 +879,7 @@ Error EditorSceneImporterGLTF::_parse_meshes(GLTFState &state) { if (p.has("mode")) { int mode = p["mode"]; ERR_FAIL_INDEX_V(mode, 7, ERR_FILE_CORRUPT); - static const Mesh::PrimitiveType primitives[7] = { + static const Mesh::PrimitiveType primitives2[7] = { Mesh::PRIMITIVE_POINTS, Mesh::PRIMITIVE_LINES, Mesh::PRIMITIVE_LINE_LOOP, @@ -889,7 +889,7 @@ Error EditorSceneImporterGLTF::_parse_meshes(GLTFState &state) { Mesh::PRIMITIVE_TRIANGLE_FAN, }; - primitive = primitives[mode]; + primitive = primitives2[mode]; } if (a.has("POSITION")) { @@ -922,17 +922,17 @@ Error EditorSceneImporterGLTF::_parse_meshes(GLTFState &state) { //PoolVector<int> v = array[Mesh::ARRAY_BONES]; //PoolVector<int>::Read r = v.read(); - for (int j = 0; j < wc; j += 4) { + for (int k = 0; k < wc; k += 4) { float total = 0.0; - total += w[j + 0]; - total += w[j + 1]; - total += w[j + 2]; - total += w[j + 3]; + total += w[k + 0]; + total += w[k + 1]; + total += w[k + 2]; + total += w[k + 3]; if (total > 0.0) { - w[j + 0] /= total; - w[j + 1] /= total; - w[j + 2] /= total; - w[j + 3] /= total; + w[k + 0] /= total; + w[k + 1] /= total; + w[k + 2] /= total; + w[k + 3] /= total; } //print_verbose(itos(j / 4) + ": " + itos(r[j + 0]) + ":" + rtos(w[j + 0]) + ", " + itos(r[j + 1]) + ":" + rtos(w[j + 1]) + ", " + itos(r[j + 2]) + ":" + rtos(w[j + 2]) + ", " + itos(r[j + 3]) + ":" + rtos(w[j + 3])); @@ -950,8 +950,8 @@ Error EditorSceneImporterGLTF::_parse_meshes(GLTFState &state) { int is = indices.size(); PoolVector<int>::Write w = indices.write(); - for (int i = 0; i < is; i += 3) { - SWAP(w[i + 1], w[i + 2]); + for (int k = 0; k < is; k += 3) { + SWAP(w[k + 1], w[k + 2]); } } array[Mesh::ARRAY_INDEX] = indices; @@ -964,10 +964,10 @@ Error EditorSceneImporterGLTF::_parse_meshes(GLTFState &state) { indices.resize(vs); { PoolVector<int>::Write w = indices.write(); - for (int i = 0; i < vs; i += 3) { - w[i] = i; - w[i + 1] = i + 2; - w[i + 2] = i + 1; + for (int k = 0; k < vs; k += 3) { + w[k] = k; + w[k + 1] = k + 2; + w[k + 2] = k + 1; } } array[Mesh::ARRAY_INDEX] = indices; diff --git a/editor/import/resource_importer_layered_texture.cpp b/editor/import/resource_importer_layered_texture.cpp index f43df02916..e38265b619 100644 --- a/editor/import/resource_importer_layered_texture.cpp +++ b/editor/import/resource_importer_layered_texture.cpp @@ -132,9 +132,9 @@ void ResourceImporterLayeredTexture::_save_tex(const Vector<Ref<Image> > &p_imag int mmc = image->get_mipmap_count() + 1; f->store_32(mmc); - for (int i = 0; i < mmc; i++) { + for (int j = 0; j < mmc; j++) { - if (i > 0) { + if (j > 0) { image->shrink_x2(); } diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp index 2616ba6e87..ad436b2797 100644 --- a/editor/import/resource_importer_scene.cpp +++ b/editor/import/resource_importer_scene.cpp @@ -1314,9 +1314,9 @@ Error ResourceImporterScene::import(const String &p_source_file, const String &p if (bool(p_options["external_files/store_in_subdir"])) { String subdir_name = p_source_file.get_file().get_basename(); DirAccess *da = DirAccess::open(base_path); - Error err = da->make_dir(subdir_name); + Error err2 = da->make_dir(subdir_name); memdelete(da); - ERR_FAIL_COND_V(err != OK && err != ERR_ALREADY_EXISTS, err); + ERR_FAIL_COND_V(err2 != OK && err2 != ERR_ALREADY_EXISTS, err2); base_path = base_path.plus_file(subdir_name); } } @@ -1331,7 +1331,7 @@ Error ResourceImporterScene::import(const String &p_source_file, const String &p float texel_size = p_options["meshes/lightmap_texel_size"]; texel_size = MAX(0.001, texel_size); - EditorProgress progress("gen_lightmaps", TTR("Generating Lightmaps"), meshes.size()); + EditorProgress progress2("gen_lightmaps", TTR("Generating Lightmaps"), meshes.size()); int step = 0; for (Map<Ref<ArrayMesh>, Transform>::Element *E = meshes.front(); E; E = E->next()) { @@ -1341,10 +1341,10 @@ Error ResourceImporterScene::import(const String &p_source_file, const String &p name = "Mesh " + itos(step); } - progress.step(TTR("Generating for Mesh: ") + name + " (" + itos(step) + "/" + itos(meshes.size()) + ")", step); + progress2.step(TTR("Generating for Mesh: ") + name + " (" + itos(step) + "/" + itos(meshes.size()) + ")", step); - Error err = mesh->lightmap_unwrap(E->get(), texel_size); - if (err != OK) { + Error err2 = mesh->lightmap_unwrap(E->get(), texel_size); + if (err2 != OK) { EditorNode::add_io_error("Mesh '" + name + "' failed lightmap generation. Please fix geometry."); } step++; diff --git a/editor/plugins/abstract_polygon_2d_editor.cpp b/editor/plugins/abstract_polygon_2d_editor.cpp index 5a62f0da4e..28f786e99a 100644 --- a/editor/plugins/abstract_polygon_2d_editor.cpp +++ b/editor/plugins/abstract_polygon_2d_editor.cpp @@ -347,16 +347,16 @@ bool AbstractPolygon2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) return true; } else { - Vector<Vector2> vertices = _get_polygon(insert.polygon); - pre_move_edit = vertices; + Vector<Vector2> vertices2 = _get_polygon(insert.polygon); + pre_move_edit = vertices2; printf("setting pre_move_edit\n"); edited_point = PosVertex(insert.polygon, insert.vertex + 1, xform.affine_inverse().xform(insert.pos)); - vertices.insert(edited_point.vertex, edited_point.pos); + vertices2.insert(edited_point.vertex, edited_point.pos); selected_point = edited_point; edge_point = PosVertex(); undo_redo->create_action(TTR("Insert Point")); - _action_set_polygon(insert.polygon, vertices); + _action_set_polygon(insert.polygon, vertices2); _commit_action(); return true; } diff --git a/editor/plugins/animation_blend_tree_editor_plugin.cpp b/editor/plugins/animation_blend_tree_editor_plugin.cpp index 13c80e5394..e615856195 100644 --- a/editor/plugins/animation_blend_tree_editor_plugin.cpp +++ b/editor/plugins/animation_blend_tree_editor_plugin.cpp @@ -785,8 +785,8 @@ void AnimationNodeBlendTreeEditor::_node_renamed(const String &p_text, Ref<Anima for (int i = 0; i < visible_properties.size(); i++) { String pname = visible_properties[i]->get_edited_property().operator String(); if (pname.begins_with(base_path + prev_name)) { - String new_name = pname.replace_first(base_path + prev_name, base_path + name); - visible_properties[i]->set_object_and_property(visible_properties[i]->get_edited_object(), new_name); + String new_name2 = pname.replace_first(base_path + prev_name, base_path + name); + visible_properties[i]->set_object_and_property(visible_properties[i]->get_edited_object(), new_name2); } } diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp index b32b537d3d..bbaf41e3cc 100644 --- a/editor/plugins/animation_player_editor_plugin.cpp +++ b/editor/plugins/animation_player_editor_plugin.cpp @@ -1160,22 +1160,22 @@ void AnimationPlayerEditor::_animation_tool_menu(int p_option) { return; } - String current = animation->get_item_text(animation->get_selected()); - Ref<Animation> anim = player->get_animation(current); - //editor->edit_resource(anim); - EditorSettings::get_singleton()->set_resource_clipboard(anim); + String current2 = animation->get_item_text(animation->get_selected()); + Ref<Animation> anim2 = player->get_animation(current2); + //editor->edit_resource(anim2); + EditorSettings::get_singleton()->set_resource_clipboard(anim2); } break; case TOOL_PASTE_ANIM: { - Ref<Animation> anim = EditorSettings::get_singleton()->get_resource_clipboard(); - if (!anim.is_valid()) { + Ref<Animation> anim2 = EditorSettings::get_singleton()->get_resource_clipboard(); + if (!anim2.is_valid()) { error_dialog->set_text(TTR("No animation resource on clipboard!")); error_dialog->popup_centered_minsize(); return; } - String name = anim->get_name(); + String name = anim2->get_name(); if (name == "") { name = TTR("Pasted Animation"); } @@ -1189,7 +1189,7 @@ void AnimationPlayerEditor::_animation_tool_menu(int p_option) { } undo_redo->create_action(TTR("Paste Animation")); - undo_redo->add_do_method(player, "add_animation", name, anim); + undo_redo->add_do_method(player, "add_animation", name, anim2); undo_redo->add_undo_method(player, "remove_animation", name); undo_redo->add_do_method(this, "_animation_player_changed", player); undo_redo->add_undo_method(this, "_animation_player_changed", player); @@ -1206,9 +1206,9 @@ void AnimationPlayerEditor::_animation_tool_menu(int p_option) { return; } - String current = animation->get_item_text(animation->get_selected()); - Ref<Animation> anim = player->get_animation(current); - editor->edit_resource(anim); + String current2 = animation->get_item_text(animation->get_selected()); + Ref<Animation> anim2 = player->get_animation(current2); + editor->edit_resource(anim2); } break; } diff --git a/editor/plugins/animation_state_machine_editor.cpp b/editor/plugins/animation_state_machine_editor.cpp index 197ee77254..e73c4ebd8a 100644 --- a/editor/plugins/animation_state_machine_editor.cpp +++ b/editor/plugins/animation_state_machine_editor.cpp @@ -714,12 +714,12 @@ void AnimationNodeStateMachineEditor::_state_machine_draw() { tl.to += offset; } - for (int i = 0; i < node_rects.size(); i++) { - if (node_rects[i].node_name == tl.from_node) { - _clip_src_line_to_rect(tl.from, tl.to, node_rects[i].node); + for (int j = 0; j < node_rects.size(); j++) { + if (node_rects[j].node_name == tl.from_node) { + _clip_src_line_to_rect(tl.from, tl.to, node_rects[j].node); } - if (node_rects[i].node_name == tl.to_node) { - _clip_dst_line_to_rect(tl.from, tl.to, node_rects[i].node); + if (node_rects[j].node_name == tl.to_node) { + _clip_dst_line_to_rect(tl.from, tl.to, node_rects[j].node); } } diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index b5d59dae99..ac05b03ed2 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -398,10 +398,10 @@ Rect2 CanvasItemEditor::_get_encompassing_rect_from_list(List<CanvasItem *> p_li // Expand with the other ones for (List<CanvasItem *>::Element *E = p_list.front(); E; E = E->next()) { - CanvasItem *canvas_item = E->get(); - Transform2D xform = canvas_item->get_global_transform_with_canvas(); + CanvasItem *canvas_item2 = E->get(); + Transform2D xform = canvas_item2->get_global_transform_with_canvas(); - Rect2 current_rect = canvas_item->_edit_get_rect(); + Rect2 current_rect = canvas_item2->_edit_get_rect(); rect.expand_to(xform.xform(current_rect.position)); rect.expand_to(xform.xform(current_rect.position + Vector2(current_rect.size.x, 0))); rect.expand_to(xform.xform(current_rect.position + current_rect.size)); @@ -816,10 +816,10 @@ void CanvasItemEditor::_commit_canvas_item_state(List<CanvasItem *> p_canvas_ite undo_redo->add_do_method(canvas_item, "_edit_set_state", canvas_item->_edit_get_state()); undo_redo->add_undo_method(canvas_item, "_edit_set_state", se->undo_state); if (commit_bones) { - for (List<Dictionary>::Element *E = se->pre_drag_bones_undo_state.front(); E; E = E->next()) { + for (List<Dictionary>::Element *F = se->pre_drag_bones_undo_state.front(); F; F = F->next()) { canvas_item = Object::cast_to<CanvasItem>(canvas_item->get_parent()); undo_redo->add_do_method(canvas_item, "_edit_set_state", canvas_item->_edit_get_state()); - undo_redo->add_undo_method(canvas_item, "_edit_set_state", E->get()); + undo_redo->add_undo_method(canvas_item, "_edit_set_state", F->get()); } } } @@ -1921,9 +1921,9 @@ bool CanvasItemEditor::_gui_input_move(const Ref<InputEvent> &p_event) { if (drag_selection.size() == 1) { Node2D *node_2d = Object::cast_to<Node2D>(drag_selection[0]); if (node_2d && move_local_base_rotated) { - Transform2D m; - m.rotate(node_2d->get_rotation()); - new_pos += m.xform(drag_to); + Transform2D m2; + m2.rotate(node_2d->get_rotation()); + new_pos += m2.xform(drag_to); } else if (move_local_base) { new_pos += drag_to; } else { @@ -2065,18 +2065,18 @@ bool CanvasItemEditor::_gui_input_select(const Ref<InputEvent> &p_event) { // Start dragging if (still_selected) { // Drag the node(s) if requested - List<CanvasItem *> selection = _get_edited_canvas_items(); + List<CanvasItem *> selection2 = _get_edited_canvas_items(); // Remove not movable nodes - for (int i = 0; i < selection.size(); i++) { - if (!_is_node_movable(selection[i], true)) { - selection.erase(selection[i]); + for (int i = 0; i < selection2.size(); i++) { + if (!_is_node_movable(selection2[i], true)) { + selection2.erase(selection2[i]); } } - if (selection.size() > 0) { + if (selection2.size() > 0) { drag_type = DRAG_MOVE; - drag_selection = selection; + drag_selection = selection2; drag_from = click; _save_canvas_item_state(drag_selection); } diff --git a/editor/plugins/mesh_instance_editor_plugin.cpp b/editor/plugins/mesh_instance_editor_plugin.cpp index 40ec03bc96..3e10cdbbfa 100644 --- a/editor/plugins/mesh_instance_editor_plugin.cpp +++ b/editor/plugins/mesh_instance_editor_plugin.cpp @@ -198,14 +198,14 @@ void MeshInstanceEditor::_menu_option(int p_option) { } break; case MENU_OPTION_CREATE_UV2: { - Ref<ArrayMesh> mesh = node->get_mesh(); - if (!mesh.is_valid()) { + Ref<ArrayMesh> mesh2 = node->get_mesh(); + if (!mesh2.is_valid()) { err_dialog->set_text(TTR("Contained Mesh is not of type ArrayMesh.")); err_dialog->popup_centered_minsize(); return; } - Error err = mesh->lightmap_unwrap(node->get_global_transform()); + Error err = mesh2->lightmap_unwrap(node->get_global_transform()); if (err != OK) { err_dialog->set_text(TTR("UV Unwrap failed, mesh may not be manifold?")); err_dialog->popup_centered_minsize(); @@ -214,8 +214,8 @@ void MeshInstanceEditor::_menu_option(int p_option) { } break; case MENU_OPTION_DEBUG_UV1: { - Ref<Mesh> mesh = node->get_mesh(); - if (!mesh.is_valid()) { + Ref<Mesh> mesh2 = node->get_mesh(); + if (!mesh2.is_valid()) { err_dialog->set_text(TTR("No mesh to debug.")); err_dialog->popup_centered_minsize(); return; @@ -223,8 +223,8 @@ void MeshInstanceEditor::_menu_option(int p_option) { _create_uv_lines(0); } break; case MENU_OPTION_DEBUG_UV2: { - Ref<Mesh> mesh = node->get_mesh(); - if (!mesh.is_valid()) { + Ref<Mesh> mesh2 = node->get_mesh(); + if (!mesh2.is_valid()) { err_dialog->set_text(TTR("No mesh to debug.")); err_dialog->popup_centered_minsize(); return; diff --git a/editor/plugins/path_2d_editor_plugin.cpp b/editor/plugins/path_2d_editor_plugin.cpp index 354475d268..a10eddb131 100644 --- a/editor/plugins/path_2d_editor_plugin.cpp +++ b/editor/plugins/path_2d_editor_plugin.cpp @@ -180,11 +180,11 @@ bool Path2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) { // Check for segment split. if (mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT && mode == MODE_EDIT && on_edge == true) { - Vector2 gpoint = mb->get_position(); + Vector2 gpoint2 = mb->get_position(); Ref<Curve2D> curve = node->get_curve(); int insertion_point = -1; - float mbLength = curve->get_closest_offset(xform.affine_inverse().xform(gpoint)); + float mbLength = curve->get_closest_offset(xform.affine_inverse().xform(gpoint2)); int len = curve->get_point_count(); for (int i = 0; i < len - 1; i++) { float compareLength = curve->get_closest_offset(curve->get_point_position(i + 1)); @@ -195,7 +195,7 @@ bool Path2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) { insertion_point = curve->get_point_count() - 2; undo_redo->create_action(TTR("Split Curve")); - undo_redo->add_do_method(curve.ptr(), "add_point", xform.affine_inverse().xform(gpoint), Vector2(0, 0), Vector2(0, 0), insertion_point + 1); + undo_redo->add_do_method(curve.ptr(), "add_point", xform.affine_inverse().xform(gpoint2), Vector2(0, 0), Vector2(0, 0), insertion_point + 1); undo_redo->add_undo_method(curve.ptr(), "remove_point", insertion_point + 1); undo_redo->add_do_method(canvas_item_editor, "update_viewport"); undo_redo->add_undo_method(canvas_item_editor, "update_viewport"); @@ -204,7 +204,7 @@ bool Path2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) { action = ACTION_MOVING_POINT; action_point = insertion_point + 1; moving_from = curve->get_point_position(action_point); - moving_screen_from = gpoint; + moving_screen_from = gpoint2; canvas_item_editor->update_viewport(); diff --git a/editor/plugins/polygon_2d_editor_plugin.cpp b/editor/plugins/polygon_2d_editor_plugin.cpp index 33157bc88f..0dbbaf4177 100644 --- a/editor/plugins/polygon_2d_editor_plugin.cpp +++ b/editor/plugins/polygon_2d_editor_plugin.cpp @@ -1092,10 +1092,10 @@ void Polygon2DEditor::_uv_draw() { PoolVector<int> points = polygons[i]; Vector<Vector2> polypoints; - for (int i = 0; i < points.size(); i++) { - int next = (i + 1) % points.size(); + for (int j = 0; j < points.size(); j++) { + int next = (j + 1) % points.size(); - int idx = points[i]; + int idx = points[j]; int idx_next = points[next]; if (idx < 0 || idx >= uvs.size()) continue; diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index 4d1e0c08ce..f578d5037d 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -4695,10 +4695,10 @@ void SpatialEditor::_init_indicators() { plane_mat->set_on_top_of_alpha(); plane_mat->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true); plane_mat->set_cull_mode(SpatialMaterial::CULL_DISABLED); - Color col; - col[i] = 1.0; - col.a = gizmo_alph; - plane_mat->set_albedo(col); + Color col2; + col2[i] = 1.0; + col2.a = gizmo_alph; + plane_mat->set_albedo(col2); plane_gizmo_color[i] = plane_mat; // needed, so we can draw planes from both sides surftool->set_material(plane_mat); surftool->commit(move_plane_gizmo[i]); @@ -4824,10 +4824,10 @@ void SpatialEditor::_init_indicators() { plane_mat->set_on_top_of_alpha(); plane_mat->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true); plane_mat->set_cull_mode(SpatialMaterial::CULL_DISABLED); - Color col; - col[i] = 1.0; - col.a = gizmo_alph; - plane_mat->set_albedo(col); + Color col2; + col2[i] = 1.0; + col2.a = gizmo_alph; + plane_mat->set_albedo(col2); plane_gizmo_color[i] = plane_mat; // needed, so we can draw planes from both sides surftool->set_material(plane_mat); surftool->commit(scale_plane_gizmo[i]); 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(); } diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp index 615b1abb75..36fe1af33f 100644 --- a/editor/plugins/tile_set_editor_plugin.cpp +++ b/editor/plugins/tile_set_editor_plugin.cpp @@ -2573,20 +2573,20 @@ bool TilesetEditorContext::_set(const StringName &p_name, const Variant &p_value tileset_editor->_set_snap_sep(snap); return true; } else if (p_name.operator String().left(5) == "tile_") { - String name = p_name.operator String().right(5); + String name2 = p_name.operator String().right(5); bool v = false; if (tileset_editor->get_current_tile() < 0 || tileset.is_null()) return false; - if (name == "autotile_bitmask_mode") { + if (name2 == "autotile_bitmask_mode") { tileset->set(String::num(tileset_editor->get_current_tile(), 0) + "/autotile/bitmask_mode", p_value, &v); - } else if (name == "subtile_size") { + } else if (name2 == "subtile_size") { tileset->set(String::num(tileset_editor->get_current_tile(), 0) + "/autotile/tile_size", p_value, &v); - } else if (name == "subtile_spacing") { + } else if (name2 == "subtile_spacing") { tileset->set(String::num(tileset_editor->get_current_tile(), 0) + "/autotile/spacing", p_value, &v); } else { - tileset->set(String::num(tileset_editor->get_current_tile(), 0) + "/" + name, p_value, &v); + tileset->set(String::num(tileset_editor->get_current_tile(), 0) + "/" + name2, p_value, &v); } if (v) { tileset->_change_notify(""); diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index 628c2f714c..734cd505d2 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -1116,8 +1116,8 @@ void EditorPropertyShaderMode::_option_selected(int p_which) { VisualShader::Type type = VisualShader::Type(i); Vector<int> nodes = visual_shader->get_node_list(type); - for (int i = 0; i < nodes.size(); i++) { - Ref<VisualShaderNodeInput> input = visual_shader->get_node(type, nodes[i]); + for (int j = 0; j < nodes.size(); j++) { + Ref<VisualShaderNodeInput> input = visual_shader->get_node(type, nodes[j]); if (!input.is_valid()) { continue; } diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index 0a24f325fd..a3bcfa6e70 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -434,22 +434,22 @@ private: if (mode == MODE_RENAME) { - String dir = _test_path(); - if (dir == "") { + String dir2 = _test_path(); + if (dir2 == "") { set_message(TTR("Invalid project path (changed anything?)."), MESSAGE_ERROR); return; } ProjectSettings *current = memnew(ProjectSettings); - int err = current->setup(dir, ""); + int err = current->setup(dir2, ""); if (err != OK) { set_message(vformat(TTR("Couldn't load project.godot in project path (error %d). It may be missing or corrupted."), err), MESSAGE_ERROR); } else { ProjectSettings::CustomMap edited_settings; edited_settings["application/config/name"] = project_name->get_text(); - if (current->save_custom(dir.plus_file("project.godot"), edited_settings, Vector<String>(), true) != OK) { + if (current->save_custom(dir2.plus_file("project.godot"), edited_settings, Vector<String>(), true) != OK) { set_message(TTR("Couldn't edit project.godot in project path."), MESSAGE_ERROR); } } diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp index cc33550ac9..1c6359a46b 100644 --- a/editor/project_settings_editor.cpp +++ b/editor/project_settings_editor.cpp @@ -712,7 +712,7 @@ void ProjectSettingsEditor::_update_actions() { if (event.is_null()) continue; - TreeItem *action = input_editor->create_item(item); + TreeItem *action2 = input_editor->create_item(item); Ref<InputEventKey> k = event; if (k.is_valid()) { @@ -727,8 +727,8 @@ void ProjectSettingsEditor::_update_actions() { if (k->get_control()) str = TTR("Control+") + str; - action->set_text(0, str); - action->set_icon(0, get_icon("Keyboard", "EditorIcons")); + action2->set_text(0, str); + action2->set_icon(0, get_icon("Keyboard", "EditorIcons")); } Ref<InputEventJoypadButton> jb = event; @@ -741,8 +741,8 @@ void ProjectSettingsEditor::_update_actions() { else str += "."; - action->set_text(0, str); - action->set_icon(0, get_icon("JoyButton", "EditorIcons")); + action2->set_text(0, str); + action2->set_icon(0, get_icon("JoyButton", "EditorIcons")); } Ref<InputEventMouseButton> mb = event; @@ -758,8 +758,8 @@ void ProjectSettingsEditor::_update_actions() { default: str += TTR("Button") + " " + itos(mb->get_button_index()) + "."; } - action->set_text(0, str); - action->set_icon(0, get_icon("Mouse", "EditorIcons")); + action2->set_text(0, str); + action2->set_icon(0, get_icon("Mouse", "EditorIcons")); } Ref<InputEventJoypadMotion> jm = event; @@ -770,14 +770,14 @@ void ProjectSettingsEditor::_update_actions() { int n = 2 * ax + (jm->get_axis_value() < 0 ? 0 : 1); String desc = _axis_names[n]; String str = _get_device_string(jm->get_device()) + ", " + TTR("Axis") + " " + itos(ax) + " " + (jm->get_axis_value() < 0 ? "-" : "+") + desc + "."; - action->set_text(0, str); - action->set_icon(0, get_icon("JoyAxis", "EditorIcons")); + action2->set_text(0, str); + action2->set_icon(0, get_icon("JoyAxis", "EditorIcons")); } - action->set_metadata(0, i); - action->set_meta("__input", event); + action2->set_metadata(0, i); + action2->set_meta("__input", event); - action->add_button(2, get_icon("Edit", "EditorIcons"), 3, false, TTR("Edit")); - action->add_button(2, get_icon("Remove", "EditorIcons"), 2, false, TTR("Remove")); + action2->add_button(2, get_icon("Edit", "EditorIcons"), 3, false, TTR("Edit")); + action2->add_button(2, get_icon("Remove", "EditorIcons"), 2, false, TTR("Remove")); } } @@ -1034,8 +1034,8 @@ void ProjectSettingsEditor::_copy_to_platform_about_to_show() { String custom = EditorExport::get_singleton()->get_export_preset(i)->get_custom_features(); Vector<String> custom_list = custom.split(","); - for (int i = 0; i < custom_list.size(); i++) { - String f = custom_list[i].strip_edges(); + for (int j = 0; j < custom_list.size(); j++) { + String f = custom_list[j].strip_edges(); if (f != String()) { presets.insert(f); } @@ -1543,10 +1543,10 @@ void ProjectSettingsEditor::_update_translations() { PoolStringArray selected = remaps[keys[i]]; for (int j = 0; j < selected.size(); j++) { - String s = selected[j]; - int qp = s.find_last(":"); - String path = s.substr(0, qp); - String locale = s.substr(qp + 1, s.length()); + String s2 = selected[j]; + int qp = s2.find_last(":"); + String path = s2.substr(0, qp); + String locale = s2.substr(qp + 1, s2.length()); TreeItem *t2 = translation_remap_options->create_item(root2); t2->set_editable(0, false); diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp index 46e2bb18fe..c45a97800c 100644 --- a/editor/property_editor.cpp +++ b/editor/property_editor.cpp @@ -905,8 +905,8 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant:: List<StringName> inheritors; ClassDB::get_inheriters_from_class(base.strip_edges(), &inheritors); - for (int i = 0; i < custom_resources.size(); i++) { - inheritors.push_back(custom_resources[i].name); + for (int j = 0; j < custom_resources.size(); j++) { + inheritors.push_back(custom_resources[j].name); } List<StringName>::Element *E = inheritors.front(); @@ -915,17 +915,17 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant:: E = E->next(); } - for (Set<String>::Element *E = valid_inheritors.front(); E; E = E->next()) { - String t = E->get(); + for (Set<String>::Element *j = valid_inheritors.front(); j; j = j->next()) { + String t = j->get(); bool is_custom_resource = false; Ref<Texture> icon; if (!custom_resources.empty()) { - for (int i = 0; i < custom_resources.size(); i++) { - if (custom_resources[i].name == t) { + for (int k = 0; k < custom_resources.size(); k++) { + if (custom_resources[k].name == t) { is_custom_resource = true; - if (custom_resources[i].icon.is_valid()) - icon = custom_resources[i].icon; + if (custom_resources[k].icon.is_valid()) + icon = custom_resources[k].icon; break; } } diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index 738d747956..c470ee1481 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -1152,17 +1152,17 @@ void SceneTreeDock::perform_node_renames(Node *p_base, List<Pair<NodePath, NodeP if (p.get_type() == Variant::NODE_PATH) { // Goes through all paths to check if its matching - for (List<Pair<NodePath, NodePath> >::Element *E = p_renames->front(); E; E = E->next()) { + for (List<Pair<NodePath, NodePath> >::Element *F = p_renames->front(); F; F = F->next()) { NodePath root_path = p_base->get_path(); - NodePath rel_path_old = root_path.rel_path_to(E->get().first); + NodePath rel_path_old = root_path.rel_path_to(F->get().first); - NodePath rel_path_new = E->get().second; + NodePath rel_path_new = F->get().second; // if not empty, get new relative path - if (E->get().second != NodePath()) { - rel_path_new = root_path.rel_path_to(E->get().second); + if (F->get().second != NodePath()) { + rel_path_new = root_path.rel_path_to(F->get().second); } // if old path detected, then it needs to be replaced with the new one @@ -1233,11 +1233,11 @@ void SceneTreeDock::perform_node_renames(Node *p_base, List<Pair<NodePath, NodeP if (!ran.has(i)) continue; //channel was removed - for (List<Pair<NodePath, NodePath> >::Element *E = p_renames->front(); E; E = E->next()) { + for (List<Pair<NodePath, NodePath> >::Element *F = p_renames->front(); F; F = F->next()) { - if (E->get().first == old_np) { + if (F->get().first == old_np) { - if (E->get().second == NodePath()) { + if (F->get().second == NodePath()) { //will be erased int idx = 0; @@ -1262,7 +1262,7 @@ void SceneTreeDock::perform_node_renames(Node *p_base, List<Pair<NodePath, NodeP } else { //will be renamed - NodePath rel_path = new_root_path.rel_path_to(E->get().second); + NodePath rel_path = new_root_path.rel_path_to(F->get().second); NodePath new_path = NodePath(rel_path.get_names(), track_np.get_subnames(), false); if (new_path == track_np) @@ -1602,9 +1602,9 @@ void SceneTreeDock::_delete_confirm() { List<Node *> owned; n->get_owned_by(n->get_owner(), &owned); Array owners; - for (List<Node *>::Element *E = owned.front(); E; E = E->next()) { + for (List<Node *>::Element *F = owned.front(); F; F = F->next()) { - owners.push_back(E->get()); + owners.push_back(F->get()); } editor_data->get_undo_redo().add_do_method(n->get_parent(), "remove_child", n); diff --git a/editor/script_create_dialog.cpp b/editor/script_create_dialog.cpp index 6a3ed1c5e0..5ab0efaee3 100644 --- a/editor/script_create_dialog.cpp +++ b/editor/script_create_dialog.cpp @@ -255,8 +255,8 @@ void ScriptCreateDialog::_lang_changed(int l) { // change extension by selected language List<String> extensions; // get all possible extensions for script - for (int l = 0; l < language_menu->get_item_count(); l++) { - ScriptServer::get_language(l)->get_recognized_extensions(&extensions); + for (int m = 0; m < language_menu->get_item_count(); m++) { + ScriptServer::get_language(m)->get_recognized_extensions(&extensions); } for (List<String>::Element *E = extensions.front(); E; E = E->next()) { diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp index 5f6459045a..303d10d768 100644 --- a/editor/script_editor_debugger.cpp +++ b/editor/script_editor_debugger.cpp @@ -777,7 +777,7 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da for (int i = 0; i < scc; i += 3) { String script = p_data[2 + i]; - String method = p_data[3 + i]; + String method2 = p_data[3 + i]; int line = p_data[4 + i]; TreeItem *stack_trace = error_tree->create_item(error); @@ -791,7 +791,7 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da stack_trace->set_text_align(0, TreeItem::ALIGN_LEFT); error->set_metadata(0, meta); } - stack_trace->set_text(1, script.get_file() + ":" + itos(line) + " @ " + method + "()"); + stack_trace->set_text(1, script.get_file() + ":" + itos(line) + " @ " + method2 + "()"); } if (warning) @@ -859,18 +859,18 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da c.items.resize(values.size() / 2); c.total_time = 0; c.signature = "categ::" + name; - for (int i = 0; i < values.size(); i += 2) { + for (int j = 0; j < values.size(); j += 2) { EditorProfiler::Metric::Category::Item item; item.calls = 1; item.line = 0; - item.name = values[i]; - item.self = values[i + 1]; + item.name = values[j]; + item.self = values[j + 1]; item.total = item.self; item.signature = "categ::" + name + "::" + item.name; item.name = item.name.capitalize(); c.total_time += item.total; - c.items.write[i / 2] = item; + c.items.write[j / 2] = item; } metric.categories.push_back(c); } @@ -1002,13 +1002,13 @@ void ScriptEditorDebugger::_performance_draw() { float m = perf_max[pi]; if (m == 0) m = 0.00001; - float h = E->get()[pi] / m; - h = (1.0 - h) * r.size.y; + float h2 = E->get()[pi] / m; + h2 = (1.0 - h2) * r.size.y; c.a = 0.7; if (E != perf_history.front()) - perf_draw->draw_line(r.position + Point2(from, h), r.position + Point2(from + spacing, prev), c, 2.0); - prev = h; + perf_draw->draw_line(r.position + Point2(from, h2), r.position + Point2(from + spacing, prev), c, 2.0); + prev = h2; E = E->next(); from -= spacing; } @@ -1536,14 +1536,14 @@ void ScriptEditorDebugger::_property_changed(Object *p_base, const StringName &p int pathid = _get_res_path_cache(respath); if (p_value.is_ref()) { - Ref<Resource> res = p_value; - if (res.is_valid() && res->get_path() != String()) { + Ref<Resource> res2 = p_value; + if (res2.is_valid() && res2->get_path() != String()) { Array msg; msg.push_back("live_res_prop_res"); msg.push_back(pathid); msg.push_back(p_property); - msg.push_back(res->get_path()); + msg.push_back(res2->get_path()); ppeer->put_var(msg); } } else { diff --git a/editor/spatial_editor_gizmos.cpp b/editor/spatial_editor_gizmos.cpp index 419b5b4db1..7a4b7d091f 100644 --- a/editor/spatial_editor_gizmos.cpp +++ b/editor/spatial_editor_gizmos.cpp @@ -1235,8 +1235,8 @@ void CameraSpatialGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_idx Vector3 s[2] = { gi.xform(ray_from), gi.xform(ray_from + ray_dir * 4096) }; if (camera->get_projection() == Camera::PROJECTION_PERSPECTIVE) { - Transform gt = camera->get_global_transform(); - float a = _find_closest_angle_to_half_pi_arc(s[0], s[1], 1.0, gt); + Transform gt2 = camera->get_global_transform(); + float a = _find_closest_angle_to_half_pi_arc(s[0], s[1], 1.0, gt2); camera->set("fov", a * 2.0); } else { @@ -3019,20 +3019,20 @@ Variant CollisionShapeSpatialGizmoPlugin::get_handle_value(EditorSpatialGizmo *p if (Object::cast_to<CapsuleShape>(*s)) { - Ref<CapsuleShape> cs = s; - return p_idx == 0 ? cs->get_radius() : cs->get_height(); + Ref<CapsuleShape> cs2 = s; + return p_idx == 0 ? cs2->get_radius() : cs2->get_height(); } if (Object::cast_to<CylinderShape>(*s)) { - Ref<CylinderShape> cs = s; - return p_idx == 0 ? cs->get_radius() : cs->get_height(); + Ref<CylinderShape> cs2 = s; + return p_idx == 0 ? cs2->get_radius() : cs2->get_height(); } if (Object::cast_to<RayShape>(*s)) { - Ref<RayShape> cs = s; - return cs->get_length(); + Ref<RayShape> cs2 = s; + return cs2->get_length(); } return Variant(); @@ -3098,26 +3098,26 @@ void CollisionShapeSpatialGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, i Vector3 axis; axis[p_idx == 0 ? 0 : 2] = 1.0; - Ref<CapsuleShape> cs = s; + Ref<CapsuleShape> cs2 = s; Vector3 ra, rb; Geometry::get_closest_points_between_segments(Vector3(), axis * 4096, sg[0], sg[1], ra, rb); float d = axis.dot(ra); if (p_idx == 1) - d -= cs->get_radius(); + d -= cs2->get_radius(); if (d < 0.001) d = 0.001; if (p_idx == 0) - cs->set_radius(d); + cs2->set_radius(d); else if (p_idx == 1) - cs->set_height(d * 2.0); + cs2->set_height(d * 2.0); } if (Object::cast_to<CylinderShape>(*s)) { Vector3 axis; axis[p_idx == 0 ? 0 : 1] = 1.0; - Ref<CylinderShape> cs = s; + Ref<CylinderShape> cs2 = s; Vector3 ra, rb; Geometry::get_closest_points_between_segments(Vector3(), axis * 4096, sg[0], sg[1], ra, rb); float d = axis.dot(ra); @@ -3126,9 +3126,9 @@ void CollisionShapeSpatialGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, i d = 0.001; if (p_idx == 0) - cs->set_radius(d); + cs2->set_radius(d); else if (p_idx == 1) - cs->set_height(d * 2.0); + cs2->set_height(d * 2.0); } } void CollisionShapeSpatialGizmoPlugin::commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) { @@ -3328,9 +3328,9 @@ void CollisionShapeSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { if (Object::cast_to<CapsuleShape>(*s)) { - Ref<CapsuleShape> cs = s; - float radius = cs->get_radius(); - float height = cs->get_height(); + Ref<CapsuleShape> cs2 = s; + float radius = cs2->get_radius(); + float height = cs2->get_height(); Vector<Vector3> points; @@ -3396,16 +3396,16 @@ void CollisionShapeSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { p_gizmo->add_collision_segments(collision_segments); Vector<Vector3> handles; - handles.push_back(Vector3(cs->get_radius(), 0, 0)); - handles.push_back(Vector3(0, 0, cs->get_height() * 0.5 + cs->get_radius())); + handles.push_back(Vector3(cs2->get_radius(), 0, 0)); + handles.push_back(Vector3(0, 0, cs2->get_height() * 0.5 + cs2->get_radius())); p_gizmo->add_handles(handles, handles_material); } if (Object::cast_to<CylinderShape>(*s)) { - Ref<CylinderShape> cs = s; - float radius = cs->get_radius(); - float height = cs->get_height(); + Ref<CylinderShape> cs2 = s; + float radius = cs2->get_radius(); + float height = cs2->get_height(); Vector<Vector3> points; @@ -3457,8 +3457,8 @@ void CollisionShapeSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { p_gizmo->add_collision_segments(collision_segments); Vector<Vector3> handles; - handles.push_back(Vector3(cs->get_radius(), 0, 0)); - handles.push_back(Vector3(0, cs->get_height() * 0.5, 0)); + handles.push_back(Vector3(cs2->get_radius(), 0, 0)); + handles.push_back(Vector3(0, cs2->get_height() * 0.5, 0)); p_gizmo->add_handles(handles, handles_material); } @@ -3503,23 +3503,23 @@ void CollisionShapeSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { Geometry::MeshData md; Error err = QuickHull::build(varr, md); if (err == OK) { - Vector<Vector3> points; - points.resize(md.edges.size() * 2); + Vector<Vector3> points2; + points2.resize(md.edges.size() * 2); for (int i = 0; i < md.edges.size(); i++) { - points.write[i * 2 + 0] = md.vertices[md.edges[i].a]; - points.write[i * 2 + 1] = md.vertices[md.edges[i].b]; + points2.write[i * 2 + 0] = md.vertices[md.edges[i].a]; + points2.write[i * 2 + 1] = md.vertices[md.edges[i].b]; } - p_gizmo->add_lines(points, material); - p_gizmo->add_collision_segments(points); + p_gizmo->add_lines(points2, material); + p_gizmo->add_collision_segments(points2); } } } if (Object::cast_to<ConcavePolygonShape>(*s)) { - Ref<ConcavePolygonShape> cs = s; - Ref<ArrayMesh> mesh = cs->get_debug_mesh()->duplicate(); + Ref<ConcavePolygonShape> cs2 = s; + Ref<ArrayMesh> mesh = cs2->get_debug_mesh()->duplicate(); mesh->surface_set_material(0, material); p_gizmo->add_mesh(mesh); } @@ -3652,11 +3652,11 @@ void NavigationMeshSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { if (ek.from < ek.to) SWAP(ek.from, ek.to); - Map<_EdgeKey, bool>::Element *E = edge_map.find(ek); + Map<_EdgeKey, bool>::Element *F = edge_map.find(ek); - if (E) { + if (F) { - E->get() = false; + F->get() = false; } else { |