aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llcharacter
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llcharacter')
-rw-r--r--linden/indra/llcharacter/llcharacter.cpp4
-rw-r--r--linden/indra/llcharacter/llcharacter.h14
-rw-r--r--linden/indra/llcharacter/llvisualparam.cpp4
-rw-r--r--linden/indra/llcharacter/llvisualparam.h7
4 files changed, 23 insertions, 6 deletions
diff --git a/linden/indra/llcharacter/llcharacter.cpp b/linden/indra/llcharacter/llcharacter.cpp
index 46ac326..72cef83 100644
--- a/linden/indra/llcharacter/llcharacter.cpp
+++ b/linden/indra/llcharacter/llcharacter.cpp
@@ -379,7 +379,7 @@ void LLCharacter::clearVisualParamWeights()
379 param; 379 param;
380 param = getNextVisualParam()) 380 param = getNextVisualParam())
381 { 381 {
382 if (param->getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE) 382 if (param->isTweakable())
383 { 383 {
384 param->setWeight( param->getDefaultWeight(), FALSE ); 384 param->setWeight( param->getDefaultWeight(), FALSE );
385 } 385 }
@@ -395,7 +395,7 @@ BOOL LLCharacter::visualParamWeightsAreDefault()
395 param; 395 param;
396 param = getNextVisualParam()) 396 param = getNextVisualParam())
397 { 397 {
398 if (param->getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE) 398 if (param->isTweakable())
399 { 399 {
400 if (param->getWeight() != param->getDefaultWeight()) 400 if (param->getWeight() != param->getDefaultWeight())
401 return false; 401 return false;
diff --git a/linden/indra/llcharacter/llcharacter.h b/linden/indra/llcharacter/llcharacter.h
index d91124b..7630760 100644
--- a/linden/indra/llcharacter/llcharacter.h
+++ b/linden/indra/llcharacter/llcharacter.h
@@ -231,6 +231,20 @@ public:
231 return (mCurIterator++)->second; 231 return (mCurIterator++)->second;
232 } 232 }
233 233
234 S32 getVisualParamCountInGroup(EVisualParamGroup group)
235 {
236 S32 rtn = 0;
237 VisualParamIndexMap_t::iterator iter;
238 for (iter = mVisualParamIndexMap.begin(); iter != mVisualParamIndexMap.end(); iter++)
239 {
240 if (iter->second->getGroup() == group)
241 {
242 rtn++;
243 }
244 }
245 return rtn;
246 }
247
234 LLVisualParam* getVisualParam(S32 id) 248 LLVisualParam* getVisualParam(S32 id)
235 { 249 {
236 VisualParamIndexMap_t::iterator iter = mVisualParamIndexMap.find(id); 250 VisualParamIndexMap_t::iterator iter = mVisualParamIndexMap.find(id);
diff --git a/linden/indra/llcharacter/llvisualparam.cpp b/linden/indra/llcharacter/llvisualparam.cpp
index d7a144e..9579ff8 100644
--- a/linden/indra/llcharacter/llvisualparam.cpp
+++ b/linden/indra/llcharacter/llvisualparam.cpp
@@ -238,7 +238,7 @@ void LLVisualParam::setAnimationTarget(F32 target_value, BOOL set_by_user)
238{ 238{
239 if (mInfo) 239 if (mInfo)
240 { 240 {
241 if (getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE) 241 if (isTweakable())
242 { 242 {
243 mTargetWeight = llclamp(target_value, mInfo->mMinWeight, mInfo->mMaxWeight); 243 mTargetWeight = llclamp(target_value, mInfo->mMinWeight, mInfo->mMaxWeight);
244 } 244 }
@@ -282,7 +282,7 @@ void LLVisualParam::animate( F32 delta, BOOL set_by_user )
282//----------------------------------------------------------------------------- 282//-----------------------------------------------------------------------------
283void LLVisualParam::stopAnimating(BOOL set_by_user) 283void LLVisualParam::stopAnimating(BOOL set_by_user)
284{ 284{
285 if (mIsAnimating && getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE) 285 if (mIsAnimating && isTweakable())
286 { 286 {
287 mIsAnimating = FALSE; 287 mIsAnimating = FALSE;
288 setWeight(mTargetWeight, set_by_user); 288 setWeight(mTargetWeight, set_by_user);
diff --git a/linden/indra/llcharacter/llvisualparam.h b/linden/indra/llcharacter/llvisualparam.h
index 3a0c1bb..d8dff8c 100644
--- a/linden/indra/llcharacter/llvisualparam.h
+++ b/linden/indra/llcharacter/llvisualparam.h
@@ -51,6 +51,7 @@ enum EVisualParamGroup
51{ 51{
52 VISUAL_PARAM_GROUP_TWEAKABLE, 52 VISUAL_PARAM_GROUP_TWEAKABLE,
53 VISUAL_PARAM_GROUP_ANIMATABLE, 53 VISUAL_PARAM_GROUP_ANIMATABLE,
54 VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT,
54 NUM_VISUAL_PARAM_GROUPS 55 NUM_VISUAL_PARAM_GROUPS
55}; 56};
56 57
@@ -124,7 +125,7 @@ public:
124 void setMaxDisplayName(const std::string& s) { mInfo->mMaxName = s; } 125 void setMaxDisplayName(const std::string& s) { mInfo->mMaxName = s; }
125 void setMinDisplayName(const std::string& s) { mInfo->mMinName = s; } 126 void setMinDisplayName(const std::string& s) { mInfo->mMinName = s; }
126 127
127 EVisualParamGroup getGroup() { return mInfo->mGroup; } 128 EVisualParamGroup getGroup() const { return mInfo->mGroup; }
128 F32 getMinWeight() { return mInfo->mMinWeight; } 129 F32 getMinWeight() { return mInfo->mMinWeight; }
129 F32 getMaxWeight() { return mInfo->mMaxWeight; } 130 F32 getMaxWeight() { return mInfo->mMaxWeight; }
130 F32 getDefaultWeight() { return mInfo->mDefaultWeight; } 131 F32 getDefaultWeight() { return mInfo->mDefaultWeight; }
@@ -133,7 +134,8 @@ public:
133 F32 getWeight() { return mIsAnimating ? mTargetWeight : mCurWeight; } 134 F32 getWeight() { return mIsAnimating ? mTargetWeight : mCurWeight; }
134 F32 getCurrentWeight() { return mCurWeight; } 135 F32 getCurrentWeight() { return mCurWeight; }
135 F32 getLastWeight() { return mLastWeight; } 136 F32 getLastWeight() { return mLastWeight; }
136 BOOL isAnimating() { return mIsAnimating; } 137 BOOL isAnimating() { return mIsAnimating; }
138 BOOL isTweakable() { return (getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE) || (getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT); }
137 139
138 LLVisualParam* getNextParam() { return mNext; } 140 LLVisualParam* getNextParam() { return mNext; }
139 void setNextParam( LLVisualParam *next ); 141 void setNextParam( LLVisualParam *next );
@@ -141,6 +143,7 @@ public:
141 virtual void setAnimating(BOOL is_animating) { mIsAnimating = is_animating; } 143 virtual void setAnimating(BOOL is_animating) { mIsAnimating = is_animating; }
142 BOOL getAnimating() { return mIsAnimating; } 144 BOOL getAnimating() { return mIsAnimating; }
143 145
146
144protected: 147protected:
145 F32 mCurWeight; // current weight 148 F32 mCurWeight; // current weight
146 F32 mLastWeight; // last weight 149 F32 mLastWeight; // last weight