From ab83fab72c66e753917001a9030aa55e69a3c496 Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Wed, 26 Sep 2012 11:52:19 -0400
Subject: [PATCH] error checking, comments for areas needing fix/check in
 appearance

---
 indra/llappearance/lldriverparam.cpp    | 2 +-
 indra/llappearance/lltexlayerparams.cpp | 1 +
 indra/newview/llagent.cpp               | 5 +++++
 indra/newview/llviewertexlayer.cpp      | 2 +-
 indra/newview/llviewerwindow.cpp        | 2 +-
 indra/newview/llvoavatar.cpp            | 9 ++++++++-
 indra/newview/llvoavatarself.cpp        | 2 +-
 7 files changed, 18 insertions(+), 5 deletions(-)
 mode change 100644 => 100755 indra/llappearance/lltexlayerparams.cpp
 mode change 100644 => 100755 indra/newview/llviewertexlayer.cpp

diff --git a/indra/llappearance/lldriverparam.cpp b/indra/llappearance/lldriverparam.cpp
index ec282c50eb8..a43878899c9 100755
--- a/indra/llappearance/lldriverparam.cpp
+++ b/indra/llappearance/lldriverparam.cpp
@@ -187,7 +187,7 @@ BOOL LLDriverParam::setInfo(LLDriverParamInfo *info)
 {
 	llassert(wearable);
 	LLDriverParam *new_param = new LLDriverParam(mAvatarAppearance, wearable);
-	// FIXME this clobbers mWearablep, which means any code currently using mWearablep is wrong.
+	// FIXME DRANO this clobbers mWearablep, which means any code currently using mWearablep is wrong.
 	*new_param = *this;
 //	new_param->mDriven.clear(); // clear driven list to avoid overwriting avatar driven params from wearables. 
 	return new_param;
diff --git a/indra/llappearance/lltexlayerparams.cpp b/indra/llappearance/lltexlayerparams.cpp
old mode 100644
new mode 100755
index 651468b1a55..18e70af23c6
--- a/indra/llappearance/lltexlayerparams.cpp
+++ b/indra/llappearance/lltexlayerparams.cpp
@@ -176,6 +176,7 @@ void LLTexLayerParamAlpha::setWeight(F32 weight, BOOL upload_bake)
 
 		if ((mAvatarAppearance->getSex() & getSex()) && (mAvatarAppearance->isSelf() && !mIsDummy)) // only trigger a baked texture update if we're changing a wearable's visual param.
 		{
+			// FIXME DRANO - is this check right?
 			if (!mAvatarAppearance->isUsingServerBakes())
 			{
 				upload_bake = FALSE;
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index fe48abc25a2..ffcd263d061 100755
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -4263,6 +4263,8 @@ void LLAgent::sendAgentSetAppearance()
 {
 	if (!isAgentAvatarValid() || (getRegion() && getRegion()->getCentralBakeVersion())) return;
 
+
+	// FIXME DRANO - remove server bake check, covered by central bake check above?
 	if (gAgentQueryManager.mNumPendingQueries > 0 && (isAgentAvatarValid() && gAgentAvatarp->isUsingServerBakes())) 
 	{
 		return;
@@ -4321,6 +4323,9 @@ void LLAgent::sendAgentSetAppearance()
 	}
 
 	// only update cache entries if we have all our baked textures
+	// FIXME DRANO additional if check for not in appearance editing
+	// mode, if still using local composites need to set using local
+	// composites to false, update mesh textures.
 	if (textures_current)
 	{
 		LL_INFOS("Avatar") << gAgentAvatarp->avString() << "TAT: Sending cached texture data" << LL_ENDL;
diff --git a/indra/newview/llviewertexlayer.cpp b/indra/newview/llviewertexlayer.cpp
old mode 100644
new mode 100755
index 463906d3ef6..9477e89f1c5
--- a/indra/newview/llviewertexlayer.cpp
+++ b/indra/newview/llviewertexlayer.cpp
@@ -285,7 +285,7 @@ BOOL LLViewerTexLayerSetBuffer::uploadInProgress() const
 BOOL LLViewerTexLayerSetBuffer::isReadyToUpload() const
 {
 	if (!gAgentQueryManager.hasNoPendingQueries()) return FALSE; // Can't upload if there are pending queries.
-	// FIXME DRANO
+	// FIXME DRANO - should be checking local appearance?
 	if (isAgentAvatarValid() && !gAgentAvatarp->isUsingServerBakes()) return FALSE; // Don't upload if avatar is using composites.
 
 	BOOL ready = FALSE;
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index aa3cf3bb9c9..d6d127ddfca 100755
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -4731,7 +4731,7 @@ void LLViewerWindow::restoreGL(const std::string& progress_message)
 		gResizeScreenTexture = TRUE;
 		gWindowResized = TRUE;
 
-		// FIXME DRANO
+		// FIXME DRANO - what to check against here?
 		if (isAgentAvatarValid() && !gAgentAvatarp->isUsingServerBakes())
 		{
 			LLVisualParamHint::requestHintUpdates();
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 1676f656d36..0f18aa358c6 100755
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -4203,8 +4203,15 @@ void LLVOAvatar::setTexEntry(const U8 index, const LLTextureEntry &te)
 const std::string LLVOAvatar::getImageURL(const U8 te, const LLUUID &uuid)
 {
 	std::string url = "";
-	if (isUsingServerBakes() && !gSavedSettings.getString("AgentAppearanceServiceURL").empty())
+	if (isUsingServerBakes())
 	{
+		if (gSavedSettings.getString("AgentAppearanceServiceURL").empty())
+		{
+			// Probably a server-side issue if we get here:
+			llwarns << "AgentAppearanceServiceURL not set - Baked texture requests will fail" << llendl;
+			return url;
+		}
+	
 		const LLAvatarAppearanceDictionary::TextureEntry* texture_entry = LLAvatarAppearanceDictionary::getInstance()->getTexture((ETextureIndex)te);
 		if (texture_entry != NULL)
 		{
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp
index b4f36a6391b..6f58ffc5c18 100755
--- a/indra/newview/llvoavatarself.cpp
+++ b/indra/newview/llvoavatarself.cpp
@@ -1274,7 +1274,7 @@ void LLVOAvatarSelf::localTextureLoaded(BOOL success, LLViewerFetchedTexture *sr
 			discard_level < local_tex_obj->getDiscard())
 		{
 			local_tex_obj->setDiscard(discard_level);
-			// FIXME DRANO
+			// FIXME DRANO - should this be a local appearance check?
 			if (isUsingServerBakes())
 			{
 				requestLayerSetUpdate(index);
-- 
GitLab