diff options
author | Nyx (Neal Orman) <nyx@lindenlab.com> | 2009-11-13 18:19:22 -0500 |
---|---|---|
committer | Nyx (Neal Orman) <nyx@lindenlab.com> | 2009-11-13 18:19:22 -0500 |
commit | be429a3ae9bdb45b1fe4bbc185814604167ab18c (patch) | |
tree | 08e7d91f3aa2b2f501a2ec82498780957d1a4bdf /indra/newview | |
parent | 2aa9f1bcbe0c51f9de24d52a08726dc13038f5b8 (diff) |
EXT-2429 body parts out of sync with COF
Visual param definitions weren't working properly when the wearable being
loaded had fewer visual parameters than the current definition of the wearable.
This occurred when you were loading wearables that had been created in older
versions of the client (or from the library).
Added missing parameters to mSavedVisualParamMap, and modified revertValues()
to ensure that the two maps are kept fully in sync on finishing loading the
wearable and when reverting the values.
Code reviewed by Vir
--HG--
branch : avatar-pipeline
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llwearable.cpp | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/indra/newview/llwearable.cpp b/indra/newview/llwearable.cpp index c5c97e7649..e37dffd526 100644 --- a/indra/newview/llwearable.cpp +++ b/indra/newview/llwearable.cpp @@ -831,6 +831,7 @@ void LLWearable::addVisualParam(LLVisualParam *param) } param->setIsDummy(FALSE); mVisualParamIndexMap[param->getID()] = param; + mSavedVisualParamMap[param->getID()] = param->getDefaultWeight(); } void LLWearable::setVisualParams() @@ -933,11 +934,39 @@ void LLWearable::setClothesColor( S32 te, const LLColor4& new_color, BOOL upload void LLWearable::revertValues() { //update saved settings so wearable is no longer dirty + // non-driver params first for (param_map_t::const_iterator iter = mSavedVisualParamMap.begin(); iter != mSavedVisualParamMap.end(); iter++) { S32 id = iter->first; F32 value = iter->second; - setVisualParamWeight(id, value, TRUE); + LLVisualParam *param = getVisualParam(id); + if(param && !dynamic_cast<LLDriverParam*>(param) ) + { + setVisualParamWeight(id, value, TRUE); + } + } + + //then driver params + for (param_map_t::const_iterator iter = mSavedVisualParamMap.begin(); iter != mSavedVisualParamMap.end(); iter++) + { + S32 id = iter->first; + F32 value = iter->second; + LLVisualParam *param = getVisualParam(id); + if(param && dynamic_cast<LLDriverParam*>(param) ) + { + setVisualParamWeight(id, value, TRUE); + } + } + + // make sure that saved values are sane + for (param_map_t::const_iterator iter = mSavedVisualParamMap.begin(); iter != mSavedVisualParamMap.end(); iter++) + { + S32 id = iter->first; + LLVisualParam *param = getVisualParam(id); + if( param ) + { + mSavedVisualParamMap[id] = param->getWeight(); + } } syncImages(mSavedTEMap, mTEMap); |