From 656b0b25d869d2fe243b3fadfb422b3b6475e559 Mon Sep 17 00:00:00 2001 From: Marc Date: Tue, 5 Oct 2021 19:24:42 +0200 Subject: [PATCH] Fix warning for array comparison The code previously compared two float arrays with the != operator. This is deprecated in Visual Studio 2019 and results in a warning that leads to an error when compiling with warnings as errors. Small fix to make the build work. --- code/AssetLib/glTF2/glTF2Importer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/AssetLib/glTF2/glTF2Importer.cpp b/code/AssetLib/glTF2/glTF2Importer.cpp index 6c92bdc87..dca32f22b 100644 --- a/code/AssetLib/glTF2/glTF2Importer.cpp +++ b/code/AssetLib/glTF2/glTF2Importer.cpp @@ -312,7 +312,7 @@ static aiMaterial *ImportMaterial(std::vector &embeddedTexIdxs, Asset &r, M if (mat.materialSheen.isPresent) { MaterialSheen &sheen = mat.materialSheen.value; // Default value {0,0,0} disables Sheen - if (sheen.sheenColorFactor != defaultSheenFactor) { + if (std::memcmp(sheen.sheenColorFactor, defaultSheenFactor, sizeof(glTFCommon::vec3)) != 0) { SetMaterialColorProperty(r, sheen.sheenColorFactor, aimat, AI_MATKEY_SHEEN_COLOR_FACTOR); aimat->AddProperty(&sheen.sheenRoughnessFactor, 1, AI_MATKEY_SHEEN_ROUGHNESS_FACTOR); SetMaterialTextureProperty(embeddedTexIdxs, r, sheen.sheenColorTexture, aimat, AI_MATKEY_SHEEN_COLOR_TEXTURE);