From 89d92267e233bc34fe600a07f485266e7edb2879 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Fri, 16 Oct 2009 21:41:31 +0000 Subject: svn merge -r134817:136516 svn+ssh://svn.lindenlab.com/svn/linden/branches/avatar-pipeline/avatar-pipeline-multiattachments-3 into svn+ssh://svn.lindenlab.com/svn/linden/branches/viewer/viewer-2.0.0-3 For DEV-32867 : Avatar Pipeline Project - Multi-Attachments This is a viewer-side-only, infrastructure-only merge for multi-attachments. This should not lead to any new functionality; it simply provides backwards compatibility for when multi-attachments are enabled in viewer2.1, so that viewer2.0 users can see viewer2.1 avatars correctly. Reviewed by: Vir. --- indra/newview/pipeline.cpp | 67 ++++++++++++++++++++++++++-------------------- 1 file changed, 38 insertions(+), 29 deletions(-) (limited to 'indra/newview/pipeline.cpp') diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 3800b9223d..b50e71bf48 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -3872,44 +3872,48 @@ void LLPipeline::renderForSelect(std::set& objects, BOOL render iter != avatarp->mAttachmentPoints.end(); ) { LLVOAvatar::attachment_map_t::iterator curiter = iter++; - LLViewerJointAttachment* attachmentp = curiter->second; - if (attachmentp->getIsHUDAttachment()) + LLViewerJointAttachment* attachment = curiter->second; + if (attachment->getIsHUDAttachment()) { - LLViewerObject* objectp = attachmentp->getObject(); - if (objectp) + for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin(); + attachment_iter != attachment->mAttachedObjects.end(); + ++attachment_iter) { - LLDrawable* drawable = objectp->mDrawable; - if (drawable->isDead()) + if (LLViewerObject* attached_object = (*attachment_iter)) { - continue; - } - - for (S32 j = 0; j < drawable->getNumFaces(); ++j) - { - LLFace* facep = drawable->getFace(j); - if (!facep->getPool()) + LLDrawable* drawable = attached_object->mDrawable; + if (drawable->isDead()) { - facep->renderForSelect(prim_mask); + continue; } - } - - //render child faces - LLViewerObject::const_child_list_t& child_list = objectp->getChildren(); - for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); - iter != child_list.end(); iter++) - { - LLViewerObject* child = *iter; - LLDrawable* child_drawable = child->mDrawable; - for (S32 l = 0; l < child_drawable->getNumFaces(); ++l) + + for (S32 j = 0; j < drawable->getNumFaces(); ++j) { - LLFace* facep = child_drawable->getFace(l); + LLFace* facep = drawable->getFace(j); if (!facep->getPool()) { facep->renderForSelect(prim_mask); } } + + //render child faces + LLViewerObject::const_child_list_t& child_list = attached_object->getChildren(); + for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); + iter != child_list.end(); iter++) + { + LLViewerObject* child = *iter; + LLDrawable* child_drawable = child->mDrawable; + for (S32 l = 0; l < child_drawable->getNumFaces(); ++l) + { + LLFace* facep = child_drawable->getFace(l); + if (!facep->getPool()) + { + facep->renderForSelect(prim_mask); + } + } + } } - } + } } } @@ -8682,10 +8686,15 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) iter != avatar->mAttachmentPoints.end(); ++iter) { - LLViewerObject* object = iter->second->getObject(); - if (object) + LLViewerJointAttachment *attachment = iter->second; + for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin(); + attachment_iter != attachment->mAttachedObjects.end(); + ++attachment_iter) { - markVisible(object->mDrawable->getSpatialBridge(), *LLViewerCamera::getInstance()); + if (LLViewerObject* attached_object = (*attachment_iter)) + { + markVisible(attached_object->mDrawable->getSpatialBridge(), *LLViewerCamera::getInstance()); + } } } -- cgit v1.2.3