浏览代码

closes https://github.com/assimp/assimp/issues/2431: use irrXml directly for mingw compiler.

Kim Kulling 6 年之前
父节点
当前提交
0021c93892
共有 2 个文件被更改,包括 8 次插入6 次删除
  1. 7 5
      code/Material/MaterialSystem.cpp
  2. 1 1
      test/models/PLY/cube_test.ply

+ 7 - 5
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<ai_real> ( reinterpret_cast<float*>(prop->mData)[a] );
+
+        for (unsigned int a = 0; a < iWrite; ++a) {
+            pOut[ a ] = static_cast<ai_real> ( reinterpret_cast<float*>(prop->mData)[a] );
         }
+
         if (pMax) {
             *pMax = iWrite;
         }

+ 1 - 1
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