diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2009-12-03 09:17:51 -0800 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2009-12-03 09:17:51 -0800 |
commit | 5fd2938da8d6709a6596833088fd83c60d591507 (patch) | |
tree | 9186f79b996eb60a9bb1f5cefada86c0596ac850 /indra/newview/llvovolume.cpp | |
parent | 97f97f286ccca1f736c575f516a61c6a32787807 (diff) | |
parent | 57b68d9bfe25fc7b9efe41a9fa30935c156acb34 (diff) |
Merge with recent viewer-2-0
Diffstat (limited to 'indra/newview/llvovolume.cpp')
-rw-r--r-- | indra/newview/llvovolume.cpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 48bd387022..cf61994fea 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -622,6 +622,7 @@ void LLVOVolume::updateTextureVirtualSize() const S32 num_faces = mDrawable->getNumFaces(); F32 min_vsize=999999999.f, max_vsize=0.f; + LLViewerCamera* camera = LLViewerCamera::getInstance(); for (S32 i = 0; i < num_faces; i++) { LLFace* face = mDrawable->getFace(i); @@ -638,7 +639,7 @@ void LLVOVolume::updateTextureVirtualSize() if (isHUDAttachment()) { - F32 area = (F32) LLViewerCamera::getInstance()->getScreenPixelArea(); + F32 area = (F32) camera->getScreenPixelArea(); vsize = area; imagep->setBoostLevel(LLViewerTexture::BOOST_HUD); face->setPixelArea(area); // treat as full screen @@ -704,9 +705,9 @@ void LLVOVolume::updateTextureVirtualSize() //if the sculpty very close to the view point, load first { - LLVector3 lookAt = getPositionAgent() - LLViewerCamera::getInstance()->getOrigin(); + LLVector3 lookAt = getPositionAgent() - camera->getOrigin(); F32 dist = lookAt.normVec() ; - F32 cos_angle_to_view_dir = lookAt * LLViewerCamera::getInstance()->getXAxis() ; + F32 cos_angle_to_view_dir = lookAt * camera->getXAxis() ; mSculptTexture->setAdditionalDecodePriority(0.8f * LLFace::calcImportanceToCamera(cos_angle_to_view_dir, dist)) ; } } @@ -741,7 +742,7 @@ void LLVOVolume::updateTextureVirtualSize() F32 rad = getLightRadius(); mLightTexture->addTextureStats(gPipeline.calcPixelArea(getPositionAgent(), LLVector3(rad,rad,rad), - *LLViewerCamera::getInstance())); + *camera)); } } @@ -1133,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((int)mMediaImplList.size() > i) + { + if(mMediaImplList[i]) + { + LLViewerMediaTexture* media_tex = LLViewerTextureManager::findMediaTexture(mMediaImplList[i]->getMediaTextureID()) ; + if(media_tex) + { + media_tex->addMediaToFace(facep) ; + } + } + } } if (!count_changed) |