diff options
Diffstat (limited to 'indra/newview/llagentwearables.cpp')
-rwxr-xr-x | indra/newview/llagentwearables.cpp | 107 |
1 files changed, 14 insertions, 93 deletions
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 8501436b5b..77fd66e4ba 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -194,11 +194,6 @@ LLAgentWearables::createStandardWearablesAllDoneCallback::~createStandardWearabl gAgentWearables.createStandardWearablesAllDone(); } -LLAgentWearables::sendAgentWearablesUpdateCallback::~sendAgentWearablesUpdateCallback() -{ - gAgentWearables.sendAgentWearablesUpdate(); -} - /** * @brief Construct a callback for dealing with the wearables. * @@ -304,6 +299,7 @@ void LLAgentWearables::addWearabletoAgentInventoryDone(const LLWearableType::ETy gInventory.notifyObservers(); } +// SUNSHINE CLEANUP dead? void LLAgentWearables::sendAgentWearablesUpdate() { // First make sure that we have inventory items for each wearable @@ -440,7 +436,7 @@ void LLAgentWearables::saveWearable(const LLWearableType::EType type, const U32 return; } - gAgentAvatarp->wearableUpdated( type, TRUE ); + gAgentAvatarp->wearableUpdated(type); if (send_update) { @@ -521,8 +517,6 @@ void LLAgentWearables::revertWearable(const LLWearableType::EType type, const U3 { wearable->revertValues(); } - - gAgent.sendAgentSetAppearance(); } void LLAgentWearables::saveAllWearables() @@ -717,8 +711,7 @@ void LLAgentWearables::wearableUpdated(LLWearable *wearable, BOOL removed) { if (isAgentAvatarValid()) { - const BOOL upload_result = removed; - gAgentAvatarp->wearableUpdated(wearable->getType(), upload_result); + gAgentAvatarp->wearableUpdated(wearable->getType()); } LLWearableData::wearableUpdated(wearable, removed); @@ -779,10 +772,11 @@ BOOL LLAgentWearables::isWearingItem(const LLUUID& item_id) const } // 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 // we can remove/ignore this whole function. EXCEPT gAgentWearables.notifyLoadingStarted + +// static void LLAgentWearables::processAgentInitialWearablesUpdate(LLMessageSystem* mesgsys, void** user_data) { // We should only receive this message a single time. Ignore subsequent AgentWearablesUpdates @@ -808,7 +802,8 @@ void LLAgentWearables::processAgentInitialWearablesUpdate(LLMessageSystem* mesgs if (isAgentAvatarValid() && (agent_id == gAgentAvatarp->getID())) { - gMessageSystem->getU32Fast(_PREHASH_AgentData, _PREHASH_SerialNum, gAgentQueryManager.mUpdateSerialNum); + U32 unused_update_serial_num; + gMessageSystem->getU32Fast(_PREHASH_AgentData, _PREHASH_SerialNum, unused_update_serial_num); const S32 NUM_BODY_PARTS = 4; S32 num_wearables = gMessageSystem->getNumberOfBlocksFast(_PREHASH_WearableData); @@ -848,7 +843,7 @@ void LLAgentWearables::processAgentInitialWearablesUpdate(LLMessageSystem* mesgs gMessageSystem->getUUIDFast(_PREHASH_WearableData, _PREHASH_AssetID, asset_id, i); if (asset_id.isNull()) { - LLViewerWearable::removeFromAvatar(type, FALSE); + LLViewerWearable::removeFromAvatar(type); } else { @@ -920,7 +915,7 @@ void LLAgentWearables::recoverMissingWearableDone() if (areWearablesLoaded()) { // Make sure that the server's idea of the avatar's wearables actually match the wearables. - gAgent.sendAgentSetAppearance(); + //gAgent.sendAgentSetAppearance(); } else { @@ -1200,11 +1195,10 @@ void LLAgentWearables::removeWearableFinal(const LLWearableType::EType type, boo for (S32 i=max_entry; i>=0; i--) { LLViewerWearable* old_wearable = getViewerWearable(type,i); - //queryWearableCache(); // moved below if (old_wearable) { popWearable(old_wearable); - old_wearable->removeFromAvatar(TRUE); + old_wearable->removeFromAvatar(); } } clearWearableType(type); @@ -1212,17 +1206,14 @@ void LLAgentWearables::removeWearableFinal(const LLWearableType::EType type, boo else { LLViewerWearable* old_wearable = getViewerWearable(type, index); - //queryWearableCache(); // moved below if (old_wearable) { popWearable(old_wearable); - old_wearable->removeFromAvatar(TRUE); + old_wearable->removeFromAvatar(); } } - queryWearableCache(); - // Update the server updateServer(); gInventory.notifyObservers(); @@ -1358,7 +1349,6 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it mWearablesLoaded = TRUE; checkWearablesLoaded(); notifyLoadingFinished(); - queryWearableCache(); updateServer(); gAgentAvatarp->dumpAvatarTEs("setWearableOutfit"); @@ -1482,80 +1472,11 @@ void LLAgentWearables::setWearableFinal(LLInventoryItem* new_item, LLViewerWeara } //llinfos << "LLVOAvatar::setWearableItem()" << llendl; - queryWearableCache(); //new_wearable->writeToAvatar(TRUE); updateServer(); } -void LLAgentWearables::queryWearableCache() -{ - if (!areWearablesLoaded() || (gAgent.getRegion() && gAgent.getRegion()->getCentralBakeVersion())) - { - return; - } - gAgentAvatarp->setIsUsingServerBakes(false); - - // Look up affected baked textures. - // If they exist: - // disallow updates for affected layersets (until dataserver responds with cache request.) - // If cache miss, turn updates back on and invalidate composite. - // If cache hit, modify baked texture entries. - // - // Cache requests contain list of hashes for each baked texture entry. - // Response is list of valid baked texture assets. (same message) - - gMessageSystem->newMessageFast(_PREHASH_AgentCachedTexture); - gMessageSystem->nextBlockFast(_PREHASH_AgentData); - gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - gMessageSystem->addS32Fast(_PREHASH_SerialNum, gAgentQueryManager.mWearablesCacheQueryID); - - S32 num_queries = 0; - for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++) - { - LLUUID hash_id = computeBakedTextureHash((EBakedTextureIndex) baked_index); - if (hash_id.notNull()) - { - num_queries++; - // *NOTE: make sure at least one request gets packed - - ETextureIndex te_index = LLAvatarAppearanceDictionary::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)te_index); - } - - gAgentQueryManager.mActiveCacheQueries[baked_index] = gAgentQueryManager.mWearablesCacheQueryID; - } - //VWR-22113: gAgent.getRegion() can return null if invalid, seen here on logout - if(gAgent.getRegion()) - { - if (isAgentAvatarValid()) - { - selfStartPhase("fetch_texture_cache_entries"); - gAgentAvatarp->outputRezTiming("Fetching textures from cache"); - } - - LL_DEBUGS("Avatar") << gAgentAvatarp->avString() << "Requesting texture cache entry for " << num_queries << " baked textures" << LL_ENDL; - gMessageSystem->sendReliable(gAgent.getRegion()->getHost()); - gAgentQueryManager.mNumPendingQueries++; - gAgentQueryManager.mWearablesCacheQueryID++; - } -} - -// virtual -void LLAgentWearables::invalidateBakedTextureHash(LLMD5& hash) const -{ - // Add some garbage into the hash so that it becomes invalid. - if (isAgentAvatarValid()) - { - hash.update((const unsigned char*)gAgentAvatarp->getID().mData, UUID_BYTES); - } -} - // User has picked "remove from avatar" from a menu. // static void LLAgentWearables::userRemoveWearable(const LLWearableType::EType &type, const U32 &index) @@ -1774,7 +1695,7 @@ bool LLAgentWearables::canWearableBeRemoved(const LLViewerWearable* wearable) co 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) +void LLAgentWearables::animateAllWearableParams(F32 delta) { for( S32 type = 0; type < LLWearableType::WT_COUNT; ++type ) { @@ -1784,7 +1705,7 @@ void LLAgentWearables::animateAllWearableParams(F32 delta, BOOL upload_bake) llassert(wearable); if (wearable) { - wearable->animateParams(delta, upload_bake); + wearable->animateParams(delta); } } } @@ -1907,10 +1828,10 @@ void LLAgentWearables::editWearableIfRequested(const LLUUID& item_id) } } +// SUNSHINE CLEANUP - both of these funcs seem to be dead code, so this one should go too. void LLAgentWearables::updateServer() { sendAgentWearablesUpdate(); - gAgent.sendAgentSetAppearance(); } boost::signals2::connection LLAgentWearables::addLoadingStartedCallback(loading_started_callback_t cb) |