summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-06-01 22:30:14 +0100
committerTofu Linden <tofu.linden@lindenlab.com>2010-06-01 22:30:14 +0100
commit08ee190ec83d617bc21c92eb127af9616d062963 (patch)
treef657a29bc094f37b194a4df90a3cde5c7552a092 /indra/newview
parent4cc5c7d2a4511ffc65bf3b6b0b2e29beb5b0fed4 (diff)
EXT-7499 WIP Prevent other avatars from remaining with a ruth shape
to be reviewed by nyx.
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/app_settings/settings.xml13
-rw-r--r--indra/newview/character/avatar_lad.xml2
-rw-r--r--indra/newview/llvoavatar.cpp86
-rw-r--r--indra/newview/llvoavatar.h1
4 files changed, 84 insertions, 18 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index c0be54a105..83b057ff5f 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -632,7 +632,18 @@
<key>BlockAvatarAppearanceMessages</key>
<map>
<key>Comment</key>
- <string>Ignore's appearance messages (for simulating Ruth)</string>
+ <string>Ignores appearance messages (for simulating Ruth)</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
+ <key>BlockSomeAvatarAppearanceVisualParams</key>
+ <map>
+ <key>Comment</key>
+ <string>Drop around 50% of VisualParam occurances in appearance messages (for simulating Ruth)</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
diff --git a/indra/newview/character/avatar_lad.xml b/indra/newview/character/avatar_lad.xml
index 5efd997ab7..9564236ad2 100644
--- a/indra/newview/character/avatar_lad.xml
+++ b/indra/newview/character/avatar_lad.xml
@@ -4782,7 +4782,7 @@
group="1"
name="Saddlebags"
wearable="shape"
- edit_grouo="driven"
+ edit_group="driven"
value_min="-.5"
value_max="3">
<param_morph>
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 7a232afba6..44532af5f7 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -6686,6 +6686,42 @@ void LLVOAvatar::onFirstTEMessageReceived()
}
//-----------------------------------------------------------------------------
+// bool visualParamWeightsAreDefault()
+//-----------------------------------------------------------------------------
+bool LLVOAvatar::visualParamWeightsAreDefault()
+{
+ bool rtn = true;
+
+ bool is_wearing_skirt = isWearingWearableType(LLWearableType::WT_SKIRT);
+ for (LLVisualParam *param = getFirstVisualParam();
+ param;
+ param = getNextVisualParam())
+ {
+ if (param->getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE)
+ {
+ if (param->getWeight() != param->getDefaultWeight() &&
+ // we have to not care whether skirt weights are default, if we're not actually wearing a skirt
+ (is_wearing_skirt ||
+ (param->getName() != "skirt length" &&
+ param->getName() != "slit front" &&
+ param->getName() != "slit back" &&
+ param->getName() != "slit left" &&
+ param->getName() != "slit right")))
+ {
+ //llinfos << "param '" << param->getName() << "'=" << param->getWeight() << " which differs from default=" << param->getDefaultWeight() << llendl;
+ rtn = false;
+ break;
+ }
+ }
+ }
+
+ //llinfos << "params are default ? " << int(rtn) << llendl;
+
+ return rtn;
+}
+
+
+//-----------------------------------------------------------------------------
// processAvatarAppearance()
//-----------------------------------------------------------------------------
void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
@@ -6753,16 +6789,17 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
{
releaseComponentTextures();
}
-
-
+
// parse visual params
S32 num_blocks = mesgsys->getNumberOfBlocksFast(_PREHASH_VisualParam);
- if( num_blocks > 1 )
+ bool drop_visual_params_debug = gSavedSettings.getBOOL("BlockSomeAvatarAppearanceVisualParams") && (random()%2)!=0; // pretend that ~50% of AvatarAppearance messages arrived without a VisualParam block, for testing
+ if( num_blocks > 1 && !drop_visual_params_debug)
{
BOOL params_changed = FALSE;
BOOL interp_params = FALSE;
- LLVisualParam* param = getFirstVisualParam();
+ LLVisualParam* param = getFirstVisualParam(); // why do we peel away and ignore the first VisualParam?
+ llassert(param); // if this ever fires, we should do the same as when num_blocks<=1
if (!param)
{
llwarns << "No visual params!" << llendl;
@@ -6778,8 +6815,8 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
if( !param )
{
- llwarns << "Number of params in AvatarAppearance msg does not match number of params in avatar xml file." << llendl;
- return;
+ // more visual params supplied than expected - just process what we know about
+ break;
}
U8 value;
@@ -6804,14 +6841,10 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
}
}
- while( param && (param->getGroup() != VISUAL_PARAM_GROUP_TWEAKABLE) )
+ const S32 expected_tweakable_count = getVisualParamCountInGroup(VISUAL_PARAM_GROUP_TWEAKABLE);
+ if (num_blocks != expected_tweakable_count)
{
- param = getNextVisualParam();
- }
- if( param )
- {
- llwarns << "Number of params in AvatarAppearance msg does not match number of params in avatar xml file." << llendl;
- return;
+ llwarns << "Number of params in AvatarAppearance msg (" << num_blocks << ") does not match number of tweakable params in avatar xml file (" << expected_tweakable_count << "). Processing what we can. object: " << getID() << llendl;
}
if (params_changed)
@@ -6828,16 +6861,37 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
updateSexDependentLayerSets( FALSE );
}
}
+
+ llassert( getSex() == ((getVisualParamWeight( "male" ) > 0.5f) ? SEX_MALE : SEX_FEMALE) );
}
else
{
- llwarns << "AvatarAppearance msg received without any parameters, object: " << getID() << llendl;
+ // AvatarAppearance message arrived without visual params
+ if (drop_visual_params_debug)
+ {
+ llinfos << "Debug-faked lack of parameters on AvatarAppearance for object: " << getID() << llendl;
+ }
+ else
+ {
+ llinfos << "AvatarAppearance msg received without any parameters, object: " << getID() << llendl;
+ }
+
+ // this isn't really a problem if we already have a non-default shape
+ if (visualParamWeightsAreDefault())
+ {
+ // re-request appearance, hoping that it comes back with a shape next time
+ llinfos << "Re-requesting AvatarAppearance for object: " << getID() << llendl;
+ LLAvatarPropertiesProcessor::getInstance()->sendAvatarTexturesRequest(getID());
+ }
+ else
+ {
+ llinfos << "That's okay, we already have a non-default shape for object: " << getID() << llendl;
+ // we don't really care.
+ }
}
setCompositeUpdatesEnabled( TRUE );
- llassert( getSex() == ((getVisualParamWeight( "male" ) > 0.5f) ? SEX_MALE : SEX_FEMALE) );
-
// If all of the avatars are completely baked, release the global image caches to conserve memory.
LLVOAvatar::cullAvatarsByPixelArea();
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index 3c940e03c0..b30cce09f6 100644
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -249,6 +249,7 @@ public:
//--------------------------------------------------------------------
public:
BOOL isFullyLoaded() const;
+ bool visualParamWeightsAreDefault();
protected:
virtual BOOL getIsCloud();
BOOL updateIsFullyLoaded();