From 0a3493db0804ae71ccff2155847ed40089627d7b Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Fri, 6 Aug 2010 14:28:26 +0100 Subject: EXT-8579 FIXED Develop.Avatar.Animation Info should not show asset IDs Made it so that you only see real UUIDs if the viewer thinks you are in real godmode. --- indra/newview/llvoavatar.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 72aec07e67..1ca10219ce 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3137,14 +3137,16 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) if (motionp->getName().empty()) { output = llformat("%s - %d", - motionp->getID().asString().c_str(), - (U32)motionp->getPriority()); + gAgent.isGodlikeWithoutAdminMenuFakery() ? + motionp->getID().asString().c_str() : + LLUUID::null.asString().c_str(), + (U32)motionp->getPriority()); } else { output = llformat("%s - %d", - motionp->getName().c_str(), - (U32)motionp->getPriority()); + motionp->getName().c_str(), + (U32)motionp->getPriority()); } addDebugText(output); } -- cgit v1.2.3 From 4682264eadc3c3a4dc09e64fc5ad74cb0657639e Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Fri, 6 Aug 2010 09:29:33 -0600 Subject: EXT-8447: FIXED: crash at LLTextureCache::writeEntryToHeaderImmediately(int,LLTextureCache::Entry &,bool) [secondlife-bin lltexturecache.cpp] --- indra/llcommon/llapr.cpp | 12 +++++- indra/newview/lltexturecache.cpp | 87 +++++++++++++++++++++++++++++++++++----- indra/newview/lltexturecache.h | 7 ++-- 3 files changed, 90 insertions(+), 16 deletions(-) (limited to 'indra') diff --git a/indra/llcommon/llapr.cpp b/indra/llcommon/llapr.cpp index 7330b00bcf..dca4cf7c3f 100644 --- a/indra/llcommon/llapr.cpp +++ b/indra/llcommon/llapr.cpp @@ -417,7 +417,11 @@ apr_pool_t* LLAPRFile::getAPRFilePool(apr_pool_t* pool) // File I/O S32 LLAPRFile::read(void *buf, S32 nbytes) { - llassert_always(mFile) ; + if(!mFile) + { + llwarns << "apr mFile is removed by somebody else. Can not read." << llendl ; + return 0; + } apr_size_t sz = nbytes; apr_status_t s = apr_file_read(mFile, buf, &sz); @@ -435,7 +439,11 @@ S32 LLAPRFile::read(void *buf, S32 nbytes) S32 LLAPRFile::write(const void *buf, S32 nbytes) { - llassert_always(mFile) ; + if(!mFile) + { + llwarns << "apr mFile is removed by somebody else. Can not write." << llendl ; + return 0; + } apr_size_t sz = nbytes; apr_status_t s = apr_file_write(mFile, buf, &sz); diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index 403692951f..952f893015 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -998,7 +998,11 @@ LLAPRFile* LLTextureCache::openHeaderEntriesFile(bool readonly, S32 offset) void LLTextureCache::closeHeaderEntriesFile() { - llassert_always(mHeaderAPRFile != NULL); + if(!mHeaderAPRFile) + { + return ; + } + delete mHeaderAPRFile; mHeaderAPRFile = NULL; } @@ -1115,7 +1119,7 @@ S32 LLTextureCache::openAndReadEntry(const LLUUID& id, Entry& entry, bool create } //mHeaderMutex is locked before calling this. -void LLTextureCache::writeEntryToHeaderImmediately(S32 idx, Entry& entry, bool write_header) +void LLTextureCache::writeEntryToHeaderImmediately(S32& idx, Entry& entry, bool write_header) { LLAPRFile* aprfile ; S32 bytes_written ; @@ -1124,7 +1128,13 @@ void LLTextureCache::writeEntryToHeaderImmediately(S32 idx, Entry& entry, bool w { aprfile = openHeaderEntriesFile(false, 0); bytes_written = aprfile->write((U8*)&mHeaderEntriesInfo, sizeof(EntriesInfo)) ; - llassert_always(bytes_written == sizeof(EntriesInfo)); + if(bytes_written != sizeof(EntriesInfo)) + { + clearCorruptedCache() ; //clear the cache. + idx = -1 ;//mark the idx invalid. + return ; + } + mHeaderAPRFile->seek(APR_SET, offset); } else @@ -1132,19 +1142,31 @@ void LLTextureCache::writeEntryToHeaderImmediately(S32 idx, Entry& entry, bool w aprfile = openHeaderEntriesFile(false, offset); } bytes_written = aprfile->write((void*)&entry, (S32)sizeof(Entry)); - llassert_always(bytes_written == sizeof(Entry)); + if(bytes_written != sizeof(Entry)) + { + clearCorruptedCache() ; //clear the cache. + idx = -1 ;//mark the idx invalid. + + return ; + } + closeHeaderEntriesFile(); mUpdatedEntryMap.erase(idx) ; } //mHeaderMutex is locked before calling this. -void LLTextureCache::readEntryFromHeaderImmediately(S32 idx, Entry& entry) +void LLTextureCache::readEntryFromHeaderImmediately(S32& idx, Entry& entry) { S32 offset = sizeof(EntriesInfo) + idx * sizeof(Entry); LLAPRFile* aprfile = openHeaderEntriesFile(true, offset); S32 bytes_read = aprfile->read((void*)&entry, (S32)sizeof(Entry)); - llassert_always(bytes_read == sizeof(Entry)); closeHeaderEntriesFile(); + + if(bytes_read != sizeof(Entry)) + { + clearCorruptedCache() ; //clear the cache. + idx = -1 ;//mark the idx invalid. + } } //mHeaderMutex is locked before calling this. @@ -1169,7 +1191,7 @@ void LLTextureCache::updateEntryTimeStamp(S32 idx, Entry& entry) } //update an existing entry, write to header file immediately. -bool LLTextureCache::updateEntry(S32 idx, Entry& entry, S32 new_image_size, S32 new_data_size) +bool LLTextureCache::updateEntry(S32& idx, Entry& entry, S32 new_image_size, S32 new_data_size) { S32 new_body_size = llmax(0, new_data_size - TEXTURE_CACHE_ENTRY_SIZE) ; @@ -1240,6 +1262,10 @@ U32 LLTextureCache::openAndReadEntries(std::vector& entries) { aprfile = openHeaderEntriesFile(false, 0); updatedHeaderEntriesFile() ; + if(!aprfile) + { + return 0; + } aprfile->seek(APR_SET, (S32)sizeof(EntriesInfo)); } for (U32 idx=0; idx& entries) for (S32 idx=0; idxwrite((void*)(&entries[idx]), (S32)sizeof(Entry)); - llassert_always(bytes_written == sizeof(Entry)); + if(bytes_written != sizeof(Entry)) + { + clearCorruptedCache() ; //clear the cache. + return ; + } } closeHeaderEntriesFile(); } @@ -1307,7 +1337,11 @@ void LLTextureCache::updatedHeaderEntriesFile() //entriesInfo mHeaderAPRFile->seek(APR_SET, 0); S32 bytes_written = mHeaderAPRFile->write((U8*)&mHeaderEntriesInfo, sizeof(EntriesInfo)) ; - llassert_always(bytes_written == sizeof(EntriesInfo)); + if(bytes_written != sizeof(EntriesInfo)) + { + clearCorruptedCache() ; //clear the cache. + return ; + } //write each updated entry S32 entry_size = (S32)sizeof(Entry) ; @@ -1323,7 +1357,11 @@ void LLTextureCache::updatedHeaderEntriesFile() } bytes_written = mHeaderAPRFile->write((void*)(&iter->second), entry_size); - llassert_always(bytes_written == entry_size); + if(bytes_written != entry_size) + { + clearCorruptedCache() ; //clear the cache. + return ; + } } mUpdatedEntryMap.clear() ; } @@ -1444,6 +1482,29 @@ void LLTextureCache::readHeaderCache() ////////////////////////////////////////////////////////////////////////////// +//the header mutex is locked before calling this. +void LLTextureCache::clearCorruptedCache() +{ + llwarns << "the texture cache is corrupted, need to be cleared." << llendl ; + + closeHeaderEntriesFile();//close possible file handler + purgeAllTextures(false) ; //clear the cache. + + if (!mReadOnly) //regenerate the directory tree if not exists. + { + LLFile::mkdir(mTexturesDirName); + + const char* subdirs = "0123456789abcdef"; + for (S32 i=0; i<16; i++) + { + std::string dirname = mTexturesDirName + gDirUtilp->getDirDelimiter() + subdirs[i]; + LLFile::mkdir(dirname); + } + } + + return ; +} + void LLTextureCache::purgeAllTextures(bool purge_directories) { if (!mReadOnly) @@ -1472,11 +1533,14 @@ void LLTextureCache::purgeAllTextures(bool purge_directories) mTexturesSizeTotal = 0; mFreeList.clear(); mTexturesSizeTotal = 0; + mUpdatedEntryMap.clear(); // Info with 0 entries mHeaderEntriesInfo.mVersion = sHeaderCacheVersion; mHeaderEntriesInfo.mEntries = 0; writeEntriesHeader(); + + llinfos << "The entire texture cache is cleared." << llendl ; } void LLTextureCache::purgeTextures(bool validate) @@ -1644,7 +1708,8 @@ S32 LLTextureCache::setHeaderCacheEntry(const LLUUID& id, Entry& entry, S32 imag { updateEntry(idx, entry, imagesize, datasize); } - else // retry + + if(idx < 0) // retry { readHeaderCache(); // We couldn't write an entry, so refresh the LRU diff --git a/indra/newview/lltexturecache.h b/indra/newview/lltexturecache.h index 0fceee3011..f80be0056b 100644 --- a/indra/newview/lltexturecache.h +++ b/indra/newview/lltexturecache.h @@ -154,6 +154,7 @@ protected: private: void setDirNames(ELLPath location); void readHeaderCache(); + void clearCorruptedCache(); void purgeAllTextures(bool purge_directories); void purgeTextures(bool validate); LLAPRFile* openHeaderEntriesFile(bool readonly, S32 offset); @@ -161,12 +162,12 @@ private: void readEntriesHeader(); void writeEntriesHeader(); S32 openAndReadEntry(const LLUUID& id, Entry& entry, bool create); - bool updateEntry(S32 idx, Entry& entry, S32 new_image_size, S32 new_body_size); + bool updateEntry(S32& idx, Entry& entry, S32 new_image_size, S32 new_body_size); void updateEntryTimeStamp(S32 idx, Entry& entry) ; U32 openAndReadEntries(std::vector& entries); void writeEntriesAndClose(const std::vector& entries); - void readEntryFromHeaderImmediately(S32 idx, Entry& entry) ; - void writeEntryToHeaderImmediately(S32 idx, Entry& entry, bool write_header = false) ; + void readEntryFromHeaderImmediately(S32& idx, Entry& entry) ; + void writeEntryToHeaderImmediately(S32& idx, Entry& entry, bool write_header = false) ; void removeEntry(S32 idx, Entry& entry, std::string& filename); void removeCachedTexture(const LLUUID& id) ; S32 getHeaderCacheEntry(const LLUUID& id, Entry& entry); -- cgit v1.2.3 From c187fdcf1fbac21cb7292d6269023eae83cb6847 Mon Sep 17 00:00:00 2001 From: Paul Guslisty Date: Fri, 6 Aug 2010 19:41:23 +0300 Subject: EXT-7963 FIXED (Edit Outfit > Add More > Do not switch to next item type after add/replace) - Added selected item type (in flat list view) as criterion when determining filter type in 'Add More' panel - Fixed LLAccordionCtrl::getSelectedTab() method. When 'selection_enabled = false' for LLAccordionCtrlTab, LLAccordionCtrl::getSelectedTab() returned NULL, even if some accordion tab was selected. Now it's OK. Method returns currently selected LLAccordionCtrlTab. Recovered from bad merge in 13811 Reviewed by Richard Nelson at https://codereview.productengine.com/secondlife/r/790/ --HG-- branch : product-engine --- indra/newview/llpaneloutfitedit.cpp | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index 07a66eaf10..d7a46f30b0 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -809,15 +809,38 @@ void LLPanelOutfitEdit::filterWearablesBySelectedItem(void) bool more_than_one_selected = ids.size() > 1; bool is_dummy_item = (ids.size() && dynamic_cast(mCOFWearables->getSelectedItem())); - //selected and expanded accordion tabs determine filtering when no item is selected + // selected, expanded accordion tabs and selection in flat list view determine filtering when no item is selected in COF + // selection in flat list view participates in determining filtering because of EXT-7963 + // So the priority of criterions in is: + // 1. Selected accordion tab | IF (any accordion selected) + // | filter_type = selected_accordion_type + // 2. Selected item in flat list view | ELSEIF (any item in flat list view selected) + // | filter_type = selected_item_type + // 3. Expanded accordion tab | ELSEIF (any accordion expanded) + // | filter_type = expanded accordion_type if (nothing_selected) { showWearablesListView(); - //selected accordion tab is more priority than expanded tab when determining filtering + //selected accordion tab is more priority than expanded tab + //and selected item in flat list view of 'Add more' panel when + //determining filtering LLAssetType::EType type = mCOFWearables->getSelectedAccordionAssetType(); if (type == LLAssetType::AT_NONE) + { //no accordion selected + + // when no accordion selected then selected item from flat list view + // has more priority than expanded when determining filtering + LLUUID selected_item_id = mWearableItemsList->getSelectedUUID(); + LLViewerInventoryItem* item = gInventory.getLinkedItem(selected_item_id); + if(item) { + showFilteredWearablesListView(item->getWearableType()); + return; + } + + // when no accordion selected and no selected items in flat list view + // determine filtering according to expanded accordion type = mCOFWearables->getExpandedAccordionAssetType(); } @@ -830,7 +853,7 @@ void LLPanelOutfitEdit::filterWearablesBySelectedItem(void) applyListViewFilter(LVIT_BODYPART); break; case LLAssetType::AT_CLOTHING: - default: + default: applyListViewFilter(LVIT_CLOTHING); break; } -- cgit v1.2.3 From 4277bfbba6696d47d9db5a3aa145891701c7d45f Mon Sep 17 00:00:00 2001 From: Eli Linden Date: Fri, 6 Aug 2010 11:17:45 -0700 Subject: CT-575 WIP FR linguistic --- indra/newview/skins/default/xui/fr/floater_preview_gesture.xml | 4 ++-- indra/newview/skins/default/xui/fr/menu_gesture_gear.xml | 2 +- indra/newview/skins/default/xui/fr/panel_nearby_media.xml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/fr/floater_preview_gesture.xml b/indra/newview/skins/default/xui/fr/floater_preview_gesture.xml index e7c7385fc8..82f5bac047 100644 --- a/indra/newview/skins/default/xui/fr/floater_preview_gesture.xml +++ b/indra/newview/skins/default/xui/fr/floater_preview_gesture.xml @@ -13,13 +13,13 @@ Attendre : - Stop + Arrêter Prévisualiser - -- Aucune -- + - Aucun choix - Geste : [NAME] diff --git a/indra/newview/skins/default/xui/fr/menu_gesture_gear.xml b/indra/newview/skins/default/xui/fr/menu_gesture_gear.xml index 4512d1bf7e..062dd0f005 100644 --- a/indra/newview/skins/default/xui/fr/menu_gesture_gear.xml +++ b/indra/newview/skins/default/xui/fr/menu_gesture_gear.xml @@ -1,6 +1,6 @@ - + diff --git a/indra/newview/skins/default/xui/fr/panel_nearby_media.xml b/indra/newview/skins/default/xui/fr/panel_nearby_media.xml index d19a477007..66bfd01a2a 100644 --- a/indra/newview/skins/default/xui/fr/panel_nearby_media.xml +++ b/indra/newview/skins/default/xui/fr/panel_nearby_media.xml @@ -27,7 +27,7 @@ Médias proches - Afficher : + Voir : -- cgit v1.2.3 From bcd84433717e42ec8675009e1335caf915cc1a41 Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Fri, 6 Aug 2010 20:06:16 -0700 Subject: Fixes for EXT-8563 "VWR-20156: Prim Media on HUDs has no Audio or Interactivity" Backed out changeset 1b65d0d42c67 (the fix for EXT-5205), and replaced it with a check in LLPanelPrimMediaControls::nextZoomLevel(). Made LLViewerMediaImpl::calculateInterest() not attempt to calculate distances to HUD attachments, since their global positions are invalid. --- indra/newview/llpanelprimmediacontrols.cpp | 7 +++++++ indra/newview/lltoolpie.cpp | 1 - indra/newview/llviewermedia.cpp | 19 ++++++++++++------- 3 files changed, 19 insertions(+), 8 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp index 0648d99685..9cc775d427 100644 --- a/indra/newview/llpanelprimmediacontrols.cpp +++ b/indra/newview/llpanelprimmediacontrols.cpp @@ -985,6 +985,13 @@ void LLPanelPrimMediaControls::onClickZoom() void LLPanelPrimMediaControls::nextZoomLevel() { + LLViewerObject* objectp = getTargetObject(); + if(objectp && objectp->isHUDAttachment()) + { + // Never allow zooming on HUD attachments. + return; + } + int index = 0; while (index < kNumZoomLevels) { diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 95c4f01e46..4d4a1e078d 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -1270,7 +1270,6 @@ bool LLToolPie::handleMediaClick(const LLPickInfo& pick) if (!parcel || objectp.isNull() || - objectp->isHUDAttachment() || pick.mObjectFace < 0 || pick.mObjectFace >= objectp->getNumTEs()) { diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 34e30b3ccd..44d9bb1373 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -3053,20 +3053,25 @@ void LLViewerMediaImpl::calculateInterest() // Calculate distance from the avatar, for use in the proximity calculation. mProximityDistance = 0.0f; + mProximityCamera = 0.0f; if(!mObjectList.empty()) { // Just use the first object in the list. We could go through the list and find the closest object, but this should work well enough. std::list< LLVOVolume* >::iterator iter = mObjectList.begin() ; LLVOVolume* objp = *iter ; llassert_always(objp != NULL) ; + + // The distance calculation is invalid for HUD attachments -- leave both mProximityDistance and mProximityCamera at 0 for them. + if(!objp->isHUDAttachment()) + { + LLVector3d obj_global = objp->getPositionGlobal() ; + LLVector3d agent_global = gAgent.getPositionGlobal() ; + LLVector3d global_delta = agent_global - obj_global ; + mProximityDistance = global_delta.magVecSquared(); // use distance-squared because it's cheaper and sorts the same. - LLVector3d obj_global = objp->getPositionGlobal() ; - LLVector3d agent_global = gAgent.getPositionGlobal() ; - LLVector3d global_delta = agent_global - obj_global ; - mProximityDistance = global_delta.magVecSquared(); // use distance-squared because it's cheaper and sorts the same. - - LLVector3d camera_delta = gAgentCamera.getCameraPositionGlobal() - obj_global; - mProximityCamera = camera_delta.magVec(); + LLVector3d camera_delta = gAgentCamera.getCameraPositionGlobal() - obj_global; + mProximityCamera = camera_delta.magVec(); + } } if(mNeedsMuteCheck) -- cgit v1.2.3