summaryrefslogtreecommitdiff
path: root/indra/newview/llviewertexture.cpp
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2009-11-03 19:42:52 -0700
committerXiaohong Bao <bao@lindenlab.com>2009-11-03 19:42:52 -0700
commitabf77532d8534fe98b8c05ddf049ad429da34992 (patch)
treec2ff6ab2e598b4700ff16aa0712d0d58fc40aebb /indra/newview/llviewertexture.cpp
parent81e719387983990fe0a2a197a6e09059219c119a (diff)
fix the bug that textuer boost level is mixed with boolean numbers.
Diffstat (limited to 'indra/newview/llviewertexture.cpp')
-rw-r--r--indra/newview/llviewertexture.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index 758bf8c1aa..6b8c8c01d4 100644
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -198,6 +198,7 @@ LLViewerFetchedTexture* LLViewerTextureManager::getFetchedTexture(
LLGLenum primary_format,
LLHost request_from_host)
{
+ llassert_always(boost_priority >= LLViewerTexture::BOOST_NONE) ;
return gTextureList.getImage(image_id, usemipmaps, boost_priority, texture_type, internal_format, primary_format, request_from_host) ;
}
@@ -210,6 +211,7 @@ LLViewerFetchedTexture* LLViewerTextureManager::getFetchedTextureFromFile(
LLGLenum primary_format,
const LLUUID& force_id)
{
+ llassert_always(boost_priority >= LLViewerTexture::BOOST_NONE) ;
return gTextureList.getImageFromFile(filename, usemipmaps, boost_priority, texture_type, internal_format, primary_format, force_id) ;
}
@@ -256,10 +258,10 @@ void LLViewerTextureManager::init()
image_raw = NULL;
LLViewerFetchedTexture::sDefaultImagep->dontDiscard();
#else
- LLViewerFetchedTexture::sDefaultImagep = LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT, TRUE, TRUE);
+ LLViewerFetchedTexture::sDefaultImagep = LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT, TRUE, LLViewerTexture::BOOST_UI);
#endif
- LLViewerFetchedTexture::sSmokeImagep = LLViewerTextureManager::getFetchedTexture(IMG_SMOKE, TRUE, TRUE);
+ LLViewerFetchedTexture::sSmokeImagep = LLViewerTextureManager::getFetchedTexture(IMG_SMOKE, TRUE, LLViewerTexture::BOOST_UI);
LLViewerFetchedTexture::sSmokeImagep->setNoDelete() ;
LLViewerTexture::initClass() ;
@@ -1240,7 +1242,7 @@ F32 LLViewerFetchedTexture::calcDecodePriority()
{
ddiscard+=2;
}
- else if (mGLTexturep.notNull() && !mGLTexturep->getBoundRecently() && mBoostLevel == 0)
+ else if (mGLTexturep.notNull() && !mGLTexturep->getBoundRecently() && mBoostLevel == LLViewerTexture::BOOST_NONE)
{
ddiscard-=2;
}
@@ -1252,11 +1254,11 @@ F32 LLViewerFetchedTexture::calcDecodePriority()
pixel_priority = llclamp(pixel_priority, 0.0f, priority-1.f); // priority range = 100000-900000
if ( mBoostLevel > BOOST_HIGH)
{
- priority = 1000000.f + pixel_priority + 1000.f * mBoostLevel;
+ priority = 1000000.f + pixel_priority + 1000.f * (mBoostLevel - LLViewerTexture::BOOST_NONE);
}
else
{
- priority += 0.f + pixel_priority + 1000.f * mBoostLevel;
+ priority += 0.f + pixel_priority + 1000.f * (mBoostLevel - LLViewerTexture::BOOST_NONE);
}
}
return priority;
@@ -1436,7 +1438,7 @@ bool LLViewerFetchedTexture::updateFetch()
}
if (!mDontDiscard)
{
- if (mBoostLevel == 0)
+ if (mBoostLevel == LLViewerTexture::BOOST_NONE)
{
desired_discard = llmax(desired_discard, current_discard-1);
}