diff options
-rw-r--r-- | indra/newview/llagent.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llvoavatar.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llvoavatar.h | 2 | ||||
-rw-r--r-- | indra/newview/llvoavatarself.cpp | 43 | ||||
-rw-r--r-- | indra/newview/llvoavatarself.h | 1 |
5 files changed, 47 insertions, 3 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 7a540a45c4..fb2ecb3bed 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -6326,7 +6326,7 @@ void LLAgent::sendAgentSetAppearance() msg->addU8Fast(_PREHASH_TextureIndex, (U8)texture_index); } msg->nextBlockFast(_PREHASH_ObjectData); - mAvatarObject->packTEMessage( gMessageSystem ); + mAvatarObject->sendAppearanceMessage( gMessageSystem ); } else { diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index b6c1ee2f11..75e35e5221 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -6267,7 +6267,7 @@ LLColor4 LLVOAvatar::getDummyColor() return DUMMY_COLOR; } -void LLVOAvatar::dumpAvatarTEs( const std::string& context ) +void LLVOAvatar::dumpAvatarTEs( const std::string& context ) const { /* const char* te_name[] = { "TEX_HEAD_BODYPAINT ", diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 2fd1a506a9..4b3e850e7a 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -889,7 +889,7 @@ public: static void dumpArchetypeXML(void*); static void dumpBakedStatus(); const std::string getBakedStatusForPrintout() const; - void dumpAvatarTEs(const std::string& context); + void dumpAvatarTEs(const std::string& context) const; static F32 sUnbakedTime; // Total seconds with >=1 unbaked avatars static F32 sUnbakedUpdateTime; // Last time stats were updated (to prevent multiple updates per frame) diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 711e9f90fc..d9c5e932a2 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2074,6 +2074,49 @@ void LLVOAvatarSelf::setInvisible(BOOL newvalue) } } +// HACK: this will null out the avatar's local texture IDs before the TE message is sent +// to ensure local texture IDs are not sent to other clients in the area. +// this is a short-term solution. The long term solution will be to not set the texture +// IDs in the avatar object, and keep them only in the wearable. +// This will involve further refactoring that is too risky for the initial release of 2.0. +bool LLVOAvatarSelf::sendAppearanceMessage(LLMessageSystem *mesgsys) const +{ + LLUUID texture_id[TEX_NUM_INDICES]; + // pack away current TEs to make sure we don't send them out + for (LLVOAvatarDictionary::Textures::const_iterator iter = LLVOAvatarDictionary::getInstance()->getTextures().begin(); + iter != LLVOAvatarDictionary::getInstance()->getTextures().end(); + ++iter) + { + const ETextureIndex index = iter->first; + const LLVOAvatarDictionary::TextureEntry *texture_dict = iter->second; + if (!texture_dict->mIsBakedTexture) + { + LLTextureEntry* entry = getTE((U8) index); + texture_id[index] = entry->getID(); + entry->setID(IMG_DEFAULT_AVATAR); + } + } + + bool success = packTEMessage(mesgsys); + + // unpack TEs to make sure we don't re-trigger a bake + for (LLVOAvatarDictionary::Textures::const_iterator iter = LLVOAvatarDictionary::getInstance()->getTextures().begin(); + iter != LLVOAvatarDictionary::getInstance()->getTextures().end(); + ++iter) + { + const ETextureIndex index = iter->first; + const LLVOAvatarDictionary::TextureEntry *texture_dict = iter->second; + if (!texture_dict->mIsBakedTexture) + { + LLTextureEntry* entry = getTE((U8) index); + entry->setID(texture_id[index]); + } + } + + return success; +} + + //------------------------------------------------------------------------ // needsRenderBeam() //------------------------------------------------------------------------ diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index 6702f030fe..a1cad82eff 100644 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -310,6 +310,7 @@ public: public: static void onChangeSelfInvisible(BOOL newvalue); void setInvisible(BOOL newvalue); + bool sendAppearanceMessage(LLMessageSystem *mesgsys) const; /** Appearance ** ** |