summaryrefslogtreecommitdiff
path: root/indra/llappearance/llpolymorph.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llappearance/llpolymorph.cpp')
-rw-r--r--indra/llappearance/llpolymorph.cpp60
1 files changed, 30 insertions, 30 deletions
diff --git a/indra/llappearance/llpolymorph.cpp b/indra/llappearance/llpolymorph.cpp
index c780778c7b..7ae760d312 100644
--- a/indra/llappearance/llpolymorph.cpp
+++ b/indra/llappearance/llpolymorph.cpp
@@ -104,17 +104,17 @@ LLPolyMorphData::~LLPolyMorphData()
//-----------------------------------------------------------------------------
// loadBinary()
//-----------------------------------------------------------------------------
-BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
+bool LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
{
S32 numVertices;
- S32 numRead;
+ size_t numRead;
numRead = fread(&numVertices, sizeof(S32), 1, fp);
llendianswizzle(&numVertices, sizeof(S32), 1);
if (numRead != 1)
{
LL_WARNS() << "Can't read number of morph target vertices" << LL_ENDL;
- return FALSE;
+ return false;
}
//-------------------------------------------------------------------------
@@ -151,14 +151,14 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
if (numRead != 1)
{
LL_WARNS() << "Can't read morph target vertex number" << LL_ENDL;
- return FALSE;
+ return false;
}
if (mVertexIndices[v] > 10000)
{
// Bad install? These are usually .llm files from 'character' fodler
LL_WARNS() << "Bad morph index " << v << ": " << mVertexIndices[v] << LL_ENDL;
- return FALSE;
+ return false;
}
@@ -167,7 +167,7 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
if (numRead != 3)
{
LL_WARNS() << "Can't read morph target vertex coordinates" << LL_ENDL;
- return FALSE;
+ return false;
}
F32 magnitude = mCoords[v].getLength3().getF32();
@@ -187,7 +187,7 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
if (numRead != 3)
{
LL_WARNS() << "Can't read morph target normal" << LL_ENDL;
- return FALSE;
+ return false;
}
numRead = fread(&mBinormals[v], sizeof(F32), 3, fp);
@@ -195,7 +195,7 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
if (numRead != 3)
{
LL_WARNS() << "Can't read morph target binormal" << LL_ENDL;
- return FALSE;
+ return false;
}
@@ -204,7 +204,7 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
if (numRead != 2)
{
LL_WARNS() << "Can't read morph target uv" << LL_ENDL;
- return FALSE;
+ return false;
}
mNumIndices++;
@@ -213,7 +213,7 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
mAvgDistortion.mul(1.f/(F32)mNumIndices);
mAvgDistortion.normalize3fast();
- return TRUE;
+ return true;
}
//-----------------------------------------------------------------------------
@@ -256,23 +256,23 @@ void LLPolyMorphData::freeData()
// LLPolyMorphTargetInfo()
//-----------------------------------------------------------------------------
LLPolyMorphTargetInfo::LLPolyMorphTargetInfo()
- : mIsClothingMorph(FALSE)
+ : mIsClothingMorph(false)
{
}
-BOOL LLPolyMorphTargetInfo::parseXml(LLXmlTreeNode* node)
+bool LLPolyMorphTargetInfo::parseXml(LLXmlTreeNode* node)
{
llassert( node->hasName( "param" ) && node->getChildByName( "param_morph" ) );
if (!LLViewerVisualParamInfo::parseXml(node))
- return FALSE;
+ return false;
// Get mixed-case name
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
if( !node->getFastAttributeString( name_string, mMorphName ) )
{
LL_WARNS() << "Avatar file: <param> is missing name attribute" << LL_ENDL;
- return FALSE; // Continue, ignoring this tag
+ return false; // Continue, ignoring this tag
}
static LLStdStringHandle clothing_morph_string = LLXmlTree::addAttributeString("clothing_morph");
@@ -284,7 +284,7 @@ BOOL LLPolyMorphTargetInfo::parseXml(LLXmlTreeNode* node)
{
LL_WARNS() << "Failed to getChildByName(\"param_morph\")"
<< LL_ENDL;
- return FALSE;
+ return false;
}
for (LLXmlTreeNode* child_node = paramNode->getFirstChild();
@@ -310,7 +310,7 @@ BOOL LLPolyMorphTargetInfo::parseXml(LLXmlTreeNode* node)
}
}
- return TRUE;
+ return true;
}
//-----------------------------------------------------------------------------
@@ -353,11 +353,11 @@ LLPolyMorphTarget::~LLPolyMorphTarget()
//-----------------------------------------------------------------------------
// setInfo()
//-----------------------------------------------------------------------------
-BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info)
+bool LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info)
{
llassert(mInfo == NULL);
if (info->mID < 0)
- return FALSE;
+ return false;
mInfo = info;
mID = info->mID;
setWeight(getDefaultWeight());
@@ -384,8 +384,8 @@ BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info)
if (!mMorphData)
{
const std::string driven_tag = "_Driven";
- U32 pos = morph_param_name.find(driven_tag);
- if (pos > 0)
+ auto pos = morph_param_name.find(driven_tag);
+ if (pos != std::string::npos && pos > 0)
{
morph_param_name = morph_param_name.substr(0,pos);
mMorphData = mMesh->getMorphData(morph_param_name);
@@ -394,9 +394,9 @@ BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info)
if (!mMorphData)
{
LL_WARNS() << "No morph target named " << morph_param_name << " found in mesh." << LL_ENDL;
- return FALSE; // Continue, ignoring this tag
+ return false; // Continue, ignoring this tag
}
- return TRUE;
+ return true;
}
/*virtual*/ LLViewerVisualParam* LLPolyMorphTarget::cloneParam(LLWearable* wearable) const
@@ -408,7 +408,7 @@ BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info)
//-----------------------------------------------------------------------------
// parseData()
//-----------------------------------------------------------------------------
-BOOL LLPolyMorphTarget::parseData(LLXmlTreeNode* node)
+bool LLPolyMorphTarget::parseData(LLXmlTreeNode* node)
{
LLPolyMorphTargetInfo* info = new LLPolyMorphTargetInfo;
@@ -416,9 +416,9 @@ BOOL LLPolyMorphTarget::parseData(LLXmlTreeNode* node)
if (!setInfo(info))
{
delete info;
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
#endif
@@ -659,7 +659,7 @@ void LLPolyMorphTarget::apply( ESex avatar_sex )
//-----------------------------------------------------------------------------
// applyMask()
//-----------------------------------------------------------------------------
-void LLPolyMorphTarget::applyMask(U8 *maskTextureData, S32 width, S32 height, S32 num_components, BOOL invert)
+void LLPolyMorphTarget::applyMask(const U8 *maskTextureData, S32 width, S32 height, S32 num_components, bool invert)
{
LLVector4a *clothing_weights = getInfo()->mIsClothingMorph ? mMesh->getWritableClothingWeights() : NULL;
@@ -749,7 +749,7 @@ void LLPolyMorphTarget::applyVolumeChanges(F32 delta_weight)
LLPolyVertexMask::LLPolyVertexMask(LLPolyMorphData* morph_data)
: mWeights(new F32[morph_data->mNumIndices]),
mMorphData(morph_data),
- mWeightsGenerated(FALSE)
+ mWeightsGenerated(false)
{
llassert(mMorphData != NULL);
llassert(mMorphData->mNumIndices > 0);
@@ -780,10 +780,10 @@ LLPolyVertexMask::~LLPolyVertexMask()
//-----------------------------------------------------------------------------
// generateMask()
//-----------------------------------------------------------------------------
-void LLPolyVertexMask::generateMask(U8 *maskTextureData, S32 width, S32 height, S32 num_components, BOOL invert, LLVector4a *clothing_weights)
+void LLPolyVertexMask::generateMask(const U8 *maskTextureData, S32 width, S32 height, S32 num_components, bool invert, LLVector4a *clothing_weights)
{
// RN debug output that uses Image Debugger (http://www.cs.unc.edu/~baxter/projects/imdebug/)
-// BOOL debugImg = FALSE;
+// bool debugImg = false;
// if (debugImg)
// {
// if (invert)
@@ -827,7 +827,7 @@ void LLPolyVertexMask::generateMask(U8 *maskTextureData, S32 width, S32 height,
clothing_weights[vertIndex].getF32ptr()[VW] = mWeights[index];
}
}
- mWeightsGenerated = TRUE;
+ mWeightsGenerated = true;
}
//-----------------------------------------------------------------------------