From f066ff8c607d5c0db8cea8d9cb88eec546df1089 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 21 Apr 2010 11:24:16 +0100 Subject: 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. (transplanted from 66851d9c86b7ec5155b6c3950e2971d0d7375826) --- indra/newview/pipeline.cpp | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 8295490677..37ab95f0e8 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -1964,16 +1964,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); -- cgit v1.2.3