From 1dae91d7354aef57625e3508b23a4bb21de242e8 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 19 Jul 2010 17:15:32 -0400 Subject: EXT-8360 WIP - propagating COF item name changes various places --- indra/llcommon/llmd5.cpp | 37 +++++++++++++++++++----------- indra/llcommon/llmd5.h | 11 +++++---- indra/newview/llappearancemgr.cpp | 1 + indra/newview/llcofwearables.cpp | 2 +- indra/newview/lloutfitobserver.cpp | 42 +++++++++++++++++++++++++++++++---- indra/newview/lloutfitobserver.h | 5 +++++ indra/newview/llpaneleditwearable.cpp | 8 +++---- indra/newview/llpaneloutfitedit.cpp | 2 +- 8 files changed, 81 insertions(+), 27 deletions(-) diff --git a/indra/llcommon/llmd5.cpp b/indra/llcommon/llmd5.cpp index da9cb94e13..cc73c3e45c 100644 --- a/indra/llcommon/llmd5.cpp +++ b/indra/llcommon/llmd5.cpp @@ -171,11 +171,6 @@ void LLMD5::update(FILE* file){ } - - - - - // MD5 update for istreams. // Like update for files; see above. @@ -192,9 +187,10 @@ void LLMD5::update(std::istream& stream){ } - - - +void LLMD5::update(const std::string& s) +{ + update((unsigned char *)s.c_str(),s.length()); +} // MD5 finalization. Ends an MD5 message-digest operation, writing the // the message digest and zeroizing the context. @@ -277,7 +273,7 @@ LLMD5::LLMD5(const unsigned char *s) finalize(); } -void LLMD5::raw_digest(unsigned char *s) +void LLMD5::raw_digest(unsigned char *s) const { if (!finalized) { @@ -293,7 +289,7 @@ void LLMD5::raw_digest(unsigned char *s) -void LLMD5::hex_digest(char *s) +void LLMD5::hex_digest(char *s) const { int i; @@ -319,6 +315,7 @@ void LLMD5::hex_digest(char *s) + std::ostream& operator<<(std::ostream &stream, LLMD5 context) { char s[33]; /* Flawfinder: ignore */ @@ -327,13 +324,25 @@ std::ostream& operator<<(std::ostream &stream, LLMD5 context) return stream; } +bool operator==(const LLMD5& a, const LLMD5& b) +{ + unsigned char a_guts[16]; + unsigned char b_guts[16]; + a.raw_digest(a_guts); + b.raw_digest(b_guts); + if (memcmp(a_guts,b_guts,16)==0) + return true; + else + return false; +} - +bool operator!=(const LLMD5& a, const LLMD5& b) +{ + return !(a==b); +} // PRIVATE METHODS: - - void LLMD5::init(){ finalized=0; // we just started! @@ -531,3 +540,5 @@ void LLMD5::decode (uint4 *output, const uint1 *input, const uint4 len){ output[i] = ((uint4)input[j]) | (((uint4)input[j+1]) << 8) | (((uint4)input[j+2]) << 16) | (((uint4)input[j+3]) << 24); } + + diff --git a/indra/llcommon/llmd5.h b/indra/llcommon/llmd5.h index df9d7324ab..4e68ba0d5e 100644 --- a/indra/llcommon/llmd5.h +++ b/indra/llcommon/llmd5.h @@ -95,6 +95,7 @@ public: void update (const uint1 *input, const uint4 input_length); void update (std::istream& stream); void update (FILE *file); + void update (const std::string& str); void finalize (); // constructors for special circumstances. All these constructors finalize @@ -105,11 +106,10 @@ public: LLMD5 (const unsigned char *string, const unsigned int number); // methods to acquire finalized result - void raw_digest(unsigned char *array); // provide 16-byte array for binary data - void hex_digest(char *string); // provide 33-byte array for ascii-hex string - friend std::ostream& operator<< (std::ostream&, LLMD5 context); - + void raw_digest(unsigned char *array) const; // provide 16-byte array for binary data + void hex_digest(char *string) const; // provide 33-byte array for ascii-hex string + friend std::ostream& operator<< (std::ostream&, LLMD5 context); private: @@ -131,4 +131,7 @@ private: }; +LL_COMMON_API bool operator==(const LLMD5& a, const LLMD5& b); +LL_COMMON_API bool operator!=(const LLMD5& a, const LLMD5& b); + #endif // LL_LLMD5_H diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index a7d90ab8d3..d2449abf08 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2209,6 +2209,7 @@ void LLAppearanceMgr::updateIsDirty() LLViewerInventoryItem *item2 = outfit_items.get(i); if (item1->getLinkedUUID() != item2->getLinkedUUID() || + item1->getName() != item2->getName() || item1->LLInventoryItem::getDescription() != item2->LLInventoryItem::getDescription()) { mOutfitIsDirty = true; diff --git a/indra/newview/llcofwearables.cpp b/indra/newview/llcofwearables.cpp index 86d9121213..0e03fd8833 100644 --- a/indra/newview/llcofwearables.cpp +++ b/indra/newview/llcofwearables.cpp @@ -393,7 +393,7 @@ void LLCOFWearables::refresh() return; } - if (mCOFVersion == catp->getVersion()) return; + //if (mCOFVersion == catp->getVersion()) return; mCOFVersion = catp->getVersion(); typedef std::vector values_vector_t; diff --git a/indra/newview/lloutfitobserver.cpp b/indra/newview/lloutfitobserver.cpp index 03414b9964..99835edad2 100644 --- a/indra/newview/lloutfitobserver.cpp +++ b/indra/newview/lloutfitobserver.cpp @@ -40,6 +40,7 @@ LLOutfitObserver::LLOutfitObserver() : mCOFLastVersion(LLViewerInventoryCategory::VERSION_UNKNOWN) { + mItemNameHash.finalize(); gInventory.addObserver(this); } @@ -87,13 +88,25 @@ bool LLOutfitObserver::checkCOF() if (cof.isNull()) return false; + bool cof_changed = false; + LLMD5 itemNameHash; + hashItemNames(itemNameHash); + if (itemNameHash != mItemNameHash) + { + cof_changed = true; + mItemNameHash = itemNameHash; + } + S32 cof_version = getCategoryVersion(cof); + if (cof_version != mCOFLastVersion) + { + cof_changed = true; + mCOFLastVersion = cof_version; + } - if (cof_version == mCOFLastVersion) + if (!cof_changed) return false; - - mCOFLastVersion = cof_version; - + // dirtiness state should be updated before sending signal LLAppearanceMgr::getInstance()->updateIsDirty(); mCOFChanged(); @@ -101,6 +114,27 @@ bool LLOutfitObserver::checkCOF() return true; } +void LLOutfitObserver::hashItemNames(LLMD5& itemNameHash) +{ + LLInventoryModel::cat_array_t cat_array; + LLInventoryModel::item_array_t item_array; + gInventory.collectDescendents(LLAppearanceMgr::instance().getCOF(), + cat_array, + item_array, + false); + for (LLInventoryModel::item_array_t::const_iterator iter = item_array.begin(); + iter != item_array.end(); + iter++) + { + const LLViewerInventoryItem *item = (*iter); + if (!item) + continue; + const std::string& name = item->getName(); + itemNameHash.update(name); + } + itemNameHash.finalize(); +} + void LLOutfitObserver::checkBaseOutfit() { LLUUID baseoutfit_id = diff --git a/indra/newview/lloutfitobserver.h b/indra/newview/lloutfitobserver.h index 3a66b5ea9f..f526609135 100644 --- a/indra/newview/lloutfitobserver.h +++ b/indra/newview/lloutfitobserver.h @@ -34,6 +34,7 @@ #define LL_OUTFITOBSERVER_H #include "llsingleton.h" +#include "llmd5.h" /** * Outfit observer facade that provides simple possibility to subscribe on @@ -72,6 +73,8 @@ protected: bool checkCOF(); + void hashItemNames(LLMD5& itemNameHash); + void checkBaseOutfit(); //last version number of a COF category @@ -84,6 +87,8 @@ protected: bool mLastOutfitDirtiness; + LLMD5 mItemNameHash; + private: signal_t mBOFReplaced; signal_t mBOFChanged; diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index f7e8a7b1a7..ddb5f49ab0 100644 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -786,7 +786,7 @@ BOOL LLPanelEditWearable::isDirty() const if (mWearablePtr) { if (mWearablePtr->isDirty() || - mWearablePtr->getName().compare(mNameEditor->getText()) != 0) + mWearableItem->getName().compare(mNameEditor->getText()) != 0) { isDirty = TRUE; } @@ -987,7 +987,7 @@ void LLPanelEditWearable::saveChanges(bool force_save_as) // the name of the wearable has changed, re-save wearable with new name LLAppearanceMgr::instance().removeCOFItemLinks(mWearablePtr->getItemID(),false); gAgentWearables.saveWearableAs(mWearablePtr->getType(), index, new_name, FALSE); - mNameEditor->setText(mWearablePtr->getName()); + mNameEditor->setText(mWearableItem->getName()); } else { @@ -1004,7 +1004,7 @@ void LLPanelEditWearable::revertChanges() } mWearablePtr->revertValues(); - mNameEditor->setText(mWearablePtr->getName()); + mNameEditor->setText(mWearableItem->getName()); updatePanelPickerControls(mWearablePtr->getType()); updateTypeSpecificControls(mWearablePtr->getType()); gAgentAvatarp->wearableUpdated(mWearablePtr->getType(), FALSE); @@ -1050,7 +1050,7 @@ void LLPanelEditWearable::showWearable(LLWearable* wearable, BOOL show) mDescTitle->setText(description_title); // set name - mNameEditor->setText(wearable->getName()); + mNameEditor->setText(mWearableItem->getName()); updatePanelPickerControls(type); updateTypeSpecificControls(type); diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index 937b794686..bb8c01bccf 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -1088,7 +1088,7 @@ void LLPanelOutfitEdit::getSelectedItemsUUID(uuid_vec_t& uuid_list) void LLPanelOutfitEdit::onCOFChanged() { //the panel is only updated when is visible to a user - if (!isInVisibleChain()) return; +// if (!isInVisibleChain()) return; update(); } -- cgit v1.2.3 From ca1224fd7968edebfcd274c21439ca74340efc26 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 20 Jul 2010 10:44:27 -0400 Subject: EXT-8360 FIX - item name changes get propagated to the various appearance panel widgets --- indra/newview/llinventorymodel.cpp | 24 ++++++++++++++++++++++++ indra/newview/llinventorymodel.h | 4 ++++ indra/newview/llinventoryobserver.cpp | 25 ++++++++++++++++++++----- indra/newview/llinventoryobserver.h | 8 ++++++-- indra/newview/lloutfitobserver.cpp | 28 +++------------------------- indra/newview/lloutfitobserver.h | 2 -- 6 files changed, 57 insertions(+), 34 deletions(-) diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 13e5cb516e..5a952bb6a8 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -294,6 +294,30 @@ void LLInventoryModel::getDirectDescendentsOf(const LLUUID& cat_id, items = get_ptr_in_map(mParentChildItemTree, cat_id); } +LLMD5 LLInventoryModel::hashDirectDescendentNames(const LLUUID& cat_id) const +{ + LLInventoryModel::cat_array_t* cat_array; + LLInventoryModel::item_array_t* item_array; + getDirectDescendentsOf(cat_id,cat_array,item_array); + LLMD5 item_name_hash; + if (!item_array) + { + item_name_hash.finalize(); + return item_name_hash; + } + for (LLInventoryModel::item_array_t::const_iterator iter = item_array->begin(); + iter != item_array->end(); + iter++) + { + const LLViewerInventoryItem *item = (*iter); + if (!item) + continue; + item_name_hash.update(item->getName()); + } + item_name_hash.finalize(); + return item_name_hash; +} + // SJB: Added version to lock the arrays to catch potential logic bugs void LLInventoryModel::lockDirectDescendentArrays(const LLUUID& cat_id, cat_array_t*& categories, diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index 7b56d0bdd1..ff8a5bae9b 100644 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -41,6 +41,7 @@ #include "lluuid.h" #include "llpermissionsflags.h" #include "llstring.h" +#include "llmd5.h" #include #include #include @@ -194,6 +195,9 @@ public: void getDirectDescendentsOf(const LLUUID& cat_id, cat_array_t*& categories, item_array_t*& items) const; + + // Compute a hash of direct descendent names (for detecting child name changes) + LLMD5 hashDirectDescendentNames(const LLUUID& cat_id) const; // Starting with the object specified, add its descendents to the // array provided, but do not add the inventory object specified diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp index bd6877d9d3..5416f01033 100644 --- a/indra/newview/llinventoryobserver.cpp +++ b/indra/newview/llinventoryobserver.cpp @@ -676,7 +676,9 @@ void LLInventoryCategoriesObserver::changed(U32 mask) iter != mCategoryMap.end(); ++iter) { - LLViewerInventoryCategory* category = gInventory.getCategory((*iter).first); + const LLUUID& cat_id = (*iter).first; + + LLViewerInventoryCategory* category = gInventory.getCategory(cat_id); if (!category) continue; @@ -691,7 +693,7 @@ void LLInventoryCategoriesObserver::changed(U32 mask) // Check number of known descendents to find out whether it has changed. LLInventoryModel::cat_array_t* cats; LLInventoryModel::item_array_t* items; - gInventory.getDirectDescendentsOf((*iter).first, cats, items); + gInventory.getDirectDescendentsOf(cat_id, cats, items); if (!cats || !items) { llwarns << "Category '" << category->getName() << "' descendents corrupted, fetch failed." << llendl; @@ -703,20 +705,33 @@ void LLInventoryCategoriesObserver::changed(U32 mask) continue; } - + const S32 current_num_known_descendents = cats->count() + items->count(); LLCategoryData cat_data = (*iter).second; + bool cat_changed = false; + // If category version or descendents count has changed - // update category data in mCategoryMap and fire a callback. + // update category data in mCategoryMap if (version != cat_data.mVersion || current_num_known_descendents != cat_data.mDescendentsCount) { cat_data.mVersion = version; cat_data.mDescendentsCount = current_num_known_descendents; + cat_changed = true; + } - cat_data.mCallback(); + // If any item names have changed, update the name hash + LLMD5 item_name_hash = gInventory.hashDirectDescendentNames(cat_id); + if (cat_data.mItemNameHash != item_name_hash) + { + cat_data.mItemNameHash = item_name_hash; + cat_changed = true; } + + // If anything has changed above, fire the callback. + if (cat_changed) + cat_data.mCallback(); } } diff --git a/indra/newview/llinventoryobserver.h b/indra/newview/llinventoryobserver.h index 4a88a65bf8..e9f39ba1f2 100644 --- a/indra/newview/llinventoryobserver.h +++ b/indra/newview/llinventoryobserver.h @@ -34,12 +34,13 @@ #define LL_LLINVENTORYOBSERVERS_H #include "lluuid.h" +#include "llmd5.h" #include #include class LLViewerInventoryCategory; -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~v~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLInventoryObserver // // A simple abstract base class that can relay messages when the inventory @@ -298,11 +299,14 @@ protected: : mCallback(cb) , mVersion(version) , mDescendentsCount(num_descendents) - {} + { + mItemNameHash.finalize(); + } callback_t mCallback; S32 mVersion; S32 mDescendentsCount; + LLMD5 mItemNameHash; }; typedef std::map category_map_t; diff --git a/indra/newview/lloutfitobserver.cpp b/indra/newview/lloutfitobserver.cpp index 99835edad2..60c941b456 100644 --- a/indra/newview/lloutfitobserver.cpp +++ b/indra/newview/lloutfitobserver.cpp @@ -89,12 +89,11 @@ bool LLOutfitObserver::checkCOF() return false; bool cof_changed = false; - LLMD5 itemNameHash; - hashItemNames(itemNameHash); - if (itemNameHash != mItemNameHash) + LLMD5 item_name_hash = gInventory.hashDirectDescendentNames(cof); + if (item_name_hash != mItemNameHash) { cof_changed = true; - mItemNameHash = itemNameHash; + mItemNameHash = item_name_hash; } S32 cof_version = getCategoryVersion(cof); @@ -114,27 +113,6 @@ bool LLOutfitObserver::checkCOF() return true; } -void LLOutfitObserver::hashItemNames(LLMD5& itemNameHash) -{ - LLInventoryModel::cat_array_t cat_array; - LLInventoryModel::item_array_t item_array; - gInventory.collectDescendents(LLAppearanceMgr::instance().getCOF(), - cat_array, - item_array, - false); - for (LLInventoryModel::item_array_t::const_iterator iter = item_array.begin(); - iter != item_array.end(); - iter++) - { - const LLViewerInventoryItem *item = (*iter); - if (!item) - continue; - const std::string& name = item->getName(); - itemNameHash.update(name); - } - itemNameHash.finalize(); -} - void LLOutfitObserver::checkBaseOutfit() { LLUUID baseoutfit_id = diff --git a/indra/newview/lloutfitobserver.h b/indra/newview/lloutfitobserver.h index f526609135..4bb2b9b5ec 100644 --- a/indra/newview/lloutfitobserver.h +++ b/indra/newview/lloutfitobserver.h @@ -73,8 +73,6 @@ protected: bool checkCOF(); - void hashItemNames(LLMD5& itemNameHash); - void checkBaseOutfit(); //last version number of a COF category -- cgit v1.2.3 From 06aa2322b2b769fec118ac1f2f0f51c915f5ec23 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 20 Jul 2010 11:21:18 -0400 Subject: EXT-8360 FIX - cleanup --- indra/newview/llcofwearables.cpp | 1 + indra/newview/llinventoryobserver.h | 2 +- indra/newview/llpaneloutfitedit.cpp | 3 --- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/indra/newview/llcofwearables.cpp b/indra/newview/llcofwearables.cpp index 0e03fd8833..f75ea23351 100644 --- a/indra/newview/llcofwearables.cpp +++ b/indra/newview/llcofwearables.cpp @@ -393,6 +393,7 @@ void LLCOFWearables::refresh() return; } + // BAP - removed check; does not detect item name changes. //if (mCOFVersion == catp->getVersion()) return; mCOFVersion = catp->getVersion(); diff --git a/indra/newview/llinventoryobserver.h b/indra/newview/llinventoryobserver.h index e9f39ba1f2..ccd5fa5f4e 100644 --- a/indra/newview/llinventoryobserver.h +++ b/indra/newview/llinventoryobserver.h @@ -40,7 +40,7 @@ class LLViewerInventoryCategory; -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~v~~~~~~~~~~~~~~~~~~~~~~~~~~~ +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLInventoryObserver // // A simple abstract base class that can relay messages when the inventory diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index bb8c01bccf..f764d1802b 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -1087,9 +1087,6 @@ void LLPanelOutfitEdit::getSelectedItemsUUID(uuid_vec_t& uuid_list) void LLPanelOutfitEdit::onCOFChanged() { - //the panel is only updated when is visible to a user -// if (!isInVisibleChain()) return; - update(); } -- cgit v1.2.3 From 2961992a7e135ca68e5d78b245ea9a43b4284e56 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Tue, 20 Jul 2010 12:50:13 -0400 Subject: EXT-8448 FIXED [crashhunters] Crash in LLFolderBridge::folderOptionsMenu(), and Trash folder options incorrect Minor fix to previous checkin for this crash. This fixes the UI issue where you're seeing the context options for the previous folder you clicked when you click on trash/library. --- indra/newview/llinventorybridge.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 4ac9edecbe..0b1408616e 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2598,8 +2598,6 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { mWearables=TRUE; } - mMenu = menu.getHandle(); - sSelf = getHandle(); } // Preemptively disable system folder removal if more than one item selected. @@ -2630,6 +2628,8 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) folders.push_back(category->getUUID()); } + mMenu = menu.getHandle(); + sSelf = getHandle(); LLRightClickInventoryFetchDescendentsObserver* fetch = new LLRightClickInventoryFetchDescendentsObserver(folders, FALSE); fetch->startFetch(); inc_busy_count(); -- cgit v1.2.3 From 2d5b917cea8e1ca7c06fcc47d82a4ea25d3c4494 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Tue, 20 Jul 2010 15:56:37 -0400 Subject: EXT-8119 tattoo texture remains grey until rebake texture pipeline always returns a valid image, we needed to check the image id against IMG_DEFAULT instead of NULL. This causes the image to be correctly set to IMG_DEFAULT_AVATAR, which is never rendered during layer baking. Code reviewed by Seraph --- indra/newview/llpaneleditwearable.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index f7e8a7b1a7..ebe5bf8b06 100644 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -896,7 +896,7 @@ void LLPanelEditWearable::onTexturePickerCommit(const LLUICtrl* ctrl) { // Set the new version LLViewerFetchedTexture* image = LLViewerTextureManager::getFetchedTexture(texture_ctrl->getImageAssetID()); - if( image->getID().isNull() ) + if( image->getID() == IMG_DEFAULT ) { image = LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT_AVATAR); } -- cgit v1.2.3 From a49f4090b8d9d2519439b4d7ba4904b165d569cc Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Tue, 20 Jul 2010 16:36:39 -0600 Subject: EXT-7500: FIXED: Texture Jamming problems with http texture off --- indra/newview/llvoavatar.cpp | 40 ++++++++++++++++++++++++++-------------- indra/newview/llvoavatar.h | 3 ++- indra/newview/llvoavatarself.cpp | 2 +- 3 files changed, 29 insertions(+), 16 deletions(-) diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 53b47ec408..09a3b3b9ae 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -4140,9 +4140,13 @@ void LLVOAvatar::updateTextures() } else { - render_avatar = isVisible() && !mCulled; + if(!isVisible()) + { + return ;//do not update for invisible avatar. + } + + render_avatar = !mCulled; //visible and not culled. } - checkTextureLoading() ; std::vector layer_baked; // GL NOT ACTIVE HERE - *TODO @@ -4183,7 +4187,7 @@ void LLVOAvatar::updateTextures() } } } - if (isIndexBakedTexture((ETextureIndex) texture_index) && render_avatar) + if (isIndexBakedTexture((ETextureIndex) texture_index)) { const S32 boost_level = getAvatarBakedBoostLevel(); imagep = LLViewerTextureManager::staticCastToFetchedTexture(getImage(texture_index,0), TRUE); @@ -4222,10 +4226,11 @@ void LLVOAvatar::addLocalTextureStats( ETextureIndex idx, LLViewerFetchedTexture return; } - +const S32 MAX_TEXTURE_UPDATE_INTERVAL = 64 ; //need to call updateTextures() at least every 32 frames. +const S32 MAX_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL = S32_MAX ; //frames void LLVOAvatar::checkTextureLoading() { - static const F32 MAX_INVISIBLE_WAITING_TIME = 30.f ; //seconds + static const F32 MAX_INVISIBLE_WAITING_TIME = 15.f ; //seconds BOOL pause = !isVisible() ; if(!pause) @@ -4245,9 +4250,9 @@ void LLVOAvatar::checkTextureLoading() if(pause && mInvisibleTimer.getElapsedTimeF32() < MAX_INVISIBLE_WAITING_TIME) { - return ; + return ; //have not been invisible for enough time. } - + for(LLLoadedCallbackEntry::source_callback_list_t::iterator iter = mCallbackTextureList.begin(); iter != mCallbackTextureList.end(); ++iter) { @@ -4257,17 +4262,22 @@ void LLVOAvatar::checkTextureLoading() if(pause)//pause texture fetching. { tex->pauseLoadedCallbacks(&mCallbackTextureList) ; + + //set to terminate texture fetching after MAX_TEXTURE_UPDATE_INTERVAL frames. + tex->setMaxVirtualSizeResetInterval(MAX_TEXTURE_UPDATE_INTERVAL); + tex->resetMaxVirtualSizeResetCounter() ; } else//unpause { - static const F32 START_AREA = 100.f ; - - tex->unpauseLoadedCallbacks(&mCallbackTextureList) ; - tex->addTextureStats(START_AREA); //jump start the fetching again + tex->unpauseLoadedCallbacks(&mCallbackTextureList) ; } } } + if(!pause) + { + updateTextures() ; //refresh texture stats. + } mLoadedCallbacksPaused = pause ; return ; } @@ -4276,12 +4286,14 @@ const F32 SELF_ADDITIONAL_PRI = 0.75f ; const F32 ADDITIONAL_PRI = 0.5f; void LLVOAvatar::addBakedTextureStats( LLViewerFetchedTexture* imagep, F32 pixel_area, F32 texel_area_ratio, S32 boost_level) { - //if this function is not called for the last 512 frames, the texture pipeline will stop fetching this texture. - static const S32 MAX_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL = 512 ; //frames - + //Note: + //if this function is not called for the last MAX_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL frames, + //the texture pipeline will stop fetching this texture. + imagep->resetTextureStats(); imagep->setCanUseHTTP(false) ; //turn off http fetching for baked textures. imagep->setMaxVirtualSizeResetInterval(MAX_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL); + imagep->resetMaxVirtualSizeResetCounter() ; mMaxPixelArea = llmax(pixel_area, mMaxPixelArea); mMinPixelArea = llmin(pixel_area, mMinPixelArea); diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 22fc595ea2..8ffcfc7ed4 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -1049,6 +1049,7 @@ protected: // Shared with LLVOAvatarSelf *******************************************************************************/ }; // LLVOAvatar -extern const F32 SELF_ADDITIONAL_PRI; +extern const F32 SELF_ADDITIONAL_PRI; +extern const S32 MAX_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL; #endif // LL_VO_AVATAR_H diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 8961d2c285..88896871b2 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2032,7 +2032,7 @@ void LLVOAvatarSelf::addLocalTextureStats( ETextureIndex type, LLViewerFetchedTe imagep->setBoostLevel(getAvatarBoostLevel()); imagep->resetTextureStats(); - imagep->setMaxVirtualSizeResetInterval(16); + imagep->setMaxVirtualSizeResetInterval(MAX_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL); imagep->addTextureStats( desired_pixels / texel_area_ratio ); imagep->setAdditionalDecodePriority(SELF_ADDITIONAL_PRI) ; imagep->forceUpdateBindStats() ; -- cgit v1.2.3 From 20ce01811e3a5565a27de150e4658e996bac3108 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Tue, 20 Jul 2010 18:39:36 -0700 Subject: EXT-7654 FIX About Land Floater> Icons missing --- indra/llui/llcheckboxctrl.cpp | 2 +- indra/newview/llfloaterland.cpp | 3 ++- indra/newview/skins/default/xui/en/floater_about_land.xml | 6 ++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/indra/llui/llcheckboxctrl.cpp b/indra/llui/llcheckboxctrl.cpp index 3d32157406..6f81f5434c 100644 --- a/indra/llui/llcheckboxctrl.cpp +++ b/indra/llui/llcheckboxctrl.cpp @@ -191,7 +191,7 @@ void LLCheckBoxCtrl::reshape(S32 width, S32 height, BOOL called_from_parent) static LLUICachedControl llcheckboxctrl_btn_size ("UICheckboxctrlBtnSize", 0); const S32 FUDGE = 10; - S32 text_width = mFont->getWidth( mLabel->getText() ) + FUDGE; + S32 text_width = mLabel->getTextBoundingRect().getWidth() + FUDGE; S32 text_height = llround(mFont->getLineHeight()); LLRect label_rect; label_rect.setOriginAndSize( diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 913bb676b0..f0ed659f5a 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -2088,7 +2088,8 @@ void LLPanelLandOptions::refresh() LLStyle::Params style; style.image(LLUI::getUIImage(gFloaterView->getParentFloater(this)->getString("maturity_icon_moderate"))); LLCheckBoxWithTBAcess* fullaccess_mature_ctrl = (LLCheckBoxWithTBAcess*)mMatureCtrl; - fullaccess_mature_ctrl->getTextBox()->setText(std::string("icon"),style); + fullaccess_mature_ctrl->getTextBox()->setText(LLStringExplicit("")); + fullaccess_mature_ctrl->getTextBox()->appendImageSegment(style); fullaccess_mature_ctrl->getTextBox()->appendText(getString("mature_check_mature"), false); fullaccess_mature_ctrl->setToolTip(getString("mature_check_mature_tooltip")); fullaccess_mature_ctrl->reshape(fullaccess_mature_ctrl->getRect().getWidth(), fullaccess_mature_ctrl->getRect().getHeight(), FALSE); diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml index 68e36ff0b3..8d32097c3b 100644 --- a/indra/newview/skins/default/xui/en/floater_about_land.xml +++ b/indra/newview/skins/default/xui/en/floater_about_land.xml @@ -1467,13 +1467,15 @@ Only large parcels can be listed in search. + width="200" />