diff options
Diffstat (limited to 'indra')
-rwxr-xr-x | indra/newview/llagent.cpp | 32 | ||||
-rwxr-xr-x | indra/newview/llappearancemgr.cpp | 20 | ||||
-rwxr-xr-x | indra/newview/llappearancemgr.h | 7 | ||||
-rw-r--r-- | indra/newview/llsaveoutfitcombobtn.cpp | 10 | ||||
-rwxr-xr-x[-rw-r--r--] | indra/newview/llvoavatar.cpp | 328 | ||||
-rwxr-xr-x | indra/newview/llvoavatar.h | 7 |
6 files changed, 305 insertions, 99 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index e15b4d071f..1760d4769a 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -4286,12 +4286,6 @@ void LLAgent::requestLeaveGodMode() //----------------------------------------------------------------------------- void LLAgent::sendAgentSetAppearance() { - // FIXME DRANO - problems around new-style appearance in an old-style region. - // - does this get called? - // - need to change mUseServerBakes->FALSE in that case - // - need to call processAvatarAppearance as if server had returned this result? - // gAgentAvatarp->mUseServerBakes = FALSE; - if (gAgentQueryManager.mNumPendingQueries > 0) { return; @@ -4308,6 +4302,30 @@ void LLAgent::sendAgentSetAppearance() if (!isAgentAvatarValid() || (getRegion() && getRegion()->getCentralBakeVersion())) return; + // At this point we have a complete appearance to send and are in a non-baking region. + // DRANO FIXME + //gAgentAvatarp->setIsUsingServerBakes(FALSE); + S32 sb_count, host_count, both_count, neither_count; + gAgentAvatarp->bakedTextureOriginCounts(sb_count, host_count, both_count, neither_count); + if (both_count != 0 || neither_count != 0) + { + llwarns << "bad bake texture state " << sb_count << "," << host_count << "," << both_count << "," << neither_count << llendl; + } + if (sb_count != 0 && host_count == 0) + { + gAgentAvatarp->setIsUsingServerBakes(true); + } + else if (sb_count == 0 && host_count != 0) + { + gAgentAvatarp->setIsUsingServerBakes(false); + } + else if (sb_count + host_count > 0) + { + llwarns << "unclear baked texture state, not sending appearance" << llendl; + return; + } + + LL_INFOS("Avatar") << gAgentAvatarp->avString() << "TAT: Sent AgentSetAppearance: " << gAgentAvatarp->getBakedStatusForPrintout() << LL_ENDL; //dumpAvatarTEs( "sendAgentSetAppearance()" ); @@ -4408,7 +4426,7 @@ void LLAgent::sendAgentSetAppearance() } } -// llinfos << "Avatar XML num VisualParams transmitted = " << transmitted_params << llendl; + //llinfos << "Avatar XML num VisualParams transmitted = " << transmitted_params << llendl; sendReliableMessage(); } diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 2b1e78c899..f1ba4ad453 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1184,6 +1184,21 @@ S32 LLAppearanceMgr::getCOFVersion() const } } +S32 LLAppearanceMgr::getLastUpdateRequestCOFVersion() const +{ + return mLastUpdateRequestCOFVersion; +} + +S32 LLAppearanceMgr::getLastAppearanceUpdateCOFVersion() const +{ + return mLastAppearanceUpdateCOFVersion; +} + +void LLAppearanceMgr::setLastAppearanceUpdateCOFVersion(S32 new_val) +{ + mLastAppearanceUpdateCOFVersion = new_val; +} + const LLViewerInventoryItem* LLAppearanceMgr::getBaseOutfitLink() { const LLUUID& current_outfit_cat = getCOF(); @@ -2017,7 +2032,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering) } // DRANO really should wait for the appearance message to set this. // verify that deleting this line doesn't break anything. - gAgentAvatarp->setIsUsingServerBakes(gAgent.getRegion() && gAgent.getRegion()->getCentralBakeVersion()); + //gAgentAvatarp->setIsUsingServerBakes(gAgent.getRegion() && gAgent.getRegion()->getCentralBakeVersion()); //dumpCat(getCOF(),"COF, start"); @@ -3293,7 +3308,8 @@ LLAppearanceMgr::LLAppearanceMgr(): mOutfitIsDirty(false), mOutfitLocked(false), mIsInUpdateAppearanceFromCOF(false), - mLastUpdateRequestCOFVersion(LLViewerInventoryCategory::VERSION_UNKNOWN) + mLastUpdateRequestCOFVersion(LLViewerInventoryCategory::VERSION_UNKNOWN), + mLastAppearanceUpdateCOFVersion(LLViewerInventoryCategory::VERSION_UNKNOWN) { LLOutfitObserver& outfit_observer = LLOutfitObserver::instance(); diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index bb4c9ee5a2..1a1ca1ca7d 100755 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -94,7 +94,14 @@ public: const LLUUID getCOF() const; S32 getCOFVersion() const; + // COF version of last viewer-initiated appearance update request. S32 mLastUpdateRequestCOFVersion; + S32 getLastUpdateRequestCOFVersion() const; + + // COF version of last appearance message received for self av. + S32 mLastAppearanceUpdateCOFVersion; + S32 getLastAppearanceUpdateCOFVersion() const; + void setLastAppearanceUpdateCOFVersion(S32 new_val); // Finds the folder link to the currently worn outfit const LLViewerInventoryItem *getBaseOutfitLink(); diff --git a/indra/newview/llsaveoutfitcombobtn.cpp b/indra/newview/llsaveoutfitcombobtn.cpp index 59137f4ef7..32295cd96f 100644 --- a/indra/newview/llsaveoutfitcombobtn.cpp +++ b/indra/newview/llsaveoutfitcombobtn.cpp @@ -31,8 +31,6 @@ #include "llsidepanelappearance.h" #include "llsaveoutfitcombobtn.h" #include "llviewermenu.h" -#include "llagent.h" -#include "llviewerregion.h" static const std::string SAVE_BTN("save_btn"); static const std::string SAVE_FLYOUT_BTN("save_flyout_btn"); @@ -78,12 +76,8 @@ void LLSaveOutfitComboBtn::saveOutfit(bool as_new) if (panel_outfits_inventory) { panel_outfits_inventory->onSave(); - } - - if ( gAgent.getRegion() && gAgent.getRegion()->getCentralBakeVersion()) - { - LLAppearanceMgr::instance().requestServerAppearanceUpdate(); - } + } + //*TODO how to get to know when base outfit is updated or new outfit is created? } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 99dd74c7c4..90887b5861 100644..100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1790,11 +1790,13 @@ S32 LLVOAvatar::setTETexture(const U8 te, const LLUUID& uuid) return setTETextureCore(te, uuid, url); } + llinfos << "get texture from host " << uuid << llendl; LLHost target_host = getObjectHost(); return setTETextureCore(te, uuid, target_host); } else { + llinfos << "get texture from other " << uuid << llendl; return setTETextureCore(te, uuid, LLHost::invalid); } } @@ -2881,11 +2883,22 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) } bool all_baked_downloaded = allBakedTexturesCompletelyDownloaded(); bool all_local_downloaded = allLocalTexturesCompletelyDownloaded(); - addDebugText(llformat("%s%s - mLocal: %d, mEdit: %d, mUSB: %d, CBV: %d", - all_local_downloaded ? "L" : "l", - all_baked_downloaded ? "B" : "b", - mUseLocalAppearance, mIsEditingAppearance, - mUseServerBakes, central_bake_version)); + std::string debug_line = llformat("%s%s - mLocal: %d, mEdit: %d, mUSB: %d, CBV: %d", + all_local_downloaded ? "L" : "l", + all_baked_downloaded ? "B" : "b", + mUseLocalAppearance, mIsEditingAppearance, + mUseServerBakes, central_bake_version); + std::string origin_string = bakedTextureOriginInfo(); + debug_line += " [" + origin_string + "]"; + if (isSelf()) + { + S32 curr_cof_version = LLAppearanceMgr::instance().getCOFVersion(); + S32 last_request_cof_version = LLAppearanceMgr::instance().getLastUpdateRequestCOFVersion(); + S32 last_received_cof_version = LLAppearanceMgr::instance().getLastAppearanceUpdateCOFVersion(); + debug_line += llformat(" - cof: %d req: %d rcv:%d", + curr_cof_version, last_request_cof_version, last_received_cof_version); + } + addDebugText(debug_line); } if (gSavedSettings.getBOOL("DebugAvatarCompositeBaked")) { @@ -4019,10 +4032,64 @@ bool LLVOAvatar::allLocalTexturesCompletelyDownloaded() bool LLVOAvatar::allBakedTexturesCompletelyDownloaded() { std::set<LLUUID> baked_ids; - collectLocalTextureUUIDs(baked_ids); + collectBakedTextureUUIDs(baked_ids); return allTexturesCompletelyDownloaded(baked_ids); } +void LLVOAvatar::bakedTextureOriginCounts(S32 &sb_count, // server-bake, has origin URL. + S32 &host_count, // host-based bake, has host. + S32 &both_count, // error - both host and URL set. + S32 &neither_count) // error - neither set. +{ + sb_count = host_count = both_count = neither_count = 0; + + std::set<LLUUID> baked_ids; + collectBakedTextureUUIDs(baked_ids); + for (std::set<LLUUID>::const_iterator it = baked_ids.begin(); it != baked_ids.end(); ++it) + { + LLViewerFetchedTexture *imagep = gTextureList.findImage(*it); + bool has_url = false, has_host = false; + if (!imagep->getUrl().empty()) + { + has_url = true; + } + if (imagep->getTargetHost().isOk()) + { + has_host = true; + } + if (has_url && !has_host) sb_count++; + else if (has_host && !has_url) host_count++; + else if (has_host && has_url) both_count++; + else if (!has_host && !has_url) neither_count++; + } +} + +std::string LLVOAvatar::bakedTextureOriginInfo() +{ + std::string result; + + std::set<LLUUID> baked_ids; + collectBakedTextureUUIDs(baked_ids); + for (std::set<LLUUID>::const_iterator it = baked_ids.begin(); it != baked_ids.end(); ++it) + { + LLViewerFetchedTexture *imagep = gTextureList.findImage(*it); + bool has_url = false, has_host = false; + if (!imagep->getUrl().empty()) + { + has_url = true; + } + if (imagep->getTargetHost().isOk()) + { + has_host = true; + } + if (has_url && !has_host) result += "u"; // server-bake texture with url + else if (has_host && !has_url) result += "h"; // old-style texture on sim + else if (has_host && has_url) result += "?"; // both origins? + else if (!has_host && !has_url) result += "n"; // no origin? + } + return result; +} + S32 LLVOAvatar::totalTextureMemForUUIDS(std::set<LLUUID>& ids) { S32 result = 0; @@ -6548,6 +6615,117 @@ void LLVOAvatar::dumpAppearanceMsgParams( const std::string& dump_prefix, } } +struct LLAppearanceMessageContents +{ + LLAppearanceMessageContents(): + mAppearanceVersion(-1), + mCOFVersion(LLViewerInventoryCategory::VERSION_UNKNOWN) + { + } + LLTEContents mTEContents; + S32 mAppearanceVersion; + S32 mCOFVersion; + // For future use: + //U32 appearance_flags = 0; + std::vector<F32> mParamWeights; + std::vector<LLVisualParam*> mParams; +}; + +void LLVOAvatar::parseAppearanceMessage(LLMessageSystem* mesgsys, LLAppearanceMessageContents& contents) +{ + parseTEMessage(mesgsys, _PREHASH_ObjectData, -1, contents.mTEContents); + + // Parse the AppearanceData field, if any. + if (mesgsys->has(_PREHASH_AppearanceData)) + { + U8 av_u8; + mesgsys->getU8Fast(_PREHASH_AppearanceData, _PREHASH_AppearanceVersion, av_u8, 0); + contents.mAppearanceVersion = av_u8; + llinfos << "appversion set by AppearanceData field: " << contents.mAppearanceVersion << llendl; + mesgsys->getS32Fast(_PREHASH_AppearanceData, _PREHASH_CofVersion, contents.mCOFVersion, 0); + // For future use: + //mesgsys->getU32Fast(_PREHASH_AppearanceData, _PREHASH_Flags, appearance_flags, 0); + } + + // Parse visual params, if any. + S32 num_blocks = mesgsys->getNumberOfBlocksFast(_PREHASH_VisualParam); + bool drop_visual_params_debug = gSavedSettings.getBOOL("BlockSomeAvatarAppearanceVisualParams") && (ll_rand(2) == 0); // pretend that ~12% of AvatarAppearance messages arrived without a VisualParam block, for testing + if( num_blocks > 1 && !drop_visual_params_debug) + { + LL_DEBUGS("Avatar") << avString() << " handle visual params, num_blocks " << num_blocks << LL_ENDL; + + LLVisualParam* param = getFirstVisualParam(); + llassert(param); // if this ever fires, we should do the same as when num_blocks<=1 + if (!param) + { + llwarns << "No visual params!" << llendl; + } + else + { + for( S32 i = 0; i < num_blocks; i++ ) + { + while( param && (param->getGroup() != VISUAL_PARAM_GROUP_TWEAKABLE) ) // should not be any of group VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT + { + param = getNextVisualParam(); + } + + if( !param ) + { + // more visual params supplied than expected - just process what we know about + break; + } + + U8 value; + mesgsys->getU8Fast(_PREHASH_VisualParam, _PREHASH_ParamValue, value, i); + F32 newWeight = U8_to_F32(value, param->getMinWeight(), param->getMaxWeight()); + contents.mParamWeights.push_back(newWeight); + contents.mParams.push_back(param); + + param = getNextVisualParam(); + } + } + + const S32 expected_tweakable_count = getVisualParamCountInGroup(VISUAL_PARAM_GROUP_TWEAKABLE); // don't worry about VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT + if (num_blocks != expected_tweakable_count) + { + llinfos << "Number of params in AvatarAppearance msg (" << num_blocks << ") does not match number of tweakable params in avatar xml file (" << expected_tweakable_count << "). Processing what we can. object: " << getID() << llendl; + } + } + else + { + if (drop_visual_params_debug) + { + llinfos << "Debug-faked lack of parameters on AvatarAppearance for object: " << getID() << llendl; + } + else + { + llinfos << "AvatarAppearance msg received without any parameters, object: " << getID() << llendl; + } + } + + if (contents.mAppearanceVersion < 0) // not set explicitly, try to get from visual param. + { + LLVisualParam* appearance_version_param = getVisualParam(11000); + if (appearance_version_param) + { + std::vector<LLVisualParam*>::iterator it = std::find(contents.mParams.begin(), contents.mParams.end(),appearance_version_param); + if (it != contents.mParams.end()) + { + S32 index = it - contents.mParams.begin(); + llinfos << "index: " << index << llendl; + S32 appearance_version = llround(contents.mParamWeights[index]); + contents.mAppearanceVersion = appearance_version; + llinfos << "appversion set by appearance_version param: " << contents.mAppearanceVersion << llendl; + } + } + } + if (contents.mAppearanceVersion < 0) // still not set, go with 0. + { + contents.mAppearanceVersion = 0; + llinfos << "appversion set by default: " << contents.mAppearanceVersion << llendl; + } +} + //----------------------------------------------------------------------------- // processAvatarAppearance() //----------------------------------------------------------------------------- @@ -6555,12 +6733,13 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) { bool enable_verbose_dumps = gSavedSettings.getBOOL("DebugAvatarAppearanceMessage"); std::string dump_prefix = getFullname() + "_" + (isSelf()?"s":"o") + "_"; - if (enable_verbose_dumps) { dumpArchetypeXML(dump_prefix + "process_start"); } + //if (enable_verbose_dumps) { dumpArchetypeXML(dump_prefix + "process_start"); } if (gSavedSettings.getBOOL("BlockAvatarAppearanceMessages")) { llwarns << "Blocking AvatarAppearance message" << llendl; return; } + BOOL is_first_appearance_message = !mFirstAppearanceMessageReceived; mFirstAppearanceMessageReceived = TRUE; @@ -6570,22 +6749,12 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) ESex old_sex = getSex(); - LLTEContents tec; - parseTEMessage(mesgsys, _PREHASH_ObjectData, -1, tec); + LLAppearanceMessageContents contents; + parseAppearanceMessage(mesgsys, contents); - U8 appearance_version = 0; - S32 this_update_cof_version = LLViewerInventoryCategory::VERSION_UNKNOWN; + U8 appearance_version = contents.mAppearanceVersion; + S32 this_update_cof_version = contents.mCOFVersion; S32 last_update_request_cof_version = LLAppearanceMgr::instance().mLastUpdateRequestCOFVersion; - // For future use: - //U32 appearance_flags = 0; - - if (mesgsys->has(_PREHASH_AppearanceData)) - { - mesgsys->getU8Fast(_PREHASH_AppearanceData, _PREHASH_AppearanceVersion, appearance_version, 0); - mesgsys->getS32Fast(_PREHASH_AppearanceData, _PREHASH_CofVersion, this_update_cof_version, 0); - // For future use: - //mesgsys->getU32Fast(_PREHASH_AppearanceData, _PREHASH_Flags, appearance_flags, 0); - } // Only now that we have result of appearance_version can we decide whether to bail out. if( isSelf() ) @@ -6594,6 +6763,8 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) << " last_update_request_cof_version " << last_update_request_cof_version << " my_cof_version " << LLAppearanceMgr::instance().getCOFVersion() << llendl; + LLAppearanceMgr::instance().setLastAppearanceUpdateCOFVersion(this_update_cof_version); + if (getRegion() && (getRegion()->getCentralBakeVersion()==0)) { llwarns << avString() << "Received AvatarAppearance message for self in non-server-bake region" << llendl; @@ -6604,7 +6775,6 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) } } - // Check for stale update. if (isSelf() && (appearance_version>0) @@ -6621,9 +6791,20 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) return; } - mUseServerBakes = (appearance_version > 0); + S32 num_params = contents.mParamWeights.size(); + if (num_params <= 1) + { + // In this case, we have no reliable basis for knowing + // appearance version, which may cause us to look for baked + // textures in the wrong place and flag them as missing + // assets. + llinfos << "ignoring appearance message due to lack of params" << llendl; + return; + } + + setIsUsingServerBakes(appearance_version > 0); - applyParsedTEMessage(tec); + applyParsedTEMessage(contents.mTEContents); // prevent the overwriting of valid baked textures with invalid baked textures for (U8 baked_index = 0; baked_index < mBakedTextureDatas.size(); baked_index++) @@ -6637,7 +6818,6 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) } } - // runway - was // if (!is_first_appearance_message ) // which means it would be called on second appearance message - probably wrong. @@ -6649,68 +6829,43 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) setCompositeUpdatesEnabled( FALSE ); gPipeline.markGLRebuild(this); - // parse visual params - S32 num_blocks = mesgsys->getNumberOfBlocksFast(_PREHASH_VisualParam); - bool drop_visual_params_debug = gSavedSettings.getBOOL("BlockSomeAvatarAppearanceVisualParams") && (ll_rand(2) == 0); // pretend that ~12% of AvatarAppearance messages arrived without a VisualParam block, for testing - if( num_blocks > 1 && !drop_visual_params_debug) + // Apply visual params + if( num_params > 1) { - LL_DEBUGS("Avatar") << avString() << " handle visual params, num_blocks " << num_blocks << LL_ENDL; + LL_DEBUGS("Avatar") << avString() << " handle visual params, num_params " << num_params << LL_ENDL; BOOL params_changed = FALSE; BOOL interp_params = FALSE; - LLVisualParam* param = getFirstVisualParam(); - llassert(param); // if this ever fires, we should do the same as when num_blocks<=1 - if (!param) + for( S32 i = 0; i < num_params; i++ ) { - llwarns << "No visual params!" << llendl; - } - else - { - std::vector<F32> params_for_dump; - for( S32 i = 0; i < num_blocks; i++ ) + LLVisualParam* param = contents.mParams[i]; + F32 newWeight = contents.mParamWeights[i]; + + if (is_first_appearance_message || (param->getWeight() != newWeight)) { - while( param && (param->getGroup() != VISUAL_PARAM_GROUP_TWEAKABLE) ) // should not be any of group VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT + params_changed = TRUE; + if(is_first_appearance_message) { - param = getNextVisualParam(); + param->setWeight(newWeight, FALSE); } - - if( !param ) + else { - // more visual params supplied than expected - just process what we know about - break; + interp_params = TRUE; + param->setAnimationTarget(newWeight, FALSE); } - - U8 value; - mesgsys->getU8Fast(_PREHASH_VisualParam, _PREHASH_ParamValue, value, i); - F32 newWeight = U8_to_F32(value, param->getMinWeight(), param->getMaxWeight()); - params_for_dump.push_back(newWeight); - - if (is_first_appearance_message || (param->getWeight() != newWeight)) - { - //llinfos << "Received update for param " << param->getDisplayName() << " at value " << newWeight << llendl; - params_changed = TRUE; - if(is_first_appearance_message) - { - param->setWeight(newWeight, FALSE); - } - else - { - interp_params = TRUE; - param->setAnimationTarget(newWeight, FALSE); - } - } - param = getNextVisualParam(); } - if (enable_verbose_dumps) - dumpAppearanceMsgParams(dump_prefix + "appearance_msg", params_for_dump, tec); + } + if (enable_verbose_dumps) + { + dumpAppearanceMsgParams(dump_prefix + "appearance_msg", contents.mParamWeights, contents.mTEContents); } - if (enable_verbose_dumps) { dumpArchetypeXML(dump_prefix + "process_post_set_weights"); } + //if (enable_verbose_dumps) { dumpArchetypeXML(dump_prefix + "process_post_set_weights"); } const S32 expected_tweakable_count = getVisualParamCountInGroup(VISUAL_PARAM_GROUP_TWEAKABLE); // don't worry about VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT - if (num_blocks != expected_tweakable_count) + if (num_params != expected_tweakable_count) { - llinfos << "Number of params in AvatarAppearance msg (" << num_blocks << ") does not match number of tweakable params in avatar xml file (" << expected_tweakable_count << "). Processing what we can. object: " << getID() << llendl; + llinfos << "Number of params in AvatarAppearance msg (" << num_params << ") does not match number of tweakable params in avatar xml file (" << expected_tweakable_count << "). Processing what we can. object: " << getID() << llendl; } if (params_changed) @@ -6734,14 +6889,6 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) { // AvatarAppearance message arrived without visual params LL_DEBUGS("Avatar") << avString() << "no visual params" << LL_ENDL; - if (drop_visual_params_debug) - { - llinfos << "Debug-faked lack of parameters on AvatarAppearance for object: " << getID() << llendl; - } - else - { - llinfos << "AvatarAppearance msg received without any parameters, object: " << getID() << llendl; - } const F32 LOADING_TIMEOUT_SECONDS = 60.f; // this isn't really a problem if we already have a non-default shape @@ -6771,8 +6918,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) updateMeshTextures(); - if (enable_verbose_dumps) dumpArchetypeXML(dump_prefix + "process_end"); -// llinfos << "processAvatarAppearance end " << mID << llendl; + //if (enable_verbose_dumps) dumpArchetypeXML(dump_prefix + "process_end"); } // static @@ -7245,9 +7391,29 @@ void LLVOAvatar::bodySizeChanged() } } +BOOL LLVOAvatar::isUsingServerBakes() const +{ +#if 1 + // Sanity check - visual param for appearance version should match mUseServerBakes + LLVisualParam* appearance_version_param = getVisualParam(11000); + llassert(appearance_version_param); + F32 wt = appearance_version_param->getWeight(); + F32 expect_wt = mUseServerBakes ? 1.0 : 0.0; + if (!is_approx_equal(wt,expect_wt)) + { + llwarns << "wt " << wt << " differs from expected " << expect_wt << llendl; + } +#endif + + return mUseServerBakes; +} + void LLVOAvatar::setIsUsingServerBakes(BOOL newval) { mUseServerBakes = newval; + LLVisualParam* appearance_version_param = getVisualParam(11000); + llassert(appearance_version_param); + appearance_version_param->setWeight(newval ? 1.0 : 0.0, false); } // virtual diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 2c64b9695e..bdb477590f 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -70,6 +70,7 @@ class LLHUDNameTag; class LLHUDEffectSpiral; class LLTexGlobalColor; class LLViewerJoint; +struct LLAppearanceMessageContents; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // LLVOAvatar @@ -138,6 +139,9 @@ public: bool allTexturesCompletelyDownloaded(std::set<LLUUID>& ids); bool allLocalTexturesCompletelyDownloaded(); bool allBakedTexturesCompletelyDownloaded(); + void bakedTextureOriginCounts(S32 &sb_count, S32 &host_count, + S32 &both_count, S32 &neither_count); + std::string bakedTextureOriginInfo(); void collectLocalTextureUUIDs(std::set<LLUUID>& ids); void collectBakedTextureUUIDs(std::set<LLUUID>& ids); void collectTextureUUIDs(std::set<LLUUID>& ids); @@ -635,6 +639,7 @@ protected: **/ public: + void parseAppearanceMessage(LLMessageSystem* mesgsys, LLAppearanceMessageContents& msg); void processAvatarAppearance(LLMessageSystem* mesgsys); void hideSkirt(); void startAppearanceAnimation(); @@ -653,7 +658,7 @@ public: // True if this avatar should fetch its baked textures via the new // appearance mechanism. - /*virtual*/ BOOL isUsingServerBakes() const { return mUseServerBakes; } + BOOL isUsingServerBakes() const; void setIsUsingServerBakes(BOOL newval); |