summaryrefslogtreecommitdiff
path: root/indra/newview/llvoavatar.cpp
diff options
context:
space:
mode:
authorVadim Savchuk <vsavchuk@productengine.com>2009-12-14 15:07:16 +0200
committerVadim Savchuk <vsavchuk@productengine.com>2009-12-14 15:07:16 +0200
commitf493b62f868f5fb8fe8d9f7e0f5b0ff619eb8026 (patch)
tree2d337bacabec046e3c9f7e82d6e1c59f350af410 /indra/newview/llvoavatar.cpp
parentf446e2b94d05315a09e3068b258a606986ec8872 (diff)
parenta763409647a5a8d82f2f1c54223b998877c3b72d (diff)
Merge from default branch.
--HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llvoavatar.cpp')
-rw-r--r--indra/newview/llvoavatar.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 8828ebff6a..368b964455 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -5993,7 +5993,7 @@ void LLVOAvatar::updateMeshTextures()
else
{
mBakedTextureDatas[i].mIsLoaded = FALSE;
- if ( (i == BAKED_HEAD) || (i == BAKED_UPPER) || (i == BAKED_LOWER) )
+ if ( (baked_img->getID() != IMG_INVISIBLE) && ((i == BAKED_HEAD) || (i == BAKED_UPPER) || (i == BAKED_LOWER)) )
{
baked_img->setLoadedCallback(onBakedTextureMasksLoaded, MORPH_MASK_REQUESTED_DISCARD, TRUE, TRUE, new LLTextureMaskData( mID ));
}
@@ -6463,7 +6463,7 @@ void LLVOAvatar::onFirstTEMessageReceived()
LLViewerFetchedTexture* image = LLViewerTextureManager::staticCastToFetchedTexture(getImage( mBakedTextureDatas[i].mTextureIndex, 0 ), TRUE) ;
mBakedTextureDatas[i].mLastTextureIndex = image->getID();
// If we have more than one texture for the other baked layers, we'll want to call this for them too.
- if ( (i == BAKED_HEAD) || (i == BAKED_UPPER) || (i == BAKED_LOWER) )
+ if ( (image->getID() != IMG_INVISIBLE) && ((i == BAKED_HEAD) || (i == BAKED_UPPER) || (i == BAKED_LOWER)) )
{
image->setLoadedCallback( onBakedTextureMasksLoaded, MORPH_MASK_REQUESTED_DISCARD, TRUE, TRUE, new LLTextureMaskData( mID ));
}
@@ -7650,6 +7650,9 @@ void LLVOAvatar::getImpostorValues(LLVector3* extents, LLVector3& angle, F32& di
void LLVOAvatar::idleUpdateRenderCost()
{
+ static const U32 ARC_BODY_PART_COST = 20;
+ static const U32 ARC_LIMIT = 2048;
+
if (!gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHAME))
{
return;
@@ -7666,7 +7669,7 @@ void LLVOAvatar::idleUpdateRenderCost()
{
if (isTextureVisible(tex_index))
{
- cost +=20;
+ cost +=ARC_BODY_PART_COST;
}
}
}
@@ -7686,7 +7689,6 @@ void LLVOAvatar::idleUpdateRenderCost()
const LLDrawable* drawable = attached_object->mDrawable;
if (drawable)
{
- cost += 10;
const LLVOVolume* volume = drawable->getVOVolume();
if (volume)
{
@@ -7697,11 +7699,11 @@ void LLVOAvatar::idleUpdateRenderCost()
}
}
- cost += textures.size() * 5;
+ cost += textures.size() * LLVOVolume::ARC_TEXTURE_COST;
setDebugText(llformat("%d", cost));
- F32 green = 1.f-llclamp(((F32) cost-1024.f)/1024.f, 0.f, 1.f);
- F32 red = llmin((F32) cost/1024.f, 1.f);
+ F32 green = 1.f-llclamp(((F32) cost-(F32)ARC_LIMIT)/(F32)ARC_LIMIT, 0.f, 1.f);
+ F32 red = llmin((F32) cost/(F32)ARC_LIMIT, 1.f);
mText->setColor(LLColor4(red,green,0,1));
}