Nyx (Neal Orman) 2012-08-14 17:13:46 -04:00
commit 48b7eff758
10 changed files with 32 additions and 35 deletions

View File

@ -4260,7 +4260,7 @@ void LLAgent::requestLeaveGodMode()
//-----------------------------------------------------------------------------
void LLAgent::sendAgentSetAppearance()
{
if (!isAgentAvatarValid() || LLAppearanceMgr::instance().useServerTextureBaking()) return;
if (!isAgentAvatarValid() || (getRegion() && getRegion()->getCentralBakeVersion())) return;
if (gAgentQueryManager.mNumPendingQueries > 0 && (isAgentAvatarValid() && gAgentAvatarp->isUsingBakedTextures()))
{

View File

@ -1597,7 +1597,7 @@ void LLAgentWearables::setWearableFinal(LLInventoryItem* new_item, LLWearable* n
void LLAgentWearables::queryWearableCache()
{
if (!areWearablesLoaded() || LLAppearanceMgr::instance().useServerTextureBaking())
if (!areWearablesLoaded() || (gAgent.getRegion() && gAgent.getRegion()->getCentralBakeVersion()))
{
return;
}

View File

@ -1744,7 +1744,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering)
updateIsDirty();
// Send server request for appearance update
if (useServerTextureBaking())
if (gAgent.getRegion() && gAgent.getRegion()->getCentralBakeVersion())
{
requestServerAppearanceUpdate();
}
@ -2600,14 +2600,6 @@ void LLAppearanceMgr::updateClothingOrderingInfo(LLUUID cat_id, bool update_base
if (inventory_changed) gInventory.notifyObservers();
}
// Should be true iff both the appropriate debug setting is enabled
// and the corresponding cap has been found.
bool LLAppearanceMgr::useServerTextureBaking()
{
// TODO: add cap check.
return gSavedSettings.getBOOL("UseServerTextureBaking");
}
class RequestAgentUpdateAppearanceResponder: public LLHTTPClient::Responder
{
public:

View File

@ -185,8 +185,6 @@ public:
bool isInUpdateAppearanceFromCOF() { return mIsInUpdateAppearanceFromCOF; }
bool useServerTextureBaking();
void requestServerAppearanceUpdate();
protected:

View File

@ -1450,6 +1450,18 @@ void LLViewerRegion::unpackRegionHandshake()
mProductName = productName;
}
mCentralBakeVersion = (S32)gSavedSettings.getBOOL("UseServerTextureBaking");
/*
if (msg->getSize("RegionInfo4", "CentralBakesVersion") > 0)
{
msg->getS32("RegionInfo4", "CentralBakesVersion", mCentralBakeVersion);
}
else
{
mCentralBakeVersion = 0;
}
*/
LLVLComposition *compp = getComposition();
if (compp)
{

View File

@ -278,6 +278,8 @@ public:
F32 getLandHeightRegion(const LLVector3& region_pos);
U8 getCentralBakeVersion() { return mCentralBakeVersion; }
void getInfo(LLSD& info);
bool meshRezEnabled() const;
@ -395,6 +397,7 @@ private:
F32 mBillableFactor;
U32 mMaxTasks; // max prim count
F32 mCameraDistanceSquared; // updated once per frame
U8 mCentralBakeVersion;
// Information for Homestead / CR-53
S32 mClassID;

View File

@ -4738,7 +4738,7 @@ void LLVOAvatar::setTexEntry(const U8 index, const LLTextureEntry &te)
const std::string LLVOAvatar::getImageURL(const U8 te, const LLUUID &uuid)
{
std::string url = "";
if (LLAppearanceMgr::instance().useServerTextureBaking() && !gSavedSettings.getString("AgentAppearanceServiceURL").empty())
if (mUseServerBakes && !gSavedSettings.getString("AgentAppearanceServiceURL").empty())
{
const LLVOAvatarDictionary::TextureEntry* texture_entry = LLVOAvatarDictionary::getInstance()->getTexture((ETextureIndex)te);
if (texture_entry != NULL)
@ -7336,7 +7336,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
if( isSelf() )
{
llwarns << avString() << "Received AvatarAppearance for self" << llendl;
if( mFirstTEMessageReceived && !LLAppearanceMgr::instance().useServerTextureBaking())
if( mFirstTEMessageReceived && !mUseServerBakes)
{
// llinfos << "processAvatarAppearance end " << mID << llendl;
return;

View File

@ -710,13 +710,14 @@ public:
//--------------------------------------------------------------------
public:
BOOL getIsAppearanceAnimating() const { return mAppearanceAnimating; }
BOOL isUsingBakedTextures() const { return mUseServerBakes; } // e.g. false if in appearance edit mode
private:
BOOL mAppearanceAnimating;
LLFrameTimer mAppearanceMorphTimer;
F32 mLastAppearanceBlendTime;
BOOL mIsEditingAppearance;
BOOL mUseLocalAppearance;
BOOL mUseServerBakes;
BOOL mIsEditingAppearance; // flag for if we're actively in appearance editing mode
BOOL mUseLocalAppearance; // flag for if we're using a local composite
BOOL mUseServerBakes; // flag for if baked textures should be fetched from baking service (false if they're temporary uploads)
//--------------------------------------------------------------------
// Clothing colors (convenience functions to access visual parameters)

View File

@ -885,7 +885,7 @@ void LLVOAvatarSelf::removeMissingBakedTextures()
invalidateComposite(mBakedTextureDatas[i].mTexLayerSet, FALSE);
}
updateMeshTextures();
if (!LLAppearanceMgr::instance().useServerTextureBaking())
if (getRegion() && !getRegion()->getCentralBakeVersion())
{
requestLayerSetUploads();
}
@ -1631,7 +1631,7 @@ void LLVOAvatarSelf::invalidateComposite( LLTexLayerSet* layerset, BOOL upload_r
layerset->requestUpdate();
layerset->invalidateMorphMasks();
if( upload_result && !LLAppearanceMgr::instance().useServerTextureBaking())
if( upload_result && (getRegion() && !getRegion()->getCentralBakeVersion()))
{
llassert(isSelf());
@ -2614,15 +2614,6 @@ void LLVOAvatarSelf::processRebakeAvatarTextures(LLMessageSystem* msg, void**)
}
}
BOOL LLVOAvatarSelf::isUsingBakedTextures() const
{
// Composite textures are used during appearance mode.
if (gAgentCamera.cameraCustomizeAvatar())
return FALSE;
return TRUE;
}
void LLVOAvatarSelf::forceBakeAllTextures(bool slam_for_debug)
{
@ -2723,14 +2714,15 @@ void LLVOAvatarSelf::onCustomizeStart(bool disable_camera_switch)
// static
void LLVOAvatarSelf::onCustomizeEnd(bool disable_camera_switch)
{
gAgentAvatarp->mIsEditingAppearance = false;
if (!LLAppearanceMgr::instance().useServerTextureBaking())
{
gAgentAvatarp->mUseLocalAppearance = false;
}
if (isAgentAvatarValid())
{
gAgentAvatarp->mIsEditingAppearance = false;
if (gAgentAvatarp->getRegion() && !gAgentAvatarp->getRegion()->getCentralBakeVersion())
{
gAgentAvatarp->mUseLocalAppearance = false;
}
gAgentAvatarp->invalidateAll();
if (gSavedSettings.getBOOL("AppearanceCameraMovement") && !disable_camera_switch)

View File

@ -239,7 +239,6 @@ public:
void setCachedBakedTexture(LLVOAvatarDefines::ETextureIndex i, const LLUUID& uuid);
void forceBakeAllTextures(bool slam_for_debug = false);
static void processRebakeAvatarTextures(LLMessageSystem* msg, void**);
BOOL isUsingBakedTextures() const; // e.g. false if in appearance edit mode
protected:
/*virtual*/ void removeMissingBakedTextures();