From 80b010b199f3a915cab7654ff3eed5b6d7a66e75 Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Fri, 26 Feb 2016 16:54:00 -0500
Subject: [PATCH] SL-109 WIP - minor code cleanup

---
 indra/llappearance/llavatarjointmesh.cpp | 50 ++++++++++++++----------
 indra/llcharacter/llmotioncontroller.cpp |  1 +
 indra/newview/llviewerjointmesh.cpp      |  1 -
 indra/newview/llvoavatar.cpp             |  5 +--
 4 files changed, 32 insertions(+), 25 deletions(-)

diff --git a/indra/llappearance/llavatarjointmesh.cpp b/indra/llappearance/llavatarjointmesh.cpp
index 17aa55ca0ae..7ca0928171f 100644
--- a/indra/llappearance/llavatarjointmesh.cpp
+++ b/indra/llappearance/llavatarjointmesh.cpp
@@ -41,29 +41,13 @@
 #include "llmatrix4a.h"
 
 
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-// LLAvatarJointMesh::LLSkinJoint
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
+// Utility functions added with Bento to simplify handling of extra
+// spine joints, or other new joints internal to the original
+// skeleton, and unknown to the system avatar.
 
 //-----------------------------------------------------------------------------
-// LLSkinJoint
-//-----------------------------------------------------------------------------
-LLSkinJoint::LLSkinJoint()
-{
-	mJoint       = NULL;
-}
-
+// getBaseSkeletonAncestor()
 //-----------------------------------------------------------------------------
-// ~LLSkinJoint
-//-----------------------------------------------------------------------------
-LLSkinJoint::~LLSkinJoint()
-{
-	mJoint = NULL;
-}
-
-
 LLAvatarJoint *getBaseSkeletonAncestor(LLAvatarJoint* joint)
 {
     LLJoint *ancestor = joint->getParent();
@@ -75,6 +59,9 @@ LLAvatarJoint *getBaseSkeletonAncestor(LLAvatarJoint* joint)
     return (LLAvatarJoint*) ancestor;
 }
 
+//-----------------------------------------------------------------------------
+// totalSkinOffset()
+//-----------------------------------------------------------------------------
 LLVector3 totalSkinOffset(LLAvatarJoint *joint)
 {
     LLVector3 totalOffset;
@@ -89,6 +76,29 @@ LLVector3 totalSkinOffset(LLAvatarJoint *joint)
     return totalOffset;
 }
 
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+// LLAvatarJointMesh::LLSkinJoint
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// LLSkinJoint
+//-----------------------------------------------------------------------------
+LLSkinJoint::LLSkinJoint()
+{
+	mJoint       = NULL;
+}
+
+//-----------------------------------------------------------------------------
+// ~LLSkinJoint
+//-----------------------------------------------------------------------------
+LLSkinJoint::~LLSkinJoint()
+{
+	mJoint = NULL;
+}
+
+
 //-----------------------------------------------------------------------------
 // LLSkinJoint::setupSkinJoint()
 //-----------------------------------------------------------------------------
diff --git a/indra/llcharacter/llmotioncontroller.cpp b/indra/llcharacter/llmotioncontroller.cpp
index 12c03e08945..d8185aa693e 100755
--- a/indra/llcharacter/llmotioncontroller.cpp
+++ b/indra/llcharacter/llmotioncontroller.cpp
@@ -37,6 +37,7 @@
 #include "llanimationstates.h"
 #include "llstl.h"
 
+// This is why LL_CHARACTER_MAX_ANIMATED_JOINTS needs to be a multiple of 4.
 const S32 NUM_JOINT_SIGNATURE_STRIDES = LL_CHARACTER_MAX_ANIMATED_JOINTS / 4;
 const U32 MAX_MOTION_INSTANCES = 32;
 
diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp
index 2632296c708..43a81ada495 100755
--- a/indra/newview/llviewerjointmesh.cpp
+++ b/indra/newview/llviewerjointmesh.cpp
@@ -195,7 +195,6 @@ void LLViewerJointMesh::uploadJointMatrices()
 		for (joint_num = 0; joint_num < reference_mesh->mJointRenderData.size(); ++joint_num)
 		{
 			gJointMatAligned[joint_num].loadu(gJointMatUnaligned[joint_num]);
-			//gJointMatAligned[joint_num].loadu(*reference_mesh->mJointRenderData[joint_num]->mWorldMatrix);
 		}
 	}
 }
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 84d585df026..a8cc797f163 100755
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -1384,14 +1384,11 @@ void render_sphere_and_line(const LLVector3& begin_pos, const LLVector3& end_pos
 void LLVOAvatar::renderCollisionVolumes()
 {
 	std::ostringstream ostr;
+
 	for (S32 i = 0; i < mNumCollisionVolumes; i++)
 	{
-		//mCollisionVolumes[i].renderCollision();
 		ostr << mCollisionVolumes[i].getName() << ", ";
-	}
 
-	for (S32 i = 0; i < mNumCollisionVolumes; i++)
-	{
         LLAvatarJointCollisionVolume& collision_volume = mCollisionVolumes[i];
 
 		collision_volume.updateWorldMatrix();
-- 
GitLab