From a34378934d56f5c6183bb1f48f5c4fd4565c5e02 Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Sun, 19 Oct 2008 21:26:52 +0000 Subject: [PATCH] Fixed a minor problem with the vertex format hash in the PretransformVertices step. Remember, the step seems still to swizzle materials in some cases. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@188 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/PretransformVertices.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/code/PretransformVertices.cpp b/code/PretransformVertices.cpp index 46d570300..34c2e677d 100644 --- a/code/PretransformVertices.cpp +++ b/code/PretransformVertices.cpp @@ -95,13 +95,16 @@ unsigned int GetMeshVFormat(aiMesh* pcMesh) if (pcMesh->mBones) return (unsigned int)pcMesh->mBones; - unsigned int iRet = 0; ai_assert(NULL != pcMesh->mVertices); + // FIX: the hash may never be 0. Otherwise a comparison against + // nullptr could be successful + unsigned int iRet = 1; + // normals - if (pcMesh->HasNormals())iRet |= 0x1; + if (pcMesh->HasNormals())iRet |= 0x2; // tangents and bitangents - if (pcMesh->HasTangentsAndBitangents())iRet |= 0x2; + if (pcMesh->HasTangentsAndBitangents())iRet |= 0x4; // texture coordinates unsigned int p = 0;