summaryrefslogtreecommitdiff
path: root/indra/newview/llmeshrepository.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llmeshrepository.cpp')
-rw-r--r--indra/newview/llmeshrepository.cpp42
1 files changed, 23 insertions, 19 deletions
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index a5601dafbe..9a2f47cc8d 100644
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -1355,7 +1355,7 @@ bool LLMeshRepoThread::fetchMeshSkinInfo(const LLUUID& mesh_id, bool can_retry)
{
//check cache for mesh skin info
LLFileSystem file(mesh_id, LLAssetType::AT_MESH);
- if (file.getSize() >= offset+size)
+ if (file.getSize() >= offset + size)
{
U8* buffer = new(std::nothrow) U8[size];
if (!buffer)
@@ -1372,7 +1372,7 @@ bool LLMeshRepoThread::fetchMeshSkinInfo(const LLUUID& mesh_id, bool can_retry)
bool zero = true;
for (S32 i = 0; i < llmin(size, 1024) && zero; ++i)
{
- zero = buffer[i] > 0 ? false : true;
+ zero = buffer[i] == 0;
}
if (!zero)
@@ -1486,7 +1486,7 @@ bool LLMeshRepoThread::fetchMeshDecomposition(const LLUUID& mesh_id)
bool zero = true;
for (S32 i = 0; i < llmin(size, 1024) && zero; ++i)
{
- zero = buffer[i] > 0 ? false : true;
+ zero = buffer[i] == 0;
}
if (!zero)
@@ -1584,7 +1584,7 @@ bool LLMeshRepoThread::fetchMeshPhysicsShape(const LLUUID& mesh_id)
bool zero = true;
for (S32 i = 0; i < llmin(size, 1024) && zero; ++i)
{
- zero = buffer[i] > 0 ? false : true;
+ zero = buffer[i] == 0;
}
if (!zero)
@@ -1784,7 +1784,7 @@ bool LLMeshRepoThread::fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod,
bool zero = true;
for (S32 i = 0; i < llmin(size, 1024) && zero; ++i)
{
- zero = buffer[i] > 0 ? false : true;
+ zero = buffer[i] == 0;
}
if (!zero)
@@ -2293,8 +2293,8 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures)
mUploadSkin,
mUploadJoints,
mLockScaleIfJointPosition,
- FALSE,
- FALSE,
+ false,
+ false,
data.mBaseModel->mSubmodelID);
data.mAssetData = ostr.str();
@@ -2360,17 +2360,19 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures)
std::stringstream texture_str;
if (texture != NULL && include_textures && mUploadTextures)
{
- if(texture->hasSavedRawImage())
- {
+ if (texture->hasSavedRawImage())
+ {
+ LLImageDataLock lock(texture->getSavedRawImage());
+
LLPointer<LLImageJ2C> upload_file =
LLViewerTextureList::convertToUploadFile(texture->getSavedRawImage());
if (!upload_file.isNull() && upload_file->getDataSize())
{
- texture_str.write((const char*) upload_file->getData(), upload_file->getDataSize());
+ texture_str.write((const char*) upload_file->getData(), upload_file->getDataSize());
+ }
}
}
- }
if (texture != NULL &&
mUploadTextures &&
@@ -2448,8 +2450,8 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures)
mUploadSkin,
mUploadJoints,
mLockScaleIfJointPosition,
- FALSE,
- FALSE,
+ false,
+ false,
data.mBaseModel->mSubmodelID);
data.mAssetData = ostr.str();
@@ -2514,17 +2516,19 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures)
std::stringstream texture_str;
if (texture != NULL && include_textures && mUploadTextures)
{
- if(texture->hasSavedRawImage())
- {
+ if (texture->hasSavedRawImage())
+ {
+ LLImageDataLock lock(texture->getSavedRawImage());
+
LLPointer<LLImageJ2C> upload_file =
LLViewerTextureList::convertToUploadFile(texture->getSavedRawImage());
if (!upload_file.isNull() && upload_file->getDataSize())
{
- texture_str.write((const char*) upload_file->getData(), upload_file->getDataSize());
+ texture_str.write((const char*) upload_file->getData(), upload_file->getDataSize());
+ }
}
}
- }
if (texture != NULL &&
mUploadTextures &&
@@ -4378,7 +4382,7 @@ void LLMeshUploadThread::decomposeMeshMatrix(LLMatrix4& transformation,
LLVector3& result_scale)
{
// check for reflection
- BOOL reflected = (transformation.determinant() < 0);
+ bool reflected = (transformation.determinant() < 0);
// compute position
LLVector3 position = LLVector3(0, 0, 0) * transformation;
@@ -5493,7 +5497,7 @@ void on_new_single_inventory_upload_complete(
// Show the preview panel for textures and sounds to let
// user know that the image (or snapshot) arrived intact.
- LLInventoryPanel* panel = LLInventoryPanel::getActiveInventoryPanel(FALSE);
+ LLInventoryPanel* panel = LLInventoryPanel::getActiveInventoryPanel(false);
if (panel)
{