summaryrefslogtreecommitdiff
path: root/indra/newview/llfloateravatartextures.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloateravatartextures.cpp')
-rw-r--r--indra/newview/llfloateravatartextures.cpp49
1 files changed, 47 insertions, 2 deletions
diff --git a/indra/newview/llfloateravatartextures.cpp b/indra/newview/llfloateravatartextures.cpp
index 3976e25ba4..8c7899af3e 100644
--- a/indra/newview/llfloateravatartextures.cpp
+++ b/indra/newview/llfloateravatartextures.cpp
@@ -39,6 +39,7 @@
#include "lluictrlfactory.h"
#include "llviewerobjectlist.h"
#include "llvoavatar.h"
+#include "llagentwearables.h"
using namespace LLVOAvatarDefines;
@@ -79,7 +80,26 @@ static void update_texture_ctrl(LLVOAvatar* avatarp,
LLTextureCtrl* ctrl,
ETextureIndex te)
{
- LLUUID id = avatarp->getTE(te)->getID();
+ LLUUID id = IMG_DEFAULT_AVATAR;
+ const LLVOAvatarDictionary::TextureEntry* tex_entry = LLVOAvatarDictionary::getInstance()->getTexture(te);
+ if (tex_entry->mIsLocalTexture)
+ {
+ const EWearableType wearable_type = tex_entry->mWearableType;
+ LLWearable *wearable = gAgentWearables.getWearable(wearable_type, 0);
+ if (wearable)
+ {
+ LLLocalTextureObject *lto = wearable->getLocalTextureObject(te);
+ if (lto)
+ {
+ id = lto->getID();
+ }
+ }
+ }
+ else
+ {
+ id = avatarp->getTE(te)->getID();
+ }
+ //id = avatarp->getTE(te)->getID();
if (id == IMG_DEFAULT_AVATAR)
{
ctrl->setImageAssetID(LLUUID::null);
@@ -152,7 +172,32 @@ void LLFloaterAvatarTextures::onClickDump(void* data)
const LLTextureEntry* te = avatarp->getTE(i);
if (!te) continue;
- llinfos << "Avatar TE " << i << " id " << te->getID() << llendl;
+ if (LLVOAvatar::isIndexLocalTexture((ETextureIndex)i))
+ {
+ LLUUID id = IMG_DEFAULT_AVATAR;
+ EWearableType wearable_type = LLVOAvatarDictionary::getInstance()->getTEWearableType((ETextureIndex)i);
+ LLWearable *wearable = gAgentWearables.getWearable(wearable_type, 0);
+ if (wearable)
+ {
+ LLLocalTextureObject *lto = wearable->getLocalTextureObject(i);
+ if (lto)
+ {
+ id = lto->getID();
+ }
+ }
+ if (id != IMG_DEFAULT_AVATAR)
+ {
+ llinfos << "Avatar TE " << i << " id " << id << llendl;
+ }
+ else
+ {
+ llinfos << "Avatar TE " << i << " id " << "<DEFAULT>" << llendl;
+ }
+ }
+ else
+ {
+ llinfos << "Avatar TE " << i << " id " << te->getID() << llendl;
+ }
}
#endif
}