From d58b9ee54e84b709e063cdbbc349de25feafa59b Mon Sep 17 00:00:00 2001 From: Nyx Linden Date: Thu, 25 Apr 2013 14:09:42 -0400 Subject: SH-4050 FIX camera goes underground if hover set low enough Changing viewer limit for avatar height to match server limit, camera does not go underground. Also clarified where we do not need avatar offset in the code, through comments --- indra/llappearance/llavatarappearance.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'indra/llappearance') diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp index 3bb759d458..0196558a5a 100644 --- a/indra/llappearance/llavatarappearance.cpp +++ b/indra/llappearance/llavatarappearance.cpp @@ -491,11 +491,13 @@ void LLAvatarAppearance::computeBodySize() // Certain configurations of avatars can force the overall height (with offset) to go negative. // Enforce a constraint to make sure we don't go below 0.1 meters. // Camera positioning and other things start to break down when your avatar is "walking" while being fully underground - if (new_body_size.mV[VZ] + mAvatarOffset.mV[VZ] < 0.1f) + if (new_body_size.mV[VZ] + mAvatarOffset.mV[VZ] < 1.1f) { - mAvatarOffset.mV[VZ] = -(new_body_size.mV[VZ] - 0.11f); // avoid floating point rounding making the above check continue to fail. + F32 old_offset = mAvatarOffset.mV[VZ]; + F32 old_effective_height = new_body_size.mV[VZ] + mAvatarOffset.mV[VZ]; + mAvatarOffset.mV[VZ] = -(new_body_size.mV[VZ] - 1.11f); // avoid floating point rounding making the above check continue to fail. - llassert(new_body_size.mV[VZ] + mAvatarOffset.mV[VZ] >= 0.1f); + llassert(new_body_size.mV[VZ] + mAvatarOffset.mV[VZ] >= 1.1f); if (mWearableData && isSelf()) { -- cgit v1.2.3 From f35a229281c1b9dbec1f6f939e97344ed86d5429 Mon Sep 17 00:00:00 2001 From: Nyx Linden Date: Thu, 25 Apr 2013 16:17:01 -0400 Subject: BUILDFIX: removing unused variables --- indra/llappearance/llavatarappearance.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/llappearance') diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp index 0196558a5a..0a15f06bfd 100644 --- a/indra/llappearance/llavatarappearance.cpp +++ b/indra/llappearance/llavatarappearance.cpp @@ -493,8 +493,6 @@ void LLAvatarAppearance::computeBodySize() // Camera positioning and other things start to break down when your avatar is "walking" while being fully underground if (new_body_size.mV[VZ] + mAvatarOffset.mV[VZ] < 1.1f) { - F32 old_offset = mAvatarOffset.mV[VZ]; - F32 old_effective_height = new_body_size.mV[VZ] + mAvatarOffset.mV[VZ]; mAvatarOffset.mV[VZ] = -(new_body_size.mV[VZ] - 1.11f); // avoid floating point rounding making the above check continue to fail. llassert(new_body_size.mV[VZ] + mAvatarOffset.mV[VZ] >= 1.1f); -- cgit v1.2.3 From fcb4f8265dd7ca80ebf858e31b86ac523465e74d Mon Sep 17 00:00:00 2001 From: Nyx Linden Date: Mon, 29 Apr 2013 11:49:49 -0400 Subject: SH-4146 FIX petite avatars can't touch the ground adjusted avatar hover limits to make sure that they are not forced to go above the default --- indra/llappearance/llavatarappearance.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'indra/llappearance') diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp index 0a15f06bfd..0abe9ccb87 100644 --- a/indra/llappearance/llavatarappearance.cpp +++ b/indra/llappearance/llavatarappearance.cpp @@ -491,12 +491,21 @@ void LLAvatarAppearance::computeBodySize() // Certain configurations of avatars can force the overall height (with offset) to go negative. // Enforce a constraint to make sure we don't go below 0.1 meters. // Camera positioning and other things start to break down when your avatar is "walking" while being fully underground - if (new_body_size.mV[VZ] + mAvatarOffset.mV[VZ] < 1.1f) + if (new_body_size.mV[VZ] + mAvatarOffset.mV[VZ] < 1.1f && mAvatarOffset.mV[VZ] < 0.0f) { mAvatarOffset.mV[VZ] = -(new_body_size.mV[VZ] - 1.11f); // avoid floating point rounding making the above check continue to fail. llassert(new_body_size.mV[VZ] + mAvatarOffset.mV[VZ] >= 1.1f); + + // some mesh avatars force the default height to be less than 1.1 meters. Do not force hover to be positive. + // This will allow them to appear to be on the ground, even if the server forces their physics shape to be + // taller than their visual representation. + if (mAvatarOffset.mV[VZ] > 0.0f) + { + mAvatarOffset.mV[VZ] = 0.0f; + } + if (mWearableData && isSelf()) { LLWearable* shape = mWearableData->getWearable(LLWearableType::WT_SHAPE, 0); -- cgit v1.2.3 From af1431731802320e241037486b8bff0003a4d827 Mon Sep 17 00:00:00 2001 From: Nyx Linden Date: Thu, 2 May 2013 13:56:10 -0400 Subject: SH-4060 FIX avatar hover being set to minimum at seemingly random times avatar hover was being temporarily set to -2.0 for the preview render, which was triggering the minimum enforcement, even when the user's requested value is no where near the minimum. Added a flag to disable the minimum enforcement if we are temporarily changing the value. --- indra/llappearance/llavatarappearance.cpp | 28 ---------------------------- indra/llappearance/llavatarappearance.h | 2 +- 2 files changed, 1 insertion(+), 29 deletions(-) (limited to 'indra/llappearance') diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp index 0abe9ccb87..e3497c107d 100644 --- a/indra/llappearance/llavatarappearance.cpp +++ b/indra/llappearance/llavatarappearance.cpp @@ -488,34 +488,6 @@ void LLAvatarAppearance::computeBodySize() mAvatarOffset.mV[VX] = 0.0f; mAvatarOffset.mV[VY] = 0.0f; - // Certain configurations of avatars can force the overall height (with offset) to go negative. - // Enforce a constraint to make sure we don't go below 0.1 meters. - // Camera positioning and other things start to break down when your avatar is "walking" while being fully underground - if (new_body_size.mV[VZ] + mAvatarOffset.mV[VZ] < 1.1f && mAvatarOffset.mV[VZ] < 0.0f) - { - mAvatarOffset.mV[VZ] = -(new_body_size.mV[VZ] - 1.11f); // avoid floating point rounding making the above check continue to fail. - - llassert(new_body_size.mV[VZ] + mAvatarOffset.mV[VZ] >= 1.1f); - - - // some mesh avatars force the default height to be less than 1.1 meters. Do not force hover to be positive. - // This will allow them to appear to be on the ground, even if the server forces their physics shape to be - // taller than their visual representation. - if (mAvatarOffset.mV[VZ] > 0.0f) - { - mAvatarOffset.mV[VZ] = 0.0f; - } - - if (mWearableData && isSelf()) - { - LLWearable* shape = mWearableData->getWearable(LLWearableType::WT_SHAPE, 0); - if (shape) - { - shape->setVisualParamWeight(AVATAR_HOVER, mAvatarOffset.mV[VZ], false); - } - } - } - if (new_body_size != mBodySize || old_offset != mAvatarOffset.mV[VZ]) { mBodySize = new_body_size; diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h index bce2540258..0a6a236d34 100644 --- a/indra/llappearance/llavatarappearance.h +++ b/indra/llappearance/llavatarappearance.h @@ -137,7 +137,7 @@ public: typedef std::map joint_map_t; joint_map_t mJointMap; - void computeBodySize(); + virtual void computeBodySize(); protected: -- cgit v1.2.3 From 39b734a00199eb7d24edf06f9c496161819ebde7 Mon Sep 17 00:00:00 2001 From: Nyx Linden Date: Fri, 28 Jun 2013 11:59:03 -0400 Subject: SH-4240 FIX users can set hover height to 0 removing minimum height enforcement, as changes are local-only and would not be visible by other users in this repro, unless the user explicitly saved the changes. Since there are many ways to get around the enforcement, and the enforced minimums won't be visible to other users, its simpler to allow users to use the full range of the hover slider. NOTE: this means that a user's avatar can be underground, leading to the camera pointing up at the sky. this is a known issue. --- indra/llappearance/llavatarappearance.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llappearance') diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h index 0a6a236d34..bf13680496 100644 --- a/indra/llappearance/llavatarappearance.h +++ b/indra/llappearance/llavatarappearance.h @@ -137,7 +137,7 @@ public: typedef std::map joint_map_t; joint_map_t mJointMap; - virtual void computeBodySize(); + void computeBodySize(); protected: -- cgit v1.2.3 From a1fadad9c0bd1ba261f827d6da572db5621f5bed Mon Sep 17 00:00:00 2001 From: prep Date: Wed, 24 Jul 2013 16:01:36 -0400 Subject: Sh-4321 # Fixes for detach deformations. General code cleanup as well. --- indra/llappearance/llpolyskeletaldistortion.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'indra/llappearance') diff --git a/indra/llappearance/llpolyskeletaldistortion.cpp b/indra/llappearance/llpolyskeletaldistortion.cpp index 4ba16691c2..eb86f77d97 100644 --- a/indra/llappearance/llpolyskeletaldistortion.cpp +++ b/indra/llappearance/llpolyskeletaldistortion.cpp @@ -192,7 +192,7 @@ void LLPolySkeletalDistortion::apply( ESex avatar_sex ) { LLFastTimer t(FTM_POLYSKELETAL_DISTORTION_APPLY); - F32 effective_weight = ( getSex() & avatar_sex ) ? mCurWeight : getDefaultWeight(); + F32 effective_weight = ( getSex() & avatar_sex ) ? mCurWeight : getDefaultWeight(); LLJoint* joint; joint_vec_map_t::iterator iter; @@ -204,8 +204,10 @@ void LLPolySkeletalDistortion::apply( ESex avatar_sex ) joint = iter->first; LLVector3 newScale = joint->getScale(); LLVector3 scaleDelta = iter->second; - newScale = newScale + (effective_weight * scaleDelta) - (mLastWeight * scaleDelta); - joint->setScale(newScale); + newScale = newScale + (effective_weight * scaleDelta) - (mLastWeight * scaleDelta); + //An aspect of attached mesh objects (which contain joint offsets) that need to be cleaned up when detached + joint->storeScaleForReset( newScale ); + joint->setScale(newScale); } for (iter = mJointOffsets.begin(); @@ -214,8 +216,8 @@ void LLPolySkeletalDistortion::apply( ESex avatar_sex ) { joint = iter->first; LLVector3 newPosition = joint->getPosition(); - LLVector3 positionDelta = iter->second; - newPosition = newPosition + (effective_weight * positionDelta) - (mLastWeight * positionDelta); + LLVector3 positionDelta = iter->second; + newPosition = newPosition + (effective_weight * positionDelta) - (mLastWeight * positionDelta); joint->setPosition(newPosition); } -- cgit v1.2.3 From 36bb33b12ab090e2acbc7e00039cdff682882fa4 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 18 Sep 2013 17:03:34 -0400 Subject: sunshine cleanup annotations --- indra/llappearance/llavatarappearance.h | 3 +++ indra/llappearance/lltexglobalcolor.cpp | 1 + indra/llappearance/lltexglobalcolor.h | 1 + indra/llappearance/lltexlayerparams.cpp | 5 +++++ indra/llappearance/lltexlayerparams.h | 4 ++++ 5 files changed, 14 insertions(+) mode change 100644 => 100755 indra/llappearance/llavatarappearance.h mode change 100644 => 100755 indra/llappearance/lltexlayerparams.cpp mode change 100644 => 100755 indra/llappearance/lltexlayerparams.h (limited to 'indra/llappearance') diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h old mode 100644 new mode 100755 index bf13680496..3cb28c1137 --- a/indra/llappearance/llavatarappearance.h +++ b/indra/llappearance/llavatarappearance.h @@ -225,6 +225,7 @@ public: // Composites //-------------------------------------------------------------------- public: + // SUNSHINE CLEANUP no upload virtual void invalidateComposite(LLTexLayerSet* layerset, BOOL upload_result) = 0; /******************************************************************************** @@ -256,6 +257,7 @@ protected: // Clothing colors (convenience functions to access visual parameters) //-------------------------------------------------------------------- public: + // SUNSHINE CLEANUP no upload void setClothesColor(LLAvatarAppearanceDefines::ETextureIndex te, const LLColor4& new_color, BOOL upload_bake); LLColor4 getClothesColor(LLAvatarAppearanceDefines::ETextureIndex te); static BOOL teToColorParams(LLAvatarAppearanceDefines::ETextureIndex te, U32 *param_name); @@ -265,6 +267,7 @@ public: //-------------------------------------------------------------------- public: LLColor4 getGlobalColor(const std::string& color_name ) const; + // SUNSHINE CLEANUP no upload virtual void onGlobalColorChanged(const LLTexGlobalColor* global_color, BOOL upload_bake) = 0; protected: LLTexGlobalColor* mTexSkinColor; diff --git a/indra/llappearance/lltexglobalcolor.cpp b/indra/llappearance/lltexglobalcolor.cpp index f38b982104..958f5f3069 100644 --- a/indra/llappearance/lltexglobalcolor.cpp +++ b/indra/llappearance/lltexglobalcolor.cpp @@ -103,6 +103,7 @@ LLTexParamGlobalColor::LLTexParamGlobalColor(LLTexGlobalColor* tex_global_color) return new_param; } + // SUNSHINE CLEANUP no upload void LLTexParamGlobalColor::onGlobalColorChanged(bool upload_bake) { mAvatarAppearance->onGlobalColorChanged(mTexGlobalColor, upload_bake); diff --git a/indra/llappearance/lltexglobalcolor.h b/indra/llappearance/lltexglobalcolor.h index 2867479876..b9d12c801e 100644 --- a/indra/llappearance/lltexglobalcolor.h +++ b/indra/llappearance/lltexglobalcolor.h @@ -75,6 +75,7 @@ public: LLTexParamGlobalColor(LLTexGlobalColor *tex_color); /*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const; protected: + // SUNSHINE CLEANUP no upload /*virtual*/ void onGlobalColorChanged(bool upload_bake); private: LLTexGlobalColor* mTexGlobalColor; diff --git a/indra/llappearance/lltexlayerparams.cpp b/indra/llappearance/lltexlayerparams.cpp old mode 100644 new mode 100755 index 6aae9a8cc1..cd48dcece4 --- a/indra/llappearance/lltexlayerparams.cpp +++ b/indra/llappearance/lltexlayerparams.cpp @@ -160,6 +160,7 @@ BOOL LLTexLayerParamAlpha::getMultiplyBlend() const return ((LLTexLayerParamAlphaInfo *)getInfo())->mMultiplyBlend; } +// SUNSHINE CLEANUP no upload_bake void LLTexLayerParamAlpha::setWeight(F32 weight, BOOL upload_bake) { if (mIsAnimating || mTexLayer == NULL) @@ -184,6 +185,7 @@ void LLTexLayerParamAlpha::setWeight(F32 weight, BOOL upload_bake) } } +// SUNSHINE CLEANUP no upload_bake void LLTexLayerParamAlpha::setAnimationTarget(F32 target_value, BOOL upload_bake) { // do not animate dummy parameters @@ -202,6 +204,7 @@ void LLTexLayerParamAlpha::setAnimationTarget(F32 target_value, BOOL upload_bake } } +// SUNSHINE CLEANUP no upload_bake void LLTexLayerParamAlpha::animate(F32 delta, BOOL upload_bake) { if (mNext) @@ -449,6 +452,8 @@ LLColor4 LLTexLayerParamColor::getNetColor() const } } + +// SUNSHINE CLEANUP no upload_bake void LLTexLayerParamColor::setWeight(F32 weight, BOOL upload_bake) { if (mIsAnimating) diff --git a/indra/llappearance/lltexlayerparams.h b/indra/llappearance/lltexlayerparams.h old mode 100644 new mode 100755 index b38d28d3eb..c1ea8a9fb6 --- a/indra/llappearance/lltexlayerparams.h +++ b/indra/llappearance/lltexlayerparams.h @@ -83,8 +83,11 @@ public: // LLVisualParam Virtual functions ///*virtual*/ BOOL parseData(LLXmlTreeNode* node); /*virtual*/ void apply( ESex avatar_sex ) {} + // SUNSHINE CLEANUP no upload_bake /*virtual*/ void setWeight(F32 weight, BOOL upload_bake); + // SUNSHINE CLEANUP no upload_bake /*virtual*/ void setAnimationTarget(F32 target_value, BOOL upload_bake); + // SUNSHINE CLEANUP no upload_bake /*virtual*/ void animate(F32 delta, BOOL upload_bake); // LLViewerVisualParam Virtual functions @@ -190,6 +193,7 @@ public: // New functions LLColor4 getNetColor() const; protected: + // SUNSHINE CLEANUP no upload virtual void onGlobalColorChanged(bool upload_bake) {} private: LL_ALIGN_16(LLVector4a mAvgDistortionVec); -- cgit v1.2.3 From 82f147367fb5e4ee4bbe53db01856ea375058825 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 19 Sep 2013 11:10:59 -0400 Subject: SH-3455 WIP - removing bake upload code --- indra/llappearance/llavatarappearance.cpp | 8 +++---- indra/llappearance/llavatarappearance.h | 6 ++--- indra/llappearance/lldriverparam.cpp | 28 +++++++++++----------- indra/llappearance/lldriverparam.h | 8 +++---- indra/llappearance/llpolymorph.cpp | 2 +- indra/llappearance/llpolyskeletaldistortion.cpp | 2 +- indra/llappearance/lltexglobalcolor.cpp | 4 ++-- indra/llappearance/lltexglobalcolor.h | 2 +- indra/llappearance/lltexlayerparams.cpp | 32 ++++++++++++------------- indra/llappearance/lltexlayerparams.h | 14 +++++------ indra/llappearance/llviewervisualparam.cpp | 2 +- indra/llappearance/llwearable.cpp | 18 +++++++------- indra/llappearance/llwearable.h | 6 ++--- 13 files changed, 66 insertions(+), 66 deletions(-) mode change 100644 => 100755 indra/llappearance/llavatarappearance.cpp mode change 100644 => 100755 indra/llappearance/lldriverparam.cpp mode change 100644 => 100755 indra/llappearance/lldriverparam.h mode change 100644 => 100755 indra/llappearance/lltexglobalcolor.cpp mode change 100644 => 100755 indra/llappearance/lltexglobalcolor.h mode change 100644 => 100755 indra/llappearance/llwearable.cpp mode change 100644 => 100755 indra/llappearance/llwearable.h (limited to 'indra/llappearance') diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp old mode 100644 new mode 100755 index e3497c107d..05cd7e8c41 --- a/indra/llappearance/llavatarappearance.cpp +++ b/indra/llappearance/llavatarappearance.cpp @@ -1361,14 +1361,14 @@ BOOL LLAvatarAppearance::teToColorParams( ETextureIndex te, U32 *param_name ) return TRUE; } -void LLAvatarAppearance::setClothesColor( ETextureIndex te, const LLColor4& new_color, BOOL upload_bake ) +void LLAvatarAppearance::setClothesColor( ETextureIndex te, const LLColor4& new_color) { U32 param_name[3]; if( teToColorParams( te, param_name ) ) { - setVisualParamWeight( param_name[0], new_color.mV[VX], upload_bake ); - setVisualParamWeight( param_name[1], new_color.mV[VY], upload_bake ); - setVisualParamWeight( param_name[2], new_color.mV[VZ], upload_bake ); + setVisualParamWeight( param_name[0], new_color.mV[VX]); + setVisualParamWeight( param_name[1], new_color.mV[VY]); + setVisualParamWeight( param_name[2], new_color.mV[VZ]); } } diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h index 3cb28c1137..d7bfe0d7c7 100755 --- a/indra/llappearance/llavatarappearance.h +++ b/indra/llappearance/llavatarappearance.h @@ -226,7 +226,7 @@ public: //-------------------------------------------------------------------- public: // SUNSHINE CLEANUP no upload - virtual void invalidateComposite(LLTexLayerSet* layerset, BOOL upload_result) = 0; + virtual void invalidateComposite(LLTexLayerSet* layerset) = 0; /******************************************************************************** ** ** @@ -258,7 +258,7 @@ protected: //-------------------------------------------------------------------- public: // SUNSHINE CLEANUP no upload - void setClothesColor(LLAvatarAppearanceDefines::ETextureIndex te, const LLColor4& new_color, BOOL upload_bake); + void setClothesColor(LLAvatarAppearanceDefines::ETextureIndex te, const LLColor4& new_color); LLColor4 getClothesColor(LLAvatarAppearanceDefines::ETextureIndex te); static BOOL teToColorParams(LLAvatarAppearanceDefines::ETextureIndex te, U32 *param_name); @@ -268,7 +268,7 @@ public: public: LLColor4 getGlobalColor(const std::string& color_name ) const; // SUNSHINE CLEANUP no upload - virtual void onGlobalColorChanged(const LLTexGlobalColor* global_color, BOOL upload_bake) = 0; + virtual void onGlobalColorChanged(const LLTexGlobalColor* global_color) = 0; protected: LLTexGlobalColor* mTexSkinColor; LLTexGlobalColor* mTexHairColor; diff --git a/indra/llappearance/lldriverparam.cpp b/indra/llappearance/lldriverparam.cpp old mode 100644 new mode 100755 index 1f7e8b8652..83dbcfd6bf --- a/indra/llappearance/lldriverparam.cpp +++ b/indra/llappearance/lldriverparam.cpp @@ -178,7 +178,7 @@ BOOL LLDriverParam::setInfo(LLDriverParamInfo *info) mID = info->mID; info->mDriverParam = this; - setWeight(getDefaultWeight(), FALSE ); + setWeight(getDefaultWeight()); return TRUE; } @@ -195,7 +195,7 @@ BOOL LLDriverParam::setInfo(LLDriverParamInfo *info) return new_param; } -void LLDriverParam::setWeight(F32 weight, BOOL upload_bake) +void LLDriverParam::setWeight(F32 weight) { F32 min_weight = getMinWeight(); F32 max_weight = getMaxWeight(); @@ -254,7 +254,7 @@ void LLDriverParam::setWeight(F32 weight, BOOL upload_bake) driven_weight = driven_min; } - setDrivenWeight(driven,driven_weight,upload_bake); + setDrivenWeight(driven,driven_weight); continue; } else @@ -278,13 +278,13 @@ void LLDriverParam::setWeight(F32 weight, BOOL upload_bake) driven_weight = driven_min; } - setDrivenWeight(driven,driven_weight,upload_bake); + setDrivenWeight(driven,driven_weight); continue; } } driven_weight = getDrivenWeight(driven, mCurWeight); - setDrivenWeight(driven,driven_weight,upload_bake); + setDrivenWeight(driven,driven_weight); } } @@ -430,9 +430,9 @@ const LLViewerVisualParam* LLDriverParam::getDrivenParam(S32 index) const //----------------------------------------------------------------------------- // setAnimationTarget() //----------------------------------------------------------------------------- -void LLDriverParam::setAnimationTarget( F32 target_value, BOOL upload_bake ) +void LLDriverParam::setAnimationTarget( F32 target_value) { - LLVisualParam::setAnimationTarget(target_value, upload_bake); + LLVisualParam::setAnimationTarget(target_value); for( entry_list_t::iterator iter = mDriven.begin(); iter != mDriven.end(); iter++ ) { @@ -441,16 +441,16 @@ void LLDriverParam::setAnimationTarget( F32 target_value, BOOL upload_bake ) // this isn't normally necessary, as driver params handle interpolation of their driven params // but texture params need to know to assume their final value at beginning of interpolation - driven->mParam->setAnimationTarget(driven_weight, upload_bake); + driven->mParam->setAnimationTarget(driven_weight); } } //----------------------------------------------------------------------------- // stopAnimating() //----------------------------------------------------------------------------- -void LLDriverParam::stopAnimating(BOOL upload_bake) +void LLDriverParam::stopAnimating() { - LLVisualParam::stopAnimating(upload_bake); + LLVisualParam::stopAnimating(); for( entry_list_t::iterator iter = mDriven.begin(); iter != mDriven.end(); iter++ ) { @@ -530,7 +530,7 @@ void LLDriverParam::updateCrossDrivenParams(LLWearableType::EType driven_type) LLWearable *wearable = mAvatarAppearance->getWearableData()->getTopWearable(driver_type); if (wearable) { - wearable->setVisualParamWeight(mID, wearable->getVisualParamWeight(mID), false); + wearable->setVisualParamWeight(mID, wearable->getVisualParamWeight(mID)); } } } @@ -593,7 +593,7 @@ F32 LLDriverParam::getDrivenWeight(const LLDrivenEntry* driven, F32 input_weight return driven_weight; } -void LLDriverParam::setDrivenWeight(LLDrivenEntry *driven, F32 driven_weight, bool upload_bake) +void LLDriverParam::setDrivenWeight(LLDrivenEntry *driven, F32 driven_weight) { bool use_self = false; if(mWearablep && @@ -610,10 +610,10 @@ void LLDriverParam::setDrivenWeight(LLDrivenEntry *driven, F32 driven_weight, bo if (use_self) { // call setWeight through LLVOAvatarSelf so other wearables can be updated with the correct values - mAvatarAppearance->setVisualParamWeight( (LLVisualParam*)driven->mParam, driven_weight, upload_bake ); + mAvatarAppearance->setVisualParamWeight( (LLVisualParam*)driven->mParam, driven_weight); } else { - driven->mParam->setWeight( driven_weight, upload_bake ); + driven->mParam->setWeight( driven_weight); } } diff --git a/indra/llappearance/lldriverparam.h b/indra/llappearance/lldriverparam.h old mode 100644 new mode 100755 index 040c9cf5be..5a45c8f30d --- a/indra/llappearance/lldriverparam.h +++ b/indra/llappearance/lldriverparam.h @@ -110,9 +110,9 @@ public: // LLVisualParam Virtual functions /*virtual*/ void apply( ESex sex ) {} // apply is called separately for each driven param. - /*virtual*/ void setWeight(F32 weight, BOOL upload_bake); - /*virtual*/ void setAnimationTarget( F32 target_value, BOOL upload_bake ); - /*virtual*/ void stopAnimating(BOOL upload_bake); + /*virtual*/ void setWeight(F32 weight); + /*virtual*/ void setAnimationTarget( F32 target_value); + /*virtual*/ void stopAnimating(); /*virtual*/ BOOL linkDrivenParams(visual_param_mapper mapper, BOOL only_cross_params); /*virtual*/ void resetDrivenParams(); @@ -129,7 +129,7 @@ public: protected: F32 getDrivenWeight(const LLDrivenEntry* driven, F32 input_weight); - void setDrivenWeight(LLDrivenEntry *driven, F32 driven_weight, bool upload_bake); + void setDrivenWeight(LLDrivenEntry *driven, F32 driven_weight); LL_ALIGN_16(LLVector4a mDefaultVec); // temp holder diff --git a/indra/llappearance/llpolymorph.cpp b/indra/llappearance/llpolymorph.cpp index 93c2f15a53..84df3f1830 100644 --- a/indra/llappearance/llpolymorph.cpp +++ b/indra/llappearance/llpolymorph.cpp @@ -342,7 +342,7 @@ BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info) return FALSE; mInfo = info; mID = info->mID; - setWeight(getDefaultWeight(), FALSE ); + setWeight(getDefaultWeight()); LLAvatarAppearance* avatarp = mMesh->getAvatar(); LLPolyMorphTargetInfo::volume_info_list_t::iterator iter; diff --git a/indra/llappearance/llpolyskeletaldistortion.cpp b/indra/llappearance/llpolyskeletaldistortion.cpp index eb86f77d97..2a5866afe4 100644 --- a/indra/llappearance/llpolyskeletaldistortion.cpp +++ b/indra/llappearance/llpolyskeletaldistortion.cpp @@ -130,7 +130,7 @@ BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info) return FALSE; mInfo = info; mID = info->mID; - setWeight(getDefaultWeight(), FALSE ); + setWeight(getDefaultWeight()); LLPolySkeletalDistortionInfo::bone_info_list_t::iterator iter; for (iter = getInfo()->mBoneInfoList.begin(); iter != getInfo()->mBoneInfoList.end(); iter++) diff --git a/indra/llappearance/lltexglobalcolor.cpp b/indra/llappearance/lltexglobalcolor.cpp old mode 100644 new mode 100755 index 958f5f3069..b9539e45b8 --- a/indra/llappearance/lltexglobalcolor.cpp +++ b/indra/llappearance/lltexglobalcolor.cpp @@ -104,9 +104,9 @@ LLTexParamGlobalColor::LLTexParamGlobalColor(LLTexGlobalColor* tex_global_color) } // SUNSHINE CLEANUP no upload -void LLTexParamGlobalColor::onGlobalColorChanged(bool upload_bake) +void LLTexParamGlobalColor::onGlobalColorChanged() { - mAvatarAppearance->onGlobalColorChanged(mTexGlobalColor, upload_bake); + mAvatarAppearance->onGlobalColorChanged(mTexGlobalColor); } //----------------------------------------------------------------------------- diff --git a/indra/llappearance/lltexglobalcolor.h b/indra/llappearance/lltexglobalcolor.h old mode 100644 new mode 100755 index b9d12c801e..3a6f852baf --- a/indra/llappearance/lltexglobalcolor.h +++ b/indra/llappearance/lltexglobalcolor.h @@ -76,7 +76,7 @@ public: /*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const; protected: // SUNSHINE CLEANUP no upload - /*virtual*/ void onGlobalColorChanged(bool upload_bake); + /*virtual*/ void onGlobalColorChanged(); private: LLTexGlobalColor* mTexGlobalColor; }; diff --git a/indra/llappearance/lltexlayerparams.cpp b/indra/llappearance/lltexlayerparams.cpp index cd48dcece4..6d4001958e 100755 --- a/indra/llappearance/lltexlayerparams.cpp +++ b/indra/llappearance/lltexlayerparams.cpp @@ -161,7 +161,7 @@ BOOL LLTexLayerParamAlpha::getMultiplyBlend() const } // SUNSHINE CLEANUP no upload_bake -void LLTexLayerParamAlpha::setWeight(F32 weight, BOOL upload_bake) +void LLTexLayerParamAlpha::setWeight(F32 weight) { if (mIsAnimating || mTexLayer == NULL) { @@ -179,37 +179,37 @@ void LLTexLayerParamAlpha::setWeight(F32 weight, BOOL upload_bake) if ((mAvatarAppearance->getSex() & getSex()) && (mAvatarAppearance->isSelf() && !mIsDummy)) // only trigger a baked texture update if we're changing a wearable's visual param. { - mAvatarAppearance->invalidateComposite(mTexLayer->getTexLayerSet(), upload_bake); + mAvatarAppearance->invalidateComposite(mTexLayer->getTexLayerSet()); mTexLayer->invalidateMorphMasks(); } } } // SUNSHINE CLEANUP no upload_bake -void LLTexLayerParamAlpha::setAnimationTarget(F32 target_value, BOOL upload_bake) +void LLTexLayerParamAlpha::setAnimationTarget(F32 target_value) { // do not animate dummy parameters if (mIsDummy) { - setWeight(target_value, upload_bake); + setWeight(target_value); return; } mTargetWeight = target_value; - setWeight(target_value, upload_bake); + setWeight(target_value); mIsAnimating = TRUE; if (mNext) { - mNext->setAnimationTarget(target_value, upload_bake); + mNext->setAnimationTarget(target_value); } } // SUNSHINE CLEANUP no upload_bake -void LLTexLayerParamAlpha::animate(F32 delta, BOOL upload_bake) +void LLTexLayerParamAlpha::animate(F32 delta) { if (mNext) { - mNext->animate(delta, upload_bake); + mNext->animate(delta); } } @@ -454,7 +454,7 @@ LLColor4 LLTexLayerParamColor::getNetColor() const // SUNSHINE CLEANUP no upload_bake -void LLTexLayerParamColor::setWeight(F32 weight, BOOL upload_bake) +void LLTexLayerParamColor::setWeight(F32 weight) { if (mIsAnimating) { @@ -479,10 +479,10 @@ void LLTexLayerParamColor::setWeight(F32 weight, BOOL upload_bake) if ((mAvatarAppearance->getSex() & getSex()) && (mAvatarAppearance->isSelf() && !mIsDummy)) // only trigger a baked texture update if we're changing a wearable's visual param. { - onGlobalColorChanged(upload_bake); + onGlobalColorChanged(); if (mTexLayer) { - mAvatarAppearance->invalidateComposite(mTexLayer->getTexLayerSet(), upload_bake); + mAvatarAppearance->invalidateComposite(mTexLayer->getTexLayerSet()); } } @@ -490,23 +490,23 @@ void LLTexLayerParamColor::setWeight(F32 weight, BOOL upload_bake) } } -void LLTexLayerParamColor::setAnimationTarget(F32 target_value, BOOL upload_bake) +void LLTexLayerParamColor::setAnimationTarget(F32 target_value) { // set value first then set interpolating flag to ignore further updates mTargetWeight = target_value; - setWeight(target_value, upload_bake); + setWeight(target_value); mIsAnimating = TRUE; if (mNext) { - mNext->setAnimationTarget(target_value, upload_bake); + mNext->setAnimationTarget(target_value); } } -void LLTexLayerParamColor::animate(F32 delta, BOOL upload_bake) +void LLTexLayerParamColor::animate(F32 delta) { if (mNext) { - mNext->animate(delta, upload_bake); + mNext->animate(delta); } } diff --git a/indra/llappearance/lltexlayerparams.h b/indra/llappearance/lltexlayerparams.h index c1ea8a9fb6..86d1ea9e67 100755 --- a/indra/llappearance/lltexlayerparams.h +++ b/indra/llappearance/lltexlayerparams.h @@ -84,11 +84,11 @@ public: ///*virtual*/ BOOL parseData(LLXmlTreeNode* node); /*virtual*/ void apply( ESex avatar_sex ) {} // SUNSHINE CLEANUP no upload_bake - /*virtual*/ void setWeight(F32 weight, BOOL upload_bake); + /*virtual*/ void setWeight(F32 weight); // SUNSHINE CLEANUP no upload_bake - /*virtual*/ void setAnimationTarget(F32 target_value, BOOL upload_bake); + /*virtual*/ void setAnimationTarget(F32 target_value); // SUNSHINE CLEANUP no upload_bake - /*virtual*/ void animate(F32 delta, BOOL upload_bake); + /*virtual*/ void animate(F32 delta); // LLViewerVisualParam Virtual functions /*virtual*/ F32 getTotalDistortion() { return 1.f; } @@ -177,9 +177,9 @@ public: // LLVisualParam Virtual functions ///*virtual*/ BOOL parseData(LLXmlTreeNode* node); /*virtual*/ void apply( ESex avatar_sex ) {} - /*virtual*/ void setWeight(F32 weight, BOOL upload_bake); - /*virtual*/ void setAnimationTarget(F32 target_value, BOOL upload_bake); - /*virtual*/ void animate(F32 delta, BOOL upload_bake); + /*virtual*/ void setWeight(F32 weight); + /*virtual*/ void setAnimationTarget(F32 target_value); + /*virtual*/ void animate(F32 delta); // LLViewerVisualParam Virtual functions @@ -194,7 +194,7 @@ public: LLColor4 getNetColor() const; protected: // SUNSHINE CLEANUP no upload - virtual void onGlobalColorChanged(bool upload_bake) {} + virtual void onGlobalColorChanged() {} private: LL_ALIGN_16(LLVector4a mAvgDistortionVec); } LL_ALIGN_POSTFIX(16); diff --git a/indra/llappearance/llviewervisualparam.cpp b/indra/llappearance/llviewervisualparam.cpp index cc81bcf118..0d8d1dbeca 100644 --- a/indra/llappearance/llviewervisualparam.cpp +++ b/indra/llappearance/llviewervisualparam.cpp @@ -137,7 +137,7 @@ BOOL LLViewerVisualParam::setInfo(LLViewerVisualParamInfo *info) return FALSE; mInfo = info; mID = info->mID; - setWeight(getDefaultWeight(), FALSE ); + setWeight(getDefaultWeight()); return TRUE; } diff --git a/indra/llappearance/llwearable.cpp b/indra/llappearance/llwearable.cpp old mode 100644 new mode 100755 index d86a460511..525a782ba0 --- a/indra/llappearance/llwearable.cpp +++ b/indra/llappearance/llwearable.cpp @@ -524,7 +524,7 @@ void LLWearable::revertValues() LLVisualParam *param = getVisualParam(id); if(param && !dynamic_cast(param) ) { - setVisualParamWeight(id, value, TRUE); + setVisualParamWeight(id, value); } } @@ -536,7 +536,7 @@ void LLWearable::revertValues() LLVisualParam *param = getVisualParam(id); if(param && dynamic_cast(param) ) { - setVisualParamWeight(id, value, TRUE); + setVisualParamWeight(id, value); } } @@ -646,12 +646,12 @@ void LLWearable::addVisualParam(LLVisualParam *param) } -void LLWearable::setVisualParamWeight(S32 param_index, F32 value, BOOL upload_bake) +void LLWearable::setVisualParamWeight(S32 param_index, F32 value) { if( is_in_map(mVisualParamIndexMap, param_index ) ) { LLVisualParam *wearable_param = mVisualParamIndexMap[param_index]; - wearable_param->setWeight(value, upload_bake); + wearable_param->setWeight(value); } else { @@ -692,14 +692,14 @@ void LLWearable::getVisualParams(visual_param_vec_t &list) } } -void LLWearable::animateParams(F32 delta, BOOL upload_bake) +void LLWearable::animateParams(F32 delta) { for(visual_param_index_map_t::iterator iter = mVisualParamIndexMap.begin(); iter != mVisualParamIndexMap.end(); ++iter) { LLVisualParam *param = (LLVisualParam*) iter->second; - param->animate(delta, upload_bake); + param->animate(delta); } } @@ -717,14 +717,14 @@ LLColor4 LLWearable::getClothesColor(S32 te) const return color; } -void LLWearable::setClothesColor( S32 te, const LLColor4& new_color, BOOL upload_bake ) +void LLWearable::setClothesColor( S32 te, const LLColor4& new_color) { U32 param_name[3]; if( LLAvatarAppearance::teToColorParams( (LLAvatarAppearanceDefines::ETextureIndex)te, param_name ) ) { for( U8 index = 0; index < 3; index++ ) { - setVisualParamWeight(param_name[index], new_color.mV[index], upload_bake); + setVisualParamWeight(param_name[index], new_color.mV[index]); } } } @@ -743,7 +743,7 @@ void LLWearable::writeToAvatar(LLAvatarAppearance* avatarp) S32 param_id = param->getID(); F32 weight = getVisualParamWeight(param_id); - avatarp->setVisualParamWeight( param_id, weight, FALSE ); + avatarp->setVisualParamWeight( param_id, weight); } } } diff --git a/indra/llappearance/llwearable.h b/indra/llappearance/llwearable.h old mode 100644 new mode 100755 index 6f5a1e14e8..84509a60fd --- a/indra/llappearance/llwearable.h +++ b/indra/llappearance/llwearable.h @@ -95,14 +95,14 @@ public: void setLocalTextureObject(S32 index, LLLocalTextureObject <o); void addVisualParam(LLVisualParam *param); - void setVisualParamWeight(S32 index, F32 value, BOOL upload_bake); + void setVisualParamWeight(S32 index, F32 value); F32 getVisualParamWeight(S32 index) const; LLVisualParam* getVisualParam(S32 index) const; void getVisualParams(visual_param_vec_t &list); - void animateParams(F32 delta, BOOL upload_bake); + void animateParams(F32 delta); LLColor4 getClothesColor(S32 te) const; - void setClothesColor( S32 te, const LLColor4& new_color, BOOL upload_bake ); + void setClothesColor( S32 te, const LLColor4& new_color); virtual void revertValues(); virtual void saveValues(); -- cgit v1.2.3 From d58e7cfbfcec163345e87c0c5e5f74d01075246b Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 19 Sep 2013 13:59:20 -0400 Subject: SH-3455 WIP - removing bake upload code --- indra/llappearance/llavatarappearance.cpp | 1 - indra/llappearance/llavatarappearance.h | 4 ---- indra/llappearance/lltexglobalcolor.cpp | 1 - indra/llappearance/lltexglobalcolor.h | 1 - indra/llappearance/lltexlayerparams.cpp | 4 ---- indra/llappearance/lltexlayerparams.h | 4 ---- 6 files changed, 15 deletions(-) (limited to 'indra/llappearance') diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp index 05cd7e8c41..f10ae813fd 100755 --- a/indra/llappearance/llavatarappearance.cpp +++ b/indra/llappearance/llavatarappearance.cpp @@ -491,7 +491,6 @@ void LLAvatarAppearance::computeBodySize() if (new_body_size != mBodySize || old_offset != mAvatarOffset.mV[VZ]) { mBodySize = new_body_size; - bodySizeChanged(); } } diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h index d7bfe0d7c7..3d99bb0cc7 100755 --- a/indra/llappearance/llavatarappearance.h +++ b/indra/llappearance/llavatarappearance.h @@ -144,7 +144,6 @@ protected: static BOOL parseSkeletonFile(const std::string& filename); virtual void buildCharacter(); virtual BOOL loadAvatar(); - virtual void bodySizeChanged() = 0; BOOL setupBone(const LLAvatarBoneInfo* info, LLJoint* parent, S32 ¤t_volume_num, S32 ¤t_joint_num); BOOL allocateCharacterJoints(U32 num); @@ -225,7 +224,6 @@ public: // Composites //-------------------------------------------------------------------- public: - // SUNSHINE CLEANUP no upload virtual void invalidateComposite(LLTexLayerSet* layerset) = 0; /******************************************************************************** @@ -257,7 +255,6 @@ protected: // Clothing colors (convenience functions to access visual parameters) //-------------------------------------------------------------------- public: - // SUNSHINE CLEANUP no upload void setClothesColor(LLAvatarAppearanceDefines::ETextureIndex te, const LLColor4& new_color); LLColor4 getClothesColor(LLAvatarAppearanceDefines::ETextureIndex te); static BOOL teToColorParams(LLAvatarAppearanceDefines::ETextureIndex te, U32 *param_name); @@ -267,7 +264,6 @@ public: //-------------------------------------------------------------------- public: LLColor4 getGlobalColor(const std::string& color_name ) const; - // SUNSHINE CLEANUP no upload virtual void onGlobalColorChanged(const LLTexGlobalColor* global_color) = 0; protected: LLTexGlobalColor* mTexSkinColor; diff --git a/indra/llappearance/lltexglobalcolor.cpp b/indra/llappearance/lltexglobalcolor.cpp index b9539e45b8..432e2e9f49 100755 --- a/indra/llappearance/lltexglobalcolor.cpp +++ b/indra/llappearance/lltexglobalcolor.cpp @@ -103,7 +103,6 @@ LLTexParamGlobalColor::LLTexParamGlobalColor(LLTexGlobalColor* tex_global_color) return new_param; } - // SUNSHINE CLEANUP no upload void LLTexParamGlobalColor::onGlobalColorChanged() { mAvatarAppearance->onGlobalColorChanged(mTexGlobalColor); diff --git a/indra/llappearance/lltexglobalcolor.h b/indra/llappearance/lltexglobalcolor.h index 3a6f852baf..1b0c91b5ca 100755 --- a/indra/llappearance/lltexglobalcolor.h +++ b/indra/llappearance/lltexglobalcolor.h @@ -75,7 +75,6 @@ public: LLTexParamGlobalColor(LLTexGlobalColor *tex_color); /*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const; protected: - // SUNSHINE CLEANUP no upload /*virtual*/ void onGlobalColorChanged(); private: LLTexGlobalColor* mTexGlobalColor; diff --git a/indra/llappearance/lltexlayerparams.cpp b/indra/llappearance/lltexlayerparams.cpp index 6d4001958e..80aded450d 100755 --- a/indra/llappearance/lltexlayerparams.cpp +++ b/indra/llappearance/lltexlayerparams.cpp @@ -160,7 +160,6 @@ BOOL LLTexLayerParamAlpha::getMultiplyBlend() const return ((LLTexLayerParamAlphaInfo *)getInfo())->mMultiplyBlend; } -// SUNSHINE CLEANUP no upload_bake void LLTexLayerParamAlpha::setWeight(F32 weight) { if (mIsAnimating || mTexLayer == NULL) @@ -185,7 +184,6 @@ void LLTexLayerParamAlpha::setWeight(F32 weight) } } -// SUNSHINE CLEANUP no upload_bake void LLTexLayerParamAlpha::setAnimationTarget(F32 target_value) { // do not animate dummy parameters @@ -204,7 +202,6 @@ void LLTexLayerParamAlpha::setAnimationTarget(F32 target_value) } } -// SUNSHINE CLEANUP no upload_bake void LLTexLayerParamAlpha::animate(F32 delta) { if (mNext) @@ -453,7 +450,6 @@ LLColor4 LLTexLayerParamColor::getNetColor() const } -// SUNSHINE CLEANUP no upload_bake void LLTexLayerParamColor::setWeight(F32 weight) { if (mIsAnimating) diff --git a/indra/llappearance/lltexlayerparams.h b/indra/llappearance/lltexlayerparams.h index 86d1ea9e67..e1a8c28265 100755 --- a/indra/llappearance/lltexlayerparams.h +++ b/indra/llappearance/lltexlayerparams.h @@ -83,11 +83,8 @@ public: // LLVisualParam Virtual functions ///*virtual*/ BOOL parseData(LLXmlTreeNode* node); /*virtual*/ void apply( ESex avatar_sex ) {} - // SUNSHINE CLEANUP no upload_bake /*virtual*/ void setWeight(F32 weight); - // SUNSHINE CLEANUP no upload_bake /*virtual*/ void setAnimationTarget(F32 target_value); - // SUNSHINE CLEANUP no upload_bake /*virtual*/ void animate(F32 delta); // LLViewerVisualParam Virtual functions @@ -193,7 +190,6 @@ public: // New functions LLColor4 getNetColor() const; protected: - // SUNSHINE CLEANUP no upload virtual void onGlobalColorChanged() {} private: LL_ALIGN_16(LLVector4a mAvgDistortionVec); -- cgit v1.2.3 From 7e7965af19960c613b1b4d22806682587a2cdd82 Mon Sep 17 00:00:00 2001 From: Nyx Linden Date: Fri, 20 Sep 2013 15:54:26 -0400 Subject: SH-3943 FIX beard morph masks applied inconsistently on login to server bake region Looks like we were caching bad morph masks that were generated on login. Adjusting algorithms to always replace the cache when we have invalidated the other channels of the baked texture. --- indra/llappearance/lltexlayer.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'indra/llappearance') diff --git a/indra/llappearance/lltexlayer.cpp b/indra/llappearance/lltexlayer.cpp index f951a982e5..59765b3833 100644 --- a/indra/llappearance/lltexlayer.cpp +++ b/indra/llappearance/lltexlayer.cpp @@ -1550,10 +1550,13 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC } U32 cache_index = alpha_mask_crc.getCRC(); - U8* alpha_data = get_if_there(mAlphaCache,cache_index,(U8*)NULL); - if (!alpha_data) + U8* alpha_data = NULL; + // We believe we need to generate morph masks, do not assume that the cached version is accurate. + // We can get bad morph masks during login, on minimize, and occasional gl errors. + // We should only be doing this when we believe something has changed with respect to the user's appearance. { - // clear out a slot if we have filled our cache + LL_DEBUGS("Avatar") << "gl alpha cache of morph mask not found, doing readback: " << getName() << llendl; + // clear out a slot if we have filled our cache S32 max_cache_entries = getTexLayerSet()->getAvatarAppearance()->isSelf() ? 4 : 1; while ((S32)mAlphaCache.size() >= max_cache_entries) { -- cgit v1.2.3 From 029642b2bc3a0bc0bec45af5df5d1e0b1b928b91 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 23 Sep 2013 16:48:49 -0400 Subject: SH-3455 WIP - post-SSA cleanup, including removal of mUseServerBakes and related methods --- indra/llappearance/llavatarappearance.h | 1 - indra/llappearance/llwearabledata.cpp | 7 ------- 2 files changed, 8 deletions(-) mode change 100644 => 100755 indra/llappearance/llwearabledata.cpp (limited to 'indra/llappearance') diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h index 3d99bb0cc7..1e898026c0 100755 --- a/indra/llappearance/llavatarappearance.h +++ b/indra/llappearance/llavatarappearance.h @@ -107,7 +107,6 @@ public: public: virtual bool isSelf() const { return false; } // True if this avatar is for this viewer's agent virtual BOOL isValid() const; - virtual BOOL isUsingServerBakes() const = 0; virtual BOOL isUsingLocalAppearance() const = 0; virtual BOOL isEditingAppearance() const = 0; diff --git a/indra/llappearance/llwearabledata.cpp b/indra/llappearance/llwearabledata.cpp old mode 100644 new mode 100755 index 68fdcca782..d70bbf286a --- a/indra/llappearance/llwearabledata.cpp +++ b/indra/llappearance/llwearabledata.cpp @@ -119,13 +119,6 @@ U32 LLWearableData::pushWearable(const LLWearableType::EType type, void LLWearableData::wearableUpdated(LLWearable *wearable, BOOL removed) { wearable->setUpdated(); - // FIXME DRANO avoid updating params via wearables when rendering server-baked appearance. -#if 0 - if (mAvatarAppearance->isUsingServerBakes() && !mAvatarAppearance->isUsingLocalAppearance()) - { - return; - } -#endif if (!removed) { pullCrossWearableValues(wearable->getType()); -- cgit v1.2.3 From ab0c38612f5d055b41fdf08efa9ab8f2c30ec6b8 Mon Sep 17 00:00:00 2001 From: Nyx Linden Date: Tue, 24 Sep 2013 20:22:19 +0000 Subject: SH-2728 SH-4010 FIX pants flare issues When wearing multiple layers of pants, the morph masks for all layers would be composited, resulting in the smallest intersection of all layers. Instead we should only be applying the top layer. This change will affect all consumers of the llappearance library. --- indra/llappearance/lltexlayer.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'indra/llappearance') diff --git a/indra/llappearance/lltexlayer.cpp b/indra/llappearance/lltexlayer.cpp index 59765b3833..510d8ce879 100644 --- a/indra/llappearance/lltexlayer.cpp +++ b/indra/llappearance/lltexlayer.cpp @@ -1776,13 +1776,11 @@ LLTexLayer* LLTexLayerTemplate::getLayer(U32 i) const /*virtual*/ void LLTexLayerTemplate::gatherAlphaMasks(U8 *data, S32 originX, S32 originY, S32 width, S32 height) { U32 num_wearables = updateWearableCache(); - for (U32 i = 0; i < num_wearables; i++) + U32 i = num_wearables - 1; // For rendering morph masks, we only want to use the top wearable + LLTexLayer *layer = getLayer(i); + if (layer) { - LLTexLayer *layer = getLayer(i); - if (layer) - { - layer->addAlphaMask(data, originX, originY, width, height); - } + layer->addAlphaMask(data, originX, originY, width, height); } } -- cgit v1.2.3 From b42c70173c032d3362fce438a49100fbe7608a4d Mon Sep 17 00:00:00 2001 From: Nyx Linden Date: Wed, 16 Oct 2013 15:28:10 -0400 Subject: SH-3455 BUILDFIX Updating linux appearance utility to use the new refactor Eliminated some unnecessary functions that the refactor took care of, linux build should be fixed. --- indra/llappearance/llavatarappearance.h | 7 ------- indra/llappearance/lltexglobalcolor.cpp | 5 ----- indra/llappearance/lltexglobalcolor.h | 2 -- indra/llappearance/lltexlayerparams.cpp | 17 ----------------- 4 files changed, 31 deletions(-) (limited to 'indra/llappearance') diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h index 1e898026c0..1c212873f4 100755 --- a/indra/llappearance/llavatarappearance.h +++ b/indra/llappearance/llavatarappearance.h @@ -219,12 +219,6 @@ public: ** ** *******************************************************************************/ - //-------------------------------------------------------------------- - // Composites - //-------------------------------------------------------------------- -public: - virtual void invalidateComposite(LLTexLayerSet* layerset) = 0; - /******************************************************************************** ** ** ** MESHES @@ -263,7 +257,6 @@ public: //-------------------------------------------------------------------- public: LLColor4 getGlobalColor(const std::string& color_name ) const; - virtual void onGlobalColorChanged(const LLTexGlobalColor* global_color) = 0; protected: LLTexGlobalColor* mTexSkinColor; LLTexGlobalColor* mTexHairColor; diff --git a/indra/llappearance/lltexglobalcolor.cpp b/indra/llappearance/lltexglobalcolor.cpp index 432e2e9f49..0e77b29cce 100755 --- a/indra/llappearance/lltexglobalcolor.cpp +++ b/indra/llappearance/lltexglobalcolor.cpp @@ -103,11 +103,6 @@ LLTexParamGlobalColor::LLTexParamGlobalColor(LLTexGlobalColor* tex_global_color) return new_param; } -void LLTexParamGlobalColor::onGlobalColorChanged() -{ - mAvatarAppearance->onGlobalColorChanged(mTexGlobalColor); -} - //----------------------------------------------------------------------------- // LLTexGlobalColorInfo //----------------------------------------------------------------------------- diff --git a/indra/llappearance/lltexglobalcolor.h b/indra/llappearance/lltexglobalcolor.h index 1b0c91b5ca..02ba14a959 100755 --- a/indra/llappearance/lltexglobalcolor.h +++ b/indra/llappearance/lltexglobalcolor.h @@ -74,8 +74,6 @@ class LLTexParamGlobalColor : public LLTexLayerParamColor public: LLTexParamGlobalColor(LLTexGlobalColor *tex_color); /*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const; -protected: - /*virtual*/ void onGlobalColorChanged(); private: LLTexGlobalColor* mTexGlobalColor; }; diff --git a/indra/llappearance/lltexlayerparams.cpp b/indra/llappearance/lltexlayerparams.cpp index 80aded450d..5e9d9a658b 100755 --- a/indra/llappearance/lltexlayerparams.cpp +++ b/indra/llappearance/lltexlayerparams.cpp @@ -178,7 +178,6 @@ void LLTexLayerParamAlpha::setWeight(F32 weight) if ((mAvatarAppearance->getSex() & getSex()) && (mAvatarAppearance->isSelf() && !mIsDummy)) // only trigger a baked texture update if we're changing a wearable's visual param. { - mAvatarAppearance->invalidateComposite(mTexLayer->getTexLayerSet()); mTexLayer->invalidateMorphMasks(); } } @@ -466,22 +465,6 @@ void LLTexLayerParamColor::setWeight(F32 weight) if (cur_u8 != new_u8) { mCurWeight = new_weight; - - if (info->mNumColors <= 0) - { - // This will happen when we set the default weight the first time. - return; - } - - if ((mAvatarAppearance->getSex() & getSex()) && (mAvatarAppearance->isSelf() && !mIsDummy)) // only trigger a baked texture update if we're changing a wearable's visual param. - { - onGlobalColorChanged(); - if (mTexLayer) - { - mAvatarAppearance->invalidateComposite(mTexLayer->getTexLayerSet()); - } - } - // llinfos << "param " << mName << " = " << new_weight << llendl; } } -- cgit v1.2.3 From dba221e0ac89b1505ddd3b896946286d5d1cf3d8 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 17 Oct 2013 16:12:37 -0400 Subject: SH-4160 WIP, build fix --- indra/llappearance/lltexlayerparams.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/llappearance') diff --git a/indra/llappearance/lltexlayerparams.cpp b/indra/llappearance/lltexlayerparams.cpp index 5e9d9a658b..36147f01e0 100755 --- a/indra/llappearance/lltexlayerparams.cpp +++ b/indra/llappearance/lltexlayerparams.cpp @@ -456,7 +456,6 @@ void LLTexLayerParamColor::setWeight(F32 weight) return; } - const LLTexLayerParamColorInfo *info = (LLTexLayerParamColorInfo *)getInfo(); F32 min_weight = getMinWeight(); F32 max_weight = getMaxWeight(); F32 new_weight = llclamp(weight, min_weight, max_weight); -- cgit v1.2.3 From b1838f02bc6c4a052c68fc6bbf3106e3a796a1a2 Mon Sep 17 00:00:00 2001 From: Nyx Linden Date: Fri, 25 Oct 2013 16:43:36 -0400 Subject: SH-4572 FIX changing clothing parameters do not take effect in edit appearance fix, new back-end utility and restoring the necessary functionality. --- indra/llappearance/llavatarappearance.h | 7 +++++++ indra/llappearance/lltexglobalcolor.cpp | 5 +++++ indra/llappearance/lltexglobalcolor.h | 2 ++ indra/llappearance/lltexlayerparams.cpp | 19 +++++++++++++++++++ 4 files changed, 33 insertions(+) (limited to 'indra/llappearance') diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h index 1c212873f4..1e898026c0 100755 --- a/indra/llappearance/llavatarappearance.h +++ b/indra/llappearance/llavatarappearance.h @@ -219,6 +219,12 @@ public: ** ** *******************************************************************************/ + //-------------------------------------------------------------------- + // Composites + //-------------------------------------------------------------------- +public: + virtual void invalidateComposite(LLTexLayerSet* layerset) = 0; + /******************************************************************************** ** ** ** MESHES @@ -257,6 +263,7 @@ public: //-------------------------------------------------------------------- public: LLColor4 getGlobalColor(const std::string& color_name ) const; + virtual void onGlobalColorChanged(const LLTexGlobalColor* global_color) = 0; protected: LLTexGlobalColor* mTexSkinColor; LLTexGlobalColor* mTexHairColor; diff --git a/indra/llappearance/lltexglobalcolor.cpp b/indra/llappearance/lltexglobalcolor.cpp index 0e77b29cce..432e2e9f49 100755 --- a/indra/llappearance/lltexglobalcolor.cpp +++ b/indra/llappearance/lltexglobalcolor.cpp @@ -103,6 +103,11 @@ LLTexParamGlobalColor::LLTexParamGlobalColor(LLTexGlobalColor* tex_global_color) return new_param; } +void LLTexParamGlobalColor::onGlobalColorChanged() +{ + mAvatarAppearance->onGlobalColorChanged(mTexGlobalColor); +} + //----------------------------------------------------------------------------- // LLTexGlobalColorInfo //----------------------------------------------------------------------------- diff --git a/indra/llappearance/lltexglobalcolor.h b/indra/llappearance/lltexglobalcolor.h index 02ba14a959..1b0c91b5ca 100755 --- a/indra/llappearance/lltexglobalcolor.h +++ b/indra/llappearance/lltexglobalcolor.h @@ -74,6 +74,8 @@ class LLTexParamGlobalColor : public LLTexLayerParamColor public: LLTexParamGlobalColor(LLTexGlobalColor *tex_color); /*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const; +protected: + /*virtual*/ void onGlobalColorChanged(); private: LLTexGlobalColor* mTexGlobalColor; }; diff --git a/indra/llappearance/lltexlayerparams.cpp b/indra/llappearance/lltexlayerparams.cpp index 36147f01e0..9608e2d391 100755 --- a/indra/llappearance/lltexlayerparams.cpp +++ b/indra/llappearance/lltexlayerparams.cpp @@ -178,6 +178,7 @@ void LLTexLayerParamAlpha::setWeight(F32 weight) if ((mAvatarAppearance->getSex() & getSex()) && (mAvatarAppearance->isSelf() && !mIsDummy)) // only trigger a baked texture update if we're changing a wearable's visual param. { + mAvatarAppearance->invalidateComposite(mTexLayer->getTexLayerSet()); mTexLayer->invalidateMorphMasks(); } } @@ -464,6 +465,24 @@ void LLTexLayerParamColor::setWeight(F32 weight) if (cur_u8 != new_u8) { mCurWeight = new_weight; + + const LLTexLayerParamColorInfo *info = (LLTexLayerParamColorInfo *)getInfo(); + + if (info->mNumColors <= 0) + { + // This will happen when we set the default weight the first time. + return; + } + + if ((mAvatarAppearance->getSex() & getSex()) && (mAvatarAppearance->isSelf() && !mIsDummy)) // only trigger a baked texture update if we're changing a wearable's visual param. + { + onGlobalColorChanged(); + if (mTexLayer) + { + mAvatarAppearance->invalidateComposite(mTexLayer->getTexLayerSet()); + } + } + // llinfos << "param " << mName << " = " << new_weight << llendl; } } -- cgit v1.2.3 From 75538968dbc224a956115762a67e5da20c1d369f Mon Sep 17 00:00:00 2001 From: Stinson Linden Date: Wed, 14 May 2014 19:49:13 +0100 Subject: MAINT-4009: Patching the final leak of LLViewerFetchedTexture objects occurring because the LLWearable class was not properly destroying itself. --- indra/llappearance/llwearable.cpp | 28 ++++++++++++++++++---------- indra/llappearance/llwearable.h | 1 + 2 files changed, 19 insertions(+), 10 deletions(-) (limited to 'indra/llappearance') diff --git a/indra/llappearance/llwearable.cpp b/indra/llappearance/llwearable.cpp index 389505fa34..6749a85f3c 100644 --- a/indra/llappearance/llwearable.cpp +++ b/indra/llappearance/llwearable.cpp @@ -43,9 +43,24 @@ S32 LLWearable::sCurrentDefinitionVersion = 1; // Private local functions static std::string terse_F32_to_string(F32 f); +LLWearable::LLWearable() + : mDefinitionVersion(-1), + mName(), + mDescription(), + mPermissions(), + mSaleInfo(), + mType(LLWearableType::WT_NONE), + mSavedVisualParamMap(), + mVisualParamIndexMap(), + mTEMap(), + mSavedTEMap() +{ +} + // virtual LLWearable::~LLWearable() { + destroyTextures(); } const std::string& LLWearable::getTypeLabel() const @@ -620,17 +635,10 @@ void LLWearable::syncImages(te_map_t &src, te_map_t &dst) void LLWearable::destroyTextures() { - for( te_map_t::iterator iter = mTEMap.begin(); iter != mTEMap.end(); ++iter ) - { - LLLocalTextureObject *lto = iter->second; - delete lto; - } + std::for_each(mTEMap.begin(), mTEMap.end(), DeletePairedPointer()); mTEMap.clear(); - for( te_map_t::iterator iter = mSavedTEMap.begin(); iter != mSavedTEMap.end(); ++iter ) - { - LLLocalTextureObject *lto = iter->second; - delete lto; - } + + std::for_each(mSavedTEMap.begin(), mSavedTEMap.end(), DeletePairedPointer()); mSavedTEMap.clear(); } diff --git a/indra/llappearance/llwearable.h b/indra/llappearance/llwearable.h index 132c153bcd..96809aab58 100644 --- a/indra/llappearance/llwearable.h +++ b/indra/llappearance/llwearable.h @@ -46,6 +46,7 @@ class LLWearable // Constructors and destructors //-------------------------------------------------------------------- public: + LLWearable(); virtual ~LLWearable(); //-------------------------------------------------------------------- -- cgit v1.2.3 From 487ca1bad37883be0325b564ab557a8f77575388 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 14 May 2014 17:50:59 -0400 Subject: v-r -> s-e merge WIP --- indra/llappearance/lltexlayer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llappearance') diff --git a/indra/llappearance/lltexlayer.cpp b/indra/llappearance/lltexlayer.cpp index b78d9da958..2cf86bb4fe 100644 --- a/indra/llappearance/lltexlayer.cpp +++ b/indra/llappearance/lltexlayer.cpp @@ -1565,7 +1565,7 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC // We can get bad morph masks during login, on minimize, and occasional gl errors. // We should only be doing this when we believe something has changed with respect to the user's appearance. { - LL_DEBUGS("Avatar") << "gl alpha cache of morph mask not found, doing readback: " << getName() << llendl; + LL_DEBUGS("Avatar") << "gl alpha cache of morph mask not found, doing readback: " << getName() << LL_ENDL; // clear out a slot if we have filled our cache S32 max_cache_entries = getTexLayerSet()->getAvatarAppearance()->isSelf() ? 4 : 1; while ((S32)mAlphaCache.size() >= max_cache_entries) -- cgit v1.2.3 From 76023f172c2a8eeb5c8d6b55119ef3e8faf8cc6f Mon Sep 17 00:00:00 2001 From: Stinson Linden Date: Wed, 14 May 2014 22:55:19 +0100 Subject: MAINT-4009: Patching a leak of LLVisualParam derived objects that were being leaked because the LLWearable class was not destroying itself properly. --- indra/llappearance/llwearable.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'indra/llappearance') diff --git a/indra/llappearance/llwearable.cpp b/indra/llappearance/llwearable.cpp index 6749a85f3c..d064b2982c 100644 --- a/indra/llappearance/llwearable.cpp +++ b/indra/llappearance/llwearable.cpp @@ -60,6 +60,14 @@ LLWearable::LLWearable() // virtual LLWearable::~LLWearable() { + for (visual_param_index_map_t::iterator vpIter = mVisualParamIndexMap.begin(); vpIter != mVisualParamIndexMap.end(); ++vpIter) + { + LLVisualParam* vp = vpIter->second; + vp->clearNextParam(); + delete vp; + vpIter->second = NULL; + } + destroyTextures(); } -- cgit v1.2.3 From 0160c514c5e0bc3e575b33ef27924a9c8c7c30cf Mon Sep 17 00:00:00 2001 From: Stinson Linden Date: Fri, 23 May 2014 21:56:44 +0100 Subject: MAINT-4077: Refactoring to add copy constructors to the LLVisualParam class and all of its derived descendants in order to clarify ownership of memory pointers. --- indra/llappearance/lldriverparam.cpp | 30 ++++++++----- indra/llappearance/lldriverparam.h | 1 + indra/llappearance/llpolymorph.cpp | 59 ++++++++++++++++++------- indra/llappearance/llpolymorph.h | 3 ++ indra/llappearance/llpolyskeletaldistortion.cpp | 24 +++++++--- indra/llappearance/llpolyskeletaldistortion.h | 2 + indra/llappearance/lltexglobalcolor.cpp | 24 +++++++--- indra/llappearance/lltexglobalcolor.h | 2 + indra/llappearance/lltexlayerparams.cpp | 58 +++++++++++++++++------- indra/llappearance/lltexlayerparams.h | 6 +++ indra/llappearance/llviewervisualparam.cpp | 16 +++++++ indra/llappearance/llviewervisualparam.h | 4 +- 12 files changed, 175 insertions(+), 54 deletions(-) (limited to 'indra/llappearance') diff --git a/indra/llappearance/lldriverparam.cpp b/indra/llappearance/lldriverparam.cpp index c66a428374..d2203ecc81 100644 --- a/indra/llappearance/lldriverparam.cpp +++ b/indra/llappearance/lldriverparam.cpp @@ -152,19 +152,31 @@ void LLDriverParamInfo::toStream(std::ostream &out) // LLDriverParam //----------------------------------------------------------------------------- -LLDriverParam::LLDriverParam(LLAvatarAppearance *appearance, LLWearable* wearable /* = NULL */) : +LLDriverParam::LLDriverParam(LLAvatarAppearance *appearance, LLWearable* wearable /* = NULL */) + : LLViewerVisualParam(), + mDefaultVec(), + mDriven(), mCurrentDistortionParam( NULL ), mAvatarAppearance(appearance), mWearablep(wearable) { llassert(mAvatarAppearance); - if (mWearablep) - { - llassert(mAvatarAppearance->isSelf()); - } + llassert((mWearablep == NULL) || mAvatarAppearance->isSelf()); mDefaultVec.clear(); } +LLDriverParam::LLDriverParam(const LLDriverParam& pOther) + : LLViewerVisualParam(pOther), + mDefaultVec(pOther.mDefaultVec), + mDriven(pOther.mDriven), + mCurrentDistortionParam(pOther.mCurrentDistortionParam), + mAvatarAppearance(pOther.mAvatarAppearance), + mWearablep(pOther.mWearablep) +{ + llassert(mAvatarAppearance); + llassert((mWearablep == NULL) || mAvatarAppearance->isSelf()); +} + LLDriverParam::~LLDriverParam() { } @@ -186,13 +198,7 @@ BOOL LLDriverParam::setInfo(LLDriverParamInfo *info) /*virtual*/ LLViewerVisualParam* LLDriverParam::cloneParam(LLWearable* wearable) const { llassert(wearable); - LLDriverParam *new_param = new LLDriverParam(mAvatarAppearance, wearable); - // FIXME DRANO this clobbers mWearablep, which means any code - // currently using mWearablep is wrong, or at least untested. - *new_param = *this; - //new_param->mWearablep = wearable; -// new_param->mDriven.clear(); // clear driven list to avoid overwriting avatar driven params from wearables. - return new_param; + return new LLDriverParam(*this); } void LLDriverParam::setWeight(F32 weight, BOOL upload_bake) diff --git a/indra/llappearance/lldriverparam.h b/indra/llappearance/lldriverparam.h index 2420db76e7..cd151bcf30 100644 --- a/indra/llappearance/lldriverparam.h +++ b/indra/llappearance/lldriverparam.h @@ -129,6 +129,7 @@ public: const LLViewerVisualParam* getDrivenParam(S32 index) const; protected: + LLDriverParam(const LLDriverParam& pOther); F32 getDrivenWeight(const LLDrivenEntry* driven, F32 input_weight); void setDrivenWeight(LLDrivenEntry *driven, F32 driven_weight, bool upload_bake); diff --git a/indra/llappearance/llpolymorph.cpp b/indra/llappearance/llpolymorph.cpp index ce8a0b0b76..d69b59ab1b 100644 --- a/indra/llappearance/llpolymorph.cpp +++ b/indra/llappearance/llpolymorph.cpp @@ -315,10 +315,27 @@ BOOL LLPolyMorphTargetInfo::parseXml(LLXmlTreeNode* node) // LLPolyMorphTarget() //----------------------------------------------------------------------------- LLPolyMorphTarget::LLPolyMorphTarget(LLPolyMesh *poly_mesh) - : mMorphData(NULL), mMesh(poly_mesh), - mVertMask(NULL), - mLastSex(SEX_FEMALE), - mNumMorphMasksPending(0) + : LLViewerVisualParam(), + mMorphData(NULL), + mMesh(poly_mesh), + mVertMask(NULL), + mLastSex(SEX_FEMALE), + mNumMorphMasksPending(0), + mVolumeMorphs() +{ +} + +//----------------------------------------------------------------------------- +// LLPolyMorphTarget() +//----------------------------------------------------------------------------- +LLPolyMorphTarget::LLPolyMorphTarget(const LLPolyMorphTarget& pOther) + : LLViewerVisualParam(pOther), + mMorphData(pOther.mMorphData), + mMesh(pOther.mMesh), + mVertMask(pOther.mVertMask == NULL ? NULL : new LLPolyVertexMask(*pOther.mVertMask)), + mLastSex(pOther.mLastSex), + mNumMorphMasksPending(pOther.mNumMorphMasksPending), + mVolumeMorphs(pOther.mVolumeMorphs) { } @@ -327,10 +344,8 @@ LLPolyMorphTarget::LLPolyMorphTarget(LLPolyMesh *poly_mesh) //----------------------------------------------------------------------------- LLPolyMorphTarget::~LLPolyMorphTarget() { - if (mVertMask) - { - delete mVertMask; - } + delete mVertMask; + mVertMask = NULL; } //----------------------------------------------------------------------------- @@ -385,9 +400,7 @@ BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info) /*virtual*/ LLViewerVisualParam* LLPolyMorphTarget::cloneParam(LLWearable* wearable) const { - LLPolyMorphTarget *new_param = new LLPolyMorphTarget(mMesh); - *new_param = *this; - return new_param; + return new LLPolyMorphTarget(*this); } #if 0 // obsolete @@ -722,10 +735,25 @@ void LLPolyMorphTarget::applyMask(U8 *maskTextureData, S32 width, S32 height, S3 // LLPolyVertexMask() //----------------------------------------------------------------------------- LLPolyVertexMask::LLPolyVertexMask(LLPolyMorphData* morph_data) + : mWeights(new F32[morph_data->mNumIndices]), + mMorphData(morph_data), + mWeightsGenerated(FALSE) +{ + llassert(mMorphData != NULL); + llassert(mMorphData->mNumIndices > 0); +} + +//----------------------------------------------------------------------------- +// LLPolyVertexMask() +//----------------------------------------------------------------------------- +LLPolyVertexMask::LLPolyVertexMask(const LLPolyVertexMask& pOther) + : mWeights(new F32[pOther.mMorphData->mNumIndices]), + mMorphData(pOther.mMorphData), + mWeightsGenerated(pOther.mWeightsGenerated) { - mWeights = new F32[morph_data->mNumIndices]; - mMorphData = morph_data; - mWeightsGenerated = FALSE; + llassert(mMorphData != NULL); + llassert(mMorphData->mNumIndices > 0); + memcpy(mWeights, pOther.mWeights, sizeof(F32) * mMorphData->mNumIndices); } //----------------------------------------------------------------------------- @@ -733,7 +761,8 @@ LLPolyVertexMask::LLPolyVertexMask(LLPolyMorphData* morph_data) //----------------------------------------------------------------------------- LLPolyVertexMask::~LLPolyVertexMask() { - delete[] mWeights; + delete [] mWeights; + mWeights = NULL; } //----------------------------------------------------------------------------- diff --git a/indra/llappearance/llpolymorph.h b/indra/llappearance/llpolymorph.h index ee380ae7c3..7e712f9e94 100644 --- a/indra/llappearance/llpolymorph.h +++ b/indra/llappearance/llpolymorph.h @@ -91,6 +91,7 @@ class LLPolyVertexMask { public: LLPolyVertexMask(LLPolyMorphData* morph_data); + LLPolyVertexMask(const LLPolyVertexMask& pOther); ~LLPolyVertexMask(); void generateMask(U8 *maskData, S32 width, S32 height, S32 num_components, BOOL invert, LLVector4a *clothing_weights); @@ -182,6 +183,8 @@ public: void addPendingMorphMask() { mNumMorphMasksPending++; } protected: + LLPolyMorphTarget(const LLPolyMorphTarget& pOther); + LLPolyMorphData* mMorphData; LLPolyMesh* mMesh; LLPolyVertexMask * mVertMask; diff --git a/indra/llappearance/llpolyskeletaldistortion.cpp b/indra/llappearance/llpolyskeletaldistortion.cpp index a72b446ace..b9c1ee340c 100644 --- a/indra/llappearance/llpolyskeletaldistortion.cpp +++ b/indra/llappearance/llpolyskeletaldistortion.cpp @@ -104,9 +104,25 @@ BOOL LLPolySkeletalDistortionInfo::parseXml(LLXmlTreeNode* node) // LLPolySkeletalDistortion() //----------------------------------------------------------------------------- LLPolySkeletalDistortion::LLPolySkeletalDistortion(LLAvatarAppearance *avatarp) + : LLViewerVisualParam(), + mDefaultVec(), + mJointScales(), + mJointOffsets(), + mAvatar(avatarp) +{ + mDefaultVec.splat(0.001f); +} + +//----------------------------------------------------------------------------- +// LLPolySkeletalDistortion() +//----------------------------------------------------------------------------- +LLPolySkeletalDistortion::LLPolySkeletalDistortion(const LLPolySkeletalDistortion &pOther) + : LLViewerVisualParam(pOther), + mDefaultVec(pOther.mDefaultVec), + mJointScales(pOther.mJointScales), + mJointOffsets(pOther.mJointOffsets), + mAvatar(pOther.mAvatar) { - mAvatar = avatarp; - mDefaultVec.splat(0.001f); } //----------------------------------------------------------------------------- @@ -171,9 +187,7 @@ BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info) /*virtual*/ LLViewerVisualParam* LLPolySkeletalDistortion::cloneParam(LLWearable* wearable) const { - LLPolySkeletalDistortion *new_param = new LLPolySkeletalDistortion(mAvatar); - *new_param = *this; - return new_param; + return new LLPolySkeletalDistortion(*this); } //----------------------------------------------------------------------------- diff --git a/indra/llappearance/llpolyskeletaldistortion.h b/indra/llappearance/llpolyskeletaldistortion.h index 24c9e9ae48..ea2adb8a87 100644 --- a/indra/llappearance/llpolyskeletaldistortion.h +++ b/indra/llappearance/llpolyskeletaldistortion.h @@ -118,6 +118,8 @@ public: /*virtual*/ const LLVector4a* getNextDistortion(U32 *index, LLPolyMesh **poly_mesh){index = 0; poly_mesh = NULL; return NULL;}; protected: + LLPolySkeletalDistortion(const LLPolySkeletalDistortion& pOther); + LL_ALIGN_16(LLVector4a mDefaultVec); typedef std::map joint_vec_map_t; joint_vec_map_t mJointScales; diff --git a/indra/llappearance/lltexglobalcolor.cpp b/indra/llappearance/lltexglobalcolor.cpp index 186c537659..a8283ea2e6 100644 --- a/indra/llappearance/lltexglobalcolor.cpp +++ b/indra/llappearance/lltexglobalcolor.cpp @@ -90,17 +90,31 @@ const std::string& LLTexGlobalColor::getName() const //----------------------------------------------------------------------------- // LLTexParamGlobalColor //----------------------------------------------------------------------------- -LLTexParamGlobalColor::LLTexParamGlobalColor(LLTexGlobalColor* tex_global_color) : - LLTexLayerParamColor(tex_global_color->getAvatarAppearance()), +LLTexParamGlobalColor::LLTexParamGlobalColor(LLTexGlobalColor* tex_global_color) + : LLTexLayerParamColor(tex_global_color->getAvatarAppearance()), mTexGlobalColor(tex_global_color) { } +//----------------------------------------------------------------------------- +// LLTexParamGlobalColor +//----------------------------------------------------------------------------- +LLTexParamGlobalColor::LLTexParamGlobalColor(const LLTexParamGlobalColor& pOther) + : LLTexLayerParamColor(pOther), + mTexGlobalColor(pOther.mTexGlobalColor) +{ +} + +//----------------------------------------------------------------------------- +// ~LLTexParamGlobalColor +//----------------------------------------------------------------------------- +LLTexParamGlobalColor::~LLTexParamGlobalColor() +{ +} + /*virtual*/ LLViewerVisualParam* LLTexParamGlobalColor::cloneParam(LLWearable* wearable) const { - LLTexParamGlobalColor *new_param = new LLTexParamGlobalColor(mTexGlobalColor); - *new_param = *this; - return new_param; + return new LLTexParamGlobalColor(*this); } void LLTexParamGlobalColor::onGlobalColorChanged(bool upload_bake) diff --git a/indra/llappearance/lltexglobalcolor.h b/indra/llappearance/lltexglobalcolor.h index 2867479876..4b7d23d20f 100644 --- a/indra/llappearance/lltexglobalcolor.h +++ b/indra/llappearance/lltexglobalcolor.h @@ -73,8 +73,10 @@ class LLTexParamGlobalColor : public LLTexLayerParamColor { public: LLTexParamGlobalColor(LLTexGlobalColor *tex_color); + virtual ~LLTexParamGlobalColor(); /*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const; protected: + LLTexParamGlobalColor(const LLTexParamGlobalColor& pOther); /*virtual*/ void onGlobalColorChanged(bool upload_bake); private: LLTexGlobalColor* mTexGlobalColor; diff --git a/indra/llappearance/lltexlayerparams.cpp b/indra/llappearance/lltexlayerparams.cpp index f1f7d07fa9..e04851aa71 100644 --- a/indra/llappearance/lltexlayerparams.cpp +++ b/indra/llappearance/lltexlayerparams.cpp @@ -40,7 +40,8 @@ //----------------------------------------------------------------------------- // LLTexLayerParam //----------------------------------------------------------------------------- -LLTexLayerParam::LLTexLayerParam(LLTexLayerInterface *layer) : +LLTexLayerParam::LLTexLayerParam(LLTexLayerInterface *layer) + : LLViewerVisualParam(), mTexLayer(layer), mAvatarAppearance(NULL) { @@ -54,12 +55,19 @@ LLTexLayerParam::LLTexLayerParam(LLTexLayerInterface *layer) : } } -LLTexLayerParam::LLTexLayerParam(LLAvatarAppearance *appearance) : +LLTexLayerParam::LLTexLayerParam(LLAvatarAppearance *appearance) + : LLViewerVisualParam(), mTexLayer(NULL), mAvatarAppearance(appearance) { } +LLTexLayerParam::LLTexLayerParam(const LLTexLayerParam& pOther) + : LLViewerVisualParam(pOther), + mTexLayer(pOther.mTexLayer), + mAvatarAppearance(pOther.mAvatarAppearance) +{ +} BOOL LLTexLayerParam::setInfo(LLViewerVisualParamInfo *info, BOOL add_to_appearance) { @@ -112,9 +120,11 @@ void LLTexLayerParamAlpha::getCacheByteCount(S32* gl_bytes) } } -LLTexLayerParamAlpha::LLTexLayerParamAlpha(LLTexLayerInterface* layer) : - LLTexLayerParam(layer), +LLTexLayerParamAlpha::LLTexLayerParamAlpha(LLTexLayerInterface* layer) + : LLTexLayerParam(layer), mCachedProcessedTexture(NULL), + mStaticImageTGA(), + mStaticImageRaw(), mNeedsCreateTexture(FALSE), mStaticImageInvalid(FALSE), mAvgDistortionVec(1.f, 1.f, 1.f), @@ -123,9 +133,11 @@ LLTexLayerParamAlpha::LLTexLayerParamAlpha(LLTexLayerInterface* layer) : sInstances.push_front(this); } -LLTexLayerParamAlpha::LLTexLayerParamAlpha(LLAvatarAppearance* appearance) : - LLTexLayerParam(appearance), +LLTexLayerParamAlpha::LLTexLayerParamAlpha(LLAvatarAppearance* appearance) + : LLTexLayerParam(appearance), mCachedProcessedTexture(NULL), + mStaticImageTGA(), + mStaticImageRaw(), mNeedsCreateTexture(FALSE), mStaticImageInvalid(FALSE), mAvgDistortionVec(1.f, 1.f, 1.f), @@ -134,6 +146,18 @@ LLTexLayerParamAlpha::LLTexLayerParamAlpha(LLAvatarAppearance* appearance) : sInstances.push_front(this); } +LLTexLayerParamAlpha::LLTexLayerParamAlpha(const LLTexLayerParamAlpha& pOther) + : LLTexLayerParam(pOther), + mCachedProcessedTexture(pOther.mCachedProcessedTexture), + mStaticImageTGA(pOther.mStaticImageTGA), + mStaticImageRaw(pOther.mStaticImageRaw), + mNeedsCreateTexture(pOther.mNeedsCreateTexture), + mStaticImageInvalid(pOther.mStaticImageInvalid), + mAvgDistortionVec(pOther.mAvgDistortionVec), + mCachedEffectiveWeight(pOther.mCachedEffectiveWeight) +{ + sInstances.push_front(this); +} LLTexLayerParamAlpha::~LLTexLayerParamAlpha() { @@ -143,9 +167,7 @@ LLTexLayerParamAlpha::~LLTexLayerParamAlpha() /*virtual*/ LLViewerVisualParam* LLTexLayerParamAlpha::cloneParam(LLWearable* wearable) const { - LLTexLayerParamAlpha *new_param = new LLTexLayerParamAlpha(mTexLayer); - *new_param = *this; - return new_param; + return new LLTexLayerParamAlpha(*this); } void LLTexLayerParamAlpha::deleteCaches() @@ -399,27 +421,31 @@ BOOL LLTexLayerParamAlphaInfo::parseXml(LLXmlTreeNode* node) -LLTexLayerParamColor::LLTexLayerParamColor(LLTexLayerInterface* layer) : - LLTexLayerParam(layer), +LLTexLayerParamColor::LLTexLayerParamColor(LLTexLayerInterface* layer) + : LLTexLayerParam(layer), mAvgDistortionVec(1.f, 1.f, 1.f) { } -LLTexLayerParamColor::LLTexLayerParamColor(LLAvatarAppearance *appearance) : - LLTexLayerParam(appearance), +LLTexLayerParamColor::LLTexLayerParamColor(LLAvatarAppearance *appearance) + : LLTexLayerParam(appearance), mAvgDistortionVec(1.f, 1.f, 1.f) { } +LLTexLayerParamColor::LLTexLayerParamColor(const LLTexLayerParamColor& pOther) + : LLTexLayerParam(pOther), + mAvgDistortionVec(pOther.mAvgDistortionVec) +{ +} + LLTexLayerParamColor::~LLTexLayerParamColor() { } /*virtual*/ LLViewerVisualParam* LLTexLayerParamColor::cloneParam(LLWearable* wearable) const { - LLTexLayerParamColor *new_param = new LLTexLayerParamColor(mTexLayer); - *new_param = *this; - return new_param; + return new LLTexLayerParamColor(*this); } LLColor4 LLTexLayerParamColor::getNetColor() const diff --git a/indra/llappearance/lltexlayerparams.h b/indra/llappearance/lltexlayerparams.h index b38d28d3eb..68c67784e3 100644 --- a/indra/llappearance/lltexlayerparams.h +++ b/indra/llappearance/lltexlayerparams.h @@ -52,6 +52,8 @@ public: /*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const = 0; protected: + LLTexLayerParam(const LLTexLayerParam& pOther); + LLTexLayerInterface* mTexLayer; LLAvatarAppearance* mAvatarAppearance; }; @@ -102,6 +104,8 @@ public: BOOL getMultiplyBlend() const; private: + LLTexLayerParamAlpha(const LLTexLayerParamAlpha& pOther); + LLPointer mCachedProcessedTexture; LLPointer mStaticImageTGA; LLPointer mStaticImageRaw; @@ -190,6 +194,8 @@ public: // New functions LLColor4 getNetColor() const; protected: + LLTexLayerParamColor(const LLTexLayerParamColor& pOther); + virtual void onGlobalColorChanged(bool upload_bake) {} private: LL_ALIGN_16(LLVector4a mAvgDistortionVec); diff --git a/indra/llappearance/llviewervisualparam.cpp b/indra/llappearance/llviewervisualparam.cpp index cc81bcf118..f58f7c24bc 100644 --- a/indra/llappearance/llviewervisualparam.cpp +++ b/indra/llappearance/llviewervisualparam.cpp @@ -123,6 +123,22 @@ BOOL LLViewerVisualParamInfo::parseXml(LLXmlTreeNode *node) // LLViewerVisualParam() //----------------------------------------------------------------------------- LLViewerVisualParam::LLViewerVisualParam() + : LLVisualParam() +{ +} + +//----------------------------------------------------------------------------- +// LLViewerVisualParam() +//----------------------------------------------------------------------------- +LLViewerVisualParam::LLViewerVisualParam(const LLViewerVisualParam& pOther) + : LLVisualParam(pOther) +{ +} + +//----------------------------------------------------------------------------- +// ~LLViewerVisualParam() +//----------------------------------------------------------------------------- +LLViewerVisualParam::~LLViewerVisualParam() { } diff --git a/indra/llappearance/llviewervisualparam.h b/indra/llappearance/llviewervisualparam.h index 2826e6c316..1a710c0ca6 100644 --- a/indra/llappearance/llviewervisualparam.h +++ b/indra/llappearance/llviewervisualparam.h @@ -70,7 +70,7 @@ class LLViewerVisualParam : public LLVisualParam { public: LLViewerVisualParam(); - /*virtual*/ ~LLViewerVisualParam(){}; + virtual ~LLViewerVisualParam(); // Special: These functions are overridden by child classes LLViewerVisualParamInfo *getInfo() const { return (LLViewerVisualParamInfo*)mInfo; }; @@ -105,6 +105,8 @@ public: BOOL getCrossWearable() const { return getInfo()->mCrossWearable; } +protected: + LLViewerVisualParam(const LLViewerVisualParam& pOther); } LL_ALIGN_POSTFIX(16); #endif // LL_LLViewerVisualParam_H -- cgit v1.2.3