diff options
author | Nyx (Neal Orman) <nyx@lindenlab.com> | 2009-11-02 19:05:20 -0500 |
---|---|---|
committer | Nyx (Neal Orman) <nyx@lindenlab.com> | 2009-11-02 19:05:20 -0500 |
commit | a100a6e07f8b6ea16313e25e3249736228d9b03c (patch) | |
tree | 392ab4757e0393e244ac1532ebc97f749d64650c /indra | |
parent | 0284725886bd0cb446c14da4fa10b425315415c5 (diff) |
EXT-1947 EXT-1945 EXT-1919 EXT-2088 appearance edit dummy param + animation fix
Several fixes here:
1) minor rename in argument of setIsDummy
2) corrected parameter set_by_user to calls of setVisualParamWeight where we
shouldn't be animating
3) ensured finally that mIsDummy is set properly for all wearable parameters
4) ensured that mIsDUmmy is set properly for non-wearable based parameters on
your own avatar
Code reviewed by Bigpapi
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llcharacter/llvisualparam.h | 2 | ||||
-rw-r--r-- | indra/newview/lldriverparam.cpp | 1 | ||||
-rw-r--r-- | indra/newview/llscrollingpanelparam.cpp | 8 | ||||
-rw-r--r-- | indra/newview/llvoavatarself.cpp | 5 | ||||
-rw-r--r-- | indra/newview/llwearable.cpp | 19 |
5 files changed, 15 insertions, 20 deletions
diff --git a/indra/llcharacter/llvisualparam.h b/indra/llcharacter/llvisualparam.h index affc49debf..eec56d7844 100644 --- a/indra/llcharacter/llvisualparam.h +++ b/indra/llcharacter/llvisualparam.h @@ -151,7 +151,7 @@ public: virtual void setAnimating(BOOL is_animating) { mIsAnimating = is_animating && !mIsDummy; } BOOL getAnimating() const { return mIsAnimating; } - void setIsDummy(BOOL is_self) { mIsDummy = is_self; } + void setIsDummy(BOOL is_dummy) { mIsDummy = is_dummy; } protected: F32 mCurWeight; // current weight diff --git a/indra/newview/lldriverparam.cpp b/indra/newview/lldriverparam.cpp index 527656ab6b..45f4b4fbd0 100644 --- a/indra/newview/lldriverparam.cpp +++ b/indra/newview/lldriverparam.cpp @@ -224,7 +224,6 @@ void LLDriverParam::setAvatar(LLVOAvatar *avatarp) } } *new_param = *this; - new_param->setIsDummy(FALSE); return new_param; } diff --git a/indra/newview/llscrollingpanelparam.cpp b/indra/newview/llscrollingpanelparam.cpp index 0a520ff65f..1fbaeb94f5 100644 --- a/indra/newview/llscrollingpanelparam.cpp +++ b/indra/newview/llscrollingpanelparam.cpp @@ -209,7 +209,7 @@ void LLScrollingPanelParam::onSliderMoved(LLUICtrl* ctrl, void* userdata) F32 new_weight = self->percentToWeight( (F32)slider->getValue().asReal() ); if (current_weight != new_weight ) { - self->mWearable->setVisualParamWeight( param->getID(), new_weight, TRUE ); + self->mWearable->setVisualParamWeight( param->getID(), new_weight, FALSE ); gAgent.getAvatarObject()->updateVisualParams(); } } @@ -298,7 +298,7 @@ void LLScrollingPanelParam::onHintHeldDown( LLVisualParamHint* hint ) if (slider->getMinValue() < new_percent && new_percent < slider->getMaxValue()) { - mWearable->setVisualParamWeight( hint->getVisualParam()->getID(), new_weight, TRUE); + mWearable->setVisualParamWeight( hint->getVisualParam()->getID(), new_weight, FALSE); gAgent.getAvatarObject()->updateVisualParams(); slider->setValue( weightToPercent( new_weight ) ); @@ -330,7 +330,7 @@ void LLScrollingPanelParam::onHintMinMouseUp( void* userdata ) if (slider->getMinValue() < new_percent && new_percent < slider->getMaxValue()) { - self->mWearable->setVisualParamWeight(hint->getVisualParam()->getID(), new_weight, TRUE); + self->mWearable->setVisualParamWeight(hint->getVisualParam()->getID(), new_weight, FALSE); slider->setValue( self->weightToPercent( new_weight ) ); } } @@ -364,7 +364,7 @@ void LLScrollingPanelParam::onHintMaxMouseUp( void* userdata ) if (slider->getMinValue() < new_percent && new_percent < slider->getMaxValue()) { - self->mWearable->setVisualParamWeight(hint->getVisualParam()->getID(), new_weight, TRUE); + self->mWearable->setVisualParamWeight(hint->getVisualParam()->getID(), new_weight, FALSE); slider->setValue( self->weightToPercent( new_weight ) ); } } diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 758db538a2..34e6b0f89e 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -205,7 +205,10 @@ void LLVOAvatarSelf::markDead() param; param = (LLViewerVisualParam*) getNextVisualParam()) { - param->setIsDummy(TRUE); + if (param->getWearableType() != WT_INVALID) + { + param->setIsDummy(TRUE); + } } return success; diff --git a/indra/newview/llwearable.cpp b/indra/newview/llwearable.cpp index 4cd29bb838..c32fc2bae1 100644 --- a/indra/newview/llwearable.cpp +++ b/indra/newview/llwearable.cpp @@ -60,7 +60,7 @@ static std::string asset_id_to_filename(const LLUUID &asset_id); LLWearable::LLWearable(const LLTransactionID& transaction_id) : mDefinitionVersion(LLWearable::sCurrentDefinitionVersion), - mType(WT_SHAPE) + mType(WT_INVALID) { mTransactionID = transaction_id; mAssetID = mTransactionID.makeAssetID(gAgent.getSecureSessionID()); @@ -68,7 +68,7 @@ LLWearable::LLWearable(const LLTransactionID& transaction_id) : LLWearable::LLWearable(const LLAssetID& asset_id) : mDefinitionVersion( LLWearable::sCurrentDefinitionVersion ), - mType(WT_SHAPE) + mType(WT_INVALID) { mAssetID = asset_id; mTransactionID.setNull(); @@ -181,13 +181,7 @@ void LLWearable::createVisualParams() { if (param->getWearableType() == mType) { - if (mVisualParamIndexMap[param->getID()]) - { - delete mVisualParamIndexMap[param->getID()]; - } - LLViewerVisualParam *new_param = param->cloneParam(this); - new_param->setIsDummy(FALSE); - mVisualParamIndexMap[param->getID()] = new_param; + addVisualParam(param->cloneParam(this)); } } @@ -750,7 +744,8 @@ void LLWearable::copyDataFrom(const LLWearable* src) mDescription = src->mDescription; mPermissions = src->mPermissions; mSaleInfo = src->mSaleInfo; - mType = src->mType; + + setType(src->mType); mSavedVisualParamMap.clear(); // Deep copy of mVisualParamMap (copies only those params that are current, filling in defaults where needed) @@ -763,9 +758,6 @@ void LLWearable::copyDataFrom(const LLWearable* src) S32 id = param->getID(); F32 weight = src->getVisualParamWeight(id); mSavedVisualParamMap[id] = weight; - - // Clones a visual param from src and adds it to this wearable. Value of param is taken from current value of source param, not saved. - addVisualParam(param->cloneParam(this)); } } @@ -860,6 +852,7 @@ void LLWearable::addVisualParam(LLVisualParam *param) { delete mVisualParamIndexMap[param->getID()]; } + param->setIsDummy(FALSE); mVisualParamIndexMap[param->getID()] = param; } |