diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-07-25 12:52:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-25 12:52:58 +0200 |
commit | ff0b5f8fa1be4ccd5b8de1d9d49f8a4b71439f63 (patch) | |
tree | 42543cc85d27d2c8692a2ced4bac5c537e402004 /editor/import | |
parent | 2f221e5fd507b176590bda52d08e499629ce7761 (diff) | |
parent | ac3322b0af8f23e8e2dac8111200bc69b5604c9f (diff) |
Merge pull request #50809 from akien-mga/iterators-const-references
Diffstat (limited to 'editor/import')
-rw-r--r-- | editor/import/resource_importer_scene.cpp | 18 | ||||
-rw-r--r-- | editor/import/scene_import_settings.cpp | 8 | ||||
-rw-r--r-- | editor/import/scene_importer_mesh.cpp | 2 |
3 files changed, 14 insertions, 14 deletions
diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp index d67950ec9e..e9160f0414 100644 --- a/editor/import/resource_importer_scene.cpp +++ b/editor/import/resource_importer_scene.cpp @@ -312,7 +312,7 @@ Node *ResourceImporterScene::_pre_fix_node(Node *p_node, Node *p_root, Map<Ref<E List<StringName> anims; ap->get_animation_list(&anims); - for (StringName &E : anims) { + for (const StringName &E : anims) { Ref<Animation> anim = ap->get_animation(E); ERR_CONTINUE(anim.is_null()); for (int i = 0; i < anim->get_track_count(); i++) { @@ -659,7 +659,7 @@ Node *ResourceImporterScene::_post_fix_node(Node *p_node, Node *p_root, Map<Ref< } int idx = 0; - for (Ref<Shape3D> &E : shapes) { + for (const Ref<Shape3D> &E : shapes) { CollisionShape3D *cshape = memnew(CollisionShape3D); cshape->set_shape(E); base->add_child(cshape); @@ -712,7 +712,7 @@ Node *ResourceImporterScene::_post_fix_node(Node *p_node, Node *p_root, Map<Ref< //fill node settings for this node with default values List<ImportOption> iopts; get_internal_import_options(INTERNAL_IMPORT_CATEGORY_ANIMATION_NODE, &iopts); - for (ImportOption &E : iopts) { + for (const ImportOption &E : iopts) { if (!node_settings.has(E.option.name)) { node_settings[E.option.name] = E.default_value; } @@ -756,7 +756,7 @@ Node *ResourceImporterScene::_post_fix_node(Node *p_node, Node *p_root, Map<Ref< } else { List<StringName> anims; ap->get_animation_list(&anims); - for (StringName &name : anims) { + for (const StringName &name : anims) { Ref<Animation> anim = ap->get_animation(name); if (p_animation_data.has(name)) { Dictionary anim_settings = p_animation_data[name]; @@ -764,7 +764,7 @@ Node *ResourceImporterScene::_post_fix_node(Node *p_node, Node *p_root, Map<Ref< //fill with default values List<ImportOption> iopts; get_internal_import_options(INTERNAL_IMPORT_CATEGORY_ANIMATION, &iopts); - for (ImportOption &F : iopts) { + for (const ImportOption &F : iopts) { if (!anim_settings.has(F.option.name)) { anim_settings[F.option.name] = F.default_value; } @@ -935,7 +935,7 @@ void ResourceImporterScene::_create_clips(AnimationPlayer *anim, const Array &p_ void ResourceImporterScene::_optimize_animations(AnimationPlayer *anim, float p_max_lin_error, float p_max_ang_error, float p_max_angle) { List<StringName> anim_names; anim->get_animation_list(&anim_names); - for (StringName &E : anim_names) { + for (const StringName &E : anim_names) { Ref<Animation> a = anim->get_animation(E); a->optimize(p_max_lin_error, p_max_ang_error, Math::deg2rad(p_max_angle)); } @@ -1045,7 +1045,7 @@ void ResourceImporterScene::get_import_options(List<ImportOption> *r_options, in String script_ext_hint; - for (String &E : script_extentions) { + for (const String &E : script_extentions) { if (script_ext_hint != "") { script_ext_hint += ","; } @@ -1088,7 +1088,7 @@ Node *ResourceImporterScene::import_scene_from_other_importer(EditorSceneImporte List<String> extensions; E->get()->get_extensions(&extensions); - for (String &F : extensions) { + for (const String &F : extensions) { if (F.to_lower() == ext) { importer = E; break; @@ -1118,7 +1118,7 @@ Ref<Animation> ResourceImporterScene::import_animation_from_other_importer(Edito List<String> extensions; E->get()->get_extensions(&extensions); - for (String &F : extensions) { + for (const String &F : extensions) { if (F.to_lower() == ext) { importer = E; break; diff --git a/editor/import/scene_import_settings.cpp b/editor/import/scene_import_settings.cpp index ad271eaf04..19a8f209bb 100644 --- a/editor/import/scene_import_settings.cpp +++ b/editor/import/scene_import_settings.cpp @@ -305,7 +305,7 @@ void SceneImportSettings::_fill_scene(Node *p_node, TreeItem *p_parent_item) { if (anim_node) { List<StringName> animations; anim_node->get_animation_list(&animations); - for (StringName &E : animations) { + for (const StringName &E : animations) { _fill_animation(scene_tree, anim_node->get_animation(E), E, item); } } @@ -394,7 +394,7 @@ void SceneImportSettings::_load_default_subresource_settings(Map<StringName, Var d = d[p_import_id]; List<ResourceImporterScene::ImportOption> options; ResourceImporterScene::get_singleton()->get_internal_import_options(p_category, &options); - for (ResourceImporterScene::ImportOption &E : options) { + for (const ResourceImporterScene::ImportOption &E : options) { String key = E.option.name; if (d.has(key)) { settings[key] = d[key]; @@ -440,7 +440,7 @@ void SceneImportSettings::open_settings(const String &p_path) { if (err == OK) { List<String> keys; config->get_section_keys("params", &keys); - for (String &E : keys) { + for (const String &E : keys) { Variant value = config->get_value("params", E); if (E == "_subresources") { base_subresource_settings = value; @@ -605,7 +605,7 @@ void SceneImportSettings::_select(Tree *p_from, String p_type, String p_id) { scene_import_settings_data->defaults.clear(); scene_import_settings_data->current.clear(); - for (ResourceImporter::ImportOption &E : options) { + for (const ResourceImporter::ImportOption &E : options) { scene_import_settings_data->defaults[E.option.name] = E.default_value; //needed for visibility toggling (fails if something is missing) if (scene_import_settings_data->settings->has(E.option.name)) { diff --git a/editor/import/scene_importer_mesh.cpp b/editor/import/scene_importer_mesh.cpp index 5b8f7015fe..0d14347225 100644 --- a/editor/import/scene_importer_mesh.cpp +++ b/editor/import/scene_importer_mesh.cpp @@ -79,7 +79,7 @@ void EditorSceneImporterMesh::add_surface(Mesh::PrimitiveType p_primitive, const List<Variant> lods; p_lods.get_key_list(&lods); - for (Variant &E : lods) { + for (const Variant &E : lods) { ERR_CONTINUE(!E.is_num()); Surface::LOD lod; lod.distance = E; |