summaryrefslogtreecommitdiff
path: root/indra/newview/llwearable.cpp
diff options
context:
space:
mode:
authorNyx (Neal Orman) <nyx@lindenlab.com>2010-02-04 14:53:18 -0500
committerNyx (Neal Orman) <nyx@lindenlab.com>2010-02-04 14:53:18 -0500
commitb4d61b6e63dd04f8b67edcf32ea513295843157b (patch)
tree172b4bf696d6cf1bb3d395a7b7545388461ef0e8 /indra/newview/llwearable.cpp
parent1397781c10b42cfe45e6a7878d6975fc5ac1ac02 (diff)
EXT-4003 Appearance problemw earing City Chic Female - probably param related
cross-wearable params are fun! Values were not being updated properly for parameters that cross multiple wearables. Created a few functions to ensure that these values get updated and made them called from LLAgentWearables::wearableUpdated(). Also prevented cross-wearable params from writing back to the avatar, as they are being driven by another wearable. Code reviewed by Bigpapi
Diffstat (limited to 'indra/newview/llwearable.cpp')
-rw-r--r--indra/newview/llwearable.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/indra/newview/llwearable.cpp b/indra/newview/llwearable.cpp
index d093031bea..acfbc23f62 100644
--- a/indra/newview/llwearable.cpp
+++ b/indra/newview/llwearable.cpp
@@ -625,7 +625,9 @@ void LLWearable::writeToAvatar()
// Pull params
for( LLVisualParam* param = avatar->getFirstVisualParam(); param; param = avatar->getNextVisualParam() )
{
- if( (((LLViewerVisualParam*)param)->getWearableType() == mType) )
+ // cross-wearable parameters are not authoritative, as they are driven by a different wearable. So don't copy the values to the
+ // avatar object if cross wearable. Cross wearable params get their values from the avatar, they shouldn't write the other way.
+ if( (((LLViewerVisualParam*)param)->getWearableType() == mType) && (!((LLViewerVisualParam*)param)->getCrossWearable()) )
{
S32 param_id = param->getID();
F32 weight = getVisualParamWeight(param_id);
@@ -1085,6 +1087,26 @@ void LLWearable::destroyTextures()
mSavedTEMap.clear();
}
+void LLWearable::pullCrossWearableValues()
+{
+ // scan through all of the avatar's visual parameters
+ LLVOAvatar* avatar = gAgent.getAvatarObject();
+ for (LLViewerVisualParam* param = (LLViewerVisualParam*) avatar->getFirstVisualParam();
+ param;
+ param = (LLViewerVisualParam*) avatar->getNextVisualParam())
+ {
+ if( param )
+ {
+ LLDriverParam *driver_param = dynamic_cast<LLDriverParam*>(param);
+ if(driver_param)
+ {
+ // parameter is a driver parameter, have it update its
+ driver_param->updateCrossDrivenParams(getType());
+ }
+ }
+ }
+}
+
void LLWearable::setLabelUpdated() const
{