<pre style='margin:0'>
Jeremy Lavergne (nerdling) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/95b8e3ec1efafc64e02e905595939e999c8867e4">https://github.com/macports/macports-ports/commit/95b8e3ec1efafc64e02e905595939e999c8867e4</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 95b8e3ec1efafc64e02e905595939e999c8867e4
</span>Author: Christopher Chavez <chrischavez@gmx.us>
AuthorDate: Sun Mar 6 15:05:04 2022 -0600
<span style='display:block; white-space:pre;color:#404040;'> assimp: fix qt5-qtquick3d build
</span>---
graphics/assimp/Portfile | 5 +-
graphics/assimp/files/4203.patch | 265 +++++++++++++++++++++++++++++++++++++++
2 files changed, 269 insertions(+), 1 deletion(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/graphics/assimp/Portfile b/graphics/assimp/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index cd89849b99a..75383bbf144 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/graphics/assimp/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/graphics/assimp/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -9,7 +9,7 @@ PortGroup legacysupport 1.0
</span> legacysupport.newest_darwin_requires_legacy 10
github.setup assimp assimp 5.1.5 v
<span style='display:block; white-space:pre;background:#ffe0e0;'>-revision 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+revision 2
</span> checksums rmd160 adf21a78900d6bab170898c1536fdec94195e319 \
sha256 8fea5953ac509fd0687e80cc19c7a35c0d5d4d8c654efd003a6112372d4edfda \
size 48978688
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -37,6 +37,9 @@ depends_lib port:minizip \
</span> patchfiles-append patch-code-AssetLib-glTF2-glTF2Asset.inl.diff \
patch-code-CMakeLists.txt.diff
<span style='display:block; white-space:pre;background:#e0ffe0;'>+# Fix for qt5-qtquick3d build; to be included in release following 5.2.2
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+patchfiles-append 4203.patch
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> compiler.cxx_standard 2011
compiler.thread_local_storage yes
configure.args-append -DASSIMP_BUILD_ASSIMP_TOOLS:BOOL=OFF -DASSIMP_BUILD_TESTS:BOOL=OFF
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/graphics/assimp/files/4203.patch b/graphics/assimp/files/4203.patch
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..b5fc293f040
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/graphics/assimp/files/4203.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,265 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From 2fdf52488fba296beae885b4b6e983de375a8236 Mon Sep 17 00:00:00 2001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From: RichardTea <31507749+RichardTea@users.noreply.github.com>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Date: Tue, 23 Nov 2021 13:53:58 +0000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH 1/3] float and integer material property bool conversion
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+All reading float and integer material property values as bool
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Zero => False
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Non-Zero => True
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+---
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ include/assimp/material.inl | 41 +++++++++++++++++++++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ test/unit/utMaterialSystem.cpp | 65 ++++++++++++++++++++++++++++++----
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 2 files changed, 100 insertions(+), 6 deletions(-)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/include/assimp/material.inl b/include/assimp/material.inl
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 693785c3c0..1aec6d8650 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- include/assimp/material.inl
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ include/assimp/material.inl
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -137,6 +137,47 @@ aiReturn aiMaterial::Get(const char* pKey,unsigned int type,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return ret;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++// ---------------------------------------------------------------------------
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++// Specialisation for a single bool.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++// Casts floating point and integer to bool
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++template <>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++AI_FORCE_INLINE
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aiReturn
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aiMaterial::Get(const char *pKey, unsigned int type,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ unsigned int idx, bool &pOut) const {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const aiMaterialProperty *prop;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const aiReturn ret = ::aiGetMaterialProperty(this, pKey, type, idx,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (const aiMaterialProperty **)&prop);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (AI_SUCCESS == ret) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ switch (prop->mType) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Type cannot be converted
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ default: return AI_FAILURE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case aiPTI_Buffer: {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Native bool value storage
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (prop->mDataLength < sizeof(bool)) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return AI_FAILURE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ::memcpy(&pOut, prop->mData, sizeof(bool));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case aiPTI_Float:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case aiPTI_Double:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case aiPTI_Integer: {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Read as integer and cast to bool
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int value = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (AI_SUCCESS == ::aiGetMaterialInteger(this, pKey, type, idx, &value)) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ pOut = static_cast<bool>(value);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return AI_SUCCESS;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return AI_FAILURE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return ret;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ // ---------------------------------------------------------------------------
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ AI_FORCE_INLINE
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ aiReturn aiMaterial::Get(const char* pKey,unsigned int type,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/test/unit/utMaterialSystem.cpp b/test/unit/utMaterialSystem.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 8db014d9c4..9df64ae3ba 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- test/unit/utMaterialSystem.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ test/unit/utMaterialSystem.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -125,13 +125,66 @@ TEST_F(MaterialSystemTest, testStringProperty) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ // ------------------------------------------------------------------------------------------------
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-TEST_F(MaterialSystemTest, testMaterialNameAccess) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- aiMaterial *mat = new aiMaterial();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- EXPECT_NE(nullptr, mat);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- aiString name = mat->GetName();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++TEST_F(MaterialSystemTest, testDefaultMaterialName) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aiString name = pcMat->GetName();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const int retValue(strncmp(name.C_Str(), AI_DEFAULT_MATERIAL_NAME, name.length));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ EXPECT_EQ(0, retValue);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++// ------------------------------------------------------------------------------------------------
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++TEST_F(MaterialSystemTest, testBoolProperty) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const bool valTrue = true;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const bool valFalse = false;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EXPECT_EQ(AI_SUCCESS, pcMat->AddProperty(&valTrue, 1, "bool_true"));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EXPECT_EQ(AI_SUCCESS, pcMat->AddProperty(&valFalse, 1, "bool_false"));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ bool read = false;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EXPECT_EQ(AI_SUCCESS, pcMat->Get("bool_true", 0, 0, read));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EXPECT_TRUE(read) << "read true bool";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EXPECT_EQ(AI_SUCCESS, pcMat->Get("bool_false", 0, 0, read));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EXPECT_FALSE(read) << "read false bool";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- delete mat;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++// ------------------------------------------------------------------------------------------------
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++TEST_F(MaterialSystemTest, testCastIntProperty) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int value = 10;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EXPECT_EQ(AI_SUCCESS, pcMat->AddProperty(&value, 1, "integer"));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ value = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EXPECT_EQ(AI_SUCCESS, pcMat->AddProperty(&value, 1, "zero"));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // To float
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ float valFloat = 0.0f;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EXPECT_EQ(AI_SUCCESS, pcMat->Get("integer", 0, 0, valFloat));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EXPECT_EQ(10.0f, valFloat);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EXPECT_EQ(AI_SUCCESS, pcMat->Get("zero", 0, 0, valFloat));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EXPECT_EQ(0.0f, valFloat);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // To bool
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ bool valBool = false;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EXPECT_EQ(AI_SUCCESS, pcMat->Get("integer", 0, 0, valBool));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EXPECT_EQ(true, valBool);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EXPECT_EQ(AI_SUCCESS, pcMat->Get("zero", 0, 0, valBool));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EXPECT_EQ(false, valBool);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++// ------------------------------------------------------------------------------------------------
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++TEST_F(MaterialSystemTest, testCastFloatProperty) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ float value = 150392.63f;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EXPECT_EQ(AI_SUCCESS, pcMat->AddProperty(&value, 1, "float"));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ value = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EXPECT_EQ(AI_SUCCESS, pcMat->AddProperty(&value, 1, "zero"));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // To int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int valInt = 0.0f;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EXPECT_EQ(AI_SUCCESS, pcMat->Get("float", 0, 0, valInt));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EXPECT_EQ(150392, valInt);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EXPECT_EQ(AI_SUCCESS, pcMat->Get("zero", 0, 0, valInt));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EXPECT_EQ(0, valInt);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // To bool
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ bool valBool = false;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EXPECT_EQ(AI_SUCCESS, pcMat->Get("float", 0, 0, valBool));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EXPECT_EQ(true, valBool);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EXPECT_EQ(AI_SUCCESS, pcMat->Get("zero", 0, 0, valBool));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EXPECT_EQ(false, valBool);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From 5143044cc84decd933bebd0a48b2c24e816b074a Mon Sep 17 00:00:00 2001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From: RichardTea <31507749+RichardTea@users.noreply.github.com>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Date: Tue, 23 Nov 2021 13:55:27 +0000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH 2/3] redefine AI_MATKEY_GLTF_PBRSPECULARGLOSSINESS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+This key is deprecated but is used by Qt5 & Qt 6.2.1 QtQuick3D
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+---
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ include/assimp/pbrmaterial.h | 2 +-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 1 file changed, 1 insertion(+), 1 deletion(-)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/include/assimp/pbrmaterial.h b/include/assimp/pbrmaterial.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index b642a96e39..2103a31f07 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- include/assimp/pbrmaterial.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ include/assimp/pbrmaterial.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -61,7 +61,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #define AI_MATKEY_GLTF_PBRMETALLICROUGHNESS_METALLIC_FACTOR AI_MATKEY_METALLIC_FACTOR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #define AI_MATKEY_GLTF_PBRMETALLICROUGHNESS_ROUGHNESS_FACTOR AI_MATKEY_ROUGHNESS_FACTOR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-//#define AI_MATKEY_GLTF_PBRSPECULARGLOSSINESS "$mat.gltf.pbrSpecularGlossiness", 0, 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#define AI_MATKEY_GLTF_PBRSPECULARGLOSSINESS AI_MATKEY_GLOSSINESS_FACTOR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #define AI_MATKEY_GLTF_PBRSPECULARGLOSSINESS_GLOSSINESS_FACTOR AI_MATKEY_GLOSSINESS_FACTOR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ // Use AI_MATKEY_SHADING_MODEL == aiShadingMode_Unlit instead
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From d18709b899de50f18d9d6ae7cb85f4233a715179 Mon Sep 17 00:00:00 2001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From: RichardTea <31507749+RichardTea@users.noreply.github.com>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Date: Tue, 23 Nov 2021 14:15:32 +0000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH 3/3] Small float values should be true
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+---
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ include/assimp/material.inl | 15 ++++++++++-----
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ test/unit/utMaterialSystem.cpp | 28 ++++++++++++++++++++++++++++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 2 files changed, 38 insertions(+), 5 deletions(-)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/include/assimp/material.inl b/include/assimp/material.inl
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 1aec6d8650..b299892b0b 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- include/assimp/material.inl
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ include/assimp/material.inl
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -163,16 +163,21 @@ AI_FORCE_INLINE
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ case aiPTI_Float:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case aiPTI_Double:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- case aiPTI_Integer: {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Read as integer and cast to bool
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- int value = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (AI_SUCCESS == ::aiGetMaterialInteger(this, pKey, type, idx, &value)) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case aiPTI_Double: {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Read as float and cast to bool
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ float value = 0.0f;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (AI_SUCCESS == ::aiGetMaterialFloat(this, pKey, type, idx, &value)) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ pOut = static_cast<bool>(value);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return AI_SUCCESS;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return AI_FAILURE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ case aiPTI_Integer: {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Cast to bool
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ const int value = static_cast<int>(*prop->mData);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ pOut = static_cast<bool>(value);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return AI_SUCCESS;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return ret;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/test/unit/utMaterialSystem.cpp b/test/unit/utMaterialSystem.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 9df64ae3ba..363a4b1934 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- test/unit/utMaterialSystem.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ test/unit/utMaterialSystem.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -151,6 +151,8 @@ TEST_F(MaterialSystemTest, testCastIntProperty) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ EXPECT_EQ(AI_SUCCESS, pcMat->AddProperty(&value, 1, "integer"));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ value = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ EXPECT_EQ(AI_SUCCESS, pcMat->AddProperty(&value, 1, "zero"));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ value = -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EXPECT_EQ(AI_SUCCESS, pcMat->AddProperty(&value, 1, "negative"));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ // To float
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ float valFloat = 0.0f;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -158,6 +160,8 @@ TEST_F(MaterialSystemTest, testCastIntProperty) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ EXPECT_EQ(10.0f, valFloat);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ EXPECT_EQ(AI_SUCCESS, pcMat->Get("zero", 0, 0, valFloat));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ EXPECT_EQ(0.0f, valFloat);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EXPECT_EQ(AI_SUCCESS, pcMat->Get("negative", 0, 0, valFloat));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EXPECT_EQ(-1.0f, valFloat);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ // To bool
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ bool valBool = false;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -165,6 +169,8 @@ TEST_F(MaterialSystemTest, testCastIntProperty) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ EXPECT_EQ(true, valBool);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ EXPECT_EQ(AI_SUCCESS, pcMat->Get("zero", 0, 0, valBool));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ EXPECT_EQ(false, valBool);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EXPECT_EQ(AI_SUCCESS, pcMat->Get("negative", 0, 0, valBool));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EXPECT_EQ(true, valBool);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ // ------------------------------------------------------------------------------------------------
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -188,3 +194,25 @@ TEST_F(MaterialSystemTest, testCastFloatProperty) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ EXPECT_EQ(AI_SUCCESS, pcMat->Get("zero", 0, 0, valBool));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ EXPECT_EQ(false, valBool);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++// ------------------------------------------------------------------------------------------------
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++TEST_F(MaterialSystemTest, testCastSmallFloatProperty) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ float value = 0.0078125f;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EXPECT_EQ(AI_SUCCESS, pcMat->AddProperty(&value, 1, "float"));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ value = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EXPECT_EQ(AI_SUCCESS, pcMat->AddProperty(&value, 1, "zero"));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // To int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int valInt = 0.0f;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EXPECT_EQ(AI_SUCCESS, pcMat->Get("float", 0, 0, valInt));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EXPECT_EQ(0, valInt);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EXPECT_EQ(AI_SUCCESS, pcMat->Get("zero", 0, 0, valInt));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EXPECT_EQ(0, valInt);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // To bool
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ bool valBool = false;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EXPECT_EQ(AI_SUCCESS, pcMat->Get("float", 0, 0, valBool));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EXPECT_EQ(true, valBool);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EXPECT_EQ(AI_SUCCESS, pcMat->Get("zero", 0, 0, valBool));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EXPECT_EQ(false, valBool);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span></pre><pre style='margin:0'>
</pre>