summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2016-08-09 15:24:09 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2016-08-09 15:24:09 -0400
commit95d9e85f9539c449f37c438b90a90e6ac73d3b87 (patch)
treeeb76f2733d0d3600e134c93f911bc47c75cfd066
parentb7a0d441a35193cdeb604a491b266d2f54babb7f (diff)
SL-109 - made viewer much less tolerant of bad data in avatar_skeleton.xml or avatar_lad.xml. If either of these is broken, there's no point trying to continue, more informative to just error out with an appropriate message.
-rw-r--r--indra/llappearance/llavatarappearance.cpp41
-rw-r--r--indra/llappearance/llpolyskeletaldistortion.cpp4
2 files changed, 24 insertions, 21 deletions
diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp
index 2ce43436db..acb43d23a1 100644
--- a/indra/llappearance/llavatarappearance.cpp
+++ b/indra/llappearance/llavatarappearance.cpp
@@ -593,7 +593,7 @@ BOOL LLAvatarAppearance::setupBone(const LLAvatarBoneInfo* info, LLJoint* parent
{
if (volume_num >= (S32)mNumCollisionVolumes)
{
- LL_WARNS() << "Too many bones" << LL_ENDL;
+ LL_WARNS() << "Too many collision volumes" << LL_ENDL;
return FALSE;
}
joint = (&mCollisionVolumes[volume_num]);
@@ -866,21 +866,21 @@ BOOL LLAvatarAppearance::loadAvatar()
// avatar_skeleton.xml
if( !buildSkeleton(sAvatarSkeletonInfo) )
{
- LL_WARNS() << "avatar file: buildSkeleton() failed" << LL_ENDL;
+ LL_ERRS() << "avatar file: buildSkeleton() failed" << LL_ENDL;
return FALSE;
}
// avatar_lad.xml : <skeleton>
if( !loadSkeletonNode() )
{
- LL_WARNS() << "avatar file: loadNodeSkeleton() failed" << LL_ENDL;
+ LL_ERRS() << "avatar file: loadNodeSkeleton() failed" << LL_ENDL;
return FALSE;
}
// avatar_lad.xml : <mesh>
if( !loadMeshNodes() )
{
- LL_WARNS() << "avatar file: loadNodeMesh() failed" << LL_ENDL;
+ LL_ERRS() << "avatar file: loadNodeMesh() failed" << LL_ENDL;
return FALSE;
}
@@ -890,13 +890,13 @@ BOOL LLAvatarAppearance::loadAvatar()
mTexSkinColor = new LLTexGlobalColor( this );
if( !mTexSkinColor->setInfo( sAvatarXmlInfo->mTexSkinColorInfo ) )
{
- LL_WARNS() << "avatar file: mTexSkinColor->setInfo() failed" << LL_ENDL;
+ LL_ERRS() << "avatar file: mTexSkinColor->setInfo() failed" << LL_ENDL;
return FALSE;
}
}
else
{
- LL_WARNS() << "<global_color> name=\"skin_color\" not found" << LL_ENDL;
+ LL_ERRS() << "<global_color> name=\"skin_color\" not found" << LL_ENDL;
return FALSE;
}
if( sAvatarXmlInfo->mTexHairColorInfo )
@@ -904,13 +904,13 @@ BOOL LLAvatarAppearance::loadAvatar()
mTexHairColor = new LLTexGlobalColor( this );
if( !mTexHairColor->setInfo( sAvatarXmlInfo->mTexHairColorInfo ) )
{
- LL_WARNS() << "avatar file: mTexHairColor->setInfo() failed" << LL_ENDL;
+ LL_ERRS() << "avatar file: mTexHairColor->setInfo() failed" << LL_ENDL;
return FALSE;
}
}
else
{
- LL_WARNS() << "<global_color> name=\"hair_color\" not found" << LL_ENDL;
+ LL_ERRS() << "<global_color> name=\"hair_color\" not found" << LL_ENDL;
return FALSE;
}
if( sAvatarXmlInfo->mTexEyeColorInfo )
@@ -918,26 +918,26 @@ BOOL LLAvatarAppearance::loadAvatar()
mTexEyeColor = new LLTexGlobalColor( this );
if( !mTexEyeColor->setInfo( sAvatarXmlInfo->mTexEyeColorInfo ) )
{
- LL_WARNS() << "avatar file: mTexEyeColor->setInfo() failed" << LL_ENDL;
+ LL_ERRS() << "avatar file: mTexEyeColor->setInfo() failed" << LL_ENDL;
return FALSE;
}
}
else
{
- LL_WARNS() << "<global_color> name=\"eye_color\" not found" << LL_ENDL;
+ LL_ERRS() << "<global_color> name=\"eye_color\" not found" << LL_ENDL;
return FALSE;
}
// avatar_lad.xml : <layer_set>
if (sAvatarXmlInfo->mLayerInfoList.empty())
{
- LL_WARNS() << "avatar file: missing <layer_set> node" << LL_ENDL;
+ LL_ERRS() << "avatar file: missing <layer_set> node" << LL_ENDL;
return FALSE;
}
if (sAvatarXmlInfo->mMorphMaskInfoList.empty())
{
- LL_WARNS() << "avatar file: missing <morph_masks> node" << LL_ENDL;
+ LL_ERRS() << "avatar file: missing <morph_masks> node" << LL_ENDL;
return FALSE;
}
@@ -1136,6 +1136,7 @@ BOOL LLAvatarAppearance::loadMeshNodes()
{
// This should never happen
LL_WARNS("Avatar") << "Could not find avatar mesh: " << info->mReferenceMeshName << LL_ENDL;
+ return FALSE;
}
}
else
@@ -1730,7 +1731,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* ro
{
LL_WARNS() << "Unknown param type." << LL_ENDL;
}
- continue;
+ return FALSE;
}
LLPolySkeletalDistortionInfo *info = new LLPolySkeletalDistortionInfo;
@@ -1755,7 +1756,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* ro
{
LL_WARNS() << "No name supplied for attachment point." << LL_ENDL;
delete info;
- continue;
+ return FALSE;
}
static LLStdStringHandle joint_string = LLXmlTree::addAttributeString("joint");
@@ -1763,7 +1764,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* ro
{
LL_WARNS() << "No bone declared in attachment point " << info->mName << LL_ENDL;
delete info;
- continue;
+ return FALSE;
}
static LLStdStringHandle position_string = LLXmlTree::addAttributeString("position");
@@ -1789,7 +1790,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* ro
{
LL_WARNS() << "No id supplied for attachment point " << info->mName << LL_ENDL;
delete info;
- continue;
+ return FALSE;
}
static LLStdStringHandle slot_string = LLXmlTree::addAttributeString("pie_slice");
@@ -1875,7 +1876,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMeshNodes(LLXmlTreeNode* root)
{
LL_WARNS() << "Unknown param type." << LL_ENDL;
}
- continue;
+ return FALSE;
}
LLPolyMorphTargetInfo *morphinfo = new LLPolyMorphTargetInfo();
@@ -2036,7 +2037,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMorphNodes(LLXmlTreeNode* root
{
LL_WARNS() << "No name supplied for morph mask." << LL_ENDL;
delete info;
- continue;
+ return FALSE;
}
static LLStdStringHandle region_string = LLXmlTree::addAttributeString("body_region");
@@ -2044,7 +2045,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMorphNodes(LLXmlTreeNode* root
{
LL_WARNS() << "No region supplied for morph mask." << LL_ENDL;
delete info;
- continue;
+ return FALSE;
}
static LLStdStringHandle layer_string = LLXmlTree::addAttributeString("layer");
@@ -2052,7 +2053,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMorphNodes(LLXmlTreeNode* root
{
LL_WARNS() << "No layer supplied for morph mask." << LL_ENDL;
delete info;
- continue;
+ return FALSE;
}
// optional parameter. don't throw a warning if not present.
diff --git a/indra/llappearance/llpolyskeletaldistortion.cpp b/indra/llappearance/llpolyskeletaldistortion.cpp
index e9750ae6f5..8d71335175 100644
--- a/indra/llappearance/llpolyskeletaldistortion.cpp
+++ b/indra/llappearance/llpolyskeletaldistortion.cpp
@@ -150,8 +150,10 @@ BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info)
LLJoint* joint = mAvatar->getJoint(bone_info->mBoneName);
if (!joint)
{
+ // There's no point continuing after this error - means
+ // that either the skeleton or lad file is broken.
LL_WARNS() << "Joint " << bone_info->mBoneName << " not found." << LL_ENDL;
- continue;
+ return FALSE;
}
// store it