diff options
-rw-r--r-- | indra/newview/llmeshrepository.cpp | 64 |
1 files changed, 35 insertions, 29 deletions
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 4b2fafccd4..7bbb7f2ecd 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -1471,47 +1471,53 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures) void LLMeshUploadThread::generateHulls() { + bool has_valid_requests = false ; + for (instance_map::iterator iter = mInstance.begin(); iter != mInstance.end(); ++iter) - { - LLMeshUploadData data; - data.mBaseModel = iter->first; + { + LLMeshUploadData data; + data.mBaseModel = iter->first; - LLModelInstance& instance = *(iter->second.begin()); + LLModelInstance& instance = *(iter->second.begin()); - for (S32 i = 0; i < 5; i++) - { - data.mModel[i] = instance.mLOD[i]; - } + for (S32 i = 0; i < 5; i++) + { + data.mModel[i] = instance.mLOD[i]; + } - //queue up models for hull generation - LLModel* physics = NULL; + //queue up models for hull generation + LLModel* physics = NULL; - if (data.mModel[LLModel::LOD_PHYSICS].notNull()) - { - physics = data.mModel[LLModel::LOD_PHYSICS]; - } - else if (data.mModel[LLModel::LOD_MEDIUM].notNull()) - { - physics = data.mModel[LLModel::LOD_MEDIUM]; - } - else - { - physics = data.mModel[LLModel::LOD_HIGH]; - } + if (data.mModel[LLModel::LOD_PHYSICS].notNull()) + { + physics = data.mModel[LLModel::LOD_PHYSICS]; + } + else if (data.mModel[LLModel::LOD_MEDIUM].notNull()) + { + physics = data.mModel[LLModel::LOD_MEDIUM]; + } + else + { + physics = data.mModel[LLModel::LOD_HIGH]; + } - llassert(physics != NULL); + llassert(physics != NULL); - DecompRequest* request = new DecompRequest(physics, data.mBaseModel, this); - if(request->isValid()) - { - gMeshRepo.mDecompThread->submitRequest(request); - } + DecompRequest* request = new DecompRequest(physics, data.mBaseModel, this); + if(request->isValid()) + { + gMeshRepo.mDecompThread->submitRequest(request); + has_valid_requests = true ; } - + } + + if(has_valid_requests) + { while (!mPhysicsComplete) { apr_sleep(100); } + } } void LLMeshUploadThread::doWholeModelUpload() |