summaryrefslogtreecommitdiff
path: root/indra/newview/pipeline.cpp
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-04-21 11:24:16 +0100
committerTofu Linden <tofu.linden@lindenlab.com>2010-04-21 11:24:16 +0100
commitdb73037c2882af70a09ac768ddb3748d811c767a (patch)
treec159f3236cef1e8d5d4279133b6b8e811a40c44d /indra/newview/pipeline.cpp
parentcb1ece05ddb71218de4c35df520937ffdda83434 (diff)
Make markVisible as safe as it was, but hopefully not as slow as it was.
This is also sprinkled with asserts so we can see which of the NULL tests are - or aren't - needed, if it's really so important to skip them.
Diffstat (limited to 'indra/newview/pipeline.cpp')
-rw-r--r--indra/newview/pipeline.cpp25
1 files changed, 17 insertions, 8 deletions
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 368e78dc43..318d5d5ca1 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -1977,16 +1977,25 @@ void LLPipeline::markVisible(LLDrawable *drawablep, LLCamera& camera)
{
if (drawablep->isSpatialBridge())
{
- LLDrawable* root = ((LLSpatialBridge*) drawablep)->mDrawable;
- llassert(root);
- if (root->getVObj()->isAttachment())
+ const LLDrawable* root = ((LLSpatialBridge*) drawablep)->mDrawable;
+ llassert(root); // trying to catch a bad assumption
+ if (root && // // this test may not be needed, see above
+ root->getVObj()->isAttachment())
{
- llassert(root->getParent());
- llassert(root->getParent()->getVObj());
- LLVOAvatar* av = root->getParent()->getVObj()->asAvatar();
- if (av && av->isImpostor())
+ LLDrawable* rootparent = root->getParent();
+ llassert(rootparent); // trying to catch a bad assumption
+ if (rootparent) // this test may not be needed, see above
{
- return;
+ LLViewerObject *vobj = rootparent->getVObj();
+ llassert(vobj); // trying to catch a bad assumption
+ if (vobj) // this test may not be needed, see above
+ {
+ const LLVOAvatar* av = vobj->asAvatar();
+ if (av && av->isImpostor())
+ {
+ return;
+ }
+ }
}
}
sCull->pushBridge((LLSpatialBridge*) drawablep);