diff options
Diffstat (limited to 'indra/newview/llviewerobject.cpp')
-rw-r--r-- | indra/newview/llviewerobject.cpp | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 15d7ac7ad4..37e6fa080a 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -4368,11 +4368,6 @@ void LLViewerObject::sendTEUpdate() const LLViewerTexture* LLViewerObject::getBakedTextureForMagicId(const LLUUID& id) { - if (!isAttachment()) - { - return NULL; - } - if (!LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(id)) { return NULL; @@ -4382,7 +4377,19 @@ LLViewerTexture* LLViewerObject::getBakedTextureForMagicId(const LLUUID& id) if (avatar) { LLAvatarAppearanceDefines::ETextureIndex texIndex = LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::bakedToLocalTextureIndex(LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::assetIdToBakedTextureIndex(id)); - return avatar->getBakedTextureImage(texIndex, avatar->getTE(texIndex)->getID()); + LLViewerTexture* bakedTexture = avatar->getBakedTextureImage(texIndex, avatar->getTE(texIndex)->getID()); + if (bakedTexture == NULL || bakedTexture->isMissingAsset()) + { + return LLViewerTextureManager::getFetchedTexture(id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); + } + else + { + return bakedTexture; + } + } + else + { + return LLViewerTextureManager::getFetchedTexture(id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); } return NULL; @@ -4434,6 +4441,20 @@ void LLViewerObject::setTE(const U8 te, const LLTextureEntry &texture_entry) } } +void LLViewerObject::refreshBakeTexture() +{ + for (int face_index = 0; face_index < getNumTEs(); face_index++) + { + LLTextureEntry* tex_entry = getTE(face_index); + if (tex_entry && LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(tex_entry->getID())) + { + const LLUUID& image_id = tex_entry->getID(); + LLViewerTexture* bakedTexture = getBakedTextureForMagicId(image_id); + changeTEImage(face_index, bakedTexture); + } + } +} + void LLViewerObject::setTEImage(const U8 te, LLViewerTexture *imagep) { if (mTEImages[te] != imagep) |