diff options
author | Rider Linden <rider@lindenlab.com> | 2018-10-02 00:12:47 +0000 |
---|---|---|
committer | Rider Linden <rider@lindenlab.com> | 2018-10-02 00:12:47 +0000 |
commit | c6b4b81bf2ceac0d5152c15ba86af09bb4dca183 (patch) | |
tree | c129cb4009e9990495e4651a5417a14b4e658676 /indra | |
parent | fdfb60ecb10a35efdc378ae507e1c65114a987a3 (diff) | |
parent | b4d6611ea7e5f3dfe01e7c7f7dae9c5b2c2347b8 (diff) |
Merged in graham_linden/viewer-eep-graham (pull request #123)
SL-9775
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/lldrawpoolwlsky.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llviewertexture.h | 4 | ||||
-rw-r--r-- | indra/newview/llvosky.cpp | 16 |
3 files changed, 21 insertions, 3 deletions
diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp index a796052635..5104dc18fd 100644 --- a/indra/newview/lldrawpoolwlsky.cpp +++ b/indra/newview/lldrawpoolwlsky.cpp @@ -392,8 +392,8 @@ void LLDrawPoolWLSky::renderHeavenlyBodies() if (gSky.mVOSkyp->getSun().getDraw() && face && face->getGeomCount()) { - LLViewerTexture* tex_a = face->getTexture(LLRender::DIFFUSE_MAP); - LLViewerTexture* tex_b = face->getTexture(LLRender::ALTERNATE_DIFFUSE_MAP); + LLPointer<LLViewerTexture> tex_a = face->getTexture(LLRender::DIFFUSE_MAP); + LLPointer<LLViewerTexture> tex_b = face->getTexture(LLRender::ALTERNATE_DIFFUSE_MAP); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); gGL.getTexUnit(1)->unbind(LLTexUnit::TT_TEXTURE); diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 7b58c97bc4..022f937619 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -125,6 +125,8 @@ public: virtual BOOL isMissingAsset() const ; virtual void dump(); // debug info to LL_INFOS() + virtual BOOL isViewerMediaTexture() const { return false; } + /*virtual*/ bool bindDefaultImage(const S32 stage = 0) ; /*virtual*/ bool bindDebugImage(const S32 stage = 0) ; /*virtual*/ void forceImmediateUpdate() ; @@ -576,6 +578,8 @@ public: BOOL isPlaying() const {return mIsPlaying;} void setMediaImpl() ; + virtual BOOL isViewerMediaTexture() const { return true; } + void initVirtualSize() ; void invalidateMediaImpl() ; 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); |