diff options
author | Nicky <none@none> | 2012-07-21 14:18:10 +0200 |
---|---|---|
committer | Nicky <none@none> | 2012-07-21 14:18:10 +0200 |
commit | e0b334c6154e87729addfb01a52bd5b4c085bf44 (patch) | |
tree | 03ba5a6f5d5b2fd9b6ef0134fde1e14627b49547 /indra/llrender | |
parent | fdb0218bfc156842a70661e339ba4592e02dc9c4 (diff) |
Crashfix; Change llassert_always to llassert + llwarns. This way users don't get disruptive crashes.
Diffstat (limited to 'indra/llrender')
-rw-r--r-- | indra/llrender/llvertexbuffer.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index eadef93c89..2fe0aa0b72 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -555,8 +555,21 @@ void LLVertexBuffer::drawArrays(U32 mode, const std::vector<LLVector3>& pos, con gGL.syncMatrices(); U32 count = pos.size(); - llassert_always(norm.size() >= pos.size()); - llassert_always(count > 0); + + llassert(norm.size() >= pos.size()); + llassert(count > 0); + + if( count == 0 ) + { + llwarns << "Called drawArrays with 0 vertices" << llendl; + return; + } + + if( norm.size() < pos.size() ) + { + llwarns << "Called drawArrays with #" << norm.size() << " normals and #" << pos.size() << " vertices" << llendl; + return; + } unbind(); |