master
Brad Payne (Vir Linden) 2012-09-28 10:14:07 -04:00
commit 5c101330ca
6 changed files with 25 additions and 20 deletions

View File

@ -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;

View File

@ -1750,6 +1750,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering)
{
requestServerAppearanceUpdate();
}
gAgentAvatarp->setIsUsingServerBakes(gAgent.getRegion() && gAgent.getRegion()->getCentralBakeVersion());
//dumpCat(getCOF(),"COF, start");

View File

@ -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"),

View File

@ -320,8 +320,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;

View File

@ -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()

View File

@ -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().