diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2012-09-27 17:46:19 -0400 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2012-09-27 17:46:19 -0400 |
commit | 878eb2b61a26eef3151319cffd1d8d5196b118c2 (patch) | |
tree | 4a6a905c917a5b1f7ae858ef6dbf4fc08a76094f | |
parent | 352698140775e62498686f80b5aa21aee85524cf (diff) |
audited uses of centralBakeVersion vs. isUsingServerBakes
-rwxr-xr-x | indra/newview/llagent.cpp | 11 | ||||
-rwxr-xr-x | indra/newview/llappearancemgr.cpp | 1 | ||||
-rwxr-xr-x | indra/newview/llviewerregion.cpp | 1 | ||||
-rwxr-xr-x | indra/newview/llviewerwearable.cpp | 5 | ||||
-rwxr-xr-x | indra/newview/llvoavatar.cpp | 25 | ||||
-rwxr-xr-x | indra/newview/llvoavatar.h | 2 |
6 files changed, 25 insertions, 20 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index bb9f8eaa26..709d29e884 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -4260,9 +4260,6 @@ void LLAgent::requestLeaveGodMode() //----------------------------------------------------------------------------- void LLAgent::sendAgentSetAppearance() { - // FIXME DRANO - this return short-circuits a bunch of phase stat tracking below. - if (!isAgentAvatarValid() || (getRegion() && getRegion()->getCentralBakeVersion())) return; - // FIXME DRANO - problems around new-style appearance in an old-style region. // - does this get called? // - need to change mUseServerBakes->FALSE in that case @@ -4282,6 +4279,9 @@ void LLAgent::sendAgentSetAppearance() } gAgentAvatarp->sendAppearanceChangeMetrics(); + + if (!isAgentAvatarValid() || (getRegion() && getRegion()->getCentralBakeVersion())) return; + LL_INFOS("Avatar") << gAgentAvatarp->avString() << "TAT: Sent AgentSetAppearance: " << gAgentAvatarp->getBakedStatusForPrintout() << LL_ENDL; //dumpAvatarTEs( "sendAgentSetAppearance()" ); @@ -4327,9 +4327,10 @@ void LLAgent::sendAgentSetAppearance() } // only update cache entries if we have all our baked textures - // FIXME DRANO additional if check for not in appearance editing + + // FIXME DRANO need additional check for not in appearance editing // mode, if still using local composites need to set using local - // composites to false, update mesh textures. + // composites to false, and update mesh textures. if (textures_current) { LL_INFOS("Avatar") << gAgentAvatarp->avString() << "TAT: Sending cached texture data" << LL_ENDL; diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 1e4e00d77d..c57269d0b0 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1750,6 +1750,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering) { requestServerAppearanceUpdate(); } + gAgentAvatarp->setIsUsingServerBakes(gAgent.getRegion() && gAgent.getRegion()->getCentralBakeVersion()); //dumpCat(getCOF(),"COF, start"); diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index fb50b8bb77..0855bc9243 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -283,6 +283,7 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, mSimAccess( SIM_ACCESS_MIN ), mBillableFactor(1.0), mMaxTasks(DEFAULT_MAX_REGION_WIDE_PRIM_COUNT), + mCentralBakeVersion(0), mClassID(0), mCPURatio(0), mColoName("unknown"), diff --git a/indra/newview/llviewerwearable.cpp b/indra/newview/llviewerwearable.cpp index 440548046f..9b1d8d7936 100755 --- a/indra/newview/llviewerwearable.cpp +++ b/indra/newview/llviewerwearable.cpp @@ -323,8 +323,9 @@ void LLViewerWearable::writeToAvatar(LLAvatarAppearance *avatarp) if (!viewer_avatar->isValid()) return; - if (viewer_avatar->getRegion() && - (viewer_avatar->getRegion()->getCentralBakeVersion()>0) && + // FIXME DRANO - kludgy way to avoid overwriting avatar state from wearables. + // Ideally would avoid calling this func in the first place. + if (viewer_avatar->isUsingServerBakes() && !viewer_avatar->isUsingLocalAppearance()) { return; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index fb06eb24c1..50c2659563 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -626,7 +626,7 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mLastRezzedStatus(-1), mIsEditingAppearance(FALSE), mUseLocalAppearance(FALSE), - mUseServerBakes(FALSE) + mUseServerBakes(FALSE) // FIXME DRANO consider using boost::optional, defaulting to unknown. { LLMemType mt(LLMemType::MTYPE_AVATAR); //VTResume(); // VTune @@ -2890,8 +2890,8 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) { central_bake_version = getRegion()->getCentralBakeVersion(); } - addDebugText(llformat("mUseLocalAppearance: %d,\nmIsEditingAppearance: %d\n" - "mUseServerBakes %d,\ncentralBakeVersion %d", + addDebugText(llformat("mUseLocalAppearance: %d\nmIsEditingAppearance: %d\n" + "mUseServerBakes %d\ncentralBakeVersion %d", mUseLocalAppearance, mIsEditingAppearance, mUseServerBakes, central_bake_version)); } @@ -6397,20 +6397,15 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) //mesgsys->getU32Fast(_PREHASH_AppearanceData, _PREHASH_Flags, appearance_flags, 0); } - if (appearance_version > 0) - { - mUseServerBakes = true; - } - else - { - mUseServerBakes = false; - } + mUseServerBakes = (appearance_version > 0); // Only now that we have result of appearance_version can we decide whether to bail out. - // Don't expect this case to occur. if( isSelf() ) { - llwarns << avString() << "Received AvatarAppearance for self" << llendl; + if (getRegion() && (getRegion()->getCentralBakeVersion()==0)) + { + llwarns << avString() << "Received AvatarAppearance message for self in non-server-bake region" << llendl; + } if( mFirstTEMessageReceived && !isUsingServerBakes()) { return; @@ -7052,6 +7047,10 @@ void LLVOAvatar::bodySizeChanged() } } +void LLVOAvatar::setIsUsingServerBakes(BOOL newval) +{ + mUseServerBakes = newval; +} // virtual void LLVOAvatar::removeMissingBakedTextures() diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 10c081cf68..5f858a2bea 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -644,6 +644,8 @@ public: // True if this avatar should fetch its baked textures via the new // appearance mechanism. /*virtual*/ BOOL isUsingServerBakes() const { return mUseServerBakes; } + void setIsUsingServerBakes(BOOL newval); + // True if we are currently in appearance editing mode. Often but // not always the same as isUsingLocalAppearance(). |