diff options
| author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2010-02-08 09:50:04 -0500 |
|---|---|---|
| committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2010-02-08 09:50:04 -0500 |
| commit | 5dda2516ad599d3c295930fb3fc0c6cdbe8c2ce5 (patch) | |
| tree | 06d761559a50b8df3db4dffa32c6ad28ce398c11 /indra/newview/lldriverparam.cpp | |
| parent | f5b82a377256d5806ec101e8a9d90533ea1a3bf9 (diff) | |
| parent | bb977a194f42cafdcf3f1245adf3b7f49857e552 (diff) | |
merge
Diffstat (limited to 'indra/newview/lldriverparam.cpp')
| -rw-r--r-- | indra/newview/lldriverparam.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/indra/newview/lldriverparam.cpp b/indra/newview/lldriverparam.cpp index 3961afe9af..8ebfa471f3 100644 --- a/indra/newview/lldriverparam.cpp +++ b/indra/newview/lldriverparam.cpp @@ -39,6 +39,7 @@ #include "llvoavatarself.h" #include "llagent.h" #include "llwearable.h" +#include "llagentwearables.h" //----------------------------------------------------------------------------- // LLDriverParamInfo @@ -528,6 +529,38 @@ void LLDriverParam::resetDrivenParams() mDriven.reserve(getInfo()->mDrivenInfoList.size()); } +void LLDriverParam::updateCrossDrivenParams(EWearableType driven_type) +{ + bool needs_update = (getWearableType()==driven_type); + + // if the driver has a driven entry for the passed-in wearable type, we need to refresh the value + for( entry_list_t::iterator iter = mDriven.begin(); iter != mDriven.end(); iter++ ) + { + LLDrivenEntry* driven = &(*iter); + if (driven && driven->mParam && driven->mParam->getCrossWearable() && driven->mParam->getWearableType() == driven_type) + { + needs_update = true; + } + } + + + if (needs_update) + { + EWearableType driver_type = (EWearableType)getWearableType(); + + // If we've gotten here, we've added a new wearable of type "type" + // Thus this wearable needs to get updates from the driver wearable. + // The call to setVisualParamWeight seems redundant, but is necessary + // as the number of driven wearables has changed since the last update. -Nyx + LLWearable *wearable = gAgentWearables.getTopWearable(driver_type); + if (wearable) + { + wearable->setVisualParamWeight(mID, wearable->getVisualParamWeight(mID), false); + } + } +} + + //----------------------------------------------------------------------------- // getDrivenWeight() //----------------------------------------------------------------------------- |
