diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2018-06-21 15:49:53 +0100 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2018-06-21 15:49:53 +0100 |
commit | 9d7b353cbb5c12cd74559a8f3a7365312f95d4d0 (patch) | |
tree | b35c3e3eb0c9c93cea2c01248a3943d5c1277fa7 /indra/newview/llvoavatar.cpp | |
parent | 8abfd8da4fb222382437f4b547567fabc6f75cf8 (diff) | |
parent | dc07de2f4a4c49d1877bf743b6f0d209392f6eb6 (diff) |
merge
Diffstat (limited to 'indra/newview/llvoavatar.cpp')
-rw-r--r-- | indra/newview/llvoavatar.cpp | 50 |
1 files changed, 41 insertions, 9 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index d499fb98a2..c4eadc131a 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1025,7 +1025,7 @@ void LLVOAvatar::dumpBakedStatus() const ETextureIndex index = baked_dict->mTextureIndex; if (!inst->isTextureDefined(index)) { - LL_CONT << " " << LLAvatarAppearanceDictionary::getInstance()->getTexture(index)->mName; + LL_CONT << " " << (LLAvatarAppearanceDictionary::getInstance()->getTexture(index) ? LLAvatarAppearanceDictionary::getInstance()->getTexture(index)->mName : ""); } } LL_CONT << " ) " << inst->getUnbakedPixelAreaRank(); @@ -5046,7 +5046,7 @@ void LLVOAvatar::collectLocalTextureUUIDs(std::set<LLUUID>& ids) const if (imagep) { const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = LLAvatarAppearanceDictionary::getInstance()->getTexture((ETextureIndex)texture_index); - if (texture_dict->mIsLocalTexture) + if (texture_dict && texture_dict->mIsLocalTexture) { ids.insert(imagep->getID()); } @@ -5203,8 +5203,8 @@ void LLVOAvatar::updateTextures() if (imagep) { const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = LLAvatarAppearanceDictionary::getInstance()->getTexture((ETextureIndex)texture_index); - const EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex; - if (texture_dict->mIsLocalTexture) + const EBakedTextureIndex baked_index = texture_dict ? texture_dict->mBakedTextureIndex : EBakedTextureIndex::BAKED_NUM_INDICES; + if (texture_dict && texture_dict->mIsLocalTexture) { addLocalTextureStats((ETextureIndex)texture_index, imagep, texel_area_ratio, render_avatar, mBakedTextureDatas[baked_index].mIsUsed); } @@ -5662,6 +5662,11 @@ LLUUID LLVOAvatar::remapMotionID(const LLUUID& id) if (use_new_walk_run) result = ANIM_AGENT_RUN_NEW; } + // keeps in sync with setSex() related code (viewer controls sit's sex) + else if (id == ANIM_AGENT_SIT_FEMALE) + { + result = ANIM_AGENT_SIT; + } } @@ -6585,7 +6590,26 @@ void LLVOAvatar::initAttachmentPoints(bool ignore_hud_joints) //----------------------------------------------------------------------------- void LLVOAvatar::updateVisualParams() { - setSex( (getVisualParamWeight( "male" ) > 0.5f) ? SEX_MALE : SEX_FEMALE ); + ESex avatar_sex = (getVisualParamWeight("male") > 0.5f) ? SEX_MALE : SEX_FEMALE; + if (getSex() != avatar_sex) + { + if (mIsSitting && findMotion(avatar_sex == SEX_MALE ? ANIM_AGENT_SIT_FEMALE : ANIM_AGENT_SIT) != NULL) + { + // In some cases of gender change server changes sit motion with motion message, + // but in case of some avatars (legacy?) there is no update from server side, + // likely because server doesn't know about difference between motions + // (female and male sit ids are same server side, so it is likely unaware that it + // need to send update) + // Make sure motion is up to date + stopMotion(ANIM_AGENT_SIT); + setSex(avatar_sex); + startMotion(ANIM_AGENT_SIT); + } + else + { + setSex(avatar_sex); + } + } LLCharacter::updateVisualParams(); @@ -9074,6 +9098,8 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara apr_file_printf( file, "<linden_genepool version=\"1.0\">\n" ); apr_file_printf( file, "\n\t<archetype name=\"???\">\n" ); + bool agent_is_godlike = gAgent.isGodlikeWithoutAdminMenuFakery(); + if (group_by_wearables) { for (S32 type = LLWearableType::WT_SHAPE; type < LLWearableType::WT_COUNT; type++) @@ -9099,8 +9125,11 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara LLViewerTexture* te_image = getImage((ETextureIndex)te, 0); if( te_image ) { - std::string uuid_str; - te_image->getID().toString( uuid_str ); + std::string uuid_str = LLUUID().asString(); + if (agent_is_godlike) + { + te_image->getID().toString(uuid_str); + } apr_file_printf( file, "\t\t<texture te=\"%i\" uuid=\"%s\"/>\n", te, uuid_str.c_str()); } } @@ -9122,8 +9151,11 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara LLViewerTexture* te_image = getImage((ETextureIndex)te, 0); if( te_image ) { - std::string uuid_str; - te_image->getID().toString( uuid_str ); + std::string uuid_str = LLUUID().asString(); + if (agent_is_godlike) + { + te_image->getID().toString(uuid_str); + } apr_file_printf( file, "\t\t<texture te=\"%i\" uuid=\"%s\"/>\n", te, uuid_str.c_str()); } } |