summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerobject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewerobject.cpp')
-rwxr-xr-xindra/newview/llviewerobject.cpp31
1 files changed, 27 insertions, 4 deletions
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index 394b11b759..dd80a4f65d 100755
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -206,7 +206,8 @@ LLViewerObject *LLViewerObject::createObject(const LLUUID &id, const LLPCode pco
}
LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp, BOOL is_global)
-: LLPrimitive(),
+: LLTrace::MemTrackable<LLViewerObject>("LLViewerObject"),
+ LLPrimitive(),
mChildList(),
mID(id),
mLocalID(0),
@@ -4632,12 +4633,10 @@ S32 LLViewerObject::setTEMaterialParams(const U8 te, const LLMaterialPtr pMateri
void LLViewerObject::refreshMaterials()
{
- setChanged(ALL_CHANGED);
+ setChanged(TEXTURE);
if (mDrawable.notNull())
{
gPipeline.markTextured(mDrawable);
- gPipeline.markRebuild(mDrawable,LLDrawable::REBUILD_ALL);
- dirtySpatialGroup(TRUE);
}
}
@@ -4741,6 +4740,30 @@ LLViewerTexture *LLViewerObject::getTEImage(const U8 face) const
}
+bool LLViewerObject::isImageAlphaBlended(const U8 te) const
+{
+ LLViewerTexture* image = getTEImage(te);
+ LLGLenum format = image ? image->getPrimaryFormat() : GL_RGB;
+ switch (format)
+ {
+ case GL_RGBA:
+ case GL_ALPHA:
+ {
+ return true;
+ }
+ break;
+
+ case GL_RGB: break;
+ default:
+ {
+ llwarns << "Unexpected tex format in LLViewerObject::isImageAlphaBlended...returning no alpha." << llendl;
+ }
+ break;
+ }
+
+ return false;
+}
+
LLViewerTexture *LLViewerObject::getTENormalMap(const U8 face) const
{
// llassert(mTEImages);