diff options
author | Mark Palange (Mani) <palange@lindenlab.com> | 2009-10-02 10:35:42 -0700 |
---|---|---|
committer | Mark Palange (Mani) <palange@lindenlab.com> | 2009-10-02 10:35:42 -0700 |
commit | 4d53e235c2445b820bb0ae7303b269648dd86037 (patch) | |
tree | c1ab3643cf257099822e7a0e1e832d76813555f6 /indra/newview/llface.cpp | |
parent | 80f27013b2d2a7ca6509db033c8f0c31562e04c7 (diff) | |
parent | dde2153014cd7d7b8fa704f7067a41344bfbb1c2 (diff) |
merge of latest viewer/viewer-20
Diffstat (limited to 'indra/newview/llface.cpp')
-rw-r--r-- | indra/newview/llface.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index fc5b27dd1b..a5b0b05603 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -270,16 +270,34 @@ void LLFace::setTexture(LLViewerTexture* tex) { mTexture->removeFace(this) ; removeAtlas() ; - } + } mTexture = tex ; - + if(mTexture.notNull()) { mTexture->addFace(this) ; } } +void LLFace::switchTexture(LLViewerTexture* new_texture) +{ + if(mTexture == new_texture) + { + return ; + } + + if(!new_texture) + { + llerrs << "Can not switch to a null texture." << llendl ; + } + new_texture->addTextureStats(mTexture->getMaxVirtualSize()) ; + + getViewerObject()->changeTEImage(mTEOffset, new_texture) ; + setTexture(new_texture) ; + gPipeline.markTextured(getDrawable()); +} + void LLFace::setTEOffset(const S32 te_offset) { mTEOffset = te_offset; |