Merge remote-tracking branch 'shyotl/sunshine'
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
#include "llagentwearables.h"
|
||||
#include "llagentui.h"
|
||||
#include "llanimationstates.h"
|
||||
#include "llappearancemgr.h"
|
||||
#include "llcallingcard.h"
|
||||
#include "llcapabilitylistener.h"
|
||||
#include "llconsole.h"
|
||||
@@ -104,7 +105,7 @@
|
||||
|
||||
#include "NACLantispam.h" // for NaCl Antispam Registry
|
||||
|
||||
using namespace LLVOAvatarDefines;
|
||||
using namespace LLAvatarAppearanceDefines;
|
||||
|
||||
const BOOL ANIMATE = TRUE;
|
||||
const U8 AGENT_STATE_TYPING = 0x04;
|
||||
@@ -771,6 +772,18 @@ void LLAgent::toggleTPosed()
|
||||
setTPosed(posed);
|
||||
}
|
||||
|
||||
void LLAgent::handleServerBakeRegionTransition(const LLUUID& region_id)
|
||||
{
|
||||
llinfos << "called" << llendl;
|
||||
|
||||
if (isAgentAvatarValid() &&
|
||||
!gAgentAvatarp->isUsingServerBakes() &&
|
||||
(mRegionp->getCentralBakeVersion()>0))
|
||||
{
|
||||
LLAppearanceMgr::instance().requestServerAppearanceUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// setRegion()
|
||||
@@ -862,6 +875,19 @@ void LLAgent::setRegion(LLViewerRegion *regionp)
|
||||
{
|
||||
LLEnvManagerNew::instance().onRegionCrossing();
|
||||
}
|
||||
|
||||
// If the newly entered region is using server bakes, and our
|
||||
// current appearance is non-baked, request appearance update from
|
||||
// server.
|
||||
if (mRegionp->capabilitiesReceived())
|
||||
{
|
||||
handleServerBakeRegionTransition(mRegionp->getRegionID());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Need to handle via callback after caps arrive.
|
||||
mRegionp->setCapabilitiesReceivedCallback(boost::bind(&LLAgent::handleServerBakeRegionTransition,this,_1));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1701,12 +1727,10 @@ void LLAgent::autoPilot(F32 *delta_yaw)
|
||||
*delta_yaw = yaw;
|
||||
|
||||
// Compute when to start slowing down and when to stop
|
||||
F32 stop_distance = mAutoPilotStopDistance;
|
||||
F32 slow_distance;
|
||||
if (getFlying())
|
||||
{
|
||||
slow_distance = llmax(6.f, mAutoPilotStopDistance + 5.f);
|
||||
stop_distance = llmax(2.f, mAutoPilotStopDistance);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3700,7 +3724,7 @@ void LLAgent::processAgentCachedTextureResponse(LLMessageSystem *mesgsys, void *
|
||||
return;
|
||||
}
|
||||
|
||||
if (isAgentAvatarValid() && !gAgentAvatarp->isUsingBakedTextures())
|
||||
if (isAgentAvatarValid() && gAgentAvatarp->isEditingAppearance())
|
||||
{
|
||||
// ignore baked textures when in customize mode
|
||||
return;
|
||||
@@ -3724,7 +3748,7 @@ void LLAgent::processAgentCachedTextureResponse(LLMessageSystem *mesgsys, void *
|
||||
|
||||
if ((S32)texture_index < TEX_NUM_INDICES )
|
||||
{
|
||||
const LLVOAvatarDictionary::TextureEntry *texture_entry = LLVOAvatarDictionary::instance().getTexture((ETextureIndex)texture_index);
|
||||
const LLAvatarAppearanceDictionary::TextureEntry *texture_entry = LLAvatarAppearanceDictionary::instance().getTexture((ETextureIndex)texture_index);
|
||||
if (texture_entry)
|
||||
{
|
||||
EBakedTextureIndex baked_index = texture_entry->mBakedTextureIndex;
|
||||
@@ -4400,13 +4424,19 @@ void LLAgent::requestLeaveGodMode()
|
||||
//-----------------------------------------------------------------------------
|
||||
void LLAgent::sendAgentSetAppearance()
|
||||
{
|
||||
if (!isAgentAvatarValid()) 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
|
||||
// - need to call processAvatarAppearance as if server had returned this result?
|
||||
// gAgentAvatarp->mUseServerBakes = FALSE;
|
||||
|
||||
if (gAgentQueryManager.mNumPendingQueries > 0 && (isAgentAvatarValid() && gAgentAvatarp->isUsingBakedTextures()))
|
||||
if (gAgentQueryManager.mNumPendingQueries > 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isAgentAvatarValid() || (getRegion() && getRegion()->getCentralBakeVersion())) return;
|
||||
|
||||
LL_INFOS("Avatar") << gAgentAvatarp->avString() << "TAT: Sent AgentSetAppearance: " << gAgentAvatarp->getBakedStatusForPrintout() << LL_ENDL;
|
||||
//dumpAvatarTEs( "sendAgentSetAppearance()" );
|
||||
|
||||
@@ -4446,7 +4476,7 @@ void LLAgent::sendAgentSetAppearance()
|
||||
|
||||
for(U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++ )
|
||||
{
|
||||
const ETextureIndex texture_index = LLVOAvatarDictionary::bakedToLocalTextureIndex((EBakedTextureIndex)baked_index);
|
||||
const ETextureIndex texture_index = LLAvatarAppearanceDictionary::bakedToLocalTextureIndex((EBakedTextureIndex)baked_index);
|
||||
|
||||
// if we're not wearing a skirt, we don't need the texture to be baked
|
||||
if (texture_index == TEX_SKIRT_BAKED && !gAgentAvatarp->isWearingWearableType(LLWearableType::WT_SKIRT))
|
||||
@@ -4469,7 +4499,7 @@ void LLAgent::sendAgentSetAppearance()
|
||||
for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++)
|
||||
{
|
||||
BOOL generate_valid_hash = TRUE;
|
||||
if (isAgentAvatarValid() && !gAgentAvatarp->isBakedTextureFinal((LLVOAvatarDefines::EBakedTextureIndex)baked_index))
|
||||
if (isAgentAvatarValid() && !gAgentAvatarp->isBakedTextureFinal((LLAvatarAppearanceDefines::EBakedTextureIndex)baked_index))
|
||||
{
|
||||
generate_valid_hash = FALSE;
|
||||
LL_DEBUGS("Avatar") << gAgentAvatarp->avString() << "Not caching baked texture upload for " << (U32)baked_index << " due to being uploaded at low resolution." << LL_ENDL;
|
||||
@@ -4478,7 +4508,7 @@ void LLAgent::sendAgentSetAppearance()
|
||||
const LLUUID hash = gAgentWearables.computeBakedTextureHash((EBakedTextureIndex) baked_index, generate_valid_hash);
|
||||
if (hash.notNull())
|
||||
{
|
||||
ETextureIndex texture_index = LLVOAvatarDictionary::bakedToLocalTextureIndex((EBakedTextureIndex) baked_index);
|
||||
ETextureIndex texture_index = LLAvatarAppearanceDictionary::bakedToLocalTextureIndex((EBakedTextureIndex) baked_index);
|
||||
msg->nextBlockFast(_PREHASH_WearableData);
|
||||
msg->addUUIDFast(_PREHASH_CacheID, hash);
|
||||
msg->addU8Fast(_PREHASH_TextureIndex, (U8)texture_index);
|
||||
|
||||
Reference in New Issue
Block a user