diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llagentwearables.cpp | 69 | ||||
-rw-r--r-- | indra/newview/llappearancemgr.cpp | 31 | ||||
-rw-r--r-- | indra/newview/llinventorybridge.cpp | 30 |
3 files changed, 19 insertions, 111 deletions
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 5eb943877a..a22e872517 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -56,8 +56,6 @@ #include <boost/scoped_ptr.hpp> -#define USE_CURRENT_OUTFIT_FOLDER - //-------------------------------------------------------------------- // Classes for fetching initial wearables data //-------------------------------------------------------------------- @@ -1046,64 +1044,6 @@ void LLAgentWearables::processAgentInitialWearablesUpdate(LLMessageSystem* mesgs } } -// A single wearable that the avatar was wearing on start-up has arrived from the database. -// static -void LLAgentWearables::onInitialWearableAssetArrived(LLWearable* wearable, void* userdata) -{ - boost::scoped_ptr<LLInitialWearablesFetch::InitialWearableData> wear_data((LLInitialWearablesFetch::InitialWearableData*)userdata); - const EWearableType type = wear_data->mType; - U32 index = 0; - - LLVOAvatarSelf* avatarp = gAgent.getAvatarObject(); - if (!avatarp) - { - return; - } - - if (wearable) - { - llassert(type == wearable->getType()); - wearable->setItemID(wear_data->mItemID); - index = gAgentWearables.pushWearable(type, wearable); - gAgentWearables.mItemsAwaitingWearableUpdate.erase(wear_data->mItemID); - - // disable composites if initial textures are baked - avatarp->setupComposites(); - - avatarp->setCompositeUpdatesEnabled(TRUE); - gInventory.addChangedMask(LLInventoryObserver::LABEL, wearable->getItemID()); - } - else - { - // Somehow the asset doesn't exist in the database. - gAgentWearables.recoverMissingWearable(type,index); - } - - - gInventory.notifyObservers(); - - // Have all the wearables that the avatar was wearing at log-in arrived? - // MULTI-WEARABLE: update when multiple wearables can arrive per type. - - gAgentWearables.updateWearablesLoaded(); - if (gAgentWearables.areWearablesLoaded()) - { - - // Can't query cache until all wearables have arrived, so calling this earlier is a no-op. - gAgentWearables.queryWearableCache(); - - // Make sure that the server's idea of the avatar's wearables actually match the wearables. - gAgent.sendAgentSetAppearance(); - - // Check to see if there are any baked textures that we hadn't uploaded before we logged off last time. - // If there are any, schedule them to be uploaded as soon as the layer textures they depend on arrive. - if (gAgentCamera.cameraCustomizeAvatar()) - { - avatarp->requestLayerSetUploads(); - } - } -} - // 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.) @@ -2693,16 +2633,7 @@ void LLInitialWearablesFetch::processWearablesMessage() if (wearable_data->mAssetID.notNull()) { -#ifdef USE_CURRENT_OUTFIT_FOLDER ids.push_back(wearable_data->mItemID); -#endif -#if 0 -// // Fetch the wearables -// LLWearableList::instance().getAsset(wearable_data->mAssetID, -// LLStringUtil::null, -// LLWearableDictionary::getAssetType(wearable_data->mType), -// LLAgentWearables::onInitialWearableAssetArrived, (void*)(wearable_data)); -#endif } else { diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index b3dfb8f141..c15f1efb9b 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -368,6 +368,7 @@ public: void recoverMissingWearable(EWearableType type); void clearCOFLinksForMissingWearables(); + void onWearableAssetFetch(LLWearable *wearable); void onAllComplete(); typedef std::list<LLFoundData> found_list_t; @@ -657,11 +658,10 @@ bool LLWearableHoldingPattern::pollMissingWearables() return done; } -static void onWearableAssetFetch(LLWearable* wearable, void* data) +void LLWearableHoldingPattern::onWearableAssetFetch(LLWearable *wearable) { - LLWearableHoldingPattern* holder = (LLWearableHoldingPattern*)data; - holder->mResolved += 1; // just counting callbacks, not successes. - llinfos << "onWearableAssetFetch, resolved count " << holder->mResolved << " of requested " << holder->mFoundList.size() << llendl; + mResolved += 1; // just counting callbacks, not successes. + llinfos << "onWearableAssetFetch, resolved count " << mResolved << " of requested " << mFoundList.size() << llendl; if (wearable) { llinfos << "wearable found, type " << wearable->getType() << " asset " << wearable->getAssetID() << llendl; @@ -671,7 +671,7 @@ static void onWearableAssetFetch(LLWearable* wearable, void* data) llwarns << "no wearable found" << llendl; } - if (holder->mFired) + if (mFired) { llwarns << "called after holder fired" << llendl; return; @@ -682,8 +682,8 @@ static void onWearableAssetFetch(LLWearable* wearable, void* data) return; } - for (LLWearableHoldingPattern::found_list_t::iterator iter = holder->mFoundList.begin(); - iter != holder->mFoundList.end(); ++iter) + for (LLWearableHoldingPattern::found_list_t::iterator iter = mFoundList.begin(); + iter != mFoundList.end(); ++iter) { LLFoundData& data = *iter; if(wearable->getAssetID() == data.mAssetID) @@ -696,6 +696,12 @@ static void onWearableAssetFetch(LLWearable* wearable, void* data) } } +static void onWearableAssetFetch(LLWearable* wearable, void* data) +{ + LLWearableHoldingPattern* holder = (LLWearableHoldingPattern*)data; + holder->onWearableAssetFetch(wearable); +} + static void removeDuplicateItems(LLInventoryModel::item_array_t& items) { @@ -1186,9 +1192,6 @@ void LLAppearanceManager::updateAppearanceFromCOF() // callback will be called (and this object deleted) // before the final getNextData(). - // BAP future cleanup - no point having found_container when - // mFoundList already has all the info. - LLDynamicArray<LLFoundData> found_container; for(S32 i = 0; i < wear_items.count(); ++i) { LLViewerInventoryItem *item = wear_items.get(i); @@ -1214,7 +1217,6 @@ void LLAppearanceManager::updateAppearanceFromCOF() #endif holder->mFoundList.push_front(found); - found_container.put(found); } else { @@ -1229,9 +1231,10 @@ void LLAppearanceManager::updateAppearanceFromCOF() } } - for(S32 i = 0; i < found_container.count(); ++i) + for (LLWearableHoldingPattern::found_list_t::iterator it = holder->mFoundList.begin(); + it != holder->mFoundList.end(); ++it) { - LLFoundData& found = found_container.get(i); + LLFoundData& found = *it; llinfos << "waiting for onWearableAssetFetch callback, asset " << found.mAssetID.asString() << llendl; @@ -1248,7 +1251,6 @@ void LLAppearanceManager::updateAppearanceFromCOF() { doOnIdleRepeating(boost::bind(&LLWearableHoldingPattern::pollFetchCompletion,holder)); } - } void LLAppearanceManager::getDescendentsOfAssetType(const LLUUID& category, @@ -1507,6 +1509,7 @@ void LLAppearanceManager::addCOFItemLink(const LLInventoryItem *item, bool do_up return; } +// BAP remove ensemble code for 2.1? void LLAppearanceManager::addEnsembleLink( LLInventoryCategory* cat, bool do_update ) { #if SUPPORT_ENSEMBLES diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index da21939a61..91a9ee03c8 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -4969,20 +4969,7 @@ void LLWearableBridge::onRemoveFromAvatarArrived(LLWearable* wearable, } // Find and remove this item from the COF. - // FIXME 2.1 - call removeCOFItemLinks in llappearancemgr instead. - LLInventoryModel::item_array_t items = gInventory.collectLinkedItems(item_id, LLAppearanceManager::instance().getCOF()); - if (items.size() != 1) - { - llwarns << "Found " << items.size() << " COF links to " << item_id.asString() << ", expected 1" << llendl; - } - for (LLInventoryModel::item_array_t::const_iterator iter = items.begin(); - iter != items.end(); - ++iter) - { - const LLViewerInventoryItem *linked_item = (*iter); - const LLUUID &item_id = linked_item->getUUID(); - gInventory.purgeObject(item_id); - } + LLAppearanceManager::instance().removeCOFItemLinks(item_id,false); gInventory.notifyObservers(); delete on_remove_struct; @@ -5008,20 +4995,7 @@ void LLWearableBridge::removeAllClothesFromAvatar() continue; // Find and remove this item from the COF. - LLInventoryModel::item_array_t items = gInventory.collectLinkedItems( - item_id, LLAppearanceManager::instance().getCOF()); - if (items.size() != 1) - { - llwarns << "Found " << items.size() << " COF links to " << item_id.asString() << ", expected 1" << llendl; - } - for (LLInventoryModel::item_array_t::const_iterator iter = items.begin(); - iter != items.end(); - ++iter) - { - const LLViewerInventoryItem *linked_item = (*iter); - const LLUUID &item_id = linked_item->getUUID(); - gInventory.purgeObject(item_id); - } + LLAppearanceManager::instance().removeCOFItemLinks(item_id,false); } gInventory.notifyObservers(); |