summaryrefslogtreecommitdiff
path: root/indra/newview/llface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llface.cpp')
-rw-r--r--indra/newview/llface.cpp22
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;