diff options
author | Xiaohong Bao <bao@lindenlab.com> | 2011-06-15 16:20:33 -0600 |
---|---|---|
committer | Xiaohong Bao <bao@lindenlab.com> | 2011-06-15 16:20:33 -0600 |
commit | 0bb7bcc96cfea7b5d56f083d0afcbc1fce7e9f21 (patch) | |
tree | 46b49b78517bdf835cc5abf503c2c5c730702ced /indra/newview/llmeshrepository.cpp | |
parent | a451c9e83431c7d39ef912680bf9d7411c7a12d2 (diff) |
fix for SH-1788: Assert in texture load when uploading textured mesh model
and beyond: fixed the thread-safe and highest texture resolution flaws in the mesh texture uploading flow.
Diffstat (limited to 'indra/newview/llmeshrepository.cpp')
-rwxr-xr-x | indra/newview/llmeshrepository.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 4673289094..f8ffb16adb 100755 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -1556,16 +1556,12 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures) std::stringstream texture_str; if (texture != NULL && include_textures && mUploadTextures) { - // Get binary rep of texture, if needed. - LLTextureUploadData data(texture, material.mDiffuseMapLabel); - if (!data.mTexture->isRawImageValid()) - { - data.mTexture->reloadRawImage(data.mTexture->getDiscardLevel()); + if(texture->hasSavedRawImage()) + { + LLPointer<LLImageJ2C> upload_file = + LLViewerTextureList::convertToUploadFile(texture->getSavedRawImage()); + texture_str.write((const char*) upload_file->getData(), upload_file->getDataSize()); } - - LLPointer<LLImageJ2C> upload_file = - LLViewerTextureList::convertToUploadFile(data.mTexture->getRawImage()); - texture_str.write((const char*) upload_file->getData(), upload_file->getDataSize()); } if (texture != NULL && @@ -2868,9 +2864,12 @@ void LLMeshUploadThread::doUploadTexture(LLTextureUploadData& data) data.mTexture->reloadRawImage(data.mTexture->getDiscardLevel()); } - LLPointer<LLImageJ2C> upload_file = LLViewerTextureList::convertToUploadFile(data.mTexture->getRawImage()); + if(data.mTexture->hasSavedRawImage()) + { + LLPointer<LLImageJ2C> upload_file = LLViewerTextureList::convertToUploadFile(data.mTexture->getSavedRawImage()); - ostr.write((const char*) upload_file->getData(), upload_file->getDataSize()); + ostr.write((const char*) upload_file->getData(), upload_file->getDataSize()); + } data.mAssetData = ostr.str(); |