summaryrefslogtreecommitdiff
path: root/indra/newview/lltexlayer.cpp
diff options
context:
space:
mode:
authorMonroe Linden <monroe@lindenlab.com>2010-04-19 18:02:56 -0700
committerMonroe Linden <monroe@lindenlab.com>2010-04-19 18:02:56 -0700
commit41357bb01297ce0977da7a3e2e9308d3c903d3a8 (patch)
treecf677aea0a81ecddbb394e64c9bd07db517880af /indra/newview/lltexlayer.cpp
parentc3fa45282f5bdb0cb7a3fcd680154e88cafde4bb (diff)
parent3a7490e492b35d5dc55f6124d2e1acbca3bd4d79 (diff)
Automated merge with ssh://hg.lindenlab.com/q/viewer-hotfix
Diffstat (limited to 'indra/newview/lltexlayer.cpp')
-rw-r--r--indra/newview/lltexlayer.cpp26
1 files changed, 11 insertions, 15 deletions
diff --git a/indra/newview/lltexlayer.cpp b/indra/newview/lltexlayer.cpp
index 8cb319b122..4262264a1d 100644
--- a/indra/newview/lltexlayer.cpp
+++ b/indra/newview/lltexlayer.cpp
@@ -172,12 +172,13 @@ void LLTexLayerSetBuffer::popProjection() const
BOOL LLTexLayerSetBuffer::needsRender()
{
- const LLVOAvatarSelf* avatar = mTexLayerSet->getAvatar();
+ llassert(mTexLayerSet->getAvatar() == gAgentAvatarp);
+ if (!isAgentAvatarValid()) return FALSE;
BOOL upload_now = mNeedsUpload && mTexLayerSet->isLocalTextureDataFinal() && gAgentQueryManager.hasNoPendingQueries();
- BOOL needs_update = (mNeedsUpdate || upload_now) && !avatar->mAppearanceAnimating;
+ BOOL needs_update = (mNeedsUpdate || upload_now) && !gAgentAvatarp->mAppearanceAnimating;
if (needs_update)
{
- BOOL invalid_skirt = avatar->getBakedTE(mTexLayerSet) == LLVOAvatarDefines::TEX_SKIRT_BAKED && !avatar->isWearingWearableType(WT_SKIRT);
+ BOOL invalid_skirt = gAgentAvatarp->getBakedTE(mTexLayerSet) == LLVOAvatarDefines::TEX_SKIRT_BAKED && !gAgentAvatarp->isWearingWearableType(WT_SKIRT);
if (invalid_skirt)
{
// we were trying to create a skirt texture
@@ -187,7 +188,6 @@ BOOL LLTexLayerSetBuffer::needsRender()
}
else
{
- needs_update &= (avatar->isSelf() || (avatar->isVisible() && !avatar->isCulled()));
needs_update &= mTexLayerSet->isLocalTextureDataAvailable();
}
}
@@ -290,8 +290,6 @@ void LLTexLayerSetBuffer::readBackAndUpload()
llinfos << "Baked " << mTexLayerSet->getBodyRegion() << llendl;
LLViewerStats::getInstance()->incStat(LLViewerStats::ST_TEX_BAKES);
- llassert( gAgent.getAvatarObject() == mTexLayerSet->getAvatar() );
-
// We won't need our caches since we're baked now. (Techically, we won't
// really be baked until this image is sent to the server and the Avatar
// Appearance message is received.)
@@ -358,7 +356,7 @@ void LLTexLayerSetBuffer::readBackAndUpload()
{
// baked_upload_data is owned by the responder and deleted after the request completes
LLBakedUploadData* baked_upload_data =
- new LLBakedUploadData(gAgent.getAvatarObject(), this->mTexLayerSet, asset_id);
+ new LLBakedUploadData(gAgentAvatarp, this->mTexLayerSet, asset_id);
mUploadID = asset_id;
// upload the image
@@ -415,12 +413,10 @@ void LLTexLayerSetBuffer::onTextureUploadComplete(const LLUUID& uuid,
{
LLBakedUploadData* baked_upload_data = (LLBakedUploadData*)userdata;
- LLVOAvatarSelf* avatar = gAgent.getAvatarObject();
-
if (0 == result &&
- avatar &&
- !avatar->isDead() &&
- baked_upload_data->mAvatar == avatar && // Sanity check: only the user's avatar should be uploading textures.
+ isAgentAvatarValid() &&
+ !gAgentAvatarp->isDead() &&
+ baked_upload_data->mAvatar == gAgentAvatarp && // Sanity check: only the user's avatar should be uploading textures.
baked_upload_data->mTexLayerSet->hasComposite()
)
{
@@ -445,11 +441,11 @@ void LLTexLayerSetBuffer::onTextureUploadComplete(const LLUUID& uuid,
if (result >= 0)
{
- LLVOAvatarDefines::ETextureIndex baked_te = avatar->getBakedTE(layerset_buffer->mTexLayerSet);
+ LLVOAvatarDefines::ETextureIndex baked_te = gAgentAvatarp->getBakedTE(layerset_buffer->mTexLayerSet);
// Update baked texture info with the new UUID
U64 now = LLFrameTimer::getTotalTime(); // Record starting time
llinfos << "Baked texture upload took " << (S32)((now - baked_upload_data->mStartTime) / 1000) << " ms" << llendl;
- avatar->setNewBakedTexture(baked_te, uuid);
+ gAgentAvatarp->setNewBakedTexture(baked_te, uuid);
}
else
{
@@ -463,7 +459,7 @@ void LLTexLayerSetBuffer::onTextureUploadComplete(const LLUUID& uuid,
llinfos << "Received baked texture out of date, ignored." << llendl;
}
- avatar->dirtyMesh();
+ gAgentAvatarp->dirtyMesh();
}
else
{