diff options
Diffstat (limited to 'indra/llappearance')
-rw-r--r-- | indra/llappearance/llavatarappearance.cpp | 36 | ||||
-rw-r--r-- | indra/llappearance/llavatarappearance.h | 72 | ||||
-rw-r--r-- | indra/llappearance/lldriverparam.cpp | 2 | ||||
-rw-r--r-- | indra/llappearance/lldriverparam.h | 6 | ||||
-rw-r--r-- | indra/llappearance/lllocaltextureobject.cpp | 2 | ||||
-rw-r--r-- | indra/llappearance/llpolymesh.cpp | 2 | ||||
-rw-r--r-- | indra/llappearance/llpolymorph.cpp | 6 | ||||
-rw-r--r-- | indra/llappearance/lltexlayer.cpp | 8 | ||||
-rw-r--r-- | indra/llappearance/lltexlayerparams.cpp | 8 | ||||
-rw-r--r-- | indra/llappearance/llwearable.cpp | 2 | ||||
-rw-r--r-- | indra/llappearance/llwearabledata.cpp | 2 |
11 files changed, 67 insertions, 79 deletions
diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp index 3ac5714288..95d55c835f 100644 --- a/indra/llappearance/llavatarappearance.cpp +++ b/indra/llappearance/llavatarappearance.cpp @@ -164,19 +164,7 @@ LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary* LLAvatarAppearance::sAv LLAvatarAppearance::LLAvatarAppearance(LLWearableData* wearable_data) : LLCharacter(), - mIsDummy(false), - mTexSkinColor( NULL ), - mTexHairColor( NULL ), - mTexEyeColor( NULL ), - mPelvisToFoot(0.f), - mHeadOffset(), - mRoot(NULL), - mWearableData(wearable_data), - mNumBones(0), - mNumCollisionVolumes(0), - mCollisionVolumes(NULL), - mIsBuilt(false), - mInitFlags(0) + mWearableData(wearable_data) { llassert_always(mWearableData); mBakedTextureDatas.resize(LLAvatarAppearanceDefines::BAKED_NUM_INDICES); @@ -537,11 +525,11 @@ void LLAvatarAppearance::computeBodySize() new_body_size.mV[VZ] = mPelvisToFoot + // the sqrt(2) correction below is an approximate // correction to get to the top of the head - F_SQRT2 * (skull.mV[VZ] * head_scale.mV[VZ]) + - head.mV[VZ] * neck_scale.mV[VZ] + - neck.mV[VZ] * chest_scale.mV[VZ] + - chest.mV[VZ] * torso_scale.mV[VZ] + - torso.mV[VZ] * pelvis_scale.mV[VZ]; + F_SQRT2 * (skull.mV[VZ] * head_scale.mV[VZ]) + + head.mV[VZ] * neck_scale.mV[VZ] + + neck.mV[VZ] * chest_scale.mV[VZ] + + chest.mV[VZ] * torso_scale.mV[VZ] + + torso.mV[VZ] * pelvis_scale.mV[VZ]; // TODO -- measure the real depth and width new_body_size.mV[VX] = DEFAULT_AGENT_DEPTH; @@ -1459,9 +1447,9 @@ void LLAvatarAppearance::setClothesColor( ETextureIndex te, const LLColor4& new_ U32 param_name[3]; if( teToColorParams( te, param_name ) ) { - setVisualParamWeight( param_name[0], new_color.mV[VX]); - setVisualParamWeight( param_name[1], new_color.mV[VY]); - setVisualParamWeight( param_name[2], new_color.mV[VZ]); + setVisualParamWeight( param_name[0], new_color.mV[VRED]); + setVisualParamWeight( param_name[1], new_color.mV[VGREEN]); + setVisualParamWeight( param_name[2], new_color.mV[VBLUE]); } } @@ -1471,9 +1459,9 @@ LLColor4 LLAvatarAppearance::getClothesColor( ETextureIndex te ) U32 param_name[3]; if( teToColorParams( te, param_name ) ) { - color.mV[VX] = getVisualParamWeight( param_name[0] ); - color.mV[VY] = getVisualParamWeight( param_name[1] ); - color.mV[VZ] = getVisualParamWeight( param_name[2] ); + color.mV[VRED] = getVisualParamWeight( param_name[0] ); + color.mV[VGREEN] = getVisualParamWeight( param_name[1] ); + color.mV[VBLUE] = getVisualParamWeight( param_name[2] ); } return color; } diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h index 704552dfe4..13e504e639 100644 --- a/indra/llappearance/llavatarappearance.h +++ b/indra/llappearance/llavatarappearance.h @@ -70,7 +70,7 @@ public: static void initClass(); static void cleanupClass(); // Cleanup data that's only init'd once per class. virtual void initInstance(); // Called after construction to initialize the instance. - S32 mInitFlags; + S32 mInitFlags{ 0 }; virtual bool loadSkeletonNode(); bool loadMeshNodes(); bool loadLayersets(); @@ -135,8 +135,8 @@ public: F32 getPelvisToFoot() const { return mPelvisToFoot; } /*virtual*/ LLJoint* getRootJoint() { return mRoot; } - LLVector3 mHeadOffset; // current head position - LLAvatarJoint *mRoot; + LLVector3 mHeadOffset{}; // current head position + LLAvatarJoint* mRoot{ nullptr }; typedef std::map<std::string, LLJoint*> joint_map_t; joint_map_t mJointMap; @@ -165,7 +165,7 @@ protected: bool buildSkeleton(const LLAvatarSkeletonInfo *info); void clearSkeleton(); - bool mIsBuilt; // state of deferred character building + bool mIsBuilt{ false }; // state of deferred character building avatar_joint_list_t mSkeleton; LLVector3OverrideMap mPelvisFixups; joint_alias_map_t mJointAliasMap; @@ -182,30 +182,30 @@ public: LLVector3 mBodySize; LLVector3 mAvatarOffset; protected: - F32 mPelvisToFoot; + F32 mPelvisToFoot{ 0.f }; //-------------------------------------------------------------------- // Cached pointers to well known joints //-------------------------------------------------------------------- public: - LLJoint* mPelvisp; - LLJoint* mTorsop; - LLJoint* mChestp; - LLJoint* mNeckp; - LLJoint* mHeadp; - LLJoint* mSkullp; - LLJoint* mEyeLeftp; - LLJoint* mEyeRightp; - LLJoint* mHipLeftp; - LLJoint* mHipRightp; - LLJoint* mKneeLeftp; - LLJoint* mKneeRightp; - LLJoint* mAnkleLeftp; - LLJoint* mAnkleRightp; - LLJoint* mFootLeftp; - LLJoint* mFootRightp; - LLJoint* mWristLeftp; - LLJoint* mWristRightp; + LLJoint* mPelvisp{nullptr}; + LLJoint* mTorsop{ nullptr }; + LLJoint* mChestp{ nullptr }; + LLJoint* mNeckp{ nullptr }; + LLJoint* mHeadp{ nullptr }; + LLJoint* mSkullp{ nullptr }; + LLJoint* mEyeLeftp{ nullptr }; + LLJoint* mEyeRightp{ nullptr }; + LLJoint* mHipLeftp{ nullptr }; + LLJoint* mHipRightp{ nullptr }; + LLJoint* mKneeLeftp{ nullptr }; + LLJoint* mKneeRightp{ nullptr }; + LLJoint* mAnkleLeftp{ nullptr }; + LLJoint* mAnkleRightp{ nullptr }; + LLJoint* mFootLeftp{ nullptr }; + LLJoint* mFootRightp{ nullptr }; + LLJoint* mWristLeftp{ nullptr }; + LLJoint* mWristRightp{ nullptr }; //-------------------------------------------------------------------- // XML parse tree @@ -225,7 +225,7 @@ protected: ** RENDERING **/ public: - bool mIsDummy; // for special views and animated object controllers; local to viewer + bool mIsDummy{ false }; // for special views and animated object controllers; local to viewer //-------------------------------------------------------------------- // Morph masks @@ -288,9 +288,9 @@ public: LLColor4 getGlobalColor(const std::string& color_name ) const; virtual void onGlobalColorChanged(const LLTexGlobalColor* global_color) = 0; protected: - LLTexGlobalColor* mTexSkinColor; - LLTexGlobalColor* mTexHairColor; - LLTexGlobalColor* mTexEyeColor; + LLTexGlobalColor* mTexSkinColor{ nullptr }; + LLTexGlobalColor* mTexHairColor{ nullptr }; + LLTexGlobalColor* mTexEyeColor{ nullptr }; //-------------------------------------------------------------------- // Visibility @@ -313,7 +313,7 @@ public: virtual bool isWearingWearableType(LLWearableType::EType type ) const; private: - LLWearableData* mWearableData; + LLWearableData* mWearableData{ nullptr }; /******************************************************************************** ** ** @@ -331,11 +331,11 @@ protected: struct BakedTextureData { LLUUID mLastTextureID; - LLTexLayerSet* mTexLayerSet; // Only exists for self - bool mIsLoaded; - bool mIsUsed; - LLAvatarAppearanceDefines::ETextureIndex mTextureIndex; - U32 mMaskTexName; + LLTexLayerSet* mTexLayerSet{ nullptr }; // Only exists for self + bool mIsLoaded{ false }; + bool mIsUsed{ false }; + LLAvatarAppearanceDefines::ETextureIndex mTextureIndex{ LLAvatarAppearanceDefines::ETextureIndex::TEX_INVALID }; + U32 mMaskTexName{ 0 }; // Stores pointers to the joint meshes that this baked texture deals with avatar_joint_mesh_list_t mJointMeshes; morph_list_t mMaskedMorphs; @@ -352,9 +352,9 @@ protected: // Collision volumes //-------------------------------------------------------------------- public: - S32 mNumBones; - S32 mNumCollisionVolumes; - LLAvatarJointCollisionVolume* mCollisionVolumes; + S32 mNumBones{ 0 }; + S32 mNumCollisionVolumes{ 0 }; + LLAvatarJointCollisionVolume* mCollisionVolumes{ nullptr }; protected: bool allocateCollisionVolumes(U32 num); diff --git a/indra/llappearance/lldriverparam.cpp b/indra/llappearance/lldriverparam.cpp index 29815d22f7..2e933f9357 100644 --- a/indra/llappearance/lldriverparam.cpp +++ b/indra/llappearance/lldriverparam.cpp @@ -422,7 +422,7 @@ const LLVector4a* LLDriverParam::getNextDistortion(U32 *index, LLPolyMesh **po S32 LLDriverParam::getDrivenParamsCount() const { - return mDriven.size(); + return static_cast<S32>(mDriven.size()); } const LLViewerVisualParam* LLDriverParam::getDrivenParam(S32 index) const diff --git a/indra/llappearance/lldriverparam.h b/indra/llappearance/lldriverparam.h index b7eac80603..59092988dd 100644 --- a/indra/llappearance/lldriverparam.h +++ b/indra/llappearance/lldriverparam.h @@ -130,10 +130,10 @@ protected: LL_ALIGN_16(LLVector4a mDefaultVec); // temp holder entry_list_t mDriven; - LLViewerVisualParam* mCurrentDistortionParam; + LLViewerVisualParam* mCurrentDistortionParam{ nullptr }; // Backlink only; don't make this an LLPointer. - LLAvatarAppearance* mAvatarAppearance; - LLWearable* mWearablep; + LLAvatarAppearance* mAvatarAppearance{ nullptr }; + LLWearable* mWearablep{ nullptr }; }; #endif // LL_LLDRIVERPARAM_H diff --git a/indra/llappearance/lllocaltextureobject.cpp b/indra/llappearance/lllocaltextureobject.cpp index 9707f002ee..f743f7b517 100644 --- a/indra/llappearance/lllocaltextureobject.cpp +++ b/indra/llappearance/lllocaltextureobject.cpp @@ -109,7 +109,7 @@ LLTexLayer* LLLocalTextureObject::getTexLayer(const std::string &name) U32 LLLocalTextureObject::getNumTexLayers() const { - return mTexLayers.size(); + return static_cast<U32>(mTexLayers.size()); } LLUUID LLLocalTextureObject::getID() const diff --git a/indra/llappearance/llpolymesh.cpp b/indra/llappearance/llpolymesh.cpp index b70e5af69f..97f9ca68b6 100644 --- a/indra/llappearance/llpolymesh.cpp +++ b/indra/llappearance/llpolymesh.cpp @@ -983,7 +983,7 @@ void LLPolyMesh::initializeForMorph() LLVector4a::memcpyNonAliased16((F32*) mScaledBinormals, (F32*) mSharedData->mBaseNormals, sizeof(LLVector4a) * mSharedData->mNumVertices); LLVector4a::memcpyNonAliased16((F32*) mTexCoords, (F32*) mSharedData->mTexCoords, sizeof(LLVector2) * (mSharedData->mNumVertices + mSharedData->mNumVertices%2)); - for (U32 i = 0; i < mSharedData->mNumVertices; ++i) + for (S32 i = 0; i < mSharedData->mNumVertices; ++i) { mClothingWeights[i].clear(); } diff --git a/indra/llappearance/llpolymorph.cpp b/indra/llappearance/llpolymorph.cpp index d8109d79c2..7ae760d312 100644 --- a/indra/llappearance/llpolymorph.cpp +++ b/indra/llappearance/llpolymorph.cpp @@ -107,7 +107,7 @@ LLPolyMorphData::~LLPolyMorphData() 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); @@ -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); diff --git a/indra/llappearance/lltexlayer.cpp b/indra/llappearance/lltexlayer.cpp index 60ff19f952..d376c68c7f 100644 --- a/indra/llappearance/lltexlayer.cpp +++ b/indra/llappearance/lltexlayer.cpp @@ -1038,7 +1038,7 @@ bool LLTexLayer::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bou bool success = true; // If you can't see the layer, don't render it. - if( is_approx_zero( net_color.mV[VW] ) ) + if( is_approx_zero( net_color.mV[VALPHA] ) ) { return success; } @@ -1213,7 +1213,7 @@ bool LLTexLayer::findNetColor(LLColor4* net_color) const { net_color->setVec( mTexLayerSet->getAvatarAppearance()->getGlobalColor( getInfo()->mGlobalColor ) ); } - else if (getInfo()->mFixedColor.mV[VW]) + else if (getInfo()->mFixedColor.mV[VALPHA]) { net_color->setVec( getInfo()->mFixedColor ); } @@ -1232,7 +1232,7 @@ bool LLTexLayer::findNetColor(LLColor4* net_color) const return true; } - if( getInfo()->mFixedColor.mV[VW] ) + if( getInfo()->mFixedColor.mV[VALPHA] ) { net_color->setVec( getInfo()->mFixedColor ); return true; @@ -1373,7 +1373,7 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC // Draw a rectangle with the layer color to multiply the alpha by that color's alpha. // Note: we're still using gGL.blendFunc( GL_DST_ALPHA, GL_ZERO ); - if ( !is_approx_equal(layer_color.mV[VW], 1.f) ) + if ( !is_approx_equal(layer_color.mV[VALPHA], 1.f) ) { gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); gGL.color4fv(layer_color.mV); diff --git a/indra/llappearance/lltexlayerparams.cpp b/indra/llappearance/lltexlayerparams.cpp index 7beffbcd19..30551c115d 100644 --- a/indra/llappearance/lltexlayerparams.cpp +++ b/indra/llappearance/lltexlayerparams.cpp @@ -464,10 +464,10 @@ LLColor4 LLTexLayerParamColor::getNetColor() const F32 weight = scaled_weight - index_start; const LLColor4 *start = &info->mColors[ index_start ]; const LLColor4 *end = &info->mColors[ index_end ]; - return LLColor4((1.f - weight) * start->mV[VX] + weight * end->mV[VX], - (1.f - weight) * start->mV[VY] + weight * end->mV[VY], - (1.f - weight) * start->mV[VZ] + weight * end->mV[VZ], - (1.f - weight) * start->mV[VW] + weight * end->mV[VW]); + return LLColor4((1.f - weight) * start->mV[VRED] + weight * end->mV[VRED], + (1.f - weight) * start->mV[VGREEN] + weight * end->mV[VGREEN], + (1.f - weight) * start->mV[VBLUE] + weight * end->mV[VBLUE], + (1.f - weight) * start->mV[VALPHA] + weight * end->mV[VALPHA]); } } diff --git a/indra/llappearance/llwearable.cpp b/indra/llappearance/llwearable.cpp index 9c41e3c256..a7e5292fed 100644 --- a/indra/llappearance/llwearable.cpp +++ b/indra/llappearance/llwearable.cpp @@ -744,7 +744,7 @@ void LLWearable::writeToAvatar(LLAvatarAppearance* avatarp) std::string terse_F32_to_string(F32 f) { std::string r = llformat("%.2f", f); - S32 len = r.length(); + auto len = r.length(); // "1.20" -> "1.2" // "24.00" -> "24." diff --git a/indra/llappearance/llwearabledata.cpp b/indra/llappearance/llwearabledata.cpp index a58138c434..7598ed67f3 100644 --- a/indra/llappearance/llwearabledata.cpp +++ b/indra/llappearance/llwearabledata.cpp @@ -334,7 +334,7 @@ U32 LLWearableData::getWearableCount(const LLWearableType::EType type) const return 0; } const wearableentry_vec_t& wearable_vec = wearable_iter->second; - return wearable_vec.size(); + return static_cast<U32>(wearable_vec.size()); } U32 LLWearableData::getWearableCount(const U32 tex_index) const |