From cb282c6ef0bb91957f8a6f422705813bd47c788c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Tue, 17 Mar 2020 07:33:00 +0100 Subject: Style: Set clang-format Standard to Cpp11 For us, it practically only changes the fact that `A>` is now used instead of the C++03 compatible `A >`. Note: clang-format 10+ changed the `Standard` arguments to fully specified `c++11`, `c++14`, etc. versions, but we can't use `c++17` now if we want to preserve compatibility with clang-format 8 and 9. `Cpp11` is still supported as deprecated alias for `Latest`. --- editor/import/editor_import_collada.cpp | 20 +++++------ editor/import/editor_scene_importer_gltf.cpp | 2 +- editor/import/editor_scene_importer_gltf.h | 8 ++--- .../import/resource_importer_csv_translation.cpp | 2 +- editor/import/resource_importer_obj.cpp | 14 ++++---- editor/import/resource_importer_scene.cpp | 40 +++++++++++----------- editor/import/resource_importer_scene.h | 8 ++--- editor/import/resource_importer_texture_atlas.cpp | 8 ++--- editor/import/resource_importer_texture_atlas.h | 4 +-- 9 files changed, 53 insertions(+), 53 deletions(-) (limited to 'editor/import') diff --git a/editor/import/editor_import_collada.cpp b/editor/import/editor_import_collada.cpp index 2f97f4aa31..3cc6e7a50c 100644 --- a/editor/import/editor_import_collada.cpp +++ b/editor/import/editor_import_collada.cpp @@ -49,7 +49,7 @@ struct ColladaImport { Collada collada; Spatial *scene; - Vector > animations; + Vector> animations; struct NodeMap { //String path; @@ -73,12 +73,12 @@ struct ColladaImport { Map node_map; //map from collada node to engine node Map node_name_map; //map from collada node to engine node - Map > mesh_cache; - Map > curve_cache; - Map > material_cache; + Map> mesh_cache; + Map> curve_cache; + Map> material_cache; Map skeleton_map; - Map > skeleton_bone_map; + Map> skeleton_bone_map; Set valid_animated_nodes; Vector valid_animated_properties; @@ -89,7 +89,7 @@ struct ColladaImport { Error _create_scene(Collada::Node *p_node, Spatial *p_parent); Error _create_resources(Collada::Node *p_node, bool p_use_compression); Error _create_material(const String &p_target); - Error _create_mesh_surfaces(bool p_optimize, Ref &p_mesh, const Map &p_material_map, const Collada::MeshData &meshdata, const Transform &p_local_xform, const Vector &bone_remap, const Collada::SkinControllerData *p_skin_controller, const Collada::MorphControllerData *p_morph_data, Vector > p_morph_meshes = Vector >(), bool p_use_compression = false, bool p_use_mesh_material = false); + Error _create_mesh_surfaces(bool p_optimize, Ref &p_mesh, const Map &p_material_map, const Collada::MeshData &meshdata, const Transform &p_local_xform, const Vector &bone_remap, const Collada::SkinControllerData *p_skin_controller, const Collada::MorphControllerData *p_morph_data, Vector> p_morph_meshes = Vector>(), bool p_use_compression = false, bool p_use_mesh_material = false); Error load(const String &p_path, int p_flags, bool p_force_make_tangents = false, bool p_use_compression = false); void _fix_param_animation_tracks(); void create_animation(int p_clip, bool p_make_tracks_in_all_bones, bool p_import_value_tracks); @@ -489,7 +489,7 @@ Error ColladaImport::_create_material(const String &p_target) { return OK; } -Error ColladaImport::_create_mesh_surfaces(bool p_optimize, Ref &p_mesh, const Map &p_material_map, const Collada::MeshData &meshdata, const Transform &p_local_xform, const Vector &bone_remap, const Collada::SkinControllerData *p_skin_controller, const Collada::MorphControllerData *p_morph_data, Vector > p_morph_meshes, bool p_use_compression, bool p_use_mesh_material) { +Error ColladaImport::_create_mesh_surfaces(bool p_optimize, Ref &p_mesh, const Map &p_material_map, const Collada::MeshData &meshdata, const Transform &p_local_xform, const Vector &bone_remap, const Collada::SkinControllerData *p_skin_controller, const Collada::MorphControllerData *p_morph_data, Vector> p_morph_meshes, bool p_use_compression, bool p_use_mesh_material) { bool local_xform_mirror = p_local_xform.basis.determinant() < 0; @@ -608,7 +608,7 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize, Ref &p_me /* ADD WEIGHTS IF EXIST */ /************************/ - Map > pre_weights; + Map> pre_weights; bool has_weights = false; @@ -1096,7 +1096,7 @@ Error ColladaImport::_create_resources(Collada::Node *p_node, bool p_use_compres String meshid; Transform apply_xform; Vector bone_remap; - Vector > morphs; + Vector> morphs; if (ng2->controller) { @@ -1173,7 +1173,7 @@ Error ColladaImport::_create_resources(Collada::Node *p_node, bool p_use_compres Ref mesh = Ref(memnew(ArrayMesh)); const Collada::MeshData &meshdata = collada.state.mesh_data_map[meshid2]; mesh->set_name(meshdata.name); - Error err = _create_mesh_surfaces(false, mesh, ng2->material_map, meshdata, apply_xform, bone_remap, skin, NULL, Vector >(), false); + Error err = _create_mesh_surfaces(false, mesh, ng2->material_map, meshdata, apply_xform, bone_remap, skin, NULL, Vector>(), false); ERR_FAIL_COND_V(err, err); morphs.push_back(mesh); diff --git a/editor/import/editor_scene_importer_gltf.cpp b/editor/import/editor_scene_importer_gltf.cpp index 731d094745..398fc9ff49 100644 --- a/editor/import/editor_scene_importer_gltf.cpp +++ b/editor/import/editor_scene_importer_gltf.cpp @@ -1838,7 +1838,7 @@ Error EditorSceneImporterGLTF::_determine_skeletons(GLTFState &state) { skeleton_sets.get_representatives(groups_representatives); Vector highest_group_members; - Vector > groups; + Vector> groups; for (int i = 0; i < groups_representatives.size(); ++i) { Vector group; skeleton_sets.get_members(group, groups_representatives[i]); diff --git a/editor/import/editor_scene_importer_gltf.h b/editor/import/editor_scene_importer_gltf.h index 5d2711483b..9f354fde2d 100644 --- a/editor/import/editor_scene_importer_gltf.h +++ b/editor/import/editor_scene_importer_gltf.h @@ -284,7 +284,7 @@ class EditorSceneImporterGLTF : public EditorSceneImporter { Channel translation_track; Channel rotation_track; Channel scale_track; - Vector > weight_tracks; + Vector> weight_tracks; }; String name; @@ -302,18 +302,18 @@ class EditorSceneImporterGLTF : public EditorSceneImporter { bool use_named_skin_binds; Vector nodes; - Vector > buffers; + Vector> buffers; Vector buffer_views; Vector accessors; Vector meshes; //meshes are loaded directly, no reason not to. - Vector > materials; + Vector> materials; String scene_name; Vector root_nodes; Vector textures; - Vector > images; + Vector> images; Vector skins; Vector cameras; diff --git a/editor/import/resource_importer_csv_translation.cpp b/editor/import/resource_importer_csv_translation.cpp index 3119fb088b..1d7bed3975 100644 --- a/editor/import/resource_importer_csv_translation.cpp +++ b/editor/import/resource_importer_csv_translation.cpp @@ -96,7 +96,7 @@ Error ResourceImporterCSVTranslation::import(const String &p_source_file, const ERR_FAIL_COND_V(line.size() <= 1, ERR_PARSE_ERROR); Vector locales; - Vector > translations; + Vector> translations; for (int i = 1; i < line.size(); i++) { diff --git a/editor/import/resource_importer_obj.cpp b/editor/import/resource_importer_obj.cpp index 7fd3bcc478..fb1782cb65 100644 --- a/editor/import/resource_importer_obj.cpp +++ b/editor/import/resource_importer_obj.cpp @@ -42,7 +42,7 @@ uint32_t EditorOBJImporter::get_import_flags() const { return IMPORT_SCENE; } -static Error _parse_material_library(const String &p_path, Map > &material_map, List *r_missing_deps) { +static Error _parse_material_library(const String &p_path, Map> &material_map, List *r_missing_deps) { FileAccessRef f = FileAccess::open(p_path, FileAccess::READ); ERR_FAIL_COND_V_MSG(!f, ERR_CANT_OPEN, vformat("Couldn't open MTL file '%s', it may not exist or not be readable.", p_path)); @@ -203,7 +203,7 @@ static Error _parse_material_library(const String &p_path, Map > &r_meshes, bool p_single_mesh, bool p_generate_tangents, bool p_optimize, Vector3 p_scale_mesh, Vector3 p_offset_mesh, List *r_missing_deps) { +static Error _parse_obj(const String &p_path, List> &r_meshes, bool p_single_mesh, bool p_generate_tangents, bool p_optimize, Vector3 p_scale_mesh, Vector3 p_offset_mesh, List *r_missing_deps) { FileAccessRef f = FileAccess::open(p_path, FileAccess::READ); ERR_FAIL_COND_V_MSG(!f, ERR_CANT_OPEN, vformat("Couldn't open OBJ file '%s', it may not exist or not be readable.", p_path)); @@ -221,7 +221,7 @@ static Error _parse_obj(const String &p_path, List > &r_meshes, bool p Vector uvs; String name; - Map > > material_map; + Map>> material_map; Ref surf_tool = memnew(SurfaceTool); surf_tool->begin(Mesh::PRIMITIVE_TRIANGLES); @@ -397,7 +397,7 @@ static Error _parse_obj(const String &p_path, List > &r_meshes, bool p current_material_library = l.replace("mtllib", "").strip_edges(); if (!material_map.has(current_material_library)) { - Map > lib; + Map> lib; Error err = _parse_material_library(current_material_library, lib, r_missing_deps); if (err == ERR_CANT_OPEN) { String dir = p_path.get_base_dir(); @@ -420,7 +420,7 @@ static Error _parse_obj(const String &p_path, List > &r_meshes, bool p Node *EditorOBJImporter::import_scene(const String &p_path, uint32_t p_flags, int p_bake_fps, List *r_missing_deps, Error *r_err) { - List > meshes; + List> meshes; Error err = _parse_obj(p_path, meshes, false, p_flags & IMPORT_GENERATE_TANGENT_ARRAYS, p_flags & IMPORT_USE_COMPRESSION, Vector3(1, 1, 1), Vector3(0, 0, 0), r_missing_deps); @@ -433,7 +433,7 @@ Node *EditorOBJImporter::import_scene(const String &p_path, uint32_t p_flags, in Spatial *scene = memnew(Spatial); - for (List >::Element *E = meshes.front(); E; E = E->next()) { + for (List>::Element *E = meshes.front(); E; E = E->next()) { MeshInstance *mi = memnew(MeshInstance); mi->set_mesh(E->get()); @@ -500,7 +500,7 @@ bool ResourceImporterOBJ::get_option_visibility(const String &p_option, const Ma Error ResourceImporterOBJ::import(const String &p_source_file, const String &p_save_path, const Map &p_options, List *r_platform_variants, List *r_gen_files, Variant *r_metadata) { - List > meshes; + List> meshes; Error err = _parse_obj(p_source_file, meshes, true, p_options["generate_tangents"], p_options["optimize_mesh"], p_options["scale_mesh"], p_options["offset_mesh"], NULL); diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp index 5651197fa3..94a6fee6b7 100644 --- a/editor/import/resource_importer_scene.cpp +++ b/editor/import/resource_importer_scene.cpp @@ -170,7 +170,7 @@ String ResourceImporterScene::get_visible_name() const { void ResourceImporterScene::get_recognized_extensions(List *p_extensions) const { - for (Set >::Element *E = importers.front(); E; E = E->next()) { + for (Set>::Element *E = importers.front(); E; E = E->next()) { E->get()->get_extensions(p_extensions); } } @@ -276,7 +276,7 @@ static String _fixstr(const String &p_what, const String &p_str) { return what; } -static void _gen_shape_list(const Ref &mesh, List > &r_shape_list, bool p_convex) { +static void _gen_shape_list(const Ref &mesh, List> &r_shape_list, bool p_convex) { if (!p_convex) { @@ -284,7 +284,7 @@ static void _gen_shape_list(const Ref &mesh, List > &r_shape_li r_shape_list.push_back(shape); } else { - Vector > cd = mesh->convex_decompose(); + Vector> cd = mesh->convex_decompose(); if (cd.size()) { for (int i = 0; i < cd.size(); i++) { r_shape_list.push_back(cd[i]); @@ -293,7 +293,7 @@ static void _gen_shape_list(const Ref &mesh, List > &r_shape_li } } -Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map, List > > &collision_map, LightBakeMode p_light_bake_mode) { +Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map, List>> &collision_map, LightBakeMode p_light_bake_mode) { // children first for (int i = 0; i < p_node->get_child_count(); i++) { @@ -382,7 +382,7 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map Ref mesh = mi->get_mesh(); if (mesh.is_valid()) { - List > shapes; + List> shapes; String fixed_name; if (collision_map.has(mesh)) { shapes = collision_map[mesh]; @@ -412,7 +412,7 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map p_node = col; int idx = 0; - for (List >::Element *E = shapes.front(); E; E = E->next()) { + for (List>::Element *E = shapes.front(); E; E = E->next()) { CollisionShape *cshape = memnew(CollisionShape); cshape->set_shape(E->get()); @@ -468,7 +468,7 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map Ref mesh = mi->get_mesh(); if (mesh.is_valid()) { - List > shapes; + List> shapes; if (collision_map.has(mesh)) { shapes = collision_map[mesh]; } else { @@ -486,7 +486,7 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map mi->set_owner(rigid_body->get_owner()); int idx = 0; - for (List >::Element *E = shapes.front(); E; E = E->next()) { + for (List>::Element *E = shapes.front(); E; E = E->next()) { CollisionShape *cshape = memnew(CollisionShape); cshape->set_shape(E->get()); @@ -505,7 +505,7 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map Ref mesh = mi->get_mesh(); if (mesh.is_valid()) { - List > shapes; + List> shapes; String fixed_name; if (collision_map.has(mesh)) { shapes = collision_map[mesh]; @@ -536,7 +536,7 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map col->set_owner(mi->get_owner()); int idx = 0; - for (List >::Element *E = shapes.front(); E; E = E->next()) { + for (List>::Element *E = shapes.front(); E; E = E->next()) { CollisionShape *cshape = memnew(CollisionShape); cshape->set_shape(E->get()); @@ -618,7 +618,7 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map Ref mesh = mi->get_mesh(); if (!mesh.is_null()) { - List > shapes; + List> shapes; if (collision_map.has(mesh)) { shapes = collision_map[mesh]; } else if (_teststr(mesh->get_name(), "col")) { @@ -638,7 +638,7 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map col->set_owner(p_node->get_owner()); int idx = 0; - for (List >::Element *E = shapes.front(); E; E = E->next()) { + for (List>::Element *E = shapes.front(); E; E = E->next()) { CollisionShape *cshape = memnew(CollisionShape); cshape->set_shape(E->get()); @@ -957,7 +957,7 @@ void ResourceImporterScene::_find_meshes(Node *p_node, Map, Trans } } -void ResourceImporterScene::_make_external_resources(Node *p_node, const String &p_base_path, bool p_make_animations, bool p_animations_as_text, bool p_keep_animations, bool p_make_materials, bool p_materials_as_text, bool p_keep_materials, bool p_make_meshes, bool p_meshes_as_text, Map, Ref > &p_animations, Map, Ref > &p_materials, Map, Ref > &p_meshes) { +void ResourceImporterScene::_make_external_resources(Node *p_node, const String &p_base_path, bool p_make_animations, bool p_animations_as_text, bool p_keep_animations, bool p_make_materials, bool p_materials_as_text, bool p_keep_materials, bool p_make_meshes, bool p_meshes_as_text, Map, Ref> &p_animations, Map, Ref> &p_materials, Map, Ref> &p_meshes) { List pi; @@ -1209,7 +1209,7 @@ Node *ResourceImporterScene::import_scene_from_other_importer(EditorSceneImporte Ref importer; String ext = p_path.get_extension().to_lower(); - for (Set >::Element *E = importers.front(); E; E = E->next()) { + for (Set>::Element *E = importers.front(); E; E = E->next()) { if (E->get().ptr() == p_exception) continue; @@ -1241,7 +1241,7 @@ Ref ResourceImporterScene::import_animation_from_other_importer(Edito Ref importer; String ext = p_path.get_extension().to_lower(); - for (Set >::Element *E = importers.front(); E; E = E->next()) { + for (Set>::Element *E = importers.front(); E; E = E->next()) { if (E->get().ptr() == p_exception) continue; @@ -1276,7 +1276,7 @@ Error ResourceImporterScene::import(const String &p_source_file, const String &p EditorProgress progress("import", TTR("Import Scene"), 104); progress.step(TTR("Importing Scene..."), 0); - for (Set >::Element *E = importers.front(); E; E = E->next()) { + for (Set>::Element *E = importers.front(); E; E = E->next()) { List extensions; E->get()->get_extensions(&extensions); @@ -1368,7 +1368,7 @@ Error ResourceImporterScene::import(const String &p_source_file, const String &p float anim_optimizer_maxang = p_options["animation/optimizer/max_angle"]; int light_bake_mode = p_options["meshes/light_baking"]; - Map, List > > collision_map; + Map, List>> collision_map; scene = _fix_node(scene, scene, collision_map, LightBakeMode(light_bake_mode)); @@ -1456,9 +1456,9 @@ Error ResourceImporterScene::import(const String &p_source_file, const String &p } if (external_animations || external_materials || external_meshes) { - Map, Ref > anim_map; - Map, Ref > mat_map; - Map, Ref > mesh_map; + Map, Ref> anim_map; + Map, Ref> mat_map; + Map, Ref> mesh_map; bool keep_materials = bool(p_options["materials/keep_on_reimport"]); diff --git a/editor/import/resource_importer_scene.h b/editor/import/resource_importer_scene.h index 20e7af15b5..6d1043eb28 100644 --- a/editor/import/resource_importer_scene.h +++ b/editor/import/resource_importer_scene.h @@ -93,7 +93,7 @@ public: class ResourceImporterScene : public ResourceImporter { GDCLASS(ResourceImporterScene, ResourceImporter); - Set > importers; + Set> importers; static ResourceImporterScene *singleton; @@ -125,7 +125,7 @@ class ResourceImporterScene : public ResourceImporter { public: static ResourceImporterScene *get_singleton() { return singleton; } - const Set > &get_importers() const { return importers; } + const Set> &get_importers() const { return importers; } void add_importer(Ref p_importer) { importers.insert(p_importer); } void remove_importer(Ref p_importer) { importers.erase(p_importer); } @@ -145,9 +145,9 @@ public: void _find_meshes(Node *p_node, Map, Transform> &meshes); - void _make_external_resources(Node *p_node, const String &p_base_path, bool p_make_animations, bool p_animations_as_text, bool p_keep_animations, bool p_make_materials, bool p_materials_as_text, bool p_keep_materials, bool p_make_meshes, bool p_meshes_as_text, Map, Ref > &p_animations, Map, Ref > &p_materials, Map, Ref > &p_meshes); + void _make_external_resources(Node *p_node, const String &p_base_path, bool p_make_animations, bool p_animations_as_text, bool p_keep_animations, bool p_make_materials, bool p_materials_as_text, bool p_keep_materials, bool p_make_meshes, bool p_meshes_as_text, Map, Ref> &p_animations, Map, Ref> &p_materials, Map, Ref> &p_meshes); - Node *_fix_node(Node *p_node, Node *p_root, Map, List > > &collision_map, LightBakeMode p_light_bake_mode); + Node *_fix_node(Node *p_node, Node *p_root, Map, List>> &collision_map, LightBakeMode p_light_bake_mode); void _create_clips(Node *scene, const Array &p_clips, bool p_bake_all); void _filter_anim_tracks(Ref anim, Set &keep); diff --git a/editor/import/resource_importer_texture_atlas.cpp b/editor/import/resource_importer_texture_atlas.cpp index 3172cc7279..2765bb7fae 100644 --- a/editor/import/resource_importer_texture_atlas.cpp +++ b/editor/import/resource_importer_texture_atlas.cpp @@ -192,7 +192,7 @@ static void _plot_triangle(Vector2 *vertices, const Vector2 &p_offset, bool p_tr } } -Error ResourceImporterTextureAtlas::import_group_file(const String &p_group_file, const Map > &p_source_file_options, const Map &p_base_paths) { +Error ResourceImporterTextureAtlas::import_group_file(const String &p_group_file, const Map> &p_source_file_options, const Map &p_base_paths) { ERR_FAIL_COND_V(p_source_file_options.size() == 0, ERR_BUG); //should never happen @@ -202,7 +202,7 @@ Error ResourceImporterTextureAtlas::import_group_file(const String &p_group_file pack_data_files.resize(p_source_file_options.size()); int idx = 0; - for (const Map >::Element *E = p_source_file_options.front(); E; E = E->next(), idx++) { + for (const Map>::Element *E = p_source_file_options.front(); E; E = E->next(), idx++) { PackData &pack_data = pack_data_files.write[idx]; const String &source = E->key(); @@ -251,7 +251,7 @@ Error ResourceImporterTextureAtlas::import_group_file(const String &p_group_file Ref bit_map; bit_map.instance(); bit_map->create_from_image_alpha(image); - Vector > polygons = bit_map->clip_opaque_to_polygons(Rect2(0, 0, image->get_width(), image->get_height())); + Vector> polygons = bit_map->clip_opaque_to_polygons(Rect2(0, 0, image->get_width(), image->get_height())); for (int j = 0; j < polygons.size(); j++) { @@ -323,7 +323,7 @@ Error ResourceImporterTextureAtlas::import_group_file(const String &p_group_file //save the images idx = 0; - for (const Map >::Element *E = p_source_file_options.front(); E; E = E->next(), idx++) { + for (const Map>::Element *E = p_source_file_options.front(); E; E = E->next(), idx++) { PackData &pack_data = pack_data_files.write[idx]; diff --git a/editor/import/resource_importer_texture_atlas.h b/editor/import/resource_importer_texture_atlas.h index e455a157cf..a36cae5872 100644 --- a/editor/import/resource_importer_texture_atlas.h +++ b/editor/import/resource_importer_texture_atlas.h @@ -40,7 +40,7 @@ class ResourceImporterTextureAtlas : public ResourceImporter { Rect2 region; bool is_mesh; Vector chart_pieces; //one for region, many for mesh - Vector > chart_vertices; //for mesh + Vector> chart_vertices; //for mesh Ref image; }; @@ -64,7 +64,7 @@ public: virtual String get_option_group_file() const; virtual Error import(const String &p_source_file, const String &p_save_path, const Map &p_options, List *r_platform_variants, List *r_gen_files = NULL, Variant *r_metadata = NULL); - virtual Error import_group_file(const String &p_group_file, const Map > &p_source_file_options, const Map &p_base_paths); + virtual Error import_group_file(const String &p_group_file, const Map> &p_source_file_options, const Map &p_base_paths); ResourceImporterTextureAtlas(); }; -- cgit v1.2.3