summaryrefslogtreecommitdiff
path: root/indra/newview/llvotree.cpp
diff options
context:
space:
mode:
authorNyx (Neal Orman) <nyx@lindenlab.com>2011-03-21 17:56:11 -0400
committerNyx (Neal Orman) <nyx@lindenlab.com>2011-03-21 17:56:11 -0400
commit955b727550e8595fd67c55775d8f0fe249826277 (patch)
treef4ac70eb36bcb14d44fad4199811d365eb4b788f /indra/newview/llvotree.cpp
parent77fff26431671ffef8cf482044b1fcd98262d3e0 (diff)
parent5b9ee2a9d5687eae6fd48ee6038cd2f7ed1d9a53 (diff)
merge
Diffstat (limited to 'indra/newview/llvotree.cpp')
-rw-r--r--indra/newview/llvotree.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/indra/newview/llvotree.cpp b/indra/newview/llvotree.cpp
index 20ca02efda..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,
@@ -1330,7 +1330,7 @@ U32 LLVOTree::getPartitionType() const
}
LLTreePartition::LLTreePartition()
-: LLSpatialPartition(0, FALSE, 0)
+: LLSpatialPartition(0, FALSE, GL_DYNAMIC_DRAW_ARB)
{
mDrawableType = LLPipeline::RENDER_TYPE_TREE;
mPartitionType = LLViewerRegion::PARTITION_TREE;