Commit 63b26514 authored by Christopher Tenter's avatar Christopher Tenter
Browse files

Nearly degenerate triangle crash fix.

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@11758 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 6e2fd8ea
......@@ -528,6 +528,19 @@ DrawMeshT<Mesh>::weldVertices(Vertex* _dstVertexBuf,
_dstIndexBuf[i] = offset;
}
// nearly degenerate triangle fix
if (newCount < 3)
{
// copy input buffer
newCount = 3 * numTris_;
memcpy(_dstVertexBuf, _srcVertexBuf, sizeof(Vertex) * newCount);
for (unsigned int i = 0; i < newCount; ++i)
{
_dstIndexBuf[i] = i;
_dstVertexMap[i] = _srcVertexMap[i];
}
}
// PER-FACE-NORMAL FIX
// welding is finished here, but we have to ensure that each
......
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