diff options
author | Neal Orman <nyx@lindenlab.com> | 2009-10-16 17:56:30 +0000 |
---|---|---|
committer | Neal Orman <nyx@lindenlab.com> | 2009-10-16 17:56:30 +0000 |
commit | d08b0b6ae8bcd452a3d707ac153107d0f1523df8 (patch) | |
tree | 3caac3468a18b105e5aa5eb53cd13ed416c1a48d /indra/newview/lltexlayerparams.cpp | |
parent | 087897b1f837872fc02822595e5dd47fabf3b7e8 (diff) |
merging in new wearable infrastructure to get a step closer to eventually supporting multiple wearables per type. Merge tested and compiles/working on linux and windows - no obvious regressions on appearance or appearance editor. Merge generated no conflicts due to being tested in fresh re-branch in avatar-pipeline/multiple-textures-12. Merge perfomed with following command:
svn merge -r 136489:136510 svn+ssh://svn.lindenlab.com/svn/linden/branches/avatar-pipeline/multiple-textures-12 .
Progress can be tracked in DEV-32551.
-Nyx
Diffstat (limited to 'indra/newview/lltexlayerparams.cpp')
-rw-r--r-- | indra/newview/lltexlayerparams.cpp | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/indra/newview/lltexlayerparams.cpp b/indra/newview/lltexlayerparams.cpp index 7a1ee95a65..9cd73c4656 100644 --- a/indra/newview/lltexlayerparams.cpp +++ b/indra/newview/lltexlayerparams.cpp @@ -33,13 +33,14 @@ #include "llagent.h" #include "lltexlayer.h" #include "llvoavatarself.h" +#include "llwearable.h" #include "lltexlayerparams.h" #include "llui.h" //----------------------------------------------------------------------------- // LLTexLayerParam //----------------------------------------------------------------------------- -LLTexLayerParam::LLTexLayerParam(LLTexLayer *layer) : +LLTexLayerParam::LLTexLayerParam(LLTexLayerInterface *layer) : mTexLayer(layer), mAvatar(NULL) { @@ -47,6 +48,10 @@ LLTexLayerParam::LLTexLayerParam(LLTexLayer *layer) : { mAvatar = mTexLayer->getTexLayerSet()->getAvatar(); } + else + { + llerrs << "LLTexLayerParam constructor passed with NULL reference for layer!" << llendl; + } } LLTexLayerParam::LLTexLayerParam(LLVOAvatar *avatar) : @@ -56,15 +61,19 @@ LLTexLayerParam::LLTexLayerParam(LLVOAvatar *avatar) : } -BOOL LLTexLayerParam::setInfo(LLViewerVisualParamInfo *info) +BOOL LLTexLayerParam::setInfo(LLViewerVisualParamInfo *info, BOOL add_to_avatar ) { LLViewerVisualParam::setInfo(info); - mAvatar->addVisualParam( this); + + if (add_to_avatar) + { + mAvatar->addVisualParam( this); + } + return TRUE; } - //----------------------------------------------------------------------------- // LLTexLayerParamAlpha //----------------------------------------------------------------------------- @@ -102,7 +111,7 @@ void LLTexLayerParamAlpha::getCacheByteCount(S32* gl_bytes) } } -LLTexLayerParamAlpha::LLTexLayerParamAlpha(LLTexLayer* layer) : +LLTexLayerParamAlpha::LLTexLayerParamAlpha(LLTexLayerInterface* layer) : LLTexLayerParam(layer), mCachedProcessedTexture(NULL), mNeedsCreateTexture(FALSE), @@ -131,6 +140,13 @@ LLTexLayerParamAlpha::~LLTexLayerParamAlpha() sInstances.remove(this); } +/*virtual*/ LLViewerVisualParam * LLTexLayerParamAlpha::cloneParam(LLWearable* wearable) const +{ + LLTexLayerParamAlpha *new_param = new LLTexLayerParamAlpha(mTexLayer); + *new_param = *this; + return new_param; +} + void LLTexLayerParamAlpha::deleteCaches() { mStaticImageTGA = NULL; // deletes image @@ -313,7 +329,7 @@ BOOL LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height) // Don't keep the cache for other people's avatars // (It's not really a "cache" in that case, but the logic is the same) - if (mAvatar->isSelf()) + if (!mAvatar->isSelf()) { mCachedProcessedTexture = NULL; } @@ -377,7 +393,7 @@ BOOL LLTexLayerParamAlphaInfo::parseXml(LLXmlTreeNode* node) -LLTexLayerParamColor::LLTexLayerParamColor(LLTexLayer* layer) : +LLTexLayerParamColor::LLTexLayerParamColor(LLTexLayerInterface* layer) : LLTexLayerParam(layer), mAvgDistortionVec(1.f, 1.f, 1.f) { @@ -393,6 +409,13 @@ LLTexLayerParamColor::~LLTexLayerParamColor() { } +/*virtual*/ LLViewerVisualParam * LLTexLayerParamColor::cloneParam(LLWearable* wearable) const +{ + LLTexLayerParamColor *new_param = new LLTexLayerParamColor(mTexLayer); + *new_param = *this; + return new_param; +} + LLColor4 LLTexLayerParamColor::getNetColor() const { const LLTexLayerParamColorInfo *info = (LLTexLayerParamColorInfo *)getInfo(); |