From 0021c93892bfafbe555fa7b74792060b61fd1006 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Wed, 12 Jun 2019 22:12:38 +0200 Subject: [PATCH] closes https://github.com/assimp/assimp/issues/2431: use irrXml directly for mingw compiler. --- code/Material/MaterialSystem.cpp | 12 +++++++----- test/models/PLY/cube_test.ply | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/code/Material/MaterialSystem.cpp b/code/Material/MaterialSystem.cpp index 03d5a18a3..d0b39093b 100644 --- a/code/Material/MaterialSystem.cpp +++ b/code/Material/MaterialSystem.cpp @@ -96,12 +96,12 @@ aiReturn aiGetMaterialFloatArray(const aiMaterial* pMat, ai_real* pOut, unsigned int* pMax) { - ai_assert( pOut != NULL ); - ai_assert( pMat != NULL ); + ai_assert( pOut != nullptr ); + ai_assert( pMat != nullptr ); const aiMaterialProperty* prop; aiGetMaterialProperty(pMat,pKey,type,index, (const aiMaterialProperty**) &prop); - if (!prop) { + if ( nullptr == prop) { return AI_FAILURE; } @@ -112,9 +112,11 @@ aiReturn aiGetMaterialFloatArray(const aiMaterial* pMat, if (pMax) { iWrite = std::min(*pMax,iWrite); ; } - for (unsigned int a = 0; a < iWrite;++a) { - pOut[a] = static_cast ( reinterpret_cast(prop->mData)[a] ); + + for (unsigned int a = 0; a < iWrite; ++a) { + pOut[ a ] = static_cast ( reinterpret_cast(prop->mData)[a] ); } + if (pMax) { *pMax = iWrite; } diff --git a/test/models/PLY/cube_test.ply b/test/models/PLY/cube_test.ply index 068514afe..bb0839286 100644 --- a/test/models/PLY/cube_test.ply +++ b/test/models/PLY/cube_test.ply @@ -1,6 +1,6 @@ ply format ascii 1.0 -comment Created by Open Asset Import Library - http://assimp.sf.net (v4.1.4151146389) +comment Created by Open Asset Import Library - http://assimp.sf.net (v4.1.2760932948) element vertex 8 property float x property float y