From 5164ed388c1e328cb80dec304ba2fd249ef662f4 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Wed, 21 Oct 2009 21:37:27 +0000 Subject: Code audit for r136515 ("merging in new wearable infrastructure...") No expected functionality change; this mostly contains cosmetic cleanup. Reviewed by: Nyx --- indra/newview/llwearable.cpp | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) (limited to 'indra/newview/llwearable.cpp') 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; -- cgit v1.2.3 From ef97fc146c3b1ca775c818b8beabb6d37e1b33b4 Mon Sep 17 00:00:00 2001 From: Steven Bennetts Date: Thu, 22 Oct 2009 02:16:58 +0000 Subject: Fix for Mac build. --- indra/newview/llwearable.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'indra/newview/llwearable.cpp') diff --git a/indra/newview/llwearable.cpp b/indra/newview/llwearable.cpp index 84bb099d55..631f128ffa 100644 --- a/indra/newview/llwearable.cpp +++ b/indra/newview/llwearable.cpp @@ -407,9 +407,10 @@ BOOL LLWearable::importFile( LLFILE* file ) { delete mSavedTEMap[te]; } - - mTEMap[te] = new LLLocalTextureObject(image, LLUUID(text_buffer)); - mSavedTEMap[te] = new LLLocalTextureObject(image, LLUUID(text_buffer)); + + LLUUID textureid(text_buffer); + mTEMap[te] = new LLLocalTextureObject(image, textureid); + mSavedTEMap[te] = new LLLocalTextureObject(image, textureid); createLayers(te); } -- cgit v1.2.3 From 4c4da8aca2944c2992d4ae0e13e72b9c6c0aa84f Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Thu, 22 Oct 2009 12:22:06 +0100 Subject: Fix the Mac and Linux build after llwearable breakage. Needed to add an explicit include for LLViewerFetchedTexture because it's used for a template specialization, and fixed LLLocalTextureObject constructor to take a const LLUUID reference so locals can be passed. --- indra/newview/llwearable.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llwearable.cpp') diff --git a/indra/newview/llwearable.cpp b/indra/newview/llwearable.cpp index 84bb099d55..d1ad89442c 100644 --- a/indra/newview/llwearable.cpp +++ b/indra/newview/llwearable.cpp @@ -35,6 +35,7 @@ #include "llagent.h" #include "llagentwearables.h" #include "llfloatercustomize.h" +#include "lllocaltextureobject.h" #include "llviewertexturelist.h" #include "llinventorymodel.h" #include "llviewerregion.h" -- cgit v1.2.3 From 4e6fd496eef05d3ab59f3f35878be601b18350f0 Mon Sep 17 00:00:00 2001 From: Neal Orman Date: Thu, 22 Oct 2009 22:25:38 +0000 Subject: EXT-1822 changing textures in appearance not immediate Texture changes in appearance editor were not taking effect immediately. Changed texture setting code to refresh local bake of textures. Code reviewed by Vir --- indra/newview/llwearable.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llwearable.cpp') diff --git a/indra/newview/llwearable.cpp b/indra/newview/llwearable.cpp index 631f128ffa..3bbf4c2c47 100644 --- a/indra/newview/llwearable.cpp +++ b/indra/newview/llwearable.cpp @@ -537,6 +537,7 @@ BOOL LLWearable::isDirty() const const LLUUID& saved_image_id = saved_iter->second->getID(); if (saved_image_id != current_image_id) { + // saved vs current images are different, wearable is dirty return TRUE; } } -- cgit v1.2.3