From 2a12ca14e3272dd7445ad11962bb4013a9b5ec5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 17 Jan 2020 23:21:19 +0100 Subject: [PATCH] MeshTools: test compile() with both flat and smooth normals requested. And clarify the docs about what gets the priority. --- src/Magnum/MeshTools/Compile.h | 4 +++- src/Magnum/MeshTools/Test/CompileGLTest.cpp | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Magnum/MeshTools/Compile.h b/src/Magnum/MeshTools/Compile.h index 9699d35ec..cd975994f 100644 --- a/src/Magnum/MeshTools/Compile.h +++ b/src/Magnum/MeshTools/Compile.h @@ -58,7 +58,9 @@ enum class CompileFlag: UnsignedByte { * If the mesh is @ref MeshPrimitive::Triangles, generates normals using * @ref MeshTools::generateFlatNormals(). If the mesh is not a triangle * mesh or doesn't have 3D positions, this flag does nothing. If the mesh - * already has its own normals, these get replaced. + * already has its own normals, these get replaced. If + * @ref CompileFlag::GenerateSmoothNormals is specified together with this + * flag, this flag gets a priority. */ GenerateFlatNormals = 1 << 0, diff --git a/src/Magnum/MeshTools/Test/CompileGLTest.cpp b/src/Magnum/MeshTools/Test/CompileGLTest.cpp index 504fd7bc0..d54cebb60 100644 --- a/src/Magnum/MeshTools/Test/CompileGLTest.cpp +++ b/src/Magnum/MeshTools/Test/CompileGLTest.cpp @@ -122,6 +122,7 @@ constexpr struct { {"positions + normals + texcoords", Flag::Normals|Flag::TextureCoordinates2D}, {"positions + normals + texcoords + colors", Flag::Normals|Flag::TextureCoordinates2D|Flag::Colors}, {"positions + gen flat normals", Flag::GeneratedFlatNormals}, + {"positions + gen both smooth and flat normals", Flag::GeneratedSmoothNormals|Flag::GeneratedFlatNormals}, {"positions + normals, gen flat normals", Flag::Normals|Flag::GeneratedFlatNormals}, {"positions + gen flat normals + colors", Flag::GeneratedFlatNormals|Flag::Colors}, {"positions + gen flat normals + texcoords", Flag::GeneratedFlatNormals|Flag::TextureCoordinates2D},