Commit 5cba0034 authored by hybrid's avatar hybrid

Fixed some more bugs in .obj loading, introduced in recent updates.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@847 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 3838470c
......@@ -145,7 +145,6 @@ IAnimatedMesh* COBJMeshFileLoader::createMesh(io::IReadFile* file)
case 'g': // group names skipped
{
pBufPtr = goNextLine(pBufPtr, pBufEnd);
}
break;
......@@ -710,11 +709,10 @@ bool COBJMeshFileLoader::retrieveVertexIndices(c8* pVertexData, s32* pIdx, const
// number is completed. Convert and store it
word[i] = '\0';
// if no number was found index will become 0 and later on -1 by decrement
const s32 index = core::strtol10(word, 0);
if (index<0)
pIdx[idxType] = index+vbuffer.size();
if (word[0]=='-')
pIdx[idxType] = -core::strtol10(word+1,0)+vbuffer.size();
else
pIdx[idxType] = index-1;
pIdx[idxType] = core::strtol10(word,0)-1;
// reset the word
word[0] = '\0';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment