summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2011-06-01 23:54:49 -0500
committerDave Parks <davep@lindenlab.com>2011-06-01 23:54:49 -0500
commitd78ecc6c283cfee568a08d739bc6f5eec3b9828f (patch)
tree76351b220cfa1e79b15edb21d03d81051853a09b
parente881ee54d0f6cbddcc08bfd30d09232ed891df08 (diff)
SH-812 Fix for rigged meshes not showing up as rigged until LoD switch.
-rw-r--r--indra/newview/lldrawpoolavatar.cpp2
-rwxr-xr-xindra/newview/llmeshrepository.cpp20
-rw-r--r--indra/newview/llmeshrepository.h5
-rw-r--r--indra/newview/llvoavatar.cpp2
-rw-r--r--indra/newview/llvovolume.cpp8
5 files changed, 25 insertions, 12 deletions
diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp
index 7c017f5694..870aec4eff 100644
--- a/indra/newview/lldrawpoolavatar.cpp
+++ b/indra/newview/lldrawpoolavatar.cpp
@@ -1456,7 +1456,7 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow)
continue;
}
- const LLMeshSkinInfo* skin = gMeshRepo.getSkinInfo(mesh_id);
+ const LLMeshSkinInfo* skin = gMeshRepo.getSkinInfo(mesh_id, vobj);
if (!skin)
{
continue;
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index bef2a09e6c..12e0b26fed 100755
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -2630,6 +2630,20 @@ void LLMeshRepository::notifyLoadedMeshes()
void LLMeshRepository::notifySkinInfoReceived(LLMeshSkinInfo& info)
{
mSkinMap[info.mMeshID] = info;
+
+ skin_load_map::iterator iter = mLoadingSkins.find(info.mMeshID);
+ if (iter != mLoadingSkins.end())
+ {
+ for (std::set<LLUUID>::iterator obj_id = iter->second.begin(); obj_id != iter->second.end(); ++obj_id)
+ {
+ LLVOVolume* vobj = (LLVOVolume*) gObjectList.findObject(*obj_id);
+ if (vobj)
+ {
+ vobj->notifyMeshLoaded();
+ }
+ }
+ }
+
mLoadingSkins.erase(info.mMeshID);
}
@@ -2745,7 +2759,7 @@ U32 LLMeshRepository::getResourceCost(const LLUUID& mesh_id)
return mThread->getResourceCost(mesh_id);
}
-const LLMeshSkinInfo* LLMeshRepository::getSkinInfo(const LLUUID& mesh_id)
+const LLMeshSkinInfo* LLMeshRepository::getSkinInfo(const LLUUID& mesh_id, LLVOVolume* requesting_obj)
{
if (mesh_id.notNull())
{
@@ -2759,12 +2773,12 @@ const LLMeshSkinInfo* LLMeshRepository::getSkinInfo(const LLUUID& mesh_id)
{
LLMutexLock lock(mMeshMutex);
//add volume to list of loading meshes
- std::set<LLUUID>::iterator iter = mLoadingSkins.find(mesh_id);
+ skin_load_map::iterator iter = mLoadingSkins.find(mesh_id);
if (iter == mLoadingSkins.end())
{ //no request pending for this skin info
- mLoadingSkins.insert(mesh_id);
mPendingSkinRequests.push(mesh_id);
}
+ mLoadingSkins[mesh_id].insert(requesting_obj->getID());
}
}
diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h
index 0a6954bade..9b80fc02b3 100644
--- a/indra/newview/llmeshrepository.h
+++ b/indra/newview/llmeshrepository.h
@@ -475,7 +475,7 @@ public:
static S32 getActualMeshLOD(LLSD& header, S32 lod);
U32 calcResourceCost(LLSD& header);
U32 getResourceCost(const LLUUID& mesh_params);
- const LLMeshSkinInfo* getSkinInfo(const LLUUID& mesh_id);
+ const LLMeshSkinInfo* getSkinInfo(const LLUUID& mesh_id, LLVOVolume* requesting_obj);
LLModel::Decomposition* getDecomposition(const LLUUID& mesh_id);
void fetchPhysicsShape(const LLUUID& mesh_id);
bool hasPhysicsShape(const LLUUID& mesh_id);
@@ -504,7 +504,8 @@ public:
std::vector<LLMeshRepoThread::LODRequest> mPendingRequests;
//list of mesh ids awaiting skin info
- std::set<LLUUID> mLoadingSkins;
+ typedef std::map<LLUUID, std::set<LLUUID> > skin_load_map;
+ skin_load_map mLoadingSkins;
//list of mesh ids that need to send skin info fetch requests
std::queue<LLUUID> mPendingSkinRequests;
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index dc355362ce..77bbf994e9 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -6004,7 +6004,7 @@ void LLVOAvatar::cleanupAttachedMesh( LLViewerObject* pVO )
LLVOVolume* pVObj = pVO->mDrawable->getVOVolume();
if ( pVObj )
{
- const LLMeshSkinInfo* pSkinData = gMeshRepo.getSkinInfo( pVObj->getVolume()->getParams().getSculptID() );
+ const LLMeshSkinInfo* pSkinData = gMeshRepo.getSkinInfo( pVObj->getVolume()->getParams().getSculptID(), pVObj );
if ( pSkinData )
{
const int jointCnt = pSkinData->mJointNames.size();
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 125283d474..6e84884dee 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -1096,8 +1096,6 @@ void LLVOVolume::updateSculptTexture()
}
-
-
void LLVOVolume::notifyMeshLoaded()
{
mSculptChanged = TRUE;
@@ -3534,7 +3532,7 @@ void LLVOVolume::updateRiggedVolume()
LLVolume* volume = getVolume();
- const LLMeshSkinInfo* skin = gMeshRepo.getSkinInfo(volume->getParams().getSculptID());
+ const LLMeshSkinInfo* skin = gMeshRepo.getSkinInfo(volume->getParams().getSculptID(), this);
if (!skin)
{
@@ -3986,7 +3984,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
bool rigged = vobj->isAttachment() &&
vobj->isMesh() &&
- gMeshRepo.getSkinInfo(vobj->getVolume()->getParams().getSculptID());
+ gMeshRepo.getSkinInfo(vobj->getVolume()->getParams().getSculptID(), vobj);
bool bake_sunlight = LLPipeline::sBakeSunlight && drawablep->isStatic();
@@ -4028,7 +4026,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
if ( pAvatarVO )
{
LLUUID currentId = vobj->getVolume()->getParams().getSculptID();
- const LLMeshSkinInfo* pSkinData = gMeshRepo.getSkinInfo( currentId );
+ const LLMeshSkinInfo* pSkinData = gMeshRepo.getSkinInfo( currentId, vobj );
if ( pSkinData )
{