diff options
author | Xiaohong Bao <bao@lindenlab.com> | 2010-12-22 10:56:27 -0700 |
---|---|---|
committer | Xiaohong Bao <bao@lindenlab.com> | 2010-12-22 10:56:27 -0700 |
commit | 3aa7b9f83e2dd5fa68637a31268bad8fec6cfe3b (patch) | |
tree | ee5901e8c622feab7540d816a86f19399c1cea76 /indra/newview/llmeshrepository.cpp | |
parent | 693b838b721c9d9405eda993cf2df38d9ed6e545 (diff) | |
parent | 8ba0baa63109d5e45c1f3cfd75c7d230ff99031f (diff) |
Automated merge with http://hg.secondlife.com/mesh-development
Diffstat (limited to 'indra/newview/llmeshrepository.cpp')
-rwxr-xr-x | indra/newview/llmeshrepository.cpp | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 861db7fd5d..dd2dcffc28 100755 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -1487,7 +1487,7 @@ void LLMeshUploadThread::run() { textures.insert(material_iter->mDiffuseMap); - LLTextureUploadData data(material_iter->mDiffuseMap, material_iter->mDiffuseMapLabel); + LLTextureUploadData data(material_iter->mDiffuseMap.get(), material_iter->mDiffuseMapLabel); uploadTexture(data); } } @@ -2136,6 +2136,24 @@ void LLMeshRepository::shutdown() LLConvexDecomposition::quitSystem(); } +//called in the main thread. +S32 LLMeshRepository::update() +{ + if(mUploadWaitList.empty()) + { + return 0 ; + } + + S32 size = mUploadWaitList.size() ; + for (S32 i = 0; i < size; ++i) + { + mUploads.push_back(mUploadWaitList[i]); + mUploadWaitList[i]->start() ; + } + mUploadWaitList.clear() ; + + return size ; +} S32 LLMeshRepository::loadMesh(LLVOVolume* vobj, const LLVolumeParams& mesh_params, S32 detail) { @@ -2658,8 +2676,7 @@ void LLMeshRepository::uploadModel(std::vector<LLModelInstance>& data, LLVector3 bool upload_skin, bool upload_joints) { LLMeshUploadThread* thread = new LLMeshUploadThread(data, scale, upload_textures, upload_skin, upload_joints); - mUploads.push_back(thread); - thread->start(); + mUploadWaitList.push_back(thread); } S32 LLMeshRepository::getMeshSize(const LLUUID& mesh_id, S32 lod) @@ -2746,7 +2763,7 @@ void LLMeshUploadThread::sendCostRequest(LLMeshUploadData& data) void LLMeshUploadThread::sendCostRequest(LLTextureUploadData& data) { - if (data.mTexture.notNull() && data.mTexture->getDiscardLevel() >= 0) + if (data.mTexture && data.mTexture->getDiscardLevel() >= 0) { LLSD asset_resources = LLSD::emptyMap(); |