Skip to content

Commit

Permalink
Merge pull request #2510 from assimp/issue_2431
Browse files Browse the repository at this point in the history
closes #2431: use irrXml direc…
  • Loading branch information
kimkulling committed Jun 13, 2019
2 parents 05de460 + c2097d9 commit 8d0567f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions code/Material/MaterialSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion test/models/PLY/cube_test.ply
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 8d0567f

Please sign in to comment.