summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2010-10-07 16:48:13 -0500
committerDave Parks <davep@lindenlab.com>2010-10-07 16:48:13 -0500
commit578389ce23960180610fce932eac1b7816ed8f68 (patch)
treedad7001c1174962a5bce7816e1a425d5713af7c7 /indra
parentfecf1883efab2df720e4097d66d450dd8011399f (diff)
Fix for crash when attempting to render single hull rep when no such rep is available.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llspatialpartition.cpp37
1 files changed, 20 insertions, 17 deletions
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index 68f3fdb1a0..929405232a 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -2806,29 +2806,32 @@ void renderMeshBaseHull(LLVOVolume* volume, U32 data_mask, LLColor4& color)
const LLMeshDecomposition* decomp = gMeshRepo.getDecomposition(mesh_id);
if (decomp)
- {
- gGL.pushMatrix();
- glMultMatrixf((F32*) volume->getRelativeXform().mMatrix);
-
- gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
-
+ {
LLVertexBuffer* buff = decomp->mBaseHullMesh;
- buff->setBuffer(data_mask);
+ if (buff)
+ {
+ gGL.pushMatrix();
+ glMultMatrixf((F32*) volume->getRelativeXform().mMatrix);
+
+ gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
- glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
- glColor3fv(color.mV);
- buff->drawArrays(LLRender::TRIANGLES, 0, buff->getNumVerts());
- glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+ buff->setBuffer(data_mask);
- {
- LLGLEnable blend(GL_BLEND);
- gGL.setSceneBlendType(LLRender::BT_ALPHA);
- LLGLDepthTest depth(GL_TRUE, GL_FALSE);
- glColor4fv(color.mV);
+ glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+ glColor3fv(color.mV);
buff->drawArrays(LLRender::TRIANGLES, 0, buff->getNumVerts());
+ glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+
+ {
+ LLGLEnable blend(GL_BLEND);
+ gGL.setSceneBlendType(LLRender::BT_ALPHA);
+ LLGLDepthTest depth(GL_TRUE, GL_FALSE);
+ glColor4fv(color.mV);
+ buff->drawArrays(LLRender::TRIANGLES, 0, buff->getNumVerts());
+ }
+ gGL.popMatrix();
}
- gGL.popMatrix();
}
}