aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/lltexturefetch.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/lltexturefetch.cpp23
1 files changed, 18 insertions, 5 deletions
diff --git a/linden/indra/newview/lltexturefetch.cpp b/linden/indra/newview/lltexturefetch.cpp
index 11882b2..a7c43ce 100644
--- a/linden/indra/newview/lltexturefetch.cpp
+++ b/linden/indra/newview/lltexturefetch.cpp
@@ -562,6 +562,14 @@ bool LLTextureFetchWorker::doWork(S32 param)
562 { 562 {
563 mFetchTimer.reset(); 563 mFetchTimer.reset();
564 } 564 }
565
566 if (mImagePriority <= 0.0f)
567 {
568 if (mState < WRITE_TO_CACHE)
569 {
570 return true; // cancel request
571 }
572 }
565 573
566 if (mState == INIT) 574 if (mState == INIT)
567 { 575 {
@@ -708,7 +716,7 @@ bool LLTextureFetchWorker::doWork(S32 param)
708 mFetcher->lockQueue(); 716 mFetcher->lockQueue();
709 mFetcher->removeFromNetworkQueue(this); 717 mFetcher->removeFromNetworkQueue(this);
710 mFetcher->unlockQueue(); 718 mFetcher->unlockQueue();
711 if (!mFormattedImage->getDataSize()) 719 if (mFormattedImage.isNull() || !mFormattedImage->getDataSize())
712 { 720 {
713 // processSimulatorPackets() failed 721 // processSimulatorPackets() failed
714// llwarns << "processSimulatorPackets() failed to load buffer" << llendl; 722// llwarns << "processSimulatorPackets() failed to load buffer" << llendl;
@@ -1050,17 +1058,22 @@ void LLTextureFetchWorker::removeFromCache()
1050 1058
1051bool LLTextureFetchWorker::processSimulatorPackets() 1059bool LLTextureFetchWorker::processSimulatorPackets()
1052{ 1060{
1061 if (mFormattedImage.isNull() || mRequestedSize < 0)
1062 {
1063 // not sure how we got here, but not a valid state, abort!
1064 mFormattedImage = NULL;
1065 return true;
1066 }
1067
1053 if (mLastPacket >= mFirstPacket) 1068 if (mLastPacket >= mFirstPacket)
1054 { 1069 {
1055 llassert_always(mFormattedImage) ;
1056 S32 buffer_size = mFormattedImage->getDataSize(); 1070 S32 buffer_size = mFormattedImage->getDataSize();
1057 for (S32 i = mFirstPacket; i<=mLastPacket; i++) 1071 for (S32 i = mFirstPacket; i<=mLastPacket; i++)
1058 { 1072 {
1059 llassert_always(mPackets[i]) ; 1073 llassert_always(mPackets[i]);
1060 buffer_size += mPackets[i]->mSize; 1074 buffer_size += mPackets[i]->mSize;
1061 } 1075 }
1062 bool have_all_data = mLastPacket >= mTotalPackets-1; 1076 bool have_all_data = mLastPacket >= mTotalPackets-1;
1063 llassert_always(mRequestedSize > 0);
1064 if (buffer_size >= mRequestedSize || have_all_data) 1077 if (buffer_size >= mRequestedSize || have_all_data)
1065 { 1078 {
1066 /// We have enough (or all) data 1079 /// We have enough (or all) data
@@ -1641,7 +1654,7 @@ void LLTextureFetch::sendRequestListToSimulators()
1641 S32 packet = req->mLastPacket + 1; 1654 S32 packet = req->mLastPacket + 1;
1642 gMessageSystem->nextBlockFast(_PREHASH_RequestImage); 1655 gMessageSystem->nextBlockFast(_PREHASH_RequestImage);
1643 gMessageSystem->addUUIDFast(_PREHASH_Image, req->mID); 1656 gMessageSystem->addUUIDFast(_PREHASH_Image, req->mID);
1644 gMessageSystem->addS8Fast(_PREHASH_DiscardLevel, (S8)req->mSimRequestedDiscard); 1657 gMessageSystem->addS8Fast(_PREHASH_DiscardLevel, (S8)req->mDesiredDiscard);
1645 gMessageSystem->addF32Fast(_PREHASH_DownloadPriority, req->mImagePriority); 1658 gMessageSystem->addF32Fast(_PREHASH_DownloadPriority, req->mImagePriority);
1646 gMessageSystem->addU32Fast(_PREHASH_Packet, packet); 1659 gMessageSystem->addU32Fast(_PREHASH_Packet, packet);
1647 gMessageSystem->addU8Fast(_PREHASH_Type, req->mType); 1660 gMessageSystem->addU8Fast(_PREHASH_Type, req->mType);