diff options
author | Xiaohong Bao <bao@lindenlab.com> | 2009-11-01 17:27:25 -0700 |
---|---|---|
committer | Xiaohong Bao <bao@lindenlab.com> | 2009-11-01 17:27:25 -0700 |
commit | 99d9712dd7f2a11a1094cba380f92e677710b56b (patch) | |
tree | c37d02e443682c8351e27eb6c03485ae9c96940d | |
parent | 4e1cde2e39cec8bca60faa65045a2055dd41efbf (diff) |
additional fix for DEV-41913: parcel media does not display on particle textures.
-rw-r--r-- | indra/newview/llface.cpp | 10 | ||||
-rw-r--r-- | indra/newview/llviewertexture.cpp | 37 | ||||
-rw-r--r-- | indra/newview/llviewertexture.h | 9 | ||||
-rw-r--r-- | indra/newview/llvopartgroup.cpp | 6 |
4 files changed, 25 insertions, 37 deletions
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 0276cd9a24..09b3ce1e86 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -278,16 +278,6 @@ void LLFace::setTexture(LLViewerTexture* tex) } mTexture = tex ; - - //check if this texture is replaced by a parcel media texture. - if(mTexture.notNull() && mTexture->hasParcelMedia()) - { - LLViewerMediaTexture* mediap = LLViewerTextureManager::findMediaTexture(mTexture->getID()) ; - if(mediap) - { - mediap->addMediaToFace(this) ; - } - } } void LLFace::dirtyTexture() diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 28ef128265..758bf8c1aa 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -416,7 +416,7 @@ void LLViewerTexture::init(bool firstinit) mDontDiscard = FALSE; mMaxVirtualSize = 0.f; mNeedsResetMaxVirtualSize = FALSE ; - mHasParcelMedia = FALSE ; + mParcelMedia = NULL ; } //virtual @@ -2148,6 +2148,12 @@ void LLViewerMediaTexture::updateClass() { static const F32 MAX_INACTIVE_TIME = 30.f ; +#if 0 + //force to play media. + gSavedSettings.setBOOL("AudioSteamingMedia", true) ; + gSavedSettings.setBOOL("AudioStreamingVideo", true) ; +#endif + for(media_map_t::iterator iter = sMediaMap.begin() ; iter != sMediaMap.end(); ) { LLViewerMediaTexture* mediap = iter->second; @@ -2221,17 +2227,17 @@ LLViewerMediaTexture::LLViewerMediaTexture(const LLUUID& id, BOOL usemipmaps, LL LLViewerTexture* tex = gTextureList.findImage(mID) ; if(tex) //this media is a parcel media for tex. { - tex->setParcelMedia(TRUE) ; - mParcelTexture = tex ; + tex->setParcelMedia(this) ; } } //virtual LLViewerMediaTexture::~LLViewerMediaTexture() { - if(mParcelTexture.notNull()) + LLViewerTexture* tex = gTextureList.findImage(mID) ; + if(tex) //this media is a parcel media for tex. { - mParcelTexture->setParcelMedia(FALSE) ; + tex->setParcelMedia(NULL) ; } } @@ -2283,21 +2289,11 @@ BOOL LLViewerMediaTexture::findFaces() mMediaFaceList.clear() ; BOOL ret = TRUE ; - - //for parcel media - if(mParcelTexture.isNull()) - { - LLViewerTexture* tex = gTextureList.findImage(mID) ; - if(tex) - { - tex->setParcelMedia(TRUE) ; - mParcelTexture = tex ; - } - } - if(mParcelTexture.notNull()) + LLViewerTexture* tex = gTextureList.findImage(mID) ; + if(tex) //this media is a parcel media for tex. { - const ll_face_list_t* face_list = mParcelTexture->getFaceList() ; + const ll_face_list_t* face_list = tex->getFaceList() ; for(ll_face_list_t::const_iterator iter = face_list->begin(); iter != face_list->end(); ++iter) { mMediaFaceList.push_back(*iter) ; @@ -2404,11 +2400,6 @@ void LLViewerMediaTexture::addFace(LLFace* facep) if(facep->getTexture() && facep->getTexture() != this && facep->getTexture()->getID() == mID) { mTextureList.push_back(facep->getTexture()) ; //a parcel media. - if(mParcelTexture.isNull()) - { - mParcelTexture = facep->getTexture() ; - mParcelTexture->setParcelMedia(TRUE) ; - } return ; } diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index ce8c47b878..020478beef 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -221,8 +221,9 @@ public: BOOL getDontDiscard() const { return mDontDiscard; } //----------------- - void setParcelMedia(BOOL has_media) {mHasParcelMedia = has_media;} - BOOL hasParcelMedia() const { return mHasParcelMedia ;} + void setParcelMedia(LLViewerMediaTexture* media) {mParcelMedia = media;} + BOOL hasParcelMedia() const { return mParcelMedia != NULL;} + LLViewerMediaTexture* getParcelMedia() const { return mParcelMedia;} /*virtual*/ void updateBindStatsForTester() ; protected: @@ -250,7 +251,8 @@ protected: LLPointer<LLImageGL> mGLTexturep ; S8 mDontDiscard; // Keep full res version of this image (for UI, etc) - BOOL mHasParcelMedia ; + //do not use LLPointer here. + LLViewerMediaTexture* mParcelMedia ; protected: typedef enum @@ -552,7 +554,6 @@ private: LLViewerMediaImpl* mMediaImplp ; BOOL mIsPlaying ; U32 mUpdateVirtualSizeTime ; - LLPointer< LLViewerTexture > mParcelTexture ; //the texture replaces this media texure when it is a parcel media texture. public: static void updateClass() ; diff --git a/indra/newview/llvopartgroup.cpp b/indra/newview/llvopartgroup.cpp index 7585842623..143cd2d9c6 100644 --- a/indra/newview/llvopartgroup.cpp +++ b/indra/newview/llvopartgroup.cpp @@ -249,6 +249,12 @@ BOOL LLVOPartGroup::updateGeometry(LLDrawable *drawable) facep->mCenterLocal = part->mPosAgent; facep->setFaceColor(part->mColor); facep->setTexture(part->mImagep); + + //check if this particle texture is replaced by a parcel media texture. + if(part->mImagep.notNull() && part->mImagep->hasParcelMedia()) + { + part->mImagep->getParcelMedia()->addMediaToFace(facep) ; + } mPixelArea = tot_area * pixel_meter_ratio; const F32 area_scale = 10.f; // scale area to increase priority a bit |