From d39ef5ce6fd52a66189e3e14da3a01b14b1d99a2 Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Wed, 5 May 2010 13:19:24 +0300 Subject: Implemented task EXT-7156 (Appearance panel: "Wear" button should become disabled and a loading indicator should appear next to the outfit name). When user presses the "Wear" button in the outfits list, we disable the button and display a perpetual loading indicator until all wearables of the outfit being worn get loaded. Reviewed by Sergey Litovchuk at https://codereview.productengine.com/secondlife/r/347/ --HG-- branch : product-engine --- indra/newview/llagentwearables.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index b5fde0baca..47735e7179 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1164,6 +1164,7 @@ void LLAgentWearables::createStandardWearablesAllDone() mWearablesLoaded = TRUE; checkWearablesLoaded(); + mLoadedSignal(); updateServer(); @@ -1567,6 +1568,7 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it // Start rendering & update the server mWearablesLoaded = TRUE; checkWearablesLoaded(); + mLoadedSignal(); queryWearableCache(); updateServer(); @@ -2012,6 +2014,10 @@ BOOL LLAgentWearables::areWearablesLoaded() const void LLAgentWearables::updateWearablesLoaded() { mWearablesLoaded = (itemUpdatePendingCount()==0); + if (mWearablesLoaded) + { + mLoadedSignal(); + } } bool LLAgentWearables::canWearableBeRemoved(const LLWearable* wearable) const @@ -2091,3 +2097,8 @@ void LLAgentWearables::populateMyOutfitsFolder(void) outfits->done(); } } + +boost::signals2::connection LLAgentWearables::addLoadedCallback(loaded_callback_t cb) +{ + return mLoadedSignal.connect(cb); +} -- cgit v1.2.3 From adc0aba2dd206e76a41298727794ab80754d439b Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Tue, 11 May 2010 15:08:29 -0400 Subject: EXT-7305 : FIXED : Changed LLWearableDictionary to LLWearableType Refactored LLWearableDictionary to look more like LLAssetType/LLFolderType/etc. in terms of code design. This required a lot of superficial changes across many files. Overall functionality has not changed. --- indra/newview/llagentwearables.cpp | 242 ++++++++++++++++++------------------- 1 file changed, 121 insertions(+), 121 deletions(-) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 47735e7179..3e73bbef15 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -100,13 +100,13 @@ void checkWearableAgainstInventory(LLWearable *wearable) void LLAgentWearables::dump() { llinfos << "LLAgentWearablesDump" << llendl; - for (S32 i = 0; i < WT_COUNT; i++) + for (S32 i = 0; i < LLWearableType::WT_COUNT; i++) { - U32 count = getWearableCount((EWearableType)i); + U32 count = getWearableCount((LLWearableType::EType)i); llinfos << "Type: " << i << " count " << count << llendl; for (U32 j=0; jgetItemID().isNull()) @@ -326,7 +326,7 @@ void LLAgentWearables::sendAgentWearablesUpdate() lldebugs << "sendAgentWearablesUpdate()" << llendl; // MULTI-WEARABLE: update for multi-wearables after server-side support is in. - for (S32 type=0; type < WT_COUNT; ++type) + for (S32 type=0; type < LLWearableType::WT_COUNT; ++type) { gMessageSystem->nextBlockFast(_PREHASH_WearableData); @@ -334,7 +334,7 @@ void LLAgentWearables::sendAgentWearablesUpdate() gMessageSystem->addU8Fast(_PREHASH_WearableType, type_u8); // MULTI-WEARABLE: TODO: hacked index to 0, needs to loop over all once messages support this. - LLWearable* wearable = getWearable((EWearableType)type, 0); + LLWearable* wearable = getWearable((LLWearableType::EType)type, 0); if (wearable) { //llinfos << "Sending wearable " << wearable->getName() << llendl; @@ -350,16 +350,16 @@ void LLAgentWearables::sendAgentWearablesUpdate() } else { - //llinfos << "Not wearing wearable type " << LLWearableDictionary::getInstance()->getWearable((EWearableType)i) << llendl; + //llinfos << "Not wearing wearable type " << LLWearableType::getTypeName((LLWearableType::EType)i) << llendl; gMessageSystem->addUUIDFast(_PREHASH_ItemID, LLUUID::null); } - lldebugs << " " << LLWearableDictionary::getTypeLabel((EWearableType)type) << ": " << (wearable ? wearable->getAssetID() : LLUUID::null) << llendl; + lldebugs << " " << LLWearableType::getTypeLabel((LLWearableType::EType)type) << ": " << (wearable ? wearable->getAssetID() : LLUUID::null) << llendl; } gAgent.sendReliableMessage(); } -void LLAgentWearables::saveWearable(const EWearableType type, const U32 index, BOOL send_update) +void LLAgentWearables::saveWearable(const LLWearableType::EType type, const U32 index, BOOL send_update) { LLWearable* old_wearable = getWearable(type, index); if (old_wearable && (old_wearable->isDirty() || old_wearable->isOldVersion())) @@ -422,7 +422,7 @@ void LLAgentWearables::saveWearable(const EWearableType type, const U32 index, B } } -void LLAgentWearables::saveWearableAs(const EWearableType type, +void LLAgentWearables::saveWearableAs(const LLWearableType::EType type, const U32 index, const std::string& new_name, BOOL save_in_lost_and_found) @@ -483,7 +483,7 @@ void LLAgentWearables::saveWearableAs(const EWearableType type, old_wearable->revertValues(); } -void LLAgentWearables::revertWearable(const EWearableType type, const U32 index) +void LLAgentWearables::revertWearable(const LLWearableType::EType type, const U32 index) { LLWearable* wearable = getWearable(type, index); wearable->revertValues(); @@ -498,10 +498,10 @@ void LLAgentWearables::saveAllWearables() // return; //} - for (S32 i=0; i < WT_COUNT; i++) + for (S32 i=0; i < LLWearableType::WT_COUNT; i++) { - for (U32 j=0; j < getWearableCount((EWearableType)i); j++) - saveWearable((EWearableType)i, j, FALSE); + for (U32 j=0; j < getWearableCount((LLWearableType::EType)i); j++) + saveWearable((LLWearableType::EType)i, j, FALSE); } sendAgentWearablesUpdate(); } @@ -509,14 +509,14 @@ void LLAgentWearables::saveAllWearables() // Called when the user changes the name of a wearable inventory item that is currently being worn. void LLAgentWearables::setWearableName(const LLUUID& item_id, const std::string& new_name) { - for (S32 i=0; i < WT_COUNT; i++) + for (S32 i=0; i < LLWearableType::WT_COUNT; i++) { - for (U32 j=0; j < getWearableCount((EWearableType)i); j++) + for (U32 j=0; j < getWearableCount((LLWearableType::EType)i); j++) { - LLUUID curr_item_id = getWearableItemID((EWearableType)i,j); + LLUUID curr_item_id = getWearableItemID((LLWearableType::EType)i,j); if (curr_item_id == item_id) { - LLWearable* old_wearable = getWearable((EWearableType)i,j); + LLWearable* old_wearable = getWearable((LLWearableType::EType)i,j); llassert(old_wearable); std::string old_name = old_wearable->getName(); @@ -530,7 +530,7 @@ void LLAgentWearables::setWearableName(const LLUUID& item_id, const std::string& } old_wearable->setName(old_name); - setWearable((EWearableType)i,j,new_wearable); + setWearable((LLWearableType::EType)i,j,new_wearable); sendAgentWearablesUpdate(); break; } @@ -539,7 +539,7 @@ void LLAgentWearables::setWearableName(const LLUUID& item_id, const std::string& } -BOOL LLAgentWearables::isWearableModifiable(EWearableType type, U32 index) const +BOOL LLAgentWearables::isWearableModifiable(LLWearableType::EType type, U32 index) const { LLUUID item_id = getWearableItemID(type, index); if (!item_id.isNull()) @@ -554,7 +554,7 @@ BOOL LLAgentWearables::isWearableModifiable(EWearableType type, U32 index) const return FALSE; } -BOOL LLAgentWearables::isWearableCopyable(EWearableType type, U32 index) const +BOOL LLAgentWearables::isWearableCopyable(LLWearableType::EType type, U32 index) const { LLUUID item_id = getWearableItemID(type, index); if (!item_id.isNull()) @@ -570,7 +570,7 @@ BOOL LLAgentWearables::isWearableCopyable(EWearableType type, U32 index) const } /* - U32 LLAgentWearables::getWearablePermMask(EWearableType type) + U32 LLAgentWearables::getWearablePermMask(LLWearableType::EType type) { LLUUID item_id = getWearableItemID(type); if (!item_id.isNull()) @@ -585,7 +585,7 @@ BOOL LLAgentWearables::isWearableCopyable(EWearableType type, U32 index) const } */ -LLInventoryItem* LLAgentWearables::getWearableInventoryItem(EWearableType type, U32 index) +LLInventoryItem* LLAgentWearables::getWearableInventoryItem(LLWearableType::EType type, U32 index) { LLUUID item_id = getWearableItemID(type,index); LLInventoryItem* item = NULL; @@ -598,11 +598,11 @@ LLInventoryItem* LLAgentWearables::getWearableInventoryItem(EWearableType type, const LLWearable* LLAgentWearables::getWearableFromItemID(const LLUUID& item_id) const { - for (S32 i=0; i < WT_COUNT; i++) + for (S32 i=0; i < LLWearableType::WT_COUNT; i++) { - for (U32 j=0; j < getWearableCount((EWearableType)i); j++) + for (U32 j=0; j < getWearableCount((LLWearableType::EType)i); j++) { - const LLWearable * curr_wearable = getWearable((EWearableType)i, j); + const LLWearable * curr_wearable = getWearable((LLWearableType::EType)i, j); if (curr_wearable && (curr_wearable->getItemID() == item_id)) { return curr_wearable; @@ -614,11 +614,11 @@ const LLWearable* LLAgentWearables::getWearableFromItemID(const LLUUID& item_id) LLWearable* LLAgentWearables::getWearableFromAssetID(const LLUUID& asset_id) { - for (S32 i=0; i < WT_COUNT; i++) + for (S32 i=0; i < LLWearableType::WT_COUNT; i++) { - for (U32 j=0; j < getWearableCount((EWearableType)i); j++) + for (U32 j=0; j < getWearableCount((LLWearableType::EType)i); j++) { - LLWearable * curr_wearable = getWearable((EWearableType)i, j); + LLWearable * curr_wearable = getWearable((LLWearableType::EType)i, j); if (curr_wearable && (curr_wearable->getAssetID() == asset_id)) { return curr_wearable; @@ -638,12 +638,12 @@ void LLAgentWearables::sendAgentWearablesRequest() } // static -BOOL LLAgentWearables::selfHasWearable(EWearableType type) +BOOL LLAgentWearables::selfHasWearable(LLWearableType::EType type) { return (gAgentWearables.getWearableCount(type) > 0); } -LLWearable* LLAgentWearables::getWearable(const EWearableType type, U32 index) +LLWearable* LLAgentWearables::getWearable(const LLWearableType::EType type, U32 index) { wearableentry_map_t::iterator wearable_iter = mWearableDatas.find(type); if (wearable_iter == mWearableDatas.end()) @@ -661,7 +661,7 @@ LLWearable* LLAgentWearables::getWearable(const EWearableType type, U32 index) } } -void LLAgentWearables::setWearable(const EWearableType type, U32 index, LLWearable *wearable) +void LLAgentWearables::setWearable(const LLWearableType::EType type, U32 index, LLWearable *wearable) { LLWearable *old_wearable = getWearable(type,index); @@ -691,7 +691,7 @@ void LLAgentWearables::setWearable(const EWearableType type, U32 index, LLWearab } } -U32 LLAgentWearables::pushWearable(const EWearableType type, LLWearable *wearable) +U32 LLAgentWearables::pushWearable(const LLWearableType::EType type, LLWearable *wearable) { if (wearable == NULL) { @@ -699,7 +699,7 @@ U32 LLAgentWearables::pushWearable(const EWearableType type, LLWearable *wearabl llwarns << "Null wearable sent for type " << type << llendl; return MAX_WEARABLES_PER_TYPE; } - if (type < WT_COUNT || mWearableDatas[type].size() < MAX_WEARABLES_PER_TYPE) + if (type < LLWearableType::WT_COUNT || mWearableDatas[type].size() < MAX_WEARABLES_PER_TYPE) { mWearableDatas[type].push_back(wearable); wearableUpdated(wearable); @@ -741,7 +741,7 @@ void LLAgentWearables::popWearable(LLWearable *wearable) } U32 index = getWearableIndex(wearable); - EWearableType type = wearable->getType(); + LLWearableType::EType type = wearable->getType(); if (index < MAX_WEARABLES_PER_TYPE && index < getWearableCount(type)) { @@ -749,7 +749,7 @@ void LLAgentWearables::popWearable(LLWearable *wearable) } } -void LLAgentWearables::popWearable(const EWearableType type, U32 index) +void LLAgentWearables::popWearable(const LLWearableType::EType type, U32 index) { LLWearable *wearable = getWearable(type, index); if (wearable) @@ -767,7 +767,7 @@ U32 LLAgentWearables::getWearableIndex(LLWearable *wearable) return MAX_WEARABLES_PER_TYPE; } - const EWearableType type = wearable->getType(); + const LLWearableType::EType type = wearable->getType(); wearableentry_map_t::const_iterator wearable_iter = mWearableDatas.find(type); if (wearable_iter == mWearableDatas.end()) { @@ -786,7 +786,7 @@ U32 LLAgentWearables::getWearableIndex(LLWearable *wearable) return MAX_WEARABLES_PER_TYPE; } -const LLWearable* LLAgentWearables::getWearable(const EWearableType type, U32 index) const +const LLWearable* LLAgentWearables::getWearable(const LLWearableType::EType type, U32 index) const { wearableentry_map_t::const_iterator wearable_iter = mWearableDatas.find(type); if (wearable_iter == mWearableDatas.end()) @@ -804,7 +804,7 @@ const LLWearable* LLAgentWearables::getWearable(const EWearableType type, U32 in } } -LLWearable* LLAgentWearables::getTopWearable(const EWearableType type) +LLWearable* LLAgentWearables::getTopWearable(const LLWearableType::EType type) { U32 count = getWearableCount(type); if ( count == 0) @@ -815,7 +815,7 @@ LLWearable* LLAgentWearables::getTopWearable(const EWearableType type) return getWearable(type, count-1); } -U32 LLAgentWearables::getWearableCount(const EWearableType type) const +U32 LLAgentWearables::getWearableCount(const LLWearableType::EType type) const { wearableentry_map_t::const_iterator wearable_iter = mWearableDatas.find(type); if (wearable_iter == mWearableDatas.end()) @@ -828,7 +828,7 @@ U32 LLAgentWearables::getWearableCount(const EWearableType type) const U32 LLAgentWearables::getWearableCount(const U32 tex_index) const { - const EWearableType wearable_type = LLVOAvatarDictionary::getTEWearableType((LLVOAvatarDefines::ETextureIndex)tex_index); + const LLWearableType::EType wearable_type = LLVOAvatarDictionary::getTEWearableType((LLVOAvatarDefines::ETextureIndex)tex_index); return getWearableCount(wearable_type); } @@ -843,7 +843,7 @@ U32 LLAgentWearables::itemUpdatePendingCount() const return mItemsAwaitingWearableUpdate.size(); } -const LLUUID LLAgentWearables::getWearableItemID(EWearableType type, U32 index) const +const LLUUID LLAgentWearables::getWearableItemID(LLWearableType::EType type, U32 index) const { const LLWearable *wearable = getWearable(type,index); if (wearable) @@ -852,7 +852,7 @@ const LLUUID LLAgentWearables::getWearableItemID(EWearableType type, U32 index) return LLUUID(); } -const LLUUID LLAgentWearables::getWearableAssetID(EWearableType type, U32 index) const +const LLUUID LLAgentWearables::getWearableAssetID(LLWearableType::EType type, U32 index) const { const LLWearable *wearable = getWearable(type,index); if (wearable) @@ -916,11 +916,11 @@ void LLAgentWearables::processAgentInitialWearablesUpdate(LLMessageSystem* mesgs // Parse initial wearables data from message system U8 type_u8 = 0; gMessageSystem->getU8Fast(_PREHASH_WearableData, _PREHASH_WearableType, type_u8, i); - if (type_u8 >= WT_COUNT) + if (type_u8 >= LLWearableType::WT_COUNT) { continue; } - const EWearableType type = (EWearableType) type_u8; + const LLWearableType::EType type = (LLWearableType::EType) type_u8; LLUUID item_id; gMessageSystem->getUUIDFast(_PREHASH_WearableData, _PREHASH_ItemID, item_id, i); @@ -933,7 +933,7 @@ void LLAgentWearables::processAgentInitialWearablesUpdate(LLMessageSystem* mesgs } else { - LLAssetType::EType asset_type = LLWearableDictionary::getAssetType(type); + LLAssetType::EType asset_type = LLWearableType::getAssetType(type); if (asset_type == LLAssetType::AT_NONE) { continue; @@ -946,7 +946,7 @@ void LLAgentWearables::processAgentInitialWearablesUpdate(LLMessageSystem* mesgs outfit->add(wearable_data); } - lldebugs << " " << LLWearableDictionary::getTypeLabel(type) << llendl; + lldebugs << " " << LLWearableType::getTypeLabel(type) << llendl; } // Get the complete information on the items in the inventory and set up an observer @@ -970,11 +970,11 @@ void LLAgentWearables::processAgentInitialWearablesUpdate(LLMessageSystem* mesgs // Normally, all wearables referred to "AgentWearablesUpdate" will correspond to actual assets in the // database. If for some reason, we can't load one of those assets, we can try to reconstruct it so that // the user isn't left without a shape, for example. (We can do that only after the inventory has loaded.) -void LLAgentWearables::recoverMissingWearable(const EWearableType type, U32 index) +void LLAgentWearables::recoverMissingWearable(const LLWearableType::EType type, U32 index) { // Try to recover by replacing missing wearable with a new one. LLNotificationsUtil::add("ReplacedMissingWearable"); - lldebugs << "Wearable " << LLWearableDictionary::getTypeLabel(type) << " could not be downloaded. Replaced inventory item with default wearable." << llendl; + lldebugs << "Wearable " << LLWearableType::getTypeLabel(type) << " could not be downloaded. Replaced inventory item with default wearable." << llendl; LLWearable* new_wearable = LLWearableList::instance().createNewWearable(type); S32 type_s32 = (S32) type; @@ -1011,9 +1011,9 @@ void LLAgentWearables::recoverMissingWearableDone() } } -void LLAgentWearables::addLocalTextureObject(const EWearableType wearable_type, const LLVOAvatarDefines::ETextureIndex texture_type, U32 wearable_index) +void LLAgentWearables::addLocalTextureObject(const LLWearableType::EType wearable_type, const LLVOAvatarDefines::ETextureIndex texture_type, U32 wearable_index) { - LLWearable* wearable = getWearable((EWearableType)wearable_type, wearable_index); + LLWearable* wearable = getWearable((LLWearableType::EType)wearable_type, wearable_index); if (!wearable) { llerrs << "Tried to add local texture object to invalid wearable with type " << wearable_type << " and index " << wearable_index << llendl; @@ -1027,7 +1027,7 @@ class OnWearableItemCreatedCB: public LLInventoryCallback { public: OnWearableItemCreatedCB(): - mWearablesAwaitingItems(WT_COUNT,NULL) + mWearablesAwaitingItems(LLWearableType::WT_COUNT,NULL) { llinfos << "created callback" << llendl; } @@ -1053,8 +1053,8 @@ public: llwarns << "no wearable" << llendl; return; } - EWearableType type = wearable->getType(); - if (typegetType(); + if (typeisWearableType()) { - EWearableType type = item->getWearableType(); - if (type < WT_COUNT) + LLWearableType::EType type = item->getWearableType(); + if (type < LLWearableType::WT_COUNT) { LLWearable *wearable = mWearablesAwaitingItems[type]; if (wearable) @@ -1106,30 +1106,30 @@ void LLAgentWearables::createStandardWearables(BOOL female) gAgentAvatarp->setSex(female ? SEX_FEMALE : SEX_MALE); - const BOOL create[WT_COUNT] = + const BOOL create[LLWearableType::WT_COUNT] = { - TRUE, //WT_SHAPE - TRUE, //WT_SKIN - TRUE, //WT_HAIR - TRUE, //WT_EYES - TRUE, //WT_SHIRT - TRUE, //WT_PANTS - TRUE, //WT_SHOES - TRUE, //WT_SOCKS - FALSE, //WT_JACKET - FALSE, //WT_GLOVES - TRUE, //WT_UNDERSHIRT - TRUE, //WT_UNDERPANTS - FALSE //WT_SKIRT + TRUE, //LLWearableType::WT_SHAPE + TRUE, //LLWearableType::WT_SKIN + TRUE, //LLWearableType::WT_HAIR + TRUE, //LLWearableType::WT_EYES + TRUE, //LLWearableType::WT_SHIRT + TRUE, //LLWearableType::WT_PANTS + TRUE, //LLWearableType::WT_SHOES + TRUE, //LLWearableType::WT_SOCKS + FALSE, //LLWearableType::WT_JACKET + FALSE, //LLWearableType::WT_GLOVES + TRUE, //LLWearableType::WT_UNDERSHIRT + TRUE, //LLWearableType::WT_UNDERPANTS + FALSE //LLWearableType::WT_SKIRT }; LLPointer cb = new OnWearableItemCreatedCB; - for (S32 i=0; i < WT_COUNT; i++) + for (S32 i=0; i < LLWearableType::WT_COUNT; i++) { if (create[i]) { - llassert(getWearableCount((EWearableType)i) == 0); - LLWearable* wearable = LLWearableList::instance().createNewWearable((EWearableType)i); + llassert(getWearableCount((LLWearableType::EType)i) == 0); + LLWearable* wearable = LLWearableList::instance().createNewWearable((LLWearableType::EType)i); ((OnWearableItemCreatedCB*)(&(*cb)))->addPendingWearable(wearable); // no need to update here... LLUUID category_id = LLUUID::null; @@ -1175,16 +1175,16 @@ void LLAgentWearables::createStandardWearablesAllDone() // MULTI-WEARABLE: Properly handle multiwearables later. void LLAgentWearables::getAllWearablesArray(LLDynamicArray& wearables) { - for( S32 i = 0; i < WT_COUNT; ++i ) + for( S32 i = 0; i < LLWearableType::WT_COUNT; ++i ) { - if (getWearableCount((EWearableType) i) != 0) + if (getWearableCount((LLWearableType::EType) i) != 0) { wearables.push_back(i); } } } -// Note: wearables_to_include should be a list of EWearableType types +// Note: wearables_to_include should be a list of LLWearableType::EType types // attachments_to_include should be a list of attachment points void LLAgentWearables::makeNewOutfit(const std::string& new_folder_name, const LLDynamicArray& wearables_to_include, @@ -1214,9 +1214,9 @@ void LLAgentWearables::makeNewOutfit(const std::string& new_folder_name, for (i = 0; i < count; ++i) { const S32 type = wearables_to_include[i]; - for (U32 j=0; jsetName(new_name); } - LLViewerInventoryItem* item = gInventory.getItem(getWearableItemID((EWearableType)type,j)); + LLViewerInventoryItem* item = gInventory.getItem(getWearableItemID((LLWearableType::EType)type,j)); S32 todo = addWearableToAgentInventoryCallback::CALL_NONE; if (!found_first_item) { @@ -1251,7 +1251,7 @@ void LLAgentWearables::makeNewOutfit(const std::string& new_folder_name, llassert(item); if (item) { - if (isWearableCopyable((EWearableType)type, j)) + if (isWearableCopyable((LLWearableType::EType)type, j)) { copy_inventory_item( gAgent.getID(), @@ -1365,7 +1365,7 @@ private: void LLAgentWearables::makeNewOutfitDone(S32 type, U32 index) { - LLUUID first_item_id = getWearableItemID((EWearableType)type, index); + LLUUID first_item_id = getWearableItemID((LLWearableType::EType)type, index); // Open the inventory and select the first item we added. if (first_item_id.notNull()) { @@ -1396,10 +1396,10 @@ void LLAgentWearables::addWearableToAgentInventory(LLPointergetType(); + const LLWearableType::EType type = new_wearable->getType(); new_wearable->setName(new_item->getName()); new_wearable->setItemID(new_item->getUUID()); - if (LLWearableDictionary::getAssetType(type) == LLAssetType::AT_BODYPART) + if (LLWearableType::getAssetType(type) == LLAssetType::AT_BODYPART) { // exactly one wearable per body part setWearable(type,0,new_wearable); @@ -1586,7 +1586,7 @@ void LLAgentWearables::setWearableItem(LLInventoryItem* new_item, LLWearable* ne return; } - const EWearableType type = new_wearable->getType(); + const LLWearableType::EType type = new_wearable->getType(); if (!do_append) { @@ -1599,7 +1599,7 @@ void LLAgentWearables::setWearableItem(LLInventoryItem* new_item, LLWearable* ne if ((old_wearable->getAssetID() == new_wearable->getAssetID()) && (old_item_id == new_item->getUUID())) { - lldebugs << "No change to wearable asset and item: " << LLWearableDictionary::getInstance()->getWearableEntry(type) << llendl; + lldebugs << "No change to wearable asset and item: " << LLWearableType::getTypeName(type) << llendl; return; } @@ -1656,7 +1656,7 @@ bool LLAgentWearables::onSetWearableDialog(const LLSD& notification, const LLSD& // MULTI_WEARABLE: unify code after null objects are gone. void LLAgentWearables::setWearableFinal(LLInventoryItem* new_item, LLWearable* new_wearable, bool do_append) { - const EWearableType type = new_wearable->getType(); + const LLWearableType::EType type = new_wearable->getType(); if (do_append && getWearableItemID(type,0).notNull()) { @@ -1726,7 +1726,7 @@ void LLAgentWearables::queryWearableCache() bool hash_computed = false; for (U8 i=0; i < baked_dict->mWearables.size(); i++) { - const EWearableType baked_type = baked_dict->mWearables[i]; + const LLWearableType::EType baked_type = baked_dict->mWearables[i]; const U32 num_wearables = getWearableCount(baked_type); for (U32 index = 0; index < num_wearables; ++index) { @@ -1765,20 +1765,20 @@ void LLAgentWearables::queryWearableCache() // User has picked "remove from avatar" from a menu. // static -void LLAgentWearables::userRemoveWearable(const EWearableType &type, const U32 &index) +void LLAgentWearables::userRemoveWearable(const LLWearableType::EType &type, const U32 &index) { - if (!(type==WT_SHAPE || type==WT_SKIN || type==WT_HAIR || type==WT_EYES)) //&& - //!((!gAgent.isTeen()) && (type==WT_UNDERPANTS || type==WT_UNDERSHIRT))) + if (!(type==LLWearableType::WT_SHAPE || type==LLWearableType::WT_SKIN || type==LLWearableType::WT_HAIR || type==LLWearableType::WT_EYES)) //&& + //!((!gAgent.isTeen()) && (type==LLWearableType::WT_UNDERPANTS || type==LLWearableType::WT_UNDERSHIRT))) { gAgentWearables.removeWearable(type,false,index); } } //static -void LLAgentWearables::userRemoveWearablesOfType(const EWearableType &type) +void LLAgentWearables::userRemoveWearablesOfType(const LLWearableType::EType &type) { - if (!(type==WT_SHAPE || type==WT_SKIN || type==WT_HAIR || type==WT_EYES)) //&& - //!((!gAgent.isTeen()) && (type==WT_UNDERPANTS || type==WT_UNDERSHIRT))) + if (!(type==LLWearableType::WT_SHAPE || type==LLWearableType::WT_SKIN || type==LLWearableType::WT_HAIR || type==LLWearableType::WT_EYES)) //&& + //!((!gAgent.isTeen()) && (type==LLWearableType::WT_UNDERPANTS || type==LLWearableType::WT_UNDERSHIRT))) { gAgentWearables.removeWearable(type,true,0); } @@ -1803,17 +1803,17 @@ void LLAgentWearables::userRemoveAllClothesStep2(BOOL proceed) { if (proceed) { - gAgentWearables.removeWearable(WT_SHIRT,true,0); - gAgentWearables.removeWearable(WT_PANTS,true,0); - gAgentWearables.removeWearable(WT_SHOES,true,0); - gAgentWearables.removeWearable(WT_SOCKS,true,0); - gAgentWearables.removeWearable(WT_JACKET,true,0); - gAgentWearables.removeWearable(WT_GLOVES,true,0); - gAgentWearables.removeWearable(WT_UNDERSHIRT,true,0); - gAgentWearables.removeWearable(WT_UNDERPANTS,true,0); - gAgentWearables.removeWearable(WT_SKIRT,true,0); - gAgentWearables.removeWearable(WT_ALPHA,true,0); - gAgentWearables.removeWearable(WT_TATTOO,true,0); + gAgentWearables.removeWearable(LLWearableType::WT_SHIRT,true,0); + gAgentWearables.removeWearable(LLWearableType::WT_PANTS,true,0); + gAgentWearables.removeWearable(LLWearableType::WT_SHOES,true,0); + gAgentWearables.removeWearable(LLWearableType::WT_SOCKS,true,0); + gAgentWearables.removeWearable(LLWearableType::WT_JACKET,true,0); + gAgentWearables.removeWearable(LLWearableType::WT_GLOVES,true,0); + gAgentWearables.removeWearable(LLWearableType::WT_UNDERSHIRT,true,0); + gAgentWearables.removeWearable(LLWearableType::WT_UNDERPANTS,true,0); + gAgentWearables.removeWearable(LLWearableType::WT_SKIRT,true,0); + gAgentWearables.removeWearable(LLWearableType::WT_ALPHA,true,0); + gAgentWearables.removeWearable(LLWearableType::WT_TATTOO,true,0); } } @@ -2024,18 +2024,18 @@ bool LLAgentWearables::canWearableBeRemoved(const LLWearable* wearable) const { if (!wearable) return false; - EWearableType type = wearable->getType(); + LLWearableType::EType type = wearable->getType(); // Make sure the user always has at least one shape, skin, eyes, and hair type currently worn. - return !(((type == WT_SHAPE) || (type == WT_SKIN) || (type == WT_HAIR) || (type == WT_EYES)) + return !(((type == LLWearableType::WT_SHAPE) || (type == LLWearableType::WT_SKIN) || (type == LLWearableType::WT_HAIR) || (type == LLWearableType::WT_EYES)) && (getWearableCount(type) <= 1) ); } void LLAgentWearables::animateAllWearableParams(F32 delta, BOOL upload_bake) { - for( S32 type = 0; type < WT_COUNT; ++type ) + for( S32 type = 0; type < LLWearableType::WT_COUNT; ++type ) { - for (S32 count = 0; count < (S32)getWearableCount((EWearableType)type); ++count) + for (S32 count = 0; count < (S32)getWearableCount((LLWearableType::EType)type); ++count) { - LLWearable *wearable = getWearable((EWearableType)type,count); + LLWearable *wearable = getWearable((LLWearableType::EType)type,count); wearable->animateParams(delta, upload_bake); } } -- cgit v1.2.3 From 8487341b0f255e65044c3f7e3dc09461b4e2351e Mon Sep 17 00:00:00 2001 From: Nyx Linden Date: Wed, 19 May 2010 19:48:23 -0400 Subject: AVP-44 WIP Back-end support for multiwearables Changed a lot of areas of code that were not dealing with multiwearables properly. Little functionality changed, as the support mechanisms that were out of date were subtle, but getting closer to no further areas of code that don't properly support multi-wearables. Code reviewed by Vir. --- indra/newview/llagentwearables.cpp | 190 ++++--------------------------------- 1 file changed, 17 insertions(+), 173 deletions(-) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 3e73bbef15..545c5b845b 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -125,7 +125,6 @@ void LLAgentWearables::dump() } } -// MULTI-WEARABLE: debugging struct LLAgentDumper { LLAgentDumper(std::string name): @@ -191,7 +190,7 @@ LLAgentWearables::sendAgentWearablesUpdateCallback::~sendAgentWearablesUpdateCal * @param todo Bitmask of actions to take on completion. */ LLAgentWearables::addWearableToAgentInventoryCallback::addWearableToAgentInventoryCallback( - LLPointer cb, S32 type, U32 index, LLWearable* wearable, U32 todo) : + LLPointer cb, LLWearableType::EType type, U32 index, LLWearable* wearable, U32 todo) : mType(type), mIndex(index), mWearable(wearable), @@ -240,7 +239,7 @@ void LLAgentWearables::addWearableToAgentInventoryCallback::fire(const LLUUID& i } } -void LLAgentWearables::addWearabletoAgentInventoryDone(const S32 type, +void LLAgentWearables::addWearabletoAgentInventoryDone(const LLWearableType::EType type, const U32 index, const LLUUID& item_id, LLWearable* wearable) @@ -250,7 +249,7 @@ void LLAgentWearables::addWearabletoAgentInventoryDone(const S32 type, if (item_id.isNull()) return; - LLUUID old_item_id = getWearableItemID((LLWearableType::EType)type,index); + LLUUID old_item_id = getWearableItemID(type,index); if (wearable) { @@ -259,11 +258,11 @@ void LLAgentWearables::addWearabletoAgentInventoryDone(const S32 type, if (old_item_id.notNull()) { gInventory.addChangedMask(LLInventoryObserver::LABEL, old_item_id); - setWearable((LLWearableType::EType)type,index,wearable); + setWearable(type,index,wearable); } else { - pushWearable((LLWearableType::EType)type,wearable); + pushWearable(type,wearable); } } @@ -285,13 +284,12 @@ void LLAgentWearables::addWearabletoAgentInventoryDone(const S32 type, void LLAgentWearables::sendAgentWearablesUpdate() { - // MULTI-WEARABLE: call i "type" or something. // First make sure that we have inventory items for each wearable for (S32 type=0; type < LLWearableType::WT_COUNT; ++type) { - for (U32 j=0; j < getWearableCount((LLWearableType::EType)type); ++j) + for (U32 index=0; index < getWearableCount((LLWearableType::EType)type); ++index) { - LLWearable* wearable = getWearable((LLWearableType::EType)type,j); + LLWearable* wearable = getWearable((LLWearableType::EType)type,index); if (wearable) { if (wearable->getItemID().isNull()) @@ -299,8 +297,8 @@ void LLAgentWearables::sendAgentWearablesUpdate() LLPointer cb = new addWearableToAgentInventoryCallback( LLPointer(NULL), - type, - j, + (LLWearableType::EType)type, + index, wearable, addWearableToAgentInventoryCallback::CALL_NONE); addWearableToAgentInventory(cb, wearable); @@ -325,7 +323,7 @@ void LLAgentWearables::sendAgentWearablesUpdate() gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); lldebugs << "sendAgentWearablesUpdate()" << llendl; - // MULTI-WEARABLE: update for multi-wearables after server-side support is in. + // MULTI-WEARABLE: DEPRECATED: HACK: index to 0- server database tables don't support concept of multiwearables. for (S32 type=0; type < LLWearableType::WT_COUNT; ++type) { gMessageSystem->nextBlockFast(_PREHASH_WearableData); @@ -333,7 +331,6 @@ void LLAgentWearables::sendAgentWearablesUpdate() U8 type_u8 = (U8)type; gMessageSystem->addU8Fast(_PREHASH_WearableType, type_u8); - // MULTI-WEARABLE: TODO: hacked index to 0, needs to loop over all once messages support this. LLWearable* wearable = getWearable((LLWearableType::EType)type, 0); if (wearable) { @@ -405,7 +402,7 @@ void LLAgentWearables::saveWearable(const LLWearableType::EType type, const U32 LLPointer cb = new addWearableToAgentInventoryCallback( LLPointer(NULL), - (S32)type, + type, index, new_wearable, todo); @@ -871,7 +868,7 @@ BOOL LLAgentWearables::isWearingItem(const LLUUID& item_id) const return FALSE; } -// MULTI-WEARABLE: update for multiple +// MULTI-WEARABLE: DEPRECATED (see backwards compatibility) // static // ! BACKWARDS COMPATIBILITY ! When we stop supporting viewer1.23, we can assume // that viewers have a Current Outfit Folder and won't need this message, and thus @@ -909,7 +906,7 @@ void LLAgentWearables::processAgentInitialWearablesUpdate(LLMessageSystem* mesgs //lldebugs << "processAgentInitialWearablesUpdate()" << llendl; // Add wearables - // MULTI-WEARABLE: TODO: update once messages change. Currently use results to populate the zeroth element. + // MULTI-WEARABLE: DEPRECATED: Message only supports one wearable per type, will be ignored in future. gAgentWearables.mItemsAwaitingWearableUpdate.clear(); for (S32 i=0; i < num_wearables; i++) { @@ -939,10 +936,10 @@ void LLAgentWearables::processAgentInitialWearablesUpdate(LLMessageSystem* mesgs continue; } - // MULTI-WEARABLE: TODO: update once messages change. Currently use results to populate the zeroth element. + // MULTI-WEARABLE: DEPRECATED: this message only supports one wearable per type. Should be ignored in future versions // Store initial wearables data until we know whether we have the current outfit folder or need to use the data. - LLInitialWearablesFetch::InitialWearableData wearable_data(type, item_id, asset_id); // MULTI-WEARABLE: update + LLInitialWearablesFetch::InitialWearableData wearable_data(type, item_id, asset_id); outfit->add(wearable_data); } @@ -977,7 +974,6 @@ void LLAgentWearables::recoverMissingWearable(const LLWearableType::EType type, lldebugs << "Wearable " << LLWearableType::getTypeLabel(type) << " could not be downloaded. Replaced inventory item with default wearable." << llendl; LLWearable* new_wearable = LLWearableList::instance().createNewWearable(type); - S32 type_s32 = (S32) type; setWearable(type,index,new_wearable); //new_wearable->writeToAvatar(TRUE); @@ -988,7 +984,7 @@ void LLAgentWearables::recoverMissingWearable(const LLWearableType::EType type, LLPointer cb = new addWearableToAgentInventoryCallback( LLPointer(NULL), - type_s32, + type, index, new_wearable, addWearableToAgentInventoryCallback::CALL_RECOVERDONE); @@ -1172,158 +1168,6 @@ void LLAgentWearables::createStandardWearablesAllDone() gAgentAvatarp->onFirstTEMessageReceived(); } -// MULTI-WEARABLE: Properly handle multiwearables later. -void LLAgentWearables::getAllWearablesArray(LLDynamicArray& wearables) -{ - for( S32 i = 0; i < LLWearableType::WT_COUNT; ++i ) - { - if (getWearableCount((LLWearableType::EType) i) != 0) - { - wearables.push_back(i); - } - } -} - -// Note: wearables_to_include should be a list of LLWearableType::EType types -// attachments_to_include should be a list of attachment points -void LLAgentWearables::makeNewOutfit(const std::string& new_folder_name, - const LLDynamicArray& wearables_to_include, - const LLDynamicArray& attachments_to_include, - BOOL rename_clothing) -{ - if (!isAgentAvatarValid()) return; - - // First, make a folder in the Clothes directory. - LLUUID folder_id = gInventory.createNewCategory( - gInventory.findCategoryUUIDForType(LLFolderType::FT_CLOTHING), - LLFolderType::FT_NONE, - new_folder_name); - - bool found_first_item = false; - - /////////////////// - // Wearables - - if (wearables_to_include.count()) - { - // Then, iterate though each of the wearables and save copies of them in the folder. - S32 i; - S32 count = wearables_to_include.count(); - LLDynamicArray delete_items; - LLPointer cbdone = NULL; - for (i = 0; i < count; ++i) - { - const S32 type = wearables_to_include[i]; - for (U32 j=0; jgetTypeLabel()); - LLStringUtil::truncate(new_name, DB_INV_ITEM_NAME_STR_LEN); - new_wearable->setName(new_name); - } - - LLViewerInventoryItem* item = gInventory.getItem(getWearableItemID((LLWearableType::EType)type,j)); - S32 todo = addWearableToAgentInventoryCallback::CALL_NONE; - if (!found_first_item) - { - found_first_item = true; - /* set the focus to the first item */ - todo |= addWearableToAgentInventoryCallback::CALL_MAKENEWOUTFITDONE; - /* send the agent wearables update when done */ - cbdone = new sendAgentWearablesUpdateCallback; - } - LLPointer cb = - new addWearableToAgentInventoryCallback( - cbdone, - type, - j, - new_wearable, - todo); - llassert(item); - if (item) - { - if (isWearableCopyable((LLWearableType::EType)type, j)) - { - copy_inventory_item( - gAgent.getID(), - item->getPermissions().getOwner(), - item->getUUID(), - folder_id, - new_name, - cb); - } - else - { - move_inventory_item( - gAgent.getID(), - gAgent.getSessionID(), - item->getUUID(), - folder_id, - new_name, - cb); - } - } - } - } - } - gInventory.notifyObservers(); - } - - - /////////////////// - // Attachments - - if (attachments_to_include.count()) - { - BOOL msg_started = FALSE; - LLMessageSystem* msg = gMessageSystem; - for (S32 i = 0; i < attachments_to_include.count(); i++) - { - S32 attachment_pt = attachments_to_include[i]; - LLViewerJointAttachment* attachment = get_if_there(gAgentAvatarp->mAttachmentPoints, attachment_pt, (LLViewerJointAttachment*)NULL); - if (!attachment) continue; - for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin(); - attachment_iter != attachment->mAttachedObjects.end(); - ++attachment_iter) - { - LLViewerObject *attached_object = (*attachment_iter); - if(!attached_object) continue; - const LLUUID& item_id = (*attachment_iter)->getItemID(); - if(item_id.isNull()) continue; - LLInventoryItem* item = gInventory.getItem(item_id); - if(!item) continue; - if(!msg_started) - { - msg_started = TRUE; - msg->newMessage("CreateNewOutfitAttachments"); - msg->nextBlock("AgentData"); - msg->addUUID("AgentID", gAgent.getID()); - msg->addUUID("SessionID", gAgent.getSessionID()); - msg->nextBlock("HeaderData"); - msg->addUUID("NewFolderID", folder_id); - } - msg->nextBlock("ObjectData"); - msg->addUUID("OldItemID", item_id); - msg->addUUID("OldFolderID", item->getParentUUID()); - } - } - - if (msg_started) - { - gAgent.sendReliableMessage(); - } - - } -} class LLShowCreatedOutfit: public LLInventoryCallback { @@ -2010,7 +1854,7 @@ BOOL LLAgentWearables::areWearablesLoaded() const return mWearablesLoaded; } -// MULTI-WEARABLE: update for multiple indices. +// MULTI-WEARABLE: DEPRECATED: item pending count relies on old messages that don't support multi-wearables. do not trust to be accurate void LLAgentWearables::updateWearablesLoaded() { mWearablesLoaded = (itemUpdatePendingCount()==0); -- cgit v1.2.3 From 8025997c894955ccad2cded21b5dff27494bcc4e Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Mon, 24 May 2010 13:48:52 -0400 Subject: AVP-91 WIP Fix baked texture hashing First pass at fixing baked texture hashing - unified the hash code to one function, made sure all messages pass correct texture indices. Initial code review by Vir --- indra/newview/llagentwearables.cpp | 62 +++++++++++++++++++++++--------------- 1 file changed, 38 insertions(+), 24 deletions(-) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 545c5b845b..6b5e43973e 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1565,37 +1565,18 @@ void LLAgentWearables::queryWearableCache() S32 num_queries = 0; for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++) { - const LLVOAvatarDictionary::BakedEntry *baked_dict = LLVOAvatarDictionary::getInstance()->getBakedTexture((EBakedTextureIndex)baked_index); - LLMD5 hash; - bool hash_computed = false; - for (U8 i=0; i < baked_dict->mWearables.size(); i++) + LLUUID hash_id = computeBakedTextureHash((EBakedTextureIndex) baked_index); + if (hash_id.notNull()) { - const LLWearableType::EType baked_type = baked_dict->mWearables[i]; - const U32 num_wearables = getWearableCount(baked_type); - for (U32 index = 0; index < num_wearables; ++index) - { - const LLWearable* wearable = getWearable(baked_type,index); - if (wearable) - { - LLUUID asset_id = wearable->getAssetID(); - hash.update((const unsigned char*)asset_id.mData, UUID_BYTES); - hash_computed = true; - } - } - } - hash.finalize(); - if (hash_computed) - { - LLUUID hash_id; - hash.raw_digest(hash_id.mData); - hash_id ^= baked_dict->mWearablesHashID; num_queries++; // *NOTE: make sure at least one request gets packed + ETextureIndex te_index = LLVOAvatarDictionary::bakedToLocalTextureIndex((EBakedTextureIndex)baked_index); + //llinfos << "Requesting texture for hash " << hash << " in baked texture slot " << baked_index << llendl; gMessageSystem->nextBlockFast(_PREHASH_WearableData); gMessageSystem->addUUIDFast(_PREHASH_ID, hash_id); - gMessageSystem->addU8Fast(_PREHASH_TextureIndex, (U8)baked_index); + gMessageSystem->addU8Fast(_PREHASH_TextureIndex, (U8)te_index); } gAgentQueryManager.mActiveCacheQueries[baked_index] = gAgentQueryManager.mWearablesCacheQueryID; @@ -1607,6 +1588,39 @@ void LLAgentWearables::queryWearableCache() gAgentQueryManager.mWearablesCacheQueryID++; } +LLUUID LLAgentWearables::computeBakedTextureHash(LLVOAvatarDefines::EBakedTextureIndex index) +{ + LLUUID hash_id; + bool hash_computed = false; + LLMD5 hash; + + const LLVOAvatarDictionary::BakedEntry *baked_dict = LLVOAvatarDictionary::getInstance()->getBakedTexture(index); + + for (U8 i=0; i < baked_dict->mWearables.size(); i++) + { + const LLWearableType::EType baked_type = baked_dict->mWearables[i]; + const U32 num_wearables = getWearableCount(baked_type); + for (U32 index = 0; index < num_wearables; ++index) + { + const LLWearable* wearable = getWearable(baked_type,index); + if (wearable) + { + LLUUID asset_id = wearable->getAssetID(); + hash.update((const unsigned char*)asset_id.mData, UUID_BYTES); + hash_computed = true; + } + } + } + if (hash_computed) + { + hash.update((const unsigned char*)baked_dict->mWearablesHashID.mData, UUID_BYTES); + hash.finalize(); + hash.raw_digest(hash_id.mData); + } + + return hash_id; +} + // User has picked "remove from avatar" from a menu. // static void LLAgentWearables::userRemoveWearable(const LLWearableType::EType &type, const U32 &index) -- cgit v1.2.3 From cb0589715265dc1568626fe238aac7417b44ef89 Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Tue, 25 May 2010 14:17:11 +0300 Subject: EXT-6726 WIP Added handlers for most of Appearance SP context/gear menus. Reviewed by Mike Antipov and Nyx at https://codereview.productengine.com/secondlife/r/428/ --HG-- branch : product-engine --- indra/newview/llagentwearables.cpp | 62 ++++++++++++++++++++++++++++++++------ 1 file changed, 53 insertions(+), 9 deletions(-) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 6b5e43973e..68c4fa1ea0 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -49,6 +49,7 @@ #include "llmd5.h" #include "llnotificationsutil.h" #include "llpaneloutfitsinventory.h" +#include "llsidepanelappearance.h" #include "llsidetray.h" #include "lltexlayer.h" #include "llviewerregion.h" @@ -539,9 +540,15 @@ void LLAgentWearables::setWearableName(const LLUUID& item_id, const std::string& BOOL LLAgentWearables::isWearableModifiable(LLWearableType::EType type, U32 index) const { LLUUID item_id = getWearableItemID(type, index); - if (!item_id.isNull()) + return item_id.notNull() ? isWearableModifiable(item_id) : FALSE; +} + +BOOL LLAgentWearables::isWearableModifiable(const LLUUID& item_id) const +{ + const LLUUID& linked_id = gInventory.getLinkedItemID(item_id); + if (linked_id.notNull()) { - LLInventoryItem* item = gInventory.getItem(item_id); + LLInventoryItem* item = gInventory.getItem(linked_id); if (item && item->getPermissions().allowModifyBy(gAgent.getID(), gAgent.getGroupID())) { @@ -595,12 +602,13 @@ LLInventoryItem* LLAgentWearables::getWearableInventoryItem(LLWearableType::ETyp const LLWearable* LLAgentWearables::getWearableFromItemID(const LLUUID& item_id) const { + const LLUUID& base_item_id = gInventory.getLinkedItemID(item_id); for (S32 i=0; i < LLWearableType::WT_COUNT; i++) { for (U32 j=0; j < getWearableCount((LLWearableType::EType)i); j++) { const LLWearable * curr_wearable = getWearable((LLWearableType::EType)i, j); - if (curr_wearable && (curr_wearable->getItemID() == item_id)) + if (curr_wearable && (curr_wearable->getItemID() == base_item_id)) { return curr_wearable; } @@ -812,6 +820,16 @@ LLWearable* LLAgentWearables::getTopWearable(const LLWearableType::EType type) return getWearable(type, count-1); } +LLWearable* LLAgentWearables::getBottomWearable(const LLWearableType::EType type) +{ + if (getWearableCount(type) == 0) + { + return NULL; + } + + return getWearable(type, 0); +} + U32 LLAgentWearables::getWearableCount(const LLWearableType::EType type) const { wearableentry_map_t::const_iterator wearable_iter = mWearableDatas.find(type); @@ -860,12 +878,7 @@ const LLUUID LLAgentWearables::getWearableAssetID(LLWearableType::EType type, U3 BOOL LLAgentWearables::isWearingItem(const LLUUID& item_id) const { - const LLUUID& base_item_id = gInventory.getLinkedItemID(item_id); - if (getWearableFromItemID(base_item_id) != NULL) - { - return TRUE; - } - return FALSE; + return getWearableFromItemID(item_id) != NULL; } // MULTI-WEARABLE: DEPRECATED (see backwards compatibility) @@ -1862,6 +1875,20 @@ void LLAgentWearables::checkWearablesLoaded() const #endif } +// Returns false if the given wearable is already topmost/bottommost +// (depending on closer_to_body parameter). +bool LLAgentWearables::canMoveWearable(const LLUUID& item_id, bool closer_to_body) +{ + const LLWearable* wearable = getWearableFromItemID(item_id); + if (!wearable) return false; + + LLWearableType::EType wtype = wearable->getType(); + const LLWearable* marginal_wearable = closer_to_body ? getBottomWearable(wtype) : getTopWearable(wtype); + if (!marginal_wearable) return false; + + return wearable != marginal_wearable; +} + BOOL LLAgentWearables::areWearablesLoaded() const { checkWearablesLoaded(); @@ -1932,6 +1959,23 @@ bool LLAgentWearables::moveWearable(const LLViewerInventoryItem* item, bool clos return false; } +// static +void LLAgentWearables::editWearable(const LLUUID& item_id) +{ + LLViewerInventoryItem* item; + LLWearable* wearable; + + if ((item = gInventory.getLinkedItem(item_id)) && + (wearable = gAgentWearables.getWearableFromAssetID(item->getAssetUUID())) && + gAgentWearables.isWearableModifiable(item->getUUID()) && + item->isFinished()) + { + LLPanel* panel = LLSideTray::getInstance()->showPanel("panel_outfit_edit", LLSD()); + // copied from LLPanelOutfitEdit::onEditWearableClicked() + LLSidepanelAppearance::editWearable(wearable, panel->getParent()); + } +} + void LLAgentWearables::updateServer() { sendAgentWearablesUpdate(); -- cgit v1.2.3 From 1084bfef0057de5cd3201426aaad68329a62a0da Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Wed, 26 May 2010 13:27:19 -0400 Subject: EXT-7213 WIP kill old appearance editor and all traces of code part 2 - correcting a few points that would have broken the build. Final version will be reviewed before pushing. --- indra/newview/llagentwearables.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 68c4fa1ea0..0f9ab6cfa1 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -617,6 +617,23 @@ const LLWearable* LLAgentWearables::getWearableFromItemID(const LLUUID& item_id) return NULL; } +LLWearable* LLAgentWearables::getWearableFromItemID(const LLUUID& item_id) +{ + const LLUUID& base_item_id = gInventory.getLinkedItemID(item_id); + for (S32 i=0; i < LLWearableType::WT_COUNT; i++) + { + for (U32 j=0; j < getWearableCount((LLWearableType::EType)i); j++) + { + LLWearable * curr_wearable = getWearable((LLWearableType::EType)i, j); + if (curr_wearable && (curr_wearable->getItemID() == base_item_id)) + { + return curr_wearable; + } + } + } + return NULL; +} + LLWearable* LLAgentWearables::getWearableFromAssetID(const LLUUID& asset_id) { for (S32 i=0; i < LLWearableType::WT_COUNT; i++) -- cgit v1.2.3 From ec7dbc704040dfcdcd101f090dbb2f780ca0ee8a Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Wed, 26 May 2010 18:22:04 -0400 Subject: EXT-7213 WIP kill old appearance editor and traces of code Removed last remaining references to gFloaterCustomize. Next step: kill the files themselves. Will be reviewed when complete, before pushing --- indra/newview/llagentwearables.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 0f9ab6cfa1..1deba2e2e6 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1676,14 +1676,12 @@ void LLAgentWearables::userRemoveWearablesOfType(const LLWearableType::EType &ty void LLAgentWearables::userRemoveAllClothes() { // We have to do this up front to avoid having to deal with the case of multiple wearables being dirty. - if (gFloaterCustomize) + if (gAgentCamera.cameraCustomizeAvatar()) { - gFloaterCustomize->askToSaveIfDirty(userRemoveAllClothesStep2); - } - else - { - userRemoveAllClothesStep2(TRUE); + // switching to outfit editor should automagically save any currently edited wearable + LLSideTray::getInstance()->showPanel("sidepanel_appearance", LLSD().with("type", "edit_outfit")); } + userRemoveAllClothesStep2(TRUE); } // static -- cgit v1.2.3 From cd46893057b9ec7d309059eff3f503cfaf46de56 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Thu, 27 May 2010 14:40:49 -0400 Subject: EXT-7209 EXT-7366 EXT-7213 FIX EXT-7392 WIP Final fixes for: EXT-7209 camera to enter appearance edit mode EXT-7366 change camera to face front of avatar in previews EXT-7213 kill old appearance editor Partial fix for: EXT-7392 alpha mask checkboxes are not hooked up All changes code reviewed by vir. Following commits (plus this one) reviewed with this checkin: 425d4e960450 15d04b6464a7 e92ae606de12 adc94512ea9b 24577dbbf7a4 6f28b241eae2 (sorry dessie! :) ) --- indra/newview/llagentwearables.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 1deba2e2e6..cc9e68d593 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -39,7 +39,6 @@ #include "llagentwearablesfetch.h" #include "llappearancemgr.h" #include "llcallbacklist.h" -#include "llfloatercustomize.h" #include "llfolderview.h" #include "llgesturemgr.h" #include "llinventorybridge.h" -- cgit v1.2.3 From e07deaa3dac6b9bc651034543c174e974b4b9ad2 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Fri, 28 May 2010 11:38:37 -0400 Subject: AVP-44 WIP architectural cleanup for multi-wearables Implemented some resident-suggested tweaks to better support multiwearables code reviewed by Seraph --- indra/newview/llagentwearables.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index cc9e68d593..e5796f8e63 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -718,16 +718,16 @@ U32 LLAgentWearables::pushWearable(const LLWearableType::EType type, LLWearable { // no null wearables please! llwarns << "Null wearable sent for type " << type << llendl; - return MAX_WEARABLES_PER_TYPE; + return MAX_CLOTHING_PER_TYPE; } - if (type < LLWearableType::WT_COUNT || mWearableDatas[type].size() < MAX_WEARABLES_PER_TYPE) + if (type < LLWearableType::WT_COUNT || mWearableDatas[type].size() < MAX_CLOTHING_PER_TYPE) { mWearableDatas[type].push_back(wearable); wearableUpdated(wearable); checkWearableAgainstInventory(wearable); return mWearableDatas[type].size()-1; } - return MAX_WEARABLES_PER_TYPE; + return MAX_CLOTHING_PER_TYPE; } void LLAgentWearables::wearableUpdated(LLWearable *wearable) @@ -764,7 +764,7 @@ void LLAgentWearables::popWearable(LLWearable *wearable) U32 index = getWearableIndex(wearable); LLWearableType::EType type = wearable->getType(); - if (index < MAX_WEARABLES_PER_TYPE && index < getWearableCount(type)) + if (index < MAX_CLOTHING_PER_TYPE && index < getWearableCount(type)) { popWearable(type, index); } @@ -785,7 +785,7 @@ U32 LLAgentWearables::getWearableIndex(LLWearable *wearable) { if (wearable == NULL) { - return MAX_WEARABLES_PER_TYPE; + return MAX_CLOTHING_PER_TYPE; } const LLWearableType::EType type = wearable->getType(); @@ -793,7 +793,7 @@ U32 LLAgentWearables::getWearableIndex(LLWearable *wearable) if (wearable_iter == mWearableDatas.end()) { llwarns << "tried to get wearable index with an invalid type!" << llendl; - return MAX_WEARABLES_PER_TYPE; + return MAX_CLOTHING_PER_TYPE; } const wearableentry_vec_t& wearable_vec = wearable_iter->second; for(U32 index = 0; index < wearable_vec.size(); index++) @@ -804,7 +804,7 @@ U32 LLAgentWearables::getWearableIndex(LLWearable *wearable) } } - return MAX_WEARABLES_PER_TYPE; + return MAX_CLOTHING_PER_TYPE; } const LLWearable* LLAgentWearables::getWearable(const LLWearableType::EType type, U32 index) const -- cgit v1.2.3 From 5a8063a0b8c4f4a695fd13eadf0b0ca9605f40dc Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 28 May 2010 17:58:29 -0400 Subject: texture logging - WIP --- indra/newview/llagentwearables.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index cc9e68d593..066e082cae 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1445,6 +1445,8 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it queryWearableCache(); updateServer(); + gAgentAvatarp->dumpAvatarTEs("setWearableOutfit"); + lldebugs << "setWearableOutfit() end" << llendl; } -- cgit v1.2.3 From 671625695fc44adc430a7ddf3be158ce26a61cc6 Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Wed, 2 Jun 2010 20:46:16 +0300 Subject: EXT-6726 WIP Added more menus to the Appearance SP. Done: - Implemented creating new wearables via My Outfits gear menu. - Implemented renaming/removing/editing an outfit via My Outfits context menu. - Implemented "Attach to..." / "Attach to HUD..." context submenus. - Now disabling (instead of hiding) irrelevant wearable context menu items. - Added "Take Off / Detach" context menu item that's shown for clothes and attachments. Useful if you selected a bunch of items and want to take them all off. - Fixed taking off an outfit (not all wearables were taken off because of a wrong inventory collector). - Fixed crash when editing a skirt (reference to a missing string). - In LLWearableItemsList::ContextMenu::updateItemsVisibility renamed variables and introduced MASK_UNKNOWN per Nyx's request. Known issues: - "Attach to..." context menus may be displayed partially off-screen (there is the same bug in the inventory panel). - The way we invoke wearable editing panel after the wearable gets created is currently a hack. TODO: - Wear / take off / rename / delete an outfit via My Outfits gear menu (currently not implemented because of missing selection support in My Outfits). - Add "Create new..." to body part / clothing context menu in Edit Outfit. - Add "Create new..." submenus to the Edit Outfit gear menu. Reviewed by Nyx at https://codereview.productengine.com/secondlife/r/466/ --HG-- branch : product-engine --- indra/newview/llagentwearables.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index e5796f8e63..d2a01aba16 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1973,6 +1973,32 @@ bool LLAgentWearables::moveWearable(const LLViewerInventoryItem* item, bool clos return false; } +// static +void LLAgentWearables::createWearable(LLWearableType::EType type, bool wear, const LLUUID& parent_id) +{ + LLWearable* wearable = LLWearableList::instance().createNewWearable(type); + LLAssetType::EType asset_type = wearable->getAssetType(); + LLInventoryType::EType inv_type = LLInventoryType::IT_WEARABLE; + LLPointer cb = wear ? new WearOnAvatarCallback : NULL; + LLUUID folder_id; + + if (parent_id.notNull()) + { + folder_id = parent_id; + } + else + { + LLFolderType::EType folder_type = LLFolderType::assetTypeToFolderType(asset_type); + folder_id = gInventory.findCategoryUUIDForType(folder_type); + } + + create_inventory_item(gAgent.getID(), gAgent.getSessionID(), + folder_id, wearable->getTransactionID(), wearable->getName(), + wearable->getDescription(), asset_type, inv_type, wearable->getType(), + wearable->getPermissions().getMaskNextOwner(), + cb); +} + // static void LLAgentWearables::editWearable(const LLUUID& item_id) { -- cgit v1.2.3 From 4f95701895a07066d5b46649d720335da1b62e71 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Thu, 3 Jun 2010 14:25:32 -0400 Subject: EXT-7504 WIP Force decloud after timeout using lower res textures EXT-7626 FIXED LLTexLayer header file cleanup EXT-7628 FIXED Don't cache lower res baked textures Added more information into the texture debug view. Mangled hash when uploading lower res baked textures so they're not cached Lots of superficial cleanup on lltexlayer and associated classes. Removed some unused functions and member variables as well. --- indra/newview/llagentwearables.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index e5796f8e63..5dde626ea8 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1617,13 +1617,13 @@ void LLAgentWearables::queryWearableCache() gAgentQueryManager.mWearablesCacheQueryID++; } -LLUUID LLAgentWearables::computeBakedTextureHash(LLVOAvatarDefines::EBakedTextureIndex index) +LLUUID LLAgentWearables::computeBakedTextureHash(LLVOAvatarDefines::EBakedTextureIndex baked_index, + BOOL generate_valid_hash) // Set to false if you want to upload the baked texture w/o putting it in the cache { LLUUID hash_id; bool hash_computed = false; LLMD5 hash; - - const LLVOAvatarDictionary::BakedEntry *baked_dict = LLVOAvatarDictionary::getInstance()->getBakedTexture(index); + const LLVOAvatarDictionary::BakedEntry *baked_dict = LLVOAvatarDictionary::getInstance()->getBakedTexture(baked_index); for (U8 i=0; i < baked_dict->mWearables.size(); i++) { @@ -1636,6 +1636,10 @@ LLUUID LLAgentWearables::computeBakedTextureHash(LLVOAvatarDefines::EBakedTextur { LLUUID asset_id = wearable->getAssetID(); hash.update((const unsigned char*)asset_id.mData, UUID_BYTES); + if (!generate_valid_hash) + { + hash.update((const unsigned char*)asset_id.mData, UUID_BYTES); + } hash_computed = true; } } -- cgit v1.2.3 From 0309a18d1ae746d06803b222b48a4ffb6eeafdf3 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Fri, 4 Jun 2010 10:23:11 -0400 Subject: EXT-7628 FIXED Don't cache lower res baked textures Changed hash mangling algorithm slightly. --- indra/newview/llagentwearables.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index e0104eddf0..d823a3cbbb 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1638,10 +1638,6 @@ LLUUID LLAgentWearables::computeBakedTextureHash(LLVOAvatarDefines::EBakedTextur { LLUUID asset_id = wearable->getAssetID(); hash.update((const unsigned char*)asset_id.mData, UUID_BYTES); - if (!generate_valid_hash) - { - hash.update((const unsigned char*)asset_id.mData, UUID_BYTES); - } hash_computed = true; } } @@ -1649,6 +1645,15 @@ LLUUID LLAgentWearables::computeBakedTextureHash(LLVOAvatarDefines::EBakedTextur if (hash_computed) { hash.update((const unsigned char*)baked_dict->mWearablesHashID.mData, UUID_BYTES); + + // Add some garbage into the hash so that it becomes invalid. + if (!generate_valid_hash) + { + if (isAgentAvatarValid()) + { + hash.update((const unsigned char*)gAgentAvatarp->getID().mData, UUID_BYTES); + } + } hash.finalize(); hash.raw_digest(hash_id.mData); } -- cgit v1.2.3 From d17b616b1c94c136254de0bee039cdc87979b44e Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Tue, 8 Jun 2010 17:01:29 +0300 Subject: EXT-7627 FIXED Wearing an item now doesn't open the wearable editing panel. Fix: - Save the UUID of a newly created wearable to start editing it right after it gets worn. This approach replaces a temporary hack that invoked the editing panel whenever an item gets worn (if the Appearance SP is opened at the time). The hack only happened to work sometimes because the editing panel failed to open. Other changes: - Removed a check for inventory item completeness from LLAgentWearables::editWearable(). because the check often fails and doesn't appear to be needed at all. - Added warning messages to LLAgentWearables::editWearable() so that it's easier to debug. - Replaced duplicated code in LLPanelOutfitEdit::onEditWearableClicked() with a call to gAgentWearables.editWearable(). Reviewed by Nyx at https://codereview.productengine.com/secondlife/r/529/ --HG-- branch : product-engine --- indra/newview/llagentwearables.cpp | 66 ++++++++++++++++++++++++++++++++------ 1 file changed, 56 insertions(+), 10 deletions(-) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index d823a3cbbb..cfa0a4d729 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -64,6 +64,25 @@ BOOL LLAgentWearables::mInitialWearablesUpdateReceived = FALSE; using namespace LLVOAvatarDefines; +/////////////////////////////////////////////////////////////////////////////// + +// Callback to wear and start editing an item that has just been created. +class LLWearAndEditCallback : public LLInventoryCallback +{ + void fire(const LLUUID& inv_item) + { + if (inv_item.isNull()) return; + + // Request editing the item after it gets worn. + gAgentWearables.requestEditingWearable(inv_item); + + // Wear it. + LLAppearanceMgr::instance().wearItemOnAvatar(inv_item); + } +}; + +/////////////////////////////////////////////////////////////////////////////// + // HACK: For EXT-3923: Pants item shows in inventory with skin icon and messes with "current look" // Some db items are corrupted, have inventory flags = 0, implying wearable type = shape, even though // wearable type stored in asset is some other value. @@ -1990,7 +2009,7 @@ void LLAgentWearables::createWearable(LLWearableType::EType type, bool wear, con LLWearable* wearable = LLWearableList::instance().createNewWearable(type); LLAssetType::EType asset_type = wearable->getAssetType(); LLInventoryType::EType inv_type = LLInventoryType::IT_WEARABLE; - LLPointer cb = wear ? new WearOnAvatarCallback : NULL; + LLPointer cb = wear ? new LLWearAndEditCallback : NULL; LLUUID folder_id; if (parent_id.notNull()) @@ -2013,17 +2032,44 @@ void LLAgentWearables::createWearable(LLWearableType::EType type, bool wear, con // static void LLAgentWearables::editWearable(const LLUUID& item_id) { - LLViewerInventoryItem* item; - LLWearable* wearable; + LLViewerInventoryItem* item = gInventory.getLinkedItem(item_id); + if (!item) + { + llwarns << "Failed to get linked item" << llendl; + return; + } + + LLWearable* wearable = gAgentWearables.getWearableFromItemID(item_id); + if (!wearable) + { + llwarns << "Cannot get wearable" << llendl; + return; + } + + if (!gAgentWearables.isWearableModifiable(item->getUUID())) + { + llwarns << "Cannot modify wearable" << llendl; + return; + } + + LLPanel* panel = LLSideTray::getInstance()->getPanel("sidepanel_appearance"); + LLSidepanelAppearance::editWearable(wearable, panel); +} + +// Request editing the item after it gets worn. +void LLAgentWearables::requestEditingWearable(const LLUUID& item_id) +{ + mItemToEdit = gInventory.getLinkedItemID(item_id); +} - if ((item = gInventory.getLinkedItem(item_id)) && - (wearable = gAgentWearables.getWearableFromAssetID(item->getAssetUUID())) && - gAgentWearables.isWearableModifiable(item->getUUID()) && - item->isFinished()) +// Start editing the item if previously requested. +void LLAgentWearables::editWearableIfRequested(const LLUUID& item_id) +{ + if (mItemToEdit.notNull() && + mItemToEdit == gInventory.getLinkedItemID(item_id)) { - LLPanel* panel = LLSideTray::getInstance()->showPanel("panel_outfit_edit", LLSD()); - // copied from LLPanelOutfitEdit::onEditWearableClicked() - LLSidepanelAppearance::editWearable(wearable, panel->getParent()); + LLAgentWearables::editWearable(item_id); + mItemToEdit.setNull(); } } -- cgit v1.2.3 From 56da8017d9622e092947b504813d8a40d21310a6 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Tue, 8 Jun 2010 14:52:22 -0700 Subject: EXT-7210 Baked textures should only be updated when outfit changes are saved or outfit editor is exited. reviewed and contributed to by Nyx --- indra/newview/llagentwearables.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index cfa0a4d729..acf43dda1e 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -751,7 +751,7 @@ U32 LLAgentWearables::pushWearable(const LLWearableType::EType type, LLWearable void LLAgentWearables::wearableUpdated(LLWearable *wearable) { - gAgentAvatarp->wearableUpdated(wearable->getType(), TRUE); + gAgentAvatarp->wearableUpdated(wearable->getType(), FALSE); wearable->refreshName(); wearable->setLabelUpdated(); @@ -795,7 +795,7 @@ void LLAgentWearables::popWearable(const LLWearableType::EType type, U32 index) if (wearable) { mWearableDatas[type].erase(mWearableDatas[type].begin() + index); - gAgentAvatarp->wearableUpdated(wearable->getType(), TRUE); + gAgentAvatarp->wearableUpdated(wearable->getType(), FALSE); wearable->setLabelUpdated(); } } -- cgit v1.2.3