Add restore to mBoostLevel (mPrevBoostLevel) for BOOST_SELECTED interactions

Added to the llgltexture a second boost level which will be used to properly restore the boost level after an object is right clicked on as the BOOST_SELECTED code does not restore the value the previous value. This does now and on all the child objects assigned to the object.

Also fixed up the lltextureview.cpp as it had some merge issues from a long time ago and was missed.
meow-7.2.2
minerjr 2025-02-21 09:45:34 -04:00
parent fe41087069
commit 8a527d676e
5 changed files with 55 additions and 8 deletions

View File

@ -63,6 +63,10 @@ LLGLTexture::~LLGLTexture()
void LLGLTexture::init()
{
mBoostLevel = LLGLTexture::BOOST_NONE;
// <FS:minerjr>
// Added a previous boost level to allow for restorign boost after BOOST_SELECTED is applied
mPrevBoostLevel = LLGLTexture::BOOST_NONE;
// </FS:minerjr>
mFullWidth = 0;
mFullHeight = 0;
@ -107,6 +111,18 @@ void LLGLTexture::setBoostLevel(S32 level)
}
}
// <FS:minerjr>
// Changes the current boost level to the previous value
void LLGLTexture::restoreBoostLevel()
{
mBoostLevel = mPrevBoostLevel;
}
// Stores the current boost level in a the previous boost.
void LLGLTexture::storeBoostLevel()
{
mPrevBoostLevel = mBoostLevel;
}
// </FS:minerjr>
void LLGLTexture::forceActive()
{
mTextureState = ACTIVE ;

View File

@ -101,6 +101,10 @@ public:
void setBoostLevel(S32 level);
S32 getBoostLevel() { return mBoostLevel; }
// <FS:minerjr>
void restoreBoostLevel(); // Now restores the mBoostLevel with the mPrevBoostLevel
void storeBoostLevel(); // Stores the current mBoostLevel in mPrevBoostLevel
// </FS:minerjr>
S32 getFullWidth() const { return mFullWidth; }
S32 getFullHeight() const { return mFullHeight; }
@ -183,6 +187,10 @@ public:
protected:
S32 mBoostLevel; // enum describing priority level
// <FS:minerjr>
// Added previous value to allow for restoring of BOOST_SELECTED overriding current state
S32 mPrevBoostLevel; // enum describing priority level (Previous Value for BOOST_SELECTION restore)
// </FS:minerjr>
U32 mFullWidth;
U32 mFullHeight;
bool mUseMipMaps;

View File

@ -711,19 +711,21 @@ void LLGLTexMemBar::draw()
//text = llformat("Textures: %d Fetch: %d(%d) Pkts:%d(%d) Cache R/W: %d/%d LFS:%d RAW:%d HTP:%d DEC:%d CRE:%d ",
text = llformat("Tex: %d Fetch: %d(%d) Pkts:%d(%d) CAC R/W: %d/%d LFS:%d RAW:%d HTP:%d DEC:%d CRE:%d FCA:%d ",
// </FS:Ansariel>
// <FS:minerjr> Fixed up the missing variables and converted 64bit size_t's to S32's to allow proper numbers to appear
gTextureList.getNumImages(),
LLAppViewer::getTextureFetch()->getNumRequests(), LLAppViewer::getTextureFetch()->getNumDeletes(),
LLAppViewer::getTextureFetch()->mPacketCount, LLAppViewer::getTextureFetch()->mBadPacketCount,
LLAppViewer::getTextureCache()->getNumReads(), LLAppViewer::getTextureCache()->getNumWrites(),
LLLFSThread::sLocal->getPending(),
LLImageRaw::sRawImageCount,
(S32)LLLFSThread::sLocal->getPending(),
(S32)LLImageRaw::sRawImageCount,
LLAppViewer::getTextureFetch()->getNumHTTPRequests(),
LLAppViewer::getImageDecodeThread()->getPending(),
(S32)LLAppViewer::getImageDecodeThread()->getPending(),
// <FS:Ansariel> Fast cache stats
//gTextureList.mCreateTextureList.size());
gTextureList.mCreateTextureList.size(),
gTextureList.mFastCacheList.size());
(S32)gTextureList.mCreateTextureList.size(),
(S32)gTextureList.mFastCacheList.size());
// </FS:Ansariel>
// </FS:minerjr>
x_right = 550.0f;
LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0.f, (F32)(v_offset + line_height*3),
text_color, LLFontGL::LEFT, LLFontGL::TOP,

View File

@ -4192,6 +4192,14 @@ void LLViewerObject::boostTexturePriority(bool boost_children /* = true */)
S32 tex_count = getNumTEs();
for (i = 0; i < tex_count; i++)
{
// <FS:minerjr>
// This isused to fix the textures becoming blury when object interacted with by the user and unselected.
// If this is changing the boost level for the TEImage for the first time, store the boost level before modifying it.
if (getTEImage(i)->getBoostLevel() != LLGLTexture::BOOST_SELECTED)
{
getTEImage(i)->storeBoostLevel();
}
// </FS:minerjr>
getTEImage(i)->setBoostLevel(LLGLTexture::BOOST_SELECTED);
}
@ -4199,7 +4207,17 @@ void LLViewerObject::boostTexturePriority(bool boost_children /* = true */)
{
LLSculptParams *sculpt_params = (LLSculptParams *)getParameterEntry(LLNetworkData::PARAMS_SCULPT);
LLUUID sculpt_id = sculpt_params->getSculptTexture();
LLViewerTextureManager::getFetchedTexture(sculpt_id, FTT_DEFAULT, true, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE)->setBoostLevel(LLGLTexture::BOOST_SELECTED);
// <FS:minerjr>
//LLViewerTextureManager::getFetchedTexture(sculpt_id, FTT_DEFAULT, true, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE)->setBoostLevel(LLGLTexture::BOOST_SELECTED);
// This isused to fix the textures becoming blury when object interacted with by the user and unselected.
// If this is changing the boost level for the sculpted for the first time, store the boost level before modifying it.
LLViewerFetchedTexture* sculptedTexture = LLViewerTextureManager::getFetchedTexture(sculpt_id, FTT_DEFAULT, true, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE);
if (sculptedTexture->getBoostLevel() != LLGLTexture::BOOST_SELECTED)
{
sculptedTexture->storeBoostLevel();
}
// </FS:minerjr>
sculptedTexture->setBoostLevel(LLGLTexture::BOOST_SELECTED);
}
if (boost_children)

View File

@ -3134,7 +3134,10 @@ void LLViewerLODTexture::processTextureStats()
// unset it immediately after we consume it
if (getBoostLevel() == BOOST_SELECTED)
{
setBoostLevel(BOOST_NONE);
// <FS:minerjr>
//setBoostLevel(BOOST_NONE);
restoreBoostLevel();
// </FS:minerjr>
}
}