summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerobject.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2012-07-09 12:45:22 -0400
committerOz Linden <oz@lindenlab.com>2012-07-09 12:45:22 -0400
commit5a563069e871ed4f7af6fb4ff121af5dbc00b5bb (patch)
tree17ba04b0f2dacfbe9d5e5fa9ddf197c5551eaa83 /indra/newview/llviewerobject.cpp
parent9298b1abe9f8b5a7230a5788e86affb22747740d (diff)
parentf7f27e4f2617c3656b273117543ecd92ef5ac495 (diff)
merge back more late beta fixes from 3.3.4
Diffstat (limited to 'indra/newview/llviewerobject.cpp')
-rw-r--r--indra/newview/llviewerobject.cpp38
1 files changed, 25 insertions, 13 deletions
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index 72fd3c1a4a..67c87a6c63 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -2924,27 +2924,39 @@ void LLViewerObject::removeInventory(const LLUUID& item_id)
++mInventorySerialNum;
}
-void LLViewerObject::updateInventory(
- LLViewerInventoryItem* item,
- U8 key,
- bool is_new)
+bool LLViewerObject::isTextureInInventory(LLViewerInventoryItem* item)
{
- LLMemType mt(LLMemType::MTYPE_OBJECT);
+ bool result = false;
- std::list<LLUUID>::iterator begin = mPendingInventoryItemsIDs.begin();
- std::list<LLUUID>::iterator end = mPendingInventoryItemsIDs.end();
+ if (item && LLAssetType::AT_TEXTURE == item->getType())
+ {
+ std::list<LLUUID>::iterator begin = mPendingInventoryItemsIDs.begin();
+ std::list<LLUUID>::iterator end = mPendingInventoryItemsIDs.end();
- bool is_fetching = std::find(begin, end, item->getAssetUUID()) != end;
- bool is_fetched = getInventoryItemByAsset(item->getAssetUUID()) != NULL;
+ bool is_fetching = std::find(begin, end, item->getAssetUUID()) != end;
+ bool is_fetched = getInventoryItemByAsset(item->getAssetUUID()) != NULL;
- if (is_fetched || is_fetching)
- {
- return;
+ result = is_fetched || is_fetching;
}
- else
+
+ return result;
+}
+
+void LLViewerObject::updateTextureInventory(LLViewerInventoryItem* item, U8 key, bool is_new)
+{
+ if (item && !isTextureInInventory(item))
{
mPendingInventoryItemsIDs.push_back(item->getAssetUUID());
+ updateInventory(item, key, is_new);
}
+}
+
+void LLViewerObject::updateInventory(
+ LLViewerInventoryItem* item,
+ U8 key,
+ bool is_new)
+{
+ LLMemType mt(LLMemType::MTYPE_OBJECT);
// This slices the object into what we're concerned about on the
// viewer. The simulator will take the permissions and transfer