diff options
author | Monroe Linden <monroe@lindenlab.com> | 2009-12-01 16:21:29 -0800 |
---|---|---|
committer | Monroe Linden <monroe@lindenlab.com> | 2009-12-01 16:21:29 -0800 |
commit | 37e701dba91985ddeaa4704d846f533331c95216 (patch) | |
tree | c415f0734c18ad71339afd02b01f752977c040ef /indra | |
parent | a0c133f819b7b6043e39a39a02310cd1fad67859 (diff) |
Fix for EXT-2836 (Changing texture on Media on a Prim face removes MoaP functionality).
LLVOVolume::regenFaces() (specifically the calls to facep->setTexture()) breaks associations between faces and LLViewerMediaTexture objects when called on a prim with playing media.
This change adds code which recreates the associations.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llvovolume.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 1ee0811ba6..367912f45e 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -1134,6 +1134,20 @@ void LLVOVolume::regenFaces() facep->setTEOffset(i); facep->setTexture(getTEImage(i)); facep->setViewerObject(this); + + // If the face had media on it, this will have broken the link between the LLViewerMediaTexture and the face. + // Re-establish the link. + if(mMediaImplList.size() > i) + { + if(mMediaImplList[i]) + { + LLViewerMediaTexture* media_tex = LLViewerTextureManager::findMediaTexture(mMediaImplList[i]->getMediaTextureID()) ; + if(media_tex) + { + media_tex->addMediaToFace(facep) ; + } + } + } } if (!count_changed) |