From c710a9f5bdec08933ade898a207061c8df3f3066 Mon Sep 17 00:00:00 2001 From: Armin Weatherwax Date: Sun, 30 Jan 2011 11:04:53 +0100 Subject: fix 2 regressions introduced by 76c8494525b8e2b1 --- linden/indra/newview/lltexlayer.cpp | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) (limited to 'linden/indra/newview/lltexlayer.cpp') diff --git a/linden/indra/newview/lltexlayer.cpp b/linden/indra/newview/lltexlayer.cpp index 139b1b0..ceef28b 100644 --- a/linden/indra/newview/lltexlayer.cpp +++ b/linden/indra/newview/lltexlayer.cpp @@ -211,7 +211,7 @@ void LLTexLayerSetBuffer::popProjection() BOOL LLTexLayerSetBuffer::needsRender() { LLVOAvatar* avatar = mTexLayerSet->getAvatar(); - BOOL upload_now = mNeedsUpload && mTexLayerSet->isLocalTextureDataFinal() && gAgent.mNumPendingQueries == 0; + BOOL upload_now = needsUploadNow(); BOOL needs_update = (mNeedsUpdate || upload_now) && !avatar->mAppearanceAnimating; if (needs_update) @@ -276,14 +276,16 @@ BOOL LLTexLayerSetBuffer::render() } else { - mUploadPending = FALSE; - mNeedsUpload = FALSE; + //mUploadPending = FALSE;//see... + //mNeedsUpload = FALSE;// ...below... LLVOAvatar* avatar = mTexLayerSet->getAvatar(); if (avatar) { avatar->setNewBakedTexture(avatar->getBakedTE(mTexLayerSet), IMG_INVISIBLE); llinfos << "Invisible baked texture set for " << mTexLayerSet->getBodyRegion() << llendl; } + readBackAndUpload(); //... here: Opensim is not happy if we don't + //TODO: find out if SL is happy if we do } } } @@ -456,7 +458,7 @@ void LLTexLayerSetBuffer::onTextureUploadComplete(const LLUUID& uuid, void* user LLVOAvatar* avatar = gAgent.getAvatarObject(); - if (0 == result && avatar && !avatar->isDead() && + if (avatar && !avatar->isDead() && baked_upload_data && baked_upload_data->mAvatar == avatar && // Sanity check: only the user's avatar should be uploading textures. baked_upload_data->mLayerSet->hasComposite()) @@ -491,10 +493,21 @@ void LLTexLayerSetBuffer::onTextureUploadComplete(const LLUUID& uuid, void* user } else { - // Avatar appearance is changing, ignore the upload results - llinfos << "Baked upload failed. Reason: " << result << llendl; - // *FIX: retry upload after n seconds, asset server could be busy - } + ++failures; + llinfos << "Baked upload failed (attempt " << failures << "/" << MAX_BAKE_UPLOAD_ATTEMPTS << "), "; + if (failures >= MAX_BAKE_UPLOAD_ATTEMPTS) + { + llcont << "giving up."; + } + else + { + const F32 delay = 5.f; + llcont << llformat("retrying in %.2f seconds.", delay); + layerset_buffer->mUploadFailCount = failures; + layerset_buffer->requestDelayedUpload((U64)(delay * 1000000)); + } + llcont << llendl; + } } else { -- cgit v1.1