diff options
author | Graham Linden <graham@lindenlab.com> | 2018-10-02 00:57:32 +0100 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2018-10-02 00:57:32 +0100 |
commit | b4d6611ea7e5f3dfe01e7c7f7dae9c5b2c2347b8 (patch) | |
tree | f2304ff568bf7f8c9a574530a477bf864cb877c6 /indra/newview/llvosky.cpp | |
parent | c98522a40ec6855a11a781301fca7a3943ba5a25 (diff) |
SL-9775
Add LLPointer<> on stack to avoid textures being deleted out from under the sky code.
Make textures used by sky settings remove their faces from media textures.
Add ability to detect when a given texture is viewer media with vfunc.
Diffstat (limited to 'indra/newview/llvosky.cpp')
-rw-r--r-- | indra/newview/llvosky.cpp | 16 |
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); |