summaryrefslogtreecommitdiff
path: root/indra/llprimitive/llprimitive.cpp
diff options
context:
space:
mode:
authorsimon@Simon-PC.lindenlab.com <simon@Simon-PC.lindenlab.com>2012-09-05 17:17:54 -0700
committersimon@Simon-PC.lindenlab.com <simon@Simon-PC.lindenlab.com>2012-09-05 17:17:54 -0700
commit38acb45af804968a3a75e220b45ea4b1ef489633 (patch)
tree6ea9e4237149abef95a4bc550f46dacd65d98539 /indra/llprimitive/llprimitive.cpp
parent608fa855b3e8d647d22e586218a4fc12277c387e (diff)
parente3b4b3875a6d8c7857ba948a662ace4731913ecf (diff)
Merge in latest viewer-development
Diffstat (limited to 'indra/llprimitive/llprimitive.cpp')
-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 9572378b46..946251f383 100644
--- a/indra/llprimitive/llprimitive.cpp
+++ b/indra/llprimitive/llprimitive.cpp
@@ -148,7 +148,8 @@ bool LLPrimitive::cleanupVolumeManager()
LLPrimitive::LLPrimitive()
: mTextureList(),
mNumTEs(0),
- mMiscFlags(0)
+ mMiscFlags(0),
+ mNumBumpmapTEs(0)
{
mPrimitiveCode = 0;
@@ -234,7 +235,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)
@@ -313,6 +317,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);
}
@@ -323,11 +328,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);
}
@@ -1441,6 +1448,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