diff options
author | prep <prep@lindenlab.com> | 2012-11-28 16:36:34 -0500 |
---|---|---|
committer | prep <prep@lindenlab.com> | 2012-11-28 16:36:34 -0500 |
commit | e0432f98ee515f9777604aa784d28b63d2abfe40 (patch) | |
tree | 398fcae43d9904bde2112a7085c7ef7c1a926100 /indra/newview/llviewertexture.cpp | |
parent | bf87920fc91e2ca2b8d9f6f2656ad632c3005164 (diff) | |
parent | f5a47417fde70f78b99744386c6da0bcf78e60d5 (diff) |
SH-3563. Pull and merge from viewer-development. Modest code changes to fix alignment issue in llAppearance.
Diffstat (limited to 'indra/newview/llviewertexture.cpp')
-rwxr-xr-x | indra/newview/llviewertexture.cpp | 46 |
1 files changed, 43 insertions, 3 deletions
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 37f2fd3520..846216211e 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -623,6 +623,7 @@ LLViewerTexture::~LLViewerTexture() // virtual void LLViewerTexture::init(bool firstinit) { + mSelectedTime = 0.f; mMaxVirtualSize = 0.f; mMaxVirtualSizeResetInterval = 1; mMaxVirtualSizeResetCounter = mMaxVirtualSizeResetInterval ; @@ -656,6 +657,24 @@ void LLViewerTexture::dump() << llendl; } +void LLViewerTexture::setBoostLevel(S32 level) +{ + if(mBoostLevel != level) + { + mBoostLevel = level ; + if(mBoostLevel != LLViewerTexture::BOOST_NONE && + mBoostLevel != LLViewerTexture::BOOST_SELECTED) + { + setNoDelete() ; + } + } + + if (mBoostLevel == LLViewerTexture::BOOST_SELECTED) + { + mSelectedTime = gFrameTimeSeconds; + } +} + bool LLViewerTexture::bindDefaultImage(S32 stage) { if (stage < 0) return false; @@ -1597,13 +1616,34 @@ void LLViewerFetchedTexture::updateVirtualSize() for(U32 i = 0 ; i < mNumFaces ; i++) { LLFace* facep = mFaceList[i] ; - if(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--; |