summaryrefslogtreecommitdiff
path: root/indra/newview/llvotree.cpp
diff options
context:
space:
mode:
authorKelly Washington <kelly@lindenlab.com>2012-06-27 14:43:10 -0700
committerKelly Washington <kelly@lindenlab.com>2012-06-27 14:43:10 -0700
commita68c7c27f9980a130af5eaf65c6731271a27b060 (patch)
treefa2d9a9444cfe742d1db3166079fd6631a26ddbd /indra/newview/llvotree.cpp
parent14ebeffe8776562c0ac9711a44b7ebe3dec49c47 (diff)
parent8a7fa77f23b94f9ba2cb6da1942e4f86da314b5a (diff)
Merge pulled in lindenlab/viewer-beta to kelly_linden/maint-1078
Diffstat (limited to 'indra/newview/llvotree.cpp')
-rw-r--r--indra/newview/llvotree.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/indra/newview/llvotree.cpp b/indra/newview/llvotree.cpp
index 4564207da4..3556bde9a8 100644
--- a/indra/newview/llvotree.cpp
+++ b/indra/newview/llvotree.cpp
@@ -490,11 +490,16 @@ BOOL LLVOTree::updateGeometry(LLDrawable *drawable)
if(mTrunkLOD >= sMAX_NUM_TREE_LOD_LEVELS) //do not display the tree.
{
mReferenceBuffer = NULL ;
- mDrawable->getFace(0)->setVertexBuffer(NULL);
+ LLFace * facep = drawable->getFace(0);
+ if (facep)
+ {
+ facep->setVertexBuffer(NULL);
+ }
return TRUE ;
}
- if (mReferenceBuffer.isNull() || !mDrawable->getFace(0)->getVertexBuffer())
+ if (mDrawable->getFace(0) &&
+ (mReferenceBuffer.isNull() || !mDrawable->getFace(0)->getVertexBuffer()))
{
const F32 SRR3 = 0.577350269f; // sqrt(1/3)
const F32 SRR2 = 0.707106781f; // sqrt(1/2)
@@ -507,6 +512,7 @@ BOOL LLVOTree::updateGeometry(LLDrawable *drawable)
S32 lod;
LLFace *face = drawable->getFace(0);
+ if (!face) return TRUE;
face->mCenterAgent = getPositionAgent();
face->mCenterLocal = face->mCenterAgent;
@@ -879,6 +885,7 @@ void LLVOTree::updateMesh()
calcNumVerts(vert_count, index_count, mTrunkLOD, stop_depth, mDepth, mTrunkDepth, mBranches);
LLFace* facep = mDrawable->getFace(0);
+ if (!facep) return;
LLVertexBuffer* buff = new LLVertexBuffer(LLDrawPoolTree::VERTEX_DATA_MASK, GL_STATIC_DRAW_ARB);
buff->allocateBuffer(vert_count, index_count, TRUE);
facep->setVertexBuffer(buff);