From 62d14e1a33edf2df88761969f81e70ecd0081dab Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Fri, 12 Feb 2016 15:40:46 -0500
Subject: [PATCH] SL-333 WIP - added back some unused constructors to make the
 appearance utility happier

---
 indra/llappearance/llavatarappearance.h |  1 +
 indra/llappearance/llavatarjoint.cpp    |  6 ++++++
 indra/llappearance/llavatarjoint.h      |  1 +
 indra/llcharacter/lljoint.cpp           |  7 +++++++
 indra/llcharacter/lljoint.h             | 15 +++++++++++++++
 indra/newview/llviewerjoint.cpp         |  4 ++++
 indra/newview/llviewerjoint.h           |  2 ++
 indra/newview/llvoavatar.cpp            |  6 ++++++
 indra/newview/llvoavatar.h              |  1 +
 9 files changed, 43 insertions(+)

diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h
index 39271aeadb8..3865da70980 100755
--- a/indra/llappearance/llavatarappearance.h
+++ b/indra/llappearance/llavatarappearance.h
@@ -125,6 +125,7 @@ class LLAvatarAppearance : public LLCharacter
 
 protected:
 	virtual LLAvatarJoint*	createAvatarJoint() = 0;
+    virtual LLAvatarJoint*  createAvatarJoint(S32 joint_num) = 0;
 	virtual LLAvatarJointMesh*	createAvatarJointMesh() = 0;
     void makeJointAliases(LLAvatarBoneInfo *bone_info);
 
diff --git a/indra/llappearance/llavatarjoint.cpp b/indra/llappearance/llavatarjoint.cpp
index 8133d4405a3..29642be099a 100644
--- a/indra/llappearance/llavatarjoint.cpp
+++ b/indra/llappearance/llavatarjoint.cpp
@@ -52,6 +52,12 @@ LLAvatarJoint::LLAvatarJoint() :
 	init();
 }
 
+LLAvatarJoint::LLAvatarJoint(S32 joint_num) :
+    LLJoint(joint_num)
+{
+    init();
+}
+    
 LLAvatarJoint::LLAvatarJoint(const std::string &name, LLJoint *parent) :
 	LLJoint(name, parent)
 {
diff --git a/indra/llappearance/llavatarjoint.h b/indra/llappearance/llavatarjoint.h
index 45100078564..fec91503c78 100644
--- a/indra/llappearance/llavatarjoint.h
+++ b/indra/llappearance/llavatarjoint.h
@@ -46,6 +46,7 @@ class LLAvatarJoint :
 {
 public:
 	LLAvatarJoint();
+	LLAvatarJoint(S32 joint_num);
 	// *TODO: Only used for LLVOAvatarSelf::mScreenp.  *DOES NOT INITIALIZE mResetAfterRestoreOldXform*
 	LLAvatarJoint(const std::string &name, LLJoint *parent = NULL);
 	virtual ~LLAvatarJoint();
diff --git a/indra/llcharacter/lljoint.cpp b/indra/llcharacter/lljoint.cpp
index af50a3f5743..264ec44c02f 100755
--- a/indra/llcharacter/lljoint.cpp
+++ b/indra/llcharacter/lljoint.cpp
@@ -121,6 +121,13 @@ LLJoint::LLJoint() :
 	touch();
 }
 
+LLJoint::LLJoint(S32 joint_num) :
+	mJointNum(joint_num)
+{
+	init();
+	touch();
+}
+
 //-----------------------------------------------------------------------------
 // LLJoint()
 // Class Constructor
diff --git a/indra/llcharacter/lljoint.h b/indra/llcharacter/lljoint.h
index f5007a3f06c..e666f177e71 100755
--- a/indra/llcharacter/lljoint.h
+++ b/indra/llcharacter/lljoint.h
@@ -143,6 +143,21 @@ class LLJoint
 
 public:
 	LLJoint();
+
+    // Note: these joint_num constructors are a bad idea because there
+    // are only a couple of places in the code where it is useful to
+    // have a joint num for a joint (for joints that are used in
+    // animations), and including them as part of the constructor then
+    // forces us to maintain an alternate path through the entire
+    // large-ish class hierarchy of joint types. The only reason they
+    // are still here now is to avoid breaking the baking service
+    // (appearanceutility) builds; these constructors are not used in
+    // the viewer.  Once the appearance utility is updated to remove
+    // these joint num references, which it shouldn't ever need, from
+    // its own classes, we can also remove all the joint_num
+    // constructors from LLJoint, LLViewerJoint, LLAvatarJoint, and
+    // createAvatarJoint.
+    LLJoint(S32 joint_num);
     
 	// *TODO: Only used for LLVOAvatarSelf::mScreenp.  *DOES NOT INITIALIZE mResetAfterRestoreOldXform*
 	LLJoint( const std::string &name, LLJoint *parent=NULL );
diff --git a/indra/newview/llviewerjoint.cpp b/indra/newview/llviewerjoint.cpp
index 7bd93942b3c..b7bd131246a 100755
--- a/indra/newview/llviewerjoint.cpp
+++ b/indra/newview/llviewerjoint.cpp
@@ -48,6 +48,10 @@ LLViewerJoint::LLViewerJoint() :
 	LLAvatarJoint()
 { }
 
+LLViewerJoint::LLViewerJoint(S32 joint_num) :
+	LLAvatarJoint(joint_num)
+{ }
+
 LLViewerJoint::LLViewerJoint(const std::string &name, LLJoint *parent) :
 	LLAvatarJoint(name, parent)
 { }
diff --git a/indra/newview/llviewerjoint.h b/indra/newview/llviewerjoint.h
index 75efafd1380..abe11bbf5c4 100755
--- a/indra/newview/llviewerjoint.h
+++ b/indra/newview/llviewerjoint.h
@@ -44,6 +44,8 @@ class LLViewerJoint :
 {
 public:
 	LLViewerJoint();
+    LLViewerJoint(S32 joint_num);
+
 	// *TODO: Only used for LLVOAvatarSelf::mScreenp.  *DOES NOT INITIALIZE mResetAfterRestoreOldXform*
 	LLViewerJoint(const std::string &name, LLJoint *parent = NULL);
 	virtual ~LLViewerJoint();
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 15e1f88d765..762ff958407 100755
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -1174,6 +1174,12 @@ LLAvatarJoint* LLVOAvatar::createAvatarJoint()
 	return new LLViewerJoint();
 }
 
+// virtual
+LLAvatarJoint* LLVOAvatar::createAvatarJoint(S32 joint_num)
+{
+	return new LLViewerJoint(joint_num);
+}
+
 // virtual
 LLAvatarJointMesh* LLVOAvatar::createAvatarJointMesh()
 {
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index 31c69bf88dd..e1b4885bbb4 100755
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -356,6 +356,7 @@ class LLVOAvatar :
 
 protected:
 	/*virtual*/ LLAvatarJoint*	createAvatarJoint(); // Returns LLViewerJoint
+	/*virtual*/ LLAvatarJoint*	createAvatarJoint(S32 joint_num); // Returns LLViewerJoint
 	/*virtual*/ LLAvatarJointMesh*	createAvatarJointMesh(); // Returns LLViewerJointMesh
 public:
 	void				updateHeadOffset();
-- 
GitLab