diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2012-10-03 18:16:48 -0400 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2012-10-03 18:16:48 -0400 |
commit | 13d6a9920d06bd718b632c0980f8340909b8187c (patch) | |
tree | 67d55c64b9a951f7ec3ff82823efbd7055c12673 /indra/llappearance/llavatarappearancedefines.cpp | |
parent | e29b66ed6ce29528f7b733c51db22a31a05d3a5f (diff) | |
parent | 358b0ca5fffbd2357233ba789e8f2f2a9691cf14 (diff) |
merge
Diffstat (limited to 'indra/llappearance/llavatarappearancedefines.cpp')
-rw-r--r-- | indra/llappearance/llavatarappearancedefines.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/indra/llappearance/llavatarappearancedefines.cpp b/indra/llappearance/llavatarappearancedefines.cpp index 0416309fc7..f1c78946a1 100644 --- a/indra/llappearance/llavatarappearancedefines.cpp +++ b/indra/llappearance/llavatarappearancedefines.cpp @@ -220,7 +220,7 @@ ETextureIndex LLAvatarAppearanceDictionary::bakedToLocalTextureIndex(EBakedTextu return LLAvatarAppearanceDictionary::getInstance()->getBakedTexture(index)->mTextureIndex; } -//static +// static EBakedTextureIndex LLAvatarAppearanceDictionary::findBakedByRegionName(std::string name) { U8 index = 0; @@ -238,6 +238,28 @@ EBakedTextureIndex LLAvatarAppearanceDictionary::findBakedByRegionName(std::stri return BAKED_NUM_INDICES; } +// static +EBakedTextureIndex LLAvatarAppearanceDictionary::findBakedByImageName(std::string name) +{ + U8 index = 0; + while (index < BAKED_NUM_INDICES) + { + const BakedEntry *be = LLAvatarAppearanceDictionary::getInstance()->getBakedTexture((EBakedTextureIndex) index); + if (be) + { + const TextureEntry *te = LLAvatarAppearanceDictionary::getInstance()->getTexture(be->mTextureIndex); + if (te && te->mDefaultImageName.compare(name) == 0) + { + // baked texture found + return (EBakedTextureIndex) index; + } + } + index++; + } + // baked texture could not be found + return BAKED_NUM_INDICES; +} + // static LLWearableType::EType LLAvatarAppearanceDictionary::getTEWearableType(ETextureIndex index ) { |