diff options
author | Campbell Barton <campbell@blender.org> | 2022-09-26 06:58:49 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-09-26 07:12:38 +0300 |
commit | 6275541df7e02c40e8c8650bba3104b5df8d34ef (patch) | |
tree | 042b852b57a56c9423eb58bc1b7afe1c7c2188fa /source/blender/io/collada/MeshImporter.cpp | |
parent | 96d88e56143b1972d9b0cd6c53c6e0cda9b62269 (diff) |
Cleanup: use ELEM/STR_ELEM/STREQ macros
Diffstat (limited to 'source/blender/io/collada/MeshImporter.cpp')
-rw-r--r-- | source/blender/io/collada/MeshImporter.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/source/blender/io/collada/MeshImporter.cpp b/source/blender/io/collada/MeshImporter.cpp index ce7eada84d6..6d7593afb8b 100644 --- a/source/blender/io/collada/MeshImporter.cpp +++ b/source/blender/io/collada/MeshImporter.cpp @@ -284,7 +284,7 @@ bool MeshImporter::is_nice_mesh(COLLADAFW::Mesh *mesh) const char *type_str = bc_primTypeToStr(type); /* OpenCollada passes POLYGONS type for <polylist> */ - if (type == COLLADAFW::MeshPrimitive::POLYLIST || type == COLLADAFW::MeshPrimitive::POLYGONS) { + if (ELEM(type, COLLADAFW::MeshPrimitive::POLYLIST, COLLADAFW::MeshPrimitive::POLYGONS)) { COLLADAFW::Polygons *mpvc = (COLLADAFW::Polygons *)mp; COLLADAFW::Polygons::VertexCountArray &vca = mpvc->getGroupedVerticesVertexCountArray(); @@ -324,8 +324,9 @@ bool MeshImporter::is_nice_mesh(COLLADAFW::Mesh *mesh) /* TODO: Add Checker for line syntax here */ } - else if (type != COLLADAFW::MeshPrimitive::TRIANGLES && - type != COLLADAFW::MeshPrimitive::TRIANGLE_FANS) { + else if (!ELEM(type, + COLLADAFW::MeshPrimitive::TRIANGLES, + COLLADAFW::MeshPrimitive::TRIANGLE_FANS)) { fprintf(stderr, "ERROR: Primitive type %s is not supported.\n", type_str); return false; } @@ -688,9 +689,10 @@ void MeshImporter::read_polys(COLLADAFW::Mesh *collada_mesh, } } - if (collada_meshtype == COLLADAFW::MeshPrimitive::POLYLIST || - collada_meshtype == COLLADAFW::MeshPrimitive::POLYGONS || - collada_meshtype == COLLADAFW::MeshPrimitive::TRIANGLES) { + if (ELEM(collada_meshtype, + COLLADAFW::MeshPrimitive::POLYLIST, + COLLADAFW::MeshPrimitive::POLYGONS, + COLLADAFW::MeshPrimitive::TRIANGLES)) { COLLADAFW::Polygons *mpvc = (COLLADAFW::Polygons *)mp; uint start_index = 0; |