summaryrefslogtreecommitdiff
path: root/indra/newview/llvoavatar.cpp
diff options
context:
space:
mode:
authorAnchor Linden <anchor@lindenlab.com>2018-06-27 01:45:01 +0530
committerAnchor Linden <anchor@lindenlab.com>2018-06-27 01:45:01 +0530
commit69b2add00a9d371f6148d3102f1a54b3b6ce3175 (patch)
tree4386cf9c9a347d02cf1ce31dff96f63c89989292 /indra/newview/llvoavatar.cpp
parentf848271c288ae5ffcba58d6eebd5da73e4d99d1b (diff)
[MAINT-8513] - fix "Edit My Outfit" Changes Don't Update
Diffstat (limited to 'indra/newview/llvoavatar.cpp')
-rw-r--r--indra/newview/llvoavatar.cpp91
1 files changed, 68 insertions, 23 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 9e2a69ae65..6e49a92e97 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -7558,6 +7558,33 @@ void LLVOAvatar::updateMeshTextures()
call_remove_missing = true;
}
+ //refresh bakes on any attached objects
+ for (attachment_map_t::iterator iter = mAttachmentPoints.begin();
+ iter != mAttachmentPoints.end();
+ ++iter)
+ {
+ LLViewerJointAttachment* attachment = iter->second;
+
+ for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin();
+ attachment_iter != attachment->mAttachedObjects.end();
+ ++attachment_iter)
+ {
+ LLViewerObject* attached_object = (*attachment_iter);
+ attached_object->refreshBakeTexture();
+
+ LLViewerObject::const_child_list_t& child_list = attached_object->getChildren();
+ for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin();
+ iter != child_list.end(); ++iter)
+ {
+ LLViewerObject* objectp = *iter;
+ if (objectp)
+ {
+ objectp->refreshBakeTexture();
+ }
+ }
+ }
+ }
+
}
@@ -8336,36 +8363,54 @@ void LLVOAvatar::applyParsedAppearanceMessage(LLAppearanceMessageContents& conte
}
updateMeshTextures();
+ updateMeshVisibility();
- //refresh bakes on any attached objects
- for (attachment_map_t::iterator iter = mAttachmentPoints.begin();
- iter != mAttachmentPoints.end();
- ++iter)
+}
+
+LLViewerTexture* LLVOAvatar::getBakedTexture(const U8 te)
+{
+ if (te < 0 || te >= BAKED_NUM_INDICES)
{
- LLViewerJointAttachment* attachment = iter->second;
+ return NULL;
+ }
- for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin();
- attachment_iter != attachment->mAttachedObjects.end();
- ++attachment_iter)
- {
- LLViewerObject* attached_object = (*attachment_iter);
- attached_object->refreshBakeTexture();
+ BOOL is_layer_baked = isTextureDefined(mBakedTextureDatas[te].mTextureIndex);
+ BOOL use_lkg_baked_layer; // lkg = "last known good"
+
+ LLViewerTexLayerSet* layerset = NULL;
+ layerset = getTexLayerSet(te);
+ BOOL layerset_invalid = layerset && (!layerset->getViewerComposite()->isInitialized() || !layerset->isLocalTextureDataAvailable());
+ use_lkg_baked_layer = (!is_layer_baked && (mBakedTextureDatas[te].mLastTextureID != IMG_DEFAULT_AVATAR) && layerset_invalid);
+ if (use_lkg_baked_layer)
+ {
+ layerset->setUpdatesEnabled(TRUE);
+ }
+ else
+ {
+ use_lkg_baked_layer = (!is_layer_baked && mBakedTextureDatas[te].mLastTextureID != IMG_DEFAULT_AVATAR);
+ }
- LLViewerObject::const_child_list_t& child_list = attached_object->getChildren();
- for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin();
- iter != child_list.end(); ++iter)
- {
- LLViewerObject* objectp = *iter;
- if (objectp)
- {
- objectp->refreshBakeTexture();
- }
- }
- }
+ if (use_lkg_baked_layer && !isUsingLocalAppearance())
+ {
+ LLViewerFetchedTexture* baked_img = LLViewerTextureManager::getFetchedTexture(mBakedTextureDatas[te].mLastTextureID);
+ return baked_img;
}
+ else if (!isUsingLocalAppearance() && is_layer_baked)
+ {
+ LLViewerFetchedTexture* baked_img = LLViewerTextureManager::staticCastToFetchedTexture(getImage(mBakedTextureDatas[te].mTextureIndex, 0), TRUE);
+ return baked_img;
+ }
+ else if (layerset && isUsingLocalAppearance())
+ {
+ layerset->createComposite();
+ layerset->setUpdatesEnabled(TRUE);
- updateMeshVisibility();
+ return layerset->getViewerComposite();
+ }
+
+ return NULL;
+
}
// static