summaryrefslogtreecommitdiff
path: root/indra/newview/llvosky.cpp
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2018-10-01 17:13:27 -0700
committerRider Linden <rider@lindenlab.com>2018-10-01 17:13:27 -0700
commitc6e414009a824ce9b0600af6d3c8c1739f58a142 (patch)
tree6f32081cf89500e8bf42814cf5fbdf777d762b01 /indra/newview/llvosky.cpp
parent83c2692ffcde2409ed983cb82a1b4d3fc759f72b (diff)
parentc6b4b81bf2ceac0d5152c15ba86af09bb4dca183 (diff)
Merge
Diffstat (limited to 'indra/newview/llvosky.cpp')
-rw-r--r--indra/newview/llvosky.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp
index c6267d50ff..a42239ec87 100644
--- a/indra/newview/llvosky.cpp
+++ b/indra/newview/llvosky.cpp
@@ -874,8 +874,22 @@ void LLVOSky::setSunTextures(const LLUUID& sun_texture, const LLUUID& sun_textur
{
mSunTexturep[0]->setAddressMode(LLTexUnit::TAM_CLAMP);
}
+
+ LLViewerTexture* current_tex0 = mFace[FACE_SUN]->getTexture(LLRender::DIFFUSE_MAP);
+ LLViewerTexture* current_tex1 = mFace[FACE_SUN]->getTexture(LLRender::ALTERNATE_DIFFUSE_MAP);
+
+ if (current_tex0 && (mSunTexturep[0] != current_tex0) && current_tex0->isViewerMediaTexture())
+ {
+ static_cast<LLViewerMediaTexture*>(current_tex0)->removeMediaFromFace(mFace[FACE_SUN]);
+ }
+
+ if (current_tex1 && (mSunTexturep[1] != current_tex1) && current_tex1->isViewerMediaTexture())
+ {
+ static_cast<LLViewerMediaTexture*>(current_tex1)->removeMediaFromFace(mFace[FACE_SUN]);
+ }
+
mFace[FACE_SUN]->setTexture(LLRender::DIFFUSE_MAP, mSunTexturep[0]);
-
+
if (mSunTexturep[1])
{
mSunTexturep[1]->setAddressMode(LLTexUnit::TAM_CLAMP);