summaryrefslogtreecommitdiff
path: root/indra/newview/llvotree.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2011-03-03 16:14:52 -0600
committerDave Parks <davep@lindenlab.com>2011-03-03 16:14:52 -0600
commit162d467b4a8ca1dae6b16ece1728873d43a287ac (patch)
treef0ef60a4bdae99efb6b829b51841993bc3f6fa01 /indra/newview/llvotree.cpp
parentfcb205131ccc02b2b50e79ad274ed4ef4fec0330 (diff)
SH-1085 Fix for crash when unchecking "mirror." Basically got LLFace to be paranoid about who gets to touch its LLVertexBuffer members.
Reviewed by Nyx.
Diffstat (limited to 'indra/newview/llvotree.cpp')
-rw-r--r--indra/newview/llvotree.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/indra/newview/llvotree.cpp b/indra/newview/llvotree.cpp
index 1b5aed804f..e6f2b19e07 100644
--- a/indra/newview/llvotree.cpp
+++ b/indra/newview/llvotree.cpp
@@ -525,11 +525,11 @@ BOOL LLVOTree::updateGeometry(LLDrawable *drawable)
if(mTrunkLOD >= sMAX_NUM_TREE_LOD_LEVELS) //do not display the tree.
{
mReferenceBuffer = NULL ;
- mDrawable->getFace(0)->mVertexBuffer = NULL ;
+ mDrawable->getFace(0)->setVertexBuffer(NULL);
return TRUE ;
}
- if (mReferenceBuffer.isNull() || mDrawable->getFace(0)->mVertexBuffer.isNull())
+ if (mReferenceBuffer.isNull() || !mDrawable->getFace(0)->getVertexBuffer())
{
const F32 SRR3 = 0.577350269f; // sqrt(1/3)
const F32 SRR2 = 0.707106781f; // sqrt(1/2)
@@ -863,7 +863,7 @@ BOOL LLVOTree::updateGeometry(LLDrawable *drawable)
if (gSavedSettings.getBOOL("RenderAnimateTrees"))
{
- mDrawable->getFace(0)->mVertexBuffer = mReferenceBuffer;
+ mDrawable->getFace(0)->setVertexBuffer(mReferenceBuffer);
}
else
{
@@ -921,8 +921,9 @@ void LLVOTree::updateMesh()
calcNumVerts(vert_count, index_count, mTrunkLOD, stop_depth, mDepth, mTrunkDepth, mBranches);
LLFace* facep = mDrawable->getFace(0);
- facep->mVertexBuffer = new LLVertexBuffer(LLDrawPoolTree::VERTEX_DATA_MASK, GL_STATIC_DRAW_ARB);
- facep->mVertexBuffer->allocateBuffer(vert_count, index_count, TRUE);
+ LLVertexBuffer* buff = new LLVertexBuffer(LLDrawPoolTree::VERTEX_DATA_MASK, GL_STATIC_DRAW_ARB);
+ buff->allocateBuffer(vert_count, index_count, TRUE);
+ facep->setVertexBuffer(buff);
LLStrider<LLVector3> vertices;
LLStrider<LLVector3> normals;
@@ -930,16 +931,15 @@ void LLVOTree::updateMesh()
LLStrider<U16> indices;
U16 idx_offset = 0;
- facep->mVertexBuffer->getVertexStrider(vertices);
- facep->mVertexBuffer->getNormalStrider(normals);
- facep->mVertexBuffer->getTexCoord0Strider(tex_coords);
- facep->mVertexBuffer->getIndexStrider(indices);
+ buff->getVertexStrider(vertices);
+ buff->getNormalStrider(normals);
+ buff->getTexCoord0Strider(tex_coords);
+ buff->getIndexStrider(indices);
genBranchPipeline(vertices, normals, tex_coords, indices, idx_offset, scale_mat, mTrunkLOD, stop_depth, mDepth, mTrunkDepth, 1.0, mTwist, droop, mBranches, alpha);
mReferenceBuffer->setBuffer(0);
- facep->mVertexBuffer->setBuffer(0);
-
+ buff->setBuffer(0);
}
void LLVOTree::appendMesh(LLStrider<LLVector3>& vertices,