summaryrefslogtreecommitdiff
path: root/indra/newview/llviewertexture.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewertexture.cpp')
-rw-r--r--indra/newview/llviewertexture.cpp37
1 files changed, 33 insertions, 4 deletions
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index 32cf8cc1b3..96d7890a9e 100644
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -624,6 +624,7 @@ LLViewerTexture::~LLViewerTexture()
void LLViewerTexture::init(bool firstinit)
{
mBoostLevel = LLViewerTexture::BOOST_NONE;
+ mSelectedTime = 0.f;
mFullWidth = 0;
mFullHeight = 0;
@@ -679,11 +680,18 @@ void LLViewerTexture::setBoostLevel(S32 level)
if(mBoostLevel != level)
{
mBoostLevel = level ;
- if(mBoostLevel != LLViewerTexture::BOOST_NONE)
+ if(mBoostLevel != LLViewerTexture::BOOST_NONE &&
+ mBoostLevel != LLViewerTexture::BOOST_SELECTED)
{
setNoDelete() ;
}
}
+
+ if (mBoostLevel == LLViewerTexture::BOOST_SELECTED)
+ {
+ mSelectedTime = gFrameTimeSeconds;
+ }
+
}
@@ -1904,13 +1912,34 @@ void LLViewerFetchedTexture::updateVirtualSize()
for(U32 i = 0 ; i < mNumFaces ; i++)
{
LLFace* facep = mFaceList[i] ;
- if( facep && facep->getDrawable() && facep->getDrawable()->isRecentlyVisible())
+ if( facep )
{
- addTextureStats(facep->getVirtualSize()) ;
- setAdditionalDecodePriority(facep->getImportanceToCamera()) ;
+ LLDrawable* drawable = facep->getDrawable();
+ if (drawable)
+ {
+ if(drawable->isRecentlyVisible())
+ {
+ if (getBoostLevel() == LLViewerTexture::BOOST_NONE &&
+ drawable->getVObj() && drawable->getVObj()->isSelected())
+ {
+ setBoostLevel(LLViewerTexture::BOOST_SELECTED);
+ }
+ addTextureStats(facep->getVirtualSize()) ;
+ setAdditionalDecodePriority(facep->getImportanceToCamera()) ;
+ }
+ }
}
}
+ //reset whether or not a face was selected after 10 seconds
+ const F32 SELECTION_RESET_TIME = 10.f;
+
+ if (getBoostLevel() == LLViewerTexture::BOOST_SELECTED &&
+ gFrameTimeSeconds - mSelectedTime > SELECTION_RESET_TIME)
+ {
+ setBoostLevel(LLViewerTexture::BOOST_NONE);
+ }
+
if(mMaxVirtualSizeResetCounter > 0)
{
mMaxVirtualSizeResetCounter--;