diff options
author | Eric M. Tulla (BigPapi) <tulla@lindenlab.com> | 2009-11-13 22:23:14 -0500 |
---|---|---|
committer | Eric M. Tulla (BigPapi) <tulla@lindenlab.com> | 2009-11-13 22:23:14 -0500 |
commit | a39bda1b775a161558f75bd0a23575b8ef78a80e (patch) | |
tree | 576d3d26baad182b19cab1b1f9a09acc639030ff /indra/newview/llwearable.cpp | |
parent | a58dd26b205d4e626028f1c7d27858d2ec927e41 (diff) | |
parent | 68c6ff791ffdd01e98cf7fae61b868db4a6d1698 (diff) |
Automated merge with ssh://hg.lindenlab.com/viewer/viewer-2-0/
Diffstat (limited to 'indra/newview/llwearable.cpp')
-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); |