diff options
| author | Monroe Williams <monroe@lindenlab.com> | 2009-10-01 02:35:53 +0000 |
|---|---|---|
| committer | Monroe Williams <monroe@lindenlab.com> | 2009-10-01 02:35:53 +0000 |
| commit | cf9239cabcf7999a2d2393bd4bdb6fc08e27c09c (patch) | |
| tree | b366355f955b7bf55197ef6caa105881da88df32 /indra/newview/llface.cpp | |
| parent | 8135ddac021d3ea1aba2100f862bdb58eff33d07 (diff) | |
svn merge -r 134922:134973 svn+ssh://svn.lindenlab.com/svn/linden/branches/media-on-a-prim/moap-7
Merging branches/media-on-a-prim/moap-7 down to viewer-2.0.
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; |
