summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--SConstruct12
-rw-r--r--core/image.cpp10
-rw-r--r--core/io/file_access_zip.cpp6
-rw-r--r--core/io/marshalls.cpp6
-rw-r--r--core/io/resource_format_binary.cpp15
-rw-r--r--core/io/resource_loader.cpp6
-rw-r--r--core/io/resource_saver.cpp6
-rw-r--r--core/math/a_star.cpp10
-rw-r--r--core/math/expression.cpp62
-rw-r--r--core/math/face3.h10
-rw-r--r--core/math/octree.h20
-rw-r--r--core/math/quick_hull.cpp10
-rw-r--r--core/project_settings.cpp6
-rw-r--r--core/script_language.cpp4
-rw-r--r--core/translation.cpp2
-rw-r--r--core/ustring.cpp8
-rw-r--r--core/variant_call.cpp34
-rw-r--r--core/variant_op.cpp18
-rw-r--r--core/variant_parser.cpp32
-rw-r--r--drivers/gles2/rasterizer_canvas_gles2.cpp42
-rw-r--r--drivers/gles2/rasterizer_scene_gles2.cpp10
-rw-r--r--drivers/gles2/rasterizer_storage_gles2.cpp2
-rw-r--r--drivers/gles3/rasterizer_canvas_gles3.cpp22
-rw-r--r--drivers/gles3/rasterizer_scene_gles3.cpp26
-rw-r--r--drivers/gles3/rasterizer_storage_gles3.cpp6
-rw-r--r--drivers/pulseaudio/audio_driver_pulseaudio.cpp2
-rw-r--r--editor/animation_track_editor.cpp22
-rw-r--r--editor/animation_track_editor_plugins.cpp14
-rw-r--r--editor/collada/collada.cpp10
-rw-r--r--editor/connections_dialog.cpp12
-rw-r--r--editor/create_dialog.cpp8
-rw-r--r--editor/doc/doc_data.cpp110
-rw-r--r--editor/editor_audio_buses.cpp6
-rw-r--r--editor/editor_autoload_settings.cpp10
-rw-r--r--editor/editor_file_system.cpp14
-rw-r--r--editor/editor_folding.cpp14
-rw-r--r--editor/editor_inspector.cpp54
-rw-r--r--editor/editor_node.cpp10
-rw-r--r--editor/editor_plugin_settings.cpp10
-rw-r--r--editor/editor_properties.cpp22
-rw-r--r--editor/editor_spin_slider.cpp8
-rw-r--r--editor/editor_sub_scene.cpp4
-rw-r--r--editor/fileserver/editor_file_server.cpp26
-rw-r--r--editor/find_in_files.cpp6
-rw-r--r--editor/import/editor_import_collada.cpp60
-rw-r--r--editor/import/editor_scene_importer_gltf.cpp38
-rw-r--r--editor/import/resource_importer_layered_texture.cpp4
-rw-r--r--editor/import/resource_importer_scene.cpp12
-rw-r--r--editor/plugins/abstract_polygon_2d_editor.cpp8
-rw-r--r--editor/plugins/animation_blend_tree_editor_plugin.cpp4
-rw-r--r--editor/plugins/animation_player_editor_plugin.cpp22
-rw-r--r--editor/plugins/animation_state_machine_editor.cpp10
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp28
-rw-r--r--editor/plugins/mesh_instance_editor_plugin.cpp14
-rw-r--r--editor/plugins/path_2d_editor_plugin.cpp8
-rw-r--r--editor/plugins/polygon_2d_editor_plugin.cpp6
-rw-r--r--editor/plugins/spatial_editor_plugin.cpp16
-rw-r--r--editor/plugins/tile_map_editor_plugin.cpp22
-rw-r--r--editor/plugins/tile_set_editor_plugin.cpp10
-rw-r--r--editor/plugins/visual_shader_editor_plugin.cpp4
-rw-r--r--editor/project_manager.cpp8
-rw-r--r--editor/project_settings_editor.cpp38
-rw-r--r--editor/property_editor.cpp16
-rw-r--r--editor/scene_tree_dock.cpp22
-rw-r--r--editor/script_create_dialog.cpp4
-rw-r--r--editor/script_editor_debugger.cpp26
-rw-r--r--editor/spatial_editor_gizmos.cpp72
-rw-r--r--main/main.cpp10
-rw-r--r--main/tests/test_gdscript.cpp4
-rw-r--r--main/tests/test_shader_lang.cpp12
-rw-r--r--methods.py7
-rw-r--r--modules/csg/csg.cpp12
-rw-r--r--modules/dds/texture_loader_dds.cpp10
-rw-r--r--modules/gdnative/register_types.cpp4
-rw-r--r--modules/gdscript/gdscript.cpp8
-rw-r--r--modules/gdscript/gdscript_compiler.cpp54
-rw-r--r--modules/gdscript/gdscript_editor.cpp28
-rw-r--r--modules/gdscript/gdscript_parser.cpp64
-rw-r--r--modules/gdscript/gdscript_tokenizer.cpp6
-rw-r--r--modules/gridmap/grid_map_editor_plugin.cpp8
-rw-r--r--modules/mono/csharp_script.cpp8
-rw-r--r--modules/mono/editor/bindings_generator.cpp24
-rw-r--r--modules/mono/editor/godotsharp_export.cpp4
-rw-r--r--modules/mono/editor/script_class_parser.cpp6
-rw-r--r--modules/mono/mono_gd/gd_mono_internals.cpp9
-rw-r--r--modules/mono/mono_gd/gd_mono_marshal.cpp78
-rw-r--r--modules/recast/navigation_mesh_generator.cpp28
-rw-r--r--modules/theora/video_stream_theora.cpp4
-rw-r--r--modules/visual_script/visual_script.cpp4
-rw-r--r--modules/visual_script/visual_script_expression.cpp48
-rw-r--r--modules/visual_script/visual_script_property_selector.cpp20
-rw-r--r--modules/websocket/lws_client.cpp4
-rw-r--r--modules/websocket/lws_server.cpp4
-rw-r--r--platform/android/export/export.cpp4
-rw-r--r--platform/x11/detect.py19
-rw-r--r--scene/2d/animated_sprite.cpp4
-rw-r--r--scene/2d/tile_map.cpp54
-rw-r--r--scene/3d/audio_stream_player_3d.cpp16
-rw-r--r--scene/3d/navigation_mesh.cpp6
-rw-r--r--scene/3d/path.cpp1
-rw-r--r--scene/3d/skeleton.cpp10
-rw-r--r--scene/3d/voxel_light_baker.cpp24
-rw-r--r--scene/animation/animation_blend_space_2d.cpp8
-rw-r--r--scene/animation/animation_cache.cpp10
-rw-r--r--scene/animation/animation_tree.cpp30
-rw-r--r--scene/animation/animation_tree_player.cpp30
-rw-r--r--scene/gui/button.cpp4
-rw-r--r--scene/gui/graph_edit.cpp22
-rw-r--r--scene/gui/item_list.cpp10
-rw-r--r--scene/gui/popup_menu.cpp6
-rw-r--r--scene/gui/rich_text_label.cpp10
-rw-r--r--scene/gui/text_edit.cpp20
-rw-r--r--scene/gui/texture_button.cpp4
-rw-r--r--scene/gui/tree.cpp22
-rw-r--r--scene/main/viewport.cpp12
-rw-r--r--scene/resources/animation.cpp14
-rw-r--r--scene/resources/mesh.cpp8
-rw-r--r--scene/resources/packed_scene.cpp16
-rw-r--r--scene/resources/polygon_path_finder.cpp4
-rw-r--r--scene/resources/primitive_meshes.cpp10
-rw-r--r--scene/resources/texture.cpp8
-rw-r--r--scene/resources/theme.cpp4
-rw-r--r--servers/audio/audio_stream.cpp4
-rw-r--r--servers/physics/collision_solver_sat.cpp4
-rw-r--r--servers/physics/joints/cone_twist_joint_sw.cpp4
-rw-r--r--servers/physics/space_sw.cpp4
-rw-r--r--servers/physics_2d/shape_2d_sw.cpp24
-rw-r--r--servers/physics_2d/space_2d_sw.cpp2
-rw-r--r--servers/physics_server.cpp6
-rw-r--r--servers/visual/rasterizer.h10
-rw-r--r--servers/visual/shader_language.cpp70
-rw-r--r--servers/visual/visual_server_canvas.cpp22
-rw-r--r--servers/visual/visual_server_scene.cpp4
-rw-r--r--servers/visual_server.cpp6
134 files changed, 1107 insertions, 1110 deletions
diff --git a/SConstruct b/SConstruct
index 2c79665465..3734268cae 100644
--- a/SConstruct
+++ b/SConstruct
@@ -336,12 +336,18 @@ if selected_platform in platform_list:
env.Append(CCFLAGS=['/WX'])
else: # Rest of the world
disable_nonessential_warnings = ['-Wno-sign-compare']
+ shadow_local_warning = []
+
+ if 'gcc' in os.path.basename(env["CC"]):
+ version = methods.get_compiler_version(env)
+ if version != None and version[0] >= '7':
+ shadow_local_warning = ['-Wshadow-local']
if (env["warnings"] == 'extra'):
- env.Append(CCFLAGS=['-Wall', '-Wextra'])
+ env.Append(CCFLAGS=['-Wall', '-Wextra'] + shadow_local_warning)
elif (env["warnings"] == 'all'):
- env.Append(CCFLAGS=['-Wall'] + disable_nonessential_warnings)
+ env.Append(CCFLAGS=['-Wall'] + shadow_local_warning + disable_nonessential_warnings)
elif (env["warnings"] == 'moderate'):
- env.Append(CCFLAGS=['-Wall', '-Wno-unused'] + disable_nonessential_warnings)
+ env.Append(CCFLAGS=['-Wall', '-Wno-unused'] + shadow_local_warning + disable_nonessential_warnings)
else: # 'no'
env.Append(CCFLAGS=['-w'])
if (env["werror"]):
diff --git a/core/image.cpp b/core/image.cpp
index 3d48db872c..5a287ca50e 100644
--- a/core/image.cpp
+++ b/core/image.cpp
@@ -2901,15 +2901,15 @@ void Image::fix_alpha_edges() {
if (dist >= closest_dist)
continue;
- const uint8_t *rp = &srcptr[(k * width + l) << 2];
+ const uint8_t *rp2 = &srcptr[(k * width + l) << 2];
- if (rp[3] < alpha_threshold)
+ if (rp2[3] < alpha_threshold)
continue;
closest_dist = dist;
- closest_color[0] = rp[0];
- closest_color[1] = rp[1];
- closest_color[2] = rp[2];
+ closest_color[0] = rp2[0];
+ closest_color[1] = rp2[1];
+ closest_color[2] = rp2[2];
}
}
diff --git a/core/io/file_access_zip.cpp b/core/io/file_access_zip.cpp
index 66b911e83c..be28c9a877 100644
--- a/core/io/file_access_zip.cpp
+++ b/core/io/file_access_zip.cpp
@@ -168,10 +168,10 @@ bool ZipArchive::try_open_pack(const String &p_path) {
zlib_filefunc_def io;
- FileAccess *f = FileAccess::open(p_path, FileAccess::READ);
- if (!f)
+ FileAccess *fa = FileAccess::open(p_path, FileAccess::READ);
+ if (!fa)
return false;
- io.opaque = f;
+ io.opaque = fa;
io.zopen_file = godot_open;
io.zread_file = godot_read;
io.zwrite_file = godot_write;
diff --git a/core/io/marshalls.cpp b/core/io/marshalls.cpp
index eec1c55744..5087a63b68 100644
--- a/core/io/marshalls.cpp
+++ b/core/io/marshalls.cpp
@@ -889,11 +889,11 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
if (buf) {
encode_uint32(uint32_t(np.get_name_count()) | 0x80000000, buf); //for compatibility with the old format
encode_uint32(np.get_subname_count(), buf + 4);
- uint32_t flags = 0;
+ uint32_t np_flags = 0;
if (np.is_absolute())
- flags |= 1;
+ np_flags |= 1;
- encode_uint32(flags, buf + 8);
+ encode_uint32(np_flags, buf + 8);
buf += 12;
}
diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp
index 4d4134b745..77e3efb3a0 100644
--- a/core/io/resource_format_binary.cpp
+++ b/core/io/resource_format_binary.cpp
@@ -296,9 +296,9 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) {
} break;
case VARIANT_OBJECT: {
- uint32_t type = f->get_32();
+ uint32_t objtype = f->get_32();
- switch (type) {
+ switch (objtype) {
case OBJECT_EMPTY: {
//do none
@@ -317,7 +317,7 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) {
case OBJECT_EXTERNAL_RESOURCE: {
//old file format, still around for compatibility
- String type = get_unicode_string();
+ String exttype = get_unicode_string();
String path = get_unicode_string();
if (path.find("://") == -1 && path.is_rel_path()) {
@@ -329,7 +329,7 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) {
path = remaps[path];
}
- RES res = ResourceLoader::load(path, type);
+ RES res = ResourceLoader::load(path, exttype);
if (res.is_null()) {
WARN_PRINT(String("Couldn't load resource: " + path).utf8().get_data());
@@ -346,7 +346,7 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) {
r_v = Variant();
} else {
- String type = external_resources[erindex].type;
+ String exttype = external_resources[erindex].type;
String path = external_resources[erindex].path;
if (path.find("://") == -1 && path.is_rel_path()) {
@@ -354,7 +354,7 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) {
path = ProjectSettings::get_singleton()->localize_path(res_path.get_base_dir().plus_file(path));
}
- RES res = ResourceLoader::load(path, type);
+ RES res = ResourceLoader::load(path, exttype);
if (res.is_null()) {
WARN_PRINT(String("Couldn't load resource: " + path).utf8().get_data());
@@ -1314,8 +1314,7 @@ void ResourceFormatSaverBinaryInstance::write_variant(FileAccess *f, const Varia
} else {
f->store_32(VARIANT_INT);
- int val = p_property;
- f->store_32(int32_t(val));
+ f->store_32(int32_t(p_property));
}
} break;
diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp
index 10a32bae41..98309048bb 100644
--- a/core/io/resource_loader.cpp
+++ b/core/io/resource_loader.cpp
@@ -905,9 +905,9 @@ bool ResourceLoader::add_custom_resource_format_loader(String script_path) {
void ResourceLoader::remove_custom_resource_format_loader(String script_path) {
- Ref<ResourceFormatLoader> loader = _find_custom_resource_format_loader(script_path);
- if (loader.is_valid())
- remove_resource_format_loader(loader);
+ Ref<ResourceFormatLoader> custom_loader = _find_custom_resource_format_loader(script_path);
+ if (custom_loader.is_valid())
+ remove_resource_format_loader(custom_loader);
}
void ResourceLoader::add_custom_loaders() {
diff --git a/core/io/resource_saver.cpp b/core/io/resource_saver.cpp
index 279788796c..c992e2bf94 100644
--- a/core/io/resource_saver.cpp
+++ b/core/io/resource_saver.cpp
@@ -233,9 +233,9 @@ bool ResourceSaver::add_custom_resource_format_saver(String script_path) {
void ResourceSaver::remove_custom_resource_format_saver(String script_path) {
- Ref<ResourceFormatSaver> saver = _find_custom_resource_format_saver(script_path);
- if (saver.is_valid())
- remove_resource_format_saver(saver);
+ Ref<ResourceFormatSaver> custom_saver = _find_custom_resource_format_saver(script_path);
+ if (custom_saver.is_valid())
+ remove_resource_format_saver(custom_saver);
}
void ResourceSaver::add_custom_savers() {
diff --git a/core/math/a_star.cpp b/core/math/a_star.cpp
index 21ec5218b7..6c3b84d49a 100644
--- a/core/math/a_star.cpp
+++ b/core/math/a_star.cpp
@@ -374,14 +374,14 @@ PoolVector<Vector3> AStar::get_point_path(int p_from_id, int p_to_id) {
{
PoolVector<Vector3>::Write w = path.write();
- Point *p = end_point;
+ Point *p2 = end_point;
int idx = pc - 1;
- while (p != begin_point) {
- w[idx--] = p->pos;
- p = p->prev_point;
+ while (p2 != begin_point) {
+ w[idx--] = p2->pos;
+ p2 = p2->prev_point;
}
- w[0] = p->pos; // Assign first
+ w[0] = p2->pos; // Assign first
}
return path;
diff --git a/core/math/expression.cpp b/core/math/expression.cpp
index 61e5154f44..99251d80e3 100644
--- a/core/math/expression.cpp
+++ b/core/math/expression.cpp
@@ -1264,10 +1264,10 @@ Expression::ENode *Expression::_parse_expression() {
}
str_ofs = cofs; //revert
//parse an expression
- ENode *expr = _parse_expression();
- if (!expr)
+ ENode *subexpr = _parse_expression();
+ if (!subexpr)
return NULL;
- dn->dict.push_back(expr);
+ dn->dict.push_back(subexpr);
_get_token(tk);
if (tk.type != TK_COLON) {
@@ -1275,11 +1275,11 @@ Expression::ENode *Expression::_parse_expression() {
return NULL;
}
- expr = _parse_expression();
- if (!expr)
+ subexpr = _parse_expression();
+ if (!subexpr)
return NULL;
- dn->dict.push_back(expr);
+ dn->dict.push_back(subexpr);
cofs = str_ofs;
_get_token(tk);
@@ -1308,10 +1308,10 @@ Expression::ENode *Expression::_parse_expression() {
}
str_ofs = cofs; //revert
//parse an expression
- ENode *expr = _parse_expression();
- if (!expr)
+ ENode *subexpr = _parse_expression();
+ if (!subexpr)
return NULL;
- an->array.push_back(expr);
+ an->array.push_back(subexpr);
cofs = str_ofs;
_get_token(tk);
@@ -1355,25 +1355,25 @@ Expression::ENode *Expression::_parse_expression() {
while (true) {
- int cofs = str_ofs;
+ int cofs2 = str_ofs;
_get_token(tk);
if (tk.type == TK_PARENTHESIS_CLOSE) {
break;
}
- str_ofs = cofs; //revert
+ str_ofs = cofs2; //revert
//parse an expression
- ENode *expr = _parse_expression();
- if (!expr)
+ ENode *subexpr = _parse_expression();
+ if (!subexpr)
return NULL;
- func_call->arguments.push_back(expr);
+ func_call->arguments.push_back(subexpr);
- cofs = str_ofs;
+ cofs2 = str_ofs;
_get_token(tk);
if (tk.type == TK_COMMA) {
//all good
} else if (tk.type == TK_PARENTHESIS_CLOSE) {
- str_ofs = cofs;
+ str_ofs = cofs2;
} else {
_set_error("Expected ',' or ')'");
}
@@ -1444,11 +1444,11 @@ Expression::ENode *Expression::_parse_expression() {
}
str_ofs = cofs; //revert
//parse an expression
- ENode *expr = _parse_expression();
- if (!expr)
+ ENode *subexpr = _parse_expression();
+ if (!subexpr)
return NULL;
- constructor->arguments.push_back(expr);
+ constructor->arguments.push_back(subexpr);
cofs = str_ofs;
_get_token(tk);
@@ -1485,11 +1485,11 @@ Expression::ENode *Expression::_parse_expression() {
}
str_ofs = cofs; //revert
//parse an expression
- ENode *expr = _parse_expression();
- if (!expr)
+ ENode *subexpr = _parse_expression();
+ if (!subexpr)
return NULL;
- bifunc->arguments.push_back(expr);
+ bifunc->arguments.push_back(subexpr);
cofs = str_ofs;
_get_token(tk);
@@ -1584,25 +1584,25 @@ Expression::ENode *Expression::_parse_expression() {
while (true) {
- int cofs = str_ofs;
+ int cofs3 = str_ofs;
_get_token(tk);
if (tk.type == TK_PARENTHESIS_CLOSE) {
break;
}
- str_ofs = cofs; //revert
+ str_ofs = cofs3; //revert
//parse an expression
- ENode *expr = _parse_expression();
- if (!expr)
+ ENode *subexpr = _parse_expression();
+ if (!subexpr)
return NULL;
- func_call->arguments.push_back(expr);
+ func_call->arguments.push_back(subexpr);
- cofs = str_ofs;
+ cofs3 = str_ofs;
_get_token(tk);
if (tk.type == TK_COMMA) {
//all good
} else if (tk.type == TK_PARENTHESIS_CLOSE) {
- str_ofs = cofs;
+ str_ofs = cofs3;
} else {
_set_error("Expected ',' or ')'");
}
@@ -1902,7 +1902,7 @@ bool Expression::_execute(const Array &p_inputs, Object *p_instance, Expression:
Variant b;
if (op->nodes[1]) {
- bool ret = _execute(p_inputs, p_instance, op->nodes[1], b, r_error_str);
+ ret = _execute(p_inputs, p_instance, op->nodes[1], b, r_error_str);
if (ret)
return true;
}
@@ -2070,7 +2070,7 @@ bool Expression::_execute(const Array &p_inputs, Object *p_instance, Expression:
for (int i = 0; i < call->arguments.size(); i++) {
Variant value;
- bool ret = _execute(p_inputs, p_instance, call->arguments[i], value, r_error_str);
+ ret = _execute(p_inputs, p_instance, call->arguments[i], value, r_error_str);
if (ret)
return true;
diff --git a/core/math/face3.h b/core/math/face3.h
index 1a00851eab..184e80ff77 100644
--- a/core/math/face3.h
+++ b/core/math/face3.h
@@ -241,13 +241,13 @@ bool Face3::intersects_aabb2(const AABB &p_aabb) const {
real_t minT = 1e20, maxT = -1e20;
for (int k = 0; k < 3; k++) {
- real_t d = axis.dot(vertex[k]);
+ real_t vert_d = axis.dot(vertex[k]);
- if (d > maxT)
- maxT = d;
+ if (vert_d > maxT)
+ maxT = vert_d;
- if (d < minT)
- minT = d;
+ if (vert_d < minT)
+ minT = vert_d;
}
if (maxB < minT || maxT < minB)
diff --git a/core/math/octree.h b/core/math/octree.h
index 36a77663f4..d6fc9776bc 100644
--- a/core/math/octree.h
+++ b/core/math/octree.h
@@ -916,34 +916,34 @@ void Octree<T, use_pairs, AL>::move(OctreeElementID p_id, const AABB &p_aabb) {
pass++;
- for (typename List<typename Element::OctantOwner, AL>::Element *E = owners.front(); E;) {
+ for (typename List<typename Element::OctantOwner, AL>::Element *F = owners.front(); F;) {
- Octant *o = E->get().octant;
- typename List<typename Element::OctantOwner, AL>::Element *N = E->next();
+ Octant *o = F->get().octant;
+ typename List<typename Element::OctantOwner, AL>::Element *N = F->next();
/*
if (!use_pairs)
- o->elements.erase( E->get().E );
+ o->elements.erase( F->get().E );
*/
if (use_pairs && e.pairable)
- o->pairable_elements.erase(E->get().E);
+ o->pairable_elements.erase(F->get().E);
else
- o->elements.erase(E->get().E);
+ o->elements.erase(F->get().E);
if (_remove_element_from_octant(&e, o, common_parent->parent)) {
- owners.erase(E);
+ owners.erase(F);
}
- E = N;
+ F = N;
}
if (use_pairs) {
//unpair child elements in anything that survived
- for (typename List<typename Element::OctantOwner, AL>::Element *E = owners.front(); E; E = E->next()) {
+ for (typename List<typename Element::OctantOwner, AL>::Element *F = owners.front(); F; F = F->next()) {
- Octant *o = E->get().octant;
+ Octant *o = F->get().octant;
// erase children pairs, unref ONCE
pass++;
diff --git a/core/math/quick_hull.cpp b/core/math/quick_hull.cpp
index 1aa345db1f..bc2b4e6fe0 100644
--- a/core/math/quick_hull.cpp
+++ b/core/math/quick_hull.cpp
@@ -438,12 +438,12 @@ Error QuickHull::build(const Vector<Vector3> &p_points, Geometry::MeshData &r_me
}
// remove all edge connections to this face
- for (Map<Edge, RetFaceConnect>::Element *E = ret_edges.front(); E; E = E->next()) {
- if (E->get().left == O)
- E->get().left = NULL;
+ for (Map<Edge, RetFaceConnect>::Element *G = ret_edges.front(); G; G = G->next()) {
+ if (G->get().left == O)
+ G->get().left = NULL;
- if (E->get().right == O)
- E->get().right = NULL;
+ if (G->get().right == O)
+ G->get().right = NULL;
}
ret_edges.erase(F); //remove the edge
diff --git a/core/project_settings.cpp b/core/project_settings.cpp
index 8d05d7cc74..6b4895d688 100644
--- a/core/project_settings.cpp
+++ b/core/project_settings.cpp
@@ -501,7 +501,7 @@ Error ProjectSettings::_load_settings_binary(const String p_path) {
d.resize(vlen);
f->get_buffer(d.ptrw(), vlen);
Variant value;
- Error err = decode_variant(value, d.ptr(), d.size());
+ err = decode_variant(value, d.ptr(), d.size());
ERR_EXPLAIN("Error decoding property: " + key);
ERR_CONTINUE(err != OK);
set(key, value);
@@ -656,7 +656,7 @@ Error ProjectSettings::_save_settings_binary(const String &p_file, const Map<Str
file->store_string(key);
int len;
- Error err = encode_variant(p_custom_features, NULL, len);
+ err = encode_variant(p_custom_features, NULL, len);
if (err != OK) {
memdelete(file);
ERR_FAIL_V(err);
@@ -694,7 +694,7 @@ Error ProjectSettings::_save_settings_binary(const String &p_file, const Map<Str
file->store_string(key);
int len;
- Error err = encode_variant(value, NULL, len);
+ err = encode_variant(value, NULL, len);
if (err != OK)
memdelete(file);
ERR_FAIL_COND_V(err != OK, ERR_INVALID_DATA);
diff --git a/core/script_language.cpp b/core/script_language.cpp
index 2746c015d6..f0310ffc31 100644
--- a/core/script_language.cpp
+++ b/core/script_language.cpp
@@ -527,8 +527,8 @@ void PlaceHolderScriptInstance::property_set_fallback(const StringName &p_name,
}
bool found = false;
- for (const List<PropertyInfo>::Element *E = properties.front(); E; E = E->next()) {
- if (E->get().name == p_name) {
+ for (const List<PropertyInfo>::Element *F = properties.front(); F; F = F->next()) {
+ if (F->get().name == p_name) {
found = true;
break;
}
diff --git a/core/translation.cpp b/core/translation.cpp
index a402df3eea..6921f1d9f1 100644
--- a/core/translation.cpp
+++ b/core/translation.cpp
@@ -1052,7 +1052,7 @@ StringName TranslationServer::translate(const StringName &p_message) const {
if (fallback.length() >= 2) {
const CharType *fptr = &fallback[0];
- bool near_match = false;
+ near_match = false;
for (const Set<Ref<Translation> >::Element *E = translations.front(); E; E = E->next()) {
const Ref<Translation> &t = E->get();
diff --git a/core/ustring.cpp b/core/ustring.cpp
index 838907419e..17b52035dd 100644
--- a/core/ustring.cpp
+++ b/core/ustring.cpp
@@ -603,13 +603,13 @@ String String::camelcase_to_underscore(bool lowercase) const {
is_next_number = cstr[i + 1] >= '0' && cstr[i + 1] <= '9';
}
- const bool a = is_upper && !was_precedent_upper && !was_precedent_number;
- const bool b = was_precedent_upper && is_upper && are_next_2_lower;
- const bool c = is_number && !was_precedent_number;
+ const bool cond_a = is_upper && !was_precedent_upper && !was_precedent_number;
+ const bool cond_b = was_precedent_upper && is_upper && are_next_2_lower;
+ const bool cond_c = is_number && !was_precedent_number;
const bool can_break_number_letter = is_number && !was_precedent_number && is_next_lower;
const bool can_break_letter_number = !is_number && was_precedent_number && (is_next_lower || is_next_number);
- bool should_split = a || b || c || can_break_number_letter || can_break_letter_number;
+ bool should_split = cond_a || cond_b || cond_c || can_break_number_letter || can_break_letter_number;
if (should_split) {
new_string += this->substr(start_index, i - start_index) + "_";
start_index = i;
diff --git a/core/variant_call.cpp b/core/variant_call.cpp
index f6f4569dfa..32461f6584 100644
--- a/core/variant_call.cpp
+++ b/core/variant_call.cpp
@@ -1227,15 +1227,15 @@ bool Variant::has_method(const StringName &p_method) const {
#endif
}
- const _VariantCall::TypeFunc &fd = _VariantCall::type_funcs[type];
- return fd.functions.has(p_method);
+ const _VariantCall::TypeFunc &tf = _VariantCall::type_funcs[type];
+ return tf.functions.has(p_method);
}
Vector<Variant::Type> Variant::get_method_argument_types(Variant::Type p_type, const StringName &p_method) {
- const _VariantCall::TypeFunc &fd = _VariantCall::type_funcs[p_type];
+ const _VariantCall::TypeFunc &tf = _VariantCall::type_funcs[p_type];
- const Map<StringName, _VariantCall::FuncData>::Element *E = fd.functions.find(p_method);
+ const Map<StringName, _VariantCall::FuncData>::Element *E = tf.functions.find(p_method);
if (!E)
return Vector<Variant::Type>();
@@ -1244,9 +1244,9 @@ Vector<Variant::Type> Variant::get_method_argument_types(Variant::Type p_type, c
bool Variant::is_method_const(Variant::Type p_type, const StringName &p_method) {
- const _VariantCall::TypeFunc &fd = _VariantCall::type_funcs[p_type];
+ const _VariantCall::TypeFunc &tf = _VariantCall::type_funcs[p_type];
- const Map<StringName, _VariantCall::FuncData>::Element *E = fd.functions.find(p_method);
+ const Map<StringName, _VariantCall::FuncData>::Element *E = tf.functions.find(p_method);
if (!E)
return false;
@@ -1255,9 +1255,9 @@ bool Variant::is_method_const(Variant::Type p_type, const StringName &p_method)
Vector<StringName> Variant::get_method_argument_names(Variant::Type p_type, const StringName &p_method) {
- const _VariantCall::TypeFunc &fd = _VariantCall::type_funcs[p_type];
+ const _VariantCall::TypeFunc &tf = _VariantCall::type_funcs[p_type];
- const Map<StringName, _VariantCall::FuncData>::Element *E = fd.functions.find(p_method);
+ const Map<StringName, _VariantCall::FuncData>::Element *E = tf.functions.find(p_method);
if (!E)
return Vector<StringName>();
@@ -1266,9 +1266,9 @@ Vector<StringName> Variant::get_method_argument_names(Variant::Type p_type, cons
Variant::Type Variant::get_method_return_type(Variant::Type p_type, const StringName &p_method, bool *r_has_return) {
- const _VariantCall::TypeFunc &fd = _VariantCall::type_funcs[p_type];
+ const _VariantCall::TypeFunc &tf = _VariantCall::type_funcs[p_type];
- const Map<StringName, _VariantCall::FuncData>::Element *E = fd.functions.find(p_method);
+ const Map<StringName, _VariantCall::FuncData>::Element *E = tf.functions.find(p_method);
if (!E)
return Variant::NIL;
@@ -1280,9 +1280,9 @@ Variant::Type Variant::get_method_return_type(Variant::Type p_type, const String
Vector<Variant> Variant::get_method_default_arguments(Variant::Type p_type, const StringName &p_method) {
- const _VariantCall::TypeFunc &fd = _VariantCall::type_funcs[p_type];
+ const _VariantCall::TypeFunc &tf = _VariantCall::type_funcs[p_type];
- const Map<StringName, _VariantCall::FuncData>::Element *E = fd.functions.find(p_method);
+ const Map<StringName, _VariantCall::FuncData>::Element *E = tf.functions.find(p_method);
if (!E)
return Vector<Variant>();
@@ -1291,9 +1291,9 @@ Vector<Variant> Variant::get_method_default_arguments(Variant::Type p_type, cons
void Variant::get_method_list(List<MethodInfo> *p_list) const {
- const _VariantCall::TypeFunc &fd = _VariantCall::type_funcs[type];
+ const _VariantCall::TypeFunc &tf = _VariantCall::type_funcs[type];
- for (const Map<StringName, _VariantCall::FuncData>::Element *E = fd.functions.front(); E; E = E->next()) {
+ for (const Map<StringName, _VariantCall::FuncData>::Element *E = tf.functions.front(); E; E = E->next()) {
const _VariantCall::FuncData &fd = E->get();
@@ -1405,11 +1405,11 @@ Variant Variant::get_constant_value(Variant::Type p_type, const StringName &p_va
Map<StringName, int>::Element *E = cd.value.find(p_value);
if (!E) {
- Map<StringName, Variant>::Element *E = cd.variant_value.find(p_value);
- if (E) {
+ Map<StringName, Variant>::Element *F = cd.variant_value.find(p_value);
+ if (F) {
if (r_valid)
*r_valid = true;
- return E->get();
+ return F->get();
} else {
return -1;
}
diff --git a/core/variant_op.cpp b/core/variant_op.cpp
index 93654d3389..26851e4c23 100644
--- a/core/variant_op.cpp
+++ b/core/variant_op.cpp
@@ -3496,15 +3496,15 @@ void Variant::blend(const Variant &a, const Variant &b, float c, Variant &r_dst)
case COLOR: {
const Color *ca = reinterpret_cast<const Color *>(a._data._mem);
const Color *cb = reinterpret_cast<const Color *>(b._data._mem);
- float r = ca->r + cb->r * c;
- float g = ca->g + cb->g * c;
- float b = ca->b + cb->b * c;
- float a = ca->a + cb->a * c;
- r = r > 1.0 ? 1.0 : r;
- g = g > 1.0 ? 1.0 : g;
- b = b > 1.0 ? 1.0 : b;
- a = a > 1.0 ? 1.0 : a;
- r_dst = Color(r, g, b, a);
+ float new_r = ca->r + cb->r * c;
+ float new_g = ca->g + cb->g * c;
+ float new_b = ca->b + cb->b * c;
+ float new_a = ca->a + cb->a * c;
+ new_r = new_r > 1.0 ? 1.0 : new_r;
+ new_g = new_g > 1.0 ? 1.0 : new_g;
+ new_b = new_b > 1.0 ? 1.0 : new_b;
+ new_a = new_a > 1.0 ? 1.0 : new_a;
+ r_dst = Color(new_r, new_g, new_b, new_a);
}
return;
default: {
diff --git a/core/variant_parser.cpp b/core/variant_parser.cpp
index 84fb85e812..716e5499e3 100644
--- a/core/variant_parser.cpp
+++ b/core/variant_parser.cpp
@@ -728,7 +728,7 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream,
bool at_key = true;
String key;
- Token token;
+ Token token2;
bool need_comma = false;
while (true) {
@@ -740,11 +740,11 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream,
if (at_key) {
- Error err = get_token(p_stream, token, line, r_err_str);
+ Error err = get_token(p_stream, token2, line, r_err_str);
if (err != OK)
return err;
- if (token.type == TK_PARENTHESIS_CLOSE) {
+ if (token2.type == TK_PARENTHESIS_CLOSE) {
Reference *reference = Object::cast_to<Reference>(obj);
if (reference) {
value = REF(reference);
@@ -756,7 +756,7 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream,
if (need_comma) {
- if (token.type != TK_COMMA) {
+ if (token2.type != TK_COMMA) {
r_err_str = "Expected '}' or ','";
return ERR_PARSE_ERROR;
@@ -766,18 +766,18 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream,
}
}
- if (token.type != TK_STRING) {
+ if (token2.type != TK_STRING) {
r_err_str = "Expected property name as string";
return ERR_PARSE_ERROR;
}
- key = token.value;
+ key = token2.value;
- err = get_token(p_stream, token, line, r_err_str);
+ err = get_token(p_stream, token2, line, r_err_str);
if (err != OK)
return err;
- if (token.type != TK_COLON) {
+ if (token2.type != TK_COLON) {
r_err_str = "Expected ':'";
return ERR_PARSE_ERROR;
@@ -785,12 +785,12 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream,
at_key = false;
} else {
- Error err = get_token(p_stream, token, line, r_err_str);
+ Error err = get_token(p_stream, token2, line, r_err_str);
if (err != OK)
return err;
Variant v;
- err = parse_value(token, v, p_stream, line, r_err_str, p_res_parser);
+ err = parse_value(token2, v, p_stream, line, r_err_str, p_res_parser);
if (err)
return err;
obj->set(key, v);
@@ -882,11 +882,11 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream,
return ERR_PARSE_ERROR;
}
- String id = token.value;
+ String id2 = token.value;
Ref<InputEvent> ie;
- if (id == "NONE") {
+ if (id2 == "NONE") {
get_token(p_stream, token, line, r_err_str);
@@ -895,7 +895,7 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream,
return ERR_PARSE_ERROR;
}
- } else if (id == "KEY") {
+ } else if (id2 == "KEY") {
Ref<InputEventKey> key;
key.instance();
@@ -954,7 +954,7 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream,
return ERR_PARSE_ERROR;
}
- } else if (id == "MBUTTON") {
+ } else if (id2 == "MBUTTON") {
Ref<InputEventMouseButton> mb;
mb.instance();
@@ -980,7 +980,7 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream,
return ERR_PARSE_ERROR;
}
- } else if (id == "JBUTTON") {
+ } else if (id2 == "JBUTTON") {
Ref<InputEventJoypadButton> jb;
jb.instance();
@@ -1006,7 +1006,7 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream,
return ERR_PARSE_ERROR;
}
- } else if (id == "JAXIS") {
+ } else if (id2 == "JAXIS") {
Ref<InputEventJoypadMotion> jm;
jm.instance();
diff --git a/drivers/gles2/rasterizer_canvas_gles2.cpp b/drivers/gles2/rasterizer_canvas_gles2.cpp
index a7345978e1..bf210ef2b2 100644
--- a/drivers/gles2/rasterizer_canvas_gles2.cpp
+++ b/drivers/gles2/rasterizer_canvas_gles2.cpp
@@ -851,11 +851,11 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur
int indices[num_points * 3];
- for (int i = 0; i < num_points; i++) {
- points[i] = circle->pos + Vector2(Math::sin(i * Math_PI * 2.0 / num_points), Math::cos(i * Math_PI * 2.0 / num_points)) * circle->radius;
- indices[i * 3 + 0] = i;
- indices[i * 3 + 1] = (i + 1) % num_points;
- indices[i * 3 + 2] = num_points;
+ for (int j = 0; j < num_points; j++) {
+ points[j] = circle->pos + Vector2(Math::sin(j * Math_PI * 2.0 / num_points), Math::cos(j * Math_PI * 2.0 / num_points)) * circle->radius;
+ indices[j * 3 + 0] = j;
+ indices[j * 3 + 1] = (j + 1) % num_points;
+ indices[j * 3 + 2] = num_points;
}
_bind_canvas_texture(RID(), RID());
@@ -913,13 +913,13 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, s->index_id);
}
- for (int i = 0; i < VS::ARRAY_MAX - 1; i++) {
- if (s->attribs[i].enabled) {
- glEnableVertexAttribArray(i);
- glVertexAttribPointer(s->attribs[i].index, s->attribs[i].size, s->attribs[i].type, s->attribs[i].normalized, s->attribs[i].stride, (uint8_t *)0 + s->attribs[i].offset);
+ for (int k = 0; k < VS::ARRAY_MAX - 1; k++) {
+ if (s->attribs[k].enabled) {
+ glEnableVertexAttribArray(k);
+ glVertexAttribPointer(s->attribs[k].index, s->attribs[k].size, s->attribs[k].type, s->attribs[k].normalized, s->attribs[k].stride, (uint8_t *)0 + s->attribs[k].offset);
} else {
- glDisableVertexAttribArray(i);
- switch (i) {
+ glDisableVertexAttribArray(k);
+ switch (k) {
case VS::ARRAY_NORMAL: {
glVertexAttrib4f(VS::ARRAY_NORMAL, 0.0, 0.0, 1, 1);
} break;
@@ -939,8 +939,8 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur
}
}
- for (int i = 1; i < VS::ARRAY_MAX - 1; i++) {
- glDisableVertexAttribArray(i);
+ for (int j = 1; j < VS::ARRAY_MAX - 1; j++) {
+ glDisableVertexAttribArray(j);
}
}
@@ -1002,13 +1002,13 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, s->index_id);
}
- for (int i = 0; i < VS::ARRAY_MAX - 1; i++) {
- if (s->attribs[i].enabled) {
- glEnableVertexAttribArray(i);
- glVertexAttribPointer(s->attribs[i].index, s->attribs[i].size, s->attribs[i].type, s->attribs[i].normalized, s->attribs[i].stride, (uint8_t *)0 + s->attribs[i].offset);
+ for (int k = 0; k < VS::ARRAY_MAX - 1; k++) {
+ if (s->attribs[k].enabled) {
+ glEnableVertexAttribArray(k);
+ glVertexAttribPointer(s->attribs[k].index, s->attribs[k].size, s->attribs[k].type, s->attribs[k].normalized, s->attribs[k].stride, (uint8_t *)0 + s->attribs[k].offset);
} else {
- glDisableVertexAttribArray(i);
- switch (i) {
+ glDisableVertexAttribArray(k);
+ switch (k) {
case VS::ARRAY_NORMAL: {
glVertexAttrib4f(VS::ARRAY_NORMAL, 0.0, 0.0, 1, 1);
} break;
@@ -1021,8 +1021,8 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur
}
}
- for (int i = 0; i < amount; i++) {
- const float *buffer = base_buffer + i * stride;
+ for (int k = 0; k < amount; k++) {
+ const float *buffer = base_buffer + k * stride;
{
diff --git a/drivers/gles2/rasterizer_scene_gles2.cpp b/drivers/gles2/rasterizer_scene_gles2.cpp
index 03e6c185ee..3920a5f96a 100644
--- a/drivers/gles2/rasterizer_scene_gles2.cpp
+++ b/drivers/gles2/rasterizer_scene_gles2.cpp
@@ -1120,10 +1120,10 @@ void RasterizerSceneGLES2::_fill_render_list(InstanceBase **p_cull_result, int p
int num_surfaces = mesh->surfaces.size();
- for (int i = 0; i < num_surfaces; i++) {
- int material_index = instance->materials[i].is_valid() ? i : -1;
+ for (int j = 0; j < num_surfaces; j++) {
+ int material_index = instance->materials[j].is_valid() ? j : -1;
- RasterizerStorageGLES2::Surface *surface = mesh->surfaces[i];
+ RasterizerStorageGLES2::Surface *surface = mesh->surfaces[j];
_add_geometry(surface, instance, NULL, material_index, p_depth_pass, p_shadow_pass);
}
@@ -1143,8 +1143,8 @@ void RasterizerSceneGLES2::_fill_render_list(InstanceBase **p_cull_result, int p
int ssize = mesh->surfaces.size();
- for (int i = 0; i < ssize; i++) {
- RasterizerStorageGLES2::Surface *s = mesh->surfaces[i];
+ for (int j = 0; j < ssize; j++) {
+ RasterizerStorageGLES2::Surface *s = mesh->surfaces[j];
_add_geometry(s, instance, multi_mesh, -1, p_depth_pass, p_shadow_pass);
}
} break;
diff --git a/drivers/gles2/rasterizer_storage_gles2.cpp b/drivers/gles2/rasterizer_storage_gles2.cpp
index d00d572ccf..0227cd2b34 100644
--- a/drivers/gles2/rasterizer_storage_gles2.cpp
+++ b/drivers/gles2/rasterizer_storage_gles2.cpp
@@ -4283,7 +4283,7 @@ void RasterizerStorageGLES2::_render_target_allocate(RenderTarget *rt) {
glClearColor(0, 0, 0, 0);
glClear(GL_COLOR_BUFFER_BIT);
- GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
+ status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
if (status != GL_FRAMEBUFFER_COMPLETE) {
_render_target_clear(rt);
ERR_FAIL_COND(status != GL_FRAMEBUFFER_COMPLETE);
diff --git a/drivers/gles3/rasterizer_canvas_gles3.cpp b/drivers/gles3/rasterizer_canvas_gles3.cpp
index 0cda8acba8..227445ae5b 100644
--- a/drivers/gles3/rasterizer_canvas_gles3.cpp
+++ b/drivers/gles3/rasterizer_canvas_gles3.cpp
@@ -581,10 +581,10 @@ void RasterizerCanvasGLES3::_canvas_item_render_commands(Item *p_item, Item *cur
#ifdef GLES_OVER_GL
if (line->antialiased) {
glEnable(GL_LINE_SMOOTH);
- for (int i = 0; i < 4; i++) {
+ for (int j = 0; j < 4; j++) {
Vector2 vertsl[2] = {
- verts[i],
- verts[(i + 1) % 4],
+ verts[j],
+ verts[(j + 1) % 4],
};
_draw_gui_primitive(2, vertsl, NULL, NULL);
}
@@ -782,8 +782,8 @@ void RasterizerCanvasGLES3::_canvas_item_render_commands(Item *p_item, Item *cur
}
if (primitive->colors.size() == 1 && primitive->points.size() > 1) {
- Color c = primitive->colors[0];
- glVertexAttrib4f(VS::ARRAY_COLOR, c.r, c.g, c.b, c.a);
+ Color col = primitive->colors[0];
+ glVertexAttrib4f(VS::ARRAY_COLOR, col.r, col.g, col.b, col.a);
} else if (primitive->colors.empty()) {
glVertexAttrib4f(VS::ARRAY_COLOR, 1, 1, 1, 1);
@@ -1035,8 +1035,6 @@ void RasterizerCanvasGLES3::_canvas_item_render_commands(Item *p_item, Item *cur
glDrawArraysInstanced(GL_TRIANGLE_FAN, 0, 4, amount);
} else {
//split
-
- int stride = sizeof(float) * 4 * 6;
int split = int(Math::ceil(particles->phase * particles->amount));
if (amount - split > 0) {
@@ -1099,12 +1097,12 @@ void RasterizerCanvasGLES3::_canvas_item_render_commands(Item *p_item, Item *cur
points[numpoints] = circle->pos;
int indices[numpoints * 3];
- for (int i = 0; i < numpoints; i++) {
+ for (int j = 0; j < numpoints; j++) {
- points[i] = circle->pos + Vector2(Math::sin(i * Math_PI * 2.0 / numpoints), Math::cos(i * Math_PI * 2.0 / numpoints)) * circle->radius;
- indices[i * 3 + 0] = i;
- indices[i * 3 + 1] = (i + 1) % numpoints;
- indices[i * 3 + 2] = numpoints;
+ points[j] = circle->pos + Vector2(Math::sin(j * Math_PI * 2.0 / numpoints), Math::cos(j * Math_PI * 2.0 / numpoints)) * circle->radius;
+ indices[j * 3 + 0] = j;
+ indices[j * 3 + 1] = (j + 1) % numpoints;
+ indices[j * 3 + 2] = numpoints;
}
_bind_canvas_texture(RID(), RID());
diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp
index d634f8ea76..c66f2ed6ec 100644
--- a/drivers/gles3/rasterizer_scene_gles3.cpp
+++ b/drivers/gles3/rasterizer_scene_gles3.cpp
@@ -3178,10 +3178,10 @@ void RasterizerSceneGLES3::_fill_render_list(InstanceBase **p_cull_result, int p
int ssize = mesh->surfaces.size();
- for (int i = 0; i < ssize; i++) {
+ for (int j = 0; j < ssize; j++) {
- int mat_idx = inst->materials[i].is_valid() ? i : -1;
- RasterizerStorageGLES3::Surface *s = mesh->surfaces[i];
+ int mat_idx = inst->materials[j].is_valid() ? j : -1;
+ RasterizerStorageGLES3::Surface *s = mesh->surfaces[j];
_add_geometry(s, inst, NULL, mat_idx, p_depth_pass, p_shadow_pass);
}
@@ -3202,9 +3202,9 @@ void RasterizerSceneGLES3::_fill_render_list(InstanceBase **p_cull_result, int p
int ssize = mesh->surfaces.size();
- for (int i = 0; i < ssize; i++) {
+ for (int j = 0; j < ssize; j++) {
- RasterizerStorageGLES3::Surface *s = mesh->surfaces[i];
+ RasterizerStorageGLES3::Surface *s = mesh->surfaces[j];
_add_geometry(s, inst, multi_mesh, -1, p_depth_pass, p_shadow_pass);
}
@@ -3222,9 +3222,9 @@ void RasterizerSceneGLES3::_fill_render_list(InstanceBase **p_cull_result, int p
RasterizerStorageGLES3::Particles *particles = storage->particles_owner.getptr(inst->base);
ERR_CONTINUE(!particles);
- for (int i = 0; i < particles->draw_passes.size(); i++) {
+ for (int j = 0; j < particles->draw_passes.size(); j++) {
- RID pmesh = particles->draw_passes[i];
+ RID pmesh = particles->draw_passes[j];
if (!pmesh.is_valid())
continue;
RasterizerStorageGLES3::Mesh *mesh = storage->mesh_owner.get(pmesh);
@@ -3233,9 +3233,9 @@ void RasterizerSceneGLES3::_fill_render_list(InstanceBase **p_cull_result, int p
int ssize = mesh->surfaces.size();
- for (int j = 0; j < ssize; j++) {
+ for (int k = 0; k < ssize; k++) {
- RasterizerStorageGLES3::Surface *s = mesh->surfaces[j];
+ RasterizerStorageGLES3::Surface *s = mesh->surfaces[k];
_add_geometry(s, inst, particles, -1, p_depth_pass, p_shadow_pass);
}
}
@@ -5059,7 +5059,7 @@ void RasterizerSceneGLES3::initialize() {
{ //reflection cubemaps
int max_reflection_cubemap_sampler_size = 512;
- int cube_size = max_reflection_cubemap_sampler_size;
+ int rcube_size = max_reflection_cubemap_sampler_size;
glActiveTexture(GL_TEXTURE0);
@@ -5069,10 +5069,10 @@ void RasterizerSceneGLES3::initialize() {
GLenum format = GL_RGBA;
GLenum type = use_float ? GL_HALF_FLOAT : GL_UNSIGNED_INT_2_10_10_10_REV;
- while (cube_size >= 32) {
+ while (rcube_size >= 32) {
ReflectionCubeMap cube;
- cube.size = cube_size;
+ cube.size = rcube_size;
glGenTextures(1, &cube.depth);
glBindTexture(GL_TEXTURE_2D, cube.depth);
@@ -5111,7 +5111,7 @@ void RasterizerSceneGLES3::initialize() {
reflection_cubemaps.push_back(cube);
- cube_size >>= 1;
+ rcube_size >>= 1;
}
}
diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp
index ce34de1dd8..5189017437 100644
--- a/drivers/gles3/rasterizer_storage_gles3.cpp
+++ b/drivers/gles3/rasterizer_storage_gles3.cpp
@@ -6049,9 +6049,9 @@ void RasterizerStorageGLES3::particles_set_amount(RID p_particles, int p_amount)
glBindBuffer(GL_ARRAY_BUFFER, particles->particle_buffers[i]);
glBufferData(GL_ARRAY_BUFFER, floats * sizeof(float), data, GL_STATIC_DRAW);
- for (int i = 0; i < 6; i++) {
- glEnableVertexAttribArray(i);
- glVertexAttribPointer(i, 4, GL_FLOAT, GL_FALSE, sizeof(float) * 4 * 6, ((uint8_t *)0) + (i * 16));
+ for (int j = 0; j < 6; j++) {
+ glEnableVertexAttribArray(j);
+ glVertexAttribPointer(j, 4, GL_FLOAT, GL_FALSE, sizeof(float) * 4 * 6, ((uint8_t *)0) + (j * 16));
}
}
diff --git a/drivers/pulseaudio/audio_driver_pulseaudio.cpp b/drivers/pulseaudio/audio_driver_pulseaudio.cpp
index 0d98b7fbc0..aec3d27d69 100644
--- a/drivers/pulseaudio/audio_driver_pulseaudio.cpp
+++ b/drivers/pulseaudio/audio_driver_pulseaudio.cpp
@@ -420,7 +420,7 @@ void AudioDriverPulseAudio::thread_func(void *p_udata) {
pa_operation *pa_op = pa_context_get_server_info(ad->pa_ctx, &AudioDriverPulseAudio::pa_server_info_cb, (void *)ad);
if (pa_op) {
while (ad->pa_status == 0) {
- int ret = pa_mainloop_iterate(ad->pa_ml, 1, NULL);
+ ret = pa_mainloop_iterate(ad->pa_ml, 1, NULL);
if (ret < 0) {
ERR_PRINT("pa_mainloop_iterate error");
}
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 {
diff --git a/main/main.cpp b/main/main.cpp
index b81a379dbb..ee13a4bacc 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -1147,8 +1147,8 @@ Error Main::setup2(Thread::ID p_main_tid_override) {
if (boot_logo_path != String()) {
boot_logo.instance();
- Error err = ImageLoader::load_image(boot_logo_path, boot_logo);
- if (err)
+ Error load_err = ImageLoader::load_image(boot_logo_path, boot_logo);
+ if (load_err)
ERR_PRINTS("Non-existing or invalid boot splash at: " + boot_logo_path + ". Loading default splash.");
}
@@ -1548,8 +1548,8 @@ bool Main::start() {
Ref<PackedScene> ps = res;
n = ps->instance();
} else if (res->is_class("Script")) {
- Ref<Script> s = res;
- StringName ibt = s->get_instance_base_type();
+ Ref<Script> script_res = res;
+ StringName ibt = script_res->get_instance_base_type();
bool valid_type = ClassDB::is_parent_class(ibt, "Node");
ERR_EXPLAIN("Script does not inherit a Node: " + path);
ERR_CONTINUE(!valid_type);
@@ -1560,7 +1560,7 @@ bool Main::start() {
ERR_CONTINUE(obj == NULL);
n = Object::cast_to<Node>(obj);
- n->set_script(s.get_ref_ptr());
+ n->set_script(script_res.get_ref_ptr());
}
ERR_EXPLAIN("Path in autoload not a node or script: " + path);
diff --git a/main/tests/test_gdscript.cpp b/main/tests/test_gdscript.cpp
index b0b7fc8357..55e31a18c3 100644
--- a/main/tests/test_gdscript.cpp
+++ b/main/tests/test_gdscript.cpp
@@ -1041,10 +1041,10 @@ MainLoop *test(TestType p_type) {
} else if (p_type == TEST_BYTECODE) {
- Vector<uint8_t> buf = GDScriptTokenizerBuffer::parse_code_string(code);
+ Vector<uint8_t> buf2 = GDScriptTokenizerBuffer::parse_code_string(code);
String dst = test.get_basename() + ".gdc";
FileAccess *fw = FileAccess::open(dst, FileAccess::WRITE);
- fw->store_buffer(buf.ptr(), buf.size());
+ fw->store_buffer(buf2.ptr(), buf2.size());
memdelete(fw);
}
diff --git a/main/tests/test_shader_lang.cpp b/main/tests/test_shader_lang.cpp
index 8441748cc0..dcb19b7df7 100644
--- a/main/tests/test_shader_lang.cpp
+++ b/main/tests/test_shader_lang.cpp
@@ -149,11 +149,11 @@ static String dump_node_code(SL::Node *p_node, int p_level) {
String header;
header = _typestr(fnode->return_type) + " " + fnode->name + "(";
- for (int i = 0; i < fnode->arguments.size(); i++) {
+ for (int j = 0; j < fnode->arguments.size(); j++) {
- if (i > 0)
+ if (j > 0)
header += ", ";
- header += _prestr(fnode->arguments[i].precision) + _typestr(fnode->arguments[i].type) + " " + fnode->arguments[i].name;
+ header += _prestr(fnode->arguments[j].precision) + _typestr(fnode->arguments[j].type) + " " + fnode->arguments[j].name;
}
header += ")\n";
@@ -336,9 +336,9 @@ MainLoop *test() {
print_line("Error at line: " + rtos(sl.get_error_line()) + ": " + sl.get_error_text());
return NULL;
} else {
- String code;
- recreate_code(&code, sl.get_shader());
- print_line("code:\n\n" + code);
+ String code2;
+ recreate_code(&code2, sl.get_shader());
+ print_line("code:\n\n" + code2);
}
return NULL;
diff --git a/methods.py b/methods.py
index 42eac7ca75..d8e90a8da5 100644
--- a/methods.py
+++ b/methods.py
@@ -660,3 +660,10 @@ def detect_darwin_sdk_path(platform, env):
print("Failed to find SDK path while running xcrun --sdk {} --show-sdk-path.".format(sdk_name))
raise
+def get_compiler_version(env):
+ version = decode_utf8(subprocess.check_output([env['CXX'], '--version']).strip())
+ match = re.search('[0-9][0-9.]*', version)
+ if match is not None:
+ return match.group().split('.')
+ else:
+ return None
diff --git a/modules/csg/csg.cpp b/modules/csg/csg.cpp
index a0be0138d3..fb7f829cf0 100644
--- a/modules/csg/csg.cpp
+++ b/modules/csg/csg.cpp
@@ -666,14 +666,14 @@ void CSGBrushOperation::_add_poly_points(const BuildPoly &p_poly, int p_edge, in
if (opposite_point == prev_point)
continue; //not going back
- EdgeSort e;
+ EdgeSort e2;
Vector2 local_vec = t2d.xform(p_poly.points[opposite_point].point);
- e.angle = -local_vec.angle(); //negate so we can sort by minimum angle
- e.edge = edge;
- e.edge_point = opposite_point;
- e.prev_point = to_point;
+ e2.angle = -local_vec.angle(); //negate so we can sort by minimum angle
+ e2.edge = edge;
+ e2.edge_point = opposite_point;
+ e2.prev_point = to_point;
- next_edges.push_back(e);
+ next_edges.push_back(e2);
}
//finally, sort by minimum angle
diff --git a/modules/dds/texture_loader_dds.cpp b/modules/dds/texture_loader_dds.cpp
index a063942269..0a94690989 100644
--- a/modules/dds/texture_loader_dds.cpp
+++ b/modules/dds/texture_loader_dds.cpp
@@ -263,14 +263,14 @@ RES ResourceFormatDDS::load(const String &p_path, const String &p_original_path,
colsize = 4;
}
- int w = width;
- int h = height;
+ int w2 = width;
+ int h2 = height;
for (uint32_t i = 1; i < mipmaps; i++) {
- w = (w + 1) >> 1;
- h = (h + 1) >> 1;
- size += w * h * info.block_size;
+ w2 = (w2 + 1) >> 1;
+ h2 = (h2 + 1) >> 1;
+ size += w2 * h2 * info.block_size;
}
src_data.resize(size + 256 * colsize);
diff --git a/modules/gdnative/register_types.cpp b/modules/gdnative/register_types.cpp
index b38de75caa..2094dca6e4 100644
--- a/modules/gdnative/register_types.cpp
+++ b/modules/gdnative/register_types.cpp
@@ -125,8 +125,8 @@ static void actual_discoverer_handler() {
// Check for removed files
if (!changed) {
- for (int i = 0; i < current_files.size(); i++) {
- if (!file_paths.has(current_files[i])) {
+ for (int j = 0; j < current_files.size(); j++) {
+ if (!file_paths.has(current_files[j])) {
changed = true;
break;
}
diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp
index f29432666e..dd9b36fd8c 100644
--- a/modules/gdscript/gdscript.cpp
+++ b/modules/gdscript/gdscript.cpp
@@ -1108,12 +1108,12 @@ void GDScriptInstance::get_property_list(List<PropertyInfo> *p_properties) const
//instance a fake script for editing the values
Vector<_GDScriptMemberSort> msort;
- for (Map<StringName, PropertyInfo>::Element *E = sptr->member_info.front(); E; E = E->next()) {
+ for (Map<StringName, PropertyInfo>::Element *F = sptr->member_info.front(); F; F = F->next()) {
_GDScriptMemberSort ms;
- ERR_CONTINUE(!sptr->member_indices.has(E->key()));
- ms.index = sptr->member_indices[E->key()].index;
- ms.name = E->key();
+ ERR_CONTINUE(!sptr->member_indices.has(F->key()));
+ ms.index = sptr->member_indices[F->key()].index;
+ ms.name = F->key();
msort.push_back(ms);
}
diff --git a/modules/gdscript/gdscript_compiler.cpp b/modules/gdscript/gdscript_compiler.cpp
index d256918b22..b2b7b1c260 100644
--- a/modules/gdscript/gdscript_compiler.cpp
+++ b/modules/gdscript/gdscript_compiler.cpp
@@ -1360,15 +1360,15 @@ Error GDScriptCompiler::_parse_block(CodeGen &codegen, const GDScriptParser::Blo
// jump unconditionally
// continue address
// compile the condition
- int ret = _parse_expression(codegen, branch.compiled_pattern, p_stack_level);
- if (ret < 0) {
+ int ret2 = _parse_expression(codegen, branch.compiled_pattern, p_stack_level);
+ if (ret2 < 0) {
memdelete(id);
memdelete(op);
return ERR_PARSE_ERROR;
}
codegen.opcodes.push_back(GDScriptFunction::OPCODE_JUMP_IF);
- codegen.opcodes.push_back(ret);
+ codegen.opcodes.push_back(ret2);
codegen.opcodes.push_back(codegen.opcodes.size() + 3);
int continue_addr = codegen.opcodes.size();
codegen.opcodes.push_back(GDScriptFunction::OPCODE_JUMP);
@@ -1401,12 +1401,12 @@ Error GDScriptCompiler::_parse_block(CodeGen &codegen, const GDScriptParser::Blo
codegen.opcodes.push_back(cf->line);
codegen.current_line = cf->line;
#endif
- int ret = _parse_expression(codegen, cf->arguments[0], p_stack_level, false);
- if (ret < 0)
+ int ret2 = _parse_expression(codegen, cf->arguments[0], p_stack_level, false);
+ if (ret2 < 0)
return ERR_PARSE_ERROR;
codegen.opcodes.push_back(GDScriptFunction::OPCODE_JUMP_IF_NOT);
- codegen.opcodes.push_back(ret);
+ codegen.opcodes.push_back(ret2);
int else_addr = codegen.opcodes.size();
codegen.opcodes.push_back(0); //temporary
@@ -1421,9 +1421,9 @@ Error GDScriptCompiler::_parse_block(CodeGen &codegen, const GDScriptParser::Blo
codegen.opcodes.push_back(0);
codegen.opcodes.write[else_addr] = codegen.opcodes.size();
- Error err = _parse_block(codegen, cf->body_else, p_stack_level, p_break_addr, p_continue_addr);
- if (err)
- return err;
+ Error err2 = _parse_block(codegen, cf->body_else, p_stack_level, p_break_addr, p_continue_addr);
+ if (err2)
+ return err2;
codegen.opcodes.write[end_addr] = codegen.opcodes.size();
} else {
@@ -1444,14 +1444,14 @@ Error GDScriptCompiler::_parse_block(CodeGen &codegen, const GDScriptParser::Blo
codegen.push_stack_identifiers();
codegen.add_stack_identifier(static_cast<const GDScriptParser::IdentifierNode *>(cf->arguments[0])->name, iter_stack_pos);
- int ret = _parse_expression(codegen, cf->arguments[1], slevel, false);
- if (ret < 0)
+ int ret2 = _parse_expression(codegen, cf->arguments[1], slevel, false);
+ if (ret2 < 0)
return ERR_COMPILATION_FAILED;
//assign container
codegen.opcodes.push_back(GDScriptFunction::OPCODE_ASSIGN);
codegen.opcodes.push_back(container_pos);
- codegen.opcodes.push_back(ret);
+ codegen.opcodes.push_back(ret2);
//begin loop
codegen.opcodes.push_back(GDScriptFunction::OPCODE_ITERATE_BEGIN);
@@ -1493,11 +1493,11 @@ Error GDScriptCompiler::_parse_block(CodeGen &codegen, const GDScriptParser::Blo
codegen.opcodes.push_back(0);
int continue_addr = codegen.opcodes.size();
- int ret = _parse_expression(codegen, cf->arguments[0], p_stack_level, false);
- if (ret < 0)
+ int ret2 = _parse_expression(codegen, cf->arguments[0], p_stack_level, false);
+ if (ret2 < 0)
return ERR_PARSE_ERROR;
codegen.opcodes.push_back(GDScriptFunction::OPCODE_JUMP_IF_NOT);
- codegen.opcodes.push_back(ret);
+ codegen.opcodes.push_back(ret2);
codegen.opcodes.push_back(break_addr);
Error err = _parse_block(codegen, cf->body, p_stack_level, break_addr, continue_addr);
if (err)
@@ -1533,21 +1533,21 @@ Error GDScriptCompiler::_parse_block(CodeGen &codegen, const GDScriptParser::Blo
} break;
case GDScriptParser::ControlFlowNode::CF_RETURN: {
- int ret;
+ int ret2;
if (cf->arguments.size()) {
- ret = _parse_expression(codegen, cf->arguments[0], p_stack_level, false);
- if (ret < 0)
+ ret2 = _parse_expression(codegen, cf->arguments[0], p_stack_level, false);
+ if (ret2 < 0)
return ERR_PARSE_ERROR;
} else {
- ret = GDScriptFunction::ADDR_TYPE_NIL << GDScriptFunction::ADDR_BITS;
+ ret2 = GDScriptFunction::ADDR_TYPE_NIL << GDScriptFunction::ADDR_BITS;
}
codegen.opcodes.push_back(GDScriptFunction::OPCODE_RETURN);
- codegen.opcodes.push_back(ret);
+ codegen.opcodes.push_back(ret2);
} break;
}
@@ -1558,12 +1558,12 @@ Error GDScriptCompiler::_parse_block(CodeGen &codegen, const GDScriptParser::Blo
const GDScriptParser::AssertNode *as = static_cast<const GDScriptParser::AssertNode *>(s);
- int ret = _parse_expression(codegen, as->condition, p_stack_level, false);
- if (ret < 0)
+ int ret2 = _parse_expression(codegen, as->condition, p_stack_level, false);
+ if (ret2 < 0)
return ERR_PARSE_ERROR;
codegen.opcodes.push_back(GDScriptFunction::OPCODE_ASSERT);
- codegen.opcodes.push_back(ret);
+ codegen.opcodes.push_back(ret2);
#endif
} break;
case GDScriptParser::Node::TYPE_BREAKPOINT: {
@@ -1590,8 +1590,8 @@ Error GDScriptCompiler::_parse_block(CodeGen &codegen, const GDScriptParser::Blo
} break;
default: {
//expression
- int ret = _parse_expression(codegen, s, p_stack_level, true);
- if (ret < 0)
+ int ret2 = _parse_expression(codegen, s, p_stack_level, true);
+ if (ret2 < 0)
return ERR_PARSE_ERROR;
} break;
}
@@ -2116,8 +2116,8 @@ Error GDScriptCompiler::_parse_class_blocks(GDScript *p_script, const GDScriptPa
instance->owner = E->get();
//needed for hot reloading
- for (Map<StringName, GDScript::MemberInfo>::Element *E = p_script->member_indices.front(); E; E = E->next()) {
- instance->member_indices_cache[E->key()] = E->get().index;
+ for (Map<StringName, GDScript::MemberInfo>::Element *F = p_script->member_indices.front(); F; F = F->next()) {
+ instance->member_indices_cache[F->key()] = F->get().index;
}
instance->owner->set_script_instance(instance);
diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp
index af770ac533..fafc73b7e6 100644
--- a/modules/gdscript/gdscript_editor.cpp
+++ b/modules/gdscript/gdscript_editor.cpp
@@ -785,12 +785,12 @@ static bool _guess_expression_type(GDScriptCompletionContext &p_context, const G
if (mb && mb->is_const()) {
bool all_is_const = true;
Vector<Variant> args;
- GDScriptCompletionContext c = p_context;
- c.line = op->line;
+ GDScriptCompletionContext c2 = p_context;
+ c2.line = op->line;
for (int i = 2; all_is_const && i < op->arguments.size(); i++) {
GDScriptCompletionIdentifier arg;
- if (_guess_expression_type(c, op->arguments[i], arg)) {
+ if (_guess_expression_type(c2, op->arguments[i], arg)) {
if (arg.type.has_type && arg.type.is_constant && arg.value.get_type() != Variant::OBJECT) {
args.push_back(arg.value);
} else {
@@ -1282,9 +1282,9 @@ static bool _guess_identifier_type(GDScriptCompletionContext &p_context, const S
for (List<MethodInfo>::Element *E = methods.front(); E; E = E->next()) {
if (E->get().name == p_context.function->name) {
MethodInfo &mi = E->get();
- for (List<PropertyInfo>::Element *E = mi.arguments.front(); E; E = E->next()) {
- if (E->get().name == p_identifier) {
- r_type = _type_from_property(E->get());
+ for (List<PropertyInfo>::Element *F = mi.arguments.front(); F; F = F->next()) {
+ if (F->get().name == p_identifier) {
+ r_type = _type_from_property(F->get());
return true;
}
}
@@ -2237,8 +2237,8 @@ static void _find_call_arguments(const GDScriptCompletionContext &p_context, con
if (obj) {
List<String> options;
obj->get_argument_options(p_method, p_argidx, &options);
- for (List<String>::Element *E = options.front(); E; E = E->next()) {
- r_result.insert(E->get());
+ for (List<String>::Element *F = options.front(); F; F = F->next()) {
+ r_result.insert(F->get());
}
}
}
@@ -2806,12 +2806,12 @@ Error GDScriptLanguage::complete_code(const String &p_code, const String &p_base
if (base_type.class_type) {
for (Map<StringName, GDScriptParser::ClassNode::Constant>::Element *E = base_type.class_type->constant_expressions.front(); E; E = E->next()) {
GDScriptCompletionIdentifier constant;
- GDScriptCompletionContext c = context;
- c._class = base_type.class_type;
- c.function = NULL;
- c.block = NULL;
- c.line = E->value().expression->line;
- if (_guess_expression_type(c, E->value().expression, constant)) {
+ GDScriptCompletionContext c2 = context;
+ c2._class = base_type.class_type;
+ c2.function = NULL;
+ c2.block = NULL;
+ c2.line = E->value().expression->line;
+ if (_guess_expression_type(c2, E->value().expression, constant)) {
if (constant.type.has_type && constant.type.is_meta_type) {
options.insert(E->key().operator String());
}
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp
index b53d37226c..a642abeb0a 100644
--- a/modules/gdscript/gdscript_parser.cpp
+++ b/modules/gdscript/gdscript_parser.cpp
@@ -2640,14 +2640,14 @@ void GDScriptParser::_transform_match_statment(MatchNode *p_match_statement) {
local_var->assign = e->value();
local_var->set_datatype(local_var->assign->get_datatype());
- IdentifierNode *id = alloc_node<IdentifierNode>();
- id->name = local_var->name;
- id->declared_block = branch->body;
- id->set_datatype(local_var->assign->get_datatype());
+ IdentifierNode *id2 = alloc_node<IdentifierNode>();
+ id2->name = local_var->name;
+ id2->declared_block = branch->body;
+ id2->set_datatype(local_var->assign->get_datatype());
OperatorNode *op = alloc_node<OperatorNode>();
op->op = OperatorNode::OP_ASSIGN;
- op->arguments.push_back(id);
+ op->arguments.push_back(id2);
op->arguments.push_back(local_var->assign);
branch->body->statements.push_front(op);
@@ -2694,9 +2694,9 @@ void GDScriptParser::_parse_block(BlockNode *p_block, bool p_static) {
if (pending_newline != -1) {
- NewLineNode *nl = alloc_node<NewLineNode>();
- nl->line = pending_newline;
- p_block->statements.push_back(nl);
+ NewLineNode *nl2 = alloc_node<NewLineNode>();
+ nl2->line = pending_newline;
+ p_block->statements.push_back(nl2);
pending_newline = -1;
}
@@ -2735,9 +2735,9 @@ void GDScriptParser::_parse_block(BlockNode *p_block, bool p_static) {
return;
}
- NewLineNode *nl = alloc_node<NewLineNode>();
- nl->line = tokenizer->get_token_line();
- p_block->statements.push_back(nl);
+ NewLineNode *nl2 = alloc_node<NewLineNode>();
+ nl2->line = tokenizer->get_token_line();
+ p_block->statements.push_back(nl2);
} break;
case GDScriptTokenizer::TK_CF_PASS: {
@@ -2922,14 +2922,14 @@ void GDScriptParser::_parse_block(BlockNode *p_block, bool p_static) {
cf_else->cf_type = ControlFlowNode::CF_IF;
//condition
- Node *condition = _parse_and_reduce_expression(p_block, p_static);
- if (!condition) {
+ Node *condition2 = _parse_and_reduce_expression(p_block, p_static);
+ if (!condition2) {
if (_recover_from_completion()) {
break;
}
return;
}
- cf_else->arguments.push_back(condition);
+ cf_else->arguments.push_back(condition2);
cf_else->cf_type = ControlFlowNode::CF_IF;
cf_if->body_else->statements.push_back(cf_else);
@@ -2992,8 +2992,8 @@ void GDScriptParser::_parse_block(BlockNode *p_block, bool p_static) {
case GDScriptTokenizer::TK_CF_WHILE: {
tokenizer->advance();
- Node *condition = _parse_and_reduce_expression(p_block, p_static);
- if (!condition) {
+ Node *condition2 = _parse_and_reduce_expression(p_block, p_static);
+ if (!condition2) {
if (_recover_from_completion()) {
break;
}
@@ -3003,7 +3003,7 @@ void GDScriptParser::_parse_block(BlockNode *p_block, bool p_static) {
ControlFlowNode *cf_while = alloc_node<ControlFlowNode>();
cf_while->cf_type = ControlFlowNode::CF_WHILE;
- cf_while->arguments.push_back(condition);
+ cf_while->arguments.push_back(condition2);
cf_while->body = alloc_node<BlockNode>();
cf_while->body->parent_block = p_block;
@@ -4705,12 +4705,12 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
op->arguments.push_back(subexpr);
#ifdef DEBUG_ENABLED
- NewLineNode *nl = alloc_node<NewLineNode>();
- nl->line = line;
+ NewLineNode *nl2 = alloc_node<NewLineNode>();
+ nl2->line = line;
if (onready)
- p_class->ready->statements.push_back(nl);
+ p_class->ready->statements.push_back(nl2);
else
- p_class->initializer->statements.push_back(nl);
+ p_class->initializer->statements.push_back(nl2);
#endif
if (onready)
p_class->ready->statements.push_back(op);
@@ -4732,8 +4732,8 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
ConstantNode *cn = alloc_node<ConstantNode>();
- Variant::CallError ce;
- cn->value = Variant::construct(member._export.type, NULL, 0, ce);
+ Variant::CallError ce2;
+ cn->value = Variant::construct(member._export.type, NULL, 0, ce2);
OperatorNode *op = alloc_node<OperatorNode>();
op->op = OperatorNode::OP_INIT_ASSIGN;
@@ -5523,10 +5523,10 @@ GDScriptParser::DataType GDScriptParser::_resolve_type(const DataType &p_source,
result.script_type = gds;
found = true;
} else {
- Ref<Script> scr = constants[id];
- if (scr.is_valid()) {
+ Ref<Script> scr2 = constants[id];
+ if (scr2.is_valid()) {
result.kind = DataType::SCRIPT;
- result.script_type = scr;
+ result.script_type = scr2;
found = true;
}
}
@@ -6646,7 +6646,7 @@ GDScriptParser::DataType GDScriptParser::_reduce_function_call_type(const Operat
bool match = false;
List<MethodInfo> constructors;
Variant::get_constructor_list(tn->vtype, &constructors);
- PropertyInfo return_type;
+ PropertyInfo return_type2;
for (List<MethodInfo>::Element *E = constructors.front(); E; E = E->next()) {
MethodInfo &mi = E->get();
@@ -6685,13 +6685,13 @@ GDScriptParser::DataType GDScriptParser::_reduce_function_call_type(const Operat
if (types_match) {
match = true;
- return_type = mi.return_val;
+ return_type2 = mi.return_val;
break;
}
}
if (match) {
- return _type_from_property(return_type, false);
+ return _type_from_property(return_type2, false);
} else if (check_types) {
String err = "No constructor of '";
err += Variant::get_type_name(tn->vtype);
@@ -7603,7 +7603,7 @@ void GDScriptParser::_check_function_types(FunctionNode *p_function) {
}
parent_signature += " " + p_function->name + "(";
if (arg_types.size()) {
- int i = 0;
+ int j = 0;
for (List<DataType>::Element *E = arg_types.front(); E; E = E->next()) {
if (E != arg_types.front()) {
parent_signature += ", ";
@@ -7613,11 +7613,11 @@ void GDScriptParser::_check_function_types(FunctionNode *p_function) {
arg = "Variant";
}
parent_signature += arg;
- if (i == arg_types.size() - default_arg_count) {
+ if (j == arg_types.size() - default_arg_count) {
parent_signature += "=default";
}
- i++;
+ j++;
}
}
parent_signature += ")";
diff --git a/modules/gdscript/gdscript_tokenizer.cpp b/modules/gdscript/gdscript_tokenizer.cpp
index 0f2f0bbb26..dc9f2db331 100644
--- a/modules/gdscript/gdscript_tokenizer.cpp
+++ b/modules/gdscript/gdscript_tokenizer.cpp
@@ -989,11 +989,11 @@ void GDScriptTokenizerText::_advance() {
//built in func?
- for (int i = 0; i < GDScriptFunctions::FUNC_MAX; i++) {
+ for (int j = 0; j < GDScriptFunctions::FUNC_MAX; j++) {
- if (str == GDScriptFunctions::get_func_name(GDScriptFunctions::Function(i))) {
+ if (str == GDScriptFunctions::get_func_name(GDScriptFunctions::Function(j))) {
- _make_built_in_func(GDScriptFunctions::Function(i));
+ _make_built_in_func(GDScriptFunctions::Function(j));
found = true;
break;
}
diff --git a/modules/gridmap/grid_map_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp
index 12c4a18a64..fb98755444 100644
--- a/modules/gridmap/grid_map_editor_plugin.cpp
+++ b/modules/gridmap/grid_map_editor_plugin.cpp
@@ -289,11 +289,11 @@ void GridMapEditor::_update_selection_transform() {
scale *= node->get_cell_size();
pos *= node->get_cell_size();
- Transform xf;
- xf.basis.scale(scale);
- xf.origin = pos;
+ Transform xf2;
+ xf2.basis.scale(scale);
+ xf2.origin = pos;
- VisualServer::get_singleton()->instance_set_transform(selection_level_instance[i], xf);
+ VisualServer::get_singleton()->instance_set_transform(selection_level_instance[i], xf2);
}
}
}
diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp
index 9c127b837d..51615df64e 100644
--- a/modules/mono/csharp_script.cpp
+++ b/modules/mono/csharp_script.cpp
@@ -719,13 +719,13 @@ void CSharpLanguage::reload_assemblies(bool p_soft_reload) {
// Script::instances are deleted during managed object disposal, which happens on domain finalize.
// Only placeholders are kept. Therefore we need to keep a copy before that happens.
- for (Set<Object *>::Element *E = script->instances.front(); E; E = E->next()) {
- script->pending_reload_instances.insert(E->get()->get_instance_id());
+ for (Set<Object *>::Element *F = script->instances.front(); F; F = F->next()) {
+ script->pending_reload_instances.insert(F->get()->get_instance_id());
}
#ifdef TOOLS_ENABLED
- for (Set<PlaceHolderScriptInstance *>::Element *E = script->placeholders.front(); E; E = E->next()) {
- script->pending_reload_instances.insert(E->get()->get_owner()->get_instance_id());
+ for (Set<PlaceHolderScriptInstance *>::Element *F = script->placeholders.front(); F; F = F->next()) {
+ script->pending_reload_instances.insert(F->get()->get_owner()->get_instance_id());
}
#endif
diff --git a/modules/mono/editor/bindings_generator.cpp b/modules/mono/editor/bindings_generator.cpp
index 2161b15591..cffccd5cb5 100644
--- a/modules/mono/editor/bindings_generator.cpp
+++ b/modules/mono/editor/bindings_generator.cpp
@@ -365,8 +365,8 @@ void BindingsGenerator::_generate_global_constants(List<String> &p_output) {
p_output.push_back(enum_proxy_name);
p_output.push_back("\n" INDENT1 OPEN_BLOCK);
- for (const List<ConstantInterface>::Element *E = ienum.constants.front(); E; E = E->next()) {
- const ConstantInterface &iconstant = E->get();
+ for (const List<ConstantInterface>::Element *F = ienum.constants.front(); F; F = F->next()) {
+ const ConstantInterface &iconstant = F->get();
if (iconstant.const_doc && iconstant.const_doc->description.size()) {
p_output.push_back(INDENT2 "/// <summary>\n");
@@ -389,7 +389,7 @@ void BindingsGenerator::_generate_global_constants(List<String> &p_output) {
p_output.push_back(iconstant.proxy_name);
p_output.push_back(" = ");
p_output.push_back(itos(iconstant.value));
- p_output.push_back(E != ienum.constants.back() ? ",\n" : "\n");
+ p_output.push_back(F != ienum.constants.back() ? ",\n" : "\n");
}
p_output.push_back(INDENT1 CLOSE_BLOCK);
@@ -472,8 +472,6 @@ Error BindingsGenerator::generate_cs_core_project(const String &p_solution_dir,
String output_dir = output_file.get_base_dir();
if (!DirAccess::exists(output_dir)) {
- DirAccessRef da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
- ERR_FAIL_COND_V(!da, ERR_CANT_CREATE);
Error err = da->make_dir_recursive(ProjectSettings::get_singleton()->globalize_path(output_dir));
ERR_FAIL_COND_V(err != OK, ERR_CANT_CREATE);
}
@@ -806,8 +804,8 @@ Error BindingsGenerator::_generate_cs_type(const TypeInterface &itype, const Str
output.push_back(ienum.cname.operator String());
output.push_back(MEMBER_BEGIN OPEN_BLOCK);
- for (const List<ConstantInterface>::Element *E = ienum.constants.front(); E; E = E->next()) {
- const ConstantInterface &iconstant = E->get();
+ for (const List<ConstantInterface>::Element *F = ienum.constants.front(); F; F = F->next()) {
+ const ConstantInterface &iconstant = F->get();
if (iconstant.const_doc && iconstant.const_doc->description.size()) {
output.push_back(INDENT3 "/// <summary>\n");
@@ -830,7 +828,7 @@ Error BindingsGenerator::_generate_cs_type(const TypeInterface &itype, const Str
output.push_back(iconstant.proxy_name);
output.push_back(" = ");
output.push_back(itos(iconstant.value));
- output.push_back(E != ienum.constants.back() ? ",\n" : "\n");
+ output.push_back(F != ienum.constants.back() ? ",\n" : "\n");
}
output.push_back(INDENT2 CLOSE_BLOCK);
@@ -1889,8 +1887,8 @@ void BindingsGenerator::_populate_object_type_interfaces() {
}
if (!imethod.is_virtual && imethod.name[0] == '_') {
- for (const List<PropertyInterface>::Element *E = itype.properties.front(); E; E = E->next()) {
- const PropertyInterface &iprop = E->get();
+ for (const List<PropertyInterface>::Element *F = itype.properties.front(); F; F = F->next()) {
+ const PropertyInterface &iprop = F->get();
if (iprop.setter == imethod.name || iprop.getter == imethod.name) {
imethod.is_internal = true;
@@ -2352,9 +2350,9 @@ void BindingsGenerator::_populate_global_constants() {
if (enum_name != StringName()) {
EnumInterface ienum(enum_name);
- List<EnumInterface>::Element *match = global_enums.find(ienum);
- if (match) {
- match->get().constants.push_back(iconstant);
+ List<EnumInterface>::Element *enum_match = global_enums.find(ienum);
+ if (enum_match) {
+ enum_match->get().constants.push_back(iconstant);
} else {
ienum.constants.push_back(iconstant);
global_enums.push_back(ienum);
diff --git a/modules/mono/editor/godotsharp_export.cpp b/modules/mono/editor/godotsharp_export.cpp
index 7e2487a6e7..ee5fed1a0c 100644
--- a/modules/mono/editor/godotsharp_export.cpp
+++ b/modules/mono/editor/godotsharp_export.cpp
@@ -194,8 +194,8 @@ Error GodotSharpExport::_get_assembly_dependencies(GDMonoAssembly *p_assembly, c
String path;
bool has_extension = ref_name.ends_with(".dll") || ref_name.ends_with(".exe");
- for (int i = 0; i < p_search_dirs.size(); i++) {
- const String &search_dir = p_search_dirs[i];
+ for (int j = 0; j < p_search_dirs.size(); j++) {
+ const String &search_dir = p_search_dirs[j];
if (has_extension) {
path = search_dir.plus_file(ref_name);
diff --git a/modules/mono/editor/script_class_parser.cpp b/modules/mono/editor/script_class_parser.cpp
index 1281ed669f..53a043b675 100644
--- a/modules/mono/editor/script_class_parser.cpp
+++ b/modules/mono/editor/script_class_parser.cpp
@@ -346,7 +346,7 @@ Error ScriptClassParser::_parse_class_base(Vector<String> &r_base) {
bool generic = false;
if (tk == TK_OP_LESS) {
- Error err = _skip_generic_type_params();
+ err = _skip_generic_type_params();
if (err)
return err;
// We don't add it to the base list if it's generic
@@ -355,11 +355,11 @@ Error ScriptClassParser::_parse_class_base(Vector<String> &r_base) {
}
if (tk == TK_COMMA) {
- Error err = _parse_class_base(r_base);
+ err = _parse_class_base(r_base);
if (err)
return err;
} else if (tk == TK_IDENTIFIER && String(value) == "where") {
- Error err = _parse_type_constraints();
+ err = _parse_type_constraints();
if (err) {
return err;
}
diff --git a/modules/mono/mono_gd/gd_mono_internals.cpp b/modules/mono/mono_gd/gd_mono_internals.cpp
index 14ec24466b..c8cba5cf1b 100644
--- a/modules/mono/mono_gd/gd_mono_internals.cpp
+++ b/modules/mono/mono_gd/gd_mono_internals.cpp
@@ -75,14 +75,14 @@ void tie_managed_to_unmanaged(MonoObject *managed, Object *unmanaged) {
script_binding.wrapper_class = klass;
script_binding.gchandle = MonoGCHandle::create_strong(managed);
- Reference *ref = Object::cast_to<Reference>(unmanaged);
- if (ref) {
+ Reference *kref = Object::cast_to<Reference>(unmanaged);
+ if (kref) {
// Unsafe refcount increment. The managed instance also counts as a reference.
// This way if the unmanaged world has no references to our owner
// but the managed instance is alive, the refcount will be 1 instead of 0.
// See: godot_icall_Reference_Dtor(MonoObject *p_obj, Object *p_ptr)
- ref->reference();
+ kref->reference();
}
// The object was just created, no script instance binding should have been attached
@@ -96,8 +96,7 @@ void tie_managed_to_unmanaged(MonoObject *managed, Object *unmanaged) {
return;
}
- Ref<MonoGCHandle> gchandle = ref ? MonoGCHandle::create_weak(managed) :
- MonoGCHandle::create_strong(managed);
+ Ref<MonoGCHandle> gchandle = ref ? MonoGCHandle::create_weak(managed) : MonoGCHandle::create_strong(managed);
Ref<CSharpScript> script = CSharpScript::create_for_managed_type(klass, native);
diff --git a/modules/mono/mono_gd/gd_mono_marshal.cpp b/modules/mono/mono_gd/gd_mono_marshal.cpp
index 18a49d0d1f..7fe8ae608a 100644
--- a/modules/mono/mono_gd/gd_mono_marshal.cpp
+++ b/modules/mono/mono_gd/gd_mono_marshal.cpp
@@ -68,39 +68,39 @@ Variant::Type managed_to_variant_type(const ManagedType &p_type) {
} break;
case MONO_TYPE_VALUETYPE: {
- GDMonoClass *tclass = p_type.type_class;
+ GDMonoClass *vtclass = p_type.type_class;
- if (tclass == CACHED_CLASS(Vector2))
+ if (vtclass == CACHED_CLASS(Vector2))
return Variant::VECTOR2;
- if (tclass == CACHED_CLASS(Rect2))
+ if (vtclass == CACHED_CLASS(Rect2))
return Variant::RECT2;
- if (tclass == CACHED_CLASS(Transform2D))
+ if (vtclass == CACHED_CLASS(Transform2D))
return Variant::TRANSFORM2D;
- if (tclass == CACHED_CLASS(Vector3))
+ if (vtclass == CACHED_CLASS(Vector3))
return Variant::VECTOR3;
- if (tclass == CACHED_CLASS(Basis))
+ if (vtclass == CACHED_CLASS(Basis))
return Variant::BASIS;
- if (tclass == CACHED_CLASS(Quat))
+ if (vtclass == CACHED_CLASS(Quat))
return Variant::QUAT;
- if (tclass == CACHED_CLASS(Transform))
+ if (vtclass == CACHED_CLASS(Transform))
return Variant::TRANSFORM;
- if (tclass == CACHED_CLASS(AABB))
+ if (vtclass == CACHED_CLASS(AABB))
return Variant::AABB;
- if (tclass == CACHED_CLASS(Color))
+ if (vtclass == CACHED_CLASS(Color))
return Variant::COLOR;
- if (tclass == CACHED_CLASS(Plane))
+ if (vtclass == CACHED_CLASS(Plane))
return Variant::PLANE;
- if (mono_class_is_enum(tclass->get_mono_ptr()))
+ if (mono_class_is_enum(vtclass->get_mono_ptr()))
return Variant::INT;
} break;
@@ -294,60 +294,60 @@ MonoObject *variant_to_mono_object(const Variant *p_var, const ManagedType &p_ty
} break;
case MONO_TYPE_VALUETYPE: {
- GDMonoClass *tclass = p_type.type_class;
+ GDMonoClass *vtclass = p_type.type_class;
- if (tclass == CACHED_CLASS(Vector2)) {
+ if (vtclass == CACHED_CLASS(Vector2)) {
GDMonoMarshal::M_Vector2 from = MARSHALLED_OUT(Vector2, p_var->operator ::Vector2());
return mono_value_box(mono_domain_get(), CACHED_CLASS_RAW(Vector2), &from);
}
- if (tclass == CACHED_CLASS(Rect2)) {
+ if (vtclass == CACHED_CLASS(Rect2)) {
GDMonoMarshal::M_Rect2 from = MARSHALLED_OUT(Rect2, p_var->operator ::Rect2());
return mono_value_box(mono_domain_get(), CACHED_CLASS_RAW(Rect2), &from);
}
- if (tclass == CACHED_CLASS(Transform2D)) {
+ if (vtclass == CACHED_CLASS(Transform2D)) {
GDMonoMarshal::M_Transform2D from = MARSHALLED_OUT(Transform2D, p_var->operator ::Transform2D());
return mono_value_box(mono_domain_get(), CACHED_CLASS_RAW(Transform2D), &from);
}
- if (tclass == CACHED_CLASS(Vector3)) {
+ if (vtclass == CACHED_CLASS(Vector3)) {
GDMonoMarshal::M_Vector3 from = MARSHALLED_OUT(Vector3, p_var->operator ::Vector3());
return mono_value_box(mono_domain_get(), CACHED_CLASS_RAW(Vector3), &from);
}
- if (tclass == CACHED_CLASS(Basis)) {
+ if (vtclass == CACHED_CLASS(Basis)) {
GDMonoMarshal::M_Basis from = MARSHALLED_OUT(Basis, p_var->operator ::Basis());
return mono_value_box(mono_domain_get(), CACHED_CLASS_RAW(Basis), &from);
}
- if (tclass == CACHED_CLASS(Quat)) {
+ if (vtclass == CACHED_CLASS(Quat)) {
GDMonoMarshal::M_Quat from = MARSHALLED_OUT(Quat, p_var->operator ::Quat());
return mono_value_box(mono_domain_get(), CACHED_CLASS_RAW(Quat), &from);
}
- if (tclass == CACHED_CLASS(Transform)) {
+ if (vtclass == CACHED_CLASS(Transform)) {
GDMonoMarshal::M_Transform from = MARSHALLED_OUT(Transform, p_var->operator ::Transform());
return mono_value_box(mono_domain_get(), CACHED_CLASS_RAW(Transform), &from);
}
- if (tclass == CACHED_CLASS(AABB)) {
+ if (vtclass == CACHED_CLASS(AABB)) {
GDMonoMarshal::M_AABB from = MARSHALLED_OUT(AABB, p_var->operator ::AABB());
return mono_value_box(mono_domain_get(), CACHED_CLASS_RAW(AABB), &from);
}
- if (tclass == CACHED_CLASS(Color)) {
+ if (vtclass == CACHED_CLASS(Color)) {
GDMonoMarshal::M_Color from = MARSHALLED_OUT(Color, p_var->operator ::Color());
return mono_value_box(mono_domain_get(), CACHED_CLASS_RAW(Color), &from);
}
- if (tclass == CACHED_CLASS(Plane)) {
+ if (vtclass == CACHED_CLASS(Plane)) {
GDMonoMarshal::M_Plane from = MARSHALLED_OUT(Plane, p_var->operator ::Plane());
return mono_value_box(mono_domain_get(), CACHED_CLASS_RAW(Plane), &from);
}
- if (mono_class_is_enum(tclass->get_mono_ptr())) {
- MonoType *enum_basetype = mono_class_enum_basetype(tclass->get_mono_ptr());
+ if (mono_class_is_enum(vtclass->get_mono_ptr())) {
+ MonoType *enum_basetype = mono_class_enum_basetype(vtclass->get_mono_ptr());
MonoClass *enum_baseclass = mono_class_from_mono_type(enum_basetype);
switch (mono_type_get_type(enum_basetype)) {
case MONO_TYPE_BOOLEAN: {
@@ -624,39 +624,39 @@ Variant mono_object_to_variant(MonoObject *p_obj) {
} break;
case MONO_TYPE_VALUETYPE: {
- GDMonoClass *tclass = type.type_class;
+ GDMonoClass *vtclass = type.type_class;
- if (tclass == CACHED_CLASS(Vector2))
+ if (vtclass == CACHED_CLASS(Vector2))
return MARSHALLED_IN(Vector2, (GDMonoMarshal::M_Vector2 *)mono_object_unbox(p_obj));
- if (tclass == CACHED_CLASS(Rect2))
+ if (vtclass == CACHED_CLASS(Rect2))
return MARSHALLED_IN(Rect2, (GDMonoMarshal::M_Rect2 *)mono_object_unbox(p_obj));
- if (tclass == CACHED_CLASS(Transform2D))
+ if (vtclass == CACHED_CLASS(Transform2D))
return MARSHALLED_IN(Transform2D, (GDMonoMarshal::M_Transform2D *)mono_object_unbox(p_obj));
- if (tclass == CACHED_CLASS(Vector3))
+ if (vtclass == CACHED_CLASS(Vector3))
return MARSHALLED_IN(Vector3, (GDMonoMarshal::M_Vector3 *)mono_object_unbox(p_obj));
- if (tclass == CACHED_CLASS(Basis))
+ if (vtclass == CACHED_CLASS(Basis))
return MARSHALLED_IN(Basis, (GDMonoMarshal::M_Basis *)mono_object_unbox(p_obj));
- if (tclass == CACHED_CLASS(Quat))
+ if (vtclass == CACHED_CLASS(Quat))
return MARSHALLED_IN(Quat, (GDMonoMarshal::M_Quat *)mono_object_unbox(p_obj));
- if (tclass == CACHED_CLASS(Transform))
+ if (vtclass == CACHED_CLASS(Transform))
return MARSHALLED_IN(Transform, (GDMonoMarshal::M_Transform *)mono_object_unbox(p_obj));
- if (tclass == CACHED_CLASS(AABB))
+ if (vtclass == CACHED_CLASS(AABB))
return MARSHALLED_IN(AABB, (GDMonoMarshal::M_AABB *)mono_object_unbox(p_obj));
- if (tclass == CACHED_CLASS(Color))
+ if (vtclass == CACHED_CLASS(Color))
return MARSHALLED_IN(Color, (GDMonoMarshal::M_Color *)mono_object_unbox(p_obj));
- if (tclass == CACHED_CLASS(Plane))
+ if (vtclass == CACHED_CLASS(Plane))
return MARSHALLED_IN(Plane, (GDMonoMarshal::M_Plane *)mono_object_unbox(p_obj));
- if (mono_class_is_enum(tclass->get_mono_ptr()))
+ if (mono_class_is_enum(vtclass->get_mono_ptr()))
return unbox<int32_t>(p_obj);
} break;
@@ -740,7 +740,7 @@ Variant mono_object_to_variant(MonoObject *p_obj) {
UNLIKELY_UNHANDLED_EXCEPTION(exc);
if (is_dict) {
- MonoException *exc = NULL;
+ exc = NULL;
MonoObject *ret = type.type_class->get_method("GetPtr")->invoke(p_obj, &exc);
UNLIKELY_UNHANDLED_EXCEPTION(exc);
return *unbox<Dictionary *>(ret);
@@ -753,7 +753,7 @@ Variant mono_object_to_variant(MonoObject *p_obj) {
UNLIKELY_UNHANDLED_EXCEPTION(exc);
if (is_array) {
- MonoException *exc = NULL;
+ exc = NULL;
MonoObject *ret = type.type_class->get_method("GetPtr")->invoke(p_obj, &exc);
UNLIKELY_UNHANDLED_EXCEPTION(exc);
return *unbox<Array *>(ret);
diff --git a/modules/recast/navigation_mesh_generator.cpp b/modules/recast/navigation_mesh_generator.cpp
index 29f5e4c363..80e98a13a5 100644
--- a/modules/recast/navigation_mesh_generator.cpp
+++ b/modules/recast/navigation_mesh_generator.cpp
@@ -66,26 +66,26 @@ void NavigationMeshGenerator::_add_mesh(const Ref<Mesh> &p_mesh, const Transform
PoolVector<int> mesh_indices = a[Mesh::ARRAY_INDEX];
PoolVector<int>::Read ir = mesh_indices.read();
- for (int i = 0; i < mesh_vertices.size(); i++) {
- _add_vertex(p_xform.xform(vr[i]), p_verticies);
+ for (int j = 0; j < mesh_vertices.size(); j++) {
+ _add_vertex(p_xform.xform(vr[j]), p_verticies);
}
- for (int i = 0; i < face_count; i++) {
+ for (int j = 0; j < face_count; j++) {
// CCW
- p_indices.push_back(current_vertex_count + (ir[i * 3 + 0]));
- p_indices.push_back(current_vertex_count + (ir[i * 3 + 2]));
- p_indices.push_back(current_vertex_count + (ir[i * 3 + 1]));
+ p_indices.push_back(current_vertex_count + (ir[j * 3 + 0]));
+ p_indices.push_back(current_vertex_count + (ir[j * 3 + 2]));
+ p_indices.push_back(current_vertex_count + (ir[j * 3 + 1]));
}
} else {
face_count = mesh_vertices.size() / 3;
- for (int i = 0; i < face_count; i++) {
- _add_vertex(p_xform.xform(vr[i * 3 + 0]), p_verticies);
- _add_vertex(p_xform.xform(vr[i * 3 + 2]), p_verticies);
- _add_vertex(p_xform.xform(vr[i * 3 + 1]), p_verticies);
-
- p_indices.push_back(current_vertex_count + (i * 3 + 0));
- p_indices.push_back(current_vertex_count + (i * 3 + 1));
- p_indices.push_back(current_vertex_count + (i * 3 + 2));
+ for (int j = 0; j < face_count; j++) {
+ _add_vertex(p_xform.xform(vr[j * 3 + 0]), p_verticies);
+ _add_vertex(p_xform.xform(vr[j * 3 + 2]), p_verticies);
+ _add_vertex(p_xform.xform(vr[j * 3 + 1]), p_verticies);
+
+ p_indices.push_back(current_vertex_count + (j * 3 + 0));
+ p_indices.push_back(current_vertex_count + (j * 3 + 1));
+ p_indices.push_back(current_vertex_count + (j * 3 + 2));
}
}
}
diff --git a/modules/theora/video_stream_theora.cpp b/modules/theora/video_stream_theora.cpp
index 31723c5c76..14c5ddd7f2 100644
--- a/modules/theora/video_stream_theora.cpp
+++ b/modules/theora/video_stream_theora.cpp
@@ -296,8 +296,8 @@ void VideoStreamPlaybackTheora::set_file(const String &p_file) {
if (ogg_sync_pageout(&oy, &og) > 0) {
queue_page(&og); /* demux into the appropriate stream */
} else {
- int ret = buffer_data(); /* someone needs more data */
- if (ret == 0) {
+ int ret2 = buffer_data(); /* someone needs more data */
+ if (ret2 == 0) {
fprintf(stderr, "End of file while searching for codec headers.\n");
clear();
return;
diff --git a/modules/visual_script/visual_script.cpp b/modules/visual_script/visual_script.cpp
index 0027300e9f..2c89e5a35c 100644
--- a/modules/visual_script/visual_script.cpp
+++ b/modules/visual_script/visual_script.cpp
@@ -1165,9 +1165,9 @@ void VisualScript::_set_data(const Dictionary &p_data) {
Array nodes = func["nodes"];
- for (int i = 0; i < nodes.size(); i += 3) {
+ for (int j = 0; j < nodes.size(); j += 3) {
- add_node(name, nodes[i], nodes[i + 2], nodes[i + 1]);
+ add_node(name, nodes[j], nodes[j + 2], nodes[j + 1]);
}
Array sequence_connections = func["sequence_connections"];
diff --git a/modules/visual_script/visual_script_expression.cpp b/modules/visual_script/visual_script_expression.cpp
index 23942fdd2a..a76e4bc36f 100644
--- a/modules/visual_script/visual_script_expression.cpp
+++ b/modules/visual_script/visual_script_expression.cpp
@@ -679,10 +679,10 @@ VisualScriptExpression::ENode *VisualScriptExpression::_parse_expression() {
}
str_ofs = cofs; //revert
//parse an expression
- ENode *expr = _parse_expression();
- if (!expr)
+ ENode *expr2 = _parse_expression();
+ if (!expr2)
return NULL;
- dn->dict.push_back(expr);
+ dn->dict.push_back(expr2);
_get_token(tk);
if (tk.type != TK_COLON) {
@@ -690,11 +690,11 @@ VisualScriptExpression::ENode *VisualScriptExpression::_parse_expression() {
return NULL;
}
- expr = _parse_expression();
- if (!expr)
+ expr2 = _parse_expression();
+ if (!expr2)
return NULL;
- dn->dict.push_back(expr);
+ dn->dict.push_back(expr2);
cofs = str_ofs;
_get_token(tk);
@@ -723,10 +723,10 @@ VisualScriptExpression::ENode *VisualScriptExpression::_parse_expression() {
}
str_ofs = cofs; //revert
//parse an expression
- ENode *expr = _parse_expression();
- if (!expr)
+ ENode *expr2 = _parse_expression();
+ if (!expr2)
return NULL;
- an->array.push_back(expr);
+ an->array.push_back(expr2);
cofs = str_ofs;
_get_token(tk);
@@ -807,11 +807,11 @@ VisualScriptExpression::ENode *VisualScriptExpression::_parse_expression() {
}
str_ofs = cofs; //revert
//parse an expression
- ENode *expr = _parse_expression();
- if (!expr)
+ ENode *expr2 = _parse_expression();
+ if (!expr2)
return NULL;
- constructor->arguments.push_back(expr);
+ constructor->arguments.push_back(expr2);
cofs = str_ofs;
_get_token(tk);
@@ -848,11 +848,11 @@ VisualScriptExpression::ENode *VisualScriptExpression::_parse_expression() {
}
str_ofs = cofs; //revert
//parse an expression
- ENode *expr = _parse_expression();
- if (!expr)
+ ENode *expr2 = _parse_expression();
+ if (!expr2)
return NULL;
- bifunc->arguments.push_back(expr);
+ bifunc->arguments.push_back(expr2);
cofs = str_ofs;
_get_token(tk);
@@ -947,25 +947,25 @@ VisualScriptExpression::ENode *VisualScriptExpression::_parse_expression() {
while (true) {
- int cofs = str_ofs;
+ int cofs3 = str_ofs;
_get_token(tk);
if (tk.type == TK_PARENTHESIS_CLOSE) {
break;
}
- str_ofs = cofs; //revert
+ str_ofs = cofs3; //revert
//parse an expression
- ENode *expr = _parse_expression();
- if (!expr)
+ ENode *expr2 = _parse_expression();
+ if (!expr2)
return NULL;
- func_call->arguments.push_back(expr);
+ func_call->arguments.push_back(expr2);
- cofs = str_ofs;
+ cofs3 = str_ofs;
_get_token(tk);
if (tk.type == TK_COMMA) {
//all good
} else if (tk.type == TK_PARENTHESIS_CLOSE) {
- str_ofs = cofs;
+ str_ofs = cofs3;
} else {
_set_error("Expected ',' or ')'");
}
@@ -1426,8 +1426,8 @@ public:
for (int i = 0; i < call->arguments.size(); i++) {
Variant value;
- bool ret = _execute(p_inputs, call->arguments[i], value, r_error_str, ce);
- if (ret)
+ bool ret2 = _execute(p_inputs, call->arguments[i], value, r_error_str, ce);
+ if (ret2)
return true;
arr.write[i] = value;
argp.write[i] = &arr[i];
diff --git a/modules/visual_script/visual_script_property_selector.cpp b/modules/visual_script/visual_script_property_selector.cpp
index 9dc0e4edfa..fa7b13bf5b 100644
--- a/modules/visual_script/visual_script_property_selector.cpp
+++ b/modules/visual_script/visual_script_property_selector.cpp
@@ -514,26 +514,26 @@ void VisualScriptPropertySelector::_item_selected() {
if (names->find(name) != NULL) {
Ref<VisualScriptOperator> operator_node = VisualScriptLanguage::singleton->create_node_from_name(name);
if (operator_node.is_valid()) {
- Map<String, DocData::ClassDoc>::Element *E = dd->class_list.find(operator_node->get_class_name());
- if (E) {
+ Map<String, DocData::ClassDoc>::Element *F = dd->class_list.find(operator_node->get_class_name());
+ if (F) {
text = Variant::get_operator_name(operator_node->get_operator());
}
}
Ref<VisualScriptTypeCast> typecast_node = VisualScriptLanguage::singleton->create_node_from_name(name);
if (typecast_node.is_valid()) {
- Map<String, DocData::ClassDoc>::Element *E = dd->class_list.find(typecast_node->get_class_name());
- if (E) {
- text = E->get().description;
+ Map<String, DocData::ClassDoc>::Element *F = dd->class_list.find(typecast_node->get_class_name());
+ if (F) {
+ text = F->get().description;
}
}
Ref<VisualScriptBuiltinFunc> builtin_node = VisualScriptLanguage::singleton->create_node_from_name(name);
if (builtin_node.is_valid()) {
- Map<String, DocData::ClassDoc>::Element *E = dd->class_list.find(builtin_node->get_class_name());
- if (E) {
- for (int i = 0; i < E->get().constants.size(); i++) {
- if (E->get().constants[i].value.to_int() == int(builtin_node->get_func())) {
- text = E->get().constants[i].description;
+ Map<String, DocData::ClassDoc>::Element *F = dd->class_list.find(builtin_node->get_class_name());
+ if (F) {
+ for (int i = 0; i < F->get().constants.size(); i++) {
+ if (F->get().constants[i].value.to_int() == int(builtin_node->get_func())) {
+ text = F->get().constants[i].description;
}
}
}
diff --git a/modules/websocket/lws_client.cpp b/modules/websocket/lws_client.cpp
index 2fbb46f3e2..2dce0ed1f5 100644
--- a/modules/websocket/lws_client.cpp
+++ b/modules/websocket/lws_client.cpp
@@ -144,9 +144,9 @@ int LWSClient::_handle_cb(struct lws *wsi, enum lws_callback_reasons reason, voi
case LWS_CALLBACK_WS_PEER_INITIATED_CLOSE: {
int code;
- String reason = peer->get_close_reason(in, len, code);
+ String reason2 = peer->get_close_reason(in, len, code);
peer_data->clean_close = true;
- _on_close_request(code, reason);
+ _on_close_request(code, reason2);
return 0;
}
diff --git a/modules/websocket/lws_server.cpp b/modules/websocket/lws_server.cpp
index fe7da99a9f..61ccdca74a 100644
--- a/modules/websocket/lws_server.cpp
+++ b/modules/websocket/lws_server.cpp
@@ -109,9 +109,9 @@ int LWSServer::_handle_cb(struct lws *wsi, enum lws_callback_reasons reason, voi
if (_peer_map.has(id)) {
int code;
Ref<LWSPeer> peer = _peer_map[id];
- String reason = peer->get_close_reason(in, len, code);
+ String reason2 = peer->get_close_reason(in, len, code);
peer_data->clean_close = true;
- _on_close_request(id, code, reason);
+ _on_close_request(id, code, reason2);
}
return 0;
}
diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp
index 60cc33e6bf..9d9270bdac 100644
--- a/platform/android/export/export.cpp
+++ b/platform/android/export/export.cpp
@@ -301,10 +301,10 @@ class EditorExportPlatformAndroid : public EditorExportPlatform {
args.push_back(d.id);
args.push_back("shell");
args.push_back("getprop");
- int ec;
+ int ec2;
String dp;
- OS::get_singleton()->execute(adb, args, true, NULL, &dp, &ec);
+ OS::get_singleton()->execute(adb, args, true, NULL, &dp, &ec2);
Vector<String> props = dp.split("\n");
String vendor;
diff --git a/platform/x11/detect.py b/platform/x11/detect.py
index 72139538b7..16760f9407 100644
--- a/platform/x11/detect.py
+++ b/platform/x11/detect.py
@@ -2,7 +2,7 @@ import os
import platform
import sys
from compat import decode_utf8
-
+from methods import get_compiler_version
def is_active():
return True
@@ -161,18 +161,11 @@ def configure(env):
env.Append(CCFLAGS=['-pipe'])
env.Append(LINKFLAGS=['-pipe'])
- # Check for gcc version > 5 before adding -no-pie
- import re
- import subprocess
- proc = subprocess.Popen([env['CXX'], '--version'], stdout=subprocess.PIPE)
- (stdout, _) = proc.communicate()
- stdout = decode_utf8(stdout)
- match = re.search('[0-9][0-9.]*', stdout)
- if match is not None:
- version = match.group().split('.')
- if (version[0] > '5'):
- env.Append(CCFLAGS=['-fpie'])
- env.Append(LINKFLAGS=['-no-pie'])
+ # Check for gcc version >= 6 before adding -no-pie
+ version = get_compiler_version(env)
+ if version != None and version[0] > '6':
+ env.Append(CCFLAGS=['-fpie'])
+ env.Append(LINKFLAGS=['-no-pie'])
## Dependencies
diff --git a/scene/2d/animated_sprite.cpp b/scene/2d/animated_sprite.cpp
index 28ddf6b5f8..3d7ff5f1fd 100644
--- a/scene/2d/animated_sprite.cpp
+++ b/scene/2d/animated_sprite.cpp
@@ -276,9 +276,9 @@ void SpriteFrames::_set_animations(const Array &p_animations) {
anim.speed = d["speed"];
anim.loop = d["loop"];
Array frames = d["frames"];
- for (int i = 0; i < frames.size(); i++) {
+ for (int j = 0; j < frames.size(); j++) {
- RES res = frames[i];
+ RES res = frames[j];
anim.frames.push_back(res);
}
diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp
index 3802019358..91e4f061cb 100644
--- a/scene/2d/tile_map.cpp
+++ b/scene/2d/tile_map.cpp
@@ -75,15 +75,15 @@ void TileMap::_notification(int p_what) {
Quadrant &q = E->get();
if (navigation) {
- for (Map<PosKey, Quadrant::NavPoly>::Element *E = q.navpoly_ids.front(); E; E = E->next()) {
+ for (Map<PosKey, Quadrant::NavPoly>::Element *F = q.navpoly_ids.front(); F; F = F->next()) {
- navigation->navpoly_remove(E->get().id);
+ navigation->navpoly_remove(F->get().id);
}
q.navpoly_ids.clear();
}
- for (Map<PosKey, Quadrant::Occluder>::Element *E = q.occluder_instances.front(); E; E = E->next()) {
- VS::get_singleton()->free(E->get().id);
+ for (Map<PosKey, Quadrant::Occluder>::Element *F = q.occluder_instances.front(); F; F = F->next()) {
+ VS::get_singleton()->free(F->get().id);
}
q.occluder_instances.clear();
}
@@ -129,14 +129,14 @@ void TileMap::_update_quadrant_transform() {
Physics2DServer::get_singleton()->body_set_state(q.body, Physics2DServer::BODY_STATE_TRANSFORM, xform);
if (navigation) {
- for (Map<PosKey, Quadrant::NavPoly>::Element *E = q.navpoly_ids.front(); E; E = E->next()) {
+ for (Map<PosKey, Quadrant::NavPoly>::Element *F = q.navpoly_ids.front(); F; F = F->next()) {
- navigation->navpoly_set_transform(E->get().id, nav_rel * E->get().xform);
+ navigation->navpoly_set_transform(F->get().id, nav_rel * F->get().xform);
}
}
- for (Map<PosKey, Quadrant::Occluder>::Element *E = q.occluder_instances.front(); E; E = E->next()) {
- VS::get_singleton()->canvas_light_occluder_set_transform(E->get().id, global_transform * E->get().xform);
+ for (Map<PosKey, Quadrant::Occluder>::Element *F = q.occluder_instances.front(); F; F = F->next()) {
+ VS::get_singleton()->canvas_light_occluder_set_transform(F->get().id, global_transform * F->get().xform);
}
}
}
@@ -462,18 +462,18 @@ void TileMap::update_dirty_quadrants() {
Vector<TileSet::ShapeData> shapes = tile_set->tile_get_shapes(c.id);
- for (int i = 0; i < shapes.size(); i++) {
- Ref<Shape2D> shape = shapes[i].shape;
+ for (int j = 0; j < shapes.size(); j++) {
+ Ref<Shape2D> shape = shapes[j].shape;
if (shape.is_valid()) {
- if (tile_set->tile_get_tile_mode(c.id) == TileSet::SINGLE_TILE || (shapes[i].autotile_coord.x == c.autotile_coord_x && shapes[i].autotile_coord.y == c.autotile_coord_y)) {
+ if (tile_set->tile_get_tile_mode(c.id) == TileSet::SINGLE_TILE || (shapes[j].autotile_coord.x == c.autotile_coord_x && shapes[j].autotile_coord.y == c.autotile_coord_y)) {
Transform2D xform;
xform.set_origin(offset.floor());
- Vector2 shape_ofs = shapes[i].shape_transform.get_origin();
+ Vector2 shape_ofs = shapes[j].shape_transform.get_origin();
_fix_cell_transform(xform, c, shape_ofs + center_ofs, s);
- xform *= shapes[i].shape_transform.untranslated();
+ xform *= shapes[j].shape_transform.untranslated();
if (debug_canvas_item.is_valid()) {
vs->canvas_item_add_set_transform(debug_canvas_item, xform);
@@ -481,7 +481,7 @@ void TileMap::update_dirty_quadrants() {
}
ps->body_add_shape(q.body, shape->get_rid(), xform);
ps->body_set_shape_metadata(q.body, shape_idx, Vector2(E->key().x, E->key().y));
- ps->body_set_shape_as_one_way_collision(q.body, shape_idx, shapes[i].one_way_collision, shapes[i].one_way_collision_margin);
+ ps->body_set_shape_as_one_way_collision(q.body, shape_idx, shapes[j].one_way_collision, shapes[j].one_way_collision_margin);
shape_idx++;
}
}
@@ -531,23 +531,23 @@ void TileMap::update_dirty_quadrants() {
colors.resize(vsize);
{
PoolVector<Vector2>::Read vr = navigation_polygon_vertices.read();
- for (int i = 0; i < vsize; i++) {
- vertices.write[i] = vr[i];
- colors.write[i] = debug_navigation_color;
+ for (int j = 0; j < vsize; j++) {
+ vertices.write[j] = vr[j];
+ colors.write[j] = debug_navigation_color;
}
}
Vector<int> indices;
- for (int i = 0; i < navpoly->get_polygon_count(); i++) {
- Vector<int> polygon = navpoly->get_polygon(i);
+ for (int j = 0; j < navpoly->get_polygon_count(); j++) {
+ Vector<int> polygon = navpoly->get_polygon(j);
- for (int j = 2; j < polygon.size(); j++) {
+ for (int k = 2; k < polygon.size(); k++) {
- int kofs[3] = { 0, j - 1, j };
- for (int k = 0; k < 3; k++) {
+ int kofs[3] = { 0, k - 1, k };
+ for (int l = 0; l < 3; l++) {
- int idx = polygon[kofs[k]];
+ int idx = polygon[kofs[l]];
ERR_FAIL_INDEX(idx, vsize);
indices.push_back(idx);
}
@@ -601,9 +601,9 @@ void TileMap::update_dirty_quadrants() {
for (Map<PosKey, Quadrant>::Element *E = quadrant_map.front(); E; E = E->next()) {
Quadrant &q = E->get();
- for (List<RID>::Element *E = q.canvas_items.front(); E; E = E->next()) {
+ for (List<RID>::Element *F = q.canvas_items.front(); F; F = F->next()) {
- VS::get_singleton()->canvas_item_set_draw_index(E->get(), index++);
+ VS::get_singleton()->canvas_item_set_draw_index(F->get(), index++);
}
}
@@ -1053,9 +1053,9 @@ void TileMap::_update_all_items_material_state() {
for (Map<PosKey, Quadrant>::Element *E = quadrant_map.front(); E; E = E->next()) {
Quadrant &q = E->get();
- for (List<RID>::Element *E = q.canvas_items.front(); E; E = E->next()) {
+ for (List<RID>::Element *F = q.canvas_items.front(); F; F = F->next()) {
- _update_item_material_state(E->get());
+ _update_item_material_state(F->get());
}
}
}
diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp
index b4bb03ff43..cf48a2503c 100644
--- a/scene/3d/audio_stream_player_3d.cpp
+++ b/scene/3d/audio_stream_player_3d.cpp
@@ -422,20 +422,20 @@ void AudioStreamPlayer3D::_notification(int p_what) {
if (cc >= 3) {
// Side pair
- float sl = Math::abs(1.0 - Math::abs(-0.4 - av));
- float sr = Math::abs(1.0 - Math::abs(0.4 - av));
+ float sleft = Math::abs(1.0 - Math::abs(-0.4 - av));
+ float sright = Math::abs(1.0 - Math::abs(0.4 - av));
- output.vol[2].l = sl;
- output.vol[2].r = sr;
+ output.vol[2].l = sleft;
+ output.vol[2].r = sright;
}
if (cc >= 4) {
// Rear pair
- float rl = Math::abs(1.0 - Math::abs(-0.2 - av));
- float rr = Math::abs(1.0 - Math::abs(0.2 - av));
+ float rleft = Math::abs(1.0 - Math::abs(-0.2 - av));
+ float rright = Math::abs(1.0 - Math::abs(0.2 - av));
- output.vol[3].l = rl;
- output.vol[3].r = rr;
+ output.vol[3].l = rleft;
+ output.vol[3].r = rright;
}
}
diff --git a/scene/3d/navigation_mesh.cpp b/scene/3d/navigation_mesh.cpp
index 75301af657..93731c4023 100644
--- a/scene/3d/navigation_mesh.cpp
+++ b/scene/3d/navigation_mesh.cpp
@@ -292,11 +292,11 @@ Ref<Mesh> NavigationMesh::get_debug_mesh() {
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 {
diff --git a/scene/3d/path.cpp b/scene/3d/path.cpp
index 8abfb62d70..9005b6b566 100644
--- a/scene/3d/path.cpp
+++ b/scene/3d/path.cpp
@@ -126,7 +126,6 @@ void PathFollow::_update_transform() {
if (rotation_mode == ROTATION_ORIENTED) {
- Vector3 pos = c->interpolate_baked(o, cubic);
Vector3 forward = c->interpolate_baked(o_next, cubic) - pos;
if (forward.length_squared() < CMP_EPSILON2)
diff --git a/scene/3d/skeleton.cpp b/scene/3d/skeleton.cpp
index 2acd03fb98..ceea50f74a 100644
--- a/scene/3d/skeleton.cpp
+++ b/scene/3d/skeleton.cpp
@@ -70,9 +70,9 @@ bool Skeleton::_set(const StringName &p_path, const Variant &p_value) {
for (int i = 0; i < children.size(); i++) {
- NodePath path = children[i];
- ERR_CONTINUE(path.operator String() == "");
- Node *node = get_node(path);
+ NodePath npath = children[i];
+ ERR_CONTINUE(npath.operator String() == "");
+ Node *node = get_node(npath);
ERR_CONTINUE(!node);
bind_child_node_to_bone(which, node);
}
@@ -115,8 +115,8 @@ bool Skeleton::_get(const StringName &p_path, Variant &r_ret) const {
ERR_CONTINUE(!obj);
Node *node = Object::cast_to<Node>(obj);
ERR_CONTINUE(!node);
- NodePath path = get_path_to(node);
- children.push_back(path);
+ NodePath npath = get_path_to(node);
+ children.push_back(npath);
}
r_ret = children;
diff --git a/scene/3d/voxel_light_baker.cpp b/scene/3d/voxel_light_baker.cpp
index 30e38c8ee2..91b3ea6ca0 100644
--- a/scene/3d/voxel_light_baker.cpp
+++ b/scene/3d/voxel_light_baker.cpp
@@ -1730,7 +1730,7 @@ Vector3 VoxelLightBaker::_compute_ray_trace_at_pos(const Vector3 &p_pos, const V
//int level_limit = max_level;
cell = 0; //start from root
- for (int i = 0; i < max_level; i++) {
+ for (int j = 0; j < max_level; j++) {
const Cell *bc = &cells[cell];
@@ -1759,14 +1759,14 @@ Vector3 VoxelLightBaker::_compute_ray_trace_at_pos(const Vector3 &p_pos, const V
}
if (unlikely(cell != CHILD_EMPTY)) {
- for (int i = 0; i < 6; i++) {
+ for (int j = 0; j < 6; j++) {
//anisotropic read light
- float amount = direction.dot(aniso_normal[i]);
+ float amount = direction.dot(aniso_normal[j]);
if (amount <= 0)
continue;
- accum.x += light[cell].accum[i][0] * amount;
- accum.y += light[cell].accum[i][1] * amount;
- accum.z += light[cell].accum[i][2] * amount;
+ accum.x += light[cell].accum[j][0] * amount;
+ accum.y += light[cell].accum[j][1] * amount;
+ accum.z += light[cell].accum[j][2] * amount;
}
accum.x += cells[cell].emission[0];
accum.y += cells[cell].emission[1];
@@ -1833,16 +1833,16 @@ Error VoxelLightBaker::make_lightmap(const Transform &p_xform, Ref<Mesh> &p_mesh
}
int faces = ic ? ic / 3 : vc / 3;
- for (int i = 0; i < faces; i++) {
+ for (int j = 0; j < faces; j++) {
Vector3 vertex[3];
Vector3 normal[3];
Vector2 uv[3];
- for (int j = 0; j < 3; j++) {
- int idx = ic ? ir[i * 3 + j] : i * 3 + j;
- vertex[j] = xform.xform(vr[idx]);
- normal[j] = xform.basis.xform(nr[idx]).normalized();
- uv[j] = u2r[idx];
+ for (int k = 0; k < 3; k++) {
+ int idx = ic ? ir[j * 3 + k] : j * 3 + k;
+ vertex[k] = xform.xform(vr[idx]);
+ normal[k] = xform.basis.xform(nr[idx]).normalized();
+ uv[k] = u2r[idx];
}
_plot_triangle(uv, vertex, normal, lightmap.ptrw(), width, height);
diff --git a/scene/animation/animation_blend_space_2d.cpp b/scene/animation/animation_blend_space_2d.cpp
index 1fe14e633b..95d4644004 100644
--- a/scene/animation/animation_blend_space_2d.cpp
+++ b/scene/animation/animation_blend_space_2d.cpp
@@ -461,9 +461,9 @@ float AnimationNodeBlendSpace2D::process(float p_time, bool p_seek) {
points[j],
points[(j + 1) % 3]
};
- Vector2 closest = Geometry::get_closest_point_to_segment_2d(blend_pos, s);
- if (first || closest.distance_to(blend_pos) < best_point.distance_to(blend_pos)) {
- best_point = closest;
+ Vector2 closest2 = Geometry::get_closest_point_to_segment_2d(blend_pos, s);
+ if (first || closest2.distance_to(blend_pos) < best_point.distance_to(blend_pos)) {
+ best_point = closest2;
blend_triangle = i;
first = false;
float d = s[0].distance_to(s[1]);
@@ -472,7 +472,7 @@ float AnimationNodeBlendSpace2D::process(float p_time, bool p_seek) {
blend_weights[(j + 1) % 3] = 0.0;
blend_weights[(j + 2) % 3] = 0.0;
} else {
- float c = s[0].distance_to(closest) / d;
+ float c = s[0].distance_to(closest2) / d;
blend_weights[j] = 1.0 - c;
blend_weights[(j + 1) % 3] = c;
diff --git a/scene/animation/animation_cache.cpp b/scene/animation/animation_cache.cpp
index 6c67af5777..feefe3ddd4 100644
--- a/scene/animation/animation_cache.cpp
+++ b/scene/animation/animation_cache.cpp
@@ -133,19 +133,19 @@ void AnimationCache::_update_cache() {
} else {
if (np.get_subname_count() > 0) {
- RES res;
+ RES res2;
Vector<StringName> leftover_subpath;
// We don't want to cache the last resource unless it is a method call
bool is_method = animation->track_get_type(i) == Animation::TYPE_METHOD;
- root->get_node_and_resource(np, res, leftover_subpath, is_method);
+ root->get_node_and_resource(np, res2, leftover_subpath, is_method);
- if (res.is_valid()) {
- path.resource = res;
+ if (res2.is_valid()) {
+ path.resource = res2;
} else {
path.node = node;
}
- path.object = res.is_valid() ? res.ptr() : (Object *)node;
+ path.object = res2.is_valid() ? res2.ptr() : (Object *)node;
path.subpath = leftover_subpath;
} else {
diff --git a/scene/animation/animation_tree.cpp b/scene/animation/animation_tree.cpp
index c32001dbcd..0b6fa26bfc 100644
--- a/scene/animation/animation_tree.cpp
+++ b/scene/animation/animation_tree.cpp
@@ -1009,10 +1009,10 @@ void AnimationTree::_process_graph(float p_delta) {
a->method_track_get_key_indices(i, time, delta, &indices);
- for (List<int>::Element *E = indices.front(); E; E = E->next()) {
+ for (List<int>::Element *F = indices.front(); F; F = F->next()) {
- StringName method = a->method_track_get_name(i, E->get());
- Vector<Variant> params = a->method_track_get_params(i, E->get());
+ StringName method = a->method_track_get_name(i, F->get());
+ Vector<Variant> params = a->method_track_get_params(i, F->get());
int s = params.size();
@@ -1151,9 +1151,9 @@ void AnimationTree::_process_graph(float p_delta) {
TrackCacheAnimation *t = static_cast<TrackCacheAnimation *>(track);
- AnimationPlayer *player = Object::cast_to<AnimationPlayer>(t->object);
+ AnimationPlayer *player2 = Object::cast_to<AnimationPlayer>(t->object);
- if (!player)
+ if (!player2)
continue;
if (delta == 0 || seeked) {
@@ -1165,10 +1165,10 @@ void AnimationTree::_process_graph(float p_delta) {
float pos = a->track_get_key_time(i, idx);
StringName anim_name = a->animation_track_get_key_animation(i, idx);
- if (String(anim_name) == "[stop]" || !player->has_animation(anim_name))
+ if (String(anim_name) == "[stop]" || !player2->has_animation(anim_name))
continue;
- Ref<Animation> anim = player->get_animation(anim_name);
+ Ref<Animation> anim = player2->get_animation(anim_name);
float at_anim_pos;
@@ -1178,14 +1178,14 @@ void AnimationTree::_process_graph(float p_delta) {
at_anim_pos = MAX(anim->get_length(), time - pos); //seek to end
}
- if (player->is_playing() || seeked) {
- player->play(anim_name);
- player->seek(at_anim_pos);
+ if (player2->is_playing() || seeked) {
+ player2->play(anim_name);
+ player2->seek(at_anim_pos);
t->playing = true;
playing_caches.insert(t);
} else {
- player->set_assigned_animation(anim_name);
- player->seek(at_anim_pos, true);
+ player2->set_assigned_animation(anim_name);
+ player2->seek(at_anim_pos, true);
}
} else {
//find stuff to play
@@ -1195,15 +1195,15 @@ void AnimationTree::_process_graph(float p_delta) {
int idx = to_play.back()->get();
StringName anim_name = a->animation_track_get_key_animation(i, idx);
- if (String(anim_name) == "[stop]" || !player->has_animation(anim_name)) {
+ if (String(anim_name) == "[stop]" || !player2->has_animation(anim_name)) {
if (playing_caches.has(t)) {
playing_caches.erase(t);
- player->stop();
+ player2->stop();
t->playing = false;
}
} else {
- player->play(anim_name);
+ player2->play(anim_name);
t->playing = true;
playing_caches.insert(t);
}
diff --git a/scene/animation/animation_tree_player.cpp b/scene/animation/animation_tree_player.cpp
index e3a21d8b46..3420b48ae3 100644
--- a/scene/animation/animation_tree_player.cpp
+++ b/scene/animation/animation_tree_player.cpp
@@ -136,9 +136,9 @@ bool AnimationTreePlayer::_set(const StringName &p_name, const Variant &p_value)
else
animation_node_set_animation(id, node.get_valid("animation"));
Array filters = node.get_valid("filter");
- for (int i = 0; i < filters.size(); i++) {
+ for (int j = 0; j < filters.size(); j++) {
- animation_node_set_filter_path(id, filters[i], true);
+ animation_node_set_filter_path(id, filters[j], true);
}
} break;
case NODE_ONESHOT: {
@@ -150,9 +150,9 @@ bool AnimationTreePlayer::_set(const StringName &p_name, const Variant &p_value)
oneshot_node_set_autorestart_delay(id, node.get_valid("autorestart_delay"));
oneshot_node_set_autorestart_random_delay(id, node.get_valid("autorestart_random_delay"));
Array filters = node.get_valid("filter");
- for (int i = 0; i < filters.size(); i++) {
+ for (int j = 0; j < filters.size(); j++) {
- oneshot_node_set_filter_path(id, filters[i], true);
+ oneshot_node_set_filter_path(id, filters[j], true);
}
} break;
@@ -162,9 +162,9 @@ bool AnimationTreePlayer::_set(const StringName &p_name, const Variant &p_value)
case NODE_BLEND2: {
blend2_node_set_amount(id, node.get_valid("blend"));
Array filters = node.get_valid("filter");
- for (int i = 0; i < filters.size(); i++) {
+ for (int j = 0; j < filters.size(); j++) {
- blend2_node_set_filter_path(id, filters[i], true);
+ blend2_node_set_filter_path(id, filters[j], true);
}
} break;
case NODE_BLEND3: {
@@ -278,8 +278,8 @@ bool AnimationTreePlayer::_get(const StringName &p_name, Variant &r_ret) const {
an->filter.get_key_list(&keys);
k.resize(keys.size());
int i = 0;
- for (List<NodePath>::Element *E = keys.front(); E; E = E->next()) {
- k[i++] = E->get();
+ for (List<NodePath>::Element *F = keys.front(); F; F = F->next()) {
+ k[i++] = F->get();
}
node["filter"] = k;
} break;
@@ -297,8 +297,8 @@ bool AnimationTreePlayer::_get(const StringName &p_name, Variant &r_ret) const {
osn->filter.get_key_list(&keys);
k.resize(keys.size());
int i = 0;
- for (List<NodePath>::Element *E = keys.front(); E; E = E->next()) {
- k[i++] = E->get();
+ for (List<NodePath>::Element *F = keys.front(); F; F = F->next()) {
+ k[i++] = F->get();
}
node["filter"] = k;
@@ -315,8 +315,8 @@ bool AnimationTreePlayer::_get(const StringName &p_name, Variant &r_ret) const {
bn->filter.get_key_list(&keys);
k.resize(keys.size());
int i = 0;
- for (List<NodePath>::Element *E = keys.front(); E; E = E->next()) {
- k[i++] = E->get();
+ for (List<NodePath>::Element *F = keys.front(); F; F = F->next()) {
+ k[i++] = F->get();
}
node["filter"] = k;
@@ -874,10 +874,10 @@ void AnimationTreePlayer::_process_animation(float p_delta) {
List<int> indices;
a->method_track_get_key_indices(tr.local_track, anim_list->time, anim_list->step, &indices);
- for (List<int>::Element *E = indices.front(); E; E = E->next()) {
+ for (List<int>::Element *F = indices.front(); F; F = F->next()) {
- StringName method = a->method_track_get_name(tr.local_track, E->get());
- Vector<Variant> args = a->method_track_get_params(tr.local_track, E->get());
+ StringName method = a->method_track_get_name(tr.local_track, F->get());
+ Vector<Variant> args = a->method_track_get_params(tr.local_track, F->get());
args.resize(VARIANT_ARG_MAX);
tr.track->object->call(method, args[0], args[1], args[2], args[3], args[4]);
}
diff --git a/scene/gui/button.cpp b/scene/gui/button.cpp
index b77b57ddd4..c734136895 100644
--- a/scene/gui/button.cpp
+++ b/scene/gui/button.cpp
@@ -140,8 +140,8 @@ void Button::_notification(int p_what) {
if (has_focus()) {
- Ref<StyleBox> style = get_stylebox("focus");
- style->draw(ci, Rect2(Point2(), size));
+ Ref<StyleBox> style2 = get_stylebox("focus");
+ style2->draw(ci, Rect2(Point2(), size));
}
Ref<Font> font = get_font("font");
diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp
index 94c65b3e64..f3f2e586a6 100644
--- a/scene/gui/graph_edit.cpp
+++ b/scene/gui/graph_edit.cpp
@@ -221,8 +221,8 @@ void GraphEdit::_graph_node_raised(Node *p_gn) {
}
int first_not_comment = 0;
for (int i = 0; i < get_child_count(); i++) {
- GraphNode *gn = Object::cast_to<GraphNode>(get_child(i));
- if (gn && !gn->is_comment()) {
+ GraphNode *gn2 = Object::cast_to<GraphNode>(get_child(i));
+ if (gn2 && !gn2->is_comment()) {
first_not_comment = i;
break;
}
@@ -958,33 +958,33 @@ void GraphEdit::_gui_input(const Ref<InputEvent> &p_ev) {
previus_selected.clear();
for (int i = get_child_count() - 1; i >= 0; i--) {
- GraphNode *gn = Object::cast_to<GraphNode>(get_child(i));
- if (!gn || !gn->is_selected())
+ GraphNode *gn2 = Object::cast_to<GraphNode>(get_child(i));
+ if (!gn2 || !gn2->is_selected())
continue;
- previus_selected.push_back(gn);
+ previus_selected.push_back(gn2);
}
} else if (b->get_shift()) {
box_selection_mode_aditive = false;
previus_selected.clear();
for (int i = get_child_count() - 1; i >= 0; i--) {
- GraphNode *gn = Object::cast_to<GraphNode>(get_child(i));
- if (!gn || !gn->is_selected())
+ GraphNode *gn2 = Object::cast_to<GraphNode>(get_child(i));
+ if (!gn2 || !gn2->is_selected())
continue;
- previus_selected.push_back(gn);
+ previus_selected.push_back(gn2);
}
} else {
box_selection_mode_aditive = true;
previus_selected.clear();
for (int i = get_child_count() - 1; i >= 0; i--) {
- GraphNode *gn = Object::cast_to<GraphNode>(get_child(i));
- if (!gn)
+ GraphNode *gn2 = Object::cast_to<GraphNode>(get_child(i));
+ if (!gn2)
continue;
- gn->set_selected(false);
+ gn2->set_selected(false);
}
}
}
diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp
index f34cd131e4..026374ded1 100644
--- a/scene/gui/item_list.cpp
+++ b/scene/gui/item_list.cpp
@@ -1114,13 +1114,13 @@ void ItemList::_notification(int p_what) {
int max_len = -1;
- Vector2 size = font->get_string_size(items[i].text);
+ Vector2 size2 = font->get_string_size(items[i].text);
if (fixed_column_width)
max_len = fixed_column_width;
else if (same_column_width)
max_len = items[i].rect_cache.size.x;
else
- max_len = size.x;
+ max_len = size2.x;
Color modulate = items[i].selected ? font_color_selected : (items[i].custom_fg != Color() ? items[i].custom_fg : font_color);
if (items[i].disabled)
@@ -1170,12 +1170,12 @@ void ItemList::_notification(int p_what) {
} else {
if (fixed_column_width > 0)
- size.x = MIN(size.x, fixed_column_width);
+ size2.x = MIN(size2.x, fixed_column_width);
if (icon_mode == ICON_MODE_TOP) {
- text_ofs.x += (items[i].rect_cache.size.width - size.x) / 2;
+ text_ofs.x += (items[i].rect_cache.size.width - size2.x) / 2;
} else {
- text_ofs.y += (items[i].rect_cache.size.height - size.y) / 2;
+ text_ofs.y += (items[i].rect_cache.size.height - size2.y) / 2;
}
text_ofs.y += font->get_ascent();
diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp
index ac94ac63ec..28b124d143 100644
--- a/scene/gui/popup_menu.cpp
+++ b/scene/gui/popup_menu.cpp
@@ -519,9 +519,9 @@ void PopupMenu::_notification(int p_what) {
if (items[i].accel || (items[i].shortcut.is_valid() && items[i].shortcut->is_valid())) {
//accelerator
- String text = _get_accel_text(i);
- item_ofs.x = size.width - style->get_margin(MARGIN_RIGHT) - font->get_string_size(text).width;
- font->draw(ci, item_ofs + Point2(0, Math::floor((h - font_h) / 2.0)), text, i == mouse_over ? font_color_hover : font_color_accel);
+ String text2 = _get_accel_text(i);
+ item_ofs.x = size.width - style->get_margin(MARGIN_RIGHT) - font->get_string_size(text2).width;
+ font->draw(ci, item_ofs + Point2(0, Math::floor((h - font_h) / 2.0)), text2, i == mouse_over ? font_color_hover : font_color_accel);
}
items.write[i]._ofs_cache = ofs.y;
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp
index 2e466fd582..d4b008e277 100644
--- a/scene/gui/rich_text_label.cpp
+++ b/scene/gui/rich_text_label.cpp
@@ -544,7 +544,7 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
Vector2 draw_ofs = Point2(wofs, y);
Color font_color_shadow = get_color("font_color_shadow");
bool use_outline = get_constant("shadow_as_outline");
- Point2 shadow_ofs(get_constant("shadow_offset_x"), get_constant("shadow_offset_y"));
+ Point2 shadow_ofs2(get_constant("shadow_offset_x"), get_constant("shadow_offset_y"));
if (p_mode == PROCESS_CACHE) {
@@ -568,7 +568,7 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
for (int i = 0; i < frame->lines.size(); i++) {
- _process_line(frame, Point2(), ly, available_width, i, PROCESS_CACHE, cfont, Color(), font_color_shadow, use_outline, shadow_ofs);
+ _process_line(frame, Point2(), ly, available_width, i, PROCESS_CACHE, cfont, Color(), font_color_shadow, use_outline, shadow_ofs2);
table->columns.write[column].min_width = MAX(table->columns[column].min_width, frame->lines[i].minimum_width);
table->columns.write[column].max_width = MAX(table->columns[column].max_width, frame->lines[i].maximum_width);
}
@@ -641,7 +641,7 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
for (int i = 0; i < frame->lines.size(); i++) {
int ly = 0;
- _process_line(frame, Point2(), ly, table->columns[column].width, i, PROCESS_CACHE, cfont, Color(), font_color_shadow, use_outline, shadow_ofs);
+ _process_line(frame, Point2(), ly, table->columns[column].width, i, PROCESS_CACHE, cfont, Color(), font_color_shadow, use_outline, shadow_ofs2);
frame->lines.write[i].height_cache = ly; //actual height
frame->lines.write[i].height_accum_cache = ly; //actual height
}
@@ -674,9 +674,9 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
if (visible) {
if (p_mode == PROCESS_DRAW) {
- nonblank_line_count += _process_line(frame, p_ofs + offset + draw_ofs + Vector2(0, yofs), ly, table->columns[column].width, i, PROCESS_DRAW, cfont, ccolor, font_color_shadow, use_outline, shadow_ofs);
+ nonblank_line_count += _process_line(frame, p_ofs + offset + draw_ofs + Vector2(0, yofs), ly, table->columns[column].width, i, PROCESS_DRAW, cfont, ccolor, font_color_shadow, use_outline, shadow_ofs2);
} else if (p_mode == PROCESS_POINTER) {
- _process_line(frame, p_ofs + offset + draw_ofs + Vector2(0, yofs), ly, table->columns[column].width, i, PROCESS_POINTER, cfont, ccolor, font_color_shadow, use_outline, shadow_ofs, p_click_pos, r_click_item, r_click_char, r_outside);
+ _process_line(frame, p_ofs + offset + draw_ofs + Vector2(0, yofs), ly, table->columns[column].width, i, PROCESS_POINTER, cfont, ccolor, font_color_shadow, use_outline, shadow_ofs2, p_click_pos, r_click_item, r_click_char, r_outside);
if (r_click_item && *r_click_item) {
RETURN; // exit early
}
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 2fd86bd8b0..f38bc62a3c 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -1384,8 +1384,8 @@ void TextEdit::_notification(int p_what) {
}
}
- Size2 size = Size2(max_w, sc * font->get_height() + spacing);
- Size2 minsize = size + sb->get_minimum_size();
+ Size2 size2 = Size2(max_w, sc * font->get_height() + spacing);
+ Size2 minsize = size2 + sb->get_minimum_size();
if (completion_hint_offset == -0xFFFF) {
completion_hint_offset = cursor_pos.x - offset;
@@ -1717,10 +1717,10 @@ void TextEdit::_get_mouse_pos(const Point2i &p_mouse, int &r_row, int &r_col) co
col = get_char_pos_for_line(colx, row, wrap_index);
if (is_wrap_enabled() && wrap_index < times_line_wraps(row)) {
// move back one if we are at the end of the row
- Vector<String> rows = get_wrap_rows_text(row);
+ Vector<String> rows2 = get_wrap_rows_text(row);
int row_end_col = 0;
for (int i = 0; i < wrap_index + 1; i++) {
- row_end_col += rows[i].length();
+ row_end_col += rows2[i].length();
}
if (col >= row_end_col)
col -= 1;
@@ -3375,20 +3375,20 @@ void TextEdit::_base_insert_text(int p_line, int p_char, const String &p_text, i
String preinsert_text = text[p_line].substr(0, p_char);
String postinsert_text = text[p_line].substr(p_char, text[p_line].size());
- for (int i = 0; i < substrings.size(); i++) {
+ for (int j = 0; j < substrings.size(); j++) {
//insert the substrings
- if (i == 0) {
+ if (j == 0) {
- text.set(p_line, preinsert_text + substrings[i]);
+ text.set(p_line, preinsert_text + substrings[j]);
} else {
- text.insert(p_line + i, substrings[i]);
+ text.insert(p_line + j, substrings[j]);
}
- if (i == substrings.size() - 1) {
+ if (j == substrings.size() - 1) {
- text.set(p_line + i, text[p_line + i] + postinsert_text);
+ text.set(p_line + j, text[p_line + j] + postinsert_text);
}
}
diff --git a/scene/gui/texture_button.cpp b/scene/gui/texture_button.cpp
index 95aab95253..c165c5a545 100644
--- a/scene/gui/texture_button.cpp
+++ b/scene/gui/texture_button.cpp
@@ -206,8 +206,8 @@ void TextureButton::_notification(int p_what) {
Size2 scaleSize(size.width / tex_size.width, size.height / tex_size.height);
float scale = scaleSize.width > scaleSize.height ? scaleSize.width : scaleSize.height;
Size2 scaledTexSize = tex_size * scale;
- Point2 ofs = ((scaledTexSize - size) / scale).abs() / 2.0f;
- _texture_region = Rect2(ofs, size / scale);
+ Point2 ofs2 = ((scaledTexSize - size) / scale).abs() / 2.0f;
+ _texture_region = Rect2(ofs2, size / scale);
} break;
}
}
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index f9c80c0477..236c4dbe63 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -1071,11 +1071,11 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
int font_ascent = font->get_ascent();
int ofs = p_pos.x + ((p_item->disable_folding || hide_folding) ? cache.hseparation : cache.item_margin);
- int skip = 0;
+ int skip2 = 0;
for (int i = 0; i < columns.size(); i++) {
- if (skip) {
- skip--;
+ if (skip2) {
+ skip2--;
continue;
}
@@ -1102,7 +1102,7 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
while (i + plus < columns.size() && !p_item->cells[i + plus].editable && p_item->cells[i + plus].mode == TreeItem::CELL_MODE_STRING && p_item->cells[i + plus].text == "" && p_item->cells[i + plus].icon.is_null()) {
w += get_column_width(i + plus);
plus++;
- skip++;
+ skip2++;
}
}
@@ -1165,8 +1165,8 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
cache.selected->draw(ci, r);
}
if (text_editor->is_visible_in_tree()) {
- Vector2 ofs(0, (text_editor->get_size().height - r.size.height) / 2);
- text_editor->set_position(get_global_position() + r.position - ofs);
+ Vector2 ofs2(0, (text_editor->get_size().height - r.size.height) / 2);
+ text_editor->set_position(get_global_position() + r.position - ofs2);
}
}
@@ -2698,8 +2698,8 @@ bool Tree::edit_selected() {
popup_menu->clear();
for (int i = 0; i < c.text.get_slice_count(","); i++) {
- String s = c.text.get_slicec(',', i);
- popup_menu->add_item(s.get_slicec(':', 0), s.get_slicec(':', 1).empty() ? i : s.get_slicec(':', 1).to_int());
+ String s2 = c.text.get_slicec(',', i);
+ popup_menu->add_item(s2.get_slicec(':', 0), s2.get_slicec(':', 1).empty() ? i : s2.get_slicec(':', 1).to_int());
}
popup_menu->set_size(Size2(rect.size.width, 0));
@@ -2951,14 +2951,14 @@ void Tree::_notification(int p_what) {
if (show_column_titles) {
//title buttons
- int ofs = cache.bg->get_margin(MARGIN_LEFT);
+ int ofs2 = cache.bg->get_margin(MARGIN_LEFT);
for (int i = 0; i < columns.size(); i++) {
Ref<StyleBox> sb = (cache.click_type == Cache::CLICK_TITLE && cache.click_index == i) ? cache.title_button_pressed : ((cache.hover_type == Cache::CLICK_TITLE && cache.hover_index == i) ? cache.title_button_hover : cache.title_button);
Ref<Font> f = cache.tb_font;
- Rect2 tbrect = Rect2(ofs - cache.offset.x, bg->get_margin(MARGIN_TOP), get_column_width(i), tbh);
+ Rect2 tbrect = Rect2(ofs2 - cache.offset.x, bg->get_margin(MARGIN_TOP), get_column_width(i), tbh);
sb->draw(ci, tbrect);
- ofs += tbrect.size.width;
+ ofs2 += tbrect.size.width;
//text
int clip_w = tbrect.size.width - sb->get_minimum_size().width;
f->draw_halign(ci, tbrect.position + Point2i(sb->get_offset().x, (tbrect.size.height - f->get_height()) / 2 + f->get_ascent()), HALIGN_CENTER, clip_w, columns[i].title, cache.title_button_color);
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index f7df29fd19..31b73100b9 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -540,12 +540,12 @@ void Viewport::_notification(int p_what) {
CollisionObject2D *co = Object::cast_to<CollisionObject2D>(res[i].collider);
if (co) {
- Map<ObjectID, uint64_t>::Element *E = physics_2d_mouseover.find(res[i].collider_id);
- if (!E) {
- E = physics_2d_mouseover.insert(res[i].collider_id, frame);
+ Map<ObjectID, uint64_t>::Element *F = physics_2d_mouseover.find(res[i].collider_id);
+ if (!F) {
+ F = physics_2d_mouseover.insert(res[i].collider_id, frame);
co->_mouse_enter();
} else {
- E->get() = frame;
+ F->get() = frame;
}
co->_input_event(this, ev, res[i].shape);
@@ -1747,8 +1747,8 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
while (!gui.modal_stack.empty()) {
Control *top = gui.modal_stack.back()->get();
- Vector2 pos = top->get_global_transform_with_canvas().affine_inverse().xform(mpos);
- if (!top->has_point(pos)) {
+ Vector2 pos2 = top->get_global_transform_with_canvas().affine_inverse().xform(mpos);
+ if (!top->has_point(pos2)) {
if (top->data.modal_exclusive || top->data.modal_frame == Engine::get_singleton()->get_frames_drawn()) {
//cancel event, sorry, modal exclusive EATS UP ALL
diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp
index a7544cc031..2af92a788e 100644
--- a/scene/resources/animation.cpp
+++ b/scene/resources/animation.cpp
@@ -269,19 +269,19 @@ bool Animation::_set(const StringName &p_name, const Variant &p_value) {
for (int i = 0; i < valcount; i++) {
- Dictionary d = clips[i];
- if (!d.has("start_offset"))
+ Dictionary d2 = clips[i];
+ if (!d2.has("start_offset"))
continue;
- if (!d.has("end_offset"))
+ if (!d2.has("end_offset"))
continue;
- if (!d.has("stream"))
+ if (!d2.has("stream"))
continue;
TKey<AudioKey> ak;
ak.time = rt[i];
- ak.value.start_offset = d["start_offset"];
- ak.value.end_offset = d["end_offset"];
- ak.value.stream = d["stream"];
+ ak.value.start_offset = d2["start_offset"];
+ ak.value.end_offset = d2["end_offset"];
+ ak.value.stream = d2["stream"];
ad->values.push_back(ak);
}
diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp
index a9878ef5c1..98402dbeaf 100644
--- a/scene/resources/mesh.cpp
+++ b/scene/resources/mesh.cpp
@@ -84,15 +84,15 @@ Ref<TriangleMesh> Mesh::generate_triangle_mesh() const {
PoolVector<int> indices = a[ARRAY_INDEX];
PoolVector<int>::Read ir = indices.read();
- for (int i = 0; i < ic; i++) {
- int index = ir[i];
+ for (int j = 0; j < ic; j++) {
+ int index = ir[j];
facesw[widx++] = vr[index];
}
} else {
- for (int i = 0; i < vc; i++)
- facesw[widx++] = vr[i];
+ for (int j = 0; j < vc; j++)
+ facesw[widx++] = vr[j];
}
}
diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp
index f28a67b493..0d12d388ef 100644
--- a/scene/resources/packed_scene.cpp
+++ b/scene/resources/packed_scene.cpp
@@ -236,8 +236,8 @@ Node *SceneState::instance(GenEditState p_edit_state) const {
} else {
//for instances, a copy must be made
- Node *base = i == 0 ? node : ret_nodes[0];
- Ref<Resource> local_dupe = res->duplicate_for_local_scene(base, resources_local_to_scene);
+ Node *base2 = i == 0 ? node : ret_nodes[0];
+ Ref<Resource> local_dupe = res->duplicate_for_local_scene(base2, resources_local_to_scene);
resources_local_to_scene[res] = local_dupe;
res = local_dupe;
value = local_dupe;
@@ -296,8 +296,8 @@ Node *SceneState::instance(GenEditState p_edit_state) const {
ret_nodes[i] = node;
if (node && gen_node_path_cache && ret_nodes[0]) {
- NodePath n = ret_nodes[0]->get_path_to(node);
- node_path_cache[n] = i;
+ NodePath n2 = ret_nodes[0]->get_path_to(node);
+ node_path_cache[n2] = i;
}
}
@@ -749,7 +749,7 @@ Error SceneState::_parse_connections(Node *p_owner, Node *p_node, Map<StringName
{
Node *nl = p_node;
- bool exists = false;
+ bool exists2 = false;
while (nl) {
@@ -763,7 +763,7 @@ Error SceneState::_parse_connections(Node *p_owner, Node *p_node, Map<StringName
if (from_node >= 0 && to_node >= 0) {
//this one has state for this node, save
if (state->is_connection(from_node, c.signal, to_node, c.method)) {
- exists = true;
+ exists2 = true;
break;
}
}
@@ -781,7 +781,7 @@ Error SceneState::_parse_connections(Node *p_owner, Node *p_node, Map<StringName
if (from_node >= 0 && to_node >= 0) {
//this one has state for this node, save
if (state->is_connection(from_node, c.signal, to_node, c.method)) {
- exists = true;
+ exists2 = true;
break;
}
}
@@ -791,7 +791,7 @@ Error SceneState::_parse_connections(Node *p_owner, Node *p_node, Map<StringName
}
}
- if (exists) {
+ if (exists2) {
continue;
}
}
diff --git a/scene/resources/polygon_path_finder.cpp b/scene/resources/polygon_path_finder.cpp
index a45a55a258..52fc21ac11 100644
--- a/scene/resources/polygon_path_finder.cpp
+++ b/scene/resources/polygon_path_finder.cpp
@@ -441,9 +441,9 @@ void PolygonPathFinder::_set_data(const Dictionary &p_data) {
PoolVector<float> penalties = p_data["penalties"];
if (penalties.size() == pc) {
- PoolVector<float>::Read pr = penalties.read();
+ PoolVector<float>::Read pr2 = penalties.read();
for (int i = 0; i < pc; i++) {
- points.write[i].penalty = pr[i];
+ points.write[i].penalty = pr2[i];
}
}
}
diff --git a/scene/resources/primitive_meshes.cpp b/scene/resources/primitive_meshes.cpp
index 9ef12aa4e6..db58fe7823 100644
--- a/scene/resources/primitive_meshes.cpp
+++ b/scene/resources/primitive_meshes.cpp
@@ -376,17 +376,17 @@ void CapsuleMesh::_create_mesh_array(Array &p_arr) const {
z = radius * cos(0.5 * Math_PI * v);
for (i = 0; i <= radial_segments; i++) {
- float u = i;
- u /= radial_segments;
+ float u2 = i;
+ u2 /= radial_segments;
- x = sin(u * (Math_PI * 2.0));
- y = -cos(u * (Math_PI * 2.0));
+ x = sin(u2 * (Math_PI * 2.0));
+ y = -cos(u2 * (Math_PI * 2.0));
Vector3 p = Vector3(x * radius * w, y * radius * w, z);
points.push_back(p + Vector3(0.0, 0.0, -0.5 * mid_height));
normals.push_back(p.normalized());
ADD_TANGENT(-y, x, 0.0, 1.0)
- uvs.push_back(Vector2(u, twothirds + ((v - 1.0) * onethird)));
+ uvs.push_back(Vector2(u2, twothirds + ((v - 1.0) * onethird)));
point++;
if (i > 0 && j > 0) {
diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp
index b60ec9a80d..85c22f7bf9 100644
--- a/scene/resources/texture.cpp
+++ b/scene/resources/texture.cpp
@@ -662,16 +662,16 @@ Error StreamTexture::_load_data(const String &p_path, int &tw, int &th, int &fla
int sw = tw;
int sh = th;
- int mipmaps = Image::get_image_required_mipmaps(tw, th, format);
+ int mipmaps2 = Image::get_image_required_mipmaps(tw, th, format);
int total_size = Image::get_image_data_size(tw, th, format, true);
int idx = 0;
int ofs = 0;
- while (mipmaps > 1 && p_size_limit > 0 && (sw > p_size_limit || sh > p_size_limit)) {
+ while (mipmaps2 > 1 && p_size_limit > 0 && (sw > p_size_limit || sh > p_size_limit)) {
sw = MAX(sw >> 1, 1);
sh = MAX(sh >> 1, 1);
- mipmaps--;
+ mipmaps2--;
idx++;
}
@@ -698,7 +698,7 @@ Error StreamTexture::_load_data(const String &p_path, int &tw, int &th, int &fla
int expected = total_size - ofs;
if (bytes < expected) {
- //this is a compatibility workaround for older format, which saved less mipmaps. It is still recommended the image is reimported.
+ //this is a compatibility workaround for older format, which saved less mipmaps2. It is still recommended the image is reimported.
zeromem(w.ptr() + bytes, (expected - bytes));
} else if (bytes != expected) {
ERR_FAIL_V(ERR_FILE_CORRUPT);
diff --git a/scene/resources/theme.cpp b/scene/resources/theme.cpp
index 8d1a24dbf8..69258bc834 100644
--- a/scene/resources/theme.cpp
+++ b/scene/resources/theme.cpp
@@ -621,8 +621,8 @@ void Theme::clear() {
void Theme::copy_default_theme() {
- Ref<Theme> default_theme = get_default();
- copy_theme(default_theme);
+ Ref<Theme> default_theme2 = get_default();
+ copy_theme(default_theme2);
}
void Theme::copy_theme(const Ref<Theme> &p_other) {
diff --git a/servers/audio/audio_stream.cpp b/servers/audio/audio_stream.cpp
index 51b9d5a4a2..bd98619e92 100644
--- a/servers/audio/audio_stream.cpp
+++ b/servers/audio/audio_stream.cpp
@@ -83,8 +83,8 @@ void AudioStreamPlaybackResampled::mix(AudioFrame *p_buffer, float p_rate_scale,
_mix_internal(internal_buffer + 4, INTERNAL_BUFFER_LEN);
} else {
//fill with silence, not playing
- for (int i = 0; i < INTERNAL_BUFFER_LEN; ++i) {
- internal_buffer[i + 4] = AudioFrame(0, 0);
+ for (int j = 0; j < INTERNAL_BUFFER_LEN; ++j) {
+ internal_buffer[j + 4] = AudioFrame(0, 0);
}
}
mix_offset -= (INTERNAL_BUFFER_LEN << FP_BITS);
diff --git a/servers/physics/collision_solver_sat.cpp b/servers/physics/collision_solver_sat.cpp
index e2d7c8c44e..baf7431e28 100644
--- a/servers/physics/collision_solver_sat.cpp
+++ b/servers/physics/collision_solver_sat.cpp
@@ -821,9 +821,9 @@ static void _collision_box_capsule(const ShapeSW *p_a, const Transform &p_transf
// test edges of A
- for (int i = 0; i < 3; i++) {
+ for (int j = 0; j < 3; j++) {
- Vector3 axis = point_axis.cross(p_transform_a.basis.get_axis(i)).cross(p_transform_a.basis.get_axis(i)).normalized();
+ Vector3 axis = point_axis.cross(p_transform_a.basis.get_axis(j)).cross(p_transform_a.basis.get_axis(j)).normalized();
if (!separator.test_axis(axis))
return;
diff --git a/servers/physics/joints/cone_twist_joint_sw.cpp b/servers/physics/joints/cone_twist_joint_sw.cpp
index 05778ee9b0..268b9eefeb 100644
--- a/servers/physics/joints/cone_twist_joint_sw.cpp
+++ b/servers/physics/joints/cone_twist_joint_sw.cpp
@@ -205,9 +205,9 @@ bool ConeTwistJointSW::setup(real_t p_timestep) {
// Twist limits
if (m_twistSpan >= real_t(0.)) {
- Vector3 b2Axis2 = B->get_transform().basis.xform(this->m_rbBFrame.basis.get_axis(1));
+ Vector3 b2Axis22 = B->get_transform().basis.xform(this->m_rbBFrame.basis.get_axis(1));
Quat rotationArc = Quat(b2Axis1, b1Axis1);
- Vector3 TwistRef = rotationArc.xform(b2Axis2);
+ Vector3 TwistRef = rotationArc.xform(b2Axis22);
real_t twist = atan2fast(TwistRef.dot(b1Axis3), TwistRef.dot(b1Axis2));
real_t lockedFreeFactor = (m_twistSpan > real_t(0.05f)) ? m_limitSoftness : real_t(0.);
diff --git a/servers/physics/space_sw.cpp b/servers/physics/space_sw.cpp
index 80c17b437c..4ab92715f4 100644
--- a/servers/physics/space_sw.cpp
+++ b/servers/physics/space_sw.cpp
@@ -277,7 +277,7 @@ bool PhysicsDirectSpaceStateSW::cast_motion(const RID &p_shape, const Transform
real_t hi = 1;
Vector3 mnormal = p_motion.normalized();
- for (int i = 0; i < 8; i++) { //steps should be customizable..
+ for (int j = 0; j < 8; j++) { //steps should be customizable..
real_t ofs = (low + hi) * 0.5;
@@ -872,7 +872,7 @@ bool SpaceSW::test_body_motion(BodySW *p_body, const Transform &p_from, const Ve
real_t hi = 1;
Vector3 mnormal = p_motion.normalized();
- for (int i = 0; i < 8; i++) { //steps should be customizable..
+ for (int k = 0; k < 8; k++) { //steps should be customizable..
real_t ofs = (low + hi) * 0.5;
diff --git a/servers/physics_2d/shape_2d_sw.cpp b/servers/physics_2d/shape_2d_sw.cpp
index b622550ec9..aaa37615d5 100644
--- a/servers/physics_2d/shape_2d_sw.cpp
+++ b/servers/physics_2d/shape_2d_sw.cpp
@@ -775,22 +775,22 @@ bool ConcavePolygonShape2DSW::intersect_segment(const Vector2 &p_begin, const Ve
while (true) {
uint32_t node = stack[level] & NODE_IDX_MASK;
- const BVH &b = bvhptr[node];
+ const BVH &bvh = bvhptr[node];
bool done = false;
switch (stack[level] >> VISITED_BIT_SHIFT) {
case TEST_AABB_BIT: {
- bool valid = b.aabb.intersects_segment(p_begin, p_end);
+ bool valid = bvh.aabb.intersects_segment(p_begin, p_end);
if (!valid) {
stack[level] = (VISIT_DONE_BIT << VISITED_BIT_SHIFT) | node;
} else {
- if (b.left < 0) {
+ if (bvh.left < 0) {
- const Segment &s = segmentptr[b.right];
+ const Segment &s = segmentptr[bvh.right];
Vector2 a = pointptr[s.points[0]];
Vector2 b = pointptr[s.points[1]];
@@ -820,14 +820,14 @@ bool ConcavePolygonShape2DSW::intersect_segment(const Vector2 &p_begin, const Ve
case VISIT_LEFT_BIT: {
stack[level] = (VISIT_RIGHT_BIT << VISITED_BIT_SHIFT) | node;
- stack[level + 1] = b.left | TEST_AABB_BIT;
+ stack[level + 1] = bvh.left | TEST_AABB_BIT;
level++;
}
continue;
case VISIT_RIGHT_BIT: {
stack[level] = (VISIT_DONE_BIT << VISITED_BIT_SHIFT) | node;
- stack[level + 1] = b.right | TEST_AABB_BIT;
+ stack[level + 1] = bvh.right | TEST_AABB_BIT;
level++;
}
continue;
@@ -1025,21 +1025,21 @@ void ConcavePolygonShape2DSW::cull(const Rect2 &p_local_aabb, Callback p_callbac
while (true) {
uint32_t node = stack[level] & NODE_IDX_MASK;
- const BVH &b = bvhptr[node];
+ const BVH &bvh = bvhptr[node];
switch (stack[level] >> VISITED_BIT_SHIFT) {
case TEST_AABB_BIT: {
- bool valid = p_local_aabb.intersects(b.aabb);
+ bool valid = p_local_aabb.intersects(bvh.aabb);
if (!valid) {
stack[level] = (VISIT_DONE_BIT << VISITED_BIT_SHIFT) | node;
} else {
- if (b.left < 0) {
+ if (bvh.left < 0) {
- const Segment &s = segmentptr[b.right];
+ const Segment &s = segmentptr[bvh.right];
Vector2 a = pointptr[s.points[0]];
Vector2 b = pointptr[s.points[1]];
@@ -1058,14 +1058,14 @@ void ConcavePolygonShape2DSW::cull(const Rect2 &p_local_aabb, Callback p_callbac
case VISIT_LEFT_BIT: {
stack[level] = (VISIT_RIGHT_BIT << VISITED_BIT_SHIFT) | node;
- stack[level + 1] = b.left | TEST_AABB_BIT;
+ stack[level + 1] = bvh.left | TEST_AABB_BIT;
level++;
}
continue;
case VISIT_RIGHT_BIT: {
stack[level] = (VISIT_DONE_BIT << VISITED_BIT_SHIFT) | node;
- stack[level + 1] = b.right | TEST_AABB_BIT;
+ stack[level + 1] = bvh.right | TEST_AABB_BIT;
level++;
}
continue;
diff --git a/servers/physics_2d/space_2d_sw.cpp b/servers/physics_2d/space_2d_sw.cpp
index 2e338b03cc..41f8ddaebe 100644
--- a/servers/physics_2d/space_2d_sw.cpp
+++ b/servers/physics_2d/space_2d_sw.cpp
@@ -280,7 +280,7 @@ bool Physics2DDirectSpaceStateSW::cast_motion(const RID &p_shape, const Transfor
real_t hi = 1;
Vector2 mnormal = p_motion.normalized();
- for (int i = 0; i < 8; i++) { //steps should be customizable..
+ for (int j = 0; j < 8; j++) { //steps should be customizable..
real_t ofs = (low + hi) * 0.5;
diff --git a/servers/physics_server.cpp b/servers/physics_server.cpp
index e07133b5bb..0629af663e 100644
--- a/servers/physics_server.cpp
+++ b/servers/physics_server.cpp
@@ -739,11 +739,11 @@ const String PhysicsServerManager::setting_property_name("physics/3d/physics_eng
void PhysicsServerManager::on_servers_changed() {
- String physics_servers("DEFAULT");
+ String physics_servers2("DEFAULT");
for (int i = get_servers_count() - 1; 0 <= i; --i) {
- physics_servers += "," + get_server_name(i);
+ physics_servers2 += "," + get_server_name(i);
}
- ProjectSettings::get_singleton()->set_custom_property_info(setting_property_name, PropertyInfo(Variant::STRING, setting_property_name, PROPERTY_HINT_ENUM, physics_servers));
+ ProjectSettings::get_singleton()->set_custom_property_info(setting_property_name, PropertyInfo(Variant::STRING, setting_property_name, PROPERTY_HINT_ENUM, physics_servers2));
}
void PhysicsServerManager::register_server(const String &p_name, CreatePhysicsServerCallback p_creat_callback) {
diff --git a/servers/visual/rasterizer.h b/servers/visual/rasterizer.h
index 340176cdde..8502ef5bf7 100644
--- a/servers/visual/rasterizer.h
+++ b/servers/visual/rasterizer.h
@@ -940,9 +940,8 @@ public:
const Item::CommandPrimitive *primitive = static_cast<const Item::CommandPrimitive *>(c);
r.position = primitive->points[0];
- for (int i = 1; i < primitive->points.size(); i++) {
-
- r.expand_to(primitive->points[i]);
+ for (int j = 1; j < primitive->points.size(); j++) {
+ r.expand_to(primitive->points[j]);
}
} break;
case Item::Command::TYPE_POLYGON: {
@@ -951,9 +950,8 @@ public:
int l = polygon->points.size();
const Point2 *pp = &polygon->points[0];
r.position = pp[0];
- for (int i = 1; i < l; i++) {
-
- r.expand_to(pp[i]);
+ for (int j = 1; j < l; j++) {
+ r.expand_to(pp[j]);
}
} break;
case Item::Command::TYPE_MESH: {
diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp
index 404686a31c..639946916d 100644
--- a/servers/visual/shader_language.cpp
+++ b/servers/visual/shader_language.cpp
@@ -2184,11 +2184,11 @@ bool ShaderLanguage::_validate_function_call(BlockNode *p_block, OperatorNode *p
bool fail = false;
- for (int i = 0; i < args.size(); i++) {
+ for (int j = 0; j < args.size(); j++) {
- if (get_scalar_type(args[i]) == args[i] && p_func->arguments[i + 1]->type == Node::TYPE_CONSTANT && convert_constant(static_cast<ConstantNode *>(p_func->arguments[i + 1]), pfunc->arguments[i].type)) {
+ if (get_scalar_type(args[j]) == args[j] && p_func->arguments[j + 1]->type == Node::TYPE_CONSTANT && convert_constant(static_cast<ConstantNode *>(p_func->arguments[j + 1]), pfunc->arguments[j].type)) {
//all good
- } else if (args[i] != pfunc->arguments[i].type) {
+ } else if (args[j] != pfunc->arguments[j].type) {
fail = true;
break;
}
@@ -2897,7 +2897,7 @@ ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, cons
/* OK now see what's NEXT to the operator.. */
while (true) {
- TkPos pos = _get_tkpos();
+ TkPos pos2 = _get_tkpos();
tk = _get_token();
if (tk.type == TK_CURSOR) {
@@ -3181,7 +3181,7 @@ ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, cons
expr = op;
} else {
- _set_tkpos(pos);
+ _set_tkpos(pos2);
break;
}
}
@@ -3374,10 +3374,10 @@ ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, cons
if (!_validate_operator(op, &op->return_cache)) {
String at;
- for (int i = 0; i < op->arguments.size(); i++) {
- if (i > 0)
+ for (int j = 0; j < op->arguments.size(); j++) {
+ if (j > 0)
at += " and ";
- at += get_datatype_name(op->arguments[i]->get_datatype());
+ at += get_datatype_name(op->arguments[j]->get_datatype());
}
_set_error("Invalid arguments to unary operator '" + get_operator_text(op->op) + "' :" + at);
return NULL;
@@ -4103,17 +4103,17 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_funct
if (uniform) {
- ShaderNode::Uniform uniform;
+ ShaderNode::Uniform uniform2;
if (is_sampler_type(type)) {
- uniform.texture_order = texture_uniforms++;
- uniform.order = -1;
+ uniform2.texture_order = texture_uniforms++;
+ uniform2.order = -1;
} else {
- uniform.texture_order = -1;
- uniform.order = uniforms++;
+ uniform2.texture_order = -1;
+ uniform2.order = uniforms++;
}
- uniform.type = type;
- uniform.precision = precision;
+ uniform2.type = type;
+ uniform2.precision = precision;
//todo parse default value
@@ -4124,26 +4124,26 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_funct
tk = _get_token();
if (tk.type == TK_HINT_WHITE_TEXTURE) {
- uniform.hint = ShaderNode::Uniform::HINT_WHITE;
+ uniform2.hint = ShaderNode::Uniform::HINT_WHITE;
} else if (tk.type == TK_HINT_BLACK_TEXTURE) {
- uniform.hint = ShaderNode::Uniform::HINT_BLACK;
+ uniform2.hint = ShaderNode::Uniform::HINT_BLACK;
} else if (tk.type == TK_HINT_NORMAL_TEXTURE) {
- uniform.hint = ShaderNode::Uniform::HINT_NORMAL;
+ uniform2.hint = ShaderNode::Uniform::HINT_NORMAL;
} else if (tk.type == TK_HINT_ANISO_TEXTURE) {
- uniform.hint = ShaderNode::Uniform::HINT_ANISO;
+ uniform2.hint = ShaderNode::Uniform::HINT_ANISO;
} else if (tk.type == TK_HINT_ALBEDO_TEXTURE) {
- uniform.hint = ShaderNode::Uniform::HINT_ALBEDO;
+ uniform2.hint = ShaderNode::Uniform::HINT_ALBEDO;
} else if (tk.type == TK_HINT_BLACK_ALBEDO_TEXTURE) {
- uniform.hint = ShaderNode::Uniform::HINT_BLACK_ALBEDO;
+ uniform2.hint = ShaderNode::Uniform::HINT_BLACK_ALBEDO;
} else if (tk.type == TK_HINT_COLOR) {
if (type != TYPE_VEC4) {
_set_error("Color hint is for vec4 only");
return ERR_PARSE_ERROR;
}
- uniform.hint = ShaderNode::Uniform::HINT_COLOR;
+ uniform2.hint = ShaderNode::Uniform::HINT_COLOR;
} else if (tk.type == TK_HINT_RANGE) {
- uniform.hint = ShaderNode::Uniform::HINT_RANGE;
+ uniform2.hint = ShaderNode::Uniform::HINT_RANGE;
if (type != TYPE_FLOAT && type != TYPE_INT) {
_set_error("Range hint is for float and int only");
return ERR_PARSE_ERROR;
@@ -4169,8 +4169,8 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_funct
return ERR_PARSE_ERROR;
}
- uniform.hint_range[0] = tk.constant;
- uniform.hint_range[0] *= sign;
+ uniform2.hint_range[0] = tk.constant;
+ uniform2.hint_range[0] *= sign;
tk = _get_token();
@@ -4193,8 +4193,8 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_funct
return ERR_PARSE_ERROR;
}
- uniform.hint_range[1] = tk.constant;
- uniform.hint_range[1] *= sign;
+ uniform2.hint_range[1] = tk.constant;
+ uniform2.hint_range[1] *= sign;
tk = _get_token();
@@ -4206,13 +4206,13 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_funct
return ERR_PARSE_ERROR;
}
- uniform.hint_range[2] = tk.constant;
+ uniform2.hint_range[2] = tk.constant;
tk = _get_token();
} else {
if (type == TYPE_INT) {
- uniform.hint_range[2] = 1;
+ uniform2.hint_range[2] = 1;
} else {
- uniform.hint_range[2] = 0.001;
+ uniform2.hint_range[2] = 0.001;
}
}
@@ -4225,7 +4225,7 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_funct
_set_error("Expected valid type hint after ':'.");
}
- if (uniform.hint != ShaderNode::Uniform::HINT_RANGE && uniform.hint != ShaderNode::Uniform::HINT_NONE && uniform.hint != ShaderNode::Uniform::HINT_COLOR && type <= TYPE_MAT4) {
+ if (uniform2.hint != ShaderNode::Uniform::HINT_RANGE && uniform2.hint != ShaderNode::Uniform::HINT_NONE && uniform2.hint != ShaderNode::Uniform::HINT_COLOR && type <= TYPE_MAT4) {
_set_error("This hint is only for sampler types");
return ERR_PARSE_ERROR;
}
@@ -4245,16 +4245,16 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_funct
ConstantNode *cn = static_cast<ConstantNode *>(expr);
- uniform.default_value.resize(cn->values.size());
+ uniform2.default_value.resize(cn->values.size());
- if (!convert_constant(cn, uniform.type, uniform.default_value.ptrw())) {
- _set_error("Can't convert constant to " + get_datatype_name(uniform.type));
+ if (!convert_constant(cn, uniform2.type, uniform2.default_value.ptrw())) {
+ _set_error("Can't convert constant to " + get_datatype_name(uniform2.type));
return ERR_PARSE_ERROR;
}
tk = _get_token();
}
- shader->uniforms[name] = uniform;
+ shader->uniforms[name] = uniform2;
if (tk.type != TK_SEMICOLON) {
_set_error("Expected ';'");
diff --git a/servers/visual/visual_server_canvas.cpp b/servers/visual/visual_server_canvas.cpp
index e1ecba6334..fb57de5a7b 100644
--- a/servers/visual/visual_server_canvas.cpp
+++ b/servers/visual/visual_server_canvas.cpp
@@ -267,24 +267,24 @@ void VisualServerCanvas::render_canvas(Canvas *p_canvas, const Transform2D &p_tr
for (int i = 0; i < l; i++) {
- const Canvas::ChildItem &ci = p_canvas->child_items[i];
- _render_canvas_item_tree(ci.item, p_transform, p_clip_rect, p_canvas->modulate, p_lights);
+ const Canvas::ChildItem &ci2 = p_canvas->child_items[i];
+ _render_canvas_item_tree(ci2.item, p_transform, p_clip_rect, p_canvas->modulate, p_lights);
//mirroring (useful for scrolling backgrounds)
- if (ci.mirror.x != 0) {
+ if (ci2.mirror.x != 0) {
- Transform2D xform2 = p_transform * Transform2D(0, Vector2(ci.mirror.x, 0));
- _render_canvas_item_tree(ci.item, xform2, p_clip_rect, p_canvas->modulate, p_lights);
+ Transform2D xform2 = p_transform * Transform2D(0, Vector2(ci2.mirror.x, 0));
+ _render_canvas_item_tree(ci2.item, xform2, p_clip_rect, p_canvas->modulate, p_lights);
}
- if (ci.mirror.y != 0) {
+ if (ci2.mirror.y != 0) {
- Transform2D xform2 = p_transform * Transform2D(0, Vector2(0, ci.mirror.y));
- _render_canvas_item_tree(ci.item, xform2, p_clip_rect, p_canvas->modulate, p_lights);
+ Transform2D xform2 = p_transform * Transform2D(0, Vector2(0, ci2.mirror.y));
+ _render_canvas_item_tree(ci2.item, xform2, p_clip_rect, p_canvas->modulate, p_lights);
}
- if (ci.mirror.y != 0 && ci.mirror.x != 0) {
+ if (ci2.mirror.y != 0 && ci2.mirror.x != 0) {
- Transform2D xform2 = p_transform * Transform2D(0, ci.mirror);
- _render_canvas_item_tree(ci.item, xform2, p_clip_rect, p_canvas->modulate, p_lights);
+ Transform2D xform2 = p_transform * Transform2D(0, ci2.mirror);
+ _render_canvas_item_tree(ci2.item, xform2, p_clip_rect, p_canvas->modulate, p_lights);
}
}
}
diff --git a/servers/visual/visual_server_scene.cpp b/servers/visual/visual_server_scene.cpp
index 5d0456686a..b561351374 100644
--- a/servers/visual/visual_server_scene.cpp
+++ b/servers/visual/visual_server_scene.cpp
@@ -2916,7 +2916,7 @@ void VisualServerScene::_bake_gi_probe(Instance *p_gi_probe) {
uint32_t idx = level_cells[j];
- uint32_t r = (uint32_t(local_data[idx].energy[0]) / probe_data->dynamic.bake_dynamic_range) >> 2;
+ uint32_t r2 = (uint32_t(local_data[idx].energy[0]) / probe_data->dynamic.bake_dynamic_range) >> 2;
uint32_t g = (uint32_t(local_data[idx].energy[1]) / probe_data->dynamic.bake_dynamic_range) >> 2;
uint32_t b = (uint32_t(local_data[idx].energy[2]) / probe_data->dynamic.bake_dynamic_range) >> 2;
uint32_t a = (cells[idx].level_alpha >> 8) & 0xFF;
@@ -2924,7 +2924,7 @@ void VisualServerScene::_bake_gi_probe(Instance *p_gi_probe) {
uint32_t mm_ofs = sizes[0] * sizes[1] * (local_data[idx].pos[2]) + sizes[0] * (local_data[idx].pos[1]) + (local_data[idx].pos[0]);
mm_ofs *= 4; //for RGBA (4 bytes)
- mipmapw[mm_ofs + 0] = uint8_t(CLAMP(r, 0, 255));
+ mipmapw[mm_ofs + 0] = uint8_t(CLAMP(r2, 0, 255));
mipmapw[mm_ofs + 1] = uint8_t(CLAMP(g, 0, 255));
mipmapw[mm_ofs + 2] = uint8_t(CLAMP(b, 0, 255));
mipmapw[mm_ofs + 3] = uint8_t(CLAMP(a, 0, 255));
diff --git a/servers/visual_server.cpp b/servers/visual_server.cpp
index 14c9a29ae5..c61e2b99e2 100644
--- a/servers/visual_server.cpp
+++ b/servers/visual_server.cpp
@@ -1163,11 +1163,11 @@ void VisualServer::mesh_add_surface_from_arrays(RID p_mesh, PrimitiveType p_prim
PoolVector<uint8_t> noindex;
AABB laabb;
- Error err = _surface_set_data(p_blend_shapes[i], format & ~ARRAY_FORMAT_INDEX, offsets, total_elem_size, vertex_array_shape, array_len, noindex, 0, laabb, bone_aabb);
+ Error err2 = _surface_set_data(p_blend_shapes[i], format & ~ARRAY_FORMAT_INDEX, offsets, total_elem_size, vertex_array_shape, array_len, noindex, 0, laabb, bone_aabb);
aabb.merge_with(laabb);
- if (err) {
+ if (err2) {
ERR_EXPLAIN("Invalid blend shape array format for surface");
- ERR_FAIL_COND(err != OK);
+ ERR_FAIL_COND(err2 != OK);
}
blend_shape_data.push_back(vertex_array_shape);