diff --git a/.hgtags b/.hgtags index f82ca2d964..efb4c5ab00 100755 --- a/.hgtags +++ b/.hgtags @@ -30,6 +30,7 @@ fdf1fd7884cf642ad3d41c3f5bc2521e4a7ab3aa Firestorm_4.6.9_Release 0a61dad41140c261bb90412ff0abe83e5e3e89d9 Firestorm_4.7.1_Beta 76c9998c37a52d58792e7a22cc5055e831c95023 Firestorm_4.7.3_Release a27ad24ed75000d96d056aa20495637386e4a53e Firestorm_4.7.5_Release +31f9b0f8e9365a87975af3aa73e3f782db17f994 Firestorm_4.7.7_Release bb38ff1a763738609e1b3cada6d15fa61e5e84b9 2.1.1-release 003dd9461bfa479049afcc34545ab3431b147c7c v2start 52d96ad3d39be29147c5b2181b3bb46af6164f0e alpha-3 @@ -545,3 +546,4 @@ e821ef17c6edea4a59997719d8ba416d8c16e143 3.8.5-release 5a5bd148943bfb46cf2ff2ccf376c42dee93d19b 3.8.6-release ae3297cdd03ab14f19f3811acbc4acd3eb600336 4.0.0-release 759710a9acef61aaf7b69f4bc4a5a913de87ad8a 4.0.1-release +e9d350764dfbf5a46229e627547ef5c1b1eeef00 4.0.2-release diff --git a/doc/contributions.txt b/doc/contributions.txt index 48be6762fb..28a9159312 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -191,6 +191,7 @@ Ansariel Hiller MAINT-5533 MAINT-5756 MAINT-4677 + MAINT-2199 Aralara Rajal Arare Chantilly CHUIBUG-191 @@ -784,6 +785,12 @@ Kitty Barnett VWR-24217 STORM-1804 MAINT-5416 + MAINT-6041 + MAINT-6142 + MAINT-6144 + MAINT-6152 + MAINT-6153 + MAINT-6154 Kolor Fall Komiko Okamoto Korvel Noh @@ -1002,6 +1009,7 @@ NickyD MAINT-873 Nicky Dasmijn VWR-29228 + MAINT-1392 MAINT-873 SUN-72 BUG-2432 @@ -1255,6 +1263,7 @@ Sovereign Engineer OPEN-195 OPEN-217 OPEN-295 + MAINT-6107 STORM-2107 SpacedOut Frye VWR-34 diff --git a/indra/llcommon/tests/llleap_test.cpp b/indra/llcommon/tests/llleap_test.cpp index 2d88e2c676..d342dece84 100644 --- a/indra/llcommon/tests/llleap_test.cpp +++ b/indra/llcommon/tests/llleap_test.cpp @@ -36,10 +36,18 @@ StringVec sv(const StringVec& listof) { return listof; } #if defined(LL_WINDOWS) #define sleep(secs) _sleep((secs) * 1000) -#endif +// WOLF-300: It appears that driving a megabyte of data through an LLLeap pipe +// causes Windows abdominal pain such that it later fails code-signing in some +// mysterious way. Entirely suppressing these LLLeap tests pushes the failure +// rate MUCH lower. Can we re-enable them with a smaller data size on Windows? +const size_t BUFFERED_LENGTH = 100*1024; + +#else // not Windows const size_t BUFFERED_LENGTH = 1023*1024; // try wrangling just under a megabyte of data +#endif + void waitfor(const std::vector& instances, int timeout=60) { int i; diff --git a/indra/llmessage/llassetstorage.cpp b/indra/llmessage/llassetstorage.cpp index 61663e1982..cab3073eca 100644 --- a/indra/llmessage/llassetstorage.cpp +++ b/indra/llmessage/llassetstorage.cpp @@ -157,29 +157,50 @@ void LLAssetInfo::setFromNameValue( const LLNameValue& nv ) LL_DEBUGS("AssetStorage") << "creator: " << mCreatorID << LL_ENDL; } +///---------------------------------------------------------------------------- +/// LLBaseDownloadRequest +///---------------------------------------------------------------------------- + +LLBaseDownloadRequest::LLBaseDownloadRequest(const LLUUID &uuid, const LLAssetType::EType type) +: mUUID(uuid), +mType(type), +mDownCallback(NULL), +mUserData(NULL), +mHost(), +mIsTemp(FALSE), +mIsPriority(FALSE), +mDataSentInFirstPacket(FALSE), +mDataIsInVFS(FALSE) +{ + // Need to guarantee that this time is up to date, we may be creating a circuit even though we haven't been + // running a message system loop. + mTime = LLMessageSystem::getMessageTimeSeconds(TRUE); +} + +// virtual +LLBaseDownloadRequest::~LLBaseDownloadRequest() +{ +} + +// virtual +LLBaseDownloadRequest* LLBaseDownloadRequest::getCopy() +{ + return new LLBaseDownloadRequest(*this); +} + + ///---------------------------------------------------------------------------- /// LLAssetRequest ///---------------------------------------------------------------------------- LLAssetRequest::LLAssetRequest(const LLUUID &uuid, const LLAssetType::EType type) -: mUUID(uuid), - mType(type), - mDownCallback( NULL ), +: LLBaseDownloadRequest(uuid, type), mUpCallback( NULL ), mInfoCallback( NULL ), - mUserData( NULL ), - mHost(), - mIsTemp( FALSE ), mIsLocal(FALSE), mIsUserWaiting(FALSE), - mTimeout(LL_ASSET_STORAGE_TIMEOUT), - mIsPriority(FALSE), - mDataSentInFirstPacket(FALSE), - mDataIsInVFS( FALSE ) + mTimeout(LL_ASSET_STORAGE_TIMEOUT) { - // Need to guarantee that this time is up to date, we may be creating a circuit even though we haven't been - // running a message system loop. - mTime = LLMessageSystem::getMessageTimeSeconds(TRUE); } // virtual @@ -217,56 +238,51 @@ LLSD LLAssetRequest::getFullDetails() const return sd; } +LLBaseDownloadRequest* LLAssetRequest::getCopy() +{ + return new LLAssetRequest(*this); +} + ///---------------------------------------------------------------------------- /// LLInvItemRequest ///---------------------------------------------------------------------------- LLInvItemRequest::LLInvItemRequest(const LLUUID &uuid, const LLAssetType::EType type) -: mUUID(uuid), - mType(type), - mDownCallback( NULL ), - mUserData( NULL ), - mHost(), - mIsTemp( FALSE ), - mIsPriority(FALSE), - mDataSentInFirstPacket(FALSE), - mDataIsInVFS( FALSE ) +: LLBaseDownloadRequest(uuid, type) { - // Need to guarantee that this time is up to date, we may be creating a circuit even though we haven't been - // running a message system loop. - mTime = LLMessageSystem::getMessageTimeSeconds(TRUE); } +// virtual LLInvItemRequest::~LLInvItemRequest() { } +LLBaseDownloadRequest* LLInvItemRequest::getCopy() +{ + return new LLInvItemRequest(*this); +} + ///---------------------------------------------------------------------------- /// LLEstateAssetRequest ///---------------------------------------------------------------------------- LLEstateAssetRequest::LLEstateAssetRequest(const LLUUID &uuid, const LLAssetType::EType atype, EstateAssetType etype) -: mUUID(uuid), - mAType(atype), - mEstateAssetType(etype), - mDownCallback( NULL ), - mUserData( NULL ), - mHost(), - mIsTemp( FALSE ), - mIsPriority(FALSE), - mDataSentInFirstPacket(FALSE), - mDataIsInVFS( FALSE ) +: LLBaseDownloadRequest(uuid, atype), + mEstateAssetType(etype) { - // Need to guarantee that this time is up to date, we may be creating a circuit even though we haven't been - // running a message system loop. - mTime = LLMessageSystem::getMessageTimeSeconds(TRUE); } +// Virtual LLEstateAssetRequest::~LLEstateAssetRequest() { } +LLBaseDownloadRequest* LLEstateAssetRequest::getCopy() +{ + return new LLEstateAssetRequest(*this); +} + ///---------------------------------------------------------------------------- /// LLAssetStorage @@ -565,7 +581,7 @@ void LLAssetStorage::_queueDataRequest(const LLUUID& uuid, LLAssetType::EType at // Set our destination file, and the completion callback. LLTransferTargetParamsVFile tpvf; tpvf.setAsset(uuid, atype); - tpvf.setCallback(downloadCompleteCallback, req); + tpvf.setCallback(downloadCompleteCallback, *req); //LL_INFOS() << "Starting transfer for " << uuid << LL_ENDL; LLTransferTargetChannel *ttcp = gTransferManager.getTargetChannel(mUpstreamHost, LLTCT_ASSET); @@ -589,7 +605,7 @@ void LLAssetStorage::downloadCompleteCallback( S32 result, const LLUUID& file_id, LLAssetType::EType file_type, - void* user_data, LLExtStat ext_status) + LLBaseDownloadRequest* user_data, LLExtStat ext_status) { LL_DEBUGS("AssetStorage") << "ASSET_TRACE asset " << file_id << " downloadCompleteCallback" << LL_ENDL; @@ -608,36 +624,40 @@ void LLAssetStorage::downloadCompleteCallback( return; } + LLUUID callback_id; + LLAssetType::EType callback_type; + // Inefficient since we're doing a find through a list that may have thousands of elements. // This is due for refactoring; we will probably change mPendingDownloads into a set. request_list_t::iterator download_iter = std::find(gAssetStorage->mPendingDownloads.begin(), gAssetStorage->mPendingDownloads.end(), req); - // If the LLAssetRequest doesn't exist in the downloads queue, then it either has already been deleted - // by _cleanupRequests, or it's a transfer. + if (download_iter != gAssetStorage->mPendingDownloads.end()) { - req->setUUID(file_id); - req->setType(file_type); + callback_id = file_id; + callback_type = file_type; + } + else + { + // either has already been deleted by _cleanupRequests or it's a transfer. + callback_id = req->getUUID(); + callback_type = req->getType(); } if (LL_ERR_NOERR == result) { // we might have gotten a zero-size file - LLVFile vfile(gAssetStorage->mVFS, req->getUUID(), req->getType()); + LLVFile vfile(gAssetStorage->mVFS, callback_id, callback_type); if (vfile.getSize() <= 0) { - LL_WARNS() << "downloadCompleteCallback has non-existent or zero-size asset " << req->getUUID() << LL_ENDL; + LL_WARNS() << "downloadCompleteCallback has non-existent or zero-size asset " << callback_id << LL_ENDL; result = LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE; vfile.remove(); } } - // we will be deleting elements of mPendingDownloads which req might be part of, save id and type for reference - LLUUID callback_id = req->getUUID(); - LLAssetType::EType callback_type = req->getType(); - // find and callback ALL pending requests for this UUID // SJB: We process the callbacks in reverse order, I do not know if this is important, // but I didn't want to mess with it. @@ -731,10 +751,10 @@ void LLAssetStorage::getEstateAsset(const LLHost &object_sim, const LLUUID &agen if (source_host.isOk()) { // stash the callback info so we can find it after we get the response message - LLEstateAssetRequest *req = new LLEstateAssetRequest(asset_id, atype, etype); - req->mDownCallback = callback; - req->mUserData = user_data; - req->mIsPriority = is_priority; + LLEstateAssetRequest req(asset_id, atype, etype); + req.mDownCallback = callback; + req.mUserData = user_data; + req.mIsPriority = is_priority; // send request message to our upstream data provider // Create a new asset transfer. @@ -768,7 +788,7 @@ void LLAssetStorage::downloadEstateAssetCompleteCallback( S32 result, const LLUUID& file_id, LLAssetType::EType file_type, - void* user_data, + LLBaseDownloadRequest* user_data, LLExtStat ext_status) { LLEstateAssetRequest *req = (LLEstateAssetRequest*)user_data; @@ -875,10 +895,10 @@ void LLAssetStorage::getInvItemAsset(const LLHost &object_sim, const LLUUID &age if (source_host.isOk()) { // stash the callback info so we can find it after we get the response message - LLInvItemRequest *req = new LLInvItemRequest(asset_id, atype); - req->mDownCallback = callback; - req->mUserData = user_data; - req->mIsPriority = is_priority; + LLInvItemRequest req(asset_id, atype); + req.mDownCallback = callback; + req.mUserData = user_data; + req.mIsPriority = is_priority; // send request message to our upstream data provider // Create a new asset transfer. @@ -916,7 +936,7 @@ void LLAssetStorage::downloadInvItemCompleteCallback( S32 result, const LLUUID& file_id, LLAssetType::EType file_type, - void* user_data, + LLBaseDownloadRequest* user_data, LLExtStat ext_status) { LLInvItemRequest *req = (LLInvItemRequest*)user_data; diff --git a/indra/llmessage/llassetstorage.h b/indra/llmessage/llassetstorage.h index 1bb4acea9e..8a4d41565f 100644 --- a/indra/llmessage/llassetstorage.h +++ b/indra/llmessage/llassetstorage.h @@ -92,38 +92,52 @@ public: }; -class LLAssetRequest +class LLBaseDownloadRequest { public: - LLAssetRequest(const LLUUID &uuid, const LLAssetType::EType at); - virtual ~LLAssetRequest(); - - LLUUID getUUID() const { return mUUID; } - LLAssetType::EType getType() const { return mType; } + LLBaseDownloadRequest(const LLUUID &uuid, const LLAssetType::EType at); + virtual ~LLBaseDownloadRequest(); - void setUUID(const LLUUID& id) { mUUID = id; } - void setType(LLAssetType::EType type) { mType = type; } - void setTimeout (F64Seconds timeout) { mTimeout = timeout; } + LLUUID getUUID() const { return mUUID; } + LLAssetType::EType getType() const { return mType; } + + void setUUID(const LLUUID& id) { mUUID = id; } + void setType(LLAssetType::EType type) { mType = type; } + + virtual LLBaseDownloadRequest* getCopy(); protected: - LLUUID mUUID; - LLAssetType::EType mType; + LLUUID mUUID; + LLAssetType::EType mType; public: - void (*mDownCallback)(LLVFS*, const LLUUID&, LLAssetType::EType, void *, S32, LLExtStat); + void(*mDownCallback)(LLVFS*, const LLUUID&, LLAssetType::EType, void *, S32, LLExtStat); + + void *mUserData; + LLHost mHost; + BOOL mIsTemp; + F64Seconds mTime; // Message system time + BOOL mIsPriority; + BOOL mDataSentInFirstPacket; + BOOL mDataIsInVFS; +}; + +class LLAssetRequest : public LLBaseDownloadRequest +{ +public: + LLAssetRequest(const LLUUID &uuid, const LLAssetType::EType at); + virtual ~LLAssetRequest(); + + void setTimeout(F64Seconds timeout) { mTimeout = timeout; } + + virtual LLBaseDownloadRequest* getCopy(); + void (*mUpCallback)(const LLUUID&, void *, S32, LLExtStat); void (*mInfoCallback)(LLAssetInfo *, void *, S32); - void *mUserData; - LLHost mHost; - BOOL mIsTemp; BOOL mIsLocal; BOOL mIsUserWaiting; // We don't want to try forever if a user is waiting for a result. - F64Seconds mTime; // Message system time F64Seconds mTimeout; // Amount of time before timing out. - BOOL mIsPriority; - BOOL mDataSentInFirstPacket; - BOOL mDataIsInVFS; LLUUID mRequestingAgentID; // Only valid for uploads from an agent virtual LLSD getTerseDetails() const; @@ -141,63 +155,27 @@ struct ll_asset_request_equal : public std::equal_to }; -class LLInvItemRequest +class LLInvItemRequest : public LLBaseDownloadRequest { public: - LLInvItemRequest(const LLUUID &uuid, const LLAssetType::EType at); - virtual ~LLInvItemRequest(); - - LLUUID getUUID() const { return mUUID; } - LLAssetType::EType getType() const { return mType; } - - void setUUID(const LLUUID& id) { mUUID = id; } - void setType(LLAssetType::EType type) { mType = type; } - -protected: - LLUUID mUUID; - LLAssetType::EType mType; - -public: - void (*mDownCallback)(LLVFS*, const LLUUID&, LLAssetType::EType, void *, S32, LLExtStat); - - void *mUserData; - LLHost mHost; - BOOL mIsTemp; - F64Seconds mTime; // Message system time - BOOL mIsPriority; - BOOL mDataSentInFirstPacket; - BOOL mDataIsInVFS; + LLInvItemRequest(const LLUUID &uuid, const LLAssetType::EType at); + virtual ~LLInvItemRequest(); + virtual LLBaseDownloadRequest* getCopy(); }; -class LLEstateAssetRequest +class LLEstateAssetRequest : public LLBaseDownloadRequest { public: - LLEstateAssetRequest(const LLUUID &uuid, const LLAssetType::EType at, EstateAssetType et); - virtual ~LLEstateAssetRequest(); + LLEstateAssetRequest(const LLUUID &uuid, const LLAssetType::EType at, EstateAssetType et); + virtual ~LLEstateAssetRequest(); - LLUUID getUUID() const { return mUUID; } - LLAssetType::EType getAType() const { return mAType; } + LLAssetType::EType getAType() const { return mType; } - void setUUID(const LLUUID& id) { mUUID = id; } - void setType(LLAssetType::EType type) { mAType = type; } + virtual LLBaseDownloadRequest* getCopy(); protected: - LLUUID mUUID; - LLAssetType::EType mAType; EstateAssetType mEstateAssetType; - -public: - void (*mDownCallback)(LLVFS*, const LLUUID&, LLAssetType::EType, void *, S32, LLExtStat); - - void *mUserData; - LLHost mHost; - BOOL mIsTemp; - F64Seconds mTime; // Message system time - BOOL mIsPriority; - BOOL mDataSentInFirstPacket; - BOOL mDataIsInVFS; - }; @@ -369,17 +347,17 @@ public: S32 result, const LLUUID& file_id, LLAssetType::EType file_type, - void* user_data, LLExtStat ext_status); + LLBaseDownloadRequest* user_data, LLExtStat ext_status); static void downloadEstateAssetCompleteCallback( S32 result, const LLUUID& file_id, LLAssetType::EType file_type, - void* user_data, LLExtStat ext_status); + LLBaseDownloadRequest* user_data, LLExtStat ext_status); static void downloadInvItemCompleteCallback( S32 result, const LLUUID& file_id, LLAssetType::EType file_type, - void* user_data, LLExtStat ext_status); + LLBaseDownloadRequest* user_data, LLExtStat ext_status); // upload process callbacks static void uploadCompleteCallback(const LLUUID&, void *user_data, S32 result, LLExtStat ext_status); diff --git a/indra/llmessage/llhttpassetstorage.cpp b/indra/llmessage/llhttpassetstorage.cpp index e202154445..ace65760c3 100644 --- a/indra/llmessage/llhttpassetstorage.cpp +++ b/indra/llmessage/llhttpassetstorage.cpp @@ -938,22 +938,22 @@ void LLHTTPAssetStorage::checkForTimeouts() long curl_result = 0; S32 xfer_result = LL_ERR_NOERR; - LLHTTPAssetRequest *req = NULL; - curl_easy_getinfo(curl_msg->easy_handle, CURLINFO_PRIVATE, &req); + LLHTTPAssetRequest *http_req = NULL; + curl_easy_getinfo(curl_msg->easy_handle, CURLINFO_PRIVATE, &http_req); // TODO: Throw curl_result at all callbacks. curl_easy_getinfo(curl_msg->easy_handle, CURLINFO_HTTP_CODE, &curl_result); - if (RT_UPLOAD == req->mRequestType || RT_LOCALUPLOAD == req->mRequestType) + if (RT_UPLOAD == http_req->mRequestType || RT_LOCALUPLOAD == http_req->mRequestType) { if (curl_msg->data.result == CURLE_OK && ( curl_result == HTTP_OK || curl_result == HTTP_CREATED || curl_result == HTTP_NO_CONTENT)) { - LL_INFOS() << "Success uploading " << req->getUUID() << " to " << req->mURLBuffer << LL_ENDL; - if (RT_LOCALUPLOAD == req->mRequestType) + LL_INFOS() << "Success uploading " << http_req->getUUID() << " to " << http_req->mURLBuffer << LL_ENDL; + if (RT_LOCALUPLOAD == http_req->mRequestType) { - addTempAssetData(req->getUUID(), req->mRequestingAgentID, mHostName); + addTempAssetData(http_req->getUUID(), http_req->mRequestingAgentID, mHostName); } } else if (curl_msg->data.result == CURLE_COULDNT_CONNECT || @@ -961,18 +961,18 @@ void LLHTTPAssetStorage::checkForTimeouts() curl_result == HTTP_BAD_GATEWAY || curl_result == HTTP_SERVICE_UNAVAILABLE) { - LL_WARNS() << "Re-requesting upload for " << req->getUUID() << ". Received upload error to " << req->mURLBuffer << + LL_WARNS() << "Re-requesting upload for " << http_req->getUUID() << ". Received upload error to " << http_req->mURLBuffer << " with result " << curl_easy_strerror(curl_msg->data.result) << ", http result " << curl_result << LL_ENDL; ////HACK (probably) I am sick of this getting requeued and driving me mad. - //if (req->mIsUserWaiting) + //if (http_req->mIsUserWaiting) //{ - // deletePendingRequest(RT_UPLOAD, req->getType(), req->getUUID()); + // deletePendingRequest(RT_UPLOAD, http_req->getType(), http_req->getUUID()); //} } else { - LL_WARNS() << "Failure uploading " << req->getUUID() << " to " << req->mURLBuffer << + LL_WARNS() << "Failure uploading " << http_req->getUUID() << " to " << http_req->mURLBuffer << " with result " << curl_easy_strerror(curl_msg->data.result) << ", http result " << curl_result << LL_ENDL; xfer_result = LL_ERR_ASSET_REQUEST_FAILED; @@ -985,39 +985,39 @@ void LLHTTPAssetStorage::checkForTimeouts() { // shared upload finished callback // in the base class, this is called from processUploadComplete - _callUploadCallbacks(req->getUUID(), req->getType(), (xfer_result == 0), LL_EXSTAT_CURL_RESULT | curl_result); + _callUploadCallbacks(http_req->getUUID(), http_req->getType(), (xfer_result == 0), LL_EXSTAT_CURL_RESULT | curl_result); // Pending upload flag will get cleared when the request is deleted } } - else if (RT_DOWNLOAD == req->mRequestType) + else if (RT_DOWNLOAD == http_req->mRequestType) { if (curl_result == HTTP_OK && curl_msg->data.result == CURLE_OK) { - if (req->mVFile && req->mVFile->getSize() > 0) + if (http_req->mVFile && http_req->mVFile->getSize() > 0) { - LL_INFOS() << "Success downloading " << req->mURLBuffer << ", size " << req->mVFile->getSize() << LL_ENDL; + LL_INFOS() << "Success downloading " << http_req->mURLBuffer << ", size " << http_req->mVFile->getSize() << LL_ENDL; - req->mVFile->rename(req->getUUID(), req->getType()); + http_req->mVFile->rename(http_req->getUUID(), http_req->getType()); } else { // *TODO: if this actually indicates a bad asset on the server // (not certain at this point), then delete it - LL_WARNS() << "Found " << req->mURLBuffer << " to be zero size" << LL_ENDL; + LL_WARNS() << "Found " << http_req->mURLBuffer << " to be zero size" << LL_ENDL; xfer_result = LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE; } } else { // KLW - TAT See if an avatar owns this texture, and if so request re-upload. - LL_WARNS() << "Failure downloading " << req->mURLBuffer << + LL_WARNS() << "Failure downloading " << http_req->mURLBuffer << " with result " << curl_easy_strerror(curl_msg->data.result) << ", http result " << curl_result << LL_ENDL; xfer_result = (curl_result == HTTP_NOT_FOUND) ? LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE : LL_ERR_ASSET_REQUEST_FAILED; - if (req->mVFile) + if (http_req->mVFile) { - req->mVFile->remove(); + http_req->mVFile->remove(); } } @@ -1025,9 +1025,9 @@ void LLHTTPAssetStorage::checkForTimeouts() // this will cleanup all requests for this asset, including ours downloadCompleteCallback( xfer_result, - req->getUUID(), - req->getType(), - (void *)req, + http_req->getUUID(), + http_req->getType(), + http_req, LL_EXSTAT_CURL_RESULT | curl_result); // Pending download flag will get cleared when the request is deleted } @@ -1038,8 +1038,8 @@ void LLHTTPAssetStorage::checkForTimeouts() } // Deleting clears the pending upload/download flag if it's set and the request is transferring - delete req; - req = NULL; + delete http_req; + http_req = NULL; } } while (curl_msg && queue_length > 0); diff --git a/indra/llmessage/lltransfertargetvfile.cpp b/indra/llmessage/lltransfertargetvfile.cpp index 3c234b9726..a572c68a7f 100644 --- a/indra/llmessage/lltransfertargetvfile.cpp +++ b/indra/llmessage/lltransfertargetvfile.cpp @@ -42,7 +42,7 @@ LLTransferTargetParamsVFile::LLTransferTargetParamsVFile() : LLTransferTargetParams(LLTTT_VFILE), mAssetType(LLAssetType::AT_NONE), mCompleteCallback(NULL), - mUserDatap(NULL), + mRequestDatap(NULL), mErrCode(0) { } @@ -55,10 +55,14 @@ void LLTransferTargetParamsVFile::setAsset( mAssetType = asset_type; } -void LLTransferTargetParamsVFile::setCallback(LLTTVFCompleteCallback cb, void *user_data) +void LLTransferTargetParamsVFile::setCallback(LLTTVFCompleteCallback cb, LLBaseDownloadRequest& request) { mCompleteCallback = cb; - mUserDatap = user_data; + if (mRequestDatap) + { + delete mRequestDatap; + } + mRequestDatap = request.getCopy(); } bool LLTransferTargetParamsVFile::unpackParams(LLDataPacker& dp) @@ -98,6 +102,12 @@ LLTransferTargetVFile::LLTransferTargetVFile( LLTransferTargetVFile::~LLTransferTargetVFile() { + if (mParams.mRequestDatap) + { + // TODO: Consider doing it in LLTransferTargetParamsVFile's destructor + delete mParams.mRequestDatap; + mParams.mRequestDatap = NULL; + } } @@ -208,12 +218,18 @@ void LLTransferTargetVFile::completionCallback(const LLTSCode status) err_code = LL_ERR_ASSET_REQUEST_FAILED; break; } - if (mParams.mCompleteCallback) - { - mParams.mCompleteCallback(err_code, - mParams.getAssetID(), - mParams.getAssetType(), - mParams.mUserDatap, - LL_EXSTAT_NONE); - } + + if (mParams.mRequestDatap) + { + if (mParams.mCompleteCallback) + { + mParams.mCompleteCallback(err_code, + mParams.getAssetID(), + mParams.getAssetType(), + mParams.mRequestDatap, + LL_EXSTAT_NONE); + } + delete mParams.mRequestDatap; + mParams.mRequestDatap = NULL; + } } diff --git a/indra/llmessage/lltransfertargetvfile.h b/indra/llmessage/lltransfertargetvfile.h index 23a65e4bb2..c819c1e2f2 100644 --- a/indra/llmessage/lltransfertargetvfile.h +++ b/indra/llmessage/lltransfertargetvfile.h @@ -39,7 +39,7 @@ typedef void (*LLTTVFCompleteCallback)( S32 status, const LLUUID& file_id, LLAssetType::EType file_type, - void* user_data, LLExtStat ext_status ); + LLBaseDownloadRequest* user_data, LLExtStat ext_status ); class LLTransferTargetParamsVFile : public LLTransferTargetParams { @@ -47,7 +47,7 @@ public: LLTransferTargetParamsVFile(); void setAsset(const LLUUID& asset_id, LLAssetType::EType asset_type); - void setCallback(LLTTVFCompleteCallback cb, void* user_data); + void setCallback(LLTTVFCompleteCallback cb, LLBaseDownloadRequest& request); LLUUID getAssetID() const { return mAssetID; } LLAssetType::EType getAssetType() const { return mAssetType; } @@ -60,7 +60,7 @@ protected: LLAssetType::EType mAssetType; LLTTVFCompleteCallback mCompleteCallback; - void* mUserDatap; + LLBaseDownloadRequest* mRequestDatap; S32 mErrCode; }; diff --git a/indra/llprimitive/lldaeloader.cpp b/indra/llprimitive/lldaeloader.cpp index 5cb2d17351..0ca3be6624 100644 --- a/indra/llprimitive/lldaeloader.cpp +++ b/indra/llprimitive/lldaeloader.cpp @@ -63,6 +63,9 @@ #include "glh/glh_linear.h" #include "llmatrix4a.h" +#include +#include + // Logging for error and warning messages from colladadom #include "dae/daeErrorHandler.h" @@ -845,7 +848,8 @@ LLDAELoader::LLDAELoader( void* opaque_userdata, JointTransformMap& jointMap, JointSet& jointsFromNodes, - U32 modelLimit) + U32 modelLimit, + bool preprocess) : LLModelLoader( filename, lod, @@ -857,7 +861,7 @@ LLDAELoader::LLDAELoader( jointMap, jointsFromNodes), mGeneratedModelLimit(modelLimit), -mForceIdNaming(false) +mPreprocessDAE(preprocess) { } @@ -890,10 +894,20 @@ bool LLDAELoader::OpenFile(const std::string& filename) //no suitable slm exists, load from the .dae file DAE dae; - // Bug fixes in mesh importer by Drake Arconis - //domCOLLADA* dom = dae.open(filename); - domCOLLADA* dom = dae.open(tmp_file); - // + domCOLLADA* dom; + if (mPreprocessDAE) + { + // Bug fixes in mesh importer by Drake Arconis + //dom = dae.openFromMemory(filename, preprocessDAE(filename).c_str()); + dom = dae.openFromMemory(tmp_file, preprocessDAE(filename).c_str()); + } + else + { + LL_INFOS() << "Skipping dae preprocessing" << LL_ENDL; + // Bug fixes in mesh importer by Drake Arconis + //dom = dae.open(filename); + dom = dae.open(tmp_file); + } if (!dom) { @@ -922,9 +936,8 @@ bool LLDAELoader::OpenFile(const std::string& filename) daeInt count = db->getElementCount(NULL, COLLADA_TYPE_MESH); // Bug fixes in mesh importer by Drake Arconis - //daeDocument* doc = dae.getDoc(mFilename); + //daeDocument* doc = dae.getDoc(filename); daeDocument* doc = dae.getDoc(tmp_file); - // if (!doc) { LL_WARNS() << "can't find internal doc" << LL_ENDL; @@ -995,32 +1008,6 @@ bool LLDAELoader::OpenFile(const std::string& filename) mTransform.condition(); - mForceIdNaming = false; - std::vector checkNames; - for (daeInt idx = 0; idx < count; ++idx) - { - domMesh* mesh = NULL; - db->getElement((daeElement**)&mesh, idx, NULL, COLLADA_TYPE_MESH); - - if (mesh) - { - std::string name = getLodlessLabel(mesh, false); - - std::vector::iterator it; - it = std::find(checkNames.begin(), checkNames.end(), name); - if (it != checkNames.end()) - { - LL_WARNS() << "document has duplicate names, using IDs instead" << LL_ENDL; - mForceIdNaming = true; - break; - } - else - { - checkNames.push_back(name); - } - } - } - U32 submodel_limit = count > 0 ? mGeneratedModelLimit/count : 0; for (daeInt idx = 0; idx < count; ++idx) { //build map of domEntities to LLModel @@ -1128,6 +1115,41 @@ bool LLDAELoader::OpenFile(const std::string& filename) return true; } +std::string LLDAELoader::preprocessDAE(std::string filename) +{ + // Open a DAE file for some preprocessing (like removing space characters in IDs), see MAINT-5678 + std::ifstream inFile; + inFile.open(filename.c_str(), std::ios_base::in); + std::stringstream strStream; + strStream << inFile.rdbuf(); + std::string buffer = strStream.str(); + + LL_INFOS() << "Preprocessing dae file to remove spaces from the names, ids, etc." << LL_ENDL; + + try + { + boost::regex re("\"[\\w\\.@#$-]*(\\s[\\w\\.@#$-]*)+\""); + boost::sregex_iterator next(buffer.begin(), buffer.end(), re); + boost::sregex_iterator end; + while (next != end) + { + boost::smatch match = *next; + std::string s = match.str(); + LL_INFOS() << s << " found" << LL_ENDL; + boost::replace_all(s, " ", "_"); + LL_INFOS() << "Replacing with " << s << LL_ENDL; + boost::replace_all(buffer, match.str(), s); + next++; + } + } + catch (boost::regex_error &) + { + LL_INFOS() << "Regex error" << LL_ENDL; + } + + return buffer; +} + void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, domMesh* mesh, domSkin* skin) { llassert(model && dae && mesh && skin); @@ -2021,7 +2043,7 @@ void LLDAELoader::processElement( daeElement* element, bool& badElement, DAE* da if (model->mLabel.empty()) { - label = getLodlessLabel(instance_geo, mForceIdNaming); + label = getLodlessLabel(instance_geo); llassert(!label.empty()); @@ -2236,17 +2258,12 @@ LLImportMaterial LLDAELoader::profileToMaterial(domProfile_COMMON* material, DAE return mat; } -std::string LLDAELoader::getElementLabel(daeElement *element) -{ - return getElementLabel(element, mForceIdNaming); -} - // try to get a decent label for this element -std::string LLDAELoader::getElementLabel(daeElement *element, bool forceIdNaming) +std::string LLDAELoader::getElementLabel(daeElement *element) { // if we have a name attribute, use it std::string name = element->getAttribute("name"); - if (name.length() && !forceIdNaming) + if (name.length()) { return name; } @@ -2269,7 +2286,7 @@ std::string LLDAELoader::getElementLabel(daeElement *element, bool forceIdNaming // if parent has a name or ID, use it std::string name = parent->getAttribute("name"); - if (!name.length() || forceIdNaming) + if (!name.length()) { name = std::string(parent->getID()); } @@ -2315,9 +2332,9 @@ size_t LLDAELoader::getSuffixPosition(std::string label) } // static -std::string LLDAELoader::getLodlessLabel(daeElement *element, bool forceIdNaming) +std::string LLDAELoader::getLodlessLabel(daeElement *element) { - std::string label = getElementLabel(element, forceIdNaming); + std::string label = getElementLabel(element); size_t ext_pos = getSuffixPosition(label); if (ext_pos != -1) { @@ -2426,13 +2443,8 @@ bool LLDAELoader::addVolumeFacesFromDomMesh(LLModel* pModel,domMesh* mesh) return (status == LLModel::NO_ERRORS); } -LLModel* LLDAELoader::loadModelFromDomMesh(domMesh *mesh) -{ - return loadModelFromDomMesh(mesh, mForceIdNaming); -} - //static -LLModel* LLDAELoader::loadModelFromDomMesh(domMesh *mesh, bool forceIdNaming) +LLModel* LLDAELoader::loadModelFromDomMesh(domMesh *mesh) { LLVolumeParams volume_params; volume_params.setType(LL_PCODE_PROFILE_SQUARE, LL_PCODE_PATH_LINE); @@ -2440,7 +2452,7 @@ LLModel* LLDAELoader::loadModelFromDomMesh(domMesh *mesh, bool forceIdNaming) createVolumeFacesFromDomMesh(ret, mesh); if (ret->mLabel.empty()) { - ret->mLabel = getElementLabel(mesh, forceIdNaming); + ret->mLabel = getElementLabel(mesh); } return ret; } @@ -2458,7 +2470,7 @@ bool LLDAELoader::loadModelsFromDomMesh(domMesh* mesh, std::vector& mo LLModel* ret = new LLModel(volume_params, 0.f); - std::string model_name = getLodlessLabel(mesh, mForceIdNaming); + std::string model_name = getLodlessLabel(mesh); ret->mLabel = model_name + lod_suffix[mLod]; llassert(!ret->mLabel.empty()); diff --git a/indra/llprimitive/lldaeloader.h b/indra/llprimitive/lldaeloader.h index 3ababd3156..27db5326d5 100644 --- a/indra/llprimitive/lldaeloader.h +++ b/indra/llprimitive/lldaeloader.h @@ -56,7 +56,8 @@ public: void* opaque_userdata, JointTransformMap& jointMap, JointSet& jointsFromNodes, - U32 modelLimit); + U32 modelLimit, + bool preprocess); virtual ~LLDAELoader() ; virtual bool OpenFile(const std::string& filename); @@ -89,22 +90,22 @@ protected: static bool addVolumeFacesFromDomMesh(LLModel* model, domMesh* mesh); static bool createVolumeFacesFromDomMesh(LLModel* model, domMesh *mesh); - static LLModel* loadModelFromDomMesh(domMesh* mesh, bool forceIdNaming); - LLModel* loadModelFromDomMesh(domMesh* mesh); + static LLModel* loadModelFromDomMesh(domMesh* mesh); // Loads a mesh breaking it into one or more models as necessary // to get around volume face limitations while retaining >8 materials // bool loadModelsFromDomMesh(domMesh* mesh, std::vector& models_out, U32 submodel_limit); - static std::string getElementLabel(daeElement *element, bool forceIdNaming); - std::string getElementLabel(daeElement *element); + static std::string getElementLabel(daeElement *element); static size_t getSuffixPosition(std::string label); - static std::string getLodlessLabel(daeElement *element, bool forceIdNaming = false); + static std::string getLodlessLabel(daeElement *element); + + static std::string preprocessDAE(std::string filename); private: U32 mGeneratedModelLimit; // Attempt to limit amount of generated submodels - bool mForceIdNaming; + bool mPreprocessDAE; }; #endif // LL_LLDAELLOADER_H diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp index f2554d7a4e..2b1d097a2d 100644 --- a/indra/llrender/llfontgl.cpp +++ b/indra/llrender/llfontgl.cpp @@ -94,26 +94,33 @@ BOOL LLFontGL::loadFace(const std::string& filename, F32 point_size, F32 vert_dp static LLTrace::BlockTimerStatHandle FTM_RENDER_FONTS("Fonts"); -S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, const LLRect& rect, const LLColor4 &color, HAlign halign, VAlign valign, U8 style, +S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, const LLRect& rect, const LLColor4 &color, HAlign halign, VAlign valign, U8 style, + ShadowType shadow, S32 max_chars, F32* right_x, BOOL use_ellipses) const +{ + LLRectf rect_float(rect.mLeft, rect.mTop, rect.mRight, rect.mBottom); + return render(wstr, begin_offset, rect_float, color, halign, valign, style, shadow, max_chars, right_x, use_ellipses); +} + +S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, const LLRectf& rect, const LLColor4 &color, HAlign halign, VAlign valign, U8 style, ShadowType shadow, S32 max_chars, F32* right_x, BOOL use_ellipses) const { - F32 x = (F32)rect.mLeft; + F32 x = rect.mLeft; F32 y = 0.f; switch(valign) { case TOP: - y = (F32)rect.mTop; + y = rect.mTop; break; case VCENTER: - y = (F32)rect.getCenterY(); + y = rect.getCenterY(); break; case BASELINE: case BOTTOM: - y = (F32)rect.mBottom; + y = rect.mBottom; break; default: - y = (F32)rect.mBottom; + y = rect.mBottom; break; } return render(wstr, begin_offset, x, y, color, halign, valign, style, shadow, max_chars, rect.getWidth(), right_x, use_ellipses); @@ -357,7 +364,12 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons if (right_x) { - *right_x = (cur_x - origin.mV[VX]) / sScaleX; + F32 cr_x = (cur_x - origin.mV[VX]) / sScaleX; + if (*right_x < cr_x) + { + // rightmost edge of previously drawn text, don't draw over previous text + *right_x = cr_x; + } } //FIXME: add underline as glyph? diff --git a/indra/llrender/llfontgl.h b/indra/llrender/llfontgl.h index 461823be18..a10e0d64e9 100644 --- a/indra/llrender/llfontgl.h +++ b/indra/llrender/llfontgl.h @@ -98,6 +98,15 @@ public: F32* right_x=NULL, BOOL use_ellipses = FALSE) const; + S32 render(const LLWString &text, S32 begin_offset, + const LLRectf& rect, + const LLColor4 &color, + HAlign halign = LEFT, VAlign valign = BASELINE, + U8 style = NORMAL, ShadowType shadow = NO_SHADOW, + S32 max_chars = S32_MAX, + F32* right_x=NULL, + BOOL use_ellipses = FALSE) const; + S32 render(const LLWString &text, S32 begin_offset, F32 x, F32 y, const LLColor4 &color, diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index 753e24159a..2c28c88e02 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -327,6 +327,14 @@ LLGLSLShader::~LLGLSLShader() } void LLGLSLShader::unload() +{ + mShaderFiles.clear(); + mDefines.clear(); + + unloadInternal(); +} + +void LLGLSLShader::unloadInternal() { sInstances.erase(this); @@ -334,8 +342,6 @@ void LLGLSLShader::unload() mAttribute.clear(); mTexture.clear(); mUniform.clear(); - mShaderFiles.clear(); - mDefines.clear(); if (mProgramObject) { @@ -357,13 +363,13 @@ void LLGLSLShader::unload() mProgramObject = 0; } - + if (mTimerQuery) { glDeleteQueriesARB(1, &mTimerQuery); mTimerQuery = 0; } - + if (mSamplesQuery) { glDeleteQueriesARB(1, &mSamplesQuery); @@ -372,7 +378,7 @@ void LLGLSLShader::unload() //hack to make apple not complain glGetError(); - + stop_glerror(); } @@ -381,6 +387,8 @@ BOOL LLGLSLShader::createShader(std::vector * attributes, U32 varying_count, const char** varyings) { + unloadInternal(); + sInstances.insert(this); //reloading, reset matrix hash values diff --git a/indra/llrender/llglslshader.h b/indra/llrender/llglslshader.h index 5abddf274b..0746e8760a 100644 --- a/indra/llrender/llglslshader.h +++ b/indra/llrender/llglslshader.h @@ -198,7 +198,9 @@ public: bool mTextureStateFetched; std::vector mTextureMagFilter; std::vector mTextureMinFilter; - + +private: + void unloadInternal(); }; //UI shader (declared here so llui_libtest will link properly) diff --git a/indra/llrender/llgltexture.cpp b/indra/llrender/llgltexture.cpp index fb5e40c2c5..3a6eebebba 100644 --- a/indra/llrender/llgltexture.cpp +++ b/indra/llrender/llgltexture.cpp @@ -112,7 +112,8 @@ void LLGLTexture::setBoostLevel(S32 level) if(mBoostLevel != level) { mBoostLevel = level ; - if(mBoostLevel != LLGLTexture::BOOST_NONE) + if(mBoostLevel != LLGLTexture::BOOST_NONE + && mBoostLevel != LLGLTexture::BOOST_ICON) { setNoDelete() ; } @@ -130,13 +131,6 @@ void LLGLTexture::setActive() { mTextureState = ACTIVE ; } - - // Try to plug the profile icon memory hole - if (mBoostLevel == BOOST_ICON) - { - setNoDelete(); - } - // } //set the texture to stay in memory diff --git a/indra/llui/lliconctrl.cpp b/indra/llui/lliconctrl.cpp index 58b66f60ca..f841901801 100644 --- a/indra/llui/lliconctrl.cpp +++ b/indra/llui/lliconctrl.cpp @@ -54,7 +54,9 @@ LLIconCtrl::LLIconCtrl(const LLIconCtrl::Params& p) mUseDrawContextAlpha(p.use_draw_context_alpha), mPriority(0), mMinWidth(p.min_width), - mMinHeight(p.min_height) + mMinHeight(p.min_height), + mMaxWidth(0), + mMaxHeight(0) { if (mImagep.notNull()) { @@ -104,7 +106,15 @@ void LLIconCtrl::setValue(const LLSD& value ) && mMinWidth && mMinHeight) { - mImagep->getImage()->setKnownDrawSize(llmax(mMinWidth, mImagep->getWidth()), llmax(mMinHeight, mImagep->getHeight())); + S32 desired_draw_width = llmax(mMinWidth, mImagep->getWidth()); + S32 desired_draw_height = llmax(mMinHeight, mImagep->getHeight()); + if (mMaxWidth && mMaxHeight) + { + desired_draw_width = llmin(desired_draw_width, mMaxWidth); + desired_draw_height = llmin(desired_draw_height, mMaxHeight); + } + + mImagep->getImage()->setKnownDrawSize(desired_draw_width, desired_draw_height); } } diff --git a/indra/llui/lliconctrl.h b/indra/llui/lliconctrl.h index 8b1092df46..7971cd44d3 100644 --- a/indra/llui/lliconctrl.h +++ b/indra/llui/lliconctrl.h @@ -79,7 +79,9 @@ protected: //the output size of the icon image if set. S32 mMinWidth, - mMinHeight; + mMinHeight, + mMaxWidth, + mMaxHeight; // If set to true (default), use the draw context transparency. // If false, will use transparency returned by getCurrentTransparency(). See STORM-698. diff --git a/indra/llui/llradiogroup.cpp b/indra/llui/llradiogroup.cpp index b53bb16d97..8cf72928ff 100644 --- a/indra/llui/llradiogroup.cpp +++ b/indra/llui/llradiogroup.cpp @@ -179,6 +179,18 @@ BOOL LLRadioGroup::setSelectedIndex(S32 index, BOOL from_event) return FALSE; } + if (index < -1) + { + // less then minimum value + return FALSE; + } + + if (index < 0 && mSelectedIndex >= 0 && !mAllowDeselect) + { + // -1 is "nothing selected" + return FALSE; + } + if (mSelectedIndex >= 0) { LLRadioCtrl* old_radio_item = mRadioButtons[mSelectedIndex]; diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 22abc2111c..a6e550b7a3 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -751,7 +751,7 @@ void LLTextBase::drawText() line_end = next_start; } - LLRect text_rect(line.mRect); + LLRectf text_rect(line.mRect.mLeft, line.mRect.mTop, line.mRect.mRight, line.mRect.mBottom); text_rect.mRight = mDocumentView->getRect().getWidth(); // clamp right edge to document extents text_rect.translate(mDocumentView->getRect().mLeft, mDocumentView->getRect().mBottom); // adjust by scroll position @@ -824,7 +824,7 @@ void LLTextBase::drawText() ++misspell_it; } - text_rect.mLeft = (S32)(cur_segment->draw(seg_start - cur_segment->getStart(), clipped_end, selection_left, selection_right, text_rect)); + text_rect.mLeft = cur_segment->draw(seg_start - cur_segment->getStart(), clipped_end, selection_left, selection_right, text_rect); seg_start = clipped_end + cur_segment->getStart(); } @@ -3314,7 +3314,7 @@ bool LLTextSegment::getDimensions(S32 first_char, S32 num_chars, S32& width, S32 S32 LLTextSegment::getOffset(S32 segment_local_x_coord, S32 start_offset, S32 num_chars, bool round) const { return 0; } S32 LLTextSegment::getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars) const { return 0; } void LLTextSegment::updateLayout(const LLTextBase& editor) {} -F32 LLTextSegment::draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRect& draw_rect) { return draw_rect.mLeft; } +F32 LLTextSegment::draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect) { return draw_rect.mLeft; } bool LLTextSegment::canEdit() const { return false; } void LLTextSegment::unlinkFromDocument(LLTextBase*) {} void LLTextSegment::linkToDocument(LLTextBase*) {} @@ -3380,7 +3380,7 @@ LLNormalTextSegment::~LLNormalTextSegment() } -F32 LLNormalTextSegment::draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRect& draw_rect) +F32 LLNormalTextSegment::draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect) { if( end - start > 0 ) { @@ -3390,7 +3390,7 @@ F32 LLNormalTextSegment::draw(S32 start, S32 end, S32 selection_start, S32 selec } // Draws a single text segment, reversing the color for selection if needed. -F32 LLNormalTextSegment::drawClippedSegment(S32 seg_start, S32 seg_end, S32 selection_start, S32 selection_end, LLRect rect) +F32 LLNormalTextSegment::drawClippedSegment(S32 seg_start, S32 seg_end, S32 selection_start, S32 selection_end, LLRectf rect) { F32 alpha = LLViewDrawContext::getCurrentContext().mAlpha; @@ -3422,7 +3422,7 @@ F32 LLNormalTextSegment::drawClippedSegment(S32 seg_start, S32 seg_end, S32 sele &right_x, mEditor.getUseEllipses()); } - rect.mLeft = (S32)ceil(right_x); + rect.mLeft = right_x; if( (selection_start < seg_end) && (selection_end > seg_start) ) { @@ -3441,7 +3441,7 @@ F32 LLNormalTextSegment::drawClippedSegment(S32 seg_start, S32 seg_end, S32 sele &right_x, mEditor.getUseEllipses()); } - rect.mLeft = (S32)ceil(right_x); + rect.mLeft = right_x; if( selection_end < seg_end ) { // Draw normally @@ -3458,7 +3458,7 @@ F32 LLNormalTextSegment::drawClippedSegment(S32 seg_start, S32 seg_end, S32 sele &right_x, mEditor.getUseEllipses()); } - return right_x; + return right_x; } BOOL LLNormalTextSegment::handleHover(S32 x, S32 y, MASK mask) @@ -3702,7 +3702,7 @@ LLOnHoverChangeableTextSegment::LLOnHoverChangeableTextSegment( LLStyleConstSP s mNormalStyle(normal_style){} /*virtual*/ -F32 LLOnHoverChangeableTextSegment::draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRect& draw_rect) +F32 LLOnHoverChangeableTextSegment::draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect) { F32 result = LLNormalTextSegment::draw(start, end, selection_start, selection_end, draw_rect); if (end == mEnd - mStart) @@ -3780,7 +3780,7 @@ void LLInlineViewSegment::updateLayout(const LLTextBase& editor) mView->setOrigin(start_rect.mLeft + mLeftPad, start_rect.mBottom + mBottomPad); } -F32 LLInlineViewSegment::draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRect& draw_rect) +F32 LLInlineViewSegment::draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect) { // return padded width of widget // widget is actually drawn during mDocumentView's draw() @@ -3821,7 +3821,7 @@ S32 LLLineBreakTextSegment::getNumChars(S32 num_pixels, S32 segment_offset, S32 { return 1; } -F32 LLLineBreakTextSegment::draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRect& draw_rect) +F32 LLLineBreakTextSegment::draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect) { return draw_rect.mLeft; } @@ -3887,7 +3887,7 @@ void LLImageTextSegment::setToolTip(const std::string& tooltip) mTooltip = tooltip; } -F32 LLImageTextSegment::draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRect& draw_rect) +F32 LLImageTextSegment::draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect) { if ( (start >= 0) && (end <= mEnd - mStart)) { diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index 94100366e5..634ee77c0c 100644 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -66,7 +66,7 @@ public: virtual S32 getOffset(S32 segment_local_x_coord, S32 start_offset, S32 num_chars, bool round) const; virtual S32 getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars) const; virtual void updateLayout(const class LLTextBase& editor); - virtual F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRect& draw_rect); + virtual F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect); virtual bool canEdit() const; virtual void unlinkFromDocument(class LLTextBase* editor); virtual void linkToDocument(class LLTextBase* editor); @@ -117,7 +117,7 @@ public: /*virtual*/ bool getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const; /*virtual*/ S32 getOffset(S32 segment_local_x_coord, S32 start_offset, S32 num_chars, bool round) const; /*virtual*/ S32 getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars) const; - /*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRect& draw_rect); + /*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect); /*virtual*/ bool canEdit() const { return true; } /*virtual*/ const LLColor4& getColor() const { return mStyle->getColor(); } /*virtual*/ LLStyleConstSP getStyle() const { return mStyle; } @@ -135,7 +135,7 @@ public: /*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask); protected: - F32 drawClippedSegment(S32 seg_start, S32 seg_end, S32 selection_start, S32 selection_end, LLRect rect); + F32 drawClippedSegment(S32 seg_start, S32 seg_end, S32 selection_start, S32 selection_end, LLRectf rect); virtual const LLWString& getWText() const; virtual const S32 getLength() const; @@ -169,7 +169,7 @@ class LLOnHoverChangeableTextSegment : public LLNormalTextSegment { public: LLOnHoverChangeableTextSegment( LLStyleConstSP style, LLStyleConstSP normal_style, S32 start, S32 end, LLTextBase& editor ); - /*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRect& draw_rect); + /*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect); /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); protected: // Style used for text when mouse pointer is over segment @@ -203,7 +203,7 @@ public: /*virtual*/ bool getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const; /*virtual*/ S32 getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars) const; /*virtual*/ void updateLayout(const class LLTextBase& editor); - /*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRect& draw_rect); + /*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect); /*virtual*/ bool canEdit() const { return false; } /*virtual*/ void unlinkFromDocument(class LLTextBase* editor); /*virtual*/ void linkToDocument(class LLTextBase* editor); @@ -226,7 +226,7 @@ public: ~LLLineBreakTextSegment(); bool getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const; S32 getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars) const; - F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRect& draw_rect); + F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect); private: S32 mFontHeight; @@ -239,7 +239,7 @@ public: ~LLImageTextSegment(); bool getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const; S32 getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars) const; - F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRect& draw_rect); + F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect); /*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask); /*virtual*/ void setToolTip(const std::string& tooltip); diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index 369b77e533..b245638655 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -233,8 +233,8 @@ LLUrlEntryHTTP::LLUrlEntryHTTP() : LLUrlEntryBase() { // FIRE-1715: Links using FTP protocol are not recognized - //mPattern = boost::regex("https?://([-\\w\\.]+)+(:\\d+)?(:\\w+)?(@\\d+)?(@\\w+)?\\.[a-z](:\\d+)?(:\\w+)?(@\\d+)?(@\\w+)?/?\\S*", - mPattern = boost::regex("(https?|ftp)://([-\\w\\.]+)+(:\\d+)?(:\\w+)?(@\\d+)?(@\\w+)?\\.[a-z](:\\d+)?(:\\w+)?(@\\d+)?(@\\w+)?/?\\S*", + //mPattern = boost::regex("https?://([^\\s/?\\.#]+\\.?)+\\.\\w+(:\\d+)?(/\\S*)?", + mPattern = boost::regex("(https?|ftp)://([^\\s/?\\.#]+\\.?)+\\.\\w+(:\\d+)?(/\\S*)?", // boost::regex::perl|boost::regex::icase); mMenuName = "menu_url_http.xml"; diff --git a/indra/llui/tests/llurlentry_test.cpp b/indra/llui/tests/llurlentry_test.cpp index dde54c78c4..d41930a492 100644 --- a/indra/llui/tests/llurlentry_test.cpp +++ b/indra/llui/tests/llurlentry_test.cpp @@ -232,6 +232,14 @@ namespace tut testRegex("http url with newlines", url, "XX\nhttp://www.secondlife.com/\nXX", "http://www.secondlife.com/"); + + testRegex("http url without tld shouldn't be decorated (1)", url, + "http://test", + ""); + + testRegex("http url without tld shouldn't be decorated (2)", url, + "http://test .com", + ""); } template<> template<> diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index 5cf24caa72..0bdbbad338 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -76,6 +76,7 @@ private: bool onHTTPAuthCallback(const std::string host, const std::string realm, std::string& username, std::string& password); void onCursorChangedCallback(LLCEFLib::ECursorType type, unsigned int handle); void onFileDownloadCallback(std::string filename); + const std::string onFileDialogCallback(); void postDebugMessage(const std::string& msg); void authResponse(LLPluginMessage &message); @@ -102,6 +103,7 @@ private: bool mCanPaste; std::string mCachePath; std::string mCookiePath; + std::string mPickedFile; LLCEFLib* mLLCEFLib; VolumeCatcher mVolumeCatcher; @@ -142,6 +144,7 @@ MediaPluginBase(host_send_func, host_user_data) mCanPaste = false; mCachePath = ""; mCookiePath = ""; + mPickedFile = ""; mLLCEFLib = new LLCEFLib(); // FS specific CEF settings @@ -393,6 +396,20 @@ void MediaPluginCEF::onFileDownloadCallback(const std::string filename) sendMessage(message); } +//////////////////////////////////////////////////////////////////////////////// +// +const std::string MediaPluginCEF::onFileDialogCallback() +{ + mPickedFile.clear(); + + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "pick_file"); + message.setValueBoolean("blocking_request", true); + + sendMessage(message); + + return mPickedFile; +} + void MediaPluginCEF::onCursorChangedCallback(LLCEFLib::ECursorType type, unsigned int handle) { std::string name = ""; @@ -533,6 +550,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string) mLLCEFLib->setOnNavigateURLCallback(boost::bind(&MediaPluginCEF::onNavigateURLCallback, this, _1, _2)); mLLCEFLib->setOnHTTPAuthCallback(boost::bind(&MediaPluginCEF::onHTTPAuthCallback, this, _1, _2, _3, _4)); mLLCEFLib->setOnFileDownloadCallback(boost::bind(&MediaPluginCEF::onFileDownloadCallback, this, _1)); + mLLCEFLib->setOnFileDialogCallback(boost::bind(&MediaPluginCEF::onFileDialogCallback, this)); mLLCEFLib->setOnCursorChangedCallback(boost::bind(&MediaPluginCEF::onCursorChangedCallback, this, _1, _2)); mLLCEFLib->setOnRequestExitCallback(boost::bind(&MediaPluginCEF::onRequestExitCallback, this)); @@ -749,6 +767,10 @@ void MediaPluginCEF::receiveMessage(const char* message_string) { mEnableMediaPluginDebugging = message_in.getValueBoolean("enable"); } + if (message_name == "pick_file_response") + { + mPickedFile = message_in.getValue("file"); + } if (message_name == "auth_response") { authResponse(message_in); diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 19b617bdf9..a98ac542cc 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -1446,6 +1446,17 @@ U32 Value 768 + + ImporterPreprocessDAE + + Comment + Enable preprocessing for DAE files to fix some ColladaDOM related problems (like support for space characters within names and ids). + Persist + 1 + Type + Boolean + Value + 1 IMShowTime @@ -10568,6 +10579,17 @@ Change of this parameter will affect the layout of buttons in notification toast Value 256 + RegionCheckTextureHeights + + Comment + Don't allow user to set low heights greater than high + Persist + 1 + Type + Boolean + Value + 1 + RememberPassword Comment diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index 11a274e207..05b6c413da 100644 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -109,7 +109,18 @@ Boolean Value 1 - + + NavigationBarRatio + + Comment + The ratio between the width of Navigation layout panel and the width of whole Navigation layout stack + Persist + 1 + Type + F32 + Value + 0.6 + FSAutorespondMode Comment diff --git a/indra/newview/daeexport.cpp b/indra/newview/daeexport.cpp index b1bae4b6a4..87d576951e 100644 --- a/indra/newview/daeexport.cpp +++ b/indra/newview/daeexport.cpp @@ -83,6 +83,7 @@ #include "llviewercontrol.h" #include "llviewernetwork.h" #include "llviewerregion.h" +#include "llviewertexturelist.h" #include "llvovolume.h" #include "fsexportperms.h" @@ -485,7 +486,7 @@ void ColladaExportFloater::CacheReadResponder::saveTexturesWorker(void* data) } LLUUID id = me->mTexturesToSave.begin()->first; - LLViewerTexture* imagep = LLViewerTextureManager::findTexture(id); + LLViewerTexture* imagep = LLViewerTextureManager::findFetchedTexture(id, TEX_LIST_DISCARD); if (!imagep) { me->mTexturesToSave.erase(id); diff --git a/indra/newview/fonts/fonts.xml b/indra/newview/fonts/fonts.xml index 83e96b7cc5..77aaf03dbd 100644 --- a/indra/newview/fonts/fonts.xml +++ b/indra/newview/fonts/fonts.xml @@ -15,12 +15,12 @@ ヒラギノ角ゴシック W3.ttc ヒラギノ角ゴ Pro W3.otf ヒラギノ角ゴ ProN W3.otf - AppleSDGothicNeo-Regular.otf AppleSDGothicNeo.ttc AppleGothic.dfont AppleGothic.ttf + AppleSDGothicNeo-Regular.otf 华文细黑.ttf diff --git a/indra/newview/fonts/fonts_deja_vu_all_caps.xml b/indra/newview/fonts/fonts_deja_vu_all_caps.xml index 04a6f1252d..bca6f31667 100644 --- a/indra/newview/fonts/fonts_deja_vu_all_caps.xml +++ b/indra/newview/fonts/fonts_deja_vu_all_caps.xml @@ -15,9 +15,9 @@ ヒラギノ角ゴシック W3.ttc ヒラギノ角ゴ Pro W3.otf ヒラギノ角ゴ ProN W3.otf - AppleSDGothicNeo-Regular.otf AppleGothic.dfont AppleGothic.ttf + AppleSDGothicNeo-Regular.otf 华文细黑.ttf diff --git a/indra/newview/fonts/fonts_droid.xml b/indra/newview/fonts/fonts_droid.xml index 9b21ce572e..db0206ea29 100644 --- a/indra/newview/fonts/fonts_droid.xml +++ b/indra/newview/fonts/fonts_droid.xml @@ -15,9 +15,9 @@ ヒラギノ角ゴシック W3.ttc ヒラギノ角ゴ Pro W3.otf ヒラギノ角ゴ ProN W3.otf - AppleSDGothicNeo-Regular.otf AppleGothic.dfont AppleGothic.ttf + AppleSDGothicNeo-Regular.otf 华文细黑.ttf diff --git a/indra/newview/fonts/fonts_dyslexia.xml b/indra/newview/fonts/fonts_dyslexia.xml index 96e2e145e3..7e5caa010d 100644 --- a/indra/newview/fonts/fonts_dyslexia.xml +++ b/indra/newview/fonts/fonts_dyslexia.xml @@ -15,9 +15,9 @@ ヒラギノ角ゴシック W3.ttc ヒラギノ角ゴ Pro W3.otf ヒラギノ角ゴ ProN W3.otf - AppleSDGothicNeo-Regular.otf AppleGothic.dfont AppleGothic.ttf + AppleSDGothicNeo-Regular.otf 华文细黑.ttf diff --git a/indra/newview/fonts/fonts_liberation.xml b/indra/newview/fonts/fonts_liberation.xml index 886b2d10da..734206da8b 100644 --- a/indra/newview/fonts/fonts_liberation.xml +++ b/indra/newview/fonts/fonts_liberation.xml @@ -15,9 +15,9 @@ ヒラギノ角ゴシック W3.ttc ヒラギノ角ゴ Pro W3.otf ヒラギノ角ゴ ProN W3.otf - AppleSDGothicNeo-Regular.otf AppleGothic.dfont AppleGothic.ttf + AppleSDGothicNeo-Regular.otf 华文细黑.ttf diff --git a/indra/newview/fonts/fonts_mobi.xml b/indra/newview/fonts/fonts_mobi.xml index d16919e512..48cc82619a 100644 --- a/indra/newview/fonts/fonts_mobi.xml +++ b/indra/newview/fonts/fonts_mobi.xml @@ -15,9 +15,9 @@ ヒラギノ角ゴシック W3.ttc ヒラギノ角ゴ Pro W3.otf ヒラギノ角ゴ ProN W3.otf - AppleSDGothicNeo-Regular.otf AppleGothic.dfont AppleGothic.ttf + AppleSDGothicNeo-Regular.otf 华文细黑.ttf diff --git a/indra/newview/fonts/fonts_roboto.xml b/indra/newview/fonts/fonts_roboto.xml index 2a3bdd1bf0..71b0dd622c 100644 --- a/indra/newview/fonts/fonts_roboto.xml +++ b/indra/newview/fonts/fonts_roboto.xml @@ -15,9 +15,9 @@ ヒラギノ角ゴシック W3.ttc ヒラギノ角ゴ Pro W3.otf ヒラギノ角ゴ ProN W3.otf - AppleSDGothicNeo-Regular.otf AppleGothic.dfont AppleGothic.ttf + AppleSDGothicNeo-Regular.otf 华文细黑.ttf diff --git a/indra/newview/fonts/fonts_ubuntu.xml b/indra/newview/fonts/fonts_ubuntu.xml index 73c54491a3..d4f03ec9e6 100644 --- a/indra/newview/fonts/fonts_ubuntu.xml +++ b/indra/newview/fonts/fonts_ubuntu.xml @@ -15,9 +15,9 @@ ヒラギノ角ゴシック W3.ttc ヒラギノ角ゴ Pro W3.otf ヒラギノ角ゴ ProN W3.otf - AppleSDGothicNeo-Regular.otf AppleGothic.dfont AppleGothic.ttf + AppleSDGothicNeo-Regular.otf 华文细黑.ttf diff --git a/indra/newview/fspanellogin.cpp b/indra/newview/fspanellogin.cpp index 2858c5df84..11e9477fe2 100644 --- a/indra/newview/fspanellogin.cpp +++ b/indra/newview/fspanellogin.cpp @@ -862,7 +862,8 @@ void FSPanelLogin::onClickConnect(void *) // The start location SLURL has already been sent to LLStartUp::setStartSLURL std::string username = sInstance->getChild("username_combo")->getValue().asString(); - gSavedSettings.setString("UserLoginInfo", credentialName()); // + std::string password = sInstance->getChild("password_edit")->getValue().asString(); + gSavedSettings.setString("UserLoginInfo", credentialName()); LLSD blocked = FSData::instance().allowedLogin(); if (!blocked.isMap()) //hack for testing for an empty LLSD @@ -870,8 +871,11 @@ void FSPanelLogin::onClickConnect(void *) if(username.empty()) { // user must type in something into the username field - LLSD args; - LLNotificationsUtil::add("MustHaveAccountToLogIn", args); + LLNotificationsUtil::add("MustHaveAccountToLogIn"); + } + else if(password.empty()) + { + LLNotificationsUtil::add("MustEnterPasswordToLogIn"); } else { diff --git a/indra/newview/fspanelprofile.cpp b/indra/newview/fspanelprofile.cpp index 2f3cbe6478..5ffd098b41 100644 --- a/indra/newview/fspanelprofile.cpp +++ b/indra/newview/fspanelprofile.cpp @@ -502,7 +502,7 @@ void FSPanelProfileSecondLife::fillAccountStatus(const LLAvatarData* avatar_data std::string text; if (flags & (FSData::DEVELOPER | FSData::SUPPORT | FSData::QA | FSData::GATEWAY)) { - args["[FIRESTORM]"] = "Firestorm"; + args["[FIRESTORM]"] = LLTrans::getString("APP_NAME"); } if (flags & FSData::DEVELOPER) diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index e974914117..d084494bfe 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -3761,7 +3761,7 @@ void LLAgent::initOriginGlobal(const LLVector3d &origin_global) } BOOL LLAgent::leftButtonGrabbed() const -{ +{ const BOOL camera_mouse_look = gAgentCamera.cameraMouselook(); return (!camera_mouse_look && mControlsTakenCount[CONTROL_LBUTTON_DOWN_INDEX] > 0) || (camera_mouse_look && mControlsTakenCount[CONTROL_ML_LBUTTON_DOWN_INDEX] > 0) @@ -3769,6 +3769,13 @@ BOOL LLAgent::leftButtonGrabbed() const || (camera_mouse_look && mControlsTakenPassedOnCount[CONTROL_ML_LBUTTON_DOWN_INDEX] > 0); } +BOOL LLAgent::leftButtonBlocked() const +{ + const BOOL camera_mouse_look = gAgentCamera.cameraMouselook(); + return (!camera_mouse_look && mControlsTakenCount[CONTROL_LBUTTON_DOWN_INDEX] > 0) + || (camera_mouse_look && mControlsTakenCount[CONTROL_ML_LBUTTON_DOWN_INDEX] > 0); +} + BOOL LLAgent::rotateGrabbed() const { return (mControlsTakenCount[CONTROL_YAW_POS_INDEX] > 0) @@ -4319,7 +4326,14 @@ BOOL LLAgent::anyControlGrabbed() const BOOL LLAgent::isControlGrabbed(S32 control_index) const { - return mControlsTakenCount[control_index] > 0; + if (gAgent.mControlsTakenCount[control_index] > 0) + return TRUE; + return gAgent.mControlsTakenPassedOnCount[control_index] > 0; +} + +BOOL LLAgent::isControlBlocked(S32 control_index) const +{ + return mControlsTakenCount[control_index] > 0; } void LLAgent::forceReleaseControls() @@ -4543,6 +4557,7 @@ void LLAgent::startTeleportRequest() } if (hasPendingTeleportRequest()) { + mTeleportCanceled.reset(); if (!isMaturityPreferenceSyncedWithServer()) { gTeleportDisplay = TRUE; @@ -4572,6 +4587,7 @@ void LLAgent::startTeleportRequest() void LLAgent::handleTeleportFinished() { clearTeleportRequest(); + mTeleportCanceled.reset(); if (mIsMaturityRatingChangingDuringTeleport) { // notify user that the maturity preference has been changed @@ -4727,13 +4743,25 @@ void LLAgent::teleportCancel() msg->addUUIDFast(_PREHASH_AgentID, getID()); msg->addUUIDFast(_PREHASH_SessionID, getSessionID()); sendReliableMessage(); - } + } + mTeleportCanceled = mTeleportRequest; } clearTeleportRequest(); gAgent.setTeleportState( LLAgent::TELEPORT_NONE ); gPipeline.resetVertexBuffers(); } +void LLAgent::restoreCanceledTeleportRequest() +{ + if (mTeleportCanceled != NULL) + { + gAgent.setTeleportState( LLAgent::TELEPORT_REQUESTED ); + mTeleportRequest = mTeleportCanceled; + mTeleportCanceled.reset(); + gTeleportDisplay = TRUE; + gTeleportDisplayTimer.reset(); + } +} void LLAgent::teleportViaLocation(const LLVector3d& pos_global) { diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index 1f662e08d6..8fb7dc0da4 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -513,7 +513,8 @@ private: // Grab //-------------------------------------------------------------------- public: - BOOL leftButtonGrabbed() const; + BOOL leftButtonGrabbed() const; + BOOL leftButtonBlocked() const; BOOL rotateGrabbed() const; BOOL forwardGrabbed() const; BOOL backwardGrabbed() const; @@ -530,8 +531,9 @@ public: BOOL controlFlagsDirty() const; void enableControlFlagReset(); void resetControlFlags(); - BOOL anyControlGrabbed() const; // True iff a script has taken over a control - BOOL isControlGrabbed(S32 control_index) const; + BOOL anyControlGrabbed() const; // True if a script has taken over any control + BOOL isControlGrabbed(S32 control_index) const; // True if a script has taken over a control + BOOL isControlBlocked(S32 control_index) const; // Control should be ignored or won't be passed // Send message to simulator to force grabbed controls to be // released, in case of a poorly written script. void forceReleaseControls(); @@ -707,6 +709,7 @@ public: void teleportViaLocation(const LLVector3d& pos_global); // To a global location - this will probably need to be deprecated void teleportViaLocationLookAt(const LLVector3d& pos_global);// To a global location, preserving camera rotation void teleportCancel(); // May or may not be allowed by server + void restoreCanceledTeleportRequest(); bool getTeleportKeepsLookAt() { return mbTeleportKeepsLookAt; } // Whether look-at reset after teleport // Client LSL Bridge bool teleportBridgeLocal(LLVector3& pos_local); // Teleport using LSL Bridge @@ -736,6 +739,7 @@ private: friend class LLTeleportRequestViaLocationLookAt; LLTeleportRequestPtr mTeleportRequest; + LLTeleportRequestPtr mTeleportCanceled; boost::signals2::connection mTeleportFinishedSlot; boost::signals2::connection mTeleportFailedSlot; diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index 0ec821f6ab..1d29bf4b9e 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -900,7 +900,7 @@ void LLAgentCamera::cameraZoomIn(const F32 fraction) } LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); - if (selection->getObjectCount() && selection->getSelectType() == SELECT_TYPE_HUD) + if (LLToolMgr::getInstance()->inBuildMode() && selection->getObjectCount() && selection->getSelectType() == SELECT_TYPE_HUD) { // just update hud zoom level mHUDTargetZoom /= fraction; diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp index d5fabf2ba0..81a95e40ee 100644 --- a/indra/newview/llaisapi.cpp +++ b/indra/newview/llaisapi.cpp @@ -638,13 +638,25 @@ void AISUpdate::parseCategory(const LLSD& category_map) parseDescendentCount(category_id, category_map["_embedded"]); } - LLPointer new_cat(new LLViewerInventoryCategory(category_id)); + LLPointer new_cat; LLViewerInventoryCategory *curr_cat = gInventory.getCategory(category_id); if (curr_cat) { // Default to current values where not provided. - new_cat->copyViewerCategory(curr_cat); - } + new_cat = new LLViewerInventoryCategory(curr_cat); + } + else + { + if (category_map.has("agent_id")) + { + new_cat = new LLViewerInventoryCategory(category_map["agent_id"].asUUID()); + } + else + { + LL_DEBUGS() << "No owner provided, folder might be assigned wrong owner" << LL_ENDL; + new_cat = new LLViewerInventoryCategory(LLUUID::null); + } + } BOOL rv = new_cat->unpackMessage(category_map); // *NOTE: unpackMessage does not unpack version or descendent count. //if (category_map.has("version")) diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 67df7c6dde..3456ba49cb 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -745,7 +745,8 @@ namespace action_give_inventory static LLInventoryPanel* get_active_inventory_panel() { LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE); - if (!active_panel) + LLFloater* floater_appearance = LLFloaterReg::findInstance("appearance"); + if (!active_panel || (floater_appearance && floater_appearance->hasFocus())) { active_panel = get_outfit_editor_inventory_panel(); } diff --git a/indra/newview/llavatariconctrl.cpp b/indra/newview/llavatariconctrl.cpp index 5dbc57d610..8c03adb684 100644 --- a/indra/newview/llavatariconctrl.cpp +++ b/indra/newview/llavatariconctrl.cpp @@ -182,38 +182,12 @@ LLAvatarIconCtrl::LLAvatarIconCtrl(const LLAvatarIconCtrl::Params& p) mSymbolPos(p.symbol_pos) { mPriority = LLViewerFetchedTexture::BOOST_ICON; - - LLRect rect = p.rect; - // BottomRight is the default position - S32 left = rect.getWidth() - mSymbolSize - mSymbolHpad; - S32 bottom = mSymbolVpad; - - switch(mSymbolPos) - { - case LLAvatarIconCtrlEnums::BOTTOM_LEFT: - { - left = mSymbolHpad; - bottom = mSymbolVpad; - } - - case LLAvatarIconCtrlEnums::TOP_LEFT: - { - left = mSymbolHpad; - bottom = rect.getHeight() - mSymbolSize - mSymbolVpad; - } - - case LLAvatarIconCtrlEnums::TOP_RIGHT: - { - left = rect.getWidth() - mSymbolSize - mSymbolHpad; - bottom = rect.getHeight() - mSymbolSize - mSymbolVpad; - } - - case LLAvatarIconCtrlEnums::BOTTOM_RIGHT: - // fallthrough, is default - default: - rect.setOriginAndSize(left, bottom, mSymbolSize, mSymbolSize); - } + // don't request larger image then necessary to save gl memory, + // but ensure that quality is sufficient + LLRect rect = p.rect; + mMaxHeight = llmax((S32)p.min_height, rect.getHeight()); + mMaxWidth = llmax((S32)p.min_width, rect.getWidth()); if (p.avatar_id.isProvided()) { diff --git a/indra/newview/llchatmsgbox.cpp b/indra/newview/llchatmsgbox.cpp index aa6c9c094c..38f58abba6 100644 --- a/indra/newview/llchatmsgbox.cpp +++ b/indra/newview/llchatmsgbox.cpp @@ -56,9 +56,9 @@ public: return mEditor->getDocumentView()->getRect().getWidth(); } - /*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRect& draw_rect) + /*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect) { - gl_line_2d(draw_rect.mLeft + 5, draw_rect.getCenterY(), draw_rect.mRight - 5, draw_rect.getCenterY(), LLColor4::grey); + gl_line_2d((S32)(draw_rect.mLeft + 5), (S32)draw_rect.getCenterY(), (S32)(draw_rect.mRight - 5), (S32)draw_rect.getCenterY(), LLColor4::grey); return draw_rect.getWidth(); } diff --git a/indra/newview/llcolorswatch.cpp b/indra/newview/llcolorswatch.cpp index a03178adf6..80d810d159 100644 --- a/indra/newview/llcolorswatch.cpp +++ b/indra/newview/llcolorswatch.cpp @@ -292,7 +292,7 @@ void LLColorSwatchCtrl::onColorChanged ( void* data, EColorPickOp pick_op ) subject->mColor.mV[VALPHA] ); // keep current alpha subject->mColor = updatedColor; subject->setControlValue(updatedColor.getValue()); - + pickerp->setRevertOnCancel(TRUE); if (pick_op == COLOR_CANCEL && subject->mOnCancelCallback) { subject->mOnCancelCallback( subject, LLSD()); diff --git a/indra/newview/llexpandabletextbox.cpp b/indra/newview/llexpandabletextbox.cpp index 61b5748201..4dbed114bb 100644 --- a/indra/newview/llexpandabletextbox.cpp +++ b/indra/newview/llexpandabletextbox.cpp @@ -77,7 +77,7 @@ public: return 0; } } - /*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRect& draw_rect) + /*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect) { F32 right_x; mStyle->getFont()->renderUTF8(mExpanderLabel, start, diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index 9ab8685012..00da29ae89 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -1012,6 +1012,7 @@ BOOL LLFavoritesBarCtrl::collectFavoriteItems(LLInventoryModel::item_array_t &it { LLFavoritesOrderStorage::instance().setSortIndex((*i), ++sortField); } + LLFavoritesOrderStorage::instance().mSaveOnExit = true; } return TRUE; @@ -1584,10 +1585,10 @@ void LLFavoritesOrderStorage::destroyClass() { file.close(); LLFile::remove(filename); - if(mSaveOnExit) - { - LLFavoritesOrderStorage::instance().saveFavoritesRecord(true); - } + } + if(mSaveOnExit) + { + LLFavoritesOrderStorage::instance().saveFavoritesRecord(true); } } @@ -1870,6 +1871,16 @@ BOOL LLFavoritesOrderStorage::saveFavoritesRecord(bool pref_changed) } } + for (std::set::iterator it = mMissingSLURLs.begin(); it != mMissingSLURLs.end(); it++) + { + slurls_map_t::iterator slurl_iter = mSLURLs.find(*it); + if (slurl_iter != mSLURLs.end()) + { + pref_changed = true; + break; + } + } + if((items != mPrevFavorites) || name_changed || pref_changed) { std::string filename = getStoredFavoritesFilename(); @@ -1890,6 +1901,7 @@ BOOL LLFavoritesOrderStorage::saveFavoritesRecord(bool pref_changed) LLSD user_llsd; S32 fav_iter = 0; + mMissingSLURLs.clear(); for (LLInventoryModel::item_array_t::iterator it = items.begin(); it != items.end(); it++) { LLSD value; @@ -1907,8 +1919,10 @@ BOOL LLFavoritesOrderStorage::saveFavoritesRecord(bool pref_changed) else { getSLURL((*it)->getAssetUUID()); + value["slurl"] = ""; + user_llsd[fav_iter] = value; mUpdateRequired = true; - return FALSE; + mMissingSLURLs.insert((*it)->getAssetUUID()); } } else @@ -1944,7 +1958,6 @@ BOOL LLFavoritesOrderStorage::saveFavoritesRecord(bool pref_changed) << "' at '" << filename << "' " << LL_ENDL; } } - mPrevFavorites = items; } diff --git a/indra/newview/llfavoritesbar.h b/indra/newview/llfavoritesbar.h index 66ed2aa8ab..d000b16ef2 100644 --- a/indra/newview/llfavoritesbar.h +++ b/indra/newview/llfavoritesbar.h @@ -252,7 +252,7 @@ private: typedef std::map slurls_map_t; slurls_map_t mSLURLs; - + std::set mMissingSLURLs; bool mIsDirty; struct IsNotInFavorites diff --git a/indra/newview/llfloatercolorpicker.cpp b/indra/newview/llfloatercolorpicker.cpp index be6d33ad2f..60b0d019a5 100644 --- a/indra/newview/llfloatercolorpicker.cpp +++ b/indra/newview/llfloatercolorpicker.cpp @@ -175,6 +175,7 @@ void LLFloaterColorPicker::showUI () openFloater(getKey()); setVisible ( TRUE ); setFocus ( TRUE ); + setRevertOnCancel(FALSE); // HACK: if system color picker is required - close the SL one we made and use default system dialog if ( gSavedSettings.getBOOL ( "UseDefaultColorPicker" ) ) @@ -402,7 +403,10 @@ void LLFloaterColorPicker::onClickCancel ( void* data ) if ( self ) { - self->cancelSelection (); + if(self->getRevertOnCancel()) + { + self->cancelSelection (); + } self->closeFloater(); } } @@ -459,8 +463,7 @@ void LLFloaterColorPicker::onImmediateCheck( LLUICtrl* ctrl, void* data) if (self) { gSavedSettings.setBOOL("ApplyColorImmediately", self->mApplyImmediateCheck->get()); - - if (self->mApplyImmediateCheck->get()) + if (self->mApplyImmediateCheck->get() && self->isColorChanged()) { LLColorSwatchCtrl::onColorChanged ( self->getSwatch (), LLColorSwatchCtrl::COLOR_CHANGE ); } @@ -485,6 +488,11 @@ F32 LLFloaterColorPicker::getSwatchTransparency() return getTransparencyType() == TT_ACTIVE ? 1.f : LLFloater::getCurrentTransparency(); } +BOOL LLFloaterColorPicker::isColorChanged() +{ + return ((getOrigR() != getCurR()) || (getOrigG() != getCurG()) || (getOrigB() != getCurB())); +} + ////////////////////////////////////////////////////////////////////////////// // void LLFloaterColorPicker::draw() diff --git a/indra/newview/llfloatercolorpicker.h b/indra/newview/llfloatercolorpicker.h index f602d938e8..31384ef247 100644 --- a/indra/newview/llfloatercolorpicker.h +++ b/indra/newview/llfloatercolorpicker.h @@ -104,6 +104,11 @@ class LLFloaterColorPicker void setMouseDownInSwatch (BOOL mouse_down_in_swatch); BOOL getMouseDownInSwatch () { return mMouseDownInSwatch; } + void setRevertOnCancel (BOOL revertOnCancel) { mRevertOnCancel = revertOnCancel; }; + BOOL getRevertOnCancel () { return mRevertOnCancel; } + + BOOL isColorChanged (); + // called when text entries (RGB/HSL etc.) are changed by user void onTextEntryChanged ( LLUICtrl* ctrl ); @@ -144,6 +149,8 @@ class LLFloaterColorPicker BOOL mMouseDownInHueRegion; BOOL mMouseDownInSwatch; + BOOL mRevertOnCancel; + const S32 mRGBViewerImageLeft; const S32 mRGBViewerImageTop; const S32 mRGBViewerImageWidth; diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 1cba3b6a7b..68a75de401 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -39,6 +39,7 @@ #include "llagent.h" #include "llagentaccess.h" +#include "llappviewer.h" #include "llbutton.h" #include "llcheckboxctrl.h" #include "llcombobox.h" @@ -497,6 +498,30 @@ BOOL LLPanelLandGeneral::postBuild() mBtnBuyLand = getChild("Buy Land..."); mBtnBuyLand->setClickedCallback(onClickBuyLand, (void*)&BUY_PERSONAL_LAND); + + mBtnBuyGroupLand = getChild("Buy For Group..."); + mBtnBuyGroupLand->setClickedCallback(onClickBuyLand, (void*)&BUY_GROUP_LAND); + + + mBtnBuyPass = getChild("Buy Pass..."); + mBtnBuyPass->setClickedCallback(onClickBuyPass, this); + + mBtnReleaseLand = getChild("Abandon Land..."); + mBtnReleaseLand->setClickedCallback(onClickRelease, NULL); + + mBtnReclaimLand = getChild("Reclaim Land..."); + mBtnReclaimLand->setClickedCallback(onClickReclaim, NULL); + + mBtnStartAuction = getChild("Linden Sale..."); + mBtnStartAuction->setClickedCallback(onClickStartAuction, this); + + mBtnScriptLimits = getChild("Scripts..."); + + if(gDisconnected) + { + return TRUE; + } + // note: on region change this will not be re checked, should not matter on Agni as // 99% of the time all regions will return the same caps. In case of an erroneous setting // to enabled the floater will just throw an error when trying to get it's cap @@ -506,7 +531,6 @@ BOOL LLPanelLandGeneral::postBuild() // if (!url.empty()) { - mBtnScriptLimits = getChild("Scripts..."); if(mBtnScriptLimits) { mBtnScriptLimits->setClickedCallback(onClickScriptLimits, this); @@ -514,28 +538,11 @@ BOOL LLPanelLandGeneral::postBuild() } else { - mBtnScriptLimits = getChild("Scripts..."); if(mBtnScriptLimits) { mBtnScriptLimits->setVisible(false); } } - - mBtnBuyGroupLand = getChild("Buy For Group..."); - mBtnBuyGroupLand->setClickedCallback(onClickBuyLand, (void*)&BUY_GROUP_LAND); - - - mBtnBuyPass = getChild("Buy Pass..."); - mBtnBuyPass->setClickedCallback(onClickBuyPass, this); - - mBtnReleaseLand = getChild("Abandon Land..."); - mBtnReleaseLand->setClickedCallback(onClickRelease, NULL); - - mBtnReclaimLand = getChild("Reclaim Land..."); - mBtnReclaimLand->setClickedCallback(onClickReclaim, NULL); - - mBtnStartAuction = getChild("Linden Sale..."); - mBtnStartAuction->setClickedCallback(onClickStartAuction, this); return TRUE; } @@ -549,9 +556,61 @@ LLPanelLandGeneral::~LLPanelLandGeneral() // public void LLPanelLandGeneral::refresh() { - mBtnStartAuction->setVisible(gAgent.isGodlike()); + mEditName->setEnabled(FALSE); + mEditName->setText(LLStringUtil::null); - LLParcel *parcel = mParcel->getParcel(); + mEditUUID->setText(LLStringUtil::null); + + mEditDesc->setEnabled(FALSE); + mEditDesc->setText(getString("no_selection_text")); + + mTextSalePending->setText(LLStringUtil::null); + mTextSalePending->setEnabled(FALSE); + + mBtnDeedToGroup->setEnabled(FALSE); + mBtnSetGroup->setEnabled(FALSE); + mBtnStartAuction->setEnabled(FALSE); + + mCheckDeedToGroup ->set(FALSE); + mCheckDeedToGroup ->setEnabled(FALSE); + mCheckContributeWithDeed->set(FALSE); + mCheckContributeWithDeed->setEnabled(FALSE); + + mTextOwner->setText(LLStringUtil::null); + mContentRating->setText(LLStringUtil::null); + mLandType->setText(LLStringUtil::null); + // Doesn't exists as of 2014-04-14 + //mBtnProfile->setLabel(getString("profile_text")); + //mBtnProfile->setEnabled(FALSE); + + mTextClaimDate->setText(LLStringUtil::null); + mTextGroup->setText(LLStringUtil::null); + mTextPrice->setText(LLStringUtil::null); + + mSaleInfoForSale1->setVisible(FALSE); + mSaleInfoForSale2->setVisible(FALSE); + mSaleInfoForSaleObjects->setVisible(FALSE); + mSaleInfoForSaleNoObjects->setVisible(FALSE); + mSaleInfoNotForSale->setVisible(FALSE); + mBtnSellLand->setVisible(FALSE); + mBtnStopSellLand->setVisible(FALSE); + + mTextPriceLabel->setText(LLStringUtil::null); + mTextDwell->setText(LLStringUtil::null); + + mBtnBuyLand->setEnabled(FALSE); + mBtnScriptLimits->setEnabled(FALSE); + mBtnBuyGroupLand->setEnabled(FALSE); + mBtnReleaseLand->setEnabled(FALSE); + mBtnReclaimLand->setEnabled(FALSE); + mBtnBuyPass->setEnabled(FALSE); + + if(gDisconnected) + { + return; + } + + mBtnStartAuction->setVisible(gAgent.isGodlike()); bool region_owner = false; LLViewerRegion* regionp = LLViewerParcelMgr::getInstance()->getSelectionRegion(); if(regionp && (regionp->getOwner() == gAgent.getID())) @@ -565,59 +624,8 @@ void LLPanelLandGeneral::refresh() mBtnReleaseLand->setVisible(TRUE); mBtnReclaimLand->setVisible(FALSE); } - if (!parcel) - { - // nothing selected, disable panel - mEditName->setEnabled(FALSE); - mEditName->setText(LLStringUtil::null); - - mEditUUID->setText(LLStringUtil::null); - - mEditDesc->setEnabled(FALSE); - mEditDesc->setText(getString("no_selection_text")); - - mTextSalePending->setText(LLStringUtil::null); - mTextSalePending->setEnabled(FALSE); - - mBtnDeedToGroup->setEnabled(FALSE); - mBtnSetGroup->setEnabled(FALSE); - mBtnStartAuction->setEnabled(FALSE); - - mCheckDeedToGroup ->set(FALSE); - mCheckDeedToGroup ->setEnabled(FALSE); - mCheckContributeWithDeed->set(FALSE); - mCheckContributeWithDeed->setEnabled(FALSE); - - mTextOwner->setText(LLStringUtil::null); - mContentRating->setText(LLStringUtil::null); - mLandType->setText(LLStringUtil::null); - // Doesn't exists as of 2014-04-14 - //mBtnProfile->setLabel(getString("profile_text")); - //mBtnProfile->setEnabled(FALSE); - - mTextClaimDate->setText(LLStringUtil::null); - mTextGroup->setText(LLStringUtil::null); - mTextPrice->setText(LLStringUtil::null); - - mSaleInfoForSale1->setVisible(FALSE); - mSaleInfoForSale2->setVisible(FALSE); - mSaleInfoForSaleObjects->setVisible(FALSE); - mSaleInfoForSaleNoObjects->setVisible(FALSE); - mSaleInfoNotForSale->setVisible(FALSE); - mBtnSellLand->setVisible(FALSE); - mBtnStopSellLand->setVisible(FALSE); - - mTextPriceLabel->setText(LLStringUtil::null); - mTextDwell->setText(LLStringUtil::null); - - mBtnBuyLand->setEnabled(FALSE); - mBtnScriptLimits->setEnabled(FALSE); - mBtnBuyGroupLand->setEnabled(FALSE); - mBtnReleaseLand->setEnabled(FALSE); - mBtnReclaimLand->setEnabled(FALSE); - mBtnBuyPass->setEnabled(FALSE); - } - else + LLParcel *parcel = mParcel->getParcel(); + if (parcel) { // something selected, hooray! BOOL is_leased = (LLParcel::OS_LEASED == parcel->getOwnershipStatus()); @@ -1342,7 +1350,7 @@ void LLPanelLandObjects::refresh() mOwnerList->deleteAllItems(); mOwnerList->setEnabled(FALSE); - if (!parcel) + if (!parcel || gDisconnected) { mSWTotalObjects->setTextArg("[COUNT]", llformat("%d", 0)); mSWTotalObjects->setTextArg("[TOTAL]", llformat("%d", 0)); @@ -2124,7 +2132,7 @@ void LLPanelLandOptions::refresh() refreshSearch(); LLParcel *parcel = mParcel->getParcel(); - if (!parcel) + if (!parcel || gDisconnected) { mCheckEditObjects ->set(FALSE); mCheckEditObjects ->setEnabled(FALSE); @@ -2365,7 +2373,7 @@ void LLPanelLandOptions::draw() void LLPanelLandOptions::refreshSearch() { LLParcel *parcel = mParcel->getParcel(); - if (!parcel) + if (!parcel || gDisconnected) { mCheckShowDirectory->set(FALSE); mCheckShowDirectory->setEnabled(FALSE); @@ -2651,7 +2659,7 @@ void LLPanelLandAccess::refresh() LLParcel *parcel = mParcel->getParcel(); // Display options - if (parcel) + if (parcel && !gDisconnected) { BOOL use_access_list = parcel->getParcelFlag(PF_USE_ACCESS_LIST); BOOL use_group = parcel->getParcelFlag(PF_USE_ACCESS_GROUP); @@ -2845,7 +2853,7 @@ void LLPanelLandAccess::refresh_ui() getChildView("remove_banned")->setEnabled(FALSE); LLParcel *parcel = mParcel->getParcel(); - if (parcel) + if (parcel && !gDisconnected) { BOOL can_manage_allowed = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_MANAGE_ALLOWED); BOOL can_manage_banned = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_MANAGE_BANNED); @@ -3204,7 +3212,7 @@ BOOL LLPanelLandCovenant::postBuild() void LLPanelLandCovenant::refresh() { LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion(); - if(!region) return; + if(!region || gDisconnected) return; LLTextBox* region_name = getChild("region_name_text"); if (region_name) @@ -3429,7 +3437,7 @@ void LLPanelLandExperiences::refreshPanel(LLPanelExperienceListEditor* panel, U3 { return; } - if (parcel == NULL) + if (!parcel || gDisconnected) { // disable the panel panel->setEnabled(FALSE); diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index c39bc8aaa3..e463faa63f 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -667,7 +667,7 @@ void LLFloaterModelPreview::onAutoFillCommit(LLUICtrl* ctrl, void* userdata) { LLFloaterModelPreview* fp = (LLFloaterModelPreview*) userdata; - fp->mModelPreview->genLODs(); + fp->mModelPreview->queryLODs(); } void LLFloaterModelPreview::onLODParamCommit(S32 lod, bool enforce_tri_limit) @@ -695,7 +695,12 @@ void LLFloaterModelPreview::onLODParamCommit(S32 lod, bool enforce_tri_limit) //----------------------------------------------------------------------------- void LLFloaterModelPreview::draw() { - LLFloater::draw(); + LLFloater::draw(); + + if (!mModelPreview) + { + return; + } mModelPreview->update(); @@ -725,7 +730,7 @@ void LLFloaterModelPreview::draw() childSetTextArg("prim_cost", "[PRIM_COST]", llformat("%d", mModelPreview->mResourceCost)); childSetTextArg("description_label", "[TEXTURES]", llformat("%d", mModelPreview->mTextureSet.size())); - if (mModelPreview) + if (mModelPreview->lodsReady()) { gGL.color3f(1.f, 1.f, 1.f); @@ -1235,6 +1240,7 @@ void LLFloaterModelPreview::onMouseCaptureLostModelPreview(LLMouseHandler* handl LLModelPreview::LLModelPreview(S32 width, S32 height, LLFloater* fmp) : LLViewerDynamicTexture(width, height, 3, ORDER_MIDDLE, FALSE), LLMutex(NULL) +, mLodsQuery() , mPelvisZOffset( 0.0f ) , mLegacyRigValid( false ) , mRigValidJointUpload( false ) @@ -1611,9 +1617,18 @@ void LLModelPreview::rebuildUploadData() } instance.mLOD[i] = lod_model; } - else if (importerDebug) + else { - LL_INFOS() << "List of models does not include " << instance.mLabel << LL_ENDL; + if (i < LLModel::LOD_HIGH && !lodsReady()) + { + // assign a placeholder from previous LOD until lod generation is complete. + // Note: we might need to assign it regardless of conditions like named search does, to prevent crashes. + instance.mLOD[i] = instance.mLOD[i + 1]; + } + if (importerDebug) + { + LL_INFOS() << "List of models does not include " << instance.mLabel << LL_ENDL; + } } } @@ -1859,7 +1874,8 @@ void LLModelPreview::loadModel(std::string filename, S32 lod, bool force_disable this, mJointTransformMap, mJointsFromNode, - gSavedSettings.getU32("ImporterModelLimit")); + gSavedSettings.getU32("ImporterModelLimit"), + gSavedSettings.getBOOL("ImporterPreprocessDAE")); if (force_disable_slm) { @@ -2680,112 +2696,6 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim shader->bind(); } } -void LLModelPreview::genModelBBox() -{ - LLVector3 min, max; - min = this->mModelLoader->mExtents[0]; - max = this->mModelLoader->mExtents[1]; - std::vector v_list; - v_list.resize(4); - std::map > face_list; - - // Face 0 - v_list[0] = LLVector3(min.mV[VX], max.mV[VY], max.mV[VZ]); - v_list[1] = LLVector3(min.mV[VX], min.mV[VY], max.mV[VZ]); - v_list[2] = LLVector3(max.mV[VX], min.mV[VY], max.mV[VZ]); - v_list[3] = LLVector3(max.mV[VX], max.mV[VY], max.mV[VZ]); - face_list.insert(std::pair >(0, v_list)); - - // Face 1 - v_list[0] = LLVector3(max.mV[VX], min.mV[VY], max.mV[VZ]); - v_list[1] = LLVector3(max.mV[VX], min.mV[VY], min.mV[VZ]); - v_list[2] = LLVector3(max.mV[VX], max.mV[VY], min.mV[VZ]); - v_list[3] = LLVector3(max.mV[VX], max.mV[VY], max.mV[VZ]); - face_list.insert(std::pair >(1, v_list)); - - // Face 2 - v_list[0] = LLVector3(min.mV[VX], max.mV[VY], min.mV[VZ]); - v_list[1] = LLVector3(min.mV[VX], max.mV[VY], max.mV[VZ]); - v_list[2] = LLVector3(max.mV[VX], max.mV[VY], max.mV[VZ]); - v_list[3] = LLVector3(max.mV[VX], max.mV[VY], min.mV[VZ]); - face_list.insert(std::pair >(2, v_list)); - - // Face 3 - v_list[0] = LLVector3(min.mV[VX], max.mV[VY], max.mV[VZ]); - v_list[1] = LLVector3(min.mV[VX], max.mV[VY], min.mV[VZ]); - v_list[2] = LLVector3(min.mV[VX], min.mV[VY], min.mV[VZ]); - v_list[3] = LLVector3(min.mV[VX], min.mV[VY], max.mV[VZ]); - face_list.insert(std::pair >(3, v_list)); - - // Face 4 - v_list[0] = LLVector3(min.mV[VX], min.mV[VY], max.mV[VZ]); - v_list[1] = LLVector3(min.mV[VX], min.mV[VY], min.mV[VZ]); - v_list[2] = LLVector3(max.mV[VX], min.mV[VY], min.mV[VZ]); - v_list[3] = LLVector3(max.mV[VX], min.mV[VY], max.mV[VZ]); - face_list.insert(std::pair >(4, v_list)); - - // Face 5 - v_list[0] = LLVector3(min.mV[VX], min.mV[VY], min.mV[VZ]); - v_list[1] = LLVector3(min.mV[VX], max.mV[VY], min.mV[VZ]); - v_list[2] = LLVector3(max.mV[VX], max.mV[VY], min.mV[VZ]); - v_list[3] = LLVector3(max.mV[VX], min.mV[VY], min.mV[VZ]); - face_list.insert(std::pair >(5, v_list)); - - U16 Idx[] = { 0, 1, 2, 3, 0, 2, }; - - U32 type_mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD0; - LLPointer buff = new LLVertexBuffer(type_mask, 0); - buff->allocateBuffer(4, 6, true); - - LLStrider pos; - LLStrider idx; - LLStrider norm; - LLStrider tc; - - buff->getVertexStrider(pos); - buff->getIndexStrider(idx); - - buff->getNormalStrider(norm); - buff->getTexCoord0Strider(tc); - - for (U32 i = 0; i < 6; ++i) - { - idx[i] = Idx[i]; - } - - LLVolumeParams volume_params; - volume_params.setType(LL_PCODE_PROFILE_SQUARE, LL_PCODE_PATH_LINE); - LLModel* mdl = new LLModel(volume_params, 0.f); - mdl->mLabel = "BBOX"; // please adopt name from high LOD (mBaseModel) or from original model otherwise it breaks search mechanics which is name based - - mdl->setNumVolumeFaces(6); - for (U8 i = 0; i < 6; ++i) - { - for (U8 j = 0; j < 4; ++j) - { - pos[j] = face_list[i][j]; - } - - mdl->setVolumeFaceData(i, pos, norm, tc, idx, buff->getNumVerts(), buff->getNumIndices()); - } - - if (validate_model(mdl)) - { - LLMatrix4 mat; - std::map materials; - std::vector instance_list; - instance_list.push_back(LLModelInstance(mdl, mdl->mLabel, mat, materials)); - - for (S32 i = LLModel::LOD_HIGH - 1; i >= 0; i--) - { - mModel[i].clear(); - mModel[i].push_back(mdl); - - mScene[i].clear(); - mScene[i].insert(std::pair >(mat, instance_list)); - } - } -} void LLModelPreview::updateStatusMessages() { @@ -3537,14 +3447,25 @@ void LLModelPreview::genBuffers(S32 lod, bool include_skin_weights) void LLModelPreview::update() { if (mGenLOD) - { - mGenLOD = false; - genLODs(); - refresh(); - updateStatusMessages(); - } + { + bool subscribe_for_generation = mLodsQuery.empty(); + mGenLOD = false; + mDirty = true; + mLodsQuery.clear(); - if (mDirty) + for (S32 lod = LLModel::LOD_HIGH; lod >= 0; --lod) + { + // adding all lods into query for generation + mLodsQuery.push_back(lod); + } + + if (subscribe_for_generation) + { + doOnIdleRepeating(lodQueryCallback); + } + } + + if (mDirty && mLodsQuery.empty()) { mDirty = false; mResourceCost = calcResourceCost(); @@ -4494,6 +4415,29 @@ void LLModelPreview::textureLoadedCallback( BOOL success, LLViewerFetchedTexture } } +// static +bool LLModelPreview::lodQueryCallback() +{ + // not the best solution, but model preview belongs to floater + // so it is an easy way to check that preview still exists. + LLFloaterModelPreview* fmp = LLFloaterModelPreview::sInstance; + if (fmp && fmp->mModelPreview) + { + LLModelPreview* preview = fmp->mModelPreview; + if (preview->mLodsQuery.size() > 0) + { + S32 lod = preview->mLodsQuery.back(); + preview->mLodsQuery.pop_back(); + preview->genLODs(lod); + + // return false to continue cycle + return false; + } + } + // nothing to process + return true; +} + void LLModelPreview::onLODParamCommit(S32 lod, bool enforce_tri_limit) { if (!mLODFrozen) diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 1a0e7be762..cbb53b0c93 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -264,8 +264,9 @@ public: void clearModel(S32 lod); void loadModel(std::string filename, S32 lod, bool force_disable_slm = false); void loadModelCallback(S32 lod); + bool lodsReady() { return !mGenLOD && mLodsQuery.empty(); } + void queryLODs() { mGenLOD = true; }; void genLODs(S32 which_lod = -1, U32 decimation = 3, bool enforce_tri_limit = false); - void genModelBBox(); // Generate just a model BBox if we can't generate proper LOD void generateNormals(); void restoreNormals(); U32 calcResourceCost(); @@ -293,6 +294,7 @@ public: void setLegacyRigValid( bool rigValid ) { mLegacyRigValid = rigValid; } static void textureLoadedCallback( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* src_aux, S32 discard_level, BOOL final, void* userdata ); + static bool lodQueryCallback(); boost::signals2::connection setDetailsCallback( const details_signal_t::slot_type& cb ){ return mDetailsSignal.connect(cb); } boost::signals2::connection setModelLoadedCallback( const model_loaded_signal_t::slot_type& cb ){ return mModelLoadedSignal.connect(cb); } @@ -306,6 +308,7 @@ public: LLVector3 getTranslationForJointOffset( std::string joint ); static bool sIgnoreLoadedCallback; + std::vector mLodsQuery; protected: diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 4c8d7d99f4..21cc938c8f 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -703,6 +703,10 @@ BOOL LLFloaterPreference::postBuild() LLLogChat::setSaveHistorySignal(boost::bind(&LLFloaterPreference::onLogChatHistorySaved, this)); + LLSliderCtrl* fov_slider = getChild("camera_fov"); + fov_slider->setMinValue(LLViewerCamera::getInstance()->getMinView()); + fov_slider->setMaxValue(LLViewerCamera::getInstance()->getMaxView()); + // [SL:KB] - Patch: Viewer-CrashReporting | Checked: 2011-06-11 (Catznip-2.6.c) | Added: Catznip-2.6.0c #ifndef LL_SEND_CRASH_REPORTS // Hide the crash report tab if crash reporting isn't enabled diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index b15e052f97..e85c2a44ef 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -250,10 +250,12 @@ BOOL LLFloaterRegionInfo::postBuild() panel->buildFromFile("panel_region_debug.xml"); mTab->addTabPanel(panel); - // Crash fix - //if(!gAgent.getRegion()->getCapability("RegionExperiences").empty()) - if (gAgent.getRegion() && !gAgent.getRegion()->getCapability("RegionExperiences").empty()) - // + if(gDisconnected) + { + return TRUE; + } + + if(!gAgent.getRegion()->getCapability("RegionExperiences").empty()) { panel = new LLPanelRegionExperiences; mInfoPanels.push_back(panel); @@ -276,6 +278,11 @@ LLFloaterRegionInfo::~LLFloaterRegionInfo() void LLFloaterRegionInfo::onOpen(const LLSD& key) { + if(gDisconnected) + { + disableTabCtrls(); + return; + } refreshFromRegion(gAgent.getRegion()); requestRegionInfo(); requestMeshRezInfo(); @@ -516,7 +523,16 @@ LLPanelRegionExperiences* LLFloaterRegionInfo::getPanelExperiences() return (LLPanelRegionExperiences*)tab->getChild("Experiences"); } +void LLFloaterRegionInfo::disableTabCtrls() +{ + LLTabContainer* tab = getChild("region_panels"); + tab->getChild("General")->setCtrlsEnabled(FALSE); + tab->getChild("Debug")->setCtrlsEnabled(FALSE); + tab->getChild("Terrain")->setCtrlsEnabled(FALSE); + tab->getChild("panel_env_info")->setCtrlsEnabled(FALSE); + tab->getChild("Estate")->setCtrlsEnabled(FALSE); +} // Aurora Sim - Region Settings Console // static @@ -1366,6 +1382,22 @@ BOOL LLPanelRegionTerrainInfo::validateTextureSizes() return TRUE; } +BOOL LLPanelRegionTerrainInfo::validateTextureHeights() +{ + for (S32 i = 0; i < CORNER_COUNT; ++i) + { + std::string low = llformat("height_start_spin_%d", i); + std::string high = llformat("height_range_spin_%d", i); + + if (getChild(low)->getValue().asReal() > getChild(high)->getValue().asReal()) + { + return FALSE; + } + } + + return TRUE; +} + ///////////////////////////////////////////////////////////////////////////// // LLPanelRegionTerrainInfo ///////////////////////////////////////////////////////////////////////////// @@ -1398,6 +1430,9 @@ BOOL LLPanelRegionTerrainInfo::postBuild() childSetAction("upload_raw_btn", onClickUploadRaw, this); childSetAction("bake_terrain_btn", onClickBakeTerrain, this); + mAskedTextureHeights = false; + mConfirmedTextureHeights = false; + return LLPanelRegionInfo::postBuild(); } @@ -1489,6 +1524,21 @@ BOOL LLPanelRegionTerrainInfo::sendUpdate() #endif // OPENSIM // Aurora Sim - Region Settings Console + // Check if terrain Elevation Ranges are correct + if (gSavedSettings.getBOOL("RegionCheckTextureHeights") && !validateTextureHeights()) + { + if (!mAskedTextureHeights) + { + LLNotificationsUtil::add("ConfirmTextureHeights", LLSD(), LLSD(), boost::bind(&LLPanelRegionTerrainInfo::callbackTextureHeights, this, _1, _2)); + mAskedTextureHeights = true; + return FALSE; + } + else if (!mConfirmedTextureHeights) + { + return FALSE; + } + } + LLTextureCtrl* texture_ctrl; std::string id_str; LLMessageSystem* msg = gMessageSystem; @@ -1529,6 +1579,29 @@ BOOL LLPanelRegionTerrainInfo::sendUpdate() return TRUE; } +bool LLPanelRegionTerrainInfo::callbackTextureHeights(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (option == 0) // ok + { + mConfirmedTextureHeights = true; + } + else if (option == 1) // cancel + { + mConfirmedTextureHeights = false; + } + else if (option == 2) // don't ask + { + gSavedSettings.setBOOL("RegionCheckTextureHeights", FALSE); + mConfirmedTextureHeights = true; + } + + onBtnSet(); + + mAskedTextureHeights = false; + return false; +} + // static void LLPanelRegionTerrainInfo::onClickDownloadRaw(void* data) { @@ -2240,6 +2313,8 @@ void LLPanelEstateInfo::updateControls(LLViewerRegion* region) BOOL manager = (region && region->isEstateManager()); setCtrlsEnabled(god || owner || manager); + getChildView("apply_btn")->setEnabled(FALSE); + BOOL has_allowed_avatar = getChild("allowed_avatar_name_list")->getFirstSelected() ? TRUE : FALSE; BOOL has_allowed_group = getChild("allowed_group_name_list")->getFirstSelected() ? TRUE : FALSE; BOOL has_banned_agent = getChild("banned_avatar_name_list")->getFirstSelected() ? TRUE : FALSE; @@ -3261,6 +3336,11 @@ bool LLPanelEnvironmentInfo::refreshFromRegion(LLViewerRegion* region) void LLPanelEnvironmentInfo::refresh() { + if(gDisconnected) + { + return; + } + populateWaterPresetsList(); populateSkyPresetsList(); populateDayCyclesList(); diff --git a/indra/newview/llfloaterregioninfo.h b/indra/newview/llfloaterregioninfo.h index 8552e90e96..c5de465fc6 100644 --- a/indra/newview/llfloaterregioninfo.h +++ b/indra/newview/llfloaterregioninfo.h @@ -116,6 +116,7 @@ private: protected: void onTabSelected(const LLSD& param); + void disableTabCtrls(); void refreshFromRegion(LLViewerRegion* region); // member data @@ -263,6 +264,7 @@ public: void setEnvControls(bool available); // Whether environment settings are available for this region BOOL validateTextureSizes(); + BOOL validateTextureHeights(); //static void onChangeAnything(LLUICtrl* ctrl, void* userData); // callback for any change, to enable commit button @@ -272,6 +274,11 @@ public: static void onClickUploadRaw(void*); static void onClickBakeTerrain(void*); bool callbackBakeTerrain(const LLSD& notification, const LLSD& response); + bool callbackTextureHeights(const LLSD& notification, const LLSD& response); + +private: + bool mConfirmedTextureHeights; + bool mAskedTextureHeights; }; ///////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llfloatersidepanelcontainer.cpp b/indra/newview/llfloatersidepanelcontainer.cpp index e1a85a75a0..43f8665eb5 100644 --- a/indra/newview/llfloatersidepanelcontainer.cpp +++ b/indra/newview/llfloatersidepanelcontainer.cpp @@ -73,7 +73,11 @@ void LLFloaterSidePanelContainer::closeFloater(bool app_quitting) LLSidepanelAppearance* panel_appearance = dynamic_cast(getPanel("appearance")); if ( panel_appearance ) { - panel_appearance->getWearable()->onClose(); + LLPanelEditWearable *edit_wearable_ptr = panel_appearance->getWearable(); + if (edit_wearable_ptr) + { + edit_wearable_ptr->onClose(); + } panel_appearance->showOutfitsInventoryPanel(); } } diff --git a/indra/newview/llfloatertopobjects.cpp b/indra/newview/llfloatertopobjects.cpp index 41a7636341..4a9039c8d4 100644 --- a/indra/newview/llfloatertopobjects.cpp +++ b/indra/newview/llfloatertopobjects.cpp @@ -197,10 +197,15 @@ void LLFloaterTopObjects::handleReply(LLMessageSystem *msg, void** data) msg->getU32("DataExtended", "TimeStamp", time_stamp, block); msg->getF32("DataExtended", "MonoScore", mono_score, block); msg->getS32("DataExtended", "PublicURLs", public_urls, block); - if (msg->getSize("DataExtended", "ParcelName") > 0) + + std::string parcel_name; + F32 script_size = 0.f; + msg->getString("DataExtended", "ParcelName", parcel_name, block); + msg->getF32("DataExtended", "Size", script_size, block); + if (parcel_name.size() > 0 || script_size > 0) { - msg->getString("DataExtended", "ParcelName", parcel_buf, block); - msg->getF32("DataExtended", "Size", script_memory, block); + parcel_buf = parcel_name; + script_memory = script_size; } } diff --git a/indra/newview/llfriendcard.cpp b/indra/newview/llfriendcard.cpp index fac821371e..201298c2d4 100644 --- a/indra/newview/llfriendcard.cpp +++ b/indra/newview/llfriendcard.cpp @@ -162,6 +162,7 @@ void LLInitialFriendCardsFetch::done() // LLFriendCardsManager Constructor / Destructor LLFriendCardsManager::LLFriendCardsManager() +: mState(INIT) { LLAvatarTracker::instance().addObserver(this); } @@ -423,6 +424,7 @@ void LLFriendCardsManager::ensureFriendsFolderExists() LLUUID friends_folder_ID = findFriendFolderUUIDImpl(); if (friends_folder_ID.notNull()) { + mState = LOADING_FRIENDS_FOLDER; fetchAndCheckFolderDescendents(friends_folder_ID, boost::bind(&LLFriendCardsManager::ensureFriendsAllFolderExists, this)); } @@ -452,6 +454,7 @@ void LLFriendCardsManager::ensureFriendsAllFolderExists() LLUUID friends_all_folder_ID = findFriendAllSubfolderUUIDImpl(); if (friends_all_folder_ID.notNull()) { + mState = LOADING_ALL_FOLDER; fetchAndCheckFolderDescendents(friends_all_folder_ID, boost::bind(&LLFriendCardsManager::syncFriendsFolder, this)); } @@ -506,6 +509,9 @@ void LLFriendCardsManager::syncFriendsFolder() NULL); } + // All folders created and updated. + mState = MANAGER_READY; + // 2. Add missing Friend Cards for friends LLAvatarTracker::buddy_map_t::const_iterator buddy_it = all_buddies.begin(); LL_INFOS() << "try to build friends, count: " << all_buddies.size() << LL_ENDL; @@ -540,6 +546,12 @@ void LLFriendCardsManager::addFriendCardToInventory(const LLUUID& avatarID) << ", id: " << avatarID << LL_ENDL; + if (shouldBeAdded && !isManagerReady()) + { + shouldBeAdded = false; + LL_DEBUGS() << "Calling cards manager not ready, state: " << getManagerState() << LL_ENDL; + } + if (shouldBeAdded && findFriendCardInventoryUUIDImpl(avatarID).notNull()) { shouldBeAdded = false; @@ -583,13 +595,30 @@ void LLFriendCardsManager::onFriendListUpdate(U32 changed_mask) switch(changed_mask) { case LLFriendObserver::ADD: { - const std::set& changed_items = at.getChangedIDs(); - std::set::const_iterator id_it = changed_items.begin(); - std::set::const_iterator id_end = changed_items.end(); - for (;id_it != id_end; ++id_it) - { - LLFriendCardsManager::instance().addFriendCardToInventory(*id_it); - } + LLFriendCardsManager& cards_manager = LLFriendCardsManager::instance(); + if (cards_manager.isManagerReady()) + { + // Try to add cards into inventory. + // If cards already exist they won't be created. + const std::set& changed_items = at.getChangedIDs(); + std::set::const_iterator id_it = changed_items.begin(); + std::set::const_iterator id_end = changed_items.end(); + for (; id_it != id_end; ++id_it) + { + cards_manager.addFriendCardToInventory(*id_it); + } + } + else + { + // User either removed calling cards' folders and manager is loading them + // or update came too early, before viewer had chance to load all folders. + // Either way don't process 'add' operation - manager will recreate all + // cards after fetching folders. + LL_INFOS_ONCE() << "Calling cards manager not ready, state: " + << cards_manager.getManagerState() + << ", postponing update." + << LL_ENDL; + } } break; case LLFriendObserver::REMOVE: diff --git a/indra/newview/llfriendcard.h b/indra/newview/llfriendcard.h index 164360a221..d54232df82 100644 --- a/indra/newview/llfriendcard.h +++ b/indra/newview/llfriendcard.h @@ -45,6 +45,14 @@ class LLFriendCardsManager public: typedef std::map folderid_buddies_map_t; + enum EManagerState + { + INIT = 1, + LOADING_FRIENDS_FOLDER, + LOADING_ALL_FOLDER, + MANAGER_READY + }; + // LLFriendObserver implementation void changed(U32 mask) { @@ -71,7 +79,14 @@ public: /** * Checks is the specified category is a Friend folder or any its subfolder */ - bool isAnyFriendCategory(const LLUUID& catID) const; + bool isAnyFriendCategory(const LLUUID& catID) const; + + /** + * Indicates that all calling card related folders are created or loaded + */ + bool isManagerReady() const { return mState == MANAGER_READY; } + + EManagerState getManagerState() const { return mState; } /** * Checks whether "Friends" and "Friends/All" folders exist in "Calling Cards" category @@ -149,6 +164,8 @@ private: typedef std::set avatar_uuid_set_t; avatar_uuid_set_t mBuddyIDSet; + EManagerState mState; + }; #endif // LL_LLFRIENDCARD_H diff --git a/indra/newview/llgiveinventory.cpp b/indra/newview/llgiveinventory.cpp index 7a8faa5201..d8b5e81ca1 100644 --- a/indra/newview/llgiveinventory.cpp +++ b/indra/newview/llgiveinventory.cpp @@ -145,8 +145,10 @@ bool LLGiveInventory::isInventoryGiveAcceptable(const LLInventoryItem* item) BOOL copyable = false; if (item->getPermissions().allowCopyBy(gAgentID)) copyable = true; - if (!copyable || get_is_item_worn(item->getUUID())) + if (!copyable && get_is_item_worn(item->getUUID())) { + // worn no-copy items can't be transfered, + // but it is valid to transfer a copy of a worn item acceptable = false; } } diff --git a/indra/newview/llgroupiconctrl.cpp b/indra/newview/llgroupiconctrl.cpp index 6abf9ea637..1974a073dd 100644 --- a/indra/newview/llgroupiconctrl.cpp +++ b/indra/newview/llgroupiconctrl.cpp @@ -37,7 +37,10 @@ LLGroupIconCtrl::Params::Params() : group_id("group_id"), draw_tooltip("draw_tooltip", true), default_icon_name("default_icon_name") -{} +{ + changeDefault(min_width, 32); + changeDefault(min_height, 32); +} LLGroupIconCtrl::LLGroupIconCtrl(const LLGroupIconCtrl::Params& p) @@ -48,6 +51,12 @@ LLGroupIconCtrl::LLGroupIconCtrl(const LLGroupIconCtrl::Params& p) { mPriority = LLViewerFetchedTexture::BOOST_ICON; + // don't request larger image then necessary to save gl memory, + // but ensure that quality is sufficient + LLRect rect = p.rect; + mMaxHeight = llmax((S32)p.min_height, rect.getHeight()); + mMaxWidth = llmax((S32)p.min_width, rect.getWidth()); + if (p.group_id.isProvided()) { LLSD value(p.group_id); diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index a988649314..dcf7dca051 100644 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -1068,6 +1068,11 @@ void LLGroupMgr::processGroupMembersReply(LLMessageSystem* msg, void** data) void LLGroupMgr::processGroupPropertiesReply(LLMessageSystem* msg, void** data) { LL_DEBUGS() << "LLGroupMgr::processGroupPropertiesReply" << LL_ENDL; + if (!msg) + { + LL_ERRS() << "Can't access the messaging system" << LL_ENDL; + return; + } LLUUID agent_id; msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id ); if (gAgent.getID() != agent_id) diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp index ff6d85581b..8f325043e3 100644 --- a/indra/newview/llhudtext.cpp +++ b/indra/newview/llhudtext.cpp @@ -55,6 +55,7 @@ const F32 VERTICAL_PADDING = 12.f; const F32 BUFFER_SIZE = 2.f; const F32 HUD_TEXT_MAX_WIDTH = 190.f; const F32 HUD_TEXT_MAX_WIDTH_NO_BUBBLE = 1000.f; +const F32 MAX_DRAW_DISTANCE = 64.f; std::set > LLHUDText::sTextObjects; std::vector > LLHUDText::sVisibleTextObjects; @@ -412,7 +413,7 @@ void LLHUDText::updateVisibility() mVisible = FALSE; return; } - + if (vec_from_camera * LLViewerCamera::getInstance()->getAtAxis() <= LLViewerCamera::getInstance()->getNear() + 0.1f + mSourceObject->getVObjRadius()) { mPositionAgent = LLViewerCamera::getInstance()->getOrigin() + vec_from_camera * ((LLViewerCamera::getInstance()->getNear() + 0.1f) / (vec_from_camera * LLViewerCamera::getInstance()->getAtAxis())); @@ -430,6 +431,15 @@ void LLHUDText::updateVisibility() return; } + LLVector3 pos_agent_center = gAgent.getPosAgentFromGlobal(mPositionGlobal) - dir_from_camera; + F32 last_distance_center = (pos_agent_center - LLViewerCamera::getInstance()->getOrigin()).magVec(); + if(last_distance_center > MAX_DRAW_DISTANCE) + { + mVisible = FALSE; + return; + } + + LLVector3 x_pixel_vec; LLVector3 y_pixel_vec; diff --git a/indra/newview/llinspectgroup.cpp b/indra/newview/llinspectgroup.cpp index 76617b55bf..8e91af321e 100644 --- a/indra/newview/llinspectgroup.cpp +++ b/indra/newview/llinspectgroup.cpp @@ -42,16 +42,13 @@ #include "lltrans.h" #include "lluictrl.h" -class LLFetchGroupData; - - ////////////////////////////////////////////////////////////////////////////// // LLInspectGroup ////////////////////////////////////////////////////////////////////////////// /// Group Inspector, a small information window used when clicking /// on group names in the 2D UI -class LLInspectGroup : public LLInspect +class LLInspectGroup : public LLInspect, public LLGroupMgrObserver { friend class LLFloaterReg; @@ -65,12 +62,16 @@ public: // (for example, inspector about same group but in different position) /*virtual*/ void onOpen(const LLSD& group_id); + void setGroupID(const LLUUID& group_id); + // When closing they should close their gear menu /*virtual*/ void onClose(bool app_quitting); // Update view based on information from group manager void processGroupData(); - + + virtual void changed(LLGroupChange gc); + // Make network requests for all the data to display in this view. // Used on construction and if avatar id changes. void requestUpdate(); @@ -88,53 +89,12 @@ public: private: LLUUID mGroupID; - // an in-flight network request for group properties - // is represented by this object - LLFetchGroupData* mPropertiesRequest; }; -////////////////////////////////////////////////////////////////////////////// -// LLFetchGroupData -////////////////////////////////////////////////////////////////////////////// - -// This object represents a pending request for avatar properties information -class LLFetchGroupData : public LLGroupMgrObserver -{ -public: - // If the inspector closes it will delete the pending request object, so the - // inspector pointer will be valid for the lifetime of this object - LLFetchGroupData(const LLUUID& group_id, LLInspectGroup* inspector) - : LLGroupMgrObserver(group_id), - mInspector(inspector) - { - LLGroupMgr* mgr = LLGroupMgr::getInstance(); - // register ourselves as an observer - mgr->addObserver(this); - // send a request - mgr->sendGroupPropertiesRequest(group_id); - } - - ~LLFetchGroupData() - { - // remove ourselves as an observer - LLGroupMgr::getInstance()->removeObserver(this); - } - - void changed(LLGroupChange gc) - { - if (gc == GC_PROPERTIES) - { - mInspector->processGroupData(); - } - } - - LLInspectGroup* mInspector; -}; LLInspectGroup::LLInspectGroup(const LLSD& sd) : LLInspect( LLSD() ), // single_instance, doesn't really need key - mGroupID(), // set in onOpen() - mPropertiesRequest(NULL) + mGroupID() // set in onOpen() { mCommitCallbackRegistrar.add("InspectGroup.ViewProfile", boost::bind(&LLInspectGroup::onClickViewProfile, this)); @@ -149,10 +109,7 @@ LLInspectGroup::LLInspectGroup(const LLSD& sd) LLInspectGroup::~LLInspectGroup() { - // clean up any pending requests so they don't call back into a deleted - // view - delete mPropertiesRequest; - mPropertiesRequest = NULL; + LLGroupMgr::getInstance()->removeObserver(this); } @@ -164,7 +121,7 @@ void LLInspectGroup::onOpen(const LLSD& data) // start fade animation LLInspect::onOpen(data); - mGroupID = data["group_id"]; + setGroupID(data["group_id"]); // Position the inspector relative to the mouse cursor // Similar to how tooltips are positioned @@ -185,7 +142,8 @@ void LLInspectGroup::onOpen(const LLSD& data) // virtual void LLInspectGroup::onClose(bool app_quitting) { - // *TODO: If we add a gear menu, close it here + LLGroupMgr::getInstance()->removeObserver(this); + // *TODO: If we add a gear menu, close it here } void LLInspectGroup::requestUpdate() @@ -213,9 +171,15 @@ void LLInspectGroup::requestUpdate() getChild("leave_btn")->setVisible(false); getChild("join_btn")->setVisible(false); - // Make a new request for properties - delete mPropertiesRequest; - mPropertiesRequest = new LLFetchGroupData(mGroupID, this); + LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); + if (!gdatap || !gdatap->isGroupPropertiesDataComplete() ) + { + LLGroupMgr::getInstance()->sendGroupPropertiesRequest(mGroupID); + } + else + { + processGroupData(); + } // Name lookup will be faster out of cache, use that gCacheName->getGroup(mGroupID, @@ -223,6 +187,16 @@ void LLInspectGroup::requestUpdate() this, _1, _2, _3)); } +void LLInspectGroup::setGroupID(const LLUUID& group_id) +{ + LLGroupMgr::getInstance()->removeObserver(this); + + mID = group_id; + mGroupID = group_id; + + LLGroupMgr::getInstance()->addObserver(this); +} + void LLInspectGroup::nameUpdatedCallback( const LLUUID& id, const std::string& name, @@ -236,6 +210,14 @@ void LLInspectGroup::nameUpdatedCallback( // Otherwise possibly a request for an older inspector, ignore it } +void LLInspectGroup::changed(LLGroupChange gc) +{ + if (gc == GC_PROPERTIES) + { + processGroupData(); + } +} + void LLInspectGroup::processGroupData() { LLGroupMgrGroupData* data = @@ -288,10 +270,6 @@ void LLInspectGroup::processGroupData() bool can_join = !is_member && data->mOpenEnrollment; getChild("join_btn")->setEnabled(can_join); } - - // Delete the request object as it has been satisfied - delete mPropertiesRequest; - mPropertiesRequest = NULL; } void LLInspectGroup::onClickViewProfile() diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index ae32e992a7..befe600ca9 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1191,7 +1191,7 @@ void LLInventoryModel::updateCategory(const LLViewerInventoryCategory* cat, U32 else { // add this category - LLPointer new_cat = new LLViewerInventoryCategory(cat->getParentUUID()); + LLPointer new_cat = new LLViewerInventoryCategory(cat->getOwnerID()); new_cat->copyViewerCategory(cat); addCategory(new_cat); @@ -3593,6 +3593,11 @@ void LLInventoryModel::removeCategory(const LLUUID& category_id) void LLInventoryModel::removeObject(const LLUUID& object_id) { + if(object_id.isNull()) + { + return; + } + LLInventoryObject* obj = getObject(object_id); if (dynamic_cast(obj)) { diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp index d81401b59b..9480dfdc4d 100644 --- a/indra/newview/llinventoryobserver.cpp +++ b/indra/newview/llinventoryobserver.cpp @@ -306,6 +306,12 @@ void LLInventoryFetchItemsObserver::startFetch() continue; } + if ((*it).isNull()) + { + LL_WARNS("Inventory") << "Skip fetching for a NULL uuid" << LL_ENDL; + continue; + } + // It's incomplete, so put it on the incomplete container, and // pack this on the message. mIncomplete.push_back(*it); diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 589aaeec76..c6a33138f4 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -1485,6 +1485,11 @@ void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const L } else { + LLFloater* floater_inventory = LLFloaterReg::getInstance("inventory"); + if (floater_inventory) + { + floater_inventory->setFocus(TRUE); + } active_panel->setSelection(obj_id, TAKE_FOCUS_YES); } } diff --git a/indra/newview/lllocalbitmaps.cpp b/indra/newview/lllocalbitmaps.cpp index 5e3a3ea4ec..856040ed1f 100644 --- a/indra/newview/lllocalbitmaps.cpp +++ b/indra/newview/lllocalbitmaps.cpp @@ -135,7 +135,7 @@ LLLocalBitmap::~LLLocalBitmap() } // delete self from gimagelist - LLViewerFetchedTexture* image = gTextureList.findImage(mWorldID); + LLViewerFetchedTexture* image = gTextureList.findImage(mWorldID, TEX_LIST_DISCARD); gTextureList.deleteImage(image); if (image) @@ -216,7 +216,7 @@ bool LLLocalBitmap::updateSelf(EUpdateType optional_firstupdate) texture->setCachedRawImage(LL_LOCAL_DISCARD_LEVEL, raw_image); texture->ref(); - gTextureList.addImage(texture); + gTextureList.addImage(texture, TEX_LIST_DISCARD); if (optional_firstupdate != UT_FIRSTUSE) { @@ -224,7 +224,7 @@ bool LLLocalBitmap::updateSelf(EUpdateType optional_firstupdate) replaceIDs(old_id, mWorldID); // remove old_id from gimagelist - LLViewerFetchedTexture* image = gTextureList.findImage(old_id); + LLViewerFetchedTexture* image = gTextureList.findImage(old_id, TEX_LIST_DISCARD); if (image != NULL) { gTextureList.deleteImage(image); @@ -393,7 +393,7 @@ void LLLocalBitmap::replaceIDs(LLUUID old_id, LLUUID new_id) std::vector LLLocalBitmap::prepUpdateObjects(LLUUID old_id, U32 channel) { std::vector obj_list; - LLViewerFetchedTexture* old_texture = gTextureList.findImage(old_id); + LLViewerFetchedTexture* old_texture = gTextureList.findImage(old_id, TEX_LIST_DISCARD); for(U32 face_iterator = 0; face_iterator < old_texture->getNumFaces(channel); face_iterator++) { @@ -511,7 +511,7 @@ void LLLocalBitmap::updateUserPrims(LLUUID old_id, LLUUID new_id, U32 channel) void LLLocalBitmap::updateUserSculpts(LLUUID old_id, LLUUID new_id) { - LLViewerFetchedTexture* old_texture = gTextureList.findImage(old_id); + LLViewerFetchedTexture* old_texture = gTextureList.findImage(old_id, TEX_LIST_DISCARD); for(U32 volume_iter = 0; volume_iter < old_texture->getNumVolumes(); volume_iter++) { LLVOVolume* volume_to_object = (*old_texture->getVolumeList())[volume_iter]; diff --git a/indra/newview/llmanipscale.cpp b/indra/newview/llmanipscale.cpp index 0f86271869..0632dd0b7c 100644 --- a/indra/newview/llmanipscale.cpp +++ b/indra/newview/llmanipscale.cpp @@ -2110,7 +2110,7 @@ BOOL LLManipScale::canAffectSelection() { LLViewerObject *root_object = (objectp == NULL) ? NULL : objectp->getRootEdit(); return objectp->permModify() && objectp->permMove() && !objectp->isPermanentEnforced() && - ((root_object == NULL) || !root_object->isPermanentEnforced()) && + (root_object == NULL || (!root_object->isPermanentEnforced() && !root_object->isSeat())) && !objectp->isSeat(); } } func; diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp index 322613ef23..4da5ee4764 100644 --- a/indra/newview/llnavigationbar.cpp +++ b/indra/newview/llnavigationbar.cpp @@ -44,6 +44,7 @@ #include "lllocationinputctrl.h" #include "llpaneltopinfobar.h" #include "llteleporthistory.h" +#include "llresizebar.h" #include "llsearchcombobox.h" #include "llslurl.h" #include "llurlregistry.h" @@ -274,8 +275,11 @@ LLNavigationBar::LLNavigationBar() mBtnForward(NULL), mBtnHome(NULL), mCmbLocation(NULL), - mSearchComboBox(NULL), - mSaveToLocationHistory(false) + mSaveToLocationHistory(false), + mNavigationPanel(NULL), + mFavoritePanel(NULL), + mNavPanWidth(0), + mSearchComboBox(NULL) { // buildFromFile( "panel_navigation_bar.xml"); // Make navigation bar part of the UI @@ -358,6 +362,12 @@ void LLNavigationBar::setupPanel() // Make navigation bar part of the UI // LLHints::registerHintTarget("nav_bar", getHandle()); + + //mNavigationPanel = getChild("navigation_layout_panel"); + //mFavoritePanel = getChild("favorites_layout_panel"); + //mNavigationPanel->getResizeBar()->setResizeListener(boost::bind(&LLNavigationBar::onNavbarResized, this)); + //mFavoritePanel->getResizeBar()->setResizeListener(boost::bind(&LLNavigationBar::onNavbarResized, this)); + // return TRUE; LLHints::registerHintTarget("nav_bar",mView->getHandle()); // @@ -434,6 +444,18 @@ void LLNavigationBar::onBackButtonClicked(LLUICtrl* ctrl) gFocusMgr.releaseFocusIfNeeded(ctrl); // [FS:CR] FIRE-12333 } +void LLNavigationBar::onNavbarResized() +{ + S32 new_nav_pan_width = mNavigationPanel->getRect().getWidth(); + if(mNavPanWidth != new_nav_pan_width) + { + S32 new_stack_width = new_nav_pan_width + mFavoritePanel->getRect().getWidth(); + F32 ratio = (F32)new_nav_pan_width / (F32)new_stack_width; + gSavedPerAccountSettings.setF32("NavigationBarRatio", ratio); + mNavPanWidth = new_nav_pan_width; + } +} + void LLNavigationBar::onBackOrForwardButtonHeldDown(LLUICtrl* ctrl, const LLSD& param) { if (param["count"].asInteger() == 0) @@ -792,6 +814,8 @@ void LLNavigationBar::handleLoginComplete() LLPanelTopInfoBar::instance().handleLoginComplete(); gStatusBar->handleLoginComplete(); mCmbLocation->handleLoginComplete(); + // Commented out because we don't have the LL viewer layout + //resizeLayoutPanel(); } // [RLVa:KB] - Checked: 2014-03-23 (RLVa-1.4.10) @@ -802,6 +826,15 @@ void LLNavigationBar::refreshLocationCtrl() } // [/RLVa:KB] +void LLNavigationBar::resizeLayoutPanel() +{ + LLRect nav_bar_rect = mNavigationPanel->getRect(); + + S32 nav_panel_width = (nav_bar_rect.getWidth() + mFavoritePanel->getRect().getWidth()) * gSavedPerAccountSettings.getF32("NavigationBarRatio"); + + nav_bar_rect.setLeftTopAndSize(nav_bar_rect.mLeft, nav_bar_rect.mTop, nav_panel_width, nav_bar_rect.getHeight()); + mNavigationPanel->handleReshape(nav_bar_rect,true); +} void LLNavigationBar::invokeSearch(std::string search_text) { LLFloaterReg::showInstance("search", LLSD().with("category", "all").with("query", LLSD(search_text))); diff --git a/indra/newview/llnavigationbar.h b/indra/newview/llnavigationbar.h index bf175f0c6c..b40fcfb922 100644 --- a/indra/newview/llnavigationbar.h +++ b/indra/newview/llnavigationbar.h @@ -31,6 +31,7 @@ // #include "llpanel.h" // #include "llbutton.h" +#include "lllayoutstack.h" class LLLocationInputCtrl; class LLMenuGL; @@ -120,6 +121,7 @@ private: void rebuildTeleportHistoryMenu(); void showTeleportHistoryMenu(LLUICtrl* btn_ctrl); void invokeSearch(std::string search_text); + void resizeLayoutPanel(); // callbacks void onTeleportHistoryMenuItemClicked(const LLSD& userdata); void onTeleportHistoryChanged(); @@ -138,6 +140,7 @@ private: void onSearchCommit(); void onTeleportFinished(const LLVector3d& global_agent_pos); void onTeleportFailed(); + void onNavbarResized(); void onRegionNameResponse( std::string typed_location, std::string region_name, @@ -159,6 +162,7 @@ private: // } // + S32 mNavPanWidth; LLMenuGL* mTeleportHistoryMenu; LLPullButton* mBtnBack; LLPullButton* mBtnForward; @@ -169,6 +173,8 @@ private: //LLRect mDefaultNbRect; //LLRect mDefaultFpRect; // + LLLayoutPanel* mNavigationPanel; + LLLayoutPanel* mFavoritePanel; boost::signals2::connection mTeleportFailedConnection; boost::signals2::connection mTeleportFinishConnection; boost::signals2::connection mHistoryMenuConnection; diff --git a/indra/newview/llnotificationlistitem.cpp b/indra/newview/llnotificationlistitem.cpp index f45830bae1..019122539e 100644 --- a/indra/newview/llnotificationlistitem.cpp +++ b/indra/newview/llnotificationlistitem.cpp @@ -393,10 +393,7 @@ LLGroupNoticeNotificationListItem::LLGroupNoticeNotificationListItem(const Param buildFromFile("panel_notification_list_item.xml"); } -// Crash fix in LLGroupMgr::notifyObservers() -//LLGroupNoticeNotificationListItem::~LLGroupNoticeNotificationListItem() LLGroupNotificationListItem::~LLGroupNotificationListItem() -// { LLGroupMgr::getInstance()->removeObserver(this); } @@ -587,8 +584,6 @@ void LLGroupNoticeNotificationListItem::close() mInventoryOffer->forceResponse(IOR_DECLINE); mInventoryOffer = NULL; } - // Crash fix in LLGroupMgr::notifyObservers() - //LLGroupMgr::getInstance()->removeObserver(this); } void LLGroupNoticeNotificationListItem::onClickAttachment() diff --git a/indra/newview/llnotificationlistitem.h b/indra/newview/llnotificationlistitem.h index 2343e09a29..d2d90b35e3 100644 --- a/indra/newview/llnotificationlistitem.h +++ b/indra/newview/llnotificationlistitem.h @@ -140,7 +140,7 @@ class LLGroupNotificationListItem : public LLNotificationListItem, public LLGroupMgrObserver { public: - virtual ~LLGroupNotificationListItem(); // Crash fix in LLGroupMgr::notifyObservers() + virtual ~LLGroupNotificationListItem(); virtual BOOL postBuild(); void setGroupId(const LLUUID& value); @@ -202,7 +202,6 @@ class LLGroupNoticeNotificationListItem : public LLGroupNotificationListItem { public: - //~LLGroupNoticeNotificationListItem(); // Crash fix in LLGroupMgr::notifyObservers() static std::set getTypes(); virtual BOOL postBuild(); diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index 775ee8b9ee..cdc5a48e6d 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -2360,7 +2360,7 @@ void LLPanelFace::LLSelectedTE::getTexId(LLUUID& id, bool& identical) LLTextureEntry *te = object->getTE(te_index); if (te) { - LLViewerTexture* tex = te->getID().notNull() ? gTextureList.findImage(te->getID()) : NULL; + LLViewerTexture* tex = te->getID().notNull() ? gTextureList.findImage(te->getID(), TEX_LIST_DISCARD) : NULL; if(!tex) { tex = LLViewerFetchedTexture::sDefaultImagep; diff --git a/indra/newview/llpanelgroupexperiences.cpp b/indra/newview/llpanelgroupexperiences.cpp index fb3a97318e..6bd1c11858 100644 --- a/indra/newview/llpanelgroupexperiences.cpp +++ b/indra/newview/llpanelgroupexperiences.cpp @@ -30,7 +30,7 @@ #include "lluictrlfactory.h" #include "roles_constants.h" - +#include "llappviewer.h" #include "llhttpclient.h" #include "llagent.h" #include "llviewerregion.h" @@ -38,8 +38,6 @@ #include "llpanelexperiences.h" #include "llsd.h" -#include "llvoavatarself.h" - static LLPanelInjector t_panel_group_experiences("panel_group_experiences"); @@ -98,20 +96,13 @@ BOOL LLPanelGroupExperiences::postBuild() void LLPanelGroupExperiences::activate() { - if (getGroupID() == LLUUID::null) + if ((getGroupID() == LLUUID::null) || gDisconnected) { return; } - // Crash fix - if (!isAgentAvatarValid()) - { - return; - } - // - // search for experiences owned by the current group - std::string url = gAgent.getRegion()->getCapability("GroupExperiences"); + std::string url = (gAgent.getRegion()) ? gAgent.getRegion()->getCapability("GroupExperiences") : LLStringUtil::null; if (!url.empty()) { url += "?" + getGroupID().asString(); diff --git a/indra/newview/llpanelgroupinvite.cpp b/indra/newview/llpanelgroupinvite.cpp index 8dfd317d7f..82ea8377de 100644 --- a/indra/newview/llpanelgroupinvite.cpp +++ b/indra/newview/llpanelgroupinvite.cpp @@ -501,27 +501,22 @@ void LLPanelGroupInvite::addUsers(uuid_vec_t& agent_ids) } else { - //looks like user try to invite offline friend + //looks like user try to invite offline avatar (or the avatar from the other region) //for offline avatar_id gObjectList.findObject() will return null //so we need to do this additional search in avatar tracker, see EXT-4732 - // FIRE-4140: Group invite button on profile sometimes doesn't work - //if (LLAvatarTracker::instance().isBuddy(agent_id)) - // + LLAvatarName av_name; + if (!LLAvatarNameCache::get(agent_id, &av_name)) { - LLAvatarName av_name; - if (!LLAvatarNameCache::get(agent_id, &av_name)) - { - // actually it should happen, just in case - //LLAvatarNameCache::get(LLUUID(agent_id), boost::bind(&LLPanelGroupInvite::addUserCallback, this, _1, _2)); - // for this special case! - //when there is no cached name we should remove resident from agent_ids list to avoid breaking of sequence - // removed id will be added in callback - agent_ids.erase(agent_ids.begin() + i); - } - else - { - names.push_back(av_name.getAccountName()); - } + // actually it should happen, just in case + //LLAvatarNameCache::get(LLUUID(agent_id), boost::bind(&LLPanelGroupInvite::addUserCallback, this, _1, _2)); + // for this special case! + //when there is no cached name we should remove resident from agent_ids list to avoid breaking of sequence + // removed id will be added in callback + agent_ids.erase(agent_ids.begin() + i); + } + else + { + names.push_back(av_name.getAccountName()); } } } diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 658a99ac19..a6abe19618 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -860,12 +860,17 @@ void LLPanelLogin::onClickConnect(void *) // The start location SLURL has already been sent to LLStartUp::setStartSLURL std::string username = sInstance->getChild("username_combo")->getValue().asString(); + std::string password = sInstance->getChild("password_edit")->getValue().asString(); if(username.empty()) { // user must type in something into the username field LLNotificationsUtil::add("MustHaveAccountToLogIn"); } + else if(password.empty()) + { + LLNotificationsUtil::add("MustEnterPasswordToLogIn"); + } else { LLPointer cred; diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index f3b2cc540c..d2db4b718d 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -857,7 +857,7 @@ void LLPanelOutfitEdit::onShopButtonClicked() url = url_resolver.resolveURL(LLWearableType::WT_NONE, SEX_FEMALE); } - LLWeb::loadURLExternal(url); + LLWeb::loadURL(url); } LLWearableType::EType LLPanelOutfitEdit::getCOFWearablesSelectionType() const diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index be955cbfe2..4a0513aff0 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -713,25 +713,49 @@ void LLPanelPermissions::refresh() &next_owner_mask_on, &next_owner_mask_off); - + if (gSavedSettings.getBOOL("DebugPermissions") ) { if (valid_base_perms) { getChild("B:")->setValue("B: " + mask_to_string(base_mask_on)); - getChildView("B:")->setVisible( TRUE); - + getChildView("B:")->setVisible(TRUE); getChild("O:")->setValue("O: " + mask_to_string(owner_mask_on)); - getChildView("O:")->setVisible( TRUE); - + getChildView("O:")->setVisible(TRUE); getChild("G:")->setValue("G: " + mask_to_string(group_mask_on)); - getChildView("G:")->setVisible( TRUE); - + getChildView("G:")->setVisible(TRUE); getChild("E:")->setValue("E: " + mask_to_string(everyone_mask_on)); - getChildView("E:")->setVisible( TRUE); - + getChildView("E:")->setVisible(TRUE); getChild("N:")->setValue("N: " + mask_to_string(next_owner_mask_on)); - getChildView("N:")->setVisible( TRUE); + getChildView("N:")->setVisible(TRUE); + } + else if(!root_selected) + { + if(object_count == 1) + { + LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstNode(); + if (node && node->mValid) + { + getChild("B:")->setValue("B: " + mask_to_string( node->mPermissions->getMaskBase())); + getChildView("B:")->setVisible(TRUE); + getChild("O:")->setValue("O: " + mask_to_string(node->mPermissions->getMaskOwner())); + getChildView("O:")->setVisible(TRUE); + getChild("G:")->setValue("G: " + mask_to_string(node->mPermissions->getMaskGroup())); + getChildView("G:")->setVisible(TRUE); + getChild("E:")->setValue("E: " + mask_to_string(node->mPermissions->getMaskEveryone())); + getChildView("E:")->setVisible(TRUE); + getChild("N:")->setValue("N: " + mask_to_string(node->mPermissions->getMaskNextOwner())); + getChildView("N:")->setVisible(TRUE); + } + } + } + else + { + getChildView("B:")->setVisible(FALSE); + getChildView("O:")->setVisible(FALSE); + getChildView("G:")->setVisible(FALSE); + getChildView("E:")->setVisible(FALSE); + getChildView("N:")->setVisible(FALSE); } U32 flag_mask = 0x0; diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp index 43f03c6da4..5b768789c0 100644 --- a/indra/newview/llpanelprimmediacontrols.cpp +++ b/indra/newview/llpanelprimmediacontrols.cpp @@ -314,21 +314,14 @@ void LLPanelPrimMediaControls::updateShape() if (objectp) { - // VWR-29449; Remeber if user has MEDIA_PERM_CONTROL bool hasPermsControl = true; - // - bool mini_controls = false; LLMediaEntry *media_data = objectp->getTE(mTargetObjectFace)->getMediaData(); if (media_data && NULL != dynamic_cast(objectp)) { // Don't show the media controls if we do not have permissions enabled = dynamic_cast(objectp)->hasMediaPermission(media_data, LLVOVolume::MEDIA_PERM_CONTROL); - - // VWR-29449; Remeber if user has MEDIA_PERM_CONTROL hasPermsControl = dynamic_cast(objectp)->hasMediaPermission(media_data, LLVOVolume::MEDIA_PERM_CONTROL); - // - mini_controls = (LLMediaEntry::MINI == media_data->getControls()); } const bool is_hud = objectp->isHUDAttachment(); @@ -571,10 +564,9 @@ void LLPanelPrimMediaControls::updateShape() } } - // VWR-29449; If this is a HUD always set it visible, but hide each control if user has no perms. - // When setting it invisible it won't receive any mouse messages anymore, thus eg trying to sroll a webpage with mousewheel has surprising effects. + // MAINT-1392 If this is a HUD always set it visible, but hide each control if user has no perms. + // When setting it invisible it won't receive any mouse messages anymore - // setVisible(enabled); if( !is_hud ) setVisible(enabled); else @@ -806,20 +798,15 @@ void LLPanelPrimMediaControls::draw() controls_bg_area.mRight -= mRightBookend->getRect().getWidth() - space - 2; // draw control background UI image - - // VWR-29449; Only draw mBackgroundImage when the user has MEDIA_PERM_CONTROL. Otherwise we did hide all media controls above and drawing mBackgroundImage draws a useless grey square. - // mBackgroundImage->draw( controls_bg_area, UI_VERTEX_COLOR % alpha); - LLViewerObject* objectp = getTargetObject(); LLMediaEntry *media_data(0); if( objectp ) media_data = objectp->getTE(mTargetObjectFace)->getMediaData(); + if( !dynamic_cast(objectp) || !media_data || dynamic_cast(objectp)->hasMediaPermission(media_data, LLVOVolume::MEDIA_PERM_CONTROL) ) mBackgroundImage->draw( controls_bg_area, UI_VERTEX_COLOR % alpha); - - // // draw volume slider background UI image if (mVolumeSliderCtrl->getVisible()) diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp index f07e61dee2..e8dbbefb42 100644 --- a/indra/newview/llpanelvolume.cpp +++ b/indra/newview/llpanelvolume.cpp @@ -719,7 +719,7 @@ void LLPanelVolume::onLightCancelTexture(const LLSD& data) if (LightTextureCtrl) { - LightTextureCtrl->setImageAssetID(LLUUID::null); + LightTextureCtrl->setImageAssetID(mLightSavedTexture); } LLVOVolume *volobjp = (LLVOVolume *) mObject.get(); @@ -728,7 +728,16 @@ void LLPanelVolume::onLightCancelTexture(const LLSD& data) // Cancel the light texture as requested // NORSPEC-292 // - volobjp->setLightTextureID(LLUUID::null); + bool is_spotlight = volobjp->isLightSpotlight(); + volobjp->setLightTextureID(mLightSavedTexture); //updates spotlight + + if (!is_spotlight && mLightSavedTexture.notNull()) + { + LLVector3 spot_params = volobjp->getSpotLightParams(); + getChild("Light FOV")->setValue(spot_params.mV[0]); + getChild("Light Focus")->setValue(spot_params.mV[1]); + getChild("Light Ambiance")->setValue(spot_params.mV[2]); + } } } @@ -827,7 +836,12 @@ void LLPanelVolume::onCommitLight( LLUICtrl* ctrl, void* userdata ) self->getChild("Light Ambiance")->setValue(spot_params.mV[2]); } else - { //modifying existing params + { //modifying existing params, this time volobjp won't change params on its own. + if (volobjp->getLightTextureID() != id) + { + volobjp->setLightTextureID(id); + } + LLVector3 spot_params; spot_params.mV[0] = (F32) self->getChild("Light FOV")->getValue().asReal(); spot_params.mV[1] = (F32) self->getChild("Light Focus")->getValue().asReal(); diff --git a/indra/newview/llpersistentnotificationstorage.cpp b/indra/newview/llpersistentnotificationstorage.cpp index a00fa0d26f..29e9d527b3 100644 --- a/indra/newview/llpersistentnotificationstorage.cpp +++ b/indra/newview/llpersistentnotificationstorage.cpp @@ -126,9 +126,26 @@ void LLPersistentNotificationStorage::loadNotifications() startBulkUpdate(); // S32 processed_notifications = 0; + std::vector notifications_array; for (LLSD::reverse_array_iterator notification_it = data.rbeginArray(); notification_it != data.rendArray(); ++notification_it) + { + LLSD notification_params = *notification_it; + notifications_array.push_back(notification_params); + + ++processed_notifications; + if (processed_notifications >= gSavedSettings.getS32("MaxPersistentNotifications")) + { + LL_WARNS() << "Too many persistent notifications." + << " Processed " << gSavedSettings.getS32("MaxPersistentNotifications") << " of " << data.size() << " persistent notifications." << LL_ENDL; + break; + } + } + + for (LLSD::reverse_array_iterator notification_it = notifications_array.rbegin(); + notification_it != notifications_array.rend(); + ++notification_it) { LLSD notification_params = *notification_it; LLNotificationPtr notification(new LLNotification(notification_params)); @@ -146,14 +163,8 @@ void LLPersistentNotificationStorage::loadNotifications() // hide saved toasts so they don't confuse the user notification_channel->hideToast(notification->getID()); } - ++processed_notifications; - if (processed_notifications >= gSavedSettings.getS32("MaxPersistentNotifications")) - { - LL_WARNS() << "Too many persistent notifications." - << " Processed " << gSavedSettings.getS32("MaxPersistentNotifications") << " of " << data.size() << " persistent notifications." << LL_ENDL; - break; - } } + LLNotifications::instance().getChannel("Persistent")-> connectChanged(boost::bind(&LLPersistentNotificationStorage::onPersistentChannelChanged, this, _1)); endBulkUpdate(); // diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index 39943303dc..4cddd92cb5 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -2396,7 +2396,8 @@ LLLiveLSLEditor::LLLiveLSLEditor(const LLSD& key) : mCloseAfterSave(FALSE), mPendingUploads(0), mIsModifiable(FALSE), - mIsNew(false) + mIsNew(false), + mIsSaving(FALSE) { mFactoryMap["script ed panel"] = LLCallbackMap(LLLiveLSLEditor::createScriptEdPanel, this); } @@ -2453,6 +2454,8 @@ void LLLiveLSLEditor::callbackLSLCompileSucceeded(const LLUUID& task_id, } // [/SL:KB] + getChild("running")->set(is_script_running); + mIsSaving = FALSE; closeIfNeeded(); } @@ -2485,6 +2488,7 @@ void LLLiveLSLEditor::callbackLSLCompileFailed(const LLSD& compile_errors) } // [/SL:KB] + mIsSaving = FALSE; closeIfNeeded(); } @@ -2743,13 +2747,13 @@ void LLLiveLSLEditor::draw() if(object->permAnyOwner()) { runningCheckbox->setLabel(getString("script_running")); - runningCheckbox->setEnabled(TRUE); + runningCheckbox->setEnabled(!mIsSaving); // Rev 496 LL merge error //if(object->permAnyOwner()) //{ // runningCheckbox->setLabel(getString("script_running")); - // runningCheckbox->setEnabled(TRUE); + // runningCheckbox->setEnabled(!mIsSaving); //} //else //{ @@ -2898,6 +2902,7 @@ void LLLiveLSLEditor::saveIfNeeded(bool sync /*= true*/) getWindow()->incBusyCount(); mPendingUploads++; BOOL is_running = getChild( "running")->get(); + mIsSaving = TRUE; if (!url.empty()) { uploadAssetViaCaps(url, filename, mObjectUUID, mItemUUID, is_running, mScriptEd->getAssociatedExperience()); diff --git a/indra/newview/llpreviewscript.h b/indra/newview/llpreviewscript.h index 3c5a78495c..77f468109d 100644 --- a/indra/newview/llpreviewscript.h +++ b/indra/newview/llpreviewscript.h @@ -405,6 +405,8 @@ private: // need to save both text and script, so need to decide when done S32 mPendingUploads; + BOOL mIsSaving; + BOOL getIsModifiable() const { return mIsModifiable; } // Evaluated on load assert LLCheckBoxCtrl* mMonoCheckbox; diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index c59f880583..a6af492297 100644 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -137,15 +137,11 @@ LLPreviewTexture::~LLPreviewTexture() getWindow()->decBusyCount(); } - // mImage can be 0. - // mImage->setBoostLevel(mImageOldBoostLevel); - - if( mImage ) + if (mImage.notNull()) + { mImage->setBoostLevel(mImageOldBoostLevel); - - // - - mImage = NULL; + mImage = NULL; + } } // virtual diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp index 8242368a64..1cc4bbf443 100644 --- a/indra/newview/llscreenchannel.cpp +++ b/indra/newview/llscreenchannel.cpp @@ -36,7 +36,7 @@ #include "llviewerwindow.h" #include "llfloaterreg.h" #include "lltrans.h" - +#include "llagent.h" #include "lldockablefloater.h" #include "llsyswellwindow.h" #include "llfloaterimsession.h" @@ -306,7 +306,11 @@ void LLScreenChannel::addToast(const LLToast::Params& p) if(!show_toast && !store_toast) { - LLNotificationPtr notification = LLNotifications::instance().find(p.notif_id); + if(gAgent.isDoNotDisturb()) + { + return; + } + LLNotificationPtr notification = LLNotifications::instance().find(p.notif_id); if (notification && (!notification->canLogToIM() || !notification->hasFormElements())) diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index cf3ad817bc..a28a16015d 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -1715,7 +1715,11 @@ void LLSelectMgr::selectionSetImage(const LLUUID& imageid) f(LLViewerInventoryItem* item, const LLUUID& id) : mItem(item), mImageID(id) {} bool apply(LLViewerObject* objectp, S32 te) { - if (mItem) + if(objectp && !objectp->permModify()) + { + return false; + } + if (mItem) { if (te == -1) // all faces { @@ -6972,7 +6976,8 @@ LLBBox LLSelectMgr::getBBoxOfSelection() const //----------------------------------------------------------------------------- BOOL LLSelectMgr::canUndo() const { - return const_cast(this)->mSelectedObjects->getFirstEditableObject() != NULL; // HACK: casting away constness - MG + // Can edit or can move + return const_cast(this)->mSelectedObjects->getFirstUndoEnabledObject() != NULL; // HACK: casting away constness - MG; } //----------------------------------------------------------------------------- @@ -7967,6 +7972,22 @@ LLViewerObject* LLObjectSelection::getFirstMoveableObject(BOOL get_parent) return getFirstSelectedObject(&func, get_parent); } +//----------------------------------------------------------------------------- +// getFirstUndoEnabledObject() +//----------------------------------------------------------------------------- +LLViewerObject* LLObjectSelection::getFirstUndoEnabledObject(BOOL get_parent) +{ + struct f : public LLSelectedNodeFunctor + { + bool apply(LLSelectNode* node) + { + LLViewerObject* obj = node->getObject(); + return obj && (obj->permModify() || (obj->permMove() && !obj->isPermanentEnforced())); + } + } func; + return getFirstSelectedObject(&func, get_parent); +} + //----------------------------------------------------------------------------- // Position + Rotation update methods called from LLViewerJoystick //----------------------------------------------------------------------------- diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h index bb1e0908f9..bc716bfafb 100644 --- a/indra/newview/llselectmgr.h +++ b/indra/newview/llselectmgr.h @@ -319,6 +319,7 @@ public: LLViewerObject* getFirstCopyableObject(BOOL get_parent = FALSE); LLViewerObject* getFirstDeleteableObject(); LLViewerObject* getFirstMoveableObject(BOOL get_parent = FALSE); + LLViewerObject* getFirstUndoEnabledObject(BOOL get_parent = FALSE); /// Return the object that lead to this selection, possible a child LLViewerObject* getPrimaryObject() { return mPrimaryObject; } diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index 2417973338..d4ce011dca 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -200,7 +200,7 @@ void LLSidepanelAppearance::updateToVisibility(const LLSD &new_visibility) if (is_outfit_edit_visible || is_wearable_edit_visible) { - const LLViewerWearable *wearable_ptr = mEditWearable->getWearable(); + const LLViewerWearable *wearable_ptr = mEditWearable ? mEditWearable->getWearable() : NULL; if (!wearable_ptr) { LL_WARNS() << "Visibility change to invalid wearable" << LL_ENDL; diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index bf85f002db..33f7ad566f 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -500,7 +500,7 @@ void LLSidepanelInventory::onShareButtonClicked() void LLSidepanelInventory::onShopButtonClicked() { - LLWeb::loadURLExternal(gSavedSettings.getString("MarketplaceURL")); + LLWeb::loadURL(gSavedSettings.getString("MarketplaceURL")); } void LLSidepanelInventory::performActionOnSelection(const std::string &action) diff --git a/indra/newview/llsidepaneltaskinfo.cpp b/indra/newview/llsidepaneltaskinfo.cpp index b7e8bbdb37..483120c19a 100644 --- a/indra/newview/llsidepaneltaskinfo.cpp +++ b/indra/newview/llsidepaneltaskinfo.cpp @@ -386,6 +386,10 @@ void LLSidepanelTaskInfo::refresh() // mDACreatorName->setValue(creator_name); // mCreatorID = creator_id; // } +// if(mDACreatorName->getValue().asString() == LLStringUtil::null) +// { +// mDACreatorName->setValue(creator_name); +// } // mDACreatorName->setEnabled(TRUE); // [RLVa:KB] - Moved further down to avoid an annoying flicker when the text is set twice in a row @@ -426,6 +430,10 @@ void LLSidepanelTaskInfo::refresh() // mDAOwnerName->setValue(owner_name); // mOwnerID = owner_id; // } +// if(mDAOwnerName->getValue().asString() == LLStringUtil::null) +// { +// mDAOwnerName->setValue(owner_name); +// } // [RLVa:KB] - Moved further down to avoid an annoying flicker when the text is set twice in a row // [RLVa:KB] - Checked: 2010-11-01 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index bdd44d181a..6109fea506 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -277,7 +277,7 @@ BOOL LLStatusBar::postBuild() boost::bind(&LLStatusBar::onClickBuyCurrency, this)); // Not used in Firestorm - //getChild("goShop")->setCommitCallback(boost::bind(&LLWeb::loadURLExternal, gSavedSettings.getString("MarketplaceURL"))); + //getChild("goShop")->setCommitCallback(boost::bind(&LLWeb::loadURL, gSavedSettings.getString("MarketplaceURL"), LLStringUtil::null, LLStringUtil::null)); mBoxBalance = getChild("balance"); mBoxBalance->setClickedCallback( &LLStatusBar::onClickBalance, this ); diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index 880c70821e..285d153636 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -1496,6 +1496,7 @@ void LLTextureCache::readHeaderCache() new_entries.push_back(entry); } } + mFreeList.clear(); // recreating list, no longer valid. llassert_always(new_entries.size() <= sCacheMaxEntries); mHeaderEntriesInfo.mEntries = new_entries.size(); writeEntriesHeader(); diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 16d9a5927b..64e47a153a 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -2082,11 +2082,18 @@ void LLTextureFetchWorker::onCompleted(LLCore::HttpHandle handle, LLCore::HttpRe if (log_texture_traffic && data_size > 0) { - LLViewerTexture* tex = LLViewerTextureManager::findTexture(mID); - if (tex) - { - gTotalTextureBytesPerBoostLevel[tex->getBoostLevel()] += data_size ; - } + // one worker per multiple textures + std::vector textures; + LLViewerTextureManager::findTextures(mID, textures); + std::vector::iterator iter = textures.begin(); + while (iter != textures.end()) + { + LLViewerTexture* tex = *iter++; + if (tex) + { + gTotalTextureBytesPerBoostLevel[tex->getBoostLevel()] += data_size; + } + } } mFetcher->removeFromHTTPQueue(mID, data_size); @@ -4342,26 +4349,33 @@ bool LLTextureFetchDebugger::processStartDebug(F32 max_time) fetched_textures.insert(mFetchingHistory[i].mID); in_list = false; } - - LLViewerFetchedTexture* tex = LLViewerTextureManager::findFetchedTexture(mFetchingHistory[i].mID); - if(tex && tex->isJustBound()) //visible - { - if(!in_list) - { - mNumVisibleFetchedTextures++; - } - mNumVisibleFetchingRequests++; - - mVisibleFetchedData += mFetchingHistory[i].mFetchedSize; - mVisibleDecodedData += mFetchingHistory[i].mDecodedSize; - - if(tex->getDiscardLevel() >= mFetchingHistory[i].mDecodedLevel) - { - mRenderedData += mFetchingHistory[i].mFetchedSize; - mRenderedDecodedData += mFetchingHistory[i].mDecodedSize; - mRenderedPixels += tex->getWidth() * tex->getHeight(); - } - } + + std::vector textures; + LLViewerTextureManager::findFetchedTextures(mFetchingHistory[i].mID, textures); + std::vector::iterator iter = textures.begin(); + while (iter != textures.end()) + { + LLViewerFetchedTexture* tex = *iter++; + // fetched data will be counted for both ui and regular elements + if (tex && tex->isJustBound()) //visible + { + if (!in_list) + { + mNumVisibleFetchedTextures++; + } + mNumVisibleFetchingRequests++; + + mVisibleFetchedData += mFetchingHistory[i].mFetchedSize; + mVisibleDecodedData += mFetchingHistory[i].mDecodedSize; + + if (tex->getDiscardLevel() >= mFetchingHistory[i].mDecodedLevel) + { + mRenderedData += mFetchingHistory[i].mFetchedSize; + mRenderedDecodedData += mFetchingHistory[i].mDecodedSize; + mRenderedPixels += tex->getWidth() * tex->getHeight(); + } + } + } } mNumFetchedTextures = fetched_textures.size(); @@ -4461,7 +4475,8 @@ void LLTextureFetchDebugger::addHistoryEntry(LLTextureFetchWorker* worker) mRefetchedAllPixels += worker->mRawImage->getWidth() * worker->mRawImage->getHeight(); mRefetchedAllData += worker->mFormattedImage->getDataSize(); - LLViewerFetchedTexture* tex = LLViewerTextureManager::findFetchedTexture(worker->mID); + // refetch list only requests/creates normal images, so requesting ui='false' + LLViewerFetchedTexture* tex = LLViewerTextureManager::findFetchedTexture(worker->mID, TEX_LIST_DISCARD); if(tex && mRefetchList[tex].begin() != mRefetchList[tex].end()) { if(worker->mDecodedDiscard == mFetchingHistory[mRefetchList[tex][0]].mDecodedLevel) @@ -4688,12 +4703,18 @@ void LLTextureFetchDebugger::debugGLTextureCreation() { if(mFetchingHistory[i].mRawImage.notNull()) { - LLViewerFetchedTexture* tex = gTextureList.findImage(mFetchingHistory[i].mID) ; - if(tex && !tex->isForSculptOnly()) - { - tex->destroyGLTexture() ; - mTempTexList.push_back(tex); - } + std::vector textures; + gTextureList.findTexturesByID(mFetchingHistory[i].mID, textures); + std::vector::iterator iter = textures.begin(); + while (iter != textures.end()) + { + LLViewerFetchedTexture* tex = *iter++; + if (tex && !tex->isForSculptOnly()) + { + tex->destroyGLTexture(); + mTempTexList.push_back(tex); + } + } } } @@ -4748,11 +4769,17 @@ void LLTextureFetchDebugger::clearTextures() S32 size = mFetchingHistory.size(); for(S32 i = 0 ; i < size ; i++) { - LLViewerFetchedTexture* tex = gTextureList.findImage(mFetchingHistory[i].mID) ; - if(tex) - { - tex->clearFetchedResults() ; - } + std::vector textures; + gTextureList.findTexturesByID(mFetchingHistory[i].mID, textures); + std::vector::iterator iter = textures.begin(); + while (iter != textures.end()) + { + LLViewerFetchedTexture* tex = *iter++; + if (tex) + { + tex->clearFetchedResults(); + } + } } } @@ -4768,6 +4795,8 @@ void LLTextureFetchDebugger::makeRefetchList() continue; //the texture fetch pipeline will take care of visible textures. } + // todo: Will attempt to refetch icons and ui elements as normal images (boost_none) + // thus will create unnecessary LLViewerFetchedTexture, consider supporting separate UI textures mRefetchList[tex].push_back(i); } } diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h index a2658ecd85..dc9df71c67 100644 --- a/indra/newview/lltexturefetch.h +++ b/indra/newview/lltexturefetch.h @@ -540,7 +540,7 @@ private: S32 mNbCurlRequests; S32 mNbCurlCompleted; - std::map< LLPointer, std::vector > mRefetchList; + std::map< LLPointer, std::vector > mRefetchList; // treats UI textures as normal textures std::vector< LLPointer > mTempTexList; S32 mTempIndex; S32 mHistoryListIndex; diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp index b6b18d1905..73b6b8230b 100644 --- a/indra/newview/lltoast.cpp +++ b/indra/newview/lltoast.cpp @@ -390,10 +390,6 @@ void LLToast::setVisible(BOOL show) { mTimer->start(); } - if (!getVisible()) - { - LLModalDialog::setFrontmost(FALSE); - } } else { diff --git a/indra/newview/lltool.cpp b/indra/newview/lltool.cpp index da64fc844d..42ef7510e7 100644 --- a/indra/newview/lltool.cpp +++ b/indra/newview/lltool.cpp @@ -38,6 +38,7 @@ #include "lltoolfocus.h" #include "llfocusmgr.h" #include "llagent.h" +#include "llagentcamera.h" #include "llviewerjoystick.h" extern BOOL gDebugClicks; @@ -84,7 +85,14 @@ BOOL LLTool::handleMouseDown(S32 x, S32 y, MASK mask) } // by default, didn't handle it // LL_INFOS() << "LLTool::handleMouseDown" << LL_ENDL; - gAgent.setControlFlags(AGENT_CONTROL_LBUTTON_DOWN); + if (gAgentCamera.cameraMouselook()) + { + gAgent.setControlFlags(AGENT_CONTROL_ML_LBUTTON_DOWN); + } + else + { + gAgent.setControlFlags(AGENT_CONTROL_LBUTTON_DOWN); + } return TRUE; } @@ -95,8 +103,15 @@ BOOL LLTool::handleMouseUp(S32 x, S32 y, MASK mask) LL_INFOS() << "LLTool left mouse up" << LL_ENDL; } // by default, didn't handle it - // LL_INFOS() << "LLTool::handleMouseUp" << LL_ENDL; - gAgent.setControlFlags(AGENT_CONTROL_LBUTTON_UP); + // LL_INFOS() << "LLTool::handleMouseUp" << LL_ENDL; + if (gAgentCamera.cameraMouselook()) + { + gAgent.setControlFlags(AGENT_CONTROL_ML_LBUTTON_UP); + } + else + { + gAgent.setControlFlags(AGENT_CONTROL_LBUTTON_UP); + } return TRUE; } diff --git a/indra/newview/lltoolcomp.cpp b/indra/newview/lltoolcomp.cpp index b9a4095ade..c82e57183a 100644 --- a/indra/newview/lltoolcomp.cpp +++ b/indra/newview/lltoolcomp.cpp @@ -760,12 +760,13 @@ BOOL LLToolCompGun::handleHover(S32 x, S32 y, MASK mask) BOOL LLToolCompGun::handleMouseDown(S32 x, S32 y, MASK mask) { - // if the left button is grabbed, don't put up the pie menu - if (gAgent.leftButtonGrabbed()) - { - gAgent.setControlFlags(AGENT_CONTROL_ML_LBUTTON_DOWN); - return FALSE; - } + // if the left button is blocked, don't put up the pie menu + if (gAgent.leftButtonBlocked()) + { + // in case of "grabbed" control flag will be set later + gAgent.setControlFlags(AGENT_CONTROL_ML_LBUTTON_DOWN); + return FALSE; + } // On mousedown, start grabbing gGrabTransientTool = this; @@ -777,12 +778,13 @@ BOOL LLToolCompGun::handleMouseDown(S32 x, S32 y, MASK mask) BOOL LLToolCompGun::handleDoubleClick(S32 x, S32 y, MASK mask) { - // if the left button is grabbed, don't put up the pie menu - if (gAgent.leftButtonGrabbed()) - { - gAgent.setControlFlags(AGENT_CONTROL_ML_LBUTTON_DOWN); - return FALSE; - } + // if the left button is blocked, don't put up the pie menu + if (gAgent.leftButtonBlocked()) + { + // in case of "grabbed" control flag will be set later + gAgent.setControlFlags(AGENT_CONTROL_ML_LBUTTON_DOWN); + return FALSE; + } // On mousedown, start grabbing gGrabTransientTool = this; diff --git a/indra/newview/lltoolgrab.cpp b/indra/newview/lltoolgrab.cpp index e25d068ac6..0c3a537c41 100644 --- a/indra/newview/lltoolgrab.cpp +++ b/indra/newview/lltoolgrab.cpp @@ -146,7 +146,7 @@ BOOL LLToolGrab::handleMouseDown(S32 x, S32 y, MASK mask) // call the base class to propogate info to sim LLTool::handleMouseDown(x, y, mask); - if (!gAgent.leftButtonGrabbed()) + if (!gAgent.leftButtonBlocked()) { // can grab transparent objects (how touch event propagates, scripters rely on this) gViewerWindow->pickAsync(x, y, mask, pickCallback, /*BOOL pick_transparent*/ TRUE); diff --git a/indra/newview/lltoolmgr.cpp b/indra/newview/lltoolmgr.cpp index 3925630299..dc8c407670 100644 --- a/indra/newview/lltoolmgr.cpp +++ b/indra/newview/lltoolmgr.cpp @@ -419,11 +419,9 @@ void LLToolMgr::clearTransientTool() void LLToolMgr::onAppFocusLost() { - // During shutdown the viewer might be in a state that leads to crashes. - if( LLApp::isQuitting() ) + if (LLApp::isQuitting()) return; - // - + if (mSelectedTool) { mSelectedTool->handleDeselect(); diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 92bea9f33b..5c14ecab43 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -94,7 +94,8 @@ LLToolPie::LLToolPie() mBlockClickToWalk(false), mClickAction(0), mClickActionBuyEnabled( gSavedSettings.getBOOL("ClickActionBuyEnabled") ), - mClickActionPayEnabled( gSavedSettings.getBOOL("ClickActionPayEnabled") ) + mClickActionPayEnabled( gSavedSettings.getBOOL("ClickActionPayEnabled") ), + mDoubleClickTimer() { } @@ -110,7 +111,12 @@ BOOL LLToolPie::handleAnyMouseClick(S32 x, S32 y, MASK mask, EClickType clicktyp BOOL LLToolPie::handleMouseDown(S32 x, S32 y, MASK mask) { - mMouseOutsideSlop = FALSE; + if (mDoubleClickTimer.getStarted()) + { + mDoubleClickTimer.stop(); + } + + mMouseOutsideSlop = FALSE; mMouseDownX = x; mMouseDownY = y; @@ -710,7 +716,15 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask) BOOL LLToolPie::handleMouseUp(S32 x, S32 y, MASK mask) { - LLViewerObject* obj = mPick.getObject(); + if (!mDoubleClickTimer.getStarted()) + { + mDoubleClickTimer.start(); + } + else + { + mDoubleClickTimer.reset(); + } + LLViewerObject* obj = mPick.getObject(); U8 click_action = final_click_action(obj); // let media have first pass at click @@ -804,10 +818,17 @@ BOOL LLToolPie::handleDoubleClick(S32 x, S32 y, MASK mask) LL_INFOS() << "LLToolPie handleDoubleClick (becoming mouseDown)" << LL_ENDL; } - if (handleMediaDblClick(mPick)) - { - return TRUE; - } + if (handleMediaDblClick(mPick)) + { + return TRUE; + } + + if (!mDoubleClickTimer.getStarted() || (mDoubleClickTimer.getElapsedTimeF32() > 0.3f)) + { + mDoubleClickTimer.stop(); + return FALSE; + } + mDoubleClickTimer.stop(); if (gSavedSettings.getBOOL("DoubleClickAutoPilot")) { @@ -820,6 +841,15 @@ BOOL LLToolPie::handleDoubleClick(S32 x, S32 y, MASK mask) FALSE /* ignore transparent */, FALSE /* ignore particles */); + if(mPick.mPickType == LLPickInfo::PICK_OBJECT) + { + if (mPick.getObject() && mPick.getObject()->isHUDAttachment()) + { + mPick = savedPick; + return FALSE; + } + } + if ((mPick.mPickType == LLPickInfo::PICK_LAND && !mPick.mPosGlobal.isExactlyZero()) || (mPick.mObjectID.notNull() && !mPick.mPosGlobal.isExactlyZero())) { diff --git a/indra/newview/lltoolpie.h b/indra/newview/lltoolpie.h index 76921bc9c8..0e3b82c81b 100644 --- a/indra/newview/lltoolpie.h +++ b/indra/newview/lltoolpie.h @@ -129,6 +129,7 @@ private: LLSafeHandle mLeftClickSelection; BOOL mClickActionBuyEnabled; BOOL mClickActionPayEnabled; + LLFrameTimer mDoubleClickTimer; // Keep track of name resolutions we made and delete them if needed to avoid crashing if this instance dies. private: diff --git a/indra/newview/llviewerassetstorage.cpp b/indra/newview/llviewerassetstorage.cpp index 0fcd726465..56dc7674c1 100644 --- a/indra/newview/llviewerassetstorage.cpp +++ b/indra/newview/llviewerassetstorage.cpp @@ -368,7 +368,7 @@ void LLViewerAssetStorage::_queueDataRequest( // Set our destination file, and the completion callback. LLTransferTargetParamsVFile tpvf; tpvf.setAsset(uuid, atype); - tpvf.setCallback(downloadCompleteCallback, req); + tpvf.setCallback(downloadCompleteCallback, *req); LL_DEBUGS("AssetStorage") << "Starting transfer for " << uuid << LL_ENDL; LLTransferTargetChannel *ttcp = gTransferManager.getTargetChannel(mUpstreamHost, LLTCT_ASSET); diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 795266ccc4..76d7fa054a 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -1688,6 +1688,8 @@ void LLViewerMedia::onTeleportFinished() { // On teleport, clear this setting (i.e. set it to true) gSavedSettings.setBOOL("MediaTentativeAutoPlay", true); + + LLViewerMediaImpl::sMimeTypesFailed.clear(); } @@ -1699,6 +1701,7 @@ void LLViewerMedia::setOnlyAudibleMediaTextureID(const LLUUID& texture_id) sForceUpdate = true; } +std::vector LLViewerMediaImpl::sMimeTypesFailed; ////////////////////////////////////////////////////////////////////////////////////////// // LLViewerMediaImpl ////////////////////////////////////////////////////////////////////////////////////////// @@ -1990,10 +1993,16 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_ } LL_WARNS_ONCE("Plugin") << "plugin initialization failed for mime type: " << media_type << LL_ENDL; - LLSD args; - args["MIME_TYPE"] = media_type; - LLNotificationsUtil::add("NoPlugin", args); - + if(gAgent.isInitialized()) + { + if (std::find(sMimeTypesFailed.begin(), sMimeTypesFailed.end(), media_type) == sMimeTypesFailed.end()) + { + LLSD args; + args["MIME_TYPE"] = media_type; + LLNotificationsUtil::add("NoPlugin", args); + sMimeTypesFailed.push_back(media_type); + } + } return NULL; } diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index ede408dd0c..268dcae20e 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -469,6 +469,7 @@ private: std::string mTarget; LLNotificationPtr mNotification; bool mCleanBrowser; // force the creation of a clean browsing target with full options enabled + static std::vector sMimeTypesFailed; private: BOOL mIsUpdated ; diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 1f6631f22d..06f34c35ae 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -2691,6 +2691,20 @@ static void god_message_name_cb(const LLAvatarName& av_name, LLChat chat, std::s } } +const std::string NOT_ONLINE_MSG("User not online - message will be stored and delivered later."); +const std::string NOT_ONLINE_INVENTORY("User not online - inventory has been saved."); +void translate_if_needed(std::string& message) +{ + if (message == NOT_ONLINE_MSG) + { + message = LLTrans::getString("not_online_msg"); + } + else if (message == NOT_ONLINE_INVENTORY) + { + message = LLTrans::getString("not_online_inventory"); + } +} + // FIRE-505: Group name not shown in notification well static void notification_group_name_cb(const std::string& group_name, const std::string& sender, @@ -2846,6 +2860,11 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) chat.mFromID = from_id; chat.mFromName = name; chat.mSourceType = (from_id.isNull() || (name == std::string(SYSTEM_FROM))) ? CHAT_SOURCE_SYSTEM : CHAT_SOURCE_AGENT; + + if (chat.mSourceType == CHAT_SOURCE_SYSTEM) + { // Translate server message if required (MAINT-6109) + translate_if_needed(message); + } LLViewerObject *source = gObjectList.findObject(session_id); //Session ID is probably the wrong thing. if (source) @@ -3809,6 +3828,10 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) send_do_not_disturb_message(msg, from_id); } // FIRE-1245: Option to block/reject teleport offers + //else if (gSavedSettings.getBOOL("VoiceCallsFriendsOnly") && (LLAvatarTracker::instance().getBuddyInfo(from_id) == NULL)) + //{ + // return; + //} else if ( (is_rejecting_tp_offers && (!FSDontRejectTeleportOffersFromFriends || (FSDontRejectTeleportOffersFromFriends && !is_friend))) && (!fRlvAutoAccept) ) { send_rejecting_tp_offers_message(msg, from_id); @@ -5134,6 +5157,13 @@ void process_teleport_finish(LLMessageSystem* msg, void**) LL_WARNS("Messaging") << "Got teleport notification for wrong agent!" << LL_ENDL; return; } + + if (gAgent.getTeleportState() == LLAgent::TELEPORT_NONE) + { + // Server either ignored teleport cancel message or did not receive it in time. + // This message can't be ignored since teleport is complete at server side + gAgent.restoreCanceledTeleportRequest(); + } // Teleport is finished; it can't be cancelled now. gViewerWindow->setProgressCancelButtonVisible(FALSE); @@ -9403,7 +9433,7 @@ void callback_load_url_name(const LLUUID& id, const std::string& full_name, bool args["URL"] = load_url_info["url"].asString(); args["MESSAGE"] = load_url_info["message"].asString(); args["OBJECTNAME"] = load_url_info["object_name"].asString(); - args["NAME"] = owner_name; + args["NAME_SLURL"] = LLSLURL(is_group ? "group" : "agent", id, "about").getSLURLString(); LLNotificationsUtil::add("LoadWebPage", args, load_url_info); } diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index b2b18c3c29..a11342233d 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -159,8 +159,8 @@ LLViewerParcelMgr::LLViewerParcelMgr() // JC: Resolved a merge conflict here, eliminated // mBlockedImage->setAddressMode(LLTexUnit::TAM_WRAP); // because it is done in llviewertexturelist.cpp - mBlockedImage = LLViewerTextureManager::getFetchedTextureFromFile("world/NoEntryLines.png"); - mPassImage = LLViewerTextureManager::getFetchedTextureFromFile("world/NoEntryPassLines.png"); + mBlockedImage = LLViewerTextureManager::getFetchedTextureFromFile("world/NoEntryLines.png", FTT_LOCAL_FILE, TRUE, LLGLTexture::BOOST_UI); + mPassImage = LLViewerTextureManager::getFetchedTextureFromFile("world/NoEntryPassLines.png", FTT_LOCAL_FILE, TRUE, LLGLTexture::BOOST_UI); S32 overlay_size = mParcelsPerEdge * mParcelsPerEdge / PARCEL_OVERLAY_CHUNKS; sPackedOverlay = new U8[overlay_size]; @@ -1513,6 +1513,7 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use BOOL region_deny_identified_override = false; // Deprecated BOOL region_deny_transacted_override = false; // Deprecated BOOL region_deny_age_unverified_override = false; + BOOL agent_parcel_update = false; // updating previous(existing) agent parcel S32 other_clean_time = 0; @@ -1611,6 +1612,18 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use // Actually extract the data. if (parcel) { + if (local_id == parcel_mgr.mAgentParcel->getLocalID()) + { + // Parcels in different regions can have same ids. + LLViewerRegion* parcel_region = LLWorld::getInstance()->getRegion(msg->getSender()); + LLViewerRegion* agent_region = gAgent.getRegion(); + if (parcel_region && agent_region && parcel_region->getRegionID() == agent_region->getRegionID()) + { + // we got an updated version of agent parcel + agent_parcel_update = true; + } + } + parcel->init(owner_id, FALSE, FALSE, FALSE, claim_date, claim_price_per_meter, rent_price_per_meter, @@ -1669,16 +1682,10 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use } } } - else if (local_id == parcel_mgr.mAgentParcel->getLocalID()) + else if (agent_parcel_update) { - // Parcels in different regions can have same ids. - LLViewerRegion* parcel_region = LLWorld::getInstance()->getRegion( msg->getSender() ); - LLViewerRegion* agent_region = gAgent.getRegion(); - if (parcel_region && agent_region && parcel_region->getRegionID() == agent_region->getRegionID()) - { - // updated agent parcel - parcel_mgr.mAgentParcel->unpackMessage(msg); - } + // updated agent parcel + parcel_mgr.mAgentParcel->unpackMessage(msg); } } @@ -1834,33 +1841,37 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use { if (parcel) { - std::string music_url_raw = parcel->getMusicURL(); + // Only update stream if parcel changed (recreated) or music is playing (enabled) + if (!agent_parcel_update || gSavedSettings.getBOOL("MediaTentativeAutoPlay")) + { + std::string music_url_raw = parcel->getMusicURL(); - // Trim off whitespace from front and back - std::string music_url = music_url_raw; - LLStringUtil::trim(music_url); + // Trim off whitespace from front and back + std::string music_url = music_url_raw; + LLStringUtil::trim(music_url); - // If there is a new music URL and it's valid, play it. - if (music_url.size() > 12) - { - if (music_url.substr(0,7) == "http://") - { - optionally_start_music(music_url); - } - else - { - LL_INFOS() << "Stopping parcel music (invalid audio stream URL)" << LL_ENDL; - // clears the URL - // null value causes fade out - LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLStringUtil::null); - } - } - else if (!gAudiop->getInternetStreamURL().empty()) - { - LL_INFOS() << "Stopping parcel music (parcel stream URL is empty)" << LL_ENDL; - // null value causes fade out - LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLStringUtil::null); - } + // If there is a new music URL and it's valid, play it. + if (music_url.size() > 12) + { + if (music_url.substr(0, 7) == "http://") + { + optionally_start_music(music_url); + } + else + { + LL_INFOS() << "Stopping parcel music (invalid audio stream URL)" << LL_ENDL; + // clears the URL + // null value causes fade out + LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLStringUtil::null); + } + } + else if (!gAudiop->getInternetStreamURL().empty()) + { + LL_INFOS() << "Stopping parcel music (parcel stream URL is empty)" << LL_ENDL; + // null value causes fade out + LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLStringUtil::null); + } + } } else { diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index 16c35854fd..195cc6ddba 100644 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -250,12 +250,12 @@ public: } } } - /*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRect& draw_rect) + /*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect) { - LLRect image_rect = draw_rect; + LLRectf image_rect = draw_rect; image_rect.mRight = image_rect.mLeft + mImage->getWidth(); image_rect.mTop = image_rect.mBottom + mImage->getHeight(); - mImage->draw(image_rect); + mImage->draw(LLRect(image_rect.mLeft, image_rect.mTop, image_rect.mRight, image_rect.mBottom)); LLColor4 color; if (mEditor.getReadOnly()) diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 9d88ad9aa8..d2fae10cbe 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -106,6 +106,7 @@ S32 LLViewerTexture::sMaxSculptRez = 128; //max sculpt image size const S32 MAX_CACHED_RAW_IMAGE_AREA = 64 * 64; const S32 MAX_CACHED_RAW_SCULPT_IMAGE_AREA = LLViewerTexture::sMaxSculptRez * LLViewerTexture::sMaxSculptRez; const S32 MAX_CACHED_RAW_TERRAIN_IMAGE_AREA = 128 * 128; +const S32 DEFAULT_ICON_DIMENTIONS = 32; S32 LLViewerTexture::sMinLargeImageSize = 65536; //256 * 256. S32 LLViewerTexture::sMaxSmallImageSize = MAX_CACHED_RAW_IMAGE_AREA; BOOL LLViewerTexture::sFreezeImageScalingDown = FALSE; @@ -139,7 +140,7 @@ LLLoadedCallbackEntry::LLLoadedCallbackEntry(loaded_callback_func cb, { if(mSourceCallbackList) { - mSourceCallbackList->insert(target->getID()); + mSourceCallbackList->insert(LLTextureKey(target->getID(), (ETexListType)target->getTextureListType())); } } @@ -151,7 +152,7 @@ void LLLoadedCallbackEntry::removeTexture(LLViewerFetchedTexture* tex) { if(mSourceCallbackList) { - mSourceCallbackList->erase(tex->getID()); + mSourceCallbackList->erase(LLTextureKey(tex->getID(), (ETexListType)tex->getTextureListType())); } } @@ -178,24 +179,39 @@ LLViewerMediaTexture* LLViewerTextureManager::createMediaTexture(const LLUUID &m { return new LLViewerMediaTexture(media_id, usemipmaps, gl_image); } - -LLViewerTexture* LLViewerTextureManager::findTexture(const LLUUID& id) + +void LLViewerTextureManager::findFetchedTextures(const LLUUID& id, std::vector &output) { - LLViewerTexture* tex; - //search fetched texture list - tex = gTextureList.findImage(id); - - //search media texture list - if(!tex) - { - tex = LLViewerTextureManager::findMediaTexture(id); - } - return tex; + return gTextureList.findTexturesByID(id, output); } -LLViewerFetchedTexture* LLViewerTextureManager::findFetchedTexture(const LLUUID& id) +void LLViewerTextureManager::findTextures(const LLUUID& id, std::vector &output) { - return gTextureList.findImage(id); + std::vector fetched_output; + gTextureList.findTexturesByID(id, fetched_output); + std::vector::iterator iter = fetched_output.begin(); + while (iter != fetched_output.end()) + { + output.push_back(*iter); + iter++; + } + + //search media texture list + if (output.empty()) + { + LLViewerTexture* tex; + tex = LLViewerTextureManager::findMediaTexture(id); + if (tex) + { + output.push_back(tex); + } + } + +} + +LLViewerFetchedTexture* LLViewerTextureManager::findFetchedTexture(const LLUUID& id, S32 tex_type) +{ + return gTextureList.findImage(id, (ETexListType)tex_type); } LLViewerMediaTexture* LLViewerTextureManager::findMediaTexture(const LLUUID &media_id) @@ -733,7 +749,8 @@ void LLViewerTexture::setBoostLevel(S32 level) { mBoostLevel = level; if(mBoostLevel != LLViewerTexture::BOOST_NONE && - mBoostLevel != LLViewerTexture::BOOST_SELECTED) + mBoostLevel != LLViewerTexture::BOOST_SELECTED && + mBoostLevel != LLViewerTexture::BOOST_ICON) { setNoDelete(); } @@ -1214,6 +1231,17 @@ void LLViewerFetchedTexture::loadFromFastCache() } else { + if (mBoostLevel == LLGLTexture::BOOST_ICON) + { + S32 expected_width = mKnownDrawWidth > 0 ? mKnownDrawWidth : DEFAULT_ICON_DIMENTIONS; + S32 expected_height = mKnownDrawHeight > 0 ? mKnownDrawHeight : DEFAULT_ICON_DIMENTIONS; + if (mRawImage->getWidth() > expected_width || mRawImage->getHeight() > expected_height) + { + // scale oversized icon, no need to give more work to gl + mRawImage->scale(expected_width, expected_height); + } + } + mRequestedDiscardLevel = mDesiredDiscardLevel + 1; mIsRawImageValid = TRUE; addToCreateTexture(); @@ -1266,10 +1294,7 @@ void LLViewerFetchedTexture::setDeletionCandidate() //set the texture inactive void LLViewerFetchedTexture::setInactive() { - // Try to plug the profile icon memory hole - //if(mTextureState == ACTIVE && mGLTexturep.notNull() && mGLTexturep->getTexName() && !mGLTexturep->getBoundRecently()) - if((mTextureState == ACTIVE || (mTextureState == NO_DELETE && mBoostLevel == BOOST_ICON)) && mGLTexturep.notNull() && mGLTexturep->getTexName() && !mGLTexturep->getBoundRecently()) - // + if(mTextureState == ACTIVE && mGLTexturep.notNull() && mGLTexturep->getTexName() && !mGLTexturep->getBoundRecently()) { mTextureState = INACTIVE; } @@ -1585,6 +1610,17 @@ void LLViewerFetchedTexture::processTextureStats() { mDesiredDiscardLevel = 0; } + else if (mDontDiscard && mBoostLevel == LLGLTexture::BOOST_ICON) + { + if (mFullWidth > MAX_IMAGE_SIZE_DEFAULT || mFullHeight > MAX_IMAGE_SIZE_DEFAULT) + { + mDesiredDiscardLevel = 1; // MAX_IMAGE_SIZE_DEFAULT = 1024 and max size ever is 2048 + } + else + { + mDesiredDiscardLevel = 0; + } + } else if(!mFullWidth || !mFullHeight) { mDesiredDiscardLevel = llmin(getMaxDiscardLevel(), (S32)mLoadedCallbackDesiredDiscardLevel); @@ -2043,6 +2079,17 @@ bool LLViewerFetchedTexture::updateFetch() addToCreateTexture(); } + if (mBoostLevel == LLGLTexture::BOOST_ICON) + { + S32 expected_width = mKnownDrawWidth > 0 ? mKnownDrawWidth : DEFAULT_ICON_DIMENTIONS; + S32 expected_height = mKnownDrawHeight > 0 ? mKnownDrawHeight : DEFAULT_ICON_DIMENTIONS; + if (mRawImage->getWidth() > expected_width || mRawImage->getHeight() > expected_height) + { + // scale oversized icon, no need to give more work to gl + mRawImage->scale(expected_width, expected_height); + } + } + return TRUE; } else @@ -2784,7 +2831,7 @@ LLImageRaw* LLViewerFetchedTexture::reloadRawImage(S8 discard_level) if(mSavedRawDiscardLevel >= 0 && mSavedRawDiscardLevel <= discard_level) { - if(mSavedRawDiscardLevel != discard_level) + if (mSavedRawDiscardLevel != discard_level && mBoostLevel != BOOST_ICON) { mRawImage = new LLImageRaw(getWidth(discard_level), getHeight(discard_level), getComponents()); mRawImage->copy(getSavedRawImage()); @@ -2885,8 +2932,25 @@ void LLViewerFetchedTexture::switchToCachedImage() void LLViewerFetchedTexture::setCachedRawImage(S32 discard_level, LLImageRaw* imageraw) { if(imageraw != mRawImage.get()) - { - mCachedRawImage = imageraw; + { + if (mBoostLevel == LLGLTexture::BOOST_ICON) + { + S32 expected_width = mKnownDrawWidth > 0 ? mKnownDrawWidth : DEFAULT_ICON_DIMENTIONS; + S32 expected_height = mKnownDrawHeight > 0 ? mKnownDrawHeight : DEFAULT_ICON_DIMENTIONS; + if (mRawImage->getWidth() > expected_width || mRawImage->getHeight() > expected_height) + { + mCachedRawImage = new LLImageRaw(expected_width, expected_height, imageraw->getComponents()); + mCachedRawImage->copyScaled(imageraw); + } + else + { + mCachedRawImage = imageraw; + } + } + else + { + mCachedRawImage = imageraw; + } mCachedRawDiscardLevel = discard_level; mCachedRawImageReady = TRUE; } @@ -2976,7 +3040,24 @@ void LLViewerFetchedTexture::saveRawImage() } mSavedRawDiscardLevel = mRawDiscardLevel; - mSavedRawImage = new LLImageRaw(mRawImage->getData(), mRawImage->getWidth(), mRawImage->getHeight(), mRawImage->getComponents()); + if (mBoostLevel == LLGLTexture::BOOST_ICON) + { + S32 expected_width = mKnownDrawWidth > 0 ? mKnownDrawWidth : DEFAULT_ICON_DIMENTIONS; + S32 expected_height = mKnownDrawHeight > 0 ? mKnownDrawHeight : DEFAULT_ICON_DIMENTIONS; + if (mRawImage->getWidth() > expected_width || mRawImage->getHeight() > expected_height) + { + mSavedRawImage = new LLImageRaw(expected_width, expected_height, mRawImage->getComponents()); + mSavedRawImage->copyScaled(mRawImage); + } + else + { + mSavedRawImage = new LLImageRaw(mRawImage->getData(), mRawImage->getWidth(), mRawImage->getHeight(), mRawImage->getComponents()); + } + } + else + { + mSavedRawImage = new LLImageRaw(mRawImage->getData(), mRawImage->getWidth(), mRawImage->getHeight(), mRawImage->getComponents()); + } if(mForceToSaveRawImage && mSavedRawDiscardLevel <= mDesiredSavedRawDiscardLevel) { @@ -3353,7 +3434,7 @@ LLViewerMediaTexture::LLViewerMediaTexture(const LLUUID& id, BOOL usemipmaps, LL setCategory(LLGLTexture::MEDIA); - LLViewerTexture* tex = gTextureList.findImage(mID); + LLViewerTexture* tex = gTextureList.findImage(mID, TEX_LIST_DISCARD); if(tex) //this media is a parcel media for tex. { tex->setParcelMedia(this); @@ -3363,7 +3444,7 @@ LLViewerMediaTexture::LLViewerMediaTexture(const LLUUID& id, BOOL usemipmaps, LL //virtual LLViewerMediaTexture::~LLViewerMediaTexture() { - LLViewerTexture* tex = gTextureList.findImage(mID); + LLViewerTexture* tex = gTextureList.findImage(mID, TEX_LIST_DISCARD); if(tex) //this media is a parcel media for tex. { tex->setParcelMedia(NULL); @@ -3418,7 +3499,7 @@ BOOL LLViewerMediaTexture::findFaces() BOOL ret = TRUE; - LLViewerTexture* tex = gTextureList.findImage(mID); + LLViewerTexture* tex = gTextureList.findImage(mID, TEX_LIST_DISCARD); if(tex) //this media is a parcel media for tex. { for (U32 ch = 0; ch < LLRender::NUM_TEXTURE_CHANNELS; ++ch) @@ -3527,7 +3608,7 @@ void LLViewerMediaTexture::addFace(U32 ch, LLFace* facep) const LLTextureEntry* te = facep->getTextureEntry(); if(te && te->getID().notNull()) { - LLViewerTexture* tex = gTextureList.findImage(te->getID()); + LLViewerTexture* tex = gTextureList.findImage(te->getID(), TEX_LIST_DISCARD); if(tex) { mTextureList.push_back(tex);//increase the reference number by one for tex to avoid deleting it. @@ -3556,7 +3637,7 @@ void LLViewerMediaTexture::removeFace(U32 ch, LLFace* facep) const LLTextureEntry* te = facep->getTextureEntry(); if(te && te->getID().notNull()) { - LLViewerTexture* tex = gTextureList.findImage(te->getID()); + LLViewerTexture* tex = gTextureList.findImage(te->getID(), TEX_LIST_DISCARD); if(tex) { for(std::list< LLPointer >::iterator iter = mTextureList.begin(); @@ -3696,10 +3777,10 @@ void LLViewerMediaTexture::switchTexture(U32 ch, LLFace* facep) const LLTextureEntry* te = facep->getTextureEntry(); if(te) { - LLViewerTexture* tex = te->getID().notNull() ? gTextureList.findImage(te->getID()) : NULL; + LLViewerTexture* tex = te->getID().notNull() ? gTextureList.findImage(te->getID(), TEX_LIST_DISCARD) : NULL; if(!tex && te->getID() != mID)//try parcel media. { - tex = gTextureList.findImage(mID); + tex = gTextureList.findImage(mID, TEX_LIST_DISCARD); } if(!tex) { diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 31e3e79193..3119ea442e 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -58,11 +58,12 @@ class LLVFile; class LLMessageSystem; class LLViewerMediaImpl ; class LLVOVolume ; +struct LLTextureKey; class LLLoadedCallbackEntry { public: - typedef std::set< LLUUID > source_callback_list_t; + typedef std::set< LLTextureKey > source_callback_list_t; public: LLLoadedCallbackEntry(loaded_callback_func cb, @@ -132,6 +133,8 @@ public: /*virtual*/ const LLUUID& getID() const { return mID; } void setBoostLevel(S32 level); S32 getBoostLevel() { return mBoostLevel; } + void setTextureListType(S32 tex_type) { mTextureListType = tex_type; } + S32 getTextureListType() { return mTextureListType; } void addTextureStats(F32 virtual_size, BOOL needs_gltexture = TRUE) const; void resetTextureStats(); @@ -185,6 +188,8 @@ private: static bool isMemoryForTextureLow() ; protected: LLUUID mID; + S32 mTextureListType; // along with mID identifies where to search for this texture in TextureList + F32 mSelectedTime; // time texture was last selected mutable F32 mMaxVirtualSize; // The largest virtual size of the image, in pixels - how much data to we need? mutable S32 mMaxVirtualSizeResetCounter ; @@ -651,8 +656,9 @@ public: // //"find-texture" just check if the texture exists, if yes, return it, otherwise return null. // - static LLViewerTexture* findTexture(const LLUUID& id) ; - static LLViewerFetchedTexture* findFetchedTexture(const LLUUID& id) ; + static void findFetchedTextures(const LLUUID& id, std::vector &output); + static void findTextures(const LLUUID& id, std::vector &output); + static LLViewerFetchedTexture* findFetchedTexture(const LLUUID& id, S32 tex_type); static LLViewerMediaTexture* findMediaTexture(const LLUUID& id) ; static LLViewerMediaTexture* createMediaTexture(const LLUUID& id, BOOL usemipmaps = TRUE, LLImageGL* gl_image = NULL) ; diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 44534b2b8a..ab89e822a9 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -73,6 +73,29 @@ U32 LLViewerTextureList::sNumFastCacheReads = 0; LLViewerTextureList gTextureList; static LLTrace::BlockTimerStatHandle FTM_PROCESS_IMAGES("Process Images"); +ETexListType get_element_type(S32 priority) +{ + // don't discard flag can be used in some cases, but it usually is not set yet + if (priority == LLViewerFetchedTexture::BOOST_ICON + || priority == LLViewerFetchedTexture::BOOST_UI) + { + return TEX_LIST_UI; + } + return TEX_LIST_DISCARD; +} + +/////////////////////////////////////////////////////////////////////////////// + +LLTextureKey::LLTextureKey() +: textureId(LLUUID::null), +textureType(TEX_LIST_DISCARD) +{ +} + +LLTextureKey::LLTextureKey(LLUUID id, ETexListType tex_type) +: textureId(id), textureType(tex_type) +{ +} /////////////////////////////////////////////////////////////////////////////// @@ -354,7 +377,8 @@ LLViewerFetchedTexture* LLViewerTextureList::getImageFromFile(const std::string& if (full_path.empty()) { LL_WARNS() << "Failed to find local image file: " << filename << LL_ENDL; - return LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_UI); + LLViewerTexture::EBoostLevel priority = LLGLTexture::BOOST_UI; + return LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT, FTT_DEFAULT, TRUE, priority); } std::string url = "file://" + full_path; @@ -387,7 +411,7 @@ LLViewerFetchedTexture* LLViewerTextureList::getImageFromUrl(const std::string& new_id.generate(url); } - LLPointer imagep = findImage(new_id); + LLPointer imagep = findImage(new_id, get_element_type(boost_priority)); if (!imagep.isNull()) { @@ -425,15 +449,21 @@ LLViewerFetchedTexture* LLViewerTextureList::getImageFromUrl(const std::string& imagep->setExplicitFormat(internal_format, primary_format); } - addImage(imagep); - + addImage(imagep, get_element_type(boost_priority)); + if (boost_priority != 0) { - if (boost_priority == LLViewerFetchedTexture::BOOST_UI || - boost_priority == LLViewerFetchedTexture::BOOST_ICON) + if (boost_priority == LLViewerFetchedTexture::BOOST_UI) { imagep->dontDiscard(); } + if (boost_priority == LLViewerFetchedTexture::BOOST_ICON) + { + // Agent and group Icons are downloadable content, nothing manages + // icon deletion yet, so they should not persist + imagep->dontDiscard(); + imagep->forceActive(); + } imagep->setBoostLevel(boost_priority); } } @@ -467,7 +497,7 @@ LLViewerFetchedTexture* LLViewerTextureList::getImage(const LLUUID &image_id, return (LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_UI)); } - LLPointer imagep = findImage(image_id); + LLPointer imagep = findImage(image_id, get_element_type(boost_priority)); if (!imagep.isNull()) { LLViewerFetchedTexture *texture = imagep.get(); @@ -528,16 +558,22 @@ LLViewerFetchedTexture* LLViewerTextureList::createImage(const LLUUID &image_id, { imagep->setExplicitFormat(internal_format, primary_format); } - - addImage(imagep); - + + addImage(imagep, get_element_type(boost_priority)); + if (boost_priority != 0) { - if (boost_priority == LLViewerFetchedTexture::BOOST_UI || - boost_priority == LLViewerFetchedTexture::BOOST_ICON) + if (boost_priority == LLViewerFetchedTexture::BOOST_UI) { imagep->dontDiscard(); } + if (boost_priority == LLViewerFetchedTexture::BOOST_ICON) + { + // Agent and group Icons are downloadable content, nothing manages + // icon deletion yet, so they should not persist. + imagep->dontDiscard(); + imagep->forceActive(); + } imagep->setBoostLevel(boost_priority); } else @@ -556,12 +592,28 @@ LLViewerFetchedTexture* LLViewerTextureList::createImage(const LLUUID &image_id, return imagep ; } -LLViewerFetchedTexture *LLViewerTextureList::findImage(const LLUUID &image_id) +void LLViewerTextureList::findTexturesByID(const LLUUID &image_id, std::vector &output) { - uuid_map_t::iterator iter = mUUIDMap.find(image_id); - if(iter == mUUIDMap.end()) - return NULL; - return iter->second; + LLTextureKey search_key(image_id, TEX_LIST_DISCARD); + uuid_map_t::iterator iter = mUUIDMap.lower_bound(search_key); + while (iter != mUUIDMap.end() && iter->first.textureId == image_id) + { + output.push_back(iter->second); + iter++; + } +} + +LLViewerFetchedTexture *LLViewerTextureList::findImage(const LLTextureKey &search_key) +{ + uuid_map_t::iterator iter = mUUIDMap.find(search_key); + if (iter == mUUIDMap.end()) + return NULL; + return iter->second; +} + +LLViewerFetchedTexture *LLViewerTextureList::findImage(const LLUUID &image_id, ETexListType tex_type) +{ + return findImage(LLTextureKey(image_id, tex_type)); } void LLViewerTextureList::addImageToList(LLViewerFetchedTexture *image) @@ -606,7 +658,7 @@ void LLViewerTextureList::removeImageFromList(LLViewerFetchedTexture *image) << " but doesn't have mInImageList set" << " ref count is " << image->getNumRefs() << LL_ENDL; - uuid_map_t::iterator iter = mUUIDMap.find(image->getID()); + uuid_map_t::iterator iter = mUUIDMap.find(LLTextureKey(image->getID(), (ETexListType)image->getTextureListType())); if(iter == mUUIDMap.end()) { LL_INFOS() << "Image " << image->getID() << " is also not in mUUIDMap!" << LL_ENDL ; @@ -631,7 +683,7 @@ void LLViewerTextureList::removeImageFromList(LLViewerFetchedTexture *image) image->setInImageList(FALSE) ; } -void LLViewerTextureList::addImage(LLViewerFetchedTexture *new_image) +void LLViewerTextureList::addImage(LLViewerFetchedTexture *new_image, ETexListType tex_type) { if (!new_image) { @@ -639,16 +691,18 @@ void LLViewerTextureList::addImage(LLViewerFetchedTexture *new_image) } //llassert(new_image); LLUUID image_id = new_image->getID(); + LLTextureKey key(image_id, tex_type); - LLViewerFetchedTexture *image = findImage(image_id); + LLViewerFetchedTexture *image = findImage(key); if (image) { LL_INFOS() << "Image with ID " << image_id << " already in list" << LL_ENDL; } sNumImages++; - + addImageToList(new_image); - mUUIDMap[image_id] = new_image; + mUUIDMap[key] = new_image; + new_image->setTextureListType(tex_type); } @@ -660,8 +714,8 @@ void LLViewerTextureList::deleteImage(LLViewerFetchedTexture *image) { mCallbackList.erase(image); } - - llverify(mUUIDMap.erase(image->getID()) == 1); + LLTextureKey key(image->getID(), (ETexListType)image->getTextureListType()); + llverify(mUUIDMap.erase(key) == 1); sNumImages--; removeImageFromList(image); } @@ -808,14 +862,14 @@ void LLViewerTextureList::updateImagesDecodePriorities() static const S32 MAX_PRIO_UPDATES = gSavedSettings.getS32("TextureFetchUpdatePriorities"); // default: 32 const size_t max_update_count = llmin((S32) (MAX_PRIO_UPDATES*MAX_PRIO_UPDATES*gFrameIntervalSeconds.value()) + 1, MAX_PRIO_UPDATES); S32 update_counter = llmin(max_update_count, mUUIDMap.size()); - uuid_map_t::iterator iter = mUUIDMap.upper_bound(mLastUpdateUUID); + uuid_map_t::iterator iter = mUUIDMap.upper_bound(mLastUpdateKey); while ((update_counter-- > 0) && !mUUIDMap.empty()) { if (iter == mUUIDMap.end()) { iter = mUUIDMap.begin(); - } - mLastUpdateUUID = iter->first; + } + mLastUpdateKey = iter->first; LLPointer imagep = iter->second; ++iter; // safe to increment now @@ -1071,7 +1125,7 @@ F32 LLViewerTextureList::updateImagesFetchTextures(F32 max_time) update_counter = max_update_count; if(update_counter > 0) { - uuid_map_t::iterator iter2 = mUUIDMap.upper_bound(mLastFetchUUID); + uuid_map_t::iterator iter2 = mUUIDMap.upper_bound(mLastFetchKey); while ((update_counter > 0) && (total_update_count > 0)) { if (iter2 == mUUIDMap.end()) @@ -1101,7 +1155,7 @@ F32 LLViewerTextureList::updateImagesFetchTextures(F32 max_time) fetch_count += (imagep->updateFetch() ? 1 : 0); if (min_count <= min_update_count) { - mLastFetchUUID = imagep->getID(); + mLastFetchKey = LLTextureKey(imagep->getID(), (ETexListType)imagep->getTextureListType()); } if ((min_count-- <= 0) && (image_op_timer.getElapsedTimeF32() > max_time)) { @@ -1616,12 +1670,19 @@ void LLViewerTextureList::processImageNotInDatabase(LLMessageSystem *msg,void ** LLUUID image_id; msg->getUUIDFast(_PREHASH_ImageID, _PREHASH_ID, image_id); - LLViewerFetchedTexture* image = gTextureList.findImage( image_id ); + LLViewerFetchedTexture* image = gTextureList.findImage( image_id, TEX_LIST_DISCARD); if( image ) { - LL_WARNS() << "not in db" << LL_ENDL; + LL_WARNS() << "Image not in db" << LL_ENDL; image->setIsMissingAsset(); } + + image = gTextureList.findImage(image_id, TEX_LIST_UI); + if (image) + { + LL_WARNS() << "Icon not in db" << LL_ENDL; + image->setIsMissingAsset(); + } } @@ -1703,14 +1764,18 @@ LLUIImagePtr LLUIImageList::loadUIImage(LLViewerFetchedTexture* imagep, const st //don't compress UI images imagep->getGLTexture()->setAllowCompression(false); - //all UI images are non-deletable - imagep->setNoDelete(); - LLUIImagePtr new_imagep = new LLUIImage(name, imagep); new_imagep->setScaleStyle(scale_style); - mUIImages.insert(std::make_pair(name, new_imagep)); - mUITextureList.push_back(imagep); + if (imagep->getBoostLevel() != LLGLTexture::BOOST_ICON && + imagep->getBoostLevel() != LLGLTexture::BOOST_PREVIEW) + { + // Don't add downloadable content into this list + // all UI images are non-deletable and list does not support deletion + imagep->setNoDelete(); + mUIImages.insert(std::make_pair(name, new_imagep)); + mUITextureList.push_back(imagep); + } //Note: //Some other textures such as ICON also through this flow to be fetched. diff --git a/indra/newview/llviewertexturelist.h b/indra/newview/llviewertexturelist.h index d05b65f3cc..0f3cc0e825 100644 --- a/indra/newview/llviewertexturelist.h +++ b/indra/newview/llviewertexturelist.h @@ -59,6 +59,32 @@ typedef void (*LLImageCallback)(BOOL success, BOOL final, void* userdata); +enum ETexListType +{ + TEX_LIST_DISCARD = 0, + TEX_LIST_UI +}; + +struct LLTextureKey +{ + LLTextureKey(); + LLTextureKey(LLUUID id, ETexListType tex_type); + LLUUID textureId; + ETexListType textureType; + + friend bool operator<(const LLTextureKey& key1, const LLTextureKey& key2) + { + if (key1.textureId != key2.textureId) + { + return key1.textureId < key2.textureId; + } + else + { + return key1.textureType < key2.textureType; + } + } +}; + class LLViewerTextureList { friend class LLTextureView; @@ -83,7 +109,9 @@ public: void restoreGL(); BOOL isInitialized() const {return mInitialized;} - LLViewerFetchedTexture *findImage(const LLUUID &image_id); + void findTexturesByID(const LLUUID &image_id, std::vector &output); + LLViewerFetchedTexture *findImage(const LLUUID &image_id, ETexListType tex_type); + LLViewerFetchedTexture *findImage(const LLTextureKey &search_key); void dirtyImage(LLViewerFetchedTexture *image); @@ -122,7 +150,7 @@ private: void updateImagesUpdateStats(); F32 updateImagesLoadingFastCache(F32 max_time); - void addImage(LLViewerFetchedTexture *image); + void addImage(LLViewerFetchedTexture *image, ETexListType tex_type); void deleteImage(LLViewerFetchedTexture *image); void addImageToList(LLViewerFetchedTexture *image); @@ -189,10 +217,10 @@ public: static U32 sNumFastCacheReads; private: - typedef std::map< LLUUID, LLPointer > uuid_map_t; - uuid_map_t mUUIDMap; - LLUUID mLastUpdateUUID; - LLUUID mLastFetchUUID; + typedef std::map< LLTextureKey, LLPointer > uuid_map_t; + uuid_map_t mUUIDMap; + LLTextureKey mLastUpdateKey; + LLTextureKey mLastFetchKey; typedef std::set, LLViewerFetchedTexture::Compare> image_priority_list_t; image_priority_list_t mImageList; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 444e4d8e3c..52a6af759a 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2084,7 +2084,7 @@ LLViewerFetchedTexture *LLVOAvatar::getBakedTextureImage(const U8 te, const LLUU uuid == IMG_INVISIBLE) { // Should already exist, don't need to find it on sim or baked-texture host. - result = gTextureList.findImage(uuid); + result = gTextureList.findImage(uuid, TEX_LIST_DISCARD); } if (!result) { @@ -4767,7 +4767,7 @@ bool LLVOAvatar::allTexturesCompletelyDownloaded(std::set& ids) const { for (std::set::const_iterator it = ids.begin(); it != ids.end(); ++it) { - LLViewerFetchedTexture *imagep = gTextureList.findImage(*it); + LLViewerFetchedTexture *imagep = gTextureList.findImage(*it, TEX_LIST_DISCARD); if (imagep && imagep->getDiscardLevel()!=0) { return false; @@ -4839,7 +4839,7 @@ S32Bytes LLVOAvatar::totalTextureMemForUUIDS(std::set& ids) S32Bytes result(0); for (std::set::const_iterator it = ids.begin(); it != ids.end(); ++it) { - LLViewerFetchedTexture *imagep = gTextureList.findImage(*it); + LLViewerFetchedTexture *imagep = gTextureList.findImage(*it, TEX_LIST_DISCARD); if (imagep) { result += imagep->getTextureMemory(); @@ -4927,7 +4927,7 @@ void LLVOAvatar::releaseOldTextures() { if (new_texture_ids.find(*it) == new_texture_ids.end()) { - LLViewerFetchedTexture *imagep = gTextureList.findImage(*it); + LLViewerFetchedTexture *imagep = gTextureList.findImage(*it, TEX_LIST_DISCARD); if (imagep) { current_texture_mem += imagep->getTextureMemory(); @@ -8605,7 +8605,6 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara LLFilePicker& file_picker = LLFilePicker::instance(); if(!file_picker.getSaveFile(LLFilePicker::FFSAVE_XML, outfilename)) { - LL_INFOS("DumpArchetypeXML") << "User closed the filepicker" << LL_ENDL; return; } // @@ -8622,10 +8621,7 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara LLAPRFile::tFiletype* file = outfile.getFileHandle(); // - // FIRE-8893 - Dump archetype xml to user defined location - //LL_INFOS() << "xmlfile write handle obtained : " << fullpath << LL_ENDL; - LL_INFOS("DumpArchetypeXML") << "xmlfile write handle obtained : " << fullpath << LL_ENDL; - // + LL_INFOS() << "xmlfile write handle obtained : " << fullpath << LL_ENDL; apr_file_printf( file, "\n" ); apr_file_printf( file, "\n" ); @@ -8727,13 +8723,13 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara // show the cloned params inside the wearables as well. gAgentAvatarp->dumpWearableInfo(outfile); } - - // FIRE-8893 - Dump archetype xml to user defined location - LL_INFOS("DumpArchetypeXML") << "Archetype xml written successfully!" << LL_ENDL; LLSD args; - args["FILENAME"] = fullpath; - LLNotificationsUtil::add("DumpArchetypeSuccess", args); - // + args["PATH"] = fullpath; + LLNotificationsUtil::add("AppearanceToXMLSaved", args); + } + else + { + LLNotificationsUtil::add("AppearanceToXMLFailed"); } // File will close when handle goes out of scope } @@ -9498,7 +9494,7 @@ void LLVOAvatar::bakedTextureOriginCounts(S32 &sb_count, // server-bake, has ori collectBakedTextureUUIDs(baked_ids); for (std::set::const_iterator it = baked_ids.begin(); it != baked_ids.end(); ++it) { - LLViewerFetchedTexture *imagep = gTextureList.findImage(*it); + LLViewerFetchedTexture *imagep = gTextureList.findImage(*it, TEX_LIST_DISCARD); bool has_url = false, has_host = false; if (!imagep->getUrl().empty()) { diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index f849ac6ad8..b7ce5d2655 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -2177,12 +2177,9 @@ bool LLVOVolume::notifyAboutMissingAsset(LLViewerTexture *texture) for(mmap_UUID_MAP_t::iterator range_it = range.first; range_it != range.second; ++range_it) { LLMaterialPtr cur_material = getTEMaterialParams(range_it->second.te); - // Possible crash fix by Drake Arconis if (cur_material.isNull()) - { continue; - } - // + switch(range_it->second.map) { case LLRender::DIFFUSE_MAP: @@ -3991,10 +3988,7 @@ BOOL LLVOVolume::lineSegmentIntersect(const LLVector4a& start, const LLVector4a& if (mDrawable->isState(LLDrawable::RIGGED)) { -// if ((pick_rigged) || ((getAvatar()->isSelf()) && (LLFloater::isVisible(gFloaterTools)))) -// [SL:KB] - Patch: UI-PickRiggedAttachment | Checked: 2012-07-12 (Catznip-3.3) - if ((pick_rigged) || (getAvatar() && getAvatar()->isSelf() && (LLFloater::isVisible(gFloaterTools)))) -// [/SL:KB] + if ((pick_rigged) || (getAvatar() && (getAvatar()->isSelf()) && (LLFloater::isVisible(gFloaterTools)))) { updateRiggedVolume(true); volume = mRiggedVolume; diff --git a/indra/newview/llwatchdog.cpp b/indra/newview/llwatchdog.cpp index 5094bcd358..d6c98b1485 100644 --- a/indra/newview/llwatchdog.cpp +++ b/indra/newview/llwatchdog.cpp @@ -128,11 +128,17 @@ void LLWatchdogTimeout::setTimeout(F32 d) void LLWatchdogTimeout::start(const char *state) // { - // Order of operation is very impmortant here. + if (mTimeout == 0) + { + LL_WARNS() << "Cant' start watchdog entry - no timeout set" << LL_ENDL; + return; + } + // Order of operation is very important here. // After LLWatchdogEntry::start() is called // LLWatchdogTimeout::isAlive() will be called asynchronously. ping(state); - mTimer.start(); + mTimer.start(); + mTimer.setTimerExpirySec(mTimeout); // timer expiration set to 0 by start() LLWatchdogEntry::start(); } @@ -242,7 +248,6 @@ void LLWatchdog::run() mSuspects.end(), std::not1(std::mem_fun(&LLWatchdogEntry::isAlive)) ); - if(result != mSuspects.end()) { // error!!! diff --git a/indra/newview/llwearableitemslist.h b/indra/newview/llwearableitemslist.h index f6cb6b5314..18a30f083b 100644 --- a/indra/newview/llwearableitemslist.h +++ b/indra/newview/llwearableitemslist.h @@ -421,10 +421,7 @@ public: MASK_BODYPART = 0x02, MASK_ATTACHMENT = 0x04, MASK_GESTURE = 0x08, - // Fix hexadecimal arithmetics brain fart - //MASK_UNKNOWN = 0x16, - MASK_UNKNOWN = 0x10 - // + MASK_UNKNOWN = 0x10, }; /* virtual */ LLContextMenu* createMenu(); diff --git a/indra/newview/llworldmap.cpp b/indra/newview/llworldmap.cpp index 10a72fd226..7ccf03f7f4 100644 --- a/indra/newview/llworldmap.cpp +++ b/indra/newview/llworldmap.cpp @@ -87,7 +87,7 @@ void LLSimInfo::setLandForSaleImage (LLUUID image_id) // Aurora Sim if (mMapImageID.isNull() && image_id.notNull()) { - mOverlayImage = LLViewerTextureManager::findFetchedTexture(image_id); + mOverlayImage = LLViewerTextureManager::findFetchedTexture(image_id, TEX_LIST_DISCARD); if(mOverlayImage.notNull()) { LLAppViewer::getTextureCache()->removeFromCache(image_id); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 0d2d6fa223..56aa1fe84b 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -6201,7 +6201,9 @@ void LLPipeline::calcNearbyLights(LLCamera& camera) const Light* light = &(*iter); LLDrawable* drawable = light->drawable; const LLViewerObject *vobj = light->drawable->getVObj(); - if(vobj && vobj->getAvatar() && vobj->getAvatar()->isTooComplex()) + if(vobj && vobj->getAvatar() + && (vobj->getAvatar()->isTooComplex() || vobj->getAvatar()->isInMuteList()) + ) { drawable->clearState(LLDrawable::NEARBY_LIGHT); continue; @@ -8756,6 +8758,11 @@ void LLPipeline::renderDeferredLighting() } } + const LLViewerObject *vobj = drawablep->getVObj(); + if(vobj && vobj->getAvatar() && vobj->getAvatar()->isInMuteList()) + { + continue; + } LLVector4a center; center.load3(drawablep->getPositionAgent().mV); diff --git a/indra/newview/skins/default/xui/da/notifications.xml b/indra/newview/skins/default/xui/da/notifications.xml index 935fc92170..8aba079563 100644 --- a/indra/newview/skins/default/xui/da/notifications.xml +++ b/indra/newview/skins/default/xui/da/notifications.xml @@ -1446,7 +1446,7 @@ Hvis du ikke forlader regionen, vil du blive logget af. [MESSAGE] -Fra objekt: <nolink>[OBJECTNAME]</nolink>, ejer: [NAME]? +Fra objekt: <nolink>[OBJECTNAME]</nolink>, ejer: [NAME_SLURL]?