diff options
author | Loren Shih <seraph@lindenlab.com> | 2009-10-21 21:37:27 +0000 |
---|---|---|
committer | Loren Shih <seraph@lindenlab.com> | 2009-10-21 21:37:27 +0000 |
commit | 5164ed388c1e328cb80dec304ba2fd249ef662f4 (patch) | |
tree | df6f0f691faa1fae32f376a7b0c582127b7f2507 | |
parent | b3d1eb82fadbf3a098abb49d2ef23cade4c6fe95 (diff) |
Code audit for r136515 ("merging in new wearable infrastructure...")
No expected functionality change; this mostly contains cosmetic cleanup.
Reviewed by: Nyx
25 files changed, 132 insertions, 119 deletions
diff --git a/indra/llcharacter/llcharacter.cpp b/indra/llcharacter/llcharacter.cpp index 20ff7bab34..e68672d46f 100644 --- a/indra/llcharacter/llcharacter.cpp +++ b/indra/llcharacter/llcharacter.cpp @@ -276,7 +276,7 @@ void LLCharacter::removeAnimationData(std::string name) BOOL LLCharacter::setVisualParamWeight(LLVisualParam* which_param, F32 weight, BOOL set_by_user) { S32 index = which_param->getID(); - VisualParamIndexMap_t::iterator index_iter = mVisualParamIndexMap.find(index); + visual_param_index_map_t::iterator index_iter = mVisualParamIndexMap.find(index); if (index_iter != mVisualParamIndexMap.end()) { index_iter->second->setWeight(weight, set_by_user); @@ -293,7 +293,7 @@ BOOL LLCharacter::setVisualParamWeight(const char* param_name, F32 weight, BOOL std::string tname(param_name); LLStringUtil::toLower(tname); char *tableptr = sVisualParamNames.checkString(tname); - VisualParamNameMap_t::iterator name_iter = mVisualParamNameMap.find(tableptr); + visual_param_name_map_t::iterator name_iter = mVisualParamNameMap.find(tableptr); if (name_iter != mVisualParamNameMap.end()) { name_iter->second->setWeight(weight, set_by_user); @@ -308,7 +308,7 @@ BOOL LLCharacter::setVisualParamWeight(const char* param_name, F32 weight, BOOL //----------------------------------------------------------------------------- BOOL LLCharacter::setVisualParamWeight(S32 index, F32 weight, BOOL set_by_user) { - VisualParamIndexMap_t::iterator index_iter = mVisualParamIndexMap.find(index); + visual_param_index_map_t::iterator index_iter = mVisualParamIndexMap.find(index); if (index_iter != mVisualParamIndexMap.end()) { index_iter->second->setWeight(weight, set_by_user); @@ -324,7 +324,7 @@ BOOL LLCharacter::setVisualParamWeight(S32 index, F32 weight, BOOL set_by_user) F32 LLCharacter::getVisualParamWeight(LLVisualParam *which_param) { S32 index = which_param->getID(); - VisualParamIndexMap_t::iterator index_iter = mVisualParamIndexMap.find(index); + visual_param_index_map_t::iterator index_iter = mVisualParamIndexMap.find(index); if (index_iter != mVisualParamIndexMap.end()) { return index_iter->second->getWeight(); @@ -344,7 +344,7 @@ F32 LLCharacter::getVisualParamWeight(const char* param_name) std::string tname(param_name); LLStringUtil::toLower(tname); char *tableptr = sVisualParamNames.checkString(tname); - VisualParamNameMap_t::iterator name_iter = mVisualParamNameMap.find(tableptr); + visual_param_name_map_t::iterator name_iter = mVisualParamNameMap.find(tableptr); if (name_iter != mVisualParamNameMap.end()) { return name_iter->second->getWeight(); @@ -358,7 +358,7 @@ F32 LLCharacter::getVisualParamWeight(const char* param_name) //----------------------------------------------------------------------------- F32 LLCharacter::getVisualParamWeight(S32 index) { - VisualParamIndexMap_t::iterator index_iter = mVisualParamIndexMap.find(index); + visual_param_index_map_t::iterator index_iter = mVisualParamIndexMap.find(index); if (index_iter != mVisualParamIndexMap.end()) { return index_iter->second->getWeight(); @@ -415,7 +415,7 @@ LLVisualParam* LLCharacter::getVisualParam(const char *param_name) std::string tname(param_name); LLStringUtil::toLower(tname); char *tableptr = sVisualParamNames.checkString(tname); - VisualParamNameMap_t::iterator name_iter = mVisualParamNameMap.find(tableptr); + visual_param_name_map_t::iterator name_iter = mVisualParamNameMap.find(tableptr); if (name_iter != mVisualParamNameMap.end()) { return name_iter->second; @@ -430,7 +430,7 @@ LLVisualParam* LLCharacter::getVisualParam(const char *param_name) void LLCharacter::addSharedVisualParam(LLVisualParam *param) { S32 index = param->getID(); - VisualParamIndexMap_t::iterator index_iter = mVisualParamIndexMap.find(index); + visual_param_index_map_t::iterator index_iter = mVisualParamIndexMap.find(index); LLVisualParam* current_param = 0; if (index_iter != mVisualParamIndexMap.end()) current_param = index_iter->second; @@ -457,13 +457,13 @@ void LLCharacter::addVisualParam(LLVisualParam *param) { S32 index = param->getID(); // Add Index map - std::pair<VisualParamIndexMap_t::iterator, bool> idxres; - idxres = mVisualParamIndexMap.insert(VisualParamIndexMap_t::value_type(index, param)); + std::pair<visual_param_index_map_t::iterator, bool> idxres; + idxres = mVisualParamIndexMap.insert(visual_param_index_map_t::value_type(index, param)); if (!idxres.second) { llwarns << "Visual parameter " << param->getName() << " already exists with same ID as " << param->getName() << llendl; - VisualParamIndexMap_t::iterator index_iter = idxres.first; + visual_param_index_map_t::iterator index_iter = idxres.first; index_iter->second = param; } @@ -473,12 +473,12 @@ void LLCharacter::addVisualParam(LLVisualParam *param) std::string tname(param->getName()); LLStringUtil::toLower(tname); char *tableptr = sVisualParamNames.addString(tname); - std::pair<VisualParamNameMap_t::iterator, bool> nameres; - nameres = mVisualParamNameMap.insert(VisualParamNameMap_t::value_type(tableptr, param)); + std::pair<visual_param_name_map_t::iterator, bool> nameres; + nameres = mVisualParamNameMap.insert(visual_param_name_map_t::value_type(tableptr, param)); if (!nameres.second) { // Already exists, copy param - VisualParamNameMap_t::iterator name_iter = nameres.first; + visual_param_name_map_t::iterator name_iter = nameres.first; name_iter->second = param; } } diff --git a/indra/llcharacter/llcharacter.h b/indra/llcharacter/llcharacter.h index 1507686f67..cb44a32e8a 100644 --- a/indra/llcharacter/llcharacter.h +++ b/indra/llcharacter/llcharacter.h @@ -233,12 +233,12 @@ public: LLVisualParam* getVisualParam(S32 id) const { - VisualParamIndexMap_t::const_iterator iter = mVisualParamIndexMap.find(id); + visual_param_index_map_t::const_iterator iter = mVisualParamIndexMap.find(id); return (iter == mVisualParamIndexMap.end()) ? 0 : iter->second; } S32 getVisualParamID(LLVisualParam *id) { - VisualParamIndexMap_t::iterator iter; + visual_param_index_map_t::iterator iter; for (iter = mVisualParamIndexMap.begin(); iter != mVisualParamIndexMap.end(); iter++) { if (iter->second == id) @@ -276,11 +276,12 @@ protected: private: // visual parameter stuff - typedef std::map<S32, LLVisualParam *> VisualParamIndexMap_t; - VisualParamIndexMap_t mVisualParamIndexMap; - VisualParamIndexMap_t::iterator mCurIterator; - typedef std::map<char *, LLVisualParam *> VisualParamNameMap_t; - VisualParamNameMap_t mVisualParamNameMap; + typedef std::map<S32, LLVisualParam *> visual_param_index_map_t; + typedef std::map<char *, LLVisualParam *> visual_param_name_map_t; + + visual_param_index_map_t::iterator mCurIterator; + visual_param_index_map_t mVisualParamIndexMap; + visual_param_name_map_t mVisualParamNameMap; static LLStringTable sVisualParamNames; }; diff --git a/indra/llcharacter/llvisualparam.cpp b/indra/llcharacter/llvisualparam.cpp index c4763c6331..9e4957342c 100644 --- a/indra/llcharacter/llvisualparam.cpp +++ b/indra/llcharacter/llvisualparam.cpp @@ -305,7 +305,7 @@ void LLVisualParam::stopAnimating(BOOL set_by_user) } //virtual -BOOL LLVisualParam::linkDrivenParams(visual_param_mapper mapper, bool only_cross_params) +BOOL LLVisualParam::linkDrivenParams(visual_param_mapper mapper, BOOL only_cross_params) { // nothing to do for non-driver parameters return TRUE; diff --git a/indra/llcharacter/llvisualparam.h b/indra/llcharacter/llvisualparam.h index e6503d611d..0b516b9374 100644 --- a/indra/llcharacter/llvisualparam.h +++ b/indra/llcharacter/llvisualparam.h @@ -96,10 +96,9 @@ protected: //----------------------------------------------------------------------------- class LLVisualParam { -protected: - typedef boost::function<LLVisualParam*(S32)> visual_param_mapper; - public: + typedef boost::function<LLVisualParam*(S32)> visual_param_mapper; + LLVisualParam(); virtual ~LLVisualParam(); @@ -119,7 +118,7 @@ public: virtual void animate(F32 delta, BOOL set_by_user); virtual void stopAnimating(BOOL set_by_user); - virtual BOOL linkDrivenParams(visual_param_mapper mapper, bool only_cross_params); + virtual BOOL linkDrivenParams(visual_param_mapper mapper, BOOL only_cross_params); virtual void resetDrivenParams(); // Interface methods @@ -161,7 +160,6 @@ protected: S32 mID; // id for storing weight/morphtarget compares compactly LLVisualParamInfo *mInfo; - }; #endif // LL_LLVisualParam_H diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 34d2c00007..bb00468d40 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -68,8 +68,11 @@ public: EWearableType mType; LLUUID mItemID; LLUUID mAssetID; - InitialWearableData(EWearableType type, LLUUID itemID, LLUUID assetID) : - mType(type), mItemID(itemID), mAssetID(assetID) { } + InitialWearableData(EWearableType type, LLUUID& itemID, LLUUID& assetID) : + mType(type), + mItemID(itemID), + mAssetID(assetID) + {} }; typedef std::vector<InitialWearableData> initial_wearable_data_vec_t; @@ -654,7 +657,7 @@ U32 LLAgentWearables::pushWearable(const EWearableType type, LLWearable *wearabl if (wearable == NULL) { // no null wearables please! - //TODO: insert llwarns + llwarns << "Null wearable sent for type " << type << llendl; return MAX_WEARABLES_PER_TYPE; } if (type < WT_COUNT || mWearableDatas[type].size() < MAX_WEARABLES_PER_TYPE) @@ -1090,7 +1093,7 @@ void LLAgentWearables::getAllWearablesArray(LLDynamicArray<S32>& wearables) { for( S32 i = 0; i < WT_COUNT; ++i ) { - if (getWearableCount( (EWearableType) i) != 0 ) + if (getWearableCount((EWearableType) i) != 0) { wearables.push_back(i); } @@ -1300,8 +1303,8 @@ void LLAgentWearables::addWearableToAgentInventory(LLPointer<LLInventoryCallback void LLAgentWearables::removeWearable(const EWearableType type, bool do_remove_all, U32 index) { - if ((gAgent.isTeen()) - && (type == WT_UNDERSHIRT || type == WT_UNDERPANTS)) + if (gAgent.isTeen() && + (type == WT_UNDERSHIRT || type == WT_UNDERPANTS)) { // Can't take off underclothing in simple UI mode or on PG accounts // TODO: enable the removing of a single undershirt/underpants if multiple are worn. - Nyx diff --git a/indra/newview/lldriverparam.cpp b/indra/newview/lldriverparam.cpp index e7295512c1..45f4b4fbd0 100644 --- a/indra/newview/lldriverparam.cpp +++ b/indra/newview/lldriverparam.cpp @@ -156,13 +156,17 @@ void LLDriverParamInfo::toStream(std::ostream &out) // LLDriverParam //----------------------------------------------------------------------------- -LLDriverParam::LLDriverParam(LLVOAvatar *avatarp) - : mCurrentDistortionParam( NULL ), mAvatarp(avatarp), mWearablep(NULL) +LLDriverParam::LLDriverParam(LLVOAvatar *avatarp) : + mCurrentDistortionParam( NULL ), + mAvatarp(avatarp), + mWearablep(NULL) { } -LLDriverParam::LLDriverParam(LLWearable *wearablep) - : mCurrentDistortionParam( NULL ), mAvatarp(NULL), mWearablep(wearablep) +LLDriverParam::LLDriverParam(LLWearable *wearablep) : + mCurrentDistortionParam( NULL ), + mAvatarp(NULL), + mWearablep(wearablep) { } @@ -201,7 +205,7 @@ void LLDriverParam::setAvatar(LLVOAvatar *avatarp) } } -/*virtual*/ LLViewerVisualParam * LLDriverParam::cloneParam(LLWearable* wearable) const +/*virtual*/ LLViewerVisualParam* LLDriverParam::cloneParam(LLWearable* wearable) const { LLDriverParam *new_param; if (wearable) @@ -481,7 +485,7 @@ void LLDriverParam::stopAnimating(BOOL set_by_user) } /*virtual*/ -BOOL LLDriverParam::linkDrivenParams(visual_param_mapper mapper, bool only_cross_params) +BOOL LLDriverParam::linkDrivenParams(visual_param_mapper mapper, BOOL only_cross_params) { BOOL success = TRUE; LLDriverParamInfo::entry_info_list_t::iterator iter; @@ -584,7 +588,8 @@ F32 LLDriverParam::getDrivenWeight(const LLDrivenEntry* driven, F32 input_weight void LLDriverParam::setDrivenWeight(LLDrivenEntry *driven, F32 driven_weight, bool set_by_user) { LLVOAvatarSelf *avatar_self = gAgent.getAvatarObject(); - if(mWearablep && driven->mParam->getCrossWearable() && + if(mWearablep && + driven->mParam->getCrossWearable() && mWearablep->isOnTop()) { // call setWeight through LLVOAvatarSelf so other wearables can be updated with the correct values diff --git a/indra/newview/lldriverparam.h b/indra/newview/lldriverparam.h index c73e740574..069e71a2cb 100644 --- a/indra/newview/lldriverparam.h +++ b/indra/newview/lldriverparam.h @@ -94,7 +94,7 @@ public: void setWearable(LLWearable *wearablep); void setAvatar(LLVOAvatar *avatarp); - /*virtual*/ LLViewerVisualParam * cloneParam(LLWearable* wearable) const; + /*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const; // LLVisualParam Virtual functions ///*virtual*/ BOOL parseData(LLXmlTreeNode* node); @@ -102,7 +102,7 @@ public: /*virtual*/ void setWeight(F32 weight, BOOL set_by_user); /*virtual*/ void setAnimationTarget( F32 target_value, BOOL set_by_user ); /*virtual*/ void stopAnimating(BOOL set_by_user); - /*virtual*/ BOOL linkDrivenParams(visual_param_mapper mapper, bool only_cross_params); + /*virtual*/ BOOL linkDrivenParams(visual_param_mapper mapper, BOOL only_cross_params); /*virtual*/ void resetDrivenParams(); // LLViewerVisualParam Virtual functions diff --git a/indra/newview/lllocaltextureobject.cpp b/indra/newview/lllocaltextureobject.cpp index 99c98ec16e..0bd3e42556 100644 --- a/indra/newview/lllocaltextureobject.cpp +++ b/indra/newview/lllocaltextureobject.cpp @@ -47,18 +47,18 @@ LLLocalTextureObject::LLLocalTextureObject() : mImage = NULL; } -LLLocalTextureObject::LLLocalTextureObject(LLViewerFetchedTexture *image, LLUUID id) +LLLocalTextureObject::LLLocalTextureObject(LLViewerFetchedTexture* image, LLUUID& id) { mImage = image; gGL.getTexUnit(0)->bind(mImage); mID = id; } -LLLocalTextureObject::LLLocalTextureObject(const LLLocalTextureObject <o) : -mImage(lto.mImage), -mID(lto.mID), -mIsBakedReady(lto.mIsBakedReady), -mDiscard(lto.mDiscard) +LLLocalTextureObject::LLLocalTextureObject(const LLLocalTextureObject& lto) : + mImage(lto.mImage), + mID(lto.mID), + mIsBakedReady(lto.mIsBakedReady), + mDiscard(lto.mDiscard) { U32 num_layers = lto.getNumTexLayers(); mTexLayers.reserve(num_layers); @@ -97,7 +97,7 @@ LLTexLayer* LLLocalTextureObject::getTexLayer(U32 index) const LLTexLayer* LLLocalTextureObject::getTexLayer(const std::string &name) { - for( tex_layer_p::iterator iter = mTexLayers.begin(); iter != mTexLayers.end(); iter++) + for( tex_layer_vec_t::iterator iter = mTexLayers.begin(); iter != mTexLayers.end(); iter++) { LLTexLayer *layer = *iter; if (layer->getName().compare(name) == 0) @@ -190,7 +190,7 @@ BOOL LLLocalTextureObject::removeTexLayer(U32 index) { return FALSE; } - tex_layer_p::iterator iter = mTexLayers.begin(); + tex_layer_vec_t::iterator iter = mTexLayers.begin(); iter += index; delete *iter; diff --git a/indra/newview/lllocaltextureobject.h b/indra/newview/lllocaltextureobject.h index 138bbad677..461756ee46 100644 --- a/indra/newview/lllocaltextureobject.h +++ b/indra/newview/lllocaltextureobject.h @@ -49,8 +49,8 @@ class LLLocalTextureObject { public: LLLocalTextureObject(); - LLLocalTextureObject(LLViewerFetchedTexture *image, LLUUID id); - LLLocalTextureObject(const LLLocalTextureObject <o); + LLLocalTextureObject(LLViewerFetchedTexture* image, LLUUID& id); + LLLocalTextureObject(const LLLocalTextureObject& lto); ~LLLocalTextureObject(); LLViewerFetchedTexture* getImage() const; @@ -79,8 +79,8 @@ private: // NOTE: LLLocalTextureObject should be the exclusive owner of mTexEntry and mTexLayer // using shared pointers here only for smart assignment & cleanup // do NOT create new shared pointers to these objects, or keep pointers to them around - typedef std::vector<LLTexLayer*> tex_layer_p; - tex_layer_p mTexLayers; + typedef std::vector<LLTexLayer*> tex_layer_vec_t; + tex_layer_vec_t mTexLayers; LLUUID mID; diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index c2c32527fb..e2057bbbd7 100644 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -601,15 +601,14 @@ LLPanel* LLPanelEditWearable::getPanel(EWearableType type) void LLPanelEditWearable::getSortedParams(value_map_t &sorted_params, const std::string &edit_group) { - LLWearable::visualParamCluster_t param_list; + LLWearable::visual_param_vec_t param_list; ESex avatar_sex = gAgent.getAvatarObject()->getSex(); mWearablePtr->getVisualParams(param_list); - LLWearable::visualParamCluster_t::iterator iter = param_list.begin(); - LLWearable::visualParamCluster_t::iterator end = param_list.end(); - - for (; iter != end; ++iter) + for (LLWearable::visual_param_vec_t::iterator iter = param_list.begin(); + iter != param_list.end(); + ++iter) { LLViewerVisualParam *param = (LLViewerVisualParam*) *iter; diff --git a/indra/newview/llpolymesh.cpp b/indra/newview/llpolymesh.cpp index 02e11cefad..d5a2d66bcf 100644 --- a/indra/newview/llpolymesh.cpp +++ b/indra/newview/llpolymesh.cpp @@ -1118,7 +1118,7 @@ BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info) return TRUE; } -/*virtual*/ LLViewerVisualParam * LLPolySkeletalDistortion::cloneParam(LLWearable* wearable) const +/*virtual*/ LLViewerVisualParam* LLPolySkeletalDistortion::cloneParam(LLWearable* wearable) const { LLPolySkeletalDistortion *new_param = new LLPolySkeletalDistortion(mAvatar); *new_param = *this; diff --git a/indra/newview/llpolymesh.h b/indra/newview/llpolymesh.h index 709b176c8d..c2e5451dfe 100644 --- a/indra/newview/llpolymesh.h +++ b/indra/newview/llpolymesh.h @@ -417,7 +417,7 @@ public: // This sets mInfo and calls initialization functions BOOL setInfo(LLPolySkeletalDistortionInfo *info); - /*virtual*/ LLViewerVisualParam * cloneParam(LLWearable* wearable) const; + /*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const; // LLVisualParam Virtual functions ///*virtual*/ BOOL parseData(LLXmlTreeNode* node); diff --git a/indra/newview/llpolymorph.cpp b/indra/newview/llpolymorph.cpp index 924b1a4d6e..80983cad24 100644 --- a/indra/newview/llpolymorph.cpp +++ b/indra/newview/llpolymorph.cpp @@ -302,7 +302,7 @@ BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info) return TRUE; } -/*virtual*/ LLViewerVisualParam * LLPolyMorphTarget::cloneParam(LLWearable* wearable) const +/*virtual*/ LLViewerVisualParam* LLPolyMorphTarget::cloneParam(LLWearable* wearable) const { LLPolyMorphTarget *new_param = new LLPolyMorphTarget(mMesh); *new_param = *this; diff --git a/indra/newview/llpolymorph.h b/indra/newview/llpolymorph.h index 5089fc2e8a..01731402df 100644 --- a/indra/newview/llpolymorph.h +++ b/indra/newview/llpolymorph.h @@ -154,7 +154,7 @@ public: // This sets mInfo and calls initialization functions BOOL setInfo(LLPolyMorphTargetInfo *info); - /*virtual*/ LLViewerVisualParam * cloneParam(LLWearable* wearable) const; + /*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const; // LLVisualParam Virtual functions ///*virtual*/ BOOL parseData(LLXmlTreeNode* node); diff --git a/indra/newview/lltexglobalcolor.cpp b/indra/newview/lltexglobalcolor.cpp index d0bb9e1cf1..595b24ad47 100644 --- a/indra/newview/lltexglobalcolor.cpp +++ b/indra/newview/lltexglobalcolor.cpp @@ -101,7 +101,7 @@ LLTexParamGlobalColor::LLTexParamGlobalColor(LLTexGlobalColor* tex_global_color) { } -/*virtual*/ LLViewerVisualParam * LLTexParamGlobalColor::cloneParam(LLWearable* wearable) const +/*virtual*/ LLViewerVisualParam* LLTexParamGlobalColor::cloneParam(LLWearable* wearable) const { LLTexParamGlobalColor *new_param = new LLTexParamGlobalColor(mTexGlobalColor); *new_param = *this; diff --git a/indra/newview/lltexglobalcolor.h b/indra/newview/lltexglobalcolor.h index f0d22d317c..1e6754133f 100644 --- a/indra/newview/lltexglobalcolor.h +++ b/indra/newview/lltexglobalcolor.h @@ -78,7 +78,7 @@ class LLTexParamGlobalColor : public LLTexLayerParamColor { public: LLTexParamGlobalColor(LLTexGlobalColor *tex_color); - /*virtual*/ LLViewerVisualParam * cloneParam(LLWearable* wearable) const; + /*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const; protected: /*virtual*/ void onGlobalColorChanged(bool set_by_user); private: diff --git a/indra/newview/lltexlayer.cpp b/indra/newview/lltexlayer.cpp index de8458c0fa..17547cae39 100644 --- a/indra/newview/lltexlayer.cpp +++ b/indra/newview/lltexlayer.cpp @@ -1078,13 +1078,13 @@ BOOL LLTexLayerInterface::setInfo(const LLTexLayerInfo *info, LLWearable* wearab mInfo = info; //mID = info->mID; // No ID - mParamColorList.reserve(mInfo->mParamColorInfoList.size()); + mParamColorList.reserve(mInfo->mParamColorInfoList.size()); for (param_color_info_list_t::const_iterator iter = mInfo->mParamColorInfoList.begin(); iter != mInfo->mParamColorInfoList.end(); iter++) { LLTexLayerParamColor* param_color; - if (!wearable) + if (!wearable) { param_color = new LLTexLayerParamColor(this); if (!param_color->setInfo(*iter, TRUE)) @@ -1105,7 +1105,7 @@ BOOL LLTexLayerInterface::setInfo(const LLTexLayerInfo *info, LLWearable* wearab mParamColorList.push_back( param_color ); } - mParamAlphaList.reserve(mInfo->mParamAlphaInfoList.size()); + mParamAlphaList.reserve(mInfo->mParamAlphaInfoList.size()); for (param_alpha_info_list_t::const_iterator iter = mInfo->mParamAlphaInfoList.begin(); iter != mInfo->mParamAlphaInfoList.end(); iter++) @@ -1893,13 +1893,13 @@ LLTexLayer* LLTexLayerTemplate::getLayer(U32 i) //----------------------------------------------------------------------------- // finds a specific layer based on a passed in name //----------------------------------------------------------------------------- -LLTexLayerInterface* LLTexLayerSet::findLayerByName(std::string name) +LLTexLayerInterface* LLTexLayerSet::findLayerByName(const std::string& name) { for( layer_list_t::iterator iter = mLayerList.begin(); iter != mLayerList.end(); iter++ ) { LLTexLayerInterface* layer = *iter; - if (layer->getName().compare(name) == 0) + if (layer->getName() == name) { return layer; } @@ -1908,7 +1908,7 @@ LLTexLayerInterface* LLTexLayerSet::findLayerByName(std::string name) { LLTexLayerInterface* layer = *iter; - if (layer->getName().compare(name) == 0) + if (layer->getName() == name) { return layer; } diff --git a/indra/newview/lltexlayer.h b/indra/newview/lltexlayer.h index 2269c3c9a5..e4a6e82ba5 100644 --- a/indra/newview/lltexlayer.h +++ b/indra/newview/lltexlayer.h @@ -60,6 +60,11 @@ typedef std::vector<LLTexLayerParamAlpha *> param_alpha_list_t; typedef std::vector<LLTexLayerParamColorInfo *> param_color_info_list_t; typedef std::vector<LLTexLayerParamAlphaInfo *> param_alpha_info_list_t; + +//----------------------------------------------------------------------------- +// LLTexLayerInterface +// Interface class to generalize functionality shared by LLTexLayer and LLTexLayerTemplate. + class LLTexLayerInterface { public: @@ -256,7 +261,7 @@ public: void deleteCaches(); void gatherMorphMaskAlpha(U8 *data, S32 width, S32 height); void applyMorphMask(U8* tex_data, S32 width, S32 height, S32 num_components); - LLTexLayerInterface* findLayerByName(std::string name); + LLTexLayerInterface* findLayerByName(const std::string& name); void cloneTemplates(LLLocalTextureObject *lto, LLVOAvatarDefines::ETextureIndex tex_index, LLWearable* wearable); LLVOAvatarSelf* getAvatar() const { return mAvatar; } diff --git a/indra/newview/lltexlayerparams.cpp b/indra/newview/lltexlayerparams.cpp index 9cd73c4656..ca888899ed 100644 --- a/indra/newview/lltexlayerparams.cpp +++ b/indra/newview/lltexlayerparams.cpp @@ -140,7 +140,7 @@ LLTexLayerParamAlpha::~LLTexLayerParamAlpha() sInstances.remove(this); } -/*virtual*/ LLViewerVisualParam * LLTexLayerParamAlpha::cloneParam(LLWearable* wearable) const +/*virtual*/ LLViewerVisualParam* LLTexLayerParamAlpha::cloneParam(LLWearable* wearable) const { LLTexLayerParamAlpha *new_param = new LLTexLayerParamAlpha(mTexLayer); *new_param = *this; @@ -409,7 +409,7 @@ LLTexLayerParamColor::~LLTexLayerParamColor() { } -/*virtual*/ LLViewerVisualParam * LLTexLayerParamColor::cloneParam(LLWearable* wearable) const +/*virtual*/ LLViewerVisualParam* LLTexLayerParamColor::cloneParam(LLWearable* wearable) const { LLTexLayerParamColor *new_param = new LLTexLayerParamColor(mTexLayer); *new_param = *this; diff --git a/indra/newview/lltexlayerparams.h b/indra/newview/lltexlayerparams.h index 589bd41054..98365864f9 100644 --- a/indra/newview/lltexlayerparams.h +++ b/indra/newview/lltexlayerparams.h @@ -43,8 +43,8 @@ class LLTexLayerParam : public LLViewerVisualParam public: LLTexLayerParam(LLTexLayerInterface *layer); LLTexLayerParam(LLVOAvatar *avatar); - /* Virtual */ BOOL setInfo(LLViewerVisualParamInfo *info, BOOL add_to_avatar ); - /*virtual*/ LLViewerVisualParam * cloneParam(LLWearable* wearable) const = 0; + /*virtual*/ BOOL setInfo(LLViewerVisualParamInfo *info, BOOL add_to_avatar ); + /*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const = 0; protected: LLTexLayerInterface* mTexLayer; @@ -61,7 +61,7 @@ public: LLTexLayerParamAlpha( LLVOAvatar* avatar ); /*virtual*/ ~LLTexLayerParamAlpha(); - /*virtual*/ LLViewerVisualParam * cloneParam(LLWearable* wearable = NULL) const; + /*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable = NULL) const; // LLVisualParam Virtual functions ///*virtual*/ BOOL parseData(LLXmlTreeNode* node); @@ -138,7 +138,7 @@ public: LLTexLayerParamColor( LLVOAvatar* avatar ); /* virtual */ ~LLTexLayerParamColor(); - /*virtual*/ LLViewerVisualParam * cloneParam(LLWearable* wearable = NULL) const; + /*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable = NULL) const; // LLVisualParam Virtual functions ///*virtual*/ BOOL parseData(LLXmlTreeNode* node); diff --git a/indra/newview/llviewervisualparam.h b/indra/newview/llviewervisualparam.h index 82a694e277..3550a46fbf 100644 --- a/indra/newview/llviewervisualparam.h +++ b/indra/newview/llviewervisualparam.h @@ -83,7 +83,7 @@ public: // This sets mInfo and calls initialization functions BOOL setInfo(LLViewerVisualParamInfo *info); - virtual LLViewerVisualParam * cloneParam(LLWearable* wearable) const = 0; + virtual LLViewerVisualParam* cloneParam(LLWearable* wearable) const = 0; // LLVisualParam Virtual functions ///*virtual*/ BOOL parseData(LLXmlTreeNode* node); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index d793ea0ea5..19dea5660b 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3978,32 +3978,32 @@ void LLVOAvatar::updateTextures(LLAgent &agent) mMaxPixelArea = 0.f; mMinPixelArea = 99999999.f; mHasGrey = FALSE; // debug - for (U32 texture = 0; texture < getNumTEs(); texture++) + for (U32 texture_index = 0; texture_index < getNumTEs(); texture_index++) { - EWearableType wearable_type = LLVOAvatarDictionary::getTEWearableType((ETextureIndex)texture); + EWearableType wearable_type = LLVOAvatarDictionary::getTEWearableType((ETextureIndex)texture_index); U32 num_wearables = gAgentWearables.getWearableCount(wearable_type); - const LLTextureEntry *te = getTE(texture); + const LLTextureEntry *te = getTE(texture_index); const F32 texel_area_ratio = fabs(te->mScaleS * te->mScaleT); LLViewerFetchedTexture *imagep = NULL; for (U32 wearable_index = 0; wearable_index < num_wearables; wearable_index++) { - imagep = LLViewerTextureManager::staticCastToFetchedTexture(getImage(texture, wearable_index), TRUE); + imagep = LLViewerTextureManager::staticCastToFetchedTexture(getImage(texture_index, wearable_index), TRUE); if (imagep) { - const LLVOAvatarDictionary::TextureEntry *texture_dict = LLVOAvatarDictionary::getInstance()->getTexture((ETextureIndex)texture); + const LLVOAvatarDictionary::TextureEntry *texture_dict = LLVOAvatarDictionary::getInstance()->getTexture((ETextureIndex)texture_index); const EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex; if (texture_dict->mIsLocalTexture) { - addLocalTextureStats((ETextureIndex)texture, imagep, texel_area_ratio, render_avatar, layer_baked[baked_index]); + addLocalTextureStats((ETextureIndex)texture_index, imagep, texel_area_ratio, render_avatar, layer_baked[baked_index]); } } } - if (isIndexBakedTexture((ETextureIndex) texture)) + if (isIndexBakedTexture((ETextureIndex) texture_index)) { const S32 boost_level = getAvatarBakedBoostLevel(); - imagep = LLViewerTextureManager::staticCastToFetchedTexture(getImage(texture,0), TRUE); + imagep = LLViewerTextureManager::staticCastToFetchedTexture(getImage(texture_index,0), TRUE); // Spam if this is a baked texture, not set to default image, without valid host info - if (isIndexBakedTexture((ETextureIndex)texture) + if (isIndexBakedTexture((ETextureIndex)texture_index) && imagep->getID() != IMG_DEFAULT_AVATAR && !imagep->getTargetHost().isOk()) { @@ -6028,7 +6028,7 @@ void LLVOAvatar::setLocalTexture( ETextureIndex type, LLViewerTexture* in_tex, B } //virtual -void LLVOAvatar::setBakedReady(LLVOAvatarDefines::ETextureIndex type, BOOL baked_version_exists, U32 index) +void LLVOAvatar::setBakedReady(LLVOAvatarDefines::ETextureIndex type, BOOL baked_version_exists, U32 index) { // invalid for anyone but self llassert(0); @@ -6793,7 +6793,7 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id ) local_tex_iter != baked_dict->mLocalTextures.end(); local_tex_iter++) { - this->setBakedReady(*local_tex_iter, TRUE); + setBakedReady(*local_tex_iter, TRUE); } // ! BACKWARDS COMPATIBILITY ! diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index 0b76d3e960..9e0fa87e1f 100644 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -198,8 +198,8 @@ protected: private: static void onLocalTextureLoaded(BOOL succcess, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata); - /*virtual*/ void setImage(const U8 te, LLViewerTexture *imagep, const U32 index); - /*virtual*/ LLViewerTexture* getImage(const U8 te, const U32 index) const; + /*virtual*/ void setImage(const U8 te, LLViewerTexture *imagep, const U32 index); + /*virtual*/ LLViewerTexture* getImage(const U8 te, const U32 index) const; //-------------------------------------------------------------------- @@ -220,7 +220,6 @@ protected: public: void requestLayerSetUploads(); void requestLayerSetUpdate(LLVOAvatarDefines::ETextureIndex i); -public: LLTexLayerSet* getLayerSet(LLVOAvatarDefines::ETextureIndex index) const; //-------------------------------------------------------------------- @@ -267,8 +266,8 @@ protected: **/ public: - /*virtual*/ BOOL isWearingWearableType(EWearableType type ) const; - void wearableUpdated(EWearableType type); + /*virtual*/ BOOL isWearingWearableType(EWearableType type ) const; + void wearableUpdated(EWearableType type); //-------------------------------------------------------------------- // Attachments diff --git a/indra/newview/llwearable.cpp b/indra/newview/llwearable.cpp index 09e8c522b0..84bb099d55 100644 --- a/indra/newview/llwearable.cpp +++ b/indra/newview/llwearable.cpp @@ -138,11 +138,12 @@ BOOL LLWearable::exportFile(LLFILE* file) const return FALSE; } - for (VisualParamIndexMap_t::const_iterator iter = mVisualParamIndexMap.begin(); - iter != mVisualParamIndexMap.end(); ++iter) + for (visual_param_index_map_t::const_iterator iter = mVisualParamIndexMap.begin(); + iter != mVisualParamIndexMap.end(); + ++iter) { S32 param_id = iter->first; - LLVisualParam* param = iter->second; + const LLVisualParam* param = iter->second; F32 param_weight = param->getWeight(); if( fprintf( file, "%d %s\n", param_id, terse_F32_to_string( param_weight ).c_str() ) < 0 ) { @@ -173,13 +174,13 @@ BOOL LLWearable::exportFile(LLFILE* file) const void LLWearable::createVisualParams() { LLVOAvatar* avatar = gAgent.getAvatarObject(); - for( LLViewerVisualParam* param = (LLViewerVisualParam*) avatar->getFirstVisualParam(); - param; - param = (LLViewerVisualParam*) avatar->getNextVisualParam() ) + for (LLViewerVisualParam* param = (LLViewerVisualParam*) avatar->getFirstVisualParam(); + param; + param = (LLViewerVisualParam*) avatar->getNextVisualParam()) { - if( (param->getWearableType() == mType) ) + if (param->getWearableType() == mType) { - if( mVisualParamIndexMap[param->getID()] ) + if (mVisualParamIndexMap[param->getID()]) { delete mVisualParamIndexMap[param->getID()]; } @@ -188,7 +189,9 @@ void LLWearable::createVisualParams() } // resync driver parameters to point to the newly cloned driven parameters - for( VisualParamIndexMap_t::iterator param_iter = mVisualParamIndexMap.begin(); param_iter != mVisualParamIndexMap.end(); param_iter++ ) + for (visual_param_index_map_t::iterator param_iter = mVisualParamIndexMap.begin(); + param_iter != mVisualParamIndexMap.end(); + ++param_iter) { LLVisualParam* param = param_iter->second; LLVisualParam*(LLWearable::*wearable_function)(S32)const = &LLWearable::getVisualParam; @@ -873,7 +876,7 @@ void LLWearable::setVisualParams() { LLVOAvatarSelf* avatar = gAgent.getAvatarObject(); - for (VisualParamIndexMap_t::const_iterator iter = mVisualParamIndexMap.begin(); iter != mVisualParamIndexMap.end(); iter++) + for (visual_param_index_map_t::const_iterator iter = mVisualParamIndexMap.begin(); iter != mVisualParamIndexMap.end(); iter++) { S32 id = iter->first; LLVisualParam *wearable_param = iter->second; @@ -912,15 +915,15 @@ F32 LLWearable::getVisualParamWeight(S32 param_index) const LLVisualParam* LLWearable::getVisualParam(S32 index) const { - VisualParamIndexMap_t::const_iterator iter = mVisualParamIndexMap.find(index); + visual_param_index_map_t::const_iterator iter = mVisualParamIndexMap.find(index); return (iter == mVisualParamIndexMap.end()) ? NULL : iter->second; } -void LLWearable::getVisualParams(visualParamCluster_t &list) +void LLWearable::getVisualParams(visual_param_vec_t &list) { - VisualParamIndexMap_t::iterator iter = mVisualParamIndexMap.begin(); - VisualParamIndexMap_t::iterator end = mVisualParamIndexMap.end(); + visual_param_index_map_t::iterator iter = mVisualParamIndexMap.begin(); + visual_param_index_map_t::iterator end = mVisualParamIndexMap.end(); // add all visual params to the passed-in vector for( ; iter != end; ++iter ) @@ -929,7 +932,7 @@ void LLWearable::getVisualParams(visualParamCluster_t &list) } } -LLColor4 LLWearable::getClothesColor(S32 te) +LLColor4 LLWearable::getClothesColor(S32 te) const { LLColor4 color; U32 param_name[3]; @@ -973,7 +976,7 @@ void LLWearable::revertValues() } } -BOOL LLWearable::isOnTop() +BOOL LLWearable::isOnTop() const { return (this == gAgentWearables.getTopWearable(mType)); } @@ -996,7 +999,7 @@ void LLWearable::saveValues() { //update saved settings so wearable is no longer dirty mSavedVisualParamMap.clear(); - for (VisualParamIndexMap_t::const_iterator iter = mVisualParamIndexMap.begin(); iter != mVisualParamIndexMap.end(); ++iter) + for (visual_param_index_map_t::const_iterator iter = mVisualParamIndexMap.begin(); iter != mVisualParamIndexMap.end(); ++iter) { S32 id = iter->first; LLVisualParam *wearable_param = iter->second; @@ -1174,7 +1177,7 @@ std::ostream& operator<<(std::ostream &s, const LLWearable &w) //w.mSaleInfo s << " Params:" << "\n"; - for (LLWearable::VisualParamIndexMap_t::const_iterator iter = w.mVisualParamIndexMap.begin(); + for (LLWearable::visual_param_index_map_t::const_iterator iter = w.mVisualParamIndexMap.begin(); iter != w.mVisualParamIndexMap.end(); ++iter) { S32 param_id = iter->first; diff --git a/indra/newview/llwearable.h b/indra/newview/llwearable.h index 201f4f91ef..01bd9652a5 100644 --- a/indra/newview/llwearable.h +++ b/indra/newview/llwearable.h @@ -84,7 +84,7 @@ public: LLLocalTextureObject* getLocalTextureObject(S32 index) const; public: - typedef std::vector<LLVisualParam*> visualParamCluster_t; + typedef std::vector<LLVisualParam*> visual_param_vec_t; BOOL isDirty() const; BOOL isOldVersion() const; @@ -118,19 +118,19 @@ public: void setVisualParamWeight(S32 index, F32 value, BOOL set_by_user); F32 getVisualParamWeight(S32 index) const; LLVisualParam* getVisualParam(S32 index) const; - void getVisualParams(visualParamCluster_t &list); + void getVisualParams(visual_param_vec_t &list); - LLColor4 getClothesColor(S32 te); + LLColor4 getClothesColor(S32 te) const; void setClothesColor( S32 te, const LLColor4& new_color, BOOL set_by_user ); void revertValues(); - BOOL isOnTop(); + BOOL isOnTop() const; private: typedef std::map<S32, LLLocalTextureObject*> te_map_t; - typedef std::map<S32, LLVisualParam *> VisualParamIndexMap_t; + typedef std::map<S32, LLVisualParam *> visual_param_index_map_t; void createLayers(S32 te); void createVisualParams(); @@ -151,7 +151,7 @@ private: typedef std::map<S32, F32> param_map_t; param_map_t mSavedVisualParamMap; // last saved version of visual params - VisualParamIndexMap_t mVisualParamIndexMap; + visual_param_index_map_t mVisualParamIndexMap; te_map_t mTEMap; // maps TE to LocalTextureObject te_map_t mSavedTEMap; // last saved version of TEMap |