summaryrefslogtreecommitdiff
path: root/indra/newview/lltexlayer.cpp
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-03-11 09:19:20 +0000
committerTofu Linden <tofu.linden@lindenlab.com>2010-03-11 09:19:20 +0000
commit1b1dd127a4329cc7fed9d36608f4fc04ff056843 (patch)
tree7c998ab7f4037aee8446817293bedafffd7958c2 /indra/newview/lltexlayer.cpp
parent6d738f25d9be0f4b576c8a55e9091ced589daf71 (diff)
parenta618a3913af506878adf59a2c5b5fb12e665e35b (diff)
merge.
Diffstat (limited to 'indra/newview/lltexlayer.cpp')
-rw-r--r--indra/newview/lltexlayer.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/indra/newview/lltexlayer.cpp b/indra/newview/lltexlayer.cpp
index 662e6dcabe..386b636367 100644
--- a/indra/newview/lltexlayer.cpp
+++ b/indra/newview/lltexlayer.cpp
@@ -1130,7 +1130,8 @@ LLTexLayerInterface::LLTexLayerInterface(LLTexLayerSet* const layer_set):
}
LLTexLayerInterface::LLTexLayerInterface(const LLTexLayerInterface &layer, LLWearable *wearable):
- mTexLayerSet( layer.mTexLayerSet )
+ mTexLayerSet( layer.mTexLayerSet ),
+ mInfo(NULL)
{
// don't add visual params for cloned layers
setInfo(layer.getInfo(), wearable);
@@ -1140,11 +1141,12 @@ LLTexLayerInterface::LLTexLayerInterface(const LLTexLayerInterface &layer, LLWea
BOOL LLTexLayerInterface::setInfo(const LLTexLayerInfo *info, LLWearable* wearable ) // This sets mInfo and calls initialization functions
{
- //llassert(mInfo == NULL); // nyx says this is probably bogus but needs investigating
- if (mInfo != NULL) // above llassert(), but softened into a warning
- {
- llwarns << "BAD STUFF! mInfo != NULL" << llendl;
- }
+ // setInfo should only be called once. Code is not robust enough to handle redefinition of a texlayer.
+ // Not a critical warning, but could be useful for debugging later issues. -Nyx
+ if (mInfo != NULL)
+ {
+ llwarns << "mInfo != NULL" << llendl;
+ }
mInfo = info;
//mID = info->mID; // No ID
@@ -1881,6 +1883,11 @@ LLTexLayer* LLTexLayerTemplate::getLayer(U32 i)
/*virtual*/ BOOL LLTexLayerTemplate::render(S32 x, S32 y, S32 width, S32 height)
{
+ if(!mInfo)
+ {
+ return FALSE ;
+ }
+
BOOL success = TRUE;
updateWearableCache();
for (wearable_cache_t::const_iterator iter = mWearableCache.begin(); iter!= mWearableCache.end(); iter++)