diff options
author | Ruslan Teliuk <ruslantproductengine@lindenlab.com> | 2018-11-27 17:45:45 +0200 |
---|---|---|
committer | Ruslan Teliuk <ruslantproductengine@lindenlab.com> | 2018-11-27 17:45:45 +0200 |
commit | 4ab4c4498a04576a3cddf3533359a15a636b53b6 (patch) | |
tree | 064d6b7b40927a4b87803d6daf7f8db1a846ede6 /indra/newview/lldrawpoolavatar.cpp | |
parent | acc86a9139872e182fbeb5b9fc7daa12c5d2c029 (diff) | |
parent | c21396181b090b626d7a9f989bcead2e517bb75f (diff) |
Merged lindenlab/viewer-cougar into default
Diffstat (limited to 'indra/newview/lldrawpoolavatar.cpp')
-rw-r--r-- | indra/newview/lldrawpoolavatar.cpp | 59 |
1 files changed, 42 insertions, 17 deletions
diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index a1003aa864..63abadbcf4 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -110,6 +110,32 @@ LLDrawPoolAvatar::LLDrawPoolAvatar() : { } +LLDrawPoolAvatar::~LLDrawPoolAvatar() +{ + if (!isDead()) + { + LL_WARNS() << "Destroying avatar drawpool that still contains faces" << LL_ENDL; + } +} + +// virtual +BOOL LLDrawPoolAvatar::isDead() +{ + if (!LLFacePool::isDead()) + { + return FALSE; + } + + for (U32 i = 0; i < NUM_RIGGED_PASSES; ++i) + { + if (mRiggedFace[i].size() > 0) + { + return FALSE; + } + } + return TRUE; +} + //----------------------------------------------------------------------------- // instancePool() //----------------------------------------------------------------------------- @@ -526,7 +552,7 @@ void LLDrawPoolAvatar::renderShadow(S32 pass) } LLVOAvatar *avatarp = (LLVOAvatar *)facep->getDrawable()->getVObj().get(); - if (avatarp->isDead() || avatarp->mIsDummy || avatarp->mDrawable.isNull()) + if (avatarp->isDead() || avatarp->isUIAvatar() || avatarp->mDrawable.isNull()) { return; } @@ -1793,7 +1819,7 @@ void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer( void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) { - if (avatar->isSelf() && !gAgent.needsRenderAvatar()) + if (!avatar->shouldRenderRigged()) { return; } @@ -1831,13 +1857,7 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) continue; } - LLUUID mesh_id = volume->getParams().getSculptID(); - if (mesh_id.isNull()) - { - continue; - } - - const LLMeshSkinInfo* skin = gMeshRepo.getSkinInfo(mesh_id, vobj); + const LLMeshSkinInfo* skin = vobj->getSkinInfo(); if (!skin) { continue; @@ -2125,13 +2145,7 @@ void LLDrawPoolAvatar::updateRiggedVertexBuffers(LLVOAvatar* avatar) continue; } - LLUUID mesh_id = volume->getParams().getSculptID(); - if (mesh_id.isNull()) - { - continue; - } - - const LLMeshSkinInfo* skin = gMeshRepo.getSkinInfo(mesh_id, vobj); + const LLMeshSkinInfo* skin = vobj->getSkinInfo(); if (!skin) { continue; @@ -2252,11 +2266,16 @@ LLColor3 LLDrawPoolAvatar::getDebugColor() const void LLDrawPoolAvatar::addRiggedFace(LLFace* facep, U32 type) { + llassert (facep->isState(LLFace::RIGGED)); + llassert(getType() == LLDrawPool::POOL_AVATAR); + if (facep->getPool() && facep->getPool() != this) + { + LL_ERRS() << "adding rigged face that's already in another pool" << LL_ENDL; + } if (type >= NUM_RIGGED_PASSES) { LL_ERRS() << "Invalid rigged face type." << LL_ENDL; } - if (facep->getRiggedIndex(type) != -1) { LL_ERRS() << "Tried to add a rigged face that's referenced elsewhere." << LL_ENDL; @@ -2269,6 +2288,12 @@ void LLDrawPoolAvatar::addRiggedFace(LLFace* facep, U32 type) void LLDrawPoolAvatar::removeRiggedFace(LLFace* facep) { + llassert (facep->isState(LLFace::RIGGED)); + llassert(getType() == LLDrawPool::POOL_AVATAR); + if (facep->getPool() != this) + { + LL_ERRS() << "Tried to remove a rigged face from the wrong pool" << LL_ENDL; + } facep->setPool(NULL); for (U32 i = 0; i < NUM_RIGGED_PASSES; ++i) |