summaryrefslogtreecommitdiff
path: root/indra/llprimitive/llprimitive.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2012-07-30 14:57:33 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2012-07-30 14:57:33 -0400
commita5c9d89b28d74c1996a0c950a0c8b1484b43d243 (patch)
treeafd2dc64d86c69390fe2f482870fae0b097b768a /indra/llprimitive/llprimitive.cpp
parent0f3c5e6458acdf1676f0b7a6dc42ed8cfa286cb0 (diff)
parentd306cb059b9b56c1eb051074e19796b47e1c262d (diff)
merge
Diffstat (limited to 'indra/llprimitive/llprimitive.cpp')
-rwxr-xr-x[-rw-r--r--]indra/llprimitive/llprimitive.cpp31
1 files changed, 29 insertions, 2 deletions
diff --git a/indra/llprimitive/llprimitive.cpp b/indra/llprimitive/llprimitive.cpp
index 30532247ac..6dee192783 100644..100755
--- a/indra/llprimitive/llprimitive.cpp
+++ b/indra/llprimitive/llprimitive.cpp
@@ -149,7 +149,8 @@ bool LLPrimitive::cleanupVolumeManager()
LLPrimitive::LLPrimitive()
: mTextureList(),
mNumTEs(0),
- mMiscFlags(0)
+ mMiscFlags(0),
+ mNumBumpmapTEs(0)
{
mPrimitiveCode = 0;
@@ -237,7 +238,10 @@ void LLPrimitive::setAllTETextures(const LLUUID &tex_id)
//===============================================================
void LLPrimitive::setTE(const U8 index, const LLTextureEntry& te)
{
- mTextureList.copyTexture(index, te);
+ if(mTextureList.copyTexture(index, te) != TEM_CHANGE_NONE && te.getBumpmap() > 0)
+ {
+ mNumBumpmapTEs++;
+ }
}
S32 LLPrimitive::setTETexture(const U8 index, const LLUUID &id)
@@ -316,6 +320,7 @@ S32 LLPrimitive::setTERotation(const U8 index, const F32 r)
//===============================================================
S32 LLPrimitive::setTEBumpShinyFullbright(const U8 index, const U8 bump)
{
+ updateNumBumpmap(index, bump);
return mTextureList.setBumpShinyFullbright(index, bump);
}
@@ -326,11 +331,13 @@ S32 LLPrimitive::setTEMediaTexGen(const U8 index, const U8 media)
S32 LLPrimitive::setTEBumpmap(const U8 index, const U8 bump)
{
+ updateNumBumpmap(index, bump);
return mTextureList.setBumpMap(index, bump);
}
S32 LLPrimitive::setTEBumpShiny(const U8 index, const U8 bump_shiny)
{
+ updateNumBumpmap(index, bump_shiny);
return mTextureList.setBumpShiny(index, bump_shiny);
}
@@ -1445,6 +1452,26 @@ void LLPrimitive::takeTextureList(LLPrimTextureList& other_list)
mTextureList.take(other_list);
}
+void LLPrimitive::updateNumBumpmap(const U8 index, const U8 bump)
+{
+ LLTextureEntry* te = getTE(index);
+ if(!te)
+ {
+ return;
+ }
+
+ U8 old_bump = te->getBumpmap();
+ if(old_bump > 0)
+ {
+ mNumBumpmapTEs--;
+ }
+ if((bump & TEM_BUMP_MASK) > 0)
+ {
+ mNumBumpmapTEs++;
+ }
+
+ return;
+}
//============================================================================
// Moved from llselectmgr.cpp