diff options
author | Dave Parks <davep@lindenlab.com> | 2012-04-11 12:20:03 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2012-04-11 12:20:03 -0500 |
commit | 484994b43b65f19d3d64c7ea3760313277e9e138 (patch) | |
tree | cd6d616d0dda0a47e422bd8df77e1fc2c315cab5 /indra/newview/llvopartgroup.cpp | |
parent | f96a6aad6b266c8cd4b1a117510fd4cacb6413c8 (diff) |
MAINT-870 Fix for crash from out of control lawns.
Diffstat (limited to 'indra/newview/llvopartgroup.cpp')
-rw-r--r-- | indra/newview/llvopartgroup.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/indra/newview/llvopartgroup.cpp b/indra/newview/llvopartgroup.cpp index 5c10a80b07..6ce93d641c 100644 --- a/indra/newview/llvopartgroup.cpp +++ b/indra/newview/llvopartgroup.cpp @@ -447,14 +447,21 @@ void LLParticlePartition::addGeometryCount(LLSpatialGroup* group, U32& vertex_co continue; } - count++; - facep->mDistance = (facep->mCenterLocal - camera->getOrigin()) * camera->getAtAxis(); - obj->mDepth += facep->mDistance; + if ((facep->getGeomCount() + vertex_count) <= 65536) + { + count++; + facep->mDistance = (facep->mCenterLocal - camera->getOrigin()) * camera->getAtAxis(); + obj->mDepth += facep->mDistance; - mFaceList.push_back(facep); - vertex_count += facep->getGeomCount(); - index_count += facep->getIndicesCount(); - llassert(facep->getIndicesCount() < 65536); + mFaceList.push_back(facep); + vertex_count += facep->getGeomCount(); + index_count += facep->getIndicesCount(); + llassert(facep->getIndicesCount() < 65536); + } + else + { + facep->clearVertexBuffer(); + } } obj->mDepth /= count; |