diff options
Diffstat (limited to 'indra')
239 files changed, 3058 insertions, 1670 deletions
diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index 84947adaae..a6fd756c88 100755 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -70,76 +70,87 @@ if(WINDOWS) # Copy MS C runtime dlls, required for packaging. # *TODO - Adapt this to support VC9 if (MSVC80) - set(MSVC_VER 80) - set(MSVC_VERDOT 8.0) + list(APPEND LMSVC_VER 80) + list(APPEND LMSVC_VERDOT 8.0) elseif (MSVC_VERSION EQUAL 1600) # VisualStudio 2010 - set(MSVC_VER 100) - set(MSVC_VERDOT 10.0) + MESSAGE(STATUS "MSVC_VERSION ${MSVC_VERSION}") elseif (MSVC_VERSION EQUAL 1800) # VisualStudio 2013, which is (sigh) VS 12 - set(MSVC_VER 120) - set(MSVC_VERDOT 12.0) + list(APPEND LMSVC_VER 120) + list(APPEND LMSVC_VERDOT 12.0) else (MSVC80) MESSAGE(WARNING "New MSVC_VERSION ${MSVC_VERSION} of MSVC: adapt Copy3rdPartyLibs.cmake") endif (MSVC80) - FIND_PATH(debug_msvc_redist_path msvcr${MSVC_VER}d.dll - PATHS - ${MSVC_DEBUG_REDIST_PATH} - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\${MSVC_VERDOT}\\Setup\\VC;ProductDir]/redist/Debug_NonRedist/x86/Microsoft.VC${MSVC_VER}.DebugCRT - [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Windows;Directory]/SysWOW64 - [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Windows;Directory]/System32 - NO_DEFAULT_PATH - ) - - if(EXISTS ${debug_msvc_redist_path}) - set(debug_msvc_files - msvcr${MSVC_VER}d.dll - msvcp${MSVC_VER}d.dll - ) - - copy_if_different( - ${debug_msvc_redist_path} - "${SHARED_LIB_STAGING_DIR_DEBUG}" - out_targets - ${debug_msvc_files} - ) - set(third_party_targets ${third_party_targets} ${out_targets}) - - endif () - - FIND_PATH(release_msvc_redist_path msvcr${MSVC_VER}.dll - PATHS - ${MSVC_REDIST_PATH} - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\${MSVC_VERDOT}\\Setup\\VC;ProductDir]/redist/x86/Microsoft.VC${MSVC_VER}.CRT - [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Windows;Directory]/SysWOW64 - [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Windows;Directory]/System32 - NO_DEFAULT_PATH - ) - - if(EXISTS ${release_msvc_redist_path}) - set(release_msvc_files - msvcr${MSVC_VER}.dll - msvcp${MSVC_VER}.dll - ) - - copy_if_different( - ${release_msvc_redist_path} - "${SHARED_LIB_STAGING_DIR_RELEASE}" - out_targets - ${release_msvc_files} + # try to copy VS2010 redist independently of system version + list(APPEND LMSVC_VER 100) + list(APPEND LMSVC_VERDOT 10.0) + + list(LENGTH LMSVC_VER count) + math(EXPR count "${count}-1") + foreach(i RANGE ${count}) + list(GET LMSVC_VER ${i} MSVC_VER) + list(GET LMSVC_VERDOT ${i} MSVC_VERDOT) + MESSAGE(STATUS "Copying redist libs for VC ${MSVC_VERDOT}") + FIND_PATH(debug_msvc_redist_path NAME msvcr${MSVC_VER}d.dll + PATHS + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\${MSVC_VERDOT}\\Setup\\VC;ProductDir]/redist/Debug_NonRedist/x86/Microsoft.VC${MSVC_VER}.DebugCRT + [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Windows;Directory]/SysWOW64 + [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Windows;Directory]/System32 + ${MSVC_DEBUG_REDIST_PATH} + NO_DEFAULT_PATH ) - set(third_party_targets ${third_party_targets} ${out_targets}) - copy_if_different( - ${release_msvc_redist_path} - "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}" - out_targets - ${release_msvc_files} + if(EXISTS ${debug_msvc_redist_path}) + set(debug_msvc_files + msvcr${MSVC_VER}d.dll + msvcp${MSVC_VER}d.dll + ) + + copy_if_different( + ${debug_msvc_redist_path} + "${SHARED_LIB_STAGING_DIR_DEBUG}" + out_targets + ${debug_msvc_files} + ) + set(third_party_targets ${third_party_targets} ${out_targets}) + + unset(debug_msvc_redist_path CACHE) + endif() + + FIND_PATH(release_msvc_redist_path NAME msvcr${MSVC_VER}.dll + PATHS + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\${MSVC_VERDOT}\\Setup\\VC;ProductDir]/redist/x86/Microsoft.VC${MSVC_VER}.CRT + [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Windows;Directory]/SysWOW64 + [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Windows;Directory]/System32 + ${MSVC_REDIST_PATH} + NO_DEFAULT_PATH ) - set(third_party_targets ${third_party_targets} ${out_targets}) - - endif () + if(EXISTS ${release_msvc_redist_path}) + set(release_msvc_files + msvcr${MSVC_VER}.dll + msvcp${MSVC_VER}.dll + ) + + copy_if_different( + ${release_msvc_redist_path} + "${SHARED_LIB_STAGING_DIR_RELEASE}" + out_targets + ${release_msvc_files} + ) + set(third_party_targets ${third_party_targets} ${out_targets}) + + copy_if_different( + ${release_msvc_redist_path} + "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}" + out_targets + ${release_msvc_files} + ) + set(third_party_targets ${third_party_targets} ${out_targets}) + + unset(release_msvc_redist_path CACHE) + endif() + endforeach() elseif(DARWIN) set(SHARED_LIB_STAGING_DIR_DEBUG "${SHARED_LIB_STAGING_DIR}/Debug/Resources") diff --git a/indra/llappearance/llwearable.cpp b/indra/llappearance/llwearable.cpp index 41c06f4368..5ca9f55ac8 100755 --- a/indra/llappearance/llwearable.cpp +++ b/indra/llappearance/llwearable.cpp @@ -88,7 +88,7 @@ LLAssetType::EType LLWearable::getAssetType() const BOOL LLWearable::exportFile(const std::string& filename) const { - llofstream ofs(filename, std::ios_base::out | std::ios_base::trunc | std::ios_base::binary); + llofstream ofs(filename.c_str(), std::ios_base::out | std::ios_base::trunc | std::ios_base::binary); return ofs.is_open() && exportStream(ofs); } @@ -204,7 +204,7 @@ void LLWearable::createLayers(S32 te, LLAvatarAppearance *avatarp) LLWearable::EImportResult LLWearable::importFile(const std::string& filename, LLAvatarAppearance* avatarp ) { - llifstream ifs(filename, std::ios_base::in | std::ios_base::binary); + llifstream ifs(filename.c_str(), std::ios_base::in | std::ios_base::binary); return (! ifs.is_open())? FAILURE : importStream(ifs, avatarp); } diff --git a/indra/llappearance/llwearabledata.cpp b/indra/llappearance/llwearabledata.cpp index 5dfb201fc4..2bf3b9085b 100755 --- a/indra/llappearance/llwearabledata.cpp +++ b/indra/llappearance/llwearabledata.cpp @@ -92,7 +92,7 @@ void LLWearableData::setWearable(const LLWearableType::EType type, U32 index, LL } } -U32 LLWearableData::pushWearable(const LLWearableType::EType type, +void LLWearableData::pushWearable(const LLWearableType::EType type, LLWearable *wearable, bool trigger_updated /* = true */) { @@ -100,9 +100,8 @@ U32 LLWearableData::pushWearable(const LLWearableType::EType type, { // no null wearables please! LL_WARNS() << "Null wearable sent for type " << type << LL_ENDL; - return MAX_CLOTHING_PER_TYPE; } - if (type < LLWearableType::WT_COUNT || mWearableDatas[type].size() < MAX_CLOTHING_PER_TYPE) + if (canAddWearable(type)) { mWearableDatas[type].push_back(wearable); if (trigger_updated) @@ -110,9 +109,7 @@ U32 LLWearableData::pushWearable(const LLWearableType::EType type, const BOOL removed = FALSE; wearableUpdated(wearable, removed); } - return mWearableDatas[type].size()-1; } - return MAX_CLOTHING_PER_TYPE; } // virtual @@ -125,7 +122,7 @@ void LLWearableData::wearableUpdated(LLWearable *wearable, BOOL removed) } } -void LLWearableData::popWearable(LLWearable *wearable) +void LLWearableData::eraseWearable(LLWearable *wearable) { if (wearable == NULL) { @@ -133,16 +130,16 @@ void LLWearableData::popWearable(LLWearable *wearable) return; } - U32 index = getWearableIndex(wearable); const LLWearableType::EType type = wearable->getType(); - if (index < MAX_CLOTHING_PER_TYPE && index < getWearableCount(type)) + U32 index; + if (getWearableIndex(wearable,index)) { - popWearable(type, index); + eraseWearable(type, index); } } -void LLWearableData::popWearable(const LLWearableType::EType type, U32 index) +void LLWearableData::eraseWearable(const LLWearableType::EType type, U32 index) { LLWearable *wearable = getWearable(type, index); if (wearable) @@ -204,11 +201,11 @@ void LLWearableData::pullCrossWearableValues(const LLWearableType::EType type) } -U32 LLWearableData::getWearableIndex(const LLWearable *wearable) const +BOOL LLWearableData::getWearableIndex(const LLWearable *wearable, U32& index_found) const { if (wearable == NULL) { - return MAX_CLOTHING_PER_TYPE; + return FALSE; } const LLWearableType::EType type = wearable->getType(); @@ -216,18 +213,50 @@ U32 LLWearableData::getWearableIndex(const LLWearable *wearable) const if (wearable_iter == mWearableDatas.end()) { LL_WARNS() << "tried to get wearable index with an invalid type!" << LL_ENDL; - return MAX_CLOTHING_PER_TYPE; + return FALSE; } const wearableentry_vec_t& wearable_vec = wearable_iter->second; for(U32 index = 0; index < wearable_vec.size(); index++) { if (wearable_vec[index] == wearable) { - return index; + index_found = index; + return TRUE; } } - return MAX_CLOTHING_PER_TYPE; + return FALSE; +} + +U32 LLWearableData::getClothingLayerCount() const +{ + U32 count = 0; + for (S32 i = 0; i < LLWearableType::WT_COUNT; i++) + { + LLWearableType::EType type = (LLWearableType::EType)i; + if (LLWearableType::getAssetType(type)==LLAssetType::AT_CLOTHING) + { + count += getWearableCount(type); + } + } + return count; +} + +BOOL LLWearableData::canAddWearable(const LLWearableType::EType type) const +{ + LLAssetType::EType a_type = LLWearableType::getAssetType(type); + if (a_type==LLAssetType::AT_CLOTHING) + { + return (getClothingLayerCount() < MAX_CLOTHING_LAYERS); + } + else if (a_type==LLAssetType::AT_BODYPART) + { + return (getWearableCount(type) < 1); + } + else + { + return FALSE; + } } BOOL LLWearableData::isOnTop(LLWearable* wearable) const diff --git a/indra/llappearance/llwearabledata.h b/indra/llappearance/llwearabledata.h index 03bd179f25..a0c446ea9e 100644..100755 --- a/indra/llappearance/llwearabledata.h +++ b/indra/llappearance/llwearabledata.h @@ -60,11 +60,13 @@ public: const LLWearable* getBottomWearable(const LLWearableType::EType type) const; U32 getWearableCount(const LLWearableType::EType type) const; U32 getWearableCount(const U32 tex_index) const; - U32 getWearableIndex(const LLWearable *wearable) const; + BOOL getWearableIndex(const LLWearable *wearable, U32& index) const; + U32 getClothingLayerCount() const; + BOOL canAddWearable(const LLWearableType::EType type) const; BOOL isOnTop(LLWearable* wearable) const; - - static const U32 MAX_CLOTHING_PER_TYPE = 5; + + static const U32 MAX_CLOTHING_LAYERS = 60; //-------------------------------------------------------------------- // Setters @@ -72,11 +74,11 @@ public: protected: // Low-level data structure setter - public access is via setWearableItem, etc. void setWearable(const LLWearableType::EType type, U32 index, LLWearable *wearable); - U32 pushWearable(const LLWearableType::EType type, LLWearable *wearable, + void pushWearable(const LLWearableType::EType type, LLWearable *wearable, bool trigger_updated = true); virtual void wearableUpdated(LLWearable *wearable, BOOL removed); - void popWearable(LLWearable *wearable); - void popWearable(const LLWearableType::EType type, U32 index); + void eraseWearable(LLWearable *wearable); + void eraseWearable(const LLWearableType::EType type, U32 index); void clearWearableType(const LLWearableType::EType type); bool swapWearables(const LLWearableType::EType type, U32 index_a, U32 index_b); diff --git a/indra/llappearance/llwearabletype.cpp b/indra/llappearance/llwearabletype.cpp index 618e2a1941..87109a5906 100644..100755 --- a/indra/llappearance/llwearabletype.cpp +++ b/indra/llappearance/llwearabletype.cpp @@ -27,6 +27,7 @@ #include "linden_common.h" #include "llwearabletype.h" #include "llinventorytype.h" +#include "llinventorydefines.h" static LLTranslationBridge* sTrans = NULL; @@ -160,7 +161,7 @@ BOOL LLWearableType::getDisableCameraSwitch(LLWearableType::EType type) return entry->mDisableCameraSwitch; } -// static +// static BOOL LLWearableType::getAllowMultiwear(LLWearableType::EType type) { const LLWearableDictionary *dict = LLWearableDictionary::getInstance(); @@ -169,3 +170,9 @@ BOOL LLWearableType::getAllowMultiwear(LLWearableType::EType type) return entry->mAllowMultiwear; } +// static +LLWearableType::EType LLWearableType::inventoryFlagsToWearableType(U32 flags) +{ + return (LLWearableType::EType)(flags & LLInventoryItemFlags::II_FLAGS_WEARABLES_MASK); +} + diff --git a/indra/llappearance/llwearabletype.h b/indra/llappearance/llwearabletype.h index 7c9594644d..519d5b92a2 100644..100755 --- a/indra/llappearance/llwearabletype.h +++ b/indra/llappearance/llwearabletype.h @@ -80,6 +80,7 @@ public: static LLInventoryType::EIconName getIconName(EType type); static BOOL getDisableCameraSwitch(EType type); static BOOL getAllowMultiwear(EType type); + static EType inventoryFlagsToWearableType(U32 flags); protected: LLWearableType() {} diff --git a/indra/llcharacter/lljoint.cpp b/indra/llcharacter/lljoint.cpp index 40695bfa24..8fa08a2a6c 100755 --- a/indra/llcharacter/lljoint.cpp +++ b/indra/llcharacter/lljoint.cpp @@ -361,7 +361,6 @@ void LLJoint::removeAttachmentPosOverride( const LLUUID& mesh_id, const std::str } updatePos(av_info); } - } //-------------------------------------------------------------------- diff --git a/indra/llcharacter/lljointstate.h b/indra/llcharacter/lljointstate.h index b9c91f80b5..1ccc6b5093 100755 --- a/indra/llcharacter/lljointstate.h +++ b/indra/llcharacter/lljointstate.h @@ -64,22 +64,18 @@ protected: public: // Constructor LLJointState() - { - mUsage = 0; - mJoint = NULL; - mUsage = 0; - mWeight = 0.f; - mPriority = LLJoint::USE_MOTION_PRIORITY; - } + : mUsage(0) + , mJoint(NULL) + , mWeight(0.f) + , mPriority(LLJoint::USE_MOTION_PRIORITY) + {} LLJointState(LLJoint* joint) - { - mUsage = 0; - mJoint = joint; - mUsage = 0; - mWeight = 0.f; - mPriority = LLJoint::USE_MOTION_PRIORITY; - } + : mUsage(0) + , mJoint(joint) + , mWeight(0.f) + , mPriority(LLJoint::USE_MOTION_PRIORITY) + {} // joint that this state is applied to LLJoint* getJoint() { return mJoint; } diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index 8119b14887..2100989316 100755 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -113,7 +113,7 @@ namespace { public: RecordToFile(const std::string& filename) { - mFile.open(filename, llofstream::out | llofstream::app); + mFile.open(filename.c_str(), std::ios_base::out | std::ios_base::app); if (!mFile) { LL_INFOS() << "Error setting log file to " << filename << LL_ENDL; @@ -335,7 +335,7 @@ namespace LLSD configuration; { - llifstream file(filename()); + llifstream file(filename().c_str()); if (file.is_open()) { LLSDSerialize::fromXML(configuration, file); diff --git a/indra/llcommon/llfile.cpp b/indra/llcommon/llfile.cpp index 304d702979..295c97eac8 100755 --- a/indra/llcommon/llfile.cpp +++ b/indra/llcommon/llfile.cpp @@ -424,26 +424,6 @@ LLFILE * LLFile::_Fiopen(const std::string& filename, /************** llstdio file buffer ********************************/ -//llstdio_filebuf* llstdio_filebuf::open(const char *_Filename, -// ios_base::openmode _Mode) -//{ -//#if LL_WINDOWS -// _Filet *_File; -// if (is_open() || (_File = LLFILE::_Fiopen(_Filename, _Mode)) == 0) -// return (0); // open failed -// -// _Init(_File, _Openfl); -// _Initcvt(&_USE(_Mysb::getloc(), _Cvt)); -// return (this); // open succeeded -//#else -// std::filebuf* _file = std::filebuf::open(_Filename, _Mode); -// if (NULL == _file) return NULL; -// return this; -//#endif -//} - - -// *TODO: Seek the underlying c stream for better cross-platform compatibility? #if !LL_WINDOWS llstdio_filebuf::int_type llstdio_filebuf::overflow(llstdio_filebuf::int_type __c) { @@ -865,23 +845,19 @@ int llstdio_filebuf::sync() } #endif +#if LL_WINDOWS /************** input file stream ********************************/ - -llifstream::llifstream() : _M_filebuf(), -#if LL_WINDOWS - std::istream(&_M_filebuf) {} -#else - std::istream() +llifstream::llifstream() : + _M_filebuf(), + std::istream(&_M_filebuf) { - this->init(&_M_filebuf); } -#endif // explicit llifstream::llifstream(const std::string& _Filename, - ios_base::openmode _Mode) : _M_filebuf(), -#if LL_WINDOWS + ios_base::openmode _Mode) : + _M_filebuf(), std::istream(&_M_filebuf) { llutf16string wideName = utf8str_to_utf16str( _Filename ); @@ -890,18 +866,11 @@ llifstream::llifstream(const std::string& _Filename, _Myios::setstate(ios_base::failbit); } } -#else - std::istream() -{ - this->init(&_M_filebuf); - this->open(_Filename.c_str(), _Mode | ios_base::in); -} -#endif // explicit llifstream::llifstream(const char* _Filename, - ios_base::openmode _Mode) : _M_filebuf(), -#if LL_WINDOWS + ios_base::openmode _Mode) : + _M_filebuf(), std::istream(&_M_filebuf) { llutf16string wideName = utf8str_to_utf16str( _Filename ); @@ -910,40 +879,6 @@ llifstream::llifstream(const char* _Filename, _Myios::setstate(ios_base::failbit); } } -#else - std::istream() -{ - this->init(&_M_filebuf); - this->open(_Filename, _Mode | ios_base::in); -} -#endif - - -#if llstream_LLFILE -// explicit -llifstream::llifstream(_Filet *_File, - ios_base::openmode _Mode, size_t _Size) : - _M_filebuf(_File, _Mode, _Size), -#if LL_WINDOWS - std::istream(&_M_filebuf) {} -#else - std::istream() -{ - this->init(&_M_filebuf); -} -#endif - -#if !LL_WINDOWS -// explicit -llifstream::llifstream(int __fd, - ios_base::openmode _Mode, size_t _Size) : - _M_filebuf(__fd, _Mode, _Size), - std::istream() -{ - this->init(&_M_filebuf); -} -#endif -#endif // llstream_LLFILE bool llifstream::is_open() const { // test if C stream has been opened @@ -952,8 +887,6 @@ bool llifstream::is_open() const void llifstream::open(const char* _Filename, ios_base::openmode _Mode) { // open a C stream with specified mode - -#if LL_WINDOWS llutf16string wideName = utf8str_to_utf16str( _Filename ); if (_M_filebuf.open( wideName.c_str(), _Mode | ios_base::in) == 0) { @@ -963,27 +896,13 @@ void llifstream::open(const char* _Filename, ios_base::openmode _Mode) { _Myios::clear(); } -#else - if (_M_filebuf.open(_Filename, _Mode | ios_base::in) == 0) - { - this->setstate(ios_base::failbit); - } - else - { - this->clear(); - } -#endif } void llifstream::close() { // close the C stream if (_M_filebuf.close() == 0) { -#if LL_WINDOWS _Myios::setstate(ios_base::failbit); -#else - this->setstate(ios_base::failbit); -#endif } } @@ -991,20 +910,16 @@ void llifstream::close() /************** output file stream ********************************/ -llofstream::llofstream() : _M_filebuf(), -#if LL_WINDOWS - std::ostream(&_M_filebuf) {} -#else - std::ostream() +llofstream::llofstream() : + _M_filebuf(), + std::ostream(&_M_filebuf) { - this->init(&_M_filebuf); } -#endif // explicit llofstream::llofstream(const std::string& _Filename, - ios_base::openmode _Mode) : _M_filebuf(), -#if LL_WINDOWS + ios_base::openmode _Mode) : + _M_filebuf(), std::ostream(&_M_filebuf) { llutf16string wideName = utf8str_to_utf16str( _Filename ); @@ -1013,18 +928,11 @@ llofstream::llofstream(const std::string& _Filename, _Myios::setstate(ios_base::failbit); } } -#else - std::ostream() -{ - this->init(&_M_filebuf); - this->open(_Filename.c_str(), _Mode | ios_base::out); -} -#endif // explicit llofstream::llofstream(const char* _Filename, - ios_base::openmode _Mode) : _M_filebuf(), -#if LL_WINDOWS + ios_base::openmode _Mode) : + _M_filebuf(), std::ostream(&_M_filebuf) { llutf16string wideName = utf8str_to_utf16str( _Filename ); @@ -1033,39 +941,6 @@ llofstream::llofstream(const char* _Filename, _Myios::setstate(ios_base::failbit); } } -#else - std::ostream() -{ - this->init(&_M_filebuf); - this->open(_Filename, _Mode | ios_base::out); -} -#endif - -#if llstream_LLFILE -// explicit -llofstream::llofstream(_Filet *_File, - ios_base::openmode _Mode, size_t _Size) : - _M_filebuf(_File, _Mode, _Size), -#if LL_WINDOWS - std::ostream(&_M_filebuf) {} -#else - std::ostream() -{ - this->init(&_M_filebuf); -} -#endif - -#if !LL_WINDOWS -// explicit -llofstream::llofstream(int __fd, - ios_base::openmode _Mode, size_t _Size) : - _M_filebuf(__fd, _Mode, _Size), - std::ostream() -{ - this->init(&_M_filebuf); -} -#endif -#endif // llstream_LLFILE bool llofstream::is_open() const { // test if C stream has been opened @@ -1074,7 +949,6 @@ bool llofstream::is_open() const void llofstream::open(const char* _Filename, ios_base::openmode _Mode) { // open a C stream with specified mode -#if LL_WINDOWS llutf16string wideName = utf8str_to_utf16str( _Filename ); if (_M_filebuf.open( wideName.c_str(), _Mode | ios_base::out) == 0) { @@ -1084,27 +958,13 @@ void llofstream::open(const char* _Filename, ios_base::openmode _Mode) { _Myios::clear(); } -#else - if (_M_filebuf.open(_Filename, _Mode | ios_base::out) == 0) - { - this->setstate(ios_base::failbit); - } - else - { - this->clear(); - } -#endif } void llofstream::close() { // close the C stream if (_M_filebuf.close() == 0) { -#if LL_WINDOWS _Myios::setstate(ios_base::failbit); -#else - this->setstate(ios_base::failbit); -#endif } } @@ -1134,4 +994,4 @@ std::streamsize llofstream_size(llofstream& ofstr) return pos_end - pos_beg; } - +#endif // LL_WINDOWS diff --git a/indra/llcommon/llfile.h b/indra/llcommon/llfile.h index 44a1e42fa5..347c9867aa 100755 --- a/indra/llcommon/llfile.h +++ b/indra/llcommon/llfile.h @@ -86,12 +86,6 @@ public: static const char * tmpdir(); }; -// Remove ll[io]fstream support for [LL]FILE*, preparing to remove dependency -// on GNU's standard library. -#if ! defined(llstream_LLFILE) -#define llstream_LLFILE 0 -#endif - /** * @brief Provides a layer of compatibility for C/POSIX. * @@ -198,7 +192,7 @@ protected: #endif }; - +#if LL_WINDOWS /** * @brief Controlling input for files. * @@ -207,11 +201,11 @@ protected: * sequence, an instance of std::basic_filebuf (or a platform-specific derivative) * which allows construction using a pre-exisintg file stream buffer. * We refer to this std::basic_filebuf (or derivative) as @c sb. -*/ + */ class LL_COMMON_API llifstream : public std::istream { // input stream associated with a C stream -public: + public: // Constructors: /** * @brief Default constructor. @@ -219,7 +213,7 @@ public: * Initializes @c sb using its default constructor, and passes * @c &sb to the base class initializer. Does not open any files * (you haven't given it a filename to open). - */ + */ llifstream(); /** @@ -228,50 +222,21 @@ public: * @param Mode Open file in specified mode (see std::ios_base). * * @c ios_base::in is automatically included in @a mode. - */ + */ explicit llifstream(const std::string& _Filename, - ios_base::openmode _Mode = ios_base::in); + ios_base::openmode _Mode = ios_base::in); explicit llifstream(const char* _Filename, - ios_base::openmode _Mode = ios_base::in); - -#if llstream_LLFILE - /** - * @brief Create a stream using an open c file stream. - * @param File An open @c FILE*. - @param Mode Same meaning as in a standard filebuf. - @param Size Optimal or preferred size of internal buffer, in chars. - Defaults to system's @c BUFSIZ. - */ - explicit llifstream(_Filet *_File, - ios_base::openmode _Mode = ios_base::in, - //size_t _Size = static_cast<size_t>(BUFSIZ)); - size_t _Size = static_cast<size_t>(1)); - - /** - * @brief Create a stream using an open file descriptor. - * @param fd An open file descriptor. - @param Mode Same meaning as in a standard filebuf. - @param Size Optimal or preferred size of internal buffer, in chars. - Defaults to system's @c BUFSIZ. - */ -#if !LL_WINDOWS - explicit llifstream(int __fd, - ios_base::openmode _Mode = ios_base::in, - //size_t _Size = static_cast<size_t>(BUFSIZ)); - size_t _Size = static_cast<size_t>(1)); -#endif -#endif // llstream_LLFILE + ios_base::openmode _Mode = ios_base::in); /** * @brief The destructor does nothing. * * The file is closed by the filebuf object, not the formatting * stream. - */ + */ virtual ~llifstream() {} // Members: -#if llstream_LLFILE /** * @brief Accessing the underlying buffer. * @return The current basic_filebuf buffer. @@ -280,12 +245,11 @@ public: */ llstdio_filebuf* rdbuf() const { return const_cast<llstdio_filebuf*>(&_M_filebuf); } -#endif // llstream_LLFILE /** * @brief Wrapper to test for an open file. * @return @c rdbuf()->is_open() - */ + */ bool is_open() const; /** @@ -295,22 +259,22 @@ public: * * Calls @c llstdio_filebuf::open(s,mode|in). If that function * fails, @c failbit is set in the stream's error state. - */ + */ void open(const std::string& _Filename, - ios_base::openmode _Mode = ios_base::in) + ios_base::openmode _Mode = ios_base::in) { open(_Filename.c_str(), _Mode); } void open(const char* _Filename, - ios_base::openmode _Mode = ios_base::in); + ios_base::openmode _Mode = ios_base::in); /** * @brief Close the file. * * Calls @c llstdio_filebuf::close(). If that function * fails, @c failbit is set in the stream's error state. - */ + */ void close(); -private: + private: llstdio_filebuf _M_filebuf; }; @@ -326,7 +290,7 @@ private: */ class LL_COMMON_API llofstream : public std::ostream { -public: + public: // Constructors: /** * @brief Default constructor. @@ -334,7 +298,7 @@ public: * Initializes @c sb using its default constructor, and passes * @c &sb to the base class initializer. Does not open any files * (you haven't given it a filename to open). - */ + */ llofstream(); /** @@ -344,39 +308,11 @@ public: * * @c ios_base::out|ios_base::trunc is automatically included in * @a mode. - */ + */ explicit llofstream(const std::string& _Filename, - ios_base::openmode _Mode = ios_base::out|ios_base::trunc); + ios_base::openmode _Mode = ios_base::out|ios_base::trunc); explicit llofstream(const char* _Filename, - ios_base::openmode _Mode = ios_base::out|ios_base::trunc); - -#if llstream_LLFILE - /** - * @brief Create a stream using an open c file stream. - * @param File An open @c FILE*. - @param Mode Same meaning as in a standard filebuf. - @param Size Optimal or preferred size of internal buffer, in chars. - Defaults to system's @c BUFSIZ. - */ - explicit llofstream(_Filet *_File, - ios_base::openmode _Mode = ios_base::out, - //size_t _Size = static_cast<size_t>(BUFSIZ)); - size_t _Size = static_cast<size_t>(1)); - - /** - * @brief Create a stream using an open file descriptor. - * @param fd An open file descriptor. - @param Mode Same meaning as in a standard filebuf. - @param Size Optimal or preferred size of internal buffer, in chars. - Defaults to system's @c BUFSIZ. - */ -#if !LL_WINDOWS - explicit llofstream(int __fd, - ios_base::openmode _Mode = ios_base::out, - //size_t _Size = static_cast<size_t>(BUFSIZ)); - size_t _Size = static_cast<size_t>(1)); -#endif -#endif // llstream_LLFILE + ios_base::openmode _Mode = ios_base::out|ios_base::trunc); /** * @brief The destructor does nothing. @@ -387,7 +323,6 @@ public: virtual ~llofstream() {} // Members: -#if llstream_LLFILE /** * @brief Accessing the underlying buffer. * @return The current basic_filebuf buffer. @@ -396,7 +331,6 @@ public: */ llstdio_filebuf* rdbuf() const { return const_cast<llstdio_filebuf*>(&_M_filebuf); } -#endif // llstream_LLFILE /** * @brief Wrapper to test for an open file. @@ -411,22 +345,22 @@ public: * * Calls @c llstdio_filebuf::open(s,mode|out). If that function * fails, @c failbit is set in the stream's error state. - */ + */ void open(const std::string& _Filename, - ios_base::openmode _Mode = ios_base::out|ios_base::trunc) + ios_base::openmode _Mode = ios_base::out|ios_base::trunc) { open(_Filename.c_str(), _Mode); } void open(const char* _Filename, - ios_base::openmode _Mode = ios_base::out|ios_base::trunc); + ios_base::openmode _Mode = ios_base::out|ios_base::trunc); /** * @brief Close the file. * * Calls @c llstdio_filebuf::close(). If that function * fails, @c failbit is set in the stream's error state. - */ + */ void close(); -private: + private: llstdio_filebuf _M_filebuf; }; @@ -441,4 +375,12 @@ private: std::streamsize LL_COMMON_API llifstream_size(llifstream& fstr); std::streamsize LL_COMMON_API llofstream_size(llofstream& fstr); +#else // ! LL_WINDOWS + +// on non-windows, llifstream and llofstream are just mapped directly to the std:: equivalents +typedef std::ifstream llifstream; +typedef std::ofstream llofstream; + +#endif // LL_WINDOWS or ! LL_WINDOWS + #endif // not LL_LLFILE_H diff --git a/indra/llcommon/llliveappconfig.cpp b/indra/llcommon/llliveappconfig.cpp index 7c87c5a1a0..a9b1cdf4f6 100755 --- a/indra/llcommon/llliveappconfig.cpp +++ b/indra/llcommon/llliveappconfig.cpp @@ -49,7 +49,7 @@ bool LLLiveAppConfig::loadFile() { LL_INFOS() << "LLLiveAppConfig::loadFile(): reading from " << filename() << LL_ENDL; - llifstream file(filename()); + llifstream file(filename().c_str()); LLSD config; if (file.is_open()) { diff --git a/indra/llcommon/lllivefile.cpp b/indra/llcommon/lllivefile.cpp index c1987baf55..ea485c2d86 100755 --- a/indra/llcommon/lllivefile.cpp +++ b/indra/llcommon/lllivefile.cpp @@ -51,6 +51,8 @@ public: bool mLastExists; LLEventTimer* mEventTimer; +private: + LOG_CLASS(LLLiveFile); }; LLLiveFile::Impl::Impl(const std::string& filename, const F32 refresh_period) @@ -83,46 +85,51 @@ LLLiveFile::~LLLiveFile() bool LLLiveFile::Impl::check() { - if (!mForceCheck && mRefreshTimer.getElapsedTimeF32() < mRefreshPeriod) + bool detected_change = false; + // Skip the check if not enough time has elapsed and we're not + // forcing a check of the file + if (mForceCheck || mRefreshTimer.getElapsedTimeF32() >= mRefreshPeriod) { - // Skip the check if not enough time has elapsed and we're not - // forcing a check of the file - return false; - } - mForceCheck = false; - mRefreshTimer.reset(); - - // Stat the file to see if it exists and when it was last modified. - llstat stat_data; - int res = LLFile::stat(mFilename, &stat_data); - - if (res) - { - // Couldn't stat the file, that means it doesn't exist or is - // broken somehow. Clear flags and return. - if (mLastExists) - { - mLastExists = false; - return true; // no longer existing is a change! - } - return false; - } - - // The file exists, decide if we want to load it. - if (mLastExists) - { - // The file existed last time, don't read it if it hasn't changed since - // last time. - if (stat_data.st_mtime <= mLastModTime) - { - return false; - } - } - - // We want to read the file. Update status info for the file. - mLastExists = true; - mLastStatTime = stat_data.st_mtime; - return true; + mForceCheck = false; // force only forces one check + mRefreshTimer.reset(); // don't check again until mRefreshPeriod has passed + + // Stat the file to see if it exists and when it was last modified. + llstat stat_data; + if (LLFile::stat(mFilename, &stat_data)) + { + // Couldn't stat the file, that means it doesn't exist or is + // broken somehow. + if (mLastExists) + { + mLastExists = false; + detected_change = true; // no longer existing is a change! + LL_DEBUGS() << "detected deleted file '" << mFilename << "'" << LL_ENDL; + } + } + else + { + // The file exists + if ( ! mLastExists ) + { + // last check, it did not exist - that counts as a change + LL_DEBUGS() << "detected created file '" << mFilename << "'" << LL_ENDL; + detected_change = true; + } + else if ( stat_data.st_mtime > mLastModTime ) + { + // file modification time is newer than last check + LL_DEBUGS() << "detected updated file '" << mFilename << "'" << LL_ENDL; + detected_change = true; + } + mLastExists = true; + mLastStatTime = stat_data.st_mtime; + } + } + if (detected_change) + { + LL_INFOS() << "detected file change '" << mFilename << "'" << LL_ENDL; + } + return detected_change; } void LLLiveFile::Impl::changed() diff --git a/indra/llcommon/llmd5.cpp b/indra/llcommon/llmd5.cpp index ed80af36d8..f942a976b7 100755 --- a/indra/llcommon/llmd5.cpp +++ b/indra/llcommon/llmd5.cpp @@ -118,6 +118,12 @@ void LLMD5::update (const uint1 *input, const uint4 input_length) { buffer_space = 64 - buffer_index; // how much space is left in buffer + // now, transform each 64-byte piece of the input, bypassing the buffer + if (input == NULL || input_length == 0){ + std::cerr << "LLMD5::update: Invalid input!" << std::endl; + return; + } + // Transform as many times as possible. if (input_length >= buffer_space) { // ie. we have enough to fill the buffer // fill the rest of the buffer and transform @@ -127,12 +133,6 @@ void LLMD5::update (const uint1 *input, const uint4 input_length) { buffer_space); transform (buffer); - // now, transform each 64-byte piece of the input, bypassing the buffer - if (input == NULL || input_length == 0){ - std::cerr << "LLMD5::update: Invalid input!" << std::endl; - return; - } - for (input_index = buffer_space; input_index + 63 < input_length; input_index += 64) transform (input+input_index); diff --git a/indra/llcommon/llmemory.cpp b/indra/llcommon/llmemory.cpp index e0b2aa87c2..ae11988df8 100755 --- a/indra/llcommon/llmemory.cpp +++ b/indra/llcommon/llmemory.cpp @@ -63,13 +63,18 @@ LLPrivateMemoryPoolManager::mem_allocation_info_t LLPrivateMemoryPoolManager::sM void ll_assert_aligned_func(uintptr_t ptr,U32 alignment) { -#ifdef SHOW_ASSERT - // Redundant, place to set breakpoints. - if (ptr%alignment!=0) - { - LL_WARNS() << "alignment check failed" << LL_ENDL; - } - llassert(ptr%alignment==0); +#if defined(LL_WINDOWS) && defined(LL_DEBUG_BUFFER_OVERRUN) + //do not check + return; +#else + #ifdef SHOW_ASSERT + // Redundant, place to set breakpoints. + if (ptr%alignment!=0) + { + LL_WARNS() << "alignment check failed" << LL_ENDL; + } + llassert(ptr%alignment==0); + #endif #endif } @@ -2148,3 +2153,60 @@ void LLPrivateMemoryPoolTester::fragmentationtest() } #endif //-------------------------------------------------------------------- + +#if defined(LL_WINDOWS) && defined(LL_DEBUG_BUFFER_OVERRUN) + +#include <map> + +struct mem_info { + std::map<void*, void*> memory_info; + LLMutex mutex; + + static mem_info& get() { + static mem_info instance; + return instance; + } + +private: + mem_info(){} +}; + +void* ll_aligned_malloc_fallback( size_t size, int align ) +{ + SYSTEM_INFO sysinfo; + GetSystemInfo(&sysinfo); + + unsigned int for_alloc = sysinfo.dwPageSize; + while(for_alloc < size) for_alloc += sysinfo.dwPageSize; + + void *p = VirtualAlloc(NULL, for_alloc+sysinfo.dwPageSize, MEM_COMMIT|MEM_RESERVE, PAGE_READWRITE); + if(NULL == p) { + // call debugger + __asm int 3; + } + DWORD old; + BOOL Res = VirtualProtect((void*)((char*)p + for_alloc), sysinfo.dwPageSize, PAGE_NOACCESS, &old); + if(FALSE == Res) { + // call debugger + __asm int 3; + } + + void* ret = (void*)((char*)p + for_alloc-size); + + { + LLMutexLock lock(&mem_info::get().mutex); + mem_info::get().memory_info.insert(std::pair<void*, void*>(ret, p)); + } + + + return ret; +} + +void ll_aligned_free_fallback( void* ptr ) +{ + LLMutexLock lock(&mem_info::get().mutex); + VirtualFree(mem_info::get().memory_info.find(ptr)->second, 0, MEM_RELEASE); + mem_info::get().memory_info.erase(ptr); +} + +#endif diff --git a/indra/llcommon/llmemory.h b/indra/llcommon/llmemory.h index 7d1d541a4b..c4c9cc0566 100755 --- a/indra/llcommon/llmemory.h +++ b/indra/llcommon/llmemory.h @@ -94,32 +94,44 @@ template <typename T> T* LL_NEXT_ALIGNED_ADDRESS_64(T* address) #define LL_ALIGN_16(var) LL_ALIGN_PREFIX(16) var LL_ALIGN_POSTFIX(16) - -inline void* ll_aligned_malloc_fallback( size_t size, int align ) -{ -#if defined(LL_WINDOWS) - return _aligned_malloc(size, align); +//------------------------------------------------------------------------------------------------ +//------------------------------------------------------------------------------------------------ + // for enable buffer overrun detection predefine LL_DEBUG_BUFFER_OVERRUN in current library + // change preprocessro code to: #if 1 && defined(LL_WINDOWS) + +#if 0 && defined(LL_WINDOWS) + void* ll_aligned_malloc_fallback( size_t size, int align ); + void ll_aligned_free_fallback( void* ptr ); +//------------------------------------------------------------------------------------------------ #else - void* mem = malloc( size + (align - 1) + sizeof(void*) ); - char* aligned = ((char*)mem) + sizeof(void*); - aligned += align - ((uintptr_t)aligned & (align - 1)); - - ((void**)aligned)[-1] = mem; - return aligned; -#endif -} + inline void* ll_aligned_malloc_fallback( size_t size, int align ) + { + #if defined(LL_WINDOWS) + return _aligned_malloc(size, align); + #else + void* mem = malloc( size + (align - 1) + sizeof(void*) ); + char* aligned = ((char*)mem) + sizeof(void*); + aligned += align - ((uintptr_t)aligned & (align - 1)); + + ((void**)aligned)[-1] = mem; + return aligned; + #endif + } -inline void ll_aligned_free_fallback( void* ptr ) -{ -#if defined(LL_WINDOWS) - _aligned_free(ptr); -#else - if (ptr) + inline void ll_aligned_free_fallback( void* ptr ) { - free( ((void**)ptr)[-1] ); + #if defined(LL_WINDOWS) + _aligned_free(ptr); + #else + if (ptr) + { + free( ((void**)ptr)[-1] ); + } + #endif } #endif -} +//------------------------------------------------------------------------------------------------ +//------------------------------------------------------------------------------------------------ #if !LL_USE_TCMALLOC inline void* ll_aligned_malloc_16(size_t size) // returned hunk MUST be freed with ll_aligned_free_16(). diff --git a/indra/llcommon/llstacktrace.cpp b/indra/llcommon/llstacktrace.cpp index e0e9056380..bbf0e1e141 100755 --- a/indra/llcommon/llstacktrace.cpp +++ b/indra/llcommon/llstacktrace.cpp @@ -125,6 +125,30 @@ bool ll_get_stack_trace(std::vector<std::string>& lines) return false; } +void ll_get_stack_trace_internal(std::vector<std::string>& lines) +{ + const S32 MAX_STACK_DEPTH = 100; + const S32 STRING_NAME_LENGTH = 256; + + HANDLE process = GetCurrentProcess(); + SymInitialize( process, NULL, TRUE ); + + void *stack[MAX_STACK_DEPTH]; + + unsigned short frames = RtlCaptureStackBackTrace_fn( 0, MAX_STACK_DEPTH, stack, NULL ); + SYMBOL_INFO *symbol = (SYMBOL_INFO*)calloc(sizeof(SYMBOL_INFO) + STRING_NAME_LENGTH * sizeof(char), 1); + symbol->MaxNameLen = STRING_NAME_LENGTH-1; + symbol->SizeOfStruct = sizeof(SYMBOL_INFO); + + for(unsigned int i = 0; i < frames; i++) + { + SymFromAddr(process, (DWORD64)(stack[i]), 0, symbol); + lines.push_back(symbol->Name); + } + + free( symbol ); +} + #else bool ll_get_stack_trace(std::vector<std::string>& lines) @@ -132,5 +156,10 @@ bool ll_get_stack_trace(std::vector<std::string>& lines) return false; } +void ll_get_stack_trace_internal(std::vector<std::string>& lines) +{ + +} + #endif diff --git a/indra/llcommon/llstacktrace.h b/indra/llcommon/llstacktrace.h index ca72c64c5d..335765386a 100755 --- a/indra/llcommon/llstacktrace.h +++ b/indra/llcommon/llstacktrace.h @@ -33,6 +33,7 @@ #include <string> LL_COMMON_API bool ll_get_stack_trace(std::vector<std::string>& lines); +LL_COMMON_API void ll_get_stack_trace_internal(std::vector<std::string>& lines); #endif diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp index 617969ab2a..f3b8999883 100755 --- a/indra/llcommon/llstring.cpp +++ b/indra/llcommon/llstring.cpp @@ -107,7 +107,7 @@ bool iswindividual(llwchar elem) bool _read_file_into_string(std::string& str, const std::string& filename) { - llifstream ifs(filename, llifstream::binary); + llifstream ifs(filename.c_str(), llifstream::binary); if (!ifs.is_open()) { LL_INFOS() << "Unable to open file " << filename << LL_ENDL; diff --git a/indra/llcommon/lluriparser.cpp b/indra/llcommon/lluriparser.cpp index ef4481d32f..d98bc297e5 100644 --- a/indra/llcommon/lluriparser.cpp +++ b/indra/llcommon/lluriparser.cpp @@ -29,7 +29,7 @@ #include "linden_common.h" #include "lluriparser.h" -LLUriParser::LLUriParser(const std::string& u) : mTmpScheme(false), mRes(0) +LLUriParser::LLUriParser(const std::string& u) : mTmpScheme(false), mNormalizedTmp(false), mRes(0) { mState.uri = &mUri; @@ -118,17 +118,20 @@ void LLUriParser::fragment(const std::string& s) void LLUriParser::textRangeToString(UriTextRangeA& textRange, std::string& str) { - S32 len = textRange.afterLast - textRange.first; - if (len) + if (textRange.first != NULL && textRange.afterLast != NULL && textRange.first < textRange.afterLast) { - str = textRange.first; - str = str.substr(0, len); + const ptrdiff_t len = textRange.afterLast - textRange.first; + str.assign(textRange.first, static_cast<std::string::size_type>(len)); + } + else + { + str = LLStringUtil::null; } } void LLUriParser::extractParts() { - if (mTmpScheme) + if (mTmpScheme || mNormalizedTmp) { mScheme.clear(); } @@ -157,6 +160,7 @@ void LLUriParser::extractParts() S32 LLUriParser::normalize() { + mNormalizedTmp = mTmpScheme; if (!mRes) { mRes = uriNormalizeSyntaxExA(&mUri, URI_NORMALIZE_SCHEME | URI_NORMALIZE_HOST); @@ -175,29 +179,58 @@ S32 LLUriParser::normalize() if (!mRes) { mNormalizedUri = &label_buf[mTmpScheme ? 7 : 0]; + mTmpScheme = false; } } } } + if(mTmpScheme) + { + mNormalizedUri = mNormalizedUri.substr(7); + mTmpScheme = false; + } + return mRes; } void LLUriParser::glue(std::string& uri) const { + std::string first_part; + glueFirst(first_part); + + std::string second_part; + glueSecond(second_part); + + uri = first_part + second_part; +} + +void LLUriParser::glueFirst(std::string& uri) const +{ if (mScheme.size()) { uri = mScheme; uri += "://"; } + else + { + uri.clear(); + } uri += mHost; +} +void LLUriParser::glueSecond(std::string& uri) const +{ if (mPort.size()) { - uri += ':'; + uri = ':'; uri += mPort; } + else + { + uri.clear(); + } uri += mPath; diff --git a/indra/llcommon/lluriparser.h b/indra/llcommon/lluriparser.h index 719f916837..2df8085ae6 100644 --- a/indra/llcommon/lluriparser.h +++ b/indra/llcommon/lluriparser.h @@ -36,7 +36,7 @@ class LL_COMMON_API LLUriParser { public: LLUriParser(const std::string& u); - virtual ~LLUriParser(); + ~LLUriParser(); const char * scheme() const; void sheme (const std::string& s); @@ -60,6 +60,8 @@ public: void extractParts(); void glue(std::string& uri) const; + void glueFirst(std::string& uri) const; + void glueSecond(std::string& uri) const; bool test() const; S32 normalize(); @@ -79,6 +81,7 @@ private: S32 mRes; bool mTmpScheme; + bool mNormalizedTmp; }; #endif // LL_LLURIPARSER_H diff --git a/indra/llcrashlogger/llcrashlock.cpp b/indra/llcrashlogger/llcrashlock.cpp index 7fd7860707..7dde1fcd69 100644 --- a/indra/llcrashlogger/llcrashlock.cpp +++ b/indra/llcrashlogger/llcrashlock.cpp @@ -106,7 +106,7 @@ LLSD LLCrashLock::getLockFile(std::string filename) { LLSD lock_sd = LLSD::emptyMap(); - llifstream ifile(filename); + llifstream ifile(filename.c_str()); if (ifile.is_open()) { @@ -120,7 +120,7 @@ LLSD LLCrashLock::getLockFile(std::string filename) bool LLCrashLock::putLockFile(std::string filename, const LLSD& data) { bool result = true; - llofstream ofile(filename); + llofstream ofile(filename.c_str()); if (!LLSDSerialize::toXML(data,ofile)) { diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index ecdcd95d29..16df27bb8e 100755 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -1172,7 +1172,7 @@ static std::string find_file(std::string &name, S8 *codec) for (int i=0; i<(int)(NUM_FILE_EXTENSIONS); i++) { tname = name + "." + std::string(file_extensions[i].exten); - llifstream ifs(tname, llifstream::binary); + llifstream ifs(tname.c_str(), llifstream::binary); if (ifs.is_open()) { ifs.close(); @@ -1219,7 +1219,7 @@ bool LLImageRaw::createFromFile(const std::string &filename, bool j2c_lowest_mip return false; // format not recognized } - llifstream ifs(name, llifstream::binary); + llifstream ifs(name.c_str(), llifstream::binary); if (!ifs.is_open()) { // SJB: changed from LL_INFOS() to LL_DEBUGS() to reduce spam diff --git a/indra/llimage/llimagefilter.cpp b/indra/llimage/llimagefilter.cpp index 0b9d136910..41adc7be9a 100755 --- a/indra/llimage/llimagefilter.cpp +++ b/indra/llimage/llimagefilter.cpp @@ -54,7 +54,7 @@ LLImageFilter::LLImageFilter(const std::string& file_path) : mStencilMax(1.0) { // Load filter description from file - llifstream filter_xml(file_path); + llifstream filter_xml(file_path.c_str()); if (filter_xml.is_open()) { // Load and parse the file diff --git a/indra/llimage/llimageworker.cpp b/indra/llimage/llimageworker.cpp index c8b0e872f6..4875fe7001 100755 --- a/indra/llimage/llimageworker.cpp +++ b/indra/llimage/llimageworker.cpp @@ -143,7 +143,8 @@ bool LLImageDecodeThread::ImageRequest::processRequest() mFormattedImage->getComponents()); } done = mFormattedImage->decode(mDecodedImageRaw, decode_time_slice); // 1ms - mDecodedRaw = done; + // some decoders are removing data when task is complete and there were errors + mDecodedRaw = done && mDecodedImageRaw->getData(); } if (done && mNeedsAux && !mDecodedAux && mFormattedImage.notNull()) { @@ -155,7 +156,7 @@ bool LLImageDecodeThread::ImageRequest::processRequest() 1); } done = mFormattedImage->decodeChannels(mDecodedImageAux, decode_time_slice, 4, 4); // 1ms - mDecodedAux = done; + mDecodedAux = done && mDecodedImageAux->getData(); } return done; diff --git a/indra/llimage/tests/llimageworker_test.cpp b/indra/llimage/tests/llimageworker_test.cpp index c030b105fb..51c5c63556 100755 --- a/indra/llimage/tests/llimageworker_test.cpp +++ b/indra/llimage/tests/llimageworker_test.cpp @@ -67,6 +67,8 @@ LLImageRaw::~LLImageRaw() { } void LLImageRaw::deleteData() { } U8* LLImageRaw::allocateData(S32 size) { return NULL; } U8* LLImageRaw::reallocateData(S32 size) { return NULL; } +const U8* LLImageBase::getData() const { return NULL; } +U8* LLImageBase::getData() { return NULL; } // End Stubbing // ------------------------------------------------------------------------------------------- diff --git a/indra/llmath/llsphere.cpp b/indra/llmath/llsphere.cpp index 740047b93a..a8d6200488 100755 --- a/indra/llmath/llsphere.cpp +++ b/indra/llmath/llsphere.cpp @@ -248,8 +248,8 @@ LLSphere LLSphere::getBoundingSphere(const std::vector<LLSphere>& sphere_list) // compute the starting step-size F32 minimum_radius = 0.5f * llmin(diagonal.mV[VX], llmin(diagonal.mV[VY], diagonal.mV[VZ])); F32 step_length = bounding_radius - minimum_radius; - S32 step_count = 0; - S32 max_step_count = 12; + //S32 step_count = 0; + //S32 max_step_count = 12; F32 half_milimeter = 0.0005f; // wander the center around in search of tighter solutions @@ -258,7 +258,7 @@ LLSphere LLSphere::getBoundingSphere(const std::vector<LLSphere>& sphere_list) S32 last_dz = 2; while (step_length > half_milimeter - && step_count < max_step_count) + /*&& step_count < max_step_count*/) { // the algorithm for testing the maximum radius could be expensive enough // that it makes sense to NOT duplicate testing when possible, so we keep diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index dedd90eab2..c2198b91a7 100755 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -2683,6 +2683,17 @@ void LLVolume::setMeshAssetLoaded(BOOL loaded) mIsMeshAssetLoaded = loaded; } +void LLVolume::copyFacesTo(std::vector<LLVolumeFace> &faces) const +{ + faces = mVolumeFaces; +} + +void LLVolume::copyFacesFrom(const std::vector<LLVolumeFace> &faces) +{ + mVolumeFaces = faces; + mSculptLevel = 0; +} + void LLVolume::copyVolumeFaces(const LLVolume* volume) { mVolumeFaces = volume->mVolumeFaces; @@ -5964,7 +5975,10 @@ BOOL LLVolumeFace::createCap(LLVolume* volume, BOOL partial_build) } else { //degenerate, make up a value - normal.set(0,0,1); + if(normal.getF32ptr()[2] >= 0) + normal.set(0.f,0.f,1.f); + else + normal.set(0.f,0.f,-1.f); } llassert(llfinite(normal.getF32ptr()[0])); @@ -6278,6 +6292,8 @@ BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build) num_vertices = mNumS*mNumT; num_indices = (mNumS-1)*(mNumT-1)*6; + partial_build = (num_vertices > mNumVertices || num_indices > mNumIndices) ? FALSE : partial_build; + if (!partial_build) { resizeVertices(num_vertices); diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h index 2f38ae7203..c8476f6897 100755 --- a/indra/llmath/llvolume.h +++ b/indra/llmath/llvolume.h @@ -993,6 +993,7 @@ public: void resizePath(S32 length); const LLAlignedArray<LLVector4a,64>& getMesh() const { return mMesh; } const LLVector4a& getMeshPt(const U32 i) const { return mMesh[i]; } + void setDirty() { mPathp->setDirty(); mProfilep->setDirty(); } @@ -1045,6 +1046,8 @@ public: void sculpt(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, const U8* sculpt_data, S32 sculpt_level); void copyVolumeFaces(const LLVolume* volume); + void copyFacesTo(std::vector<LLVolumeFace> &faces) const; + void copyFacesFrom(const std::vector<LLVolumeFace> &faces); void cacheOptimize(); private: diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp index d02a60b7b2..549708097a 100755 --- a/indra/llmessage/llavatarnamecache.cpp +++ b/indra/llmessage/llavatarnamecache.cpp @@ -355,9 +355,7 @@ void LLAvatarNameCache::requestNamesViaCapability() if (!url.empty()) { - LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::requestNamesViaCapability requested " - << ids << " ids" - << LL_ENDL; + LL_INFOS("AvNameCache") << "LLAvatarNameCache::requestNamesViaCapability getting " << ids << " ids" << LL_ENDL; LLHTTPClient::get(url, new LLAvatarNameResponder(agent_ids)); } } @@ -381,8 +379,7 @@ void LLAvatarNameCache::legacyNameFetch(const LLUUID& agent_id, const std::string& full_name, bool is_group) { - LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::legacyNameFetch " - << "agent " << agent_id << " " + LL_DEBUGS("AvNameCache") << "LLAvatarNameCache agent " << agent_id << " " << "full name '" << full_name << "'" << ( is_group ? " [group]" : "" ) << LL_ENDL; @@ -411,7 +408,7 @@ void LLAvatarNameCache::requestNamesViaLegacy() // invoked below. This should never happen in practice. sPendingQueue[agent_id] = now; - LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::requestNamesViaLegacy agent " << agent_id << LL_ENDL; + LL_DEBUGS("AvNameCache") << "agent " << agent_id << LL_ENDL; gCacheName->get(agent_id, false, // legacy compatibility boost::bind(&LLAvatarNameCache::legacyNameCallback, _1, _2, _3)); @@ -429,12 +426,13 @@ void LLAvatarNameCache::cleanupClass() sCache.clear(); } -void LLAvatarNameCache::importFile(std::istream& istr) +bool LLAvatarNameCache::importFile(std::istream& istr) { LLSD data; if (LLSDParser::PARSE_FAILURE == LLSDSerialize::fromXMLDocument(data, istr)) { - return; + LL_WARNS("AvNameCache") << "avatar name cache data xml parse failed" << LL_ENDL; + return false; } // by convention LLSD storage is a map @@ -450,17 +448,19 @@ void LLAvatarNameCache::importFile(std::istream& istr) av_name.fromLLSD( it->second ); sCache[agent_id] = av_name; } - LL_INFOS("AvNameCache") << "loaded " << sCache.size() << LL_ENDL; - + LL_INFOS("AvNameCache") << "LLAvatarNameCache loaded " << sCache.size() << LL_ENDL; // Some entries may have expired since the cache was stored, // but they will be flushed in the first call to eraseUnrefreshed // from LLAvatarNameResponder::idle + + return true; } void LLAvatarNameCache::exportFile(std::ostream& ostr) { LLSD agents; F64 max_unrefreshed = LLFrameTimer::getTotalSeconds() - MAX_UNREFRESHED_TIME; + LL_INFOS("AvNameCache") << "LLAvatarNameCache at exit cache has " << sCache.size() << LL_ENDL; cache_t::const_iterator it = sCache.begin(); for ( ; it != sCache.end(); ++it) { @@ -473,6 +473,7 @@ void LLAvatarNameCache::exportFile(std::ostream& ostr) agents[agent_id.asString()] = av_name.asLLSD(); } } + LL_INFOS("AvNameCache") << "LLAvatarNameCache returning " << agents.size() << LL_ENDL; LLSD data; data["agents"] = agents; LLSDSerialize::toPrettyXML(data, ostr); @@ -515,6 +516,7 @@ void LLAvatarNameCache::idle() } else { + LL_WARNS_ONCE("AvNameCache") << "LLAvatarNameCache still using legacy api" << LL_ENDL; requestNamesViaLegacy(); } } @@ -552,24 +554,26 @@ void LLAvatarNameCache::eraseUnrefreshed() if (!sLastExpireCheck || sLastExpireCheck < max_unrefreshed) { sLastExpireCheck = now; - + S32 expired = 0; for (cache_t::iterator it = sCache.begin(); it != sCache.end();) { const LLAvatarName& av_name = it->second; if (av_name.mExpires < max_unrefreshed) { - LL_DEBUGS("AvNameCache") << it->first + LL_DEBUGS("AvNameCacheExpired") << "LLAvatarNameCache " << it->first << " user '" << av_name.getAccountName() << "' " << "expired " << now - av_name.mExpires << " secs ago" << LL_ENDL; sCache.erase(it++); + expired++; } else { ++it; } } - LL_INFOS("AvNameCache") << sCache.size() << " cached avatar names" << LL_ENDL; + LL_INFOS("AvNameCache") << "LLAvatarNameCache expired " << expired << " cached avatar names, " + << sCache.size() << " remaining" << LL_ENDL; } } @@ -590,8 +594,7 @@ bool LLAvatarNameCache::get(const LLUUID& agent_id, LLAvatarName *av_name) { if (!isRequestPending(agent_id)) { - LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::get " - << "refresh agent " << agent_id + LL_DEBUGS("AvNameCache") << "LLAvatarNameCache refresh agent " << agent_id << LL_ENDL; sAskQueue.insert(agent_id); } @@ -603,9 +606,7 @@ bool LLAvatarNameCache::get(const LLUUID& agent_id, LLAvatarName *av_name) if (!isRequestPending(agent_id)) { - LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::get " - << "queue request for agent " << agent_id - << LL_ENDL; + LL_DEBUGS("AvNameCache") << "LLAvatarNameCache queue request for agent " << agent_id << LL_ENDL; sAskQueue.insert(agent_id); } @@ -734,7 +735,7 @@ bool LLAvatarNameCache::expirationFromCacheControl(const LLSD& headers, F64 *exp fromCacheControl = true; } } - LL_DEBUGS("AvNameCache") + LL_DEBUGS("AvNameCache") << "LLAvatarNameCache " << ( fromCacheControl ? "expires based on cache control " : "default expiration " ) << "in " << *expires - now << " seconds" << LL_ENDL; diff --git a/indra/llmessage/llavatarnamecache.h b/indra/llmessage/llavatarnamecache.h index ea016b3125..5a10053a69 100755 --- a/indra/llmessage/llavatarnamecache.h +++ b/indra/llmessage/llavatarnamecache.h @@ -46,7 +46,7 @@ namespace LLAvatarNameCache void cleanupClass(); // Import/export the name cache to file. - void importFile(std::istream& istr); + bool importFile(std::istream& istr); void exportFile(std::ostream& ostr); // On the viewer, usually a simulator capabilitity. diff --git a/indra/llmessage/llcircuit.cpp b/indra/llmessage/llcircuit.cpp index 3eb0e0d057..8dbe2f8411 100755 --- a/indra/llmessage/llcircuit.cpp +++ b/indra/llmessage/llcircuit.cpp @@ -103,6 +103,7 @@ LLCircuitData::LLCircuitData(const LLHost &host, TPACKETID in_id, mPeakBPSOut(0.f), mPeriodTime(0.0), mExistenceTimer(), + mAckCreationTime(0.f), mCurrentResendCount(0), mLastPacketGap(0), mHeartbeatInterval(circuit_heartbeat_interval), @@ -1078,60 +1079,69 @@ BOOL LLCircuitData::collectRAck(TPACKETID packet_num) } mAcks.push_back(packet_num); + if (mAckCreationTime == 0) + { + mAckCreationTime = getAgeInSeconds(); + } return TRUE; } // this method is called during the message system processAcks() to // send out any acks that did not get sent already. -void LLCircuit::sendAcks() +void LLCircuit::sendAcks(F32 collect_time) { + collect_time = llclamp(collect_time, 0.f, LL_COLLECT_ACK_TIME_MAX); LLCircuitData* cd; - circuit_data_map::iterator end = mSendAckMap.end(); - for(circuit_data_map::iterator it = mSendAckMap.begin(); it != end; ++it) + circuit_data_map::iterator it = mSendAckMap.begin(); + while (it != mSendAckMap.end()) { - cd = (*it).second; - + circuit_data_map::iterator cur_it = it++; + cd = (*cur_it).second; S32 count = (S32)cd->mAcks.size(); - if(count > 0) + F32 age = cd->getAgeInSeconds() - cd->mAckCreationTime; + if (age > collect_time || count == 0) { - // send the packet acks - S32 acks_this_packet = 0; - for(S32 i = 0; i < count; ++i) + if (count>0) { - if(acks_this_packet == 0) + // send the packet acks + S32 acks_this_packet = 0; + for(S32 i = 0; i < count; ++i) { - gMessageSystem->newMessageFast(_PREHASH_PacketAck); + if(acks_this_packet == 0) + { + gMessageSystem->newMessageFast(_PREHASH_PacketAck); + } + gMessageSystem->nextBlockFast(_PREHASH_Packets); + gMessageSystem->addU32Fast(_PREHASH_ID, cd->mAcks[i]); + ++acks_this_packet; + if(acks_this_packet > 250) + { + gMessageSystem->sendMessage(cd->mHost); + acks_this_packet = 0; + } } - gMessageSystem->nextBlockFast(_PREHASH_Packets); - gMessageSystem->addU32Fast(_PREHASH_ID, cd->mAcks[i]); - ++acks_this_packet; - if(acks_this_packet > 250) + if(acks_this_packet > 0) { gMessageSystem->sendMessage(cd->mHost); - acks_this_packet = 0; } - } - if(acks_this_packet > 0) - { - gMessageSystem->sendMessage(cd->mHost); - } - if(gMessageSystem->mVerboseLog) - { - std::ostringstream str; - str << "MSG: -> " << cd->mHost << "\tPACKET ACKS:\t"; - std::ostream_iterator<TPACKETID> append(str, " "); - std::copy(cd->mAcks.begin(), cd->mAcks.end(), append); - LL_INFOS() << str.str() << LL_ENDL; - } + if(gMessageSystem->mVerboseLog) + { + std::ostringstream str; + str << "MSG: -> " << cd->mHost << "\tPACKET ACKS:\t"; + std::ostream_iterator<TPACKETID> append(str, " "); + std::copy(cd->mAcks.begin(), cd->mAcks.end(), append); + LL_INFOS() << str.str() << LL_ENDL; + } - // empty out the acks list - cd->mAcks.clear(); + // empty out the acks list + cd->mAcks.clear(); + cd->mAckCreationTime = 0.f; + } + // remove data map + mSendAckMap.erase(cur_it); } } - - // All acks have been sent, clear the map - mSendAckMap.clear(); } diff --git a/indra/llmessage/llcircuit.h b/indra/llmessage/llcircuit.h index 5b109fc218..b8021bc9f0 100755 --- a/indra/llmessage/llcircuit.h +++ b/indra/llmessage/llcircuit.h @@ -60,6 +60,7 @@ const U8 LL_PACKET_ID_SIZE = 6; const S32 LL_MAX_RESENT_PACKETS_PER_FRAME = 100; const S32 LL_MAX_ACKED_PACKETS_PER_FRAME = 200; +const F32 LL_COLLECT_ACK_TIME_MAX = 2.f; // // Prototypes and Predefines @@ -237,6 +238,7 @@ protected: packet_time_map mPotentialLostPackets; packet_time_map mRecentlyReceivedReliablePackets; std::vector<TPACKETID> mAcks; + F32 mAckCreationTime; // first ack creation time typedef std::map<TPACKETID, LLReliablePacket *> reliable_map; typedef reliable_map::iterator reliable_iter; @@ -302,7 +304,7 @@ public: // this method is called during the message system processAcks() // to send out any acks that did not get sent already. - void sendAcks(); + void sendAcks(F32 collect_time); friend std::ostream& operator<<(std::ostream& s, LLCircuit &circuit); void getInfo(LLSD& info) const; @@ -333,6 +335,7 @@ protected: circuit_data_map mCircuitData; typedef std::set<LLCircuitData *, LLCircuitData::less> ping_set_t; // Circuits sorted by next ping time + ping_set_t mPingSet; // This variable points to the last circuit data we found to diff --git a/indra/llmessage/llhttpclient.cpp b/indra/llmessage/llhttpclient.cpp index 200116337d..f8db3dded2 100755 --- a/indra/llmessage/llhttpclient.cpp +++ b/indra/llmessage/llhttpclient.cpp @@ -157,7 +157,7 @@ namespace { LLBufferStream ostream(channels, buffer.get()); - llifstream fstream(mFilename, std::iostream::binary | std::iostream::out); + llifstream fstream(mFilename.c_str(), std::iostream::binary | std::iostream::out); if(fstream.is_open()) { fstream.seekg(0, std::ios::end); diff --git a/indra/llmessage/llmessageconfig.cpp b/indra/llmessage/llmessageconfig.cpp index f8b2c8f5a6..64e79d6767 100755 --- a/indra/llmessage/llmessageconfig.cpp +++ b/indra/llmessage/llmessageconfig.cpp @@ -96,7 +96,7 @@ bool LLMessageConfigFile::loadFile() { LLSD data; { - llifstream file(filename()); + llifstream file(filename().c_str()); if (file.is_open()) { diff --git a/indra/llmessage/llservicebuilder.cpp b/indra/llmessage/llservicebuilder.cpp index 392e7f1091..cf2e42f95c 100755 --- a/indra/llmessage/llservicebuilder.cpp +++ b/indra/llmessage/llservicebuilder.cpp @@ -34,7 +34,7 @@ void LLServiceBuilder::loadServiceDefinitionsFromFile( const std::string& service_filename) { - llifstream service_file(service_filename, std::ios::binary); + llifstream service_file(service_filename.c_str(), std::ios::binary); if(service_file.is_open()) { LLSD service_data; diff --git a/indra/llmessage/message.cpp b/indra/llmessage/message.cpp index 0c3c14969b..e9ce94ab3b 100755 --- a/indra/llmessage/message.cpp +++ b/indra/llmessage/message.cpp @@ -787,7 +787,7 @@ S32 LLMessageSystem::getReceiveBytes() const } -void LLMessageSystem::processAcks() +void LLMessageSystem::processAcks(F32 collect_time) { F64Seconds mt_sec = getMessageTimeSeconds(); { @@ -813,7 +813,7 @@ void LLMessageSystem::processAcks() mCircuitInfo.resendUnackedPackets(mUnackedListDepth, mUnackedListSize); //cycle through ack list for each host we need to send acks to - mCircuitInfo.sendAcks(); + mCircuitInfo.sendAcks(collect_time); if (!mDenyTrustedCircuitSet.empty()) { diff --git a/indra/llmessage/message.h b/indra/llmessage/message.h index da06b64506..348b09b992 100755 --- a/indra/llmessage/message.h +++ b/indra/llmessage/message.h @@ -331,7 +331,7 @@ public: BOOL poll(F32 seconds); // Number of seconds that we want to block waiting for data, returns if data was received BOOL checkMessages( S64 frame_count = 0 ); - void processAcks(); + void processAcks(F32 collect_time = 0.f); BOOL isMessageFast(const char *msg); BOOL isMessage(const char *msg) diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp index caabbf997f..1571427d51 100755 --- a/indra/llprimitive/llmodel.cpp +++ b/indra/llprimitive/llmodel.cpp @@ -1681,11 +1681,11 @@ LLSD LLModel::writeModel( } } - F32* src_tc = (F32*) face.mTexCoords[j].mV; - //texcoord if (face.mTexCoords) { + F32* src_tc = (F32*) face.mTexCoords[j].mV; + for (U32 k = 0; k < 2; ++k) { //for each component //convert to 16-bit normalized @@ -2012,7 +2012,7 @@ bool LLModel::loadModel(std::istream& is) } } - std::string nm[] = + static const std::string nm[] = { "lowest_lod", "low_lod", diff --git a/indra/llprimitive/llprimitive.cpp b/indra/llprimitive/llprimitive.cpp index 6e4ccb9ea1..29747cb09c 100755 --- a/indra/llprimitive/llprimitive.cpp +++ b/indra/llprimitive/llprimitive.cpp @@ -322,6 +322,11 @@ S32 LLPrimitive::setTEMaterialParams(const U8 index, const LLMaterialPtr pMateri return mTextureList.setMaterialParams(index, pMaterialParams); } +LLMaterialPtr LLPrimitive::getTEMaterialParams(const U8 index) +{ + return mTextureList.getMaterialParams(index); +} + //=============================================================== S32 LLPrimitive::setTEBumpShinyFullbright(const U8 index, const U8 bump) { @@ -1356,9 +1361,8 @@ S32 LLPrimitive::applyParsedTEMessage(LLTEContents& tec) retval |= setTEBumpShinyFullbright(i, tec.bump[i]); retval |= setTEMediaTexGen(i, tec.media_flags[i]); retval |= setTEGlow(i, (F32)tec.glow[i] / (F32)0xFF); - - retval |= setTEMaterialID(i, tec.material_ids[i]); - + retval |= setTEMaterialID(i, tec.material_ids[i]); + coloru = LLColor4U(tec.colors + 4*i); // Note: This is an optimization to send common colors (1.f, 1.f, 1.f, 1.f) diff --git a/indra/llprimitive/llprimitive.h b/indra/llprimitive/llprimitive.h index cdb3f273c2..1bf83e36b4 100755 --- a/indra/llprimitive/llprimitive.h +++ b/indra/llprimitive/llprimitive.h @@ -389,6 +389,8 @@ public: virtual BOOL setMaterial(const U8 material); // returns TRUE if material changed virtual void setTESelected(const U8 te, bool sel); + LLMaterialPtr getTEMaterialParams(const U8 index); + void copyTEs(const LLPrimitive *primitive); S32 packTEField(U8 *cur_ptr, U8 *data_ptr, U8 data_size, U8 last_face_index, EMsgVariableType type) const; S32 unpackTEField(U8 *cur_ptr, U8 *buffer_end, U8 *data_ptr, U8 data_size, U8 face_count, EMsgVariableType type); diff --git a/indra/llprimitive/llprimtexturelist.cpp b/indra/llprimitive/llprimtexturelist.cpp index dfae9699ec..f4f08248b8 100755 --- a/indra/llprimitive/llprimtexturelist.cpp +++ b/indra/llprimitive/llprimtexturelist.cpp @@ -377,6 +377,16 @@ S32 LLPrimTextureList::setMaterialParams(const U8 index, const LLMaterialPtr pMa return TEM_CHANGE_NONE; } +LLMaterialPtr LLPrimTextureList::getMaterialParams(const U8 index) +{ + if (index < mEntryList.size()) + { + return mEntryList[index]->getMaterialParams(); + } + + return LLMaterialPtr(); +} + S32 LLPrimTextureList::size() const { return mEntryList.size(); diff --git a/indra/llprimitive/llprimtexturelist.h b/indra/llprimitive/llprimtexturelist.h index d7fabbbb79..49c636e40f 100755 --- a/indra/llprimitive/llprimtexturelist.h +++ b/indra/llprimitive/llprimtexturelist.h @@ -107,6 +107,8 @@ public: S32 setMaterialID(const U8 index, const LLMaterialID& pMaterialID); S32 setMaterialParams(const U8 index, const LLMaterialPtr pMaterialParams); + LLMaterialPtr getMaterialParams(const U8 index); + S32 size() const; // void forceResize(S32 new_size); diff --git a/indra/llprimitive/object_flags.h b/indra/llprimitive/object_flags.h index 31dbd15ae0..88eaeb034a 100755 --- a/indra/llprimitive/object_flags.h +++ b/indra/llprimitive/object_flags.h @@ -69,6 +69,7 @@ const U32 FLAGS_TEMPORARY_ON_REZ = (1U << 29); //const U32 FLAGS_UNUSED_007 = (1U << 31); // was FLAGS_ZLIB_COMPRESSED const U32 FLAGS_LOCAL = FLAGS_ANIM_SOURCE | FLAGS_CAMERA_SOURCE; +const U32 FLAGS_WORLD = FLAGS_USE_PHYSICS | FLAGS_PHANTOM | FLAGS_TEMPORARY_ON_REZ; typedef enum e_havok_joint_type { diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 0af402efea..1ca6e99ecf 100755 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -53,7 +53,7 @@ bool LLRender::sGLCoreProfile = false; static const U32 LL_NUM_TEXTURE_LAYERS = 32; static const U32 LL_NUM_LIGHT_UNITS = 8; -static GLenum sGLTextureType[] = +static const GLenum sGLTextureType[] = { GL_TEXTURE_2D, GL_TEXTURE_RECTANGLE_ARB, @@ -61,14 +61,14 @@ static GLenum sGLTextureType[] = GL_TEXTURE_2D_MULTISAMPLE }; -static GLint sGLAddressMode[] = +static const GLint sGLAddressMode[] = { GL_REPEAT, GL_MIRRORED_REPEAT, GL_CLAMP_TO_EDGE }; -static GLenum sGLCompareFunc[] = +static const GLenum sGLCompareFunc[] = { GL_NEVER, GL_ALWAYS, @@ -82,7 +82,7 @@ static GLenum sGLCompareFunc[] = const U32 immediate_mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_COLOR | LLVertexBuffer::MAP_TEXCOORD0; -static GLenum sGLBlendFactor[] = +static const GLenum sGLBlendFactor[] = { GL_ONE, GL_ZERO, @@ -99,12 +99,12 @@ static GLenum sGLBlendFactor[] = }; LLTexUnit::LLTexUnit(S32 index) -: mCurrTexType(TT_NONE), mCurrBlendType(TB_MULT), -mCurrColorOp(TBO_MULT), mCurrAlphaOp(TBO_MULT), -mCurrColorSrc1(TBS_TEX_COLOR), mCurrColorSrc2(TBS_PREV_COLOR), -mCurrAlphaSrc1(TBS_TEX_ALPHA), mCurrAlphaSrc2(TBS_PREV_ALPHA), -mCurrColorScale(1), mCurrAlphaScale(1), mCurrTexture(0), -mHasMipMaps(false) + : mCurrTexType(TT_NONE), mCurrBlendType(TB_MULT), + mCurrColorOp(TBO_MULT), mCurrAlphaOp(TBO_MULT), + mCurrColorSrc1(TBS_TEX_COLOR), mCurrColorSrc2(TBS_PREV_COLOR), + mCurrAlphaSrc1(TBS_TEX_ALPHA), mCurrAlphaSrc2(TBS_PREV_ALPHA), + mCurrColorScale(1), mCurrAlphaScale(1), mCurrTexture(0), + mHasMipMaps(false) { llassert_always(index < (S32)LL_NUM_TEXTURE_LAYERS); mIndex = index; @@ -1189,7 +1189,7 @@ void LLRender::syncMatrices() if (shader) { - llassert(shader); + //llassert(shader); bool mvp_done = false; @@ -1288,7 +1288,7 @@ void LLRender::syncMatrices() } else if (!LLGLSLShader::sNoFixedFunction) { - GLenum mode[] = + static const GLenum mode[] = { GL_MODELVIEW, GL_PROJECTION, diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 9f06ccc827..4c05d001a0 100755 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -170,7 +170,8 @@ LLFolderView::LLFolderView(const Params& p) mDraggingOverItem(NULL), mStatusTextBox(NULL), mShowItemLinkOverlays(p.show_item_link_overlays), - mViewModel(p.view_model) + mViewModel(p.view_model), + mGroupedItemModel(p.grouped_item_model) { claimMem(mViewModel); LLPanel* panel = p.parent_panel; @@ -1610,7 +1611,7 @@ void LLFolderView::update() LLFolderViewFilter& filter_object = getFolderViewModel()->getFilter(); - if (filter_object.isModified() && filter_object.isNotDefault()) + if (filter_object.isModified() && filter_object.isNotDefault() && mParentPanel.get()->getVisible()) { mNeedsAutoSelect = TRUE; } @@ -1652,8 +1653,10 @@ void LLFolderView::update() scrollToShowSelection(); } - BOOL filter_finished = getViewModelItem()->passedFilter() - && mViewModel->contentsReady(); + BOOL filter_finished = mViewModel->contentsReady() + && (getViewModelItem()->passedFilter() + || ( getViewModelItem()->getLastFilterGeneration() >= filter_object.getFirstSuccessGeneration() + && !filter_object.isModified())); if (filter_finished || gFocusMgr.childHasKeyboardFocus(mParentPanel.get()) || gFocusMgr.childHasMouseCapture(mParentPanel.get())) @@ -1808,7 +1811,6 @@ void LLFolderView::updateMenuOptions(LLMenuGL* menu) } // Successively filter out invalid options - U32 multi_select_flag = (mSelectedItems.size() > 1 ? ITEM_IN_MULTI_SELECTION : 0x0); U32 flags = multi_select_flag | FIRST_SELECTED_ITEM; for (selected_items_t::iterator item_itor = mSelectedItems.begin(); @@ -1820,6 +1822,14 @@ void LLFolderView::updateMenuOptions(LLMenuGL* menu) flags = multi_select_flag; } + // This adds a check for restrictions based on the entire + // selection set - for example, any one wearable may not push you + // over the limit, but all wearables together still might. + if (getFolderViewGroupedItemModel()) + { + getFolderViewGroupedItemModel()->groupFilterContextMenu(mSelectedItems,*menu); + } + addNoOptions(menu); } diff --git a/indra/llui/llfolderview.h b/indra/llui/llfolderview.h index 08e0a6220a..114dd7bd2f 100755 --- a/indra/llui/llfolderview.h +++ b/indra/llui/llfolderview.h @@ -45,6 +45,7 @@ #include "llscrollcontainer.h" class LLFolderViewModelInterface; +class LLFolderViewGroupedItemModel; class LLFolderViewFolder; class LLFolderViewItem; class LLFolderViewFilter; @@ -93,6 +94,7 @@ public: use_ellipses, show_item_link_overlays; Mandatory<LLFolderViewModelInterface*> view_model; + Optional<LLFolderViewGroupedItemModel*> grouped_item_model; Mandatory<std::string> options_menu; @@ -100,7 +102,7 @@ public: }; friend class LLFolderViewScrollContainer; - typedef std::deque<LLFolderViewItem*> selected_items_t; + typedef folder_view_item_deque selected_items_t; LLFolderView(const Params&); virtual ~LLFolderView( void ); @@ -113,6 +115,9 @@ public: LLFolderViewModelInterface* getFolderViewModel() { return mViewModel; } const LLFolderViewModelInterface* getFolderViewModel() const { return mViewModel; } + LLFolderViewGroupedItemModel* getFolderViewGroupedItemModel() { return mGroupedItemModel; } + const LLFolderViewGroupedItemModel* getFolderViewGroupedItemModel() const { return mGroupedItemModel; } + typedef boost::signals2::signal<void (const std::deque<LLFolderViewItem*>& items, BOOL user_action)> signal_t; void setSelectCallback(const signal_t::slot_type& cb) { mSelectSignal.connect(cb); } void setReshapeCallback(const signal_t::slot_type& cb) { mReshapeSignal.connect(cb); } @@ -300,6 +305,7 @@ protected: LLHandle<LLPanel> mParentPanel; LLFolderViewModelInterface* mViewModel; + LLFolderViewGroupedItemModel* mGroupedItemModel; /** * Is used to determine if we need to cut text In LLFolderViewItem to avoid horizontal scroll. diff --git a/indra/llui/llfolderviewitem.h b/indra/llui/llfolderviewitem.h index 0cd20a0f2d..5ad5731cad 100644..100755 --- a/indra/llui/llfolderviewitem.h +++ b/indra/llui/llfolderviewitem.h @@ -454,5 +454,12 @@ public: template<typename SORT_FUNC> void sortItems(const SORT_FUNC& func) { mItems.sort(func); } }; +typedef std::deque<LLFolderViewItem*> folder_view_item_deque; + +class LLFolderViewGroupedItemModel: public LLRefCount +{ +public: + virtual void groupFilterContextMenu(folder_view_item_deque& selected_items, LLMenuGL& menu) = 0; +}; #endif // LLFOLDERVIEWITEM_H diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index f290edb5ff..7cdbcb0621 100755 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -3689,7 +3689,7 @@ BOOL LLMenuHolderGL::handleKey(KEY key, MASK mask, BOOL called_from_parent) { handled = pMenu->handleKey(key, mask, TRUE); } - else + else if (mask == MASK_NONE || (key >= KEY_LEFT && key <= KEY_DOWN)) { //highlight first enabled one if(pMenu->highlightNextItem(NULL)) diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index 899a0bbab9..db8fdc46b7 100755 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -1825,6 +1825,7 @@ BOOL LLScrollListCtrl::handleRightMouseDown(S32 x, S32 y, MASK mask) return TRUE; } } + return LLUICtrl::handleRightMouseDown(x, y, mask); } return FALSE; } diff --git a/indra/llui/llspellcheck.cpp b/indra/llui/llspellcheck.cpp index 250372da5b..0db4281059 100755 --- a/indra/llui/llspellcheck.cpp +++ b/indra/llui/llspellcheck.cpp @@ -144,12 +144,14 @@ void LLSpellChecker::refreshDictionaryMap() const std::string user_path = getDictionaryUserPath(); // Load dictionary information (file name, friendly name, ...) - llifstream user_file(user_path + DICT_FILE_MAIN, std::ios::binary); + std::string user_filename(user_path + DICT_FILE_MAIN); + llifstream user_file(user_filename.c_str(), std::ios::binary); if ( (!user_file.is_open()) || (LLSDParser::PARSE_FAILURE == LLSDSerialize::fromXMLDocument(sDictMap, user_file)) || (0 == sDictMap.size()) ) { - llifstream app_file(app_path + DICT_FILE_MAIN, std::ios::binary); + std::string app_filename(app_path + DICT_FILE_MAIN); + llifstream app_file(app_filename.c_str(), std::ios::binary); if ( (!app_file.is_open()) || (LLSDParser::PARSE_FAILURE == LLSDSerialize::fromXMLDocument(sDictMap, app_file)) || (0 == sDictMap.size()) ) @@ -159,7 +161,7 @@ void LLSpellChecker::refreshDictionaryMap() } // Load user installed dictionary information - llifstream custom_file(user_path + DICT_FILE_USER, std::ios::binary); + llifstream custom_file(user_filename.c_str(), std::ios::binary); if (custom_file.is_open()) { LLSD custom_dict_map; @@ -215,7 +217,7 @@ void LLSpellChecker::addToDictFile(const std::string& dict_path, const std::stri if (gDirUtilp->fileExists(dict_path)) { - llifstream file_in(dict_path, std::ios::in); + llifstream file_in(dict_path.c_str(), std::ios::in); if (file_in.is_open()) { std::string word; int line_num = 0; @@ -238,7 +240,7 @@ void LLSpellChecker::addToDictFile(const std::string& dict_path, const std::stri word_list.push_back(word); - llofstream file_out(dict_path, std::ios::out | std::ios::trunc); + llofstream file_out(dict_path.c_str(), std::ios::out | std::ios::trunc); if (file_out.is_open()) { file_out << word_list.size() << std::endl; @@ -352,7 +354,7 @@ void LLSpellChecker::initHunspell(const std::string& dict_language) if (gDirUtilp->fileExists(user_path + DICT_FILE_IGNORE)) { - llifstream file_in(user_path + DICT_FILE_IGNORE, std::ios::in); + llifstream file_in((user_path + DICT_FILE_IGNORE).c_str(), std::ios::in); if (file_in.is_open()) { std::string word; int idxLine = 0; @@ -463,7 +465,8 @@ void LLSpellChecker::removeDictionary(const std::string& dict_language) LLSD LLSpellChecker::loadUserDictionaryMap() { LLSD dict_map; - llifstream dict_file(getDictionaryUserPath() + DICT_FILE_USER, std::ios::binary); + std::string dict_filename(getDictionaryUserPath() + DICT_FILE_USER); + llifstream dict_file(dict_filename.c_str(), std::ios::binary); if (dict_file.is_open()) { LLSDSerialize::fromXMLDocument(dict_map, dict_file); @@ -475,7 +478,7 @@ LLSD LLSpellChecker::loadUserDictionaryMap() // static void LLSpellChecker::saveUserDictionaryMap(const LLSD& dict_map) { - llofstream dict_file(getDictionaryUserPath() + DICT_FILE_USER, std::ios::trunc); + llofstream dict_file((getDictionaryUserPath() + DICT_FILE_USER).c_str(), std::ios::trunc); if (dict_file.is_open()) { LLSDSerialize::toPrettyXML(dict_map, dict_file); diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 43e048d216..602a703450 100755 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -38,7 +38,6 @@ #include "lltextutil.h" #include "lltooltip.h" #include "lluictrl.h" -#include "lluriparser.h" #include "llurlaction.h" #include "llurlregistry.h" #include "llview.h" @@ -2063,8 +2062,16 @@ void LLTextBase::appendTextImpl(const std::string &new_text, const LLStyle::Para LLTextUtil::processUrlMatch(&match, this, isContentTrusted() || match.isTrusted()); // output the styled Url - //appendAndHighlightTextImpl(label, part, link_params, match.underlineOnHoverOnly()); appendAndHighlightTextImpl(match.getLabel(), part, link_params, match.underlineOnHoverOnly()); + + // show query part of url with gray color only for LLUrlEntryHTTP and LLUrlEntryHTTPNoProtocol url entries + std::string label = match.getQuery(); + if (label.size()) + { + link_params.color = LLColor4::grey; + link_params.readonly_color = LLColor4::grey; + appendAndHighlightTextImpl(label, part, link_params, match.underlineOnHoverOnly()); + } // set the tooltip for the Url label if (! match.getTooltip().empty()) @@ -2855,13 +2862,44 @@ void LLTextBase::updateRects() needsReflow(); } + // update mTextBoundingRect after mVisibleTextRect took scrolls into account + if (!mLineInfoList.empty() && mScroller) + { + S32 delta_pos = 0; + + switch(mVAlign) + { + case LLFontGL::TOP: + delta_pos = llmax(mVisibleTextRect.getHeight() - mTextBoundingRect.mTop, -mTextBoundingRect.mBottom); + break; + case LLFontGL::VCENTER: + delta_pos = (llmax(mVisibleTextRect.getHeight() - mTextBoundingRect.mTop, -mTextBoundingRect.mBottom) + (mVisibleTextRect.mBottom - mTextBoundingRect.mBottom)) / 2; + break; + case LLFontGL::BOTTOM: + delta_pos = mVisibleTextRect.mBottom - mTextBoundingRect.mBottom; + break; + case LLFontGL::BASELINE: + // do nothing + break; + } + // move line segments to fit new visible rect + if (delta_pos != 0) + { + for (line_list_t::iterator it = mLineInfoList.begin(); it != mLineInfoList.end(); ++it) + { + it->mRect.translate(0, delta_pos); + } + mTextBoundingRect.translate(0, delta_pos); + } + } + // update document container again, using new mVisibleTextRect (that has scrollbars enabled as needed) doc_rect.mBottom = llmin(mVisibleTextRect.mBottom, mTextBoundingRect.mBottom); doc_rect.mLeft = 0; doc_rect.mRight = mScroller ? llmax(mVisibleTextRect.getWidth(), mTextBoundingRect.mRight) : mVisibleTextRect.getWidth(); - doc_rect.mTop = llmax(mVisibleTextRect.mTop, mTextBoundingRect.mTop); + doc_rect.mTop = llmax(mVisibleTextRect.getHeight(), mTextBoundingRect.getHeight()) + doc_rect.mBottom; if (!mScroller) { // push doc rect to top of text widget diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index c433f8ccab..926326aaff 100755 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -814,7 +814,7 @@ BOOL LLTextEditor::handleMouseUp(S32 x, S32 y, MASK mask) BOOL handled = FALSE; // if I'm not currently selecting text - if (!(hasSelection() && hasMouseCapture())) + if (!(mIsSelecting && hasMouseCapture())) { // let text segments handle mouse event handled = LLTextBase::handleMouseUp(x, y, mask); @@ -2448,12 +2448,30 @@ void LLTextEditor::updateLinkSegments() LLTextSegment *segment = *it; if (segment && segment->getStyle() && segment->getStyle()->isLink()) { - // if the link's label (what the user can edit) is a valid Url, - // then update the link's HREF to be the same as the label text. - // This lets users edit Urls in-place. LLStyleConstSP style = segment->getStyle(); LLStyleSP new_style(new LLStyle(*style)); LLWString url_label = wtext.substr(segment->getStart(), segment->getEnd()-segment->getStart()); + + segment_set_t::const_iterator next_it = mSegments.upper_bound(segment); + LLTextSegment *next_segment = *next_it; + if (next_segment) + { + LLWString next_url_label = wtext.substr(next_segment->getStart(), next_segment->getEnd()-next_segment->getStart()); + std::string link_check = wstring_to_utf8str(url_label) + wstring_to_utf8str(next_url_label); + LLUrlMatch match; + + if ( LLUrlRegistry::instance().findUrl(link_check, match)) + { + if(match.getQuery() == wstring_to_utf8str(next_url_label)) + { + continue; + } + } + } + + // if the link's label (what the user can edit) is a valid Url, + // then update the link's HREF to be the same as the label text. + // This lets users edit Urls in-place. if (LLUrlRegistry::instance().hasUrl(url_label)) { std::string new_url = wstring_to_utf8str(url_label); diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index 7e4104c49b..5f60d80858 100755 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -39,8 +39,6 @@ #include "lluicolortable.h" #include "message.h" -#include "uriparser/Uri.h" - #define APP_HEADER_REGEX "((x-grid-location-info://[-\\w\\.]+/app)|(secondlife:///app))" // Utility functions @@ -48,7 +46,8 @@ std::string localize_slapp_label(const std::string& url, const std::string& full LLUrlEntryBase::LLUrlEntryBase() -{} +{ +} LLUrlEntryBase::~LLUrlEntryBase() { @@ -187,6 +186,30 @@ bool LLUrlEntryBase::isWikiLinkCorrect(std::string url) return (LLUrlRegistry::instance().hasUrl(label)) ? false : true; } +std::string LLUrlEntryBase::urlToLabelWithGreyQuery(const std::string &url) const +{ + LLUriParser up(unescapeUrl(url)); + up.normalize(); + + std::string label; + up.extractParts(); + up.glueFirst(label); + + return label; +} + +std::string LLUrlEntryBase::urlToGreyQuery(const std::string &url) const +{ + LLUriParser up(unescapeUrl(url)); + + std::string query; + up.extractParts(); + up.glueSecond(query); + + return query; +} + + static std::string getStringAfterToken(const std::string str, const std::string token) { size_t pos = str.find(token); @@ -203,6 +226,7 @@ static std::string getStringAfterToken(const std::string str, const std::string // LLUrlEntryHTTP Describes generic http: and https: Urls // LLUrlEntryHTTP::LLUrlEntryHTTP() + : LLUrlEntryBase() { mPattern = boost::regex("https?://([-\\w\\.]+)+(:\\d+)?(:\\w+)?(@\\d+)?(@\\w+)?/?\\S*", boost::regex::perl|boost::regex::icase); @@ -212,6 +236,25 @@ LLUrlEntryHTTP::LLUrlEntryHTTP() std::string LLUrlEntryHTTP::getLabel(const std::string &url, const LLUrlLabelCallback &cb) { + return urlToLabelWithGreyQuery(url); +} + +std::string LLUrlEntryHTTP::getQuery(const std::string &url) const +{ + return urlToGreyQuery(url); +} + +std::string LLUrlEntryHTTP::getUrl(const std::string &string) const +{ + if (string.find("://") == std::string::npos) + { + return "http://" + escapeUrl(string); + } + return escapeUrl(string); +} + +std::string LLUrlEntryHTTP::getTooltip(const std::string &url) const +{ return unescapeUrl(url); } @@ -247,6 +290,7 @@ std::string LLUrlEntryHTTPLabel::getUrl(const std::string &string) const // LLUrlEntryHTTPNoProtocol Describes generic Urls like www.google.com // LLUrlEntryHTTPNoProtocol::LLUrlEntryHTTPNoProtocol() + : LLUrlEntryBase() { mPattern = boost::regex("(" "\\bwww\\.\\S+\\.\\S+" // i.e. www.FOO.BAR @@ -260,7 +304,12 @@ LLUrlEntryHTTPNoProtocol::LLUrlEntryHTTPNoProtocol() std::string LLUrlEntryHTTPNoProtocol::getLabel(const std::string &url, const LLUrlLabelCallback &cb) { - return unescapeUrl(url); + return urlToLabelWithGreyQuery(url); +} + +std::string LLUrlEntryHTTPNoProtocol::getQuery(const std::string &url) const +{ + return urlToGreyQuery(url); } std::string LLUrlEntryHTTPNoProtocol::getUrl(const std::string &string) const @@ -272,6 +321,95 @@ std::string LLUrlEntryHTTPNoProtocol::getUrl(const std::string &string) const return escapeUrl(string); } +std::string LLUrlEntryHTTPNoProtocol::getTooltip(const std::string &url) const +{ + return unescapeUrl(url); +} + +LLUrlEntryInvalidSLURL::LLUrlEntryInvalidSLURL() + : LLUrlEntryBase() +{ + mPattern = boost::regex("(http://(maps.secondlife.com|slurl.com)/secondlife/|secondlife://(/app/(worldmap|teleport)/)?)[^ /]+(/-?[0-9]+){1,3}(/?(\\?title|\\?img|\\?msg)=\\S*)?/?", + boost::regex::perl|boost::regex::icase); + mMenuName = "menu_url_http.xml"; + mTooltip = LLTrans::getString("TooltipHttpUrl"); +} + +std::string LLUrlEntryInvalidSLURL::getLabel(const std::string &url, const LLUrlLabelCallback &cb) +{ + + return escapeUrl(url); +} + +std::string LLUrlEntryInvalidSLURL::getUrl(const std::string &string) const +{ + return escapeUrl(string); +} + +std::string LLUrlEntryInvalidSLURL::getTooltip(const std::string &url) const +{ + return unescapeUrl(url); +} + +bool LLUrlEntryInvalidSLURL::isSLURLvalid(const std::string &url) const +{ + S32 actual_parts; + + if(url.find(".com/secondlife/") != std::string::npos) + { + actual_parts = 5; + } + else if(url.find("/app/") != std::string::npos) + { + actual_parts = 6; + } + else + { + actual_parts = 3; + } + + LLURI uri(url); + LLSD path_array = uri.pathArray(); + S32 path_parts = path_array.size(); + S32 x,y,z; + + if (path_parts == actual_parts) + { + // handle slurl with (X,Y,Z) coordinates + LLStringUtil::convertToS32(path_array[path_parts-3],x); + LLStringUtil::convertToS32(path_array[path_parts-2],y); + LLStringUtil::convertToS32(path_array[path_parts-1],z); + + if((x>= 0 && x<= 256) && (y>= 0 && y<= 256) && (z>= 0)) + { + return TRUE; + } + } + else if (path_parts == (actual_parts-1)) + { + // handle slurl with (X,Y) coordinates + + LLStringUtil::convertToS32(path_array[path_parts-2],x); + LLStringUtil::convertToS32(path_array[path_parts-1],y); + ; + if((x>= 0 && x<= 256) && (y>= 0 && y<= 256)) + { + return TRUE; + } + } + else if (path_parts == (actual_parts-2)) + { + // handle slurl with (X) coordinate + LLStringUtil::convertToS32(path_array[path_parts-1],x); + if(x>= 0 && x<= 256) + { + return TRUE; + } + } + + return FALSE; +} + // // LLUrlEntrySLURL Describes generic http: and https: Urls // @@ -293,6 +431,7 @@ std::string LLUrlEntrySLURL::getLabel(const std::string &url, const LLUrlLabelCa // - http://slurl.com/secondlife/Place/X // - http://slurl.com/secondlife/Place // + LLURI uri(url); LLSD path_array = uri.pathArray(); S32 path_parts = path_array.size(); @@ -345,30 +484,56 @@ std::string LLUrlEntrySLURL::getLocation(const std::string &url) const } // -// LLUrlEntrySeconlifeURLs Describes *secondlife.com and *lindenlab.com urls to substitute icon 'hand.png' before link +// LLUrlEntrySeconlifeURL Describes *secondlife.com/ and *lindenlab.com/ urls to substitute icon 'hand.png' before link // -LLUrlEntrySeconlifeURL::LLUrlEntrySeconlifeURL() -{ - mPattern = boost::regex("\\b(https?://)?([-\\w\\.]*\\.)?(secondlife|lindenlab)\\.com(:\\d{1,5})?(/\\S*)?\\b", +LLUrlEntrySecondlifeURL::LLUrlEntrySecondlifeURL() +{ + mPattern = boost::regex("(https?://)?([-\\w\\.]*\\.)?(secondlife|lindenlab)\\.com(:\\d{1,5})?\\/\\S*", boost::regex::perl|boost::regex::icase); mIcon = "Hand"; mMenuName = "menu_url_http.xml"; + mTooltip = LLTrans::getString("TooltipHttpUrl"); } -std::string LLUrlEntrySeconlifeURL::getLabel(const std::string &url, const LLUrlLabelCallback &cb) +/// Return the url from a string that matched the regex +std::string LLUrlEntrySecondlifeURL::getUrl(const std::string &string) const { - LLUriParser up(url); - up.extractParts(); - return up.host(); + if (string.find("://") == std::string::npos) + { + return "https://" + escapeUrl(string); + } + return escapeUrl(string); } -std::string LLUrlEntrySeconlifeURL::getTooltip(const std::string &url) const +std::string LLUrlEntrySecondlifeURL::getLabel(const std::string &url, const LLUrlLabelCallback &cb) +{ + return urlToLabelWithGreyQuery(url); +} + +std::string LLUrlEntrySecondlifeURL::getQuery(const std::string &url) const +{ + return urlToGreyQuery(url); +} + +std::string LLUrlEntrySecondlifeURL::getTooltip(const std::string &url) const { return url; } // +// LLUrlEntrySimpleSecondlifeURL Describes *secondlife.com and *lindenlab.com urls to substitute icon 'hand.png' before link +// +LLUrlEntrySimpleSecondlifeURL::LLUrlEntrySimpleSecondlifeURL() + { + mPattern = boost::regex("(https?://)?([-\\w\\.]*\\.)?(secondlife|lindenlab)\\.com(?!\\S)", + boost::regex::perl|boost::regex::icase); + + mIcon = "Hand"; + mMenuName = "menu_url_http.xml"; +} + +// // LLUrlEntryAgent Describes a Second Life agent Url, e.g., // secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/about // x-grid-location-info://lincoln.lindenlab.com/app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/about diff --git a/indra/llui/llurlentry.h b/indra/llui/llurlentry.h index 1cb11cdb1c..60a494974f 100755 --- a/indra/llui/llurlentry.h +++ b/indra/llui/llurlentry.h @@ -78,6 +78,9 @@ public: /// Given a matched Url, return a label for the Url virtual std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) { return url; } + /// Return port, query and fragment parts for the Url + virtual std::string getQuery(const std::string &url) const { return ""; } + /// Return an icon that can be displayed next to Urls of this type virtual std::string getIcon(const std::string &url); @@ -104,6 +107,8 @@ public: bool isWikiLinkCorrect(std::string url); + virtual bool isSLURLvalid(const std::string &url) const { return TRUE; }; + protected: std::string getIDStringFromUrl(const std::string &url) const; std::string escapeUrl(const std::string &url) const; @@ -111,6 +116,8 @@ protected: std::string getLabelFromWikiLink(const std::string &url) const; std::string getUrlFromWikiLink(const std::string &string) const; void addObserver(const std::string &id, const std::string &url, const LLUrlLabelCallback &cb); + std::string urlToLabelWithGreyQuery(const std::string &url) const; + std::string urlToGreyQuery(const std::string &url) const; virtual void callObservers(const std::string &id, const std::string &label, const std::string& icon); typedef struct { @@ -133,6 +140,9 @@ class LLUrlEntryHTTP : public LLUrlEntryBase public: LLUrlEntryHTTP(); /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); + /*virtual*/ std::string getQuery(const std::string &url) const; + /*virtual*/ std::string getUrl(const std::string &string) const; + /*virtual*/ std::string getTooltip(const std::string &url) const; }; /// @@ -155,7 +165,20 @@ class LLUrlEntryHTTPNoProtocol : public LLUrlEntryBase public: LLUrlEntryHTTPNoProtocol(); /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); + /*virtual*/ std::string getQuery(const std::string &url) const; /*virtual*/ std::string getUrl(const std::string &string) const; + /*virtual*/ std::string getTooltip(const std::string &url) const; +}; + +class LLUrlEntryInvalidSLURL : public LLUrlEntryBase +{ +public: + LLUrlEntryInvalidSLURL(); + /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); + /*virtual*/ std::string getUrl(const std::string &string) const; + /*virtual*/ std::string getTooltip(const std::string &url) const; + + bool isSLURLvalid(const std::string &url) const; }; /// @@ -172,16 +195,24 @@ public: /// /// LLUrlEntrySeconlifeURLs Describes *secondlife.com and *lindenlab.com Urls /// -class LLUrlEntrySeconlifeURL : public LLUrlEntryBase +class LLUrlEntrySecondlifeURL : public LLUrlEntryBase { public: - LLUrlEntrySeconlifeURL(); - bool isTrusted() const { return true; } + LLUrlEntrySecondlifeURL(); + /*virtual*/ bool isTrusted() const { return true; } + /*virtual*/ std::string getUrl(const std::string &string) const; /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); + /*virtual*/ std::string getQuery(const std::string &url) const; /*virtual*/ std::string getTooltip(const std::string &url) const; +}; -private: - std::string mLabel; +/// +/// LLUrlEntrySeconlifeURLs Describes *secondlife.com and *lindenlab.com Urls +/// +class LLUrlEntrySimpleSecondlifeURL : public LLUrlEntrySecondlifeURL +{ +public: + LLUrlEntrySimpleSecondlifeURL(); }; /// diff --git a/indra/llui/llurlmatch.cpp b/indra/llui/llurlmatch.cpp index 016d1ca92d..2f2ac969e1 100755 --- a/indra/llui/llurlmatch.cpp +++ b/indra/llui/llurlmatch.cpp @@ -42,8 +42,8 @@ LLUrlMatch::LLUrlMatch() : { } -void LLUrlMatch::setValues(U32 start, U32 end, const std::string &url, - const std::string &label, const std::string &tooltip, +void LLUrlMatch::setValues(U32 start, U32 end, const std::string &url, const std::string &label, + const std::string& query, const std::string &tooltip, const std::string &icon, const LLStyle::Params& style, const std::string &menu, const std::string &location, const LLUUID& id, bool underline_on_hover_only, bool trusted) @@ -52,6 +52,7 @@ void LLUrlMatch::setValues(U32 start, U32 end, const std::string &url, mEnd = end; mUrl = url; mLabel = label; + mQuery = query; mTooltip = tooltip; mIcon = icon; mStyle = style; diff --git a/indra/llui/llurlmatch.h b/indra/llui/llurlmatch.h index 9f8960b32f..ff699902ca 100755 --- a/indra/llui/llurlmatch.h +++ b/indra/llui/llurlmatch.h @@ -62,6 +62,9 @@ public: /// return a label that can be used for the display of this Url std::string getLabel() const { return mLabel; } + /// return a right part of url which should be drawn in grey + std::string getQuery() const { return mQuery; } + /// return a message that could be displayed in a tooltip or status bar std::string getTooltip() const { return mTooltip; } @@ -85,10 +88,10 @@ public: /// Change the contents of this match object (used by LLUrlRegistry) void setValues(U32 start, U32 end, const std::string &url, const std::string &label, - const std::string &tooltip, const std::string &icon, + const std::string& query, const std::string &tooltip, const std::string &icon, const LLStyle::Params& style, const std::string &menu, const std::string &location, const LLUUID& id, - bool underline_on_hover_only = false, bool trusted = false ); + bool underline_on_hover_only = false, bool trusted = false); const LLUUID& getID() const { return mID; } private: @@ -96,6 +99,7 @@ private: U32 mEnd; std::string mUrl; std::string mLabel; + std::string mQuery; std::string mTooltip; std::string mIcon; std::string mMenuName; diff --git a/indra/llui/llurlregistry.cpp b/indra/llui/llurlregistry.cpp index 9e8d8d01f1..1143574968 100755 --- a/indra/llui/llurlregistry.cpp +++ b/indra/llui/llurlregistry.cpp @@ -44,10 +44,13 @@ LLUrlRegistry::LLUrlRegistry() registerUrl(new LLUrlEntryNoLink()); mUrlEntryIcon = new LLUrlEntryIcon(); registerUrl(mUrlEntryIcon); + mLLUrlEntryInvalidSLURL = new LLUrlEntryInvalidSLURL(); + registerUrl(mLLUrlEntryInvalidSLURL); registerUrl(new LLUrlEntrySLURL()); // decorated links for host names like: secondlife.com and lindenlab.com - registerUrl(new LLUrlEntrySeconlifeURL()); + registerUrl(new LLUrlEntrySecondlifeURL()); + registerUrl(new LLUrlEntrySimpleSecondlifeURL()); registerUrl(new LLUrlEntryHTTP()); mUrlEntryHTTPLabel = new LLUrlEntryHTTPLabel(); @@ -188,6 +191,14 @@ bool LLUrlRegistry::findUrl(const std::string &text, LLUrlMatch &match, const LL if (start < match_start || match_entry == NULL) { + if (mLLUrlEntryInvalidSLURL == *it) + { + if(url_entry && url_entry->isSLURLvalid(text.substr(start, end - start + 1))) + { + continue; + } + } + if((mUrlEntryHTTPLabel == *it) || (mUrlEntrySLLabel == *it)) { if(url_entry && !url_entry->isWikiLinkCorrect(text.substr(start, end - start + 1))) @@ -209,13 +220,17 @@ bool LLUrlRegistry::findUrl(const std::string &text, LLUrlMatch &match, const LL // fill in the LLUrlMatch object and return it std::string url = text.substr(match_start, match_end - match_start + 1); - LLUriParser up(url); - up.normalize(); - url = up.normalizedUri(); + if (match_entry == mUrlEntryTrusted) + { + LLUriParser up(url); + up.normalize(); + url = up.normalizedUri(); + } match.setValues(match_start, match_end, match_entry->getUrl(url), match_entry->getLabel(url, cb), + match_entry->getQuery(url), match_entry->getTooltip(url), match_entry->getIcon(url), match_entry->getStyle(), @@ -243,7 +258,7 @@ bool LLUrlRegistry::findUrl(const LLWString &text, LLUrlMatch &match, const LLUr // character encoding, so we need to update the start // and end values to be correct for the wide string. LLWString wurl = utf8str_to_wstring(match.getUrl()); - S32 start = text.find(wurl); + size_t start = text.find(wurl); if (start == std::string::npos) { return false; @@ -252,6 +267,7 @@ bool LLUrlRegistry::findUrl(const LLWString &text, LLUrlMatch &match, const LLUr match.setValues(start, end, match.getUrl(), match.getLabel(), + match.getQuery(), match.getTooltip(), match.getIcon(), match.getStyle(), diff --git a/indra/llui/llurlregistry.h b/indra/llui/llurlregistry.h index 1cb403dfc9..5ce4048d5d 100755 --- a/indra/llui/llurlregistry.h +++ b/indra/llui/llurlregistry.h @@ -93,7 +93,9 @@ private: friend class LLSingleton<LLUrlRegistry>; std::vector<LLUrlEntryBase *> mUrlEntry; + LLUrlEntryBase* mUrlEntryTrusted; LLUrlEntryBase* mUrlEntryIcon; + LLUrlEntryBase* mLLUrlEntryInvalidSLURL; LLUrlEntryBase* mUrlEntryHTTPLabel; LLUrlEntryBase* mUrlEntrySLLabel; }; diff --git a/indra/llui/llviewereventrecorder.cpp b/indra/llui/llviewereventrecorder.cpp index c5a4354f32..9fe6a542b4 100644 --- a/indra/llui/llviewereventrecorder.cpp +++ b/indra/llui/llviewereventrecorder.cpp @@ -50,7 +50,7 @@ bool LLViewerEventRecorder::displayViewerEventRecorderMenuItems() { void LLViewerEventRecorder::setEventLoggingOn() { if (! mLog.is_open()) { - mLog.open(mLogFilename, llofstream::out); + mLog.open(mLogFilename.c_str(), std::ios_base::out); } logEvents=true; LL_DEBUGS() << "LLViewerEventRecorder::setEventLoggingOn event logging turned on" << LL_ENDL; diff --git a/indra/llui/tests/llurlmatch_test.cpp b/indra/llui/tests/llurlmatch_test.cpp index 55c1efefef..843886eb69 100755 --- a/indra/llui/tests/llurlmatch_test.cpp +++ b/indra/llui/tests/llurlmatch_test.cpp @@ -151,7 +151,7 @@ namespace tut LLUrlMatch match; ensure("empty()", match.empty()); - match.setValues(0, 1, "http://secondlife.com", "Second Life", "", "", LLStyle::Params(), "", "", LLUUID::null); + match.setValues(0, 1, "http://secondlife.com", "", "Second Life", "", "", LLStyle::Params(), "", "", LLUUID::null); ensure("! empty()", ! match.empty()); } @@ -164,7 +164,7 @@ namespace tut LLUrlMatch match; ensure_equals("getStart() == 0", match.getStart(), 0); - match.setValues(10, 20, "", "", "", "", LLStyle::Params(), "", "", LLUUID::null); + match.setValues(10, 20, "", "", "", "", "", LLStyle::Params(), "", "", LLUUID::null); ensure_equals("getStart() == 10", match.getStart(), 10); } @@ -177,7 +177,7 @@ namespace tut LLUrlMatch match; ensure_equals("getEnd() == 0", match.getEnd(), 0); - match.setValues(10, 20, "", "", "", "", LLStyle::Params(), "", "", LLUUID::null); + match.setValues(10, 20, "", "", "", "", "", LLStyle::Params(), "", "", LLUUID::null); ensure_equals("getEnd() == 20", match.getEnd(), 20); } @@ -190,10 +190,10 @@ namespace tut LLUrlMatch match; ensure_equals("getUrl() == ''", match.getUrl(), ""); - match.setValues(10, 20, "http://slurl.com/", "", "", "", LLStyle::Params(), "", "", LLUUID::null); + match.setValues(10, 20, "http://slurl.com/", "", "", "", "", LLStyle::Params(), "", "", LLUUID::null); ensure_equals("getUrl() == 'http://slurl.com/'", match.getUrl(), "http://slurl.com/"); - match.setValues(10, 20, "", "", "", "", LLStyle::Params(), "", "", LLUUID::null); + match.setValues(10, 20, "", "", "", "", "", LLStyle::Params(), "", "", LLUUID::null); ensure_equals("getUrl() == '' (2)", match.getUrl(), ""); } @@ -206,10 +206,10 @@ namespace tut LLUrlMatch match; ensure_equals("getLabel() == ''", match.getLabel(), ""); - match.setValues(10, 20, "", "Label", "", "", LLStyle::Params(), "", "", LLUUID::null); + match.setValues(10, 20, "", "Label", "", "", "", LLStyle::Params(), "", "", LLUUID::null); ensure_equals("getLabel() == 'Label'", match.getLabel(), "Label"); - match.setValues(10, 20, "", "", "", "", LLStyle::Params(), "", "", LLUUID::null); + match.setValues(10, 20, "", "", "", "", "", LLStyle::Params(), "", "", LLUUID::null); ensure_equals("getLabel() == '' (2)", match.getLabel(), ""); } @@ -222,10 +222,10 @@ namespace tut LLUrlMatch match; ensure_equals("getTooltip() == ''", match.getTooltip(), ""); - match.setValues(10, 20, "", "", "Info", "", LLStyle::Params(), "", "", LLUUID::null); + match.setValues(10, 20, "", "", "", "Info", "", LLStyle::Params(), "", "", LLUUID::null); ensure_equals("getTooltip() == 'Info'", match.getTooltip(), "Info"); - match.setValues(10, 20, "", "", "", "", LLStyle::Params(), "", "", LLUUID::null); + match.setValues(10, 20, "", "", "", "", "", LLStyle::Params(), "", "", LLUUID::null); ensure_equals("getTooltip() == '' (2)", match.getTooltip(), ""); } @@ -238,10 +238,10 @@ namespace tut LLUrlMatch match; ensure_equals("getIcon() == ''", match.getIcon(), ""); - match.setValues(10, 20, "", "", "", "Icon", LLStyle::Params(), "", "", LLUUID::null); + match.setValues(10, 20, "", "", "", "", "Icon", LLStyle::Params(), "", "", LLUUID::null); ensure_equals("getIcon() == 'Icon'", match.getIcon(), "Icon"); - match.setValues(10, 20, "", "", "", "", LLStyle::Params(), "", "", LLUUID::null); + match.setValues(10, 20, "", "", "", "", "", LLStyle::Params(), "", "", LLUUID::null); ensure_equals("getIcon() == '' (2)", match.getIcon(), ""); } @@ -254,10 +254,10 @@ namespace tut LLUrlMatch match; ensure("getMenuName() empty", match.getMenuName().empty()); - match.setValues(10, 20, "", "", "", "Icon", LLStyle::Params(), "xui_file.xml", "", LLUUID::null); + match.setValues(10, 20, "", "", "", "", "Icon", LLStyle::Params(), "xui_file.xml", "", LLUUID::null); ensure_equals("getMenuName() == \"xui_file.xml\"", match.getMenuName(), "xui_file.xml"); - match.setValues(10, 20, "", "", "", "", LLStyle::Params(), "", "", LLUUID::null); + match.setValues(10, 20, "", "", "", "", "", LLStyle::Params(), "", "", LLUUID::null); ensure("getMenuName() empty (2)", match.getMenuName().empty()); } @@ -270,10 +270,10 @@ namespace tut LLUrlMatch match; ensure("getLocation() empty", match.getLocation().empty()); - match.setValues(10, 20, "", "", "", "Icon", LLStyle::Params(), "xui_file.xml", "Paris", LLUUID::null); + match.setValues(10, 20, "", "", "", "", "Icon", LLStyle::Params(), "xui_file.xml", "Paris", LLUUID::null); ensure_equals("getLocation() == \"Paris\"", match.getLocation(), "Paris"); - match.setValues(10, 20, "", "", "", "", LLStyle::Params(), "", "", LLUUID::null); + match.setValues(10, 20, "", "", "", "", "", LLStyle::Params(), "", "", LLUUID::null); ensure("getLocation() empty (2)", match.getLocation().empty()); } } diff --git a/indra/llvfs/llpidlock.cpp b/indra/llvfs/llpidlock.cpp index e64368e8d7..6572edead3 100644 --- a/indra/llvfs/llpidlock.cpp +++ b/indra/llvfs/llpidlock.cpp @@ -95,7 +95,7 @@ LLPidLockFile& LLPidLockFile::instance() void LLPidLockFile::writeLockFile(LLSD pids) { - llofstream ofile(mLockName); + llofstream ofile(mLockName.c_str()); if (!LLSDSerialize::toXML(pids,ofile)) { @@ -119,7 +119,7 @@ bool LLPidLockFile::requestLock(LLNameTable<void *> *name_table, bool autosave, LLSD out_pids; out_pids.append( (LLSD::Integer)mPID ); - llifstream ifile(mLockName); + llifstream ifile(mLockName.c_str()); if (ifile.is_open()) { //If file exists, we need to decide whether or not to continue. @@ -175,7 +175,7 @@ bool LLPidLockFile::checkLock() void LLPidLockFile::releaseLock() { - llifstream ifile(mLockName); + llifstream ifile(mLockName.c_str()); LLSD in_pids; LLSD out_pids; bool write_file=FALSE; diff --git a/indra/llwindow/llwindowheadless.cpp b/indra/llwindow/llwindowheadless.cpp index e6e6bc67ff..70f473281b 100755 --- a/indra/llwindow/llwindowheadless.cpp +++ b/indra/llwindow/llwindowheadless.cpp @@ -51,4 +51,3 @@ LLWindowHeadless::~LLWindowHeadless() void LLWindowHeadless::swapBuffers() { } - diff --git a/indra/llwindow/llwindowheadless.h b/indra/llwindow/llwindowheadless.h index 1f767f4c97..c692666df1 100755 --- a/indra/llwindow/llwindowheadless.h +++ b/indra/llwindow/llwindowheadless.h @@ -75,7 +75,8 @@ public: /*virtual*/ void delayInputProcessing() {}; /*virtual*/ void swapBuffers(); - // handy coordinate space conversion routines + + // handy coordinate space conversion routines /*virtual*/ BOOL convertCoords(LLCoordScreen from, LLCoordWindow *to) { return FALSE; }; /*virtual*/ BOOL convertCoords(LLCoordWindow from, LLCoordScreen *to) { return FALSE; }; /*virtual*/ BOOL convertCoords(LLCoordWindow from, LLCoordGL *to) { return FALSE; }; diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index b2f1d618ef..15e054fb5d 100755 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -898,6 +898,11 @@ void LLWindowMacOSX::swapBuffers() CGLFlushDrawable(mContext); } +void LLWindowMacOSX::restoreGLContext() +{ + CGLSetCurrentContext(mContext); +} + F32 LLWindowMacOSX::getGamma() { F32 result = 2.2; // Default to something sane @@ -1152,6 +1157,8 @@ void LLWindowMacOSX::beforeDialog() void LLWindowMacOSX::afterDialog() { + //For fix problem with Core Flow view on OSX + restoreGLContext(); } diff --git a/indra/llwindow/llwindowmacosx.h b/indra/llwindow/llwindowmacosx.h index 825fd05c5f..9e9bd8ae39 100755 --- a/indra/llwindow/llwindowmacosx.h +++ b/indra/llwindow/llwindowmacosx.h @@ -87,7 +87,7 @@ public: /*virtual*/ void gatherInput(); /*virtual*/ void delayInputProcessing() {}; /*virtual*/ void swapBuffers(); - + // handy coordinate space conversion routines /*virtual*/ BOOL convertCoords(LLCoordScreen from, LLCoordWindow *to); /*virtual*/ BOOL convertCoords(LLCoordWindow from, LLCoordScreen *to); @@ -155,7 +155,9 @@ protected: //Satisfy MAINT-3135 and MAINT-3288 with a flag. /*virtual */ void setOldResize(bool oldresize) {setResizeMode(oldresize, mGLView); } - + +private: + void restoreGLContext(); protected: // diff --git a/indra/llwindow/llwindowmesaheadless.h b/indra/llwindow/llwindowmesaheadless.h index 8f70aee4f6..00e42240e6 100755 --- a/indra/llwindow/llwindowmesaheadless.h +++ b/indra/llwindow/llwindowmesaheadless.h @@ -77,6 +77,7 @@ public: /*virtual*/ void gatherInput() {}; /*virtual*/ void delayInputProcessing() {}; /*virtual*/ void swapBuffers(); + /*virtual*/ void restoreGLContext() {}; // handy coordinate space conversion routines /*virtual*/ BOOL convertCoords(LLCoordScreen from, LLCoordWindow *to) { return FALSE; }; diff --git a/indra/llwindow/llwindowsdl.h b/indra/llwindow/llwindowsdl.h index c5ce892a04..7193e6f45a 100755 --- a/indra/llwindow/llwindowsdl.h +++ b/indra/llwindow/llwindowsdl.h @@ -97,6 +97,7 @@ public: /*virtual*/ void processMiscNativeEvents(); /*virtual*/ void gatherInput(); /*virtual*/ void swapBuffers(); + /*virtual*/ void restoreGLContext() {}; /*virtual*/ void delayInputProcessing() { }; diff --git a/indra/llwindow/llwindowwin32.h b/indra/llwindow/llwindowwin32.h index 169d264808..2ca8d48fc7 100755 --- a/indra/llwindow/llwindowwin32.h +++ b/indra/llwindow/llwindowwin32.h @@ -83,6 +83,7 @@ public: /*virtual*/ void gatherInput(); /*virtual*/ void delayInputProcessing(); /*virtual*/ void swapBuffers(); + /*virtual*/ void restoreGLContext() {}; // handy coordinate space conversion routines /*virtual*/ BOOL convertCoords(LLCoordScreen from, LLCoordWindow *to); diff --git a/indra/llxml/llcontrol.cpp b/indra/llxml/llcontrol.cpp index 598a802d67..4e3d0ab392 100755 --- a/indra/llxml/llcontrol.cpp +++ b/indra/llxml/llcontrol.cpp @@ -833,7 +833,7 @@ U32 LLControlGroup::saveToFile(const std::string& filename, BOOL nondefault_only } } llofstream file; - file.open(filename); + file.open(filename.c_str()); if (file.is_open()) { LLSDSerialize::toPrettyXML(settings, file); @@ -853,7 +853,7 @@ U32 LLControlGroup::loadFromFile(const std::string& filename, bool set_default_v { LLSD settings; llifstream infile; - infile.open(filename); + infile.open(filename.c_str()); if(!infile.is_open()) { LL_WARNS("Settings") << "Cannot find file " << filename << " to load." << LL_ENDL; diff --git a/indra/llxml/tests/llcontrol_test.cpp b/indra/llxml/tests/llcontrol_test.cpp index c273773c9b..2b691ffbb1 100755 --- a/indra/llxml/tests/llcontrol_test.cpp +++ b/indra/llxml/tests/llcontrol_test.cpp @@ -80,7 +80,7 @@ namespace tut } void writeSettingsFile(const LLSD& config) { - llofstream file(mTestConfigFile); + llofstream file(mTestConfigFile.c_str()); if (file.is_open()) { LLSDSerialize::toPrettyXML(config, file); diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt index 0bbe2c1160..ca06baa571 100644 --- a/indra/newview/VIEWER_VERSION.txt +++ b/indra/newview/VIEWER_VERSION.txt @@ -1 +1 @@ -3.7.27 +3.7.31 diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 6933fe220e..9e52ea33ae 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -49,6 +49,17 @@ <key>Value</key> <real>300</real> </map> + <key>AckCollectTime</key> + <map> + <key>Comment</key> + <string>Ack messages collection and grouping time</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>0.1</real> + </map> <key>AdminMenu</key> <map> <key>Comment</key> @@ -5019,6 +5030,7 @@ <key>Type</key> <string>LLSD</string> <key>Value</key> + <array/> </map> <key>LSLFindCaseInsensitivity</key> <map> @@ -11765,7 +11777,7 @@ <key>Type</key> <string>F32</string> <key>Value</key> - <integer>0.0</integer> + <real>0.0</real> </map> <key>TextureFetchSource</key> <map> @@ -13208,6 +13220,17 @@ <key>Value</key> <integer>1</integer> </map> + <key>EnvironmentPersistAcrossLogin</key> + <map> + <key>Comment</key> + <string>Keep Environment settings consistent across sessions</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> <key>UseDayCycle</key> <map> <key>Comment</key> @@ -14099,17 +14122,6 @@ <key>Value</key> <integer>-1</integer> </map> - <key>MaxFPS</key> - <map> - <key>Comment</key> - <string>Yield some time to the local host if we reach a threshold framerate.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>-1.0</real> - </map> <key>ForcePeriodicRenderingTime</key> <map> <key>Comment</key> @@ -14682,17 +14694,6 @@ <key>Value</key> <integer>1</integer> </map> - <key>UseHTTPInventory</key> - <map> - <key>Comment</key> - <string>Allow use of http inventory transfers instead of UDP</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> <key>ClickToWalk</key> <map> <key>Comment</key> diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index d119504017..c62b45ed81 100755 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -97,7 +97,7 @@ <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>true</integer> + <integer>1</integer> </map> <key>InstantMessageLogPath</key> <map> diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index f151b15e29..359171c5bd 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -398,6 +398,8 @@ LLAgent::LLAgent() : mAutoPilotFinishedCallback(NULL), mAutoPilotCallbackData(NULL), + mMovementKeysLocked(FALSE), + mEffectColor(new LLUIColor(LLColor4(0.f, 1.f, 1.f, 1.f))), mHaveHomePosition(FALSE), diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index 56bd1428ce..4830cb754b 100755 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -515,6 +515,9 @@ public: void moveYaw(F32 mag, bool reset_view = true); void movePitch(F32 mag); + BOOL isMovementLocked() const { return mMovementKeysLocked; } + void setMovementLocked(BOOL set_locked) { mMovementKeysLocked = set_locked; } + //-------------------------------------------------------------------- // Move the avatar's frame //-------------------------------------------------------------------- @@ -569,6 +572,7 @@ private: void (*mAutoPilotFinishedCallback)(BOOL, void *); void* mAutoPilotCallbackData; LLUUID mLeaderID; + BOOL mMovementKeysLocked; /** Movement ** ** diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index 291dffa210..7f0330ee99 100755 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -35,6 +35,7 @@ #include "llfloaterreg.h" #include "llhudmanager.h" #include "lljoystickbutton.h" +#include "llmorphview.h" #include "llmoveview.h" #include "llselectmgr.h" #include "llsmoothstep.h" @@ -2267,7 +2268,10 @@ void LLAgentCamera::changeCameraToCustomizeAvatar() gFocusMgr.setKeyboardFocus( NULL ); gFocusMgr.setMouseCapture( NULL ); - + if( gMorphView ) + { + gMorphView->setVisible( TRUE ); + } // Remove any pitch or rotation from the avatar LLVector3 at = gAgent.getAtAxis(); at.mV[VZ] = 0.f; diff --git a/indra/newview/llagentpilot.cpp b/indra/newview/llagentpilot.cpp index 44589f0d57..cfc445f998 100755 --- a/indra/newview/llagentpilot.cpp +++ b/indra/newview/llagentpilot.cpp @@ -84,7 +84,7 @@ void LLAgentPilot::loadTxt(const std::string& filename) return; } - llifstream file(filename); + llifstream file(filename.c_str()); if (!file) { @@ -125,7 +125,7 @@ void LLAgentPilot::loadXML(const std::string& filename) return; } - llifstream file(filename); + llifstream file(filename.c_str()); if (!file) { @@ -168,7 +168,7 @@ void LLAgentPilot::save() void LLAgentPilot::saveTxt(const std::string& filename) { llofstream file; - file.open(filename); + file.open(filename.c_str()); if (!file) { @@ -191,7 +191,7 @@ void LLAgentPilot::saveTxt(const std::string& filename) void LLAgentPilot::saveXML(const std::string& filename) { llofstream file; - file.open(filename); + file.open(filename.c_str()); if (!file) { diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index f06ffb4fb3..5589ab4aa7 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -633,10 +633,13 @@ void LLAgentWearables::wearableUpdated(LLWearable *wearable, BOOL removed) // the versions themselves are compatible. This code can be removed before release. if( wearable->getDefinitionVersion() == 24 ) { - wearable->setDefinitionVersion(22); - U32 index = getWearableIndex(wearable); - LL_INFOS() << "forcing wearable type " << wearable->getType() << " to version 22 from 24" << LL_ENDL; - saveWearable(wearable->getType(),index); + U32 index; + if (getWearableIndex(wearable,index)) + { + LL_INFOS() << "forcing wearable type " << wearable->getType() << " to version 22 from 24" << LL_ENDL; + wearable->setDefinitionVersion(22); + saveWearable(wearable->getType(),index); + } } checkWearableAgainstInventory(viewer_wearable); @@ -949,7 +952,7 @@ void LLAgentWearables::removeWearableFinal(const LLWearableType::EType type, boo LLViewerWearable* old_wearable = getViewerWearable(type,i); if (old_wearable) { - popWearable(old_wearable); + eraseWearable(old_wearable); old_wearable->removeFromAvatar(); } } @@ -961,7 +964,7 @@ void LLAgentWearables::removeWearableFinal(const LLWearableType::EType type, boo if (old_wearable) { - popWearable(old_wearable); + eraseWearable(old_wearable); old_wearable->removeFromAvatar(); } } @@ -1163,7 +1166,13 @@ bool LLAgentWearables::onSetWearableDialog(const LLSD& notification, const LLSD& { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); LLInventoryItem* new_item = gInventory.getItem(notification["payload"]["item_id"].asUUID()); - U32 index = gAgentWearables.getWearableIndex(wearable); + U32 index; + if (!gAgentWearables.getWearableIndex(wearable,index)) + { + LL_WARNS() << "Wearable not found" << LL_ENDL; + delete wearable; + return false; + } if (!new_item) { delete wearable; diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index a64d5b50b3..b3317e937e 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1338,90 +1338,113 @@ void wear_on_avatar_cb(const LLUUID& inv_item, bool do_replace = false) } } -bool LLAppearanceMgr::wearItemOnAvatar(const LLUUID& item_id_to_wear, +void LLAppearanceMgr::wearItemsOnAvatar(const uuid_vec_t& item_ids_to_wear, + bool do_update, + bool replace, + LLPointer<LLInventoryCallback> cb) +{ + bool first = true; + + LLInventoryObject::const_object_list_t items_to_link; + + for (uuid_vec_t::const_iterator it = item_ids_to_wear.begin(); + it != item_ids_to_wear.end(); + ++it) + { + replace = first && replace; + first = false; + + const LLUUID& item_id_to_wear = *it; + + if (item_id_to_wear.isNull()) continue; + + LLViewerInventoryItem* item_to_wear = gInventory.getItem(item_id_to_wear); + if (!item_to_wear) continue; + + if (gInventory.isObjectDescendentOf(item_to_wear->getUUID(), gInventory.getLibraryRootFolderID())) + { + LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(wear_on_avatar_cb,_1,replace)); + copy_inventory_item(gAgent.getID(), item_to_wear->getPermissions().getOwner(), item_to_wear->getUUID(), LLUUID::null, std::string(), cb); + continue; + } + else if (!gInventory.isObjectDescendentOf(item_to_wear->getUUID(), gInventory.getRootFolderID())) + { + continue; // not in library and not in agent's inventory + } + else if (gInventory.isObjectDescendentOf(item_to_wear->getUUID(), gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH))) + { + LLNotificationsUtil::add("CannotWearTrash"); + continue; + } + else if (isLinkedInCOF(item_to_wear->getUUID())) // EXT-84911 + { + continue; + } + + switch (item_to_wear->getType()) + { + case LLAssetType::AT_CLOTHING: + { + if (gAgentWearables.areWearablesLoaded()) + { + if (!cb && do_update) + { + cb = new LLUpdateAppearanceAndEditWearableOnDestroy(item_id_to_wear); + } + LLWearableType::EType type = item_to_wear->getWearableType(); + S32 wearable_count = gAgentWearables.getWearableCount(type); + if ((replace && wearable_count != 0) || !gAgentWearables.canAddWearable(type)) + { + LLUUID item_id = gAgentWearables.getWearableItemID(item_to_wear->getWearableType(), + wearable_count-1); + removeCOFItemLinks(item_id, cb); + } + + items_to_link.push_back(item_to_wear); + } + } + break; + + case LLAssetType::AT_BODYPART: + { + // TODO: investigate wearables may not be loaded at this point EXT-8231 + + // Remove the existing wearables of the same type. + // Remove existing body parts anyway because we must not be able to wear e.g. two skins. + removeCOFLinksOfType(item_to_wear->getWearableType()); + if (!cb && do_update) + { + cb = new LLUpdateAppearanceAndEditWearableOnDestroy(item_id_to_wear); + } + items_to_link.push_back(item_to_wear); + } + break; + + case LLAssetType::AT_OBJECT: + { + rez_attachment(item_to_wear, NULL, replace); + } + break; + + default: continue; + } + } + + // Batch up COF link creation - more efficient if using AIS. + if (items_to_link.size()) + { + link_inventory_array(getCOF(), items_to_link, cb); + } +} + +void LLAppearanceMgr::wearItemOnAvatar(const LLUUID& item_id_to_wear, bool do_update, bool replace, LLPointer<LLInventoryCallback> cb) { - - if (item_id_to_wear.isNull()) return false; - - // *TODO: issue with multi-wearable should be fixed: - // in this case this method will be called N times - loading started for each item - // and than N times will be called - loading completed for each item. - // That means subscribers will be notified that loading is done after first item in a batch is worn. - // (loading indicator disappears for example before all selected items are worn) - // Have not fix this issue for 2.1 because of stability reason. EXT-7777. - - // Disabled for now because it is *not* acceptable to call updateAppearanceFromCOF() multiple times -// gAgentWearables.notifyLoadingStarted(); - - LLViewerInventoryItem* item_to_wear = gInventory.getItem(item_id_to_wear); - if (!item_to_wear) return false; - - if (gInventory.isObjectDescendentOf(item_to_wear->getUUID(), gInventory.getLibraryRootFolderID())) - { - LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(wear_on_avatar_cb,_1,replace)); - copy_inventory_item(gAgent.getID(), item_to_wear->getPermissions().getOwner(), item_to_wear->getUUID(), LLUUID::null, std::string(), cb); - return false; - } - else if (!gInventory.isObjectDescendentOf(item_to_wear->getUUID(), gInventory.getRootFolderID())) - { - return false; // not in library and not in agent's inventory - } - else if (gInventory.isObjectDescendentOf(item_to_wear->getUUID(), gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH))) - { - LLNotificationsUtil::add("CannotWearTrash"); - return false; - } - else if (isLinkedInCOF(item_to_wear->getUUID())) // EXT-84911 - { - return false; - } - - switch (item_to_wear->getType()) - { - case LLAssetType::AT_CLOTHING: - if (gAgentWearables.areWearablesLoaded()) - { - if (!cb && do_update) - { - cb = new LLUpdateAppearanceAndEditWearableOnDestroy(item_id_to_wear); - } - S32 wearable_count = gAgentWearables.getWearableCount(item_to_wear->getWearableType()); - if ((replace && wearable_count != 0) || - (wearable_count >= LLAgentWearables::MAX_CLOTHING_PER_TYPE) ) - { - LLUUID item_id = gAgentWearables.getWearableItemID(item_to_wear->getWearableType(), - wearable_count-1); - removeCOFItemLinks(item_id, cb); - } - - addCOFItemLink(item_to_wear, cb); - } - break; - - case LLAssetType::AT_BODYPART: - // TODO: investigate wearables may not be loaded at this point EXT-8231 - - // Remove the existing wearables of the same type. - // Remove existing body parts anyway because we must not be able to wear e.g. two skins. - removeCOFLinksOfType(item_to_wear->getWearableType()); - if (!cb && do_update) - { - cb = new LLUpdateAppearanceAndEditWearableOnDestroy(item_id_to_wear); - } - addCOFItemLink(item_to_wear, cb); - break; - - case LLAssetType::AT_OBJECT: - rez_attachment(item_to_wear, NULL, replace); - break; - - default: return false;; - } - - return true; + uuid_vec_t ids; + ids.push_back(item_id_to_wear); + wearItemsOnAvatar(ids, do_update, replace, cb); } // Update appearance from outfit folder. @@ -1782,6 +1805,49 @@ bool LLAppearanceMgr::getCanReplaceCOF(const LLUUID& outfit_cat_id) return items.size() > 0; } +// Moved from LLWearableList::ContextMenu for wider utility. +bool LLAppearanceMgr::canAddWearables(const uuid_vec_t& item_ids) +{ + // TODO: investigate wearables may not be loaded at this point EXT-8231 + + U32 n_objects = 0; + U32 n_clothes = 0; + + // Count given clothes (by wearable type) and objects. + for (uuid_vec_t::const_iterator it = item_ids.begin(); it != item_ids.end(); ++it) + { + LLViewerInventoryItem* item = gInventory.getItem(*it); + if (!item) + { + return false; + } + + if (item->getType() == LLAssetType::AT_OBJECT) + { + ++n_objects; + } + else if (item->getType() == LLAssetType::AT_CLOTHING) + { + ++n_clothes; + } + else + { + LL_WARNS() << "Unexpected wearable type" << LL_ENDL; + return false; + } + } + + // Check whether we can add all the objects. + if (!isAgentAvatarValid() || !gAgentAvatarp->canAttachMoreObjects(n_objects)) + { + return false; + } + + // Check whether we can add all the clothes. + U32 sum_clothes = n_clothes + gAgentWearables.getClothingLayerCount(); + return sum_clothes <= LLAgentWearables::MAX_CLOTHING_LAYERS; +} + void LLAppearanceMgr::purgeBaseOutfitLink(const LLUUID& category, LLPointer<LLInventoryCallback> cb) { LLInventoryModel::cat_array_t cats; @@ -1804,25 +1870,39 @@ void LLAppearanceMgr::purgeBaseOutfitLink(const LLUUID& category, LLPointer<LLIn // Keep the last N wearables of each type. For viewer 2.0, N is 1 for // both body parts and clothing items. void LLAppearanceMgr::filterWearableItems( - LLInventoryModel::item_array_t& items, S32 max_per_type) -{ - // Divvy items into arrays by wearable type. - std::vector<LLInventoryModel::item_array_t> items_by_type(LLWearableType::WT_COUNT); - divvyWearablesByType(items, items_by_type); - - // rebuild items list, retaining the last max_per_type of each array - items.clear(); - for (S32 i=0; i<LLWearableType::WT_COUNT; i++) - { - S32 size = items_by_type[i].size(); - if (size <= 0) - continue; - S32 start_index = llmax(0,size-max_per_type); - for (S32 j = start_index; j<size; j++) - { - items.push_back(items_by_type[i][j]); - } - } + LLInventoryModel::item_array_t& items, S32 max_per_type, S32 max_total) +{ + // Restrict by max total items first. + if ((max_total > 0) && (items.size() > max_total)) + { + LLInventoryModel::item_array_t items_to_keep; + for (S32 i=0; i<max_total; i++) + { + items_to_keep.push_back(items[i]); + } + items = items_to_keep; + } + + if (max_per_type > 0) + { + // Divvy items into arrays by wearable type. + std::vector<LLInventoryModel::item_array_t> items_by_type(LLWearableType::WT_COUNT); + divvyWearablesByType(items, items_by_type); + + // rebuild items list, retaining the last max_per_type of each array + items.clear(); + for (S32 i=0; i<LLWearableType::WT_COUNT; i++) + { + S32 size = items_by_type[i].size(); + if (size <= 0) + continue; + S32 start_index = llmax(0,size-max_per_type); + for (S32 j = start_index; j<size; j++) + { + items.push_back(items_by_type[i][j]); + } + } + } } void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) @@ -1864,7 +1944,7 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) reverse(body_items.begin(), body_items.end()); // Reduce body items to max of one per type. removeDuplicateItems(body_items); - filterWearableItems(body_items, 1); + filterWearableItems(body_items, 1, 0); // - Wearables: include COF contents only if appending. LLInventoryModel::item_array_t wear_items; @@ -1873,7 +1953,7 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) getDescendentsOfAssetType(category, wear_items, LLAssetType::AT_CLOTHING); // Reduce wearables to max of one per type. removeDuplicateItems(wear_items); - filterWearableItems(wear_items, LLAgentWearables::MAX_CLOTHING_PER_TYPE); + filterWearableItems(wear_items, 0, LLAgentWearables::MAX_CLOTHING_LAYERS); // - Attachments: include COF contents only if appending. LLInventoryModel::item_array_t obj_items; @@ -2062,7 +2142,8 @@ void item_array_diff(LLInventoryModel::item_array_t& full_list, S32 LLAppearanceMgr::findExcessOrDuplicateItems(const LLUUID& cat_id, LLAssetType::EType type, - S32 max_items, + S32 max_items_per_type, + S32 max_items_total, LLInventoryObject::object_list_t& items_to_kill) { S32 to_kill_count = 0; @@ -2071,9 +2152,9 @@ S32 LLAppearanceMgr::findExcessOrDuplicateItems(const LLUUID& cat_id, getDescendentsOfAssetType(cat_id, items, type); LLInventoryModel::item_array_t curr_items = items; removeDuplicateItems(items); - if (max_items > 0) + if (max_items_per_type > 0 || max_items_total > 0) { - filterWearableItems(items, max_items); + filterWearableItems(items, max_items_per_type, max_items_total); } LLInventoryModel::item_array_t kill_items; item_array_diff(curr_items,items,kill_items); @@ -2092,11 +2173,11 @@ void LLAppearanceMgr::findAllExcessOrDuplicateItems(const LLUUID& cat_id, LLInventoryObject::object_list_t& items_to_kill) { findExcessOrDuplicateItems(cat_id,LLAssetType::AT_BODYPART, - 1, items_to_kill); + 1, 0, items_to_kill); findExcessOrDuplicateItems(cat_id,LLAssetType::AT_CLOTHING, - LLAgentWearables::MAX_CLOTHING_PER_TYPE, items_to_kill); + 0, LLAgentWearables::MAX_CLOTHING_LAYERS, items_to_kill); findExcessOrDuplicateItems(cat_id,LLAssetType::AT_OBJECT, - -1, items_to_kill); + 0, 0, items_to_kill); } void LLAppearanceMgr::enforceCOFItemRestrictions(LLPointer<LLInventoryCallback> cb) @@ -2588,7 +2669,6 @@ void LLAppearanceMgr::addCOFItemLink(const LLInventoryItem *item, item_array, LLInventoryModel::EXCLUDE_TRASH); bool linked_already = false; - U32 count = 0; for (S32 i=0; i<item_array.size(); i++) { // Are these links to the same object? @@ -2608,14 +2688,13 @@ void LLAppearanceMgr::addCOFItemLink(const LLInventoryItem *item, // type? If so, new item will replace old. else if ((vitem->isWearableType()) && (vitem->getWearableType() == wearable_type)) { - ++count; - if (is_body_part && inv_item->getIsLinkType() && (vitem->getWearableType() == wearable_type)) + if (is_body_part && inv_item->getIsLinkType()) { remove_inventory_item(inv_item->getUUID(), cb); } - else if (count >= LLAgentWearables::MAX_CLOTHING_PER_TYPE) + else if (!gAgentWearables.canAddWearable(wearable_type)) { - // MULTI-WEARABLES: make sure we don't go over MAX_CLOTHING_PER_TYPE + // MULTI-WEARABLES: make sure we don't go over clothing limits remove_inventory_item(inv_item->getUUID(), cb); } } @@ -4071,16 +4150,7 @@ void callAfterCategoryFetch(const LLUUID& cat_id, nullary_func_t cb) void wear_multiple(const uuid_vec_t& ids, bool replace) { LLPointer<LLInventoryCallback> cb = new LLUpdateAppearanceOnDestroy; - - bool first = true; - uuid_vec_t::const_iterator it; - for (it = ids.begin(); it != ids.end(); ++it) - { - // if replace is requested, the first item worn will replace the current top - // item, and others will be added. - LLAppearanceMgr::instance().wearItemOnAvatar(*it,false,first && replace,cb); - first = false; - } + LLAppearanceMgr::instance().wearItemsOnAvatar(ids, false, replace, cb); } // SLapp for easy-wearing of a stock (library) avatar diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 7742a19c07..ee9d3b7209 100755 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -67,7 +67,8 @@ public: void addCategoryToCurrentOutfit(const LLUUID& cat_id); S32 findExcessOrDuplicateItems(const LLUUID& cat_id, LLAssetType::EType type, - S32 max_items, + S32 max_items_per_type, + S32 max_items_total, LLInventoryObject::object_list_t& items_to_kill); void findAllExcessOrDuplicateItems(const LLUUID& cat_id, LLInventoryObject::object_list_t& items_to_kill); @@ -99,6 +100,9 @@ public: // Determine whether we can replace current outfit with the given one. bool getCanReplaceCOF(const LLUUID& outfit_cat_id); + // Can we add all referenced items to the avatar? + bool canAddWearables(const uuid_vec_t& item_ids); + // Copy all items in a category. void shallowCopyCategoryContents(const LLUUID& src_id, const LLUUID& dst_id, LLPointer<LLInventoryCallback> cb); @@ -117,8 +121,13 @@ public: // find the UUID of the currently worn outfit (Base Outfit) const LLUUID getBaseOutfitUUID(); + void wearItemsOnAvatar(const uuid_vec_t& item_ids_to_wear, + bool do_update, + bool replace, + LLPointer<LLInventoryCallback> cb = NULL); + // Wear/attach an item (from a user's inventory) on the agent - bool wearItemOnAvatar(const LLUUID& item_to_wear, bool do_update, bool replace = false, + void wearItemOnAvatar(const LLUUID& item_to_wear, bool do_update, bool replace = false, LLPointer<LLInventoryCallback> cb = NULL); // Update the displayed outfit name in UI. @@ -235,7 +244,7 @@ protected: private: - void filterWearableItems(LLInventoryModel::item_array_t& items, S32 max_per_type); + void filterWearableItems(LLInventoryModel::item_array_t& items, S32 max_per_type, S32 max_total); void getDescendentsOfAssetType(const LLUUID& category, LLInventoryModel::item_array_t& items, diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 27e8b83e13..1a49fea253 100755 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -684,6 +684,8 @@ LLAppViewer::LLAppViewer() mQuitRequested(false), mLogoutRequestSent(false), mYieldTime(-1), + mLastAgentControlFlags(0), + mLastAgentForceUpdate(0), mMainloopTimeout(NULL), mAgentRegionLastAlive(false), mRandomizeFramerate(LLCachedControl<bool>(gSavedSettings,"Randomize Framerate", FALSE)), @@ -3272,7 +3274,7 @@ void LLAppViewer::writeDebugInfo(bool isStatic) : getDynamicDebugFile() ); LL_INFOS() << "Opening debug file " << *debug_filename << LL_ENDL; - llofstream out_file(*debug_filename); + llofstream out_file(debug_filename->c_str()); isStatic ? LLSDSerialize::toPrettyXML(gDebugInfo, out_file) : LLSDSerialize::toPrettyXML(gDebugInfo["Dynamic"], out_file); @@ -3761,7 +3763,7 @@ void LLAppViewer::handleViewerCrash() { std::string filename; filename = gDirUtilp->getExpandedFilename(LL_PATH_DUMP, "stats.log"); - llofstream file(filename, llofstream::binary); + llofstream file(filename.c_str(), std::ios_base::binary); if(file.good()) { LL_INFOS() << "Handle viewer crash generating stats log." << LL_ENDL; @@ -4649,17 +4651,22 @@ void LLAppViewer::loadNameCache() std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "avatar_name_cache.xml"); LL_INFOS("AvNameCache") << filename << LL_ENDL; - llifstream name_cache_stream(filename); + llifstream name_cache_stream(filename.c_str()); if(name_cache_stream.is_open()) { - LLAvatarNameCache::importFile(name_cache_stream); + if ( ! LLAvatarNameCache::importFile(name_cache_stream)) + { + LL_WARNS("AppInit") << "removing invalid '" << filename << "'" << LL_ENDL; + name_cache_stream.close(); + LLFile::remove(filename); + } } if (!gCacheName) return; std::string name_cache; name_cache = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "name.cache"); - llifstream cache_file(name_cache); + llifstream cache_file(name_cache.c_str()); if(cache_file.is_open()) { if(gCacheName->importFile(cache_file)) return; @@ -4667,24 +4674,26 @@ void LLAppViewer::loadNameCache() } void LLAppViewer::saveNameCache() - { +{ // display names cache std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "avatar_name_cache.xml"); - llofstream name_cache_stream(filename); + llofstream name_cache_stream(filename.c_str()); if(name_cache_stream.is_open()) { LLAvatarNameCache::exportFile(name_cache_stream); -} - - if (!gCacheName) return; - - std::string name_cache; - name_cache = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "name.cache"); - llofstream cache_file(name_cache); - if(cache_file.is_open()) - { - gCacheName->exportFile(cache_file); + } + + // real names cache + if (gCacheName) + { + std::string name_cache; + name_cache = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "name.cache"); + llofstream cache_file(name_cache.c_str()); + if(cache_file.is_open()) + { + gCacheName->exportFile(cache_file); + } } } @@ -4812,22 +4821,24 @@ void LLAppViewer::idle() gAgentPilot.updateTarget(); gAgent.autoPilot(&yaw); } - - static LLFrameTimer agent_update_timer; - static U32 last_control_flags; - - // When appropriate, update agent location to the simulator. - F32 agent_update_time = agent_update_timer.getElapsedTimeF32(); - BOOL flags_changed = gAgent.controlFlagsDirty() || (last_control_flags != gAgent.getControlFlags()); - - if (flags_changed || (agent_update_time > (1.0f / (F32) AGENT_UPDATES_PER_SECOND))) - { - LL_RECORD_BLOCK_TIME(FTM_AGENT_UPDATE); - // Send avatar and camera info - last_control_flags = gAgent.getControlFlags(); - send_agent_update(TRUE); - agent_update_timer.reset(); - } + + static LLFrameTimer agent_update_timer; + + // When appropriate, update agent location to the simulator. + F32 agent_update_time = agent_update_timer.getElapsedTimeF32(); + F32 agent_force_update_time = mLastAgentForceUpdate + agent_update_time; + BOOL force_update = gAgent.controlFlagsDirty() + || (mLastAgentControlFlags != gAgent.getControlFlags()) + || (agent_force_update_time > (1.0f / (F32) AGENT_FORCE_UPDATES_PER_SECOND)); + if (force_update || (agent_update_time > (1.0f / (F32) AGENT_UPDATES_PER_SECOND))) + { + LL_RECORD_BLOCK_TIME(FTM_AGENT_UPDATE); + // Send avatar and camera info + mLastAgentControlFlags = gAgent.getControlFlags(); + mLastAgentForceUpdate = force_update ? 0 : agent_force_update_time; + send_agent_update(force_update); + agent_update_timer.reset(); + } } ////////////////////////////////////// @@ -5375,7 +5386,7 @@ void LLAppViewer::idleNetwork() } // Handle per-frame message system processing. - gMessageSystem->processAcks(); + gMessageSystem->processAcks(gSavedSettings.getF32("AckCollectTime")); #ifdef TIME_THROTTLE_MESSAGES if (total_time >= CheckMessagesMaxTime) diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index e0f3f326c7..e8a1ca036b 100755 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -275,6 +275,8 @@ private: bool mQuitRequested; // User wants to quit, may have modified documents open. bool mLogoutRequestSent; // Disconnect message sent to simulator, no longer safe to send messages to the sim. S32 mYieldTime; + U32 mLastAgentControlFlags; + F32 mLastAgentForceUpdate; struct SettingsFiles* mSettingsLocationList; LLWatchdogTimeout* mMainloopTimeout; @@ -314,6 +316,7 @@ public: // consts from viewer.h const S32 AGENT_UPDATES_PER_SECOND = 10; +const S32 AGENT_FORCE_UPDATES_PER_SECOND = 1; // Globals with external linkage. From viewer.h // *NOTE:Mani - These will be removed as the Viewer App Cleanup project continues. diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp index e5c2d212fe..d2b1dcbf35 100755 --- a/indra/newview/llassetuploadresponders.cpp +++ b/indra/newview/llassetuploadresponders.cpp @@ -226,21 +226,34 @@ void LLAssetUploadResponder::httpFailure() { // *TODO: Add adaptive retry policy? LL_WARNS() << dumpResponse() << LL_ENDL; - LLSD args; + std::string reason; if (isHttpClientErrorStatus(getStatus())) { - args["FILE"] = (mFileName.empty() ? mVFileID.asString() : mFileName); - args["REASON"] = "Error in upload request. Please visit " + reason = "Error in upload request. Please visit " "http://secondlife.com/support for help fixing this problem."; - LLNotificationsUtil::add("CannotUploadReason", args); } else { - args["FILE"] = (mFileName.empty() ? mVFileID.asString() : mFileName); - args["REASON"] = "The server is experiencing unexpected " + reason = "The server is experiencing unexpected " "difficulties."; - LLNotificationsUtil::add("CannotUploadReason", args); } + LLSD args; + args["FILE"] = (mFileName.empty() ? mVFileID.asString() : mFileName); + args["REASON"] = reason; + LLNotificationsUtil::add("CannotUploadReason", args); + + // unfreeze script preview + if(mAssetType == LLAssetType::AT_LSL_TEXT) + { + LLPreviewLSL* preview = LLFloaterReg::findTypedInstance<LLPreviewLSL>("preview_script", mPostData["item_id"]); + if (preview) + { + LLSD errors; + errors.append(LLTrans::getString("UploadFailed") + reason); + preview->callbackLSLCompileFailed(errors); + } + } + LLUploadDialog::modalUploadFinished(); LLFilePicker::instance().reset(); // unlock file picker when bulk upload fails } @@ -295,8 +308,22 @@ void LLAssetUploadResponder::uploadUpload(const LLSD& content) void LLAssetUploadResponder::uploadFailure(const LLSD& content) { LL_WARNS() << dumpResponse() << LL_ENDL; + + // unfreeze script preview + if(mAssetType == LLAssetType::AT_LSL_TEXT) + { + LLPreviewLSL* preview = LLFloaterReg::findTypedInstance<LLPreviewLSL>("preview_script", mPostData["item_id"]); + if (preview) + { + LLSD errors; + errors.append(LLTrans::getString("UploadFailed") + content["message"].asString()); + preview->callbackLSLCompileFailed(errors); + } + } + // remove the "Uploading..." message LLUploadDialog::modalUploadFinished(); + LLFloater* floater_snapshot = LLFloaterReg::findInstance("snapshot"); if (floater_snapshot) { @@ -622,7 +649,10 @@ void LLUpdateTaskInventoryResponder::uploadComplete(const LLSD& content) } else { - LLLiveLSLEditor* preview = LLFloaterReg::findTypedInstance<LLLiveLSLEditor>("preview_scriptedit", LLSD(item_id)); + LLSD floater_key; + floater_key["taskid"] = task_id; + floater_key["itemid"] = item_id; + LLLiveLSLEditor* preview = LLFloaterReg::findTypedInstance<LLLiveLSLEditor>("preview_scriptedit", floater_key); if (preview) { // Bytecode save completed diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 8235b13118..8dc8a2ff20 100755 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -745,7 +745,7 @@ namespace action_give_inventory } std::string residents; - LLAvatarActions::buildResidentsString(avatar_names, residents); + LLAvatarActions::buildResidentsString(avatar_names, residents, true); std::string items; build_items_string(inventory_selected_uuids, items); @@ -777,7 +777,7 @@ namespace action_give_inventory } // static -void LLAvatarActions::buildResidentsString(std::vector<LLAvatarName> avatar_names, std::string& residents_string) +void LLAvatarActions::buildResidentsString(std::vector<LLAvatarName> avatar_names, std::string& residents_string, bool complete_name) { llassert(avatar_names.size() > 0); @@ -785,7 +785,15 @@ void LLAvatarActions::buildResidentsString(std::vector<LLAvatarName> avatar_name const std::string& separator = LLTrans::getString("words_separator"); for (std::vector<LLAvatarName>::const_iterator it = avatar_names.begin(); ; ) { - residents_string.append((*it).getDisplayName()); + if(complete_name) + { + residents_string.append((*it).getCompleteName()); + } + else + { + residents_string.append((*it).getDisplayName()); + } + if (++it == avatar_names.end()) { break; diff --git a/indra/newview/llavataractions.h b/indra/newview/llavataractions.h index 85813f2152..bd0ac24e93 100755 --- a/indra/newview/llavataractions.h +++ b/indra/newview/llavataractions.h @@ -221,7 +221,7 @@ public: * @param avatar_names - a vector of given avatar names from which resulting string is built * @param residents_string - the resulting string */ - static void buildResidentsString(std::vector<LLAvatarName> avatar_names, std::string& residents_string); + static void buildResidentsString(std::vector<LLAvatarName> avatar_names, std::string& residents_string, bool complete_name = false); /** * Builds a string of residents' display names separated by "words_separator" string. diff --git a/indra/newview/llavatariconctrl.cpp b/indra/newview/llavatariconctrl.cpp index 746b541f9d..281e591b48 100755 --- a/indra/newview/llavatariconctrl.cpp +++ b/indra/newview/llavatariconctrl.cpp @@ -76,7 +76,7 @@ void LLAvatarIconIDCache::load () // build filename for each user std::string resolved_filename = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, mFilename); - llifstream file(resolved_filename); + llifstream file(resolved_filename.c_str()); if (!file.is_open()) return; @@ -114,7 +114,7 @@ void LLAvatarIconIDCache::save () std::string resolved_filename = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, mFilename); // open a file for writing - llofstream file (resolved_filename); + llofstream file (resolved_filename.c_str()); if (!file.is_open()) { LL_WARNS() << "can't open avatar icons cache file\"" << mFilename << "\" for writing" << LL_ENDL; diff --git a/indra/newview/llcallingcard.cpp b/indra/newview/llcallingcard.cpp index afbb73ee08..b6c5496c17 100755 --- a/indra/newview/llcallingcard.cpp +++ b/indra/newview/llcallingcard.cpp @@ -860,7 +860,7 @@ bool LLCollectMappableBuddies::operator()(const LLUUID& buddy_id, LLRelationship { LLAvatarName av_name; LLAvatarNameCache::get( buddy_id, &av_name); - buddy_map_t::value_type value(av_name.getDisplayName(), buddy_id); + buddy_map_t::value_type value(buddy_id, av_name.getDisplayName()); if(buddy->isOnline() && buddy->isRightGrantedFrom(LLRelationship::GRANT_MAP_LOCATION)) { mMappable.insert(value); @@ -871,7 +871,7 @@ bool LLCollectMappableBuddies::operator()(const LLUUID& buddy_id, LLRelationship bool LLCollectOnlineBuddies::operator()(const LLUUID& buddy_id, LLRelationship* buddy) { gCacheName->getFullName(buddy_id, mFullName); - buddy_map_t::value_type value(mFullName, buddy_id); + buddy_map_t::value_type value(buddy_id, mFullName); if(buddy->isOnline()) { mOnline.insert(value); @@ -883,8 +883,8 @@ bool LLCollectAllBuddies::operator()(const LLUUID& buddy_id, LLRelationship* bud { LLAvatarName av_name; LLAvatarNameCache::get(buddy_id, &av_name); - mFullName = av_name.getDisplayName(); - buddy_map_t::value_type value(mFullName, buddy_id); + mFullName = av_name.getCompleteName(); + buddy_map_t::value_type value(buddy_id, mFullName); if(buddy->isOnline()) { mOnline.insert(value); diff --git a/indra/newview/llcallingcard.h b/indra/newview/llcallingcard.h index 8803cce59d..6e5fc01cd8 100755 --- a/indra/newview/llcallingcard.h +++ b/indra/newview/llcallingcard.h @@ -233,7 +233,7 @@ public: LLCollectMappableBuddies() {} virtual ~LLCollectMappableBuddies() {} virtual bool operator()(const LLUUID& buddy_id, LLRelationship* buddy); - typedef std::map<std::string, LLUUID, LLDictionaryLess> buddy_map_t; + typedef std::map<LLUUID, std::string> buddy_map_t; buddy_map_t mMappable; std::string mFullName; }; @@ -245,7 +245,7 @@ public: LLCollectOnlineBuddies() {} virtual ~LLCollectOnlineBuddies() {} virtual bool operator()(const LLUUID& buddy_id, LLRelationship* buddy); - typedef std::map<std::string, LLUUID, LLDictionaryLess> buddy_map_t; + typedef std::map<LLUUID, std::string> buddy_map_t; buddy_map_t mOnline; std::string mFullName; }; @@ -258,7 +258,7 @@ public: LLCollectAllBuddies() {} virtual ~LLCollectAllBuddies() {} virtual bool operator()(const LLUUID& buddy_id, LLRelationship* buddy); - typedef std::map<std::string, LLUUID, LLDictionaryLess> buddy_map_t; + typedef std::map<LLUUID, std::string> buddy_map_t; buddy_map_t mOnline; buddy_map_t mOffline; std::string mFullName; diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 84b9ac756a..f0bd63ba46 100755 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -1113,7 +1113,15 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL if (irc_me && !use_plain_text_chat_history) { - message = chat.mFromName + message; + std::string from_name = chat.mFromName; + LLAvatarName av_name; + if (!chat.mFromID.isNull() && + LLAvatarNameCache::get(chat.mFromID, &av_name) && + !av_name.isDisplayNameDefault()) + { + from_name = av_name.getCompleteName(); + } + message = from_name + message; } if (square_brackets) diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index c0823182c0..46b7679915 100755 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -376,6 +376,14 @@ BOOL LLIMChiclet::handleRightMouseDown(S32 x, S32 y, MASK mask) return TRUE; } +void LLIMChiclet::hidePopupMenu() +{ + if (mPopupMenu) + { + mPopupMenu->setVisible(FALSE); + } +} + bool LLIMChiclet::canCreateMenu() { if(mPopupMenu) diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h index d5e3a55fdf..9201c6bc00 100755 --- a/indra/newview/llchiclet.h +++ b/indra/newview/llchiclet.h @@ -305,6 +305,8 @@ public: */ virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); + void hidePopupMenu(); + protected: LLIMChiclet(const LLIMChiclet::Params& p); diff --git a/indra/newview/llcommandlineparser.cpp b/indra/newview/llcommandlineparser.cpp index 06164e9597..1819fc74ee 100755 --- a/indra/newview/llcommandlineparser.cpp +++ b/indra/newview/llcommandlineparser.cpp @@ -622,7 +622,7 @@ void LLControlGroupCLP::configure(const std::string& config_filename, LLControlG LLSD clpConfigLLSD; llifstream input_stream; - input_stream.open(config_filename, std::ios::in | std::ios::binary); + input_stream.open(config_filename.c_str(), std::ios::in | std::ios::binary); if(input_stream.is_open()) { diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp index 4250aeacd6..b18e543f0a 100644 --- a/indra/newview/llconversationview.cpp +++ b/indra/newview/llconversationview.cpp @@ -296,7 +296,7 @@ BOOL LLConversationViewSession::handleMouseUp( S32 x, S32 y, MASK mask ) LLFloater* volume_floater = LLFloaterReg::findInstance("floater_voice_volume"); LLFloater* chat_volume_floater = LLFloaterReg::findInstance("chat_voice"); if (result - && getRoot() + && getRoot() && (getRoot()->getCurSelectedItem() == this) && !(volume_floater && volume_floater->isShown() && volume_floater->hasFocus()) && !(chat_volume_floater && chat_volume_floater->isShown() && chat_volume_floater->hasFocus())) { diff --git a/indra/newview/lldaycyclemanager.cpp b/indra/newview/lldaycyclemanager.cpp index 131675310e..803e2b2fb2 100755 --- a/indra/newview/lldaycyclemanager.cpp +++ b/indra/newview/lldaycyclemanager.cpp @@ -207,7 +207,7 @@ bool LLDayCycleManager::addPreset(const std::string& name, const LLSD& data) { if (name.empty()) { - llassert(name.empty()); + //llassert(name.empty()); return false; } diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index 3293b02131..f956023358 100755 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -1116,7 +1116,14 @@ LLSpatialPartition* LLDrawable::getSpatialPartition() retval = gPipeline.getSpatialPartition((LLViewerObject*) mVObjp); } else if (isRoot()) - { //must be an active volume + { + if (mSpatialBridge && (mSpatialBridge->asPartition()->mPartitionType == LLViewerRegion::PARTITION_HUD) != mVObjp->isHUDAttachment()) + { + // remove obsolete bridge + mSpatialBridge->markDead(); + setSpatialBridge(NULL); + } + //must be an active volume if (!mSpatialBridge) { if (mVObjp->isHUDAttachment()) diff --git a/indra/newview/llenvmanager.cpp b/indra/newview/llenvmanager.cpp index 41d378fea1..a626ad1bff 100755 --- a/indra/newview/llenvmanager.cpp +++ b/indra/newview/llenvmanager.cpp @@ -303,7 +303,8 @@ void LLEnvManagerNew::loadUserPrefs() mUserPrefs.mSkyPresetName = gSavedSettings.getString("SkyPresetName"); mUserPrefs.mDayCycleName = gSavedSettings.getString("DayCycleName"); - mUserPrefs.mUseRegionSettings = gSavedSettings.getBOOL("UseEnvironmentFromRegion"); + bool use_region_settings = gSavedSettings.getBOOL("EnvironmentPersistAcrossLogin") ? gSavedSettings.getBOOL("UseEnvironmentFromRegion") : true; + mUserPrefs.mUseRegionSettings = use_region_settings; mUserPrefs.mUseDayCycle = gSavedSettings.getBOOL("UseDayCycle"); if (mUserPrefs.mUseRegionSettings) diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index a85016dcb7..de349a03d4 100755 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -344,10 +344,38 @@ void LLFace::dirtyTexture() gPipeline.markTextured(drawablep); } +void LLFace::notifyAboutCreatingTexture(LLViewerTexture *texture) +{ + LLDrawable* drawablep = getDrawable(); + if(mVObjp.notNull() && mVObjp->getVolume()) + { + LLVOVolume *vobj = drawablep->getVOVolume(); + if(vobj && vobj->notifyAboutCreatingTexture(texture)) + { + gPipeline.markTextured(drawablep); + gPipeline.markRebuild(drawablep, LLDrawable::REBUILD_VOLUME); + } + } +} + +void LLFace::notifyAboutMissingAsset(LLViewerTexture *texture) +{ + LLDrawable* drawablep = getDrawable(); + if(mVObjp.notNull() && mVObjp->getVolume()) + { + LLVOVolume *vobj = drawablep->getVOVolume(); + if(vobj && vobj->notifyAboutMissingAsset(texture)) + { + gPipeline.markTextured(drawablep); + gPipeline.markRebuild(drawablep, LLDrawable::REBUILD_VOLUME); + } + } +} + void LLFace::switchTexture(U32 ch, LLViewerTexture* new_texture) { llassert(ch < LLRender::NUM_TEXTURE_CHANNELS); - + if(mTexture[ch] == new_texture) { return ; @@ -956,6 +984,10 @@ void LLFace::getPlanarProjectedParams(LLQuaternion* face_rot, LLVector3* face_po const LLVolumeFace& vf = getViewerObject()->getVolume()->getVolumeFace(mTEOffset); const LLVector4a& normal4a = vf.mNormals[0]; const LLVector4a& tangent = vf.mTangents[0]; + if (!&tangent) + { + return; + } LLVector4a binormal4a; binormal4a.setCross3(normal4a, tangent); @@ -1299,15 +1331,15 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, } if (shiny_in_alpha) - { - - GLfloat alpha[4] = { - 0.00f, - 0.25f, - 0.5f, - 0.75f - }; + + static const GLfloat alpha[4] = + { + 0.00f, + 0.25f, + 0.5f, + 0.75f + }; llassert(tep->getShiny() <= 3); color.mV[3] = U8 (alpha[tep->getShiny()] * 255); diff --git a/indra/newview/llface.h b/indra/newview/llface.h index d3a561facc..ee545acb94 100755 --- a/indra/newview/llface.h +++ b/indra/newview/llface.h @@ -218,7 +218,7 @@ public: void setHasMedia(bool has_media) { mHasMedia = has_media ;} BOOL hasMedia() const ; - BOOL switchTexture() ; + BOOL switchTexture() ; //vertex buffer tracking void setVertexBuffer(LLVertexBuffer* buffer); @@ -230,10 +230,13 @@ public: static U32 getRiggedDataMask(U32 type); + void notifyAboutCreatingTexture(LLViewerTexture *texture); + void notifyAboutMissingAsset(LLViewerTexture *texture); + public: //aligned members LLVector4a mExtents[2]; -private: +private: F32 adjustPartialOverlapPixelArea(F32 cos_angle_to_view_dir, F32 radius ); BOOL calcPixelArea(F32& cos_angle_to_view_dir, F32& radius) ; public: diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index 3da162c5ef..fc9e85caf8 100755 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -1470,7 +1470,7 @@ void LLFavoritesOrderStorage::destroyClass() std::string old_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites.xml"); llifstream file; - file.open(old_filename); + file.open(old_filename.c_str()); if (file.is_open()) { file.close(); @@ -1508,7 +1508,7 @@ void LLFavoritesOrderStorage::load() LLSD settings_llsd; llifstream file; - file.open(filename); + file.open(filename.c_str()); if (file.is_open()) { LLSDSerialize::fromXML(settings_llsd, file); @@ -1542,7 +1542,7 @@ void LLFavoritesOrderStorage::saveFavoritesSLURLs() if (!filename.empty()) { llifstream in_file; - in_file.open(filename); + in_file.open(filename.c_str()); LLSD fav_llsd; if (in_file.is_open()) { @@ -1589,7 +1589,7 @@ void LLFavoritesOrderStorage::saveFavoritesSLURLs() fav_llsd[av_name.getUserName()] = user_llsd; llofstream file; - file.open(filename); + file.open(filename.c_str()); if ( file.is_open() ) { LLSDSerialize::toPrettyXML(fav_llsd, file); @@ -1614,7 +1614,7 @@ void LLFavoritesOrderStorage::removeFavoritesRecordOfUser() { LLSD fav_llsd; llifstream file; - file.open(filename); + file.open(filename.c_str()); if (file.is_open()) { LLSDSerialize::fromXML(fav_llsd, file); @@ -1631,7 +1631,7 @@ void LLFavoritesOrderStorage::removeFavoritesRecordOfUser() } llofstream out_file; - out_file.open(filename); + out_file.open(filename.c_str()); if ( out_file.is_open() ) { LLSDSerialize::toPrettyXML(fav_llsd, out_file); @@ -1687,7 +1687,7 @@ void LLFavoritesOrderStorage::save() } llofstream file; - file.open(filename); + file.open(filename.c_str()); if ( file.is_open() ) { LLSDSerialize::toPrettyXML(settings_llsd, file); diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index 5c8926e54c..73f10e24d6 100755 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -331,7 +331,7 @@ bool LLFeatureManager::parseFeatureTable(std::string filename) U32 version; cleanupFeatureTables(); // in case an earlier attempt left partial results - file.open(filename); /*Flawfinder: ignore*/ + file.open(filename.c_str()); /*Flawfinder: ignore*/ if (!file) { diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index 7ac3ac2f61..b342d8fdf3 100755 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -156,7 +156,7 @@ BOOL LLFloaterAbout::postBuild() std::string contributors_path = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"contributors.txt"); llifstream contrib_file; std::string contributors; - contrib_file.open(contributors_path); /* Flawfinder: ignore */ + contrib_file.open(contributors_path.c_str()); /* Flawfinder: ignore */ if (contrib_file.is_open()) { std::getline(contrib_file, contributors); // all names are on a single line @@ -173,7 +173,7 @@ BOOL LLFloaterAbout::postBuild() // Get the Versions and Copyrights, created at build time std::string licenses_path = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"packages-info.txt"); llifstream licenses_file; - licenses_file.open(licenses_path); /* Flawfinder: ignore */ + licenses_file.open(licenses_path.c_str()); /* Flawfinder: ignore */ if (licenses_file.is_open()) { std::string license_line; diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index 513c33e60d..566a3c9cd3 100755 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -348,11 +348,11 @@ void LLFloaterAvatarPicker::populateFriend() for(it = collector.mOnline.begin(); it!=collector.mOnline.end(); it++) { - friends_scroller->addStringUUIDItem(it->first, it->second); + friends_scroller->addStringUUIDItem(it->second, it->first); } for(it = collector.mOffline.begin(); it!=collector.mOffline.end(); it++) { - friends_scroller->addStringUUIDItem(it->first, it->second); + friends_scroller->addStringUUIDItem(it->second, it->first); } friends_scroller->sortByColumnIndex(0, TRUE); } diff --git a/indra/newview/llfloaterbump.cpp b/indra/newview/llfloaterbump.cpp index ad44c509d9..34904cf7ed 100755 --- a/indra/newview/llfloaterbump.cpp +++ b/indra/newview/llfloaterbump.cpp @@ -30,10 +30,17 @@ #include "llsd.h" #include "mean_collision_data.h" +#include "llavataractions.h" #include "llfloaterbump.h" +#include "llfloaterreporter.h" +#include "llmutelist.h" +#include "llpanelblockedlist.h" #include "llscrolllistctrl.h" +#include "lltrans.h" #include "lluictrlfactory.h" #include "llviewermessage.h" +#include "llviewermenu.h" +#include "llviewerobjectlist.h" ///---------------------------------------------------------------------------- /// Class LLFloaterBump @@ -43,6 +50,18 @@ LLFloaterBump::LLFloaterBump(const LLSD& key) : LLFloater(key) { + mCommitCallbackRegistrar.add("Avatar.SendIM", boost::bind(&LLFloaterBump::startIM, this)); + mCommitCallbackRegistrar.add("Avatar.ReportAbuse", boost::bind(&LLFloaterBump::reportAbuse, this)); + mCommitCallbackRegistrar.add("ShowAgentProfile", boost::bind(&LLFloaterBump::showProfile, this)); + mCommitCallbackRegistrar.add("Avatar.InviteToGroup", boost::bind(&LLFloaterBump::inviteToGroup, this)); + mCommitCallbackRegistrar.add("Avatar.Call", boost::bind(&LLFloaterBump::startCall, this)); + mEnableCallbackRegistrar.add("Avatar.EnableCall", boost::bind(&LLAvatarActions::canCall)); + mCommitCallbackRegistrar.add("Avatar.AddFriend", boost::bind(&LLFloaterBump::addFriend, this)); + mEnableCallbackRegistrar.add("Avatar.EnableAddFriend", boost::bind(&LLFloaterBump::enableAddFriend, this)); + mCommitCallbackRegistrar.add("Avatar.Mute", boost::bind(&LLFloaterBump::muteAvatar, this)); + mEnableCallbackRegistrar.add("Avatar.EnableMute", boost::bind(&LLFloaterBump::enableMute, this)); + mCommitCallbackRegistrar.add("PayObject", boost::bind(&LLFloaterBump::payAvatar, this)); + mCommitCallbackRegistrar.add("Tools.LookAtSelection", boost::bind(&LLFloaterBump::zoomInAvatar, this)); } @@ -51,13 +70,25 @@ LLFloaterBump::~LLFloaterBump() { } +BOOL LLFloaterBump::postBuild() +{ + mList = getChild<LLScrollListCtrl>("bump_list"); + mList->setAllowMultipleSelection(false); + mList->setRightMouseDownCallback(boost::bind(&LLFloaterBump::onScrollListRightClicked, this, _1, _2, _3)); + + mPopupMenu = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>("menu_avatar_other.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); + mPopupMenu->setItemVisible(std::string("Normal"), false); + mPopupMenu->setItemVisible(std::string("Always use impostor"), false); + mPopupMenu->setItemVisible(std::string("Never use impostor"), false); + mPopupMenu->setItemVisible(std::string("Impostor seperator"), false); + + return TRUE; +} // virtual void LLFloaterBump::onOpen(const LLSD& key) { - LLScrollListCtrl* list = getChild<LLScrollListCtrl>("bump_list"); - if (!list) - return; - list->deleteAllItems(); + mNames.clear(); + mList->deleteAllItems(); if (gMeanCollisionList.empty()) { @@ -65,7 +96,7 @@ void LLFloaterBump::onOpen(const LLSD& key) LLSD row; row["columns"][0]["value"] = none_detected; row["columns"][0]["font"] = "SansSerifBold"; - list->addElement(row); + mList->addElement(row); } else { @@ -73,7 +104,7 @@ void LLFloaterBump::onOpen(const LLSD& key) iter != gMeanCollisionList.end(); ++iter) { LLMeanCollisionData *mcd = *iter; - add(list, mcd); + add(mList, mcd); } } } @@ -125,4 +156,94 @@ void LLFloaterBump::add(LLScrollListCtrl* list, LLMeanCollisionData* mcd) row["columns"][0]["value"] = text; row["columns"][0]["font"] = "SansSerifBold"; list->addElement(row); + + + mNames[mcd->mPerp] = mcd->mFullName; +} + + +void LLFloaterBump::onScrollListRightClicked(LLUICtrl* ctrl, S32 x, S32 y) +{ + if (!gMeanCollisionList.empty()) + { + LLScrollListItem* item = mList->hitItem(x, y); + if (item && mPopupMenu) + { + mItemUUID = item->getUUID(); + mPopupMenu->buildDrawLabels(); + mPopupMenu->updateParent(LLMenuGL::sMenuContainer); + + std::string mute_msg = (LLMuteList::getInstance()->isMuted(mItemUUID, mNames[mItemUUID])) ? "UnmuteAvatar" : "MuteAvatar"; + mPopupMenu->getChild<LLUICtrl>("Avatar Mute")->setValue(LLTrans::getString(mute_msg)); + mPopupMenu->setItemEnabled(std::string("Zoom In"), (BOOL)gObjectList.findObject(mItemUUID)); + + ((LLContextMenu*)mPopupMenu)->show(x, y); + LLMenuGL::showPopup(ctrl, mPopupMenu, x, y); + } + } +} + + +void LLFloaterBump::startIM() +{ + LLAvatarActions::startIM(mItemUUID); +} + +void LLFloaterBump::startCall() +{ + LLAvatarActions::startCall(mItemUUID); +} + +void LLFloaterBump::reportAbuse() +{ + LLFloaterReporter::showFromAvatar(mItemUUID, "av_name"); +} + +void LLFloaterBump::showProfile() +{ + LLAvatarActions::showProfile(mItemUUID); +} + +void LLFloaterBump::addFriend() +{ + LLAvatarActions::requestFriendshipDialog(mItemUUID); +} + +bool LLFloaterBump::enableAddFriend() +{ + return !LLAvatarActions::isFriend(mItemUUID); +} + +void LLFloaterBump::muteAvatar() +{ + LLMute mute(mItemUUID, mNames[mItemUUID], LLMute::AGENT); + if (LLMuteList::getInstance()->isMuted(mute.mID)) + { + LLMuteList::getInstance()->remove(mute); + } + else + { + LLMuteList::getInstance()->add(mute); + LLPanelBlockedList::showPanelAndSelect(mute.mID); + } +} + +void LLFloaterBump::payAvatar() +{ + LLAvatarActions::pay(mItemUUID); +} + +void LLFloaterBump::zoomInAvatar() +{ + handle_zoom_to_object(mItemUUID); +} + +bool LLFloaterBump::enableMute() +{ + return LLAvatarActions::canBlock(mItemUUID); +} + +void LLFloaterBump::inviteToGroup() +{ + LLAvatarActions::inviteToGroup(mItemUUID); } diff --git a/indra/newview/llfloaterbump.h b/indra/newview/llfloaterbump.h index 5acab6da8c..11b7db9fee 100755 --- a/indra/newview/llfloaterbump.h +++ b/indra/newview/llfloaterbump.h @@ -29,6 +29,7 @@ #define LL_LLFLOATERBUMP_H #include "llfloater.h" +#include "llmenugl.h" class LLMeanCollisionData; class LLScrollListCtrl; @@ -39,14 +40,36 @@ class LLFloaterBump friend class LLFloaterReg; protected: void add(LLScrollListCtrl* list, LLMeanCollisionData *mcd); + void onScrollListRightClicked(LLUICtrl* ctrl, S32 x, S32 y); public: + /*virtual*/ BOOL postBuild(); /*virtual*/ void onOpen(const LLSD& key); + void startIM(); + void startCall(); + void reportAbuse(); + void showProfile(); + void addFriend(); + void inviteToGroup(); + bool enableAddFriend(); + void muteAvatar(); + void payAvatar(); + void zoomInAvatar(); + bool enableMute(); + private: LLFloaterBump(const LLSD& key); virtual ~LLFloaterBump(); + + LLScrollListCtrl* mList; + LLMenuGL* mPopupMenu; + LLUUID mItemUUID; + + typedef std::map<LLUUID, std::string> uuid_map_t; + uuid_map_t mNames; + }; #endif diff --git a/indra/newview/llfloatercamera.cpp b/indra/newview/llfloatercamera.cpp index 6a82b8c74c..20d650fa37 100755 --- a/indra/newview/llfloatercamera.cpp +++ b/indra/newview/llfloatercamera.cpp @@ -32,6 +32,7 @@ #include "llfloaterreg.h" // Viewer includes +#include "llagent.h" #include "llagentcamera.h" #include "lljoystickbutton.h" #include "llviewercontrol.h" @@ -340,6 +341,8 @@ void LLFloaterCamera::onClose(bool app_quitting) switchMode(CAMERA_CTRL_MODE_PAN); mClosed = TRUE; + + gAgent.setMovementLocked(FALSE); } LLFloaterCamera::LLFloaterCamera(const LLSD& val) diff --git a/indra/newview/llfloatercolorpicker.cpp b/indra/newview/llfloatercolorpicker.cpp index 0c59ba9a6d..535cb368bd 100755 --- a/indra/newview/llfloatercolorpicker.cpp +++ b/indra/newview/llfloatercolorpicker.cpp @@ -342,11 +342,6 @@ void LLFloaterColorPicker::setCurRgb ( F32 curRIn, F32 curGIn, F32 curBIn ) curG = curGIn; curB = curBIn; - if (mApplyImmediateCheck->get()) - { - LLColorSwatchCtrl::onColorChanged ( getSwatch (), LLColorSwatchCtrl::COLOR_CHANGE ); - } - // update corresponding HSL values and LLColor3(curRIn, curGIn, curBIn).calcHSL(&curH, &curS, &curL); @@ -374,11 +369,6 @@ void LLFloaterColorPicker::setCurHsl ( F32 curHIn, F32 curSIn, F32 curLIn ) // update corresponding RGB values and hslToRgb ( curH, curS, curL, curR, curG, curB ); - - if (mApplyImmediateCheck->get()) - { - LLColorSwatchCtrl::onColorChanged ( getSwatch (), LLColorSwatchCtrl::COLOR_CHANGE ); - } } ////////////////////////////////////////////////////////////////////////////// @@ -467,7 +457,8 @@ void LLFloaterColorPicker::onImmediateCheck( LLUICtrl* ctrl, void* data) void LLFloaterColorPicker::onColorSelect( const LLTextureEntry& te ) { - setCurRgb(te.getColor().mV[VRED], te.getColor().mV[VGREEN], te.getColor().mV[VBLUE]); + // Pipete + selectCurRgb(te.getColor().mV[VRED], te.getColor().mV[VGREEN], te.getColor().mV[VBLUE]); } void LLFloaterColorPicker::onMouseCaptureLost() @@ -643,6 +634,28 @@ const LLColor4& LLFloaterColorPicker::getComplimentaryColor ( const LLColor4& ba } ////////////////////////////////////////////////////////////////////////////// +// set current RGB and rise change event if needed. +void LLFloaterColorPicker::selectCurRgb ( F32 curRIn, F32 curGIn, F32 curBIn ) +{ + setCurRgb(curRIn, curGIn, curBIn); + if (mApplyImmediateCheck->get()) + { + LLColorSwatchCtrl::onColorChanged ( getSwatch (), LLColorSwatchCtrl::COLOR_CHANGE ); + } +} + +////////////////////////////////////////////////////////////////////////////// +// set current HSL and rise change event if needed. +void LLFloaterColorPicker::selectCurHsl ( F32 curHIn, F32 curSIn, F32 curLIn ) +{ + setCurHsl(curHIn, curSIn, curLIn); + if (mApplyImmediateCheck->get()) + { + LLColorSwatchCtrl::onColorChanged ( getSwatch (), LLColorSwatchCtrl::COLOR_CHANGE ); + } +} + +////////////////////////////////////////////////////////////////////////////// // draw color palette void LLFloaterColorPicker::drawPalette () { @@ -736,7 +749,7 @@ void LLFloaterColorPicker::onTextEntryChanged ( LLUICtrl* ctrl ) } // update current RGB (and implicitly HSL) - setCurRgb ( rVal, gVal, bVal ); + selectCurRgb ( rVal, gVal, bVal ); updateTextEntry (); } @@ -759,15 +772,10 @@ void LLFloaterColorPicker::onTextEntryChanged ( LLUICtrl* ctrl ) lVal = (F32)ctrl->getValue().asReal() / 100.0f; // update current HSL (and implicitly RGB) - setCurHsl ( hVal, sVal, lVal ); + selectCurHsl ( hVal, sVal, lVal ); updateTextEntry (); } - - if (mApplyImmediateCheck->get()) - { - LLColorSwatchCtrl::onColorChanged ( getSwatch (), LLColorSwatchCtrl::COLOR_CHANGE ); - } } ////////////////////////////////////////////////////////////////////////////// @@ -780,7 +788,7 @@ BOOL LLFloaterColorPicker::updateRgbHslFromPoint ( S32 xPosIn, S32 yPosIn ) yPosIn >= mRGBViewerImageTop - mRGBViewerImageHeight ) { // update HSL (and therefore RGB) based on new H & S and current L - setCurHsl ( ( ( F32 )xPosIn - ( F32 )mRGBViewerImageLeft ) / ( F32 )mRGBViewerImageWidth, + selectCurHsl ( ( ( F32 )xPosIn - ( F32 )mRGBViewerImageLeft ) / ( F32 )mRGBViewerImageWidth, ( ( F32 )yPosIn - ( ( F32 )mRGBViewerImageTop - ( F32 )mRGBViewerImageHeight ) ) / ( F32 )mRGBViewerImageHeight, getCurL () ); @@ -795,7 +803,7 @@ BOOL LLFloaterColorPicker::updateRgbHslFromPoint ( S32 xPosIn, S32 yPosIn ) { // update HSL (and therefore RGB) based on current HS and new L - setCurHsl ( getCurH (), + selectCurHsl ( getCurH (), getCurS (), ( ( F32 )yPosIn - ( ( F32 )mRGBViewerImageTop - ( F32 )mRGBViewerImageHeight ) ) / ( F32 )mRGBViewerImageHeight ); @@ -887,7 +895,7 @@ BOOL LLFloaterColorPicker::handleMouseDown ( S32 x, S32 y, MASK mask ) { LLColor4 selected = *mPalette [ index ]; - setCurRgb ( selected [ 0 ], selected [ 1 ], selected [ 2 ] ); + selectCurRgb ( selected [ 0 ], selected [ 1 ], selected [ 2 ] ); if (mApplyImmediateCheck->get()) { diff --git a/indra/newview/llfloatercolorpicker.h b/indra/newview/llfloatercolorpicker.h index d4d22b643a..8c16ebdf03 100755 --- a/indra/newview/llfloatercolorpicker.h +++ b/indra/newview/llfloatercolorpicker.h @@ -122,6 +122,9 @@ class LLFloaterColorPicker static void onImmediateCheck ( LLUICtrl* ctrl, void* data ); void onColorSelect( const class LLTextureEntry& te ); private: + // mutators for color values, can raise event to preview changes at object + void selectCurRgb ( F32 curRIn, F32 curGIn, F32 curBIn ); + void selectCurHsl ( F32 curHIn, F32 curSIn, F32 curLIn ); // draws color selection palette void drawPalette (); diff --git a/indra/newview/llfloaterflickr.cpp b/indra/newview/llfloaterflickr.cpp index 51352e083a..cd132b843d 100644 --- a/indra/newview/llfloaterflickr.cpp +++ b/indra/newview/llfloaterflickr.cpp @@ -51,7 +51,7 @@ #include "lltabcontainer.h" #include "llviewerparcelmgr.h" #include "llviewerregion.h" - +#include <boost/regex.hpp> static LLPanelInjector<LLFlickrPhotoPanel> t_panel_photo("llflickrphotopanel"); static LLPanelInjector<LLFlickrAccountPanel> t_panel_account("llflickraccountpanel"); @@ -344,7 +344,12 @@ void LLFlickrPhotoPanel::sendPhoto() std::string parcel_name = LLViewerParcelMgr::getInstance()->getAgentParcelName(); if (!parcel_name.empty()) { - photo_link_text += " at " + parcel_name; + boost::regex pattern = boost::regex("\\S\\.[a-zA-Z]{2,}"); + boost::match_results<std::string::const_iterator> matches; + if(!boost::regex_search(parcel_name, matches, pattern)) + { + photo_link_text += " at " + parcel_name; + } } photo_link_text += " in Second Life"; diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index 2864f018b2..357b635594 100755 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -118,6 +118,7 @@ LLFloaterIMSessionTab* LLFloaterIMSessionTab::getConversation(const LLUUID& uuid else { conv = LLFloaterReg::getTypedInstance<LLFloaterIMSessionTab>("impanel", LLSD(uuid)); + conv->setOpenPositioning(LLFloaterEnums::POSITIONING_RELATIVE); } return conv; diff --git a/indra/newview/llfloaterinspect.cpp b/indra/newview/llfloaterinspect.cpp index 5a1dfc99ab..10088d20c2 100755 --- a/indra/newview/llfloaterinspect.cpp +++ b/indra/newview/llfloaterinspect.cpp @@ -32,6 +32,7 @@ #include "llfloatertools.h" #include "llavataractions.h" #include "llavatarnamecache.h" +#include "llgroupactions.h" #include "llscrolllistctrl.h" #include "llscrolllistitem.h" #include "llselectmgr.h" @@ -147,8 +148,17 @@ void LLFloaterInspect::onClickOwnerProfile() LLSelectNode* node = mObjectSelection->getFirstNode(&func); if(node) { - const LLUUID& owner_id = node->mPermissions->getOwner(); - LLAvatarActions::showProfile(owner_id); + if(node->mPermissions->isGroupOwned()) + { + const LLUUID& idGroup = node->mPermissions->getGroup(); + LLGroupActions::show(idGroup); + } + else + { + const LLUUID& owner_id = node->mPermissions->getOwner(); + LLAvatarActions::showProfile(owner_id); + } + } } } @@ -219,21 +229,42 @@ void LLFloaterInspect::refresh() const LLUUID& idCreator = obj->mPermissions->getCreator(); LLAvatarName av_name; - // Only work with the names if we actually get a result - // from the name cache. If not, defer setting the - // actual name and set a placeholder. - if (LLAvatarNameCache::get(idOwner, &av_name)) + if(obj->mPermissions->isGroupOwned()) { - owner_name = av_name.getCompleteName(); + std::string group_name; + const LLUUID& idGroup = obj->mPermissions->getGroup(); + if(gCacheName->getGroupName(idGroup, group_name)) + { + owner_name = "[" + group_name + "] (group)"; + } + else + { + owner_name = LLTrans::getString("RetrievingData"); + if (mOwnerNameCacheConnection.connected()) + { + mOwnerNameCacheConnection.disconnect(); + } + mOwnerNameCacheConnection = gCacheName->getGroup(idGroup, boost::bind(&LLFloaterInspect::onGetOwnerNameCallback, this)); + } } else { - owner_name = LLTrans::getString("RetrievingData"); - if (mOwnerNameCacheConnection.connected()) + // Only work with the names if we actually get a result + // from the name cache. If not, defer setting the + // actual name and set a placeholder. + if (LLAvatarNameCache::get(idOwner, &av_name)) + { + owner_name = av_name.getCompleteName(); + } + else { - mOwnerNameCacheConnection.disconnect(); + owner_name = LLTrans::getString("RetrievingData"); + if (mOwnerNameCacheConnection.connected()) + { + mOwnerNameCacheConnection.disconnect(); + } + mOwnerNameCacheConnection = LLAvatarNameCache::get(idOwner, boost::bind(&LLFloaterInspect::onGetOwnerNameCallback, this)); } - mOwnerNameCacheConnection = LLAvatarNameCache::get(idOwner, boost::bind(&LLFloaterInspect::onGetOwnerNameCallback, this)); } if (LLAvatarNameCache::get(idCreator, &av_name)) diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 8c4feff1d9..5ebd25d228 100755 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -1983,6 +1983,7 @@ void LLPanelLandOptions::refresh() else { // something selected, hooray! + LLViewerRegion* regionp = LLViewerParcelMgr::getInstance()->getSelectionRegion(); // Display options BOOL can_change_options = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_OPTIONS); @@ -1998,8 +1999,9 @@ void LLPanelLandOptions::refresh() mCheckGroupObjectEntry ->set( parcel->getAllowGroupObjectEntry() || parcel->getAllowAllObjectEntry()); mCheckGroupObjectEntry ->setEnabled( can_change_options && !parcel->getAllowAllObjectEntry() ); + BOOL region_damage = regionp ? regionp->getAllowDamage() : FALSE; mCheckSafe ->set( !parcel->getAllowDamage() ); - mCheckSafe ->setEnabled( can_change_options ); + mCheckSafe ->setEnabled( can_change_options && region_damage ); mCheckFly ->set( parcel->getAllowFly() ); mCheckFly ->setEnabled( can_change_options ); @@ -2079,7 +2081,6 @@ void LLPanelLandOptions::refresh() // they can see the checkbox, but its disposition depends on the // state of the region - LLViewerRegion* regionp = LLViewerParcelMgr::getInstance()->getSelectionRegion(); if (regionp) { if (regionp->getSimAccess() == SIM_ACCESS_PG) diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index ec905558aa..72c9170b06 100755 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -732,6 +732,11 @@ void LLFloaterModelPreview::toggleGenarateNormals() { bool enabled = childGetValue("gen_normals").asBoolean(); childSetEnabled("crease_angle", enabled); + if(enabled) { + mModelPreview->generateNormals(); + } else { + mModelPreview->restoreNormals(); + } } //static @@ -2155,7 +2160,7 @@ bool LLModelLoader::loadFromSLM(const std::string& filename) S32 file_size = (S32) stat.st_size; - llifstream ifstream(filename, std::ifstream::in | std::ifstream::binary); + llifstream ifstream(filename.c_str(), std::ifstream::in | std::ifstream::binary); LLSD data; LLSDSerialize::fromBinary(data, ifstream, file_size); ifstream.close(); @@ -3513,7 +3518,7 @@ void LLModelPreview::saveUploadData(const std::string& filename, bool save_skinw data["instance"][i] = instance.asLLSD(); } - llofstream out(filename, std::ios_base::out | std::ios_base::binary); + llofstream out(filename.c_str(), std::ios_base::out | std::ios_base::binary); LLSDSerialize::toBinary(data, out); out.flush(); out.close(); @@ -3834,7 +3839,6 @@ void LLModelPreview::generateNormals() S32 which_lod = mPreviewLOD; - if (which_lod > 4 || which_lod < 0 || mModel[which_lod].empty()) { @@ -3849,19 +3853,81 @@ void LLModelPreview::generateNormals() if (which_lod == 3 && !mBaseModel.empty()) { - for (LLModelLoader::model_list::iterator iter = mBaseModel.begin(); iter != mBaseModel.end(); ++iter) + if(mBaseModelFacesCopy.empty()) + { + mBaseModelFacesCopy.reserve(mBaseModel.size()); + for (LLModelLoader::model_list::iterator it = mBaseModel.begin(), itE = mBaseModel.end(); it != itE; ++it) + { + v_LLVolumeFace_t faces; + (*it)->copyFacesTo(faces); + mBaseModelFacesCopy.push_back(faces); + } + } + + for (LLModelLoader::model_list::iterator it = mBaseModel.begin(), itE = mBaseModel.end(); it != itE; ++it) { - (*iter)->generateNormals(angle_cutoff); + (*it)->generateNormals(angle_cutoff); } mVertexBuffer[5].clear(); } - for (LLModelLoader::model_list::iterator iter = mModel[which_lod].begin(); iter != mModel[which_lod].end(); ++iter) + bool perform_copy = mModelFacesCopy[which_lod].empty(); + if(perform_copy) { + mModelFacesCopy[which_lod].reserve(mModel[which_lod].size()); + } + + for (LLModelLoader::model_list::iterator it = mModel[which_lod].begin(), itE = mModel[which_lod].end(); it != itE; ++it) + { + if(perform_copy) + { + v_LLVolumeFace_t faces; + (*it)->copyFacesTo(faces); + mModelFacesCopy[which_lod].push_back(faces); + } + + (*it)->generateNormals(angle_cutoff); + } + + mVertexBuffer[which_lod].clear(); + refresh(); + updateStatusMessages(); +} + +void LLModelPreview::restoreNormals() +{ + S32 which_lod = mPreviewLOD; + + if (which_lod > 4 || which_lod < 0 || + mModel[which_lod].empty()) + { + return; + } + + if(!mBaseModelFacesCopy.empty()) { - (*iter)->generateNormals(angle_cutoff); + llassert(mBaseModelFacesCopy.size() == mBaseModel.size()); + + vv_LLVolumeFace_t::const_iterator itF = mBaseModelFacesCopy.begin(); + for (LLModelLoader::model_list::iterator it = mBaseModel.begin(), itE = mBaseModel.end(); it != itE; ++it, ++itF) + { + (*it)->copyFacesFrom((*itF)); + } + + mBaseModelFacesCopy.clear(); } + + if(!mModelFacesCopy[which_lod].empty()) + { + vv_LLVolumeFace_t::const_iterator itF = mModelFacesCopy[which_lod].begin(); + for (LLModelLoader::model_list::iterator it = mModel[which_lod].begin(), itE = mModel[which_lod].end(); it != itE; ++it, ++itF) + { + (*it)->copyFacesFrom((*itF)); + } + mModelFacesCopy[which_lod].clear(); + } + mVertexBuffer[which_lod].clear(); refresh(); updateStatusMessages(); diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 6c0c60b87f..618748bd4e 100755 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -343,6 +343,7 @@ public: void loadModelCallback(S32 lod); void genLODs(S32 which_lod = -1, U32 decimation = 3, bool enforce_tri_limit = false); void generateNormals(); + void restoreNormals(); U32 calcResourceCost(); void rebuildUploadData(); void saveUploadData(bool save_skinweights, bool save_joint_poisitions); @@ -447,6 +448,12 @@ private: LLModelLoader::model_list mModel[LLModel::NUM_LODS]; LLModelLoader::model_list mBaseModel; + typedef std::vector<LLVolumeFace> v_LLVolumeFace_t; + typedef std::vector<v_LLVolumeFace_t> vv_LLVolumeFace_t; + + vv_LLVolumeFace_t mModelFacesCopy[LLModel::NUM_LODS]; + vv_LLVolumeFace_t mBaseModelFacesCopy; + U32 mGroup; std::map<LLPointer<LLModel>, U32> mObject; U32 mMaxTriangleLimit; diff --git a/indra/newview/llfloaterpay.cpp b/indra/newview/llfloaterpay.cpp index 172f81d078..31245db344 100755 --- a/indra/newview/llfloaterpay.cpp +++ b/indra/newview/llfloaterpay.cpp @@ -367,7 +367,8 @@ void LLFloaterPay::payViaObject(money_callback callback, LLSafeHandle<LLObjectSe LLSelectNode* node = selection->getFirstRootNode(); if (!node) { - //FIXME: notify user object no longer exists + // object no longer exists + LLNotificationsUtil::add("PayObjectFailed"); floater->closeFloater(); return; } @@ -491,12 +492,22 @@ void LLFloaterPay::onGive(void* data) } if (amount > PAY_AMOUNT_NOTIFICATION && gStatusBar && gStatusBar->getBalance() > amount) { - LLUUID payee_id; - BOOL is_group; + LLUUID payee_id = LLUUID::null; + BOOL is_group = false; if (floater->mObjectSelection.notNull()) { LLSelectNode* node = floater->mObjectSelection->getFirstRootNode(); - node->mPermissions->getOwnership(payee_id, is_group); + if (node) + { + node->mPermissions->getOwnership(payee_id, is_group); + } + else + { + // object no longer exists + LLNotificationsUtil::add("PayObjectFailed"); + floater->closeFloater(); + return; + } } else { @@ -562,6 +573,10 @@ void LLFloaterPay::give(S32 amount) msg->sendReliable( region->getHost() ); } } + else + { + LLNotificationsUtil::add("PayObjectFailed"); + } } else { diff --git a/indra/newview/llfloaterperms.cpp b/indra/newview/llfloaterperms.cpp index 849aa7cd14..042cf47070 100755 --- a/indra/newview/llfloaterperms.cpp +++ b/indra/newview/llfloaterperms.cpp @@ -195,7 +195,7 @@ private: // even if it is the same as a previous one. sPreviousReason = ""; LLFloaterPermsDefault::setCapSent(true); - LL_INFOS("FloaterPermsResponder") << "Sent default permissions to simulator" << LL_ENDL; + LL_INFOS("ObjectPermissionsFloater") << "Default permissions successfully sent to simulator" << LL_ENDL; } }; @@ -223,8 +223,20 @@ void LLFloaterPermsDefault::updateCap() report["default_object_perm_masks"]["NextOwner"] = (LLSD::Integer)LLFloaterPerms::getNextOwnerPerms(sCategoryNames[CAT_OBJECTS]); + { + LL_DEBUGS("ObjectPermissionsFloater") << "Sending default permissions to '" + << object_url << "'\n"; + std::ostringstream sent_perms_log; + LLSDSerialize::toPrettyXML(report, sent_perms_log); + LL_CONT << sent_perms_log.str() << LL_ENDL; + } + LLHTTPClient::post(object_url, report, new LLFloaterPermsResponder()); } + else + { + LL_DEBUGS("ObjectPermissionsFloater") << "AgentPreferences cap not available." << LL_ENDL; + } } void LLFloaterPermsDefault::setCapSent(bool cap_sent) diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 306ee45ef2..7083c1ddf5 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -37,6 +37,7 @@ #include "message.h" #include "llfloaterautoreplacesettings.h" #include "llagent.h" +#include "llagentcamera.h" #include "llcheckboxctrl.h" #include "llcolorswatch.h" #include "llcombobox.h" @@ -73,6 +74,7 @@ #include "llviewermessage.h" #include "llviewershadermgr.h" #include "llviewerthrottle.h" +#include "llvoavatarself.h" #include "llvotree.h" #include "llvosky.h" #include "llfloaterpathfindingconsole.h" @@ -263,6 +265,14 @@ void handleDisplayNamesOptionChanged(const LLSD& newvalue) LLVOAvatar::invalidateNameTags(); } +void handleAppearanceCameraMovementChanged(const LLSD& newvalue) +{ + if(!newvalue.asBoolean() && gAgentCamera.getCameraMode() == CAMERA_MODE_CUSTOMIZE_AVATAR) + { + gAgentCamera.changeCameraToDefault(); + gAgentCamera.resetView(); + } +} /*bool callback_skip_dialogs(const LLSD& notification, const LLSD& response, LLFloaterPreference* floater) { @@ -373,6 +383,8 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) gSavedSettings.getControl("NameTagShowFriends")->getCommitSignal()->connect(boost::bind(&handleNameTagOptionChanged, _2)); gSavedSettings.getControl("UseDisplayNames")->getCommitSignal()->connect(boost::bind(&handleDisplayNamesOptionChanged, _2)); + gSavedSettings.getControl("AppearanceCameraMovement")->getCommitSignal()->connect(boost::bind(&handleAppearanceCameraMovementChanged, _2)); + LLAvatarPropertiesProcessor::getInstance()->addObserver( gAgent.getID(), this ); mCommitCallbackRegistrar.add("Pref.ClearLog", boost::bind(&LLConversationLog::onClearLog, &LLConversationLog::instance())); diff --git a/indra/newview/llfloaterproperties.cpp b/indra/newview/llfloaterproperties.cpp index a3bf99f054..6bfc780722 100755 --- a/indra/newview/llfloaterproperties.cpp +++ b/indra/newview/llfloaterproperties.cpp @@ -36,6 +36,7 @@ #include "llagent.h" #include "llbutton.h" #include "llcheckboxctrl.h" +#include "llcombobox.h" #include "llavataractions.h" #include "llinventorydefines.h" #include "llinventoryobserver.h" @@ -143,7 +144,7 @@ BOOL LLFloaterProperties::postBuild() getChild<LLUICtrl>("CheckNextOwnerTransfer")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitPermissions, this)); // Mark for sale or not, and sale info getChild<LLUICtrl>("CheckPurchase")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitSaleInfo, this)); - getChild<LLUICtrl>("RadioSaleType")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitSaleType, this)); + getChild<LLUICtrl>("ComboBoxSaleType")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitSaleType, this)); // "Price" label for edit getChild<LLUICtrl>("Edit Cost")->setCommitCallback(boost::bind(&LLFloaterProperties::onCommitSaleInfo, this)); // The UI has been built, now fill in all the values @@ -188,7 +189,7 @@ void LLFloaterProperties::refresh() "CheckNextOwnerCopy", "CheckNextOwnerTransfer", "CheckPurchase", - "RadioSaleType", + "ComboBoxSaleType", "Edit Cost" }; for(size_t t=0; t<LL_ARRAY_SIZE(enableNames); ++t) @@ -479,6 +480,9 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) const LLSaleInfo& sale_info = item->getSaleInfo(); BOOL is_for_sale = sale_info.isForSale(); + LLComboBox* combo_sale_type = getChild<LLComboBox>("ComboBoxSaleType"); + LLUICtrl* edit_cost = getChild<LLUICtrl>("Edit Cost"); + // Check for ability to change values. if (is_obj_modify && can_agent_sell && gAgent.allowOperation(PERM_TRANSFER, perm, GP_OBJECT_MANIPULATE)) @@ -491,9 +495,9 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) getChildView("CheckNextOwnerCopy")->setEnabled((base_mask & PERM_COPY) && !cannot_restrict_permissions); getChildView("CheckNextOwnerTransfer")->setEnabled((next_owner_mask & PERM_COPY) && !cannot_restrict_permissions); - getChildView("RadioSaleType")->setEnabled(is_complete && is_for_sale); getChildView("TextPrice")->setEnabled(is_complete && is_for_sale); - getChildView("Edit Cost")->setEnabled(is_complete && is_for_sale); + combo_sale_type->setEnabled(is_complete && is_for_sale); + edit_cost->setEnabled(is_complete && is_for_sale); } else { @@ -505,31 +509,28 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) getChildView("CheckNextOwnerCopy")->setEnabled(FALSE); getChildView("CheckNextOwnerTransfer")->setEnabled(FALSE); - getChildView("RadioSaleType")->setEnabled(FALSE); getChildView("TextPrice")->setEnabled(FALSE); - getChildView("Edit Cost")->setEnabled(FALSE); + combo_sale_type->setEnabled(FALSE); + edit_cost->setEnabled(FALSE); } // Set values. getChild<LLUICtrl>("CheckPurchase")->setValue(is_for_sale); - getChildView("combobox sale copy")->setEnabled(is_for_sale); - getChildView("Edit Cost")->setEnabled(is_for_sale); getChild<LLUICtrl>("CheckNextOwnerModify")->setValue(LLSD(BOOL(next_owner_mask & PERM_MODIFY))); getChild<LLUICtrl>("CheckNextOwnerCopy")->setValue(LLSD(BOOL(next_owner_mask & PERM_COPY))); getChild<LLUICtrl>("CheckNextOwnerTransfer")->setValue(LLSD(BOOL(next_owner_mask & PERM_TRANSFER))); - LLRadioGroup* radioSaleType = getChild<LLRadioGroup>("RadioSaleType"); if (is_for_sale) { - radioSaleType->setSelectedIndex((S32)sale_info.getSaleType() - 1); S32 numerical_price; numerical_price = sale_info.getSalePrice(); - getChild<LLUICtrl>("Edit Cost")->setValue(llformat("%d",numerical_price)); + edit_cost->setValue(llformat("%d",numerical_price)); + combo_sale_type->setValue(sale_info.getSaleType()); } else { - radioSaleType->setSelectedIndex(-1); - getChild<LLUICtrl>("Edit Cost")->setValue(llformat("%d",0)); + edit_cost->setValue(llformat("%d",0)); + combo_sale_type->setValue(LLSaleInfo::FS_COPY); } } @@ -757,25 +758,11 @@ void LLFloaterProperties::updateSaleInfo() { // turn on sale info LLSaleInfo::EForSale sale_type = LLSaleInfo::FS_COPY; - - LLRadioGroup* RadioSaleType = getChild<LLRadioGroup>("RadioSaleType"); - if(RadioSaleType) + + LLComboBox* combo_sale_type = getChild<LLComboBox>("ComboBoxSaleType"); + if (combo_sale_type) { - switch (RadioSaleType->getSelectedIndex()) - { - case 0: - sale_type = LLSaleInfo::FS_ORIGINAL; - break; - case 1: - sale_type = LLSaleInfo::FS_COPY; - break; - case 2: - sale_type = LLSaleInfo::FS_CONTENTS; - break; - default: - sale_type = LLSaleInfo::FS_COPY; - break; - } + sale_type = static_cast<LLSaleInfo::EForSale>(combo_sale_type->getValue().asInteger()); } if (sale_type == LLSaleInfo::FS_COPY diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index dbc643881e..b27a42cb8e 100755 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -367,8 +367,6 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater) LLViewerWindow::ESnapshotType layer_type = getLayerType(floater); floater->getChild<LLComboBox>("local_format_combo")->selectNthItem(gSavedSettings.getS32("SnapshotFormat")); - enableAspectRatioCheckbox(floater, !floater->impl.mAspectRatioCheckOff); - setAspectRatioCheckboxValue(floater, gSavedSettings.getBOOL("KeepAspectForSnapshot")); floater->getChildView("layer_types")->setEnabled(shot_type == LLSnapshotLivePreview::SNAPSHOT_LOCAL); LLPanelSnapshot* active_panel = getActivePanel(floater); @@ -478,8 +476,9 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater) default: break; } - - if (previewp) + setAspectRatioCheckboxValue(floater, !floater->impl.mAspectRatioCheckOff && gSavedSettings.getBOOL("KeepAspectForSnapshot")); + + if (previewp) { previewp->setSnapshotType(shot_type); previewp->setSnapshotFormat(shot_format); @@ -554,7 +553,7 @@ void LLFloaterSnapshot::Impl::onClickNewSnapshot(void* data) { view->impl.setStatus(Impl::STATUS_READY); LL_DEBUGS() << "updating snapshot" << LL_ENDL; - previewp->updateSnapshot(TRUE); + previewp->mForceUpdateSnapshot = TRUE; } } @@ -627,6 +626,13 @@ void LLFloaterSnapshot::Impl::applyKeepAspectCheck(LLFloaterSnapshot* view, BOOL if (view) { + LLPanelSnapshot* active_panel = getActivePanel(view); + if (checked && active_panel) + { + LLComboBox* combo = view->getChild<LLComboBox>(active_panel->getImageSizeComboName()); + combo->setCurrentByIndex(combo->getItemCount() - 1); // "custom" is always the last index + } + LLSnapshotLivePreview* previewp = getPreviewView(view) ; if(previewp) { @@ -691,7 +697,7 @@ void LLFloaterSnapshot::Impl::checkAspectRatio(LLFloaterSnapshot *view, S32 inde } view->impl.mAspectRatioCheckOff = !enable_cb; - enableAspectRatioCheckbox(view, enable_cb); + if (previewp) { previewp->mKeepAspectRatio = keep_aspect; @@ -1193,6 +1199,22 @@ void LLFloaterSnapshot::onOpen(const LLSD& key) void LLFloaterSnapshot::onClose(bool app_quitting) { getParent()->setMouseOpaque(FALSE); + + //unfreeze everything, hide fullscreen preview + LLSnapshotLivePreview* previewp = LLFloaterSnapshot::Impl::getPreviewView(this); + if (previewp) + { + previewp->setVisible(FALSE); + previewp->setEnabled(FALSE); + } + + gSavedSettings.setBOOL("FreezeTime", FALSE); + impl.mAvatarPauseHandles.clear(); + + if (impl.mLastToolset) + { + LLToolMgr::getInstance()->setCurrentToolset(impl.mLastToolset); + } } // virtual diff --git a/indra/newview/llfloaterspellchecksettings.cpp b/indra/newview/llfloaterspellchecksettings.cpp index 54c7b4c37d..5124dae147 100755 --- a/indra/newview/llfloaterspellchecksettings.cpp +++ b/indra/newview/llfloaterspellchecksettings.cpp @@ -350,7 +350,8 @@ void LLFloaterSpellCheckerImport::onBtnOK() custom_dict_info["language"] = dict_language; LLSD custom_dict_map; - llifstream custom_file_in(LLSpellChecker::getDictionaryUserPath() + "user_dictionaries.xml"); + std::string custom_filename(LLSpellChecker::getDictionaryUserPath() + "user_dictionaries.xml"); + llifstream custom_file_in(custom_filename.c_str()); if (custom_file_in.is_open()) { LLSDSerialize::fromXMLDocument(custom_dict_map, custom_file_in); @@ -372,7 +373,7 @@ void LLFloaterSpellCheckerImport::onBtnOK() custom_dict_map.append(custom_dict_info); } - llofstream custom_file_out(LLSpellChecker::getDictionaryUserPath() + "user_dictionaries.xml", std::ios::trunc); + llofstream custom_file_out(custom_filename.c_str(), std::ios::trunc); if (custom_file_out.is_open()) { LLSDSerialize::toPrettyXML(custom_dict_map, custom_file_out); diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index cc4753577d..1b1c24b19a 100755 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -63,6 +63,7 @@ #include "llviewerregion.h" #include "llviewerstats.h" #include "llviewertexture.h" +#include "llviewerwindow.h" #include "llworldmap.h" #include "llworldmapmessage.h" #include "llworldmapview.h" @@ -890,7 +891,7 @@ void LLFloaterWorldMap::buildAvatarIDList() end = collector.mMappable.end(); for( ; it != end; ++it) { - list->addSimpleElement((*it).first, ADD_BOTTOM, (*it).second); + list->addSimpleElement((*it).second, ADD_BOTTOM, (*it).first); } list->setCurrentByID( LLAvatarTracker::instance().getAvatarID() ); @@ -1634,3 +1635,10 @@ void LLFloaterWorldMap::onChangeMaturity() gSavedSettings.setBOOL("ShowAdultEvents", FALSE); } } + +void LLFloaterWorldMap::onFocusLost() +{ + gViewerWindow->showCursor(); + LLWorldMapView* map_panel = (LLWorldMapView*)gFloaterWorldMap->mPanel; + map_panel->mPanning = FALSE; +} diff --git a/indra/newview/llfloaterworldmap.h b/indra/newview/llfloaterworldmap.h index 84ca5a7a71..7ce8dae9a9 100755 --- a/indra/newview/llfloaterworldmap.h +++ b/indra/newview/llfloaterworldmap.h @@ -68,6 +68,8 @@ public: /*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); /*virtual*/ void draw(); + /*virtual*/ void onFocusLost(); + // methods for dealing with inventory. The observe() method is // called during program startup. inventoryUpdated() will be // called by a helper object when an interesting change has diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 8d8239611c..5d3a11e245 100755 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -3061,6 +3061,24 @@ void LLIMMgr::inviteToSession( { if (gAgent.isDoNotDisturb() && !isRejectGroupCall && !isRejectNonFriendCall) { + if (!hasSession(session_id) && (type == IM_SESSION_P2P_INVITE)) + { + std::string fixed_session_name = caller_name; + if(!session_name.empty() && session_name.size()>1) + { + fixed_session_name = session_name; + } + else + { + LLAvatarName av_name; + if (LLAvatarNameCache::get(caller_id, &av_name)) + { + fixed_session_name = av_name.getDisplayName(); + } + } + LLIMModel::getInstance()->newSession(session_id, fixed_session_name, IM_NOTHING_SPECIAL, caller_id, false, false); + } + LLSD args; addSystemMessage(session_id, "you_auto_rejected_call", args); send_do_not_disturb_message(gMessageSystem, caller_id, session_id); diff --git a/indra/newview/llinspectobject.cpp b/indra/newview/llinspectobject.cpp index a7b93b8030..46019557f8 100755 --- a/indra/newview/llinspectobject.cpp +++ b/indra/newview/llinspectobject.cpp @@ -219,7 +219,7 @@ void LLInspectObject::onOpen(const LLSD& data) LLViewerMediaFocus::getInstance()->clearFocus(); LLSelectMgr::instance().deselectAll(); - mObjectSelection = LLSelectMgr::instance().selectObjectAndFamily(obj); + mObjectSelection = LLSelectMgr::instance().selectObjectAndFamily(obj,FALSE,TRUE); // Mark this as a transient selection struct SetTransient : public LLSelectedNodeFunctor diff --git a/indra/newview/llinspecttoast.cpp b/indra/newview/llinspecttoast.cpp index 0bc7bd188d..d04378daaf 100755 --- a/indra/newview/llinspecttoast.cpp +++ b/indra/newview/llinspecttoast.cpp @@ -89,6 +89,11 @@ void LLInspectToast::onOpen(const LLSD& notification_id) mConnection = toast->setOnToastDestroyedCallback(boost::bind(&LLInspectToast::onToastDestroy, this, _1)); LLPanel * panel = toast->getPanel(); + if (panel == NULL) + { + LL_WARNS() << "Could not get toast's panel." << LL_ENDL; + return; + } panel->setVisible(TRUE); panel->setMouseOpaque(FALSE); if(mPanel != NULL && mPanel->getParent() == this) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 1910656066..a047ed6fee 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -74,6 +74,7 @@ #include "llviewerwindow.h" #include "llvoavatarself.h" #include "llwearablelist.h" +#include "llwearableitemslist.h" #include "lllandmarkactions.h" #include "llpanellandmarks.h" @@ -557,6 +558,46 @@ BOOL LLInvFVBridge::isClipboardPasteableAsLink() const return TRUE; } +void disable_context_entries_if_present(LLMenuGL& menu, + const menuentry_vec_t &disabled_entries) +{ + const LLView::child_list_t *list = menu.getChildList(); + for (LLView::child_list_t::const_iterator itor = list->begin(); + itor != list->end(); + ++itor) + { + LLView *menu_item = (*itor); + std::string name = menu_item->getName(); + + // descend into split menus: + LLMenuItemBranchGL* branchp = dynamic_cast<LLMenuItemBranchGL*>(menu_item); + if ((name == "More") && branchp) + { + disable_context_entries_if_present(*branchp->getBranch(), disabled_entries); + } + + bool found = false; + menuentry_vec_t::const_iterator itor2; + for (itor2 = disabled_entries.begin(); itor2 != disabled_entries.end(); ++itor2) + { + if (*itor2 == name) + { + found = true; + break; + } + } + + if (found) + { + menu_item->setVisible(TRUE); + // A bit of a hack so we can remember that some UI element explicitly set this to be visible + // so that some other UI element from multi-select doesn't later set this invisible. + menu_item->pushVisible(TRUE); + + menu_item->setEnabled(FALSE); + } + } +} void hide_context_entries(LLMenuGL& menu, const menuentry_vec_t &entries_to_show, const menuentry_vec_t &disabled_entries) @@ -765,6 +806,31 @@ void LLInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags) hide_context_entries(menu, items, disabled_items); } +bool get_selection_item_uuids(LLFolderView::selected_items_t& selected_items, uuid_vec_t& ids) +{ + uuid_vec_t results; + S32 non_item = 0; + for(LLFolderView::selected_items_t::iterator it = selected_items.begin(); it != selected_items.end(); ++it) + { + LLItemBridge *view_model = dynamic_cast<LLItemBridge *>((*it)->getViewModelItem()); + + if(view_model && view_model->getUUID().notNull()) + { + results.push_back(view_model->getUUID()); + } + else + { + non_item++; + } + } + if (non_item == 0) + { + ids = results; + return true; + } + return false; +} + void LLInvFVBridge::addTrashContextMenuOptions(menuentry_vec_t &items, menuentry_vec_t &disabled_items) { @@ -1120,7 +1186,7 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type, { LL_WARNS() << LLAssetType::lookup(asset_type) << " asset has inventory type " << LLInventoryType::lookupHumanReadable(inv_type) << " on uuid " << uuid << LL_ENDL; } - new_listener = new LLWearableBridge(inventory, root, uuid, asset_type, inv_type, (LLWearableType::EType)flags); + new_listener = new LLWearableBridge(inventory, root, uuid, asset_type, inv_type, LLWearableType::inventoryFlagsToWearableType(flags)); break; case LLAssetType::AT_CATEGORY: if (actual_asset_type == LLAssetType::AT_LINK_FOLDER) @@ -3585,7 +3651,7 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) if(!model) return; buildContextMenuOptions(flags, items, disabled_items); - hide_context_entries(menu, items, disabled_items); + hide_context_entries(menu, items, disabled_items); // Reposition the menu, in case we're adding items to an existing menu. menu.needsArrange(); @@ -4462,11 +4528,11 @@ void LLTextureBridge::performAction(LLInventoryModel* model, std::string action) { if ("save_as" == action) { - LLFloaterReg::showInstance("preview_texture", LLSD(mUUID), TAKE_FOCUS_YES); - LLPreviewTexture* preview_texture = LLFloaterReg::findTypedInstance<LLPreviewTexture>("preview_texture", mUUID); + LLPreviewTexture* preview_texture = LLFloaterReg::getTypedInstance<LLPreviewTexture>("preview_texture", mUUID); if (preview_texture) { preview_texture->openToSave(); + preview_texture->saveAs(); } } else LLItemBridge::performAction(model, action); @@ -5770,7 +5836,7 @@ void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags) if (LLWearableType::getAllowMultiwear(mWearableType)) { items.push_back(std::string("Wearable Add")); - if (gAgentWearables.getWearableCount(mWearableType) >= LLAgentWearables::MAX_CLOTHING_PER_TYPE) + if (!gAgentWearables.canAddWearable(mWearableType)) { disabled_items.push_back(std::string("Wearable Add")); } @@ -6439,4 +6505,22 @@ LLInvFVBridge* LLRecentInventoryBridgeBuilder::createBridge( return new_listener; } +LLFolderViewGroupedItemBridge::LLFolderViewGroupedItemBridge() +{ +} + +void LLFolderViewGroupedItemBridge::groupFilterContextMenu(folder_view_item_deque& selected_items, LLMenuGL& menu) +{ + uuid_vec_t ids; + menuentry_vec_t disabled_items; + if (get_selection_item_uuids(selected_items, ids)) + { + if (!LLAppearanceMgr::instance().canAddWearables(ids)) + { + disabled_items.push_back(std::string("Wearable Add")); + } + } + disable_context_entries_if_present(menu, disabled_items); +} + // EOF diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index f8ef15991d..300cef7deb 100755 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -37,6 +37,7 @@ #include "llviewerwearable.h" #include "lltooldraganddrop.h" #include "lllandmarklist.h" +#include "llfolderviewitem.h" class LLInventoryFilter; class LLInventoryPanel; @@ -689,4 +690,11 @@ void hide_context_entries(LLMenuGL& menu, const menuentry_vec_t &entries_to_show, const menuentry_vec_t &disabled_entries); +class LLFolderViewGroupedItemBridge: public LLFolderViewGroupedItemModel +{ +public: + LLFolderViewGroupedItemBridge(); + virtual void groupFilterContextMenu(folder_view_item_deque& selected_items, LLMenuGL& menu); +}; + #endif // LL_LLINVENTORYBRIDGE_H diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 1abc09bf3b..2546db546b 100755 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -45,6 +45,7 @@ // newview includes #include "llappearancemgr.h" #include "llappviewer.h" +#include "llavataractions.h" #include "llclipboard.h" #include "lldonotdisturbnotificationstorage.h" #include "llfloaterinventory.h" @@ -1114,16 +1115,35 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root LLFloater::setFloaterHost(multi_propertiesp); } - std::set<LLFolderViewItem*>::iterator set_iter; - - for (set_iter = selected_items.begin(); set_iter != selected_items.end(); ++set_iter) - { - LLFolderViewItem* folder_item = *set_iter; - if(!folder_item) continue; - LLInvFVBridge* bridge = (LLInvFVBridge*)folder_item->getViewModelItem(); - if(!bridge) continue; - bridge->performAction(model, action); - } + + std::set<LLUUID> selected_uuid_set = LLAvatarActions::getInventorySelectedUUIDs(); + uuid_vec_t ids; + std::copy(selected_uuid_set.begin(), selected_uuid_set.end(), std::back_inserter(ids)); + // Check for actions that get handled in bulk + if (action == "wear") + { + wear_multiple(ids, true); + } + else if (action == "wear_add") + { + wear_multiple(ids, false); + } + else if (action == "take_off" || action == "detach") + { + LLAppearanceMgr::instance().removeItemsFromAvatar(ids); + } + else + { + std::set<LLFolderViewItem*>::iterator set_iter; + for (set_iter = selected_items.begin(); set_iter != selected_items.end(); ++set_iter) + { + LLFolderViewItem* folder_item = *set_iter; + if(!folder_item) continue; + LLInvFVBridge* bridge = (LLInvFVBridge*)folder_item->getViewModelItem(); + if(!bridge) continue; + bridge->performAction(model, action); + } + } LLFloater::setFloaterHost(NULL); if (multi_previewp) diff --git a/indra/newview/llinventoryicon.cpp b/indra/newview/llinventoryicon.cpp index b7c4ec6f8b..013a5a7629 100755 --- a/indra/newview/llinventoryicon.cpp +++ b/indra/newview/llinventoryicon.cpp @@ -183,6 +183,6 @@ const std::string& LLInventoryIcon::getIconName(LLInventoryType::EIconName idx) LLInventoryType::EIconName LLInventoryIcon::assignWearableIcon(U32 misc_flag) { - const LLWearableType::EType wearable_type = LLWearableType::EType(LLInventoryItemFlags::II_FLAGS_WEARABLES_MASK & misc_flag); + const LLWearableType::EType wearable_type = LLWearableType::inventoryFlagsToWearableType(misc_flag); return LLWearableType::getIconName(wearable_type); } diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp index f18832fe95..40edb13a80 100755 --- a/indra/newview/llinventorymodelbackgroundfetch.cpp +++ b/indra/newview/llinventorymodelbackgroundfetch.cpp @@ -181,8 +181,6 @@ private: }; -const S32 MAX_FETCH_RETRIES = 10; - const char * const LOG_INV("Inventory"); } // end of namespace anonymous @@ -199,10 +197,7 @@ LLInventoryModelBackgroundFetch::LLInventoryModelBackgroundFetch(): mAllFoldersFetched(FALSE), mRecursiveInventoryFetchStarted(FALSE), mRecursiveLibraryFetchStarted(FALSE), - mNumFetchRetries(0), - mMinTimeBetweenFetches(0.3f), - mMaxTimeBetweenFetches(10.f), - mTimelyFetchPending(FALSE) + mMinTimeBetweenFetches(0.3f) {} LLInventoryModelBackgroundFetch::~LLInventoryModelBackgroundFetch() @@ -351,164 +346,7 @@ void LLInventoryModelBackgroundFetch::backgroundFetch() if (mBackgroundFetchActive && gAgent.getRegion() && gAgent.getRegion()->capabilitiesReceived()) { // If we'll be using the capability, we'll be sending batches and the background thing isn't as important. - if (gSavedSettings.getBOOL("UseHTTPInventory")) - { - bulkFetch(); - return; - } - -#if 1 - //-------------------------------------------------------------------------------- - // DEPRECATED OLD CODE - // - - // No more categories to fetch, stop fetch process. - if (mFetchQueue.empty()) - { - setAllFoldersFetched(); - return; - } - - F32 fast_fetch_time = lerp(mMinTimeBetweenFetches, mMaxTimeBetweenFetches, 0.1f); - F32 slow_fetch_time = lerp(mMinTimeBetweenFetches, mMaxTimeBetweenFetches, 0.5f); - if (mTimelyFetchPending && mFetchTimer.getElapsedTimeF32() > slow_fetch_time) - { - // Double timeouts on failure. - mMinTimeBetweenFetches = llmin(mMinTimeBetweenFetches * 2.f, 10.f); - mMaxTimeBetweenFetches = llmin(mMaxTimeBetweenFetches * 2.f, 120.f); - LL_DEBUGS(LOG_INV) << "Inventory fetch times grown to (" << mMinTimeBetweenFetches << ", " << mMaxTimeBetweenFetches << ")" << LL_ENDL; - // fetch is no longer considered "timely" although we will wait for full time-out. - mTimelyFetchPending = FALSE; - } - - while(1) - { - if (mFetchQueue.empty()) - { - break; - } - - if (gDisconnected) - { - // Just bail if we are disconnected. - break; - } - - const FetchQueueInfo info = mFetchQueue.front(); - - if (info.mIsCategory) - { - - LLViewerInventoryCategory* cat = gInventory.getCategory(info.mUUID); - - // Category has been deleted, remove from queue. - if (!cat) - { - mFetchQueue.pop_front(); - continue; - } - - if (mFetchTimer.getElapsedTimeF32() > mMinTimeBetweenFetches && - LLViewerInventoryCategory::VERSION_UNKNOWN == cat->getVersion()) - { - // Category exists but has no children yet, fetch the descendants - // for now, just request every time and rely on retry timer to throttle. - if (cat->fetch()) - { - mFetchTimer.reset(); - mTimelyFetchPending = TRUE; - } - else - { - // The catagory also tracks if it has expired and here it says it hasn't - // yet. Get out of here because nothing is going to happen until we - // update the timers. - break; - } - } - // Do I have all my children? - else if (gInventory.isCategoryComplete(info.mUUID)) - { - // Finished with this category, remove from queue. - mFetchQueue.pop_front(); - - // Add all children to queue. - LLInventoryModel::cat_array_t* categories; - LLInventoryModel::item_array_t* items; - gInventory.getDirectDescendentsOf(cat->getUUID(), categories, items); - for (LLInventoryModel::cat_array_t::const_iterator it = categories->begin(); - it != categories->end(); - ++it) - { - mFetchQueue.push_back(FetchQueueInfo((*it)->getUUID(),info.mRecursive)); - } - - // We received a response in less than the fast time. - if (mTimelyFetchPending && mFetchTimer.getElapsedTimeF32() < fast_fetch_time) - { - // Shrink timeouts based on success. - mMinTimeBetweenFetches = llmax(mMinTimeBetweenFetches * 0.8f, 0.3f); - mMaxTimeBetweenFetches = llmax(mMaxTimeBetweenFetches * 0.8f, 10.f); - LL_DEBUGS(LOG_INV) << "Inventory fetch times shrunk to (" << mMinTimeBetweenFetches << ", " << mMaxTimeBetweenFetches << ")" << LL_ENDL; - } - - mTimelyFetchPending = FALSE; - continue; - } - else if (mFetchTimer.getElapsedTimeF32() > mMaxTimeBetweenFetches) - { - // Received first packet, but our num descendants does not match db's num descendants - // so try again later. - mFetchQueue.pop_front(); - - if (mNumFetchRetries++ < MAX_FETCH_RETRIES) - { - // push on back of queue - mFetchQueue.push_back(info); - } - mTimelyFetchPending = FALSE; - mFetchTimer.reset(); - break; - } - - // Not enough time has elapsed to do a new fetch - break; - } - else - { - LLViewerInventoryItem* itemp = gInventory.getItem(info.mUUID); - - mFetchQueue.pop_front(); - if (!itemp) - { - continue; - } - - if (mFetchTimer.getElapsedTimeF32() > mMinTimeBetweenFetches) - { - itemp->fetchFromServer(); - mFetchTimer.reset(); - mTimelyFetchPending = TRUE; - } - else if (itemp->mIsComplete) - { - mTimelyFetchPending = FALSE; - } - else if (mFetchTimer.getElapsedTimeF32() > mMaxTimeBetweenFetches) - { - mFetchQueue.push_back(info); - mFetchTimer.reset(); - mTimelyFetchPending = FALSE; - } - // Not enough time has elapsed to do a new fetch - break; - } - } - - // - // DEPRECATED OLD CODE - //-------------------------------------------------------------------------------- -#endif + bulkFetch(); } } diff --git a/indra/newview/llinventorymodelbackgroundfetch.h b/indra/newview/llinventorymodelbackgroundfetch.h index 2139f85519..19fbfc2ed3 100755 --- a/indra/newview/llinventorymodelbackgroundfetch.h +++ b/indra/newview/llinventorymodelbackgroundfetch.h @@ -87,12 +87,9 @@ private: BOOL mBackgroundFetchActive; bool mFolderFetchActive; S32 mFetchCount; - BOOL mTimelyFetchPending; - S32 mNumFetchRetries; LLFrameTimer mFetchTimer; F32 mMinTimeBetweenFetches; - F32 mMaxTimeBetweenFetches; struct FetchQueueInfo { diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 3546317471..4a230accb6 100755 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -146,7 +146,8 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) : mShowEmptyMessage(p.show_empty_message), mViewsInitialized(false), mInvFVBridgeBuilder(NULL), - mInventoryViewModel(p.name) + mInventoryViewModel(p.name), + mGroupedItemBridge(new LLFolderViewGroupedItemBridge) { mInvFVBridgeBuilder = &INVENTORY_BRIDGE_BUILDER; @@ -186,6 +187,7 @@ LLFolderView * LLInventoryPanel::createFolderRoot(LLUUID root_id ) NULL, root_id); p.view_model = &mInventoryViewModel; + p.grouped_item_model = mGroupedItemBridge; p.use_label_suffix = mParams.use_label_suffix; p.allow_multiselect = mAllowMultiSelect; p.show_empty_message = mShowEmptyMessage; diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index a490dfce5d..bc4c10e441 100755 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -43,6 +43,7 @@ class LLInvFVBridge; class LLInventoryFolderViewModelBuilder; class LLInvPanelComplObserver; class LLFolderViewModelInventory; +class LLFolderViewGroupedItemBridge; namespace LLInitParam { @@ -240,6 +241,7 @@ protected: LLScrollContainer* mScroller; LLFolderViewModelInventory mInventoryViewModel; + LLPointer<LLFolderViewGroupedItemBridge> mGroupedItemBridge; Params mParams; // stored copy of parameter block std::map<LLUUID, LLFolderViewItem*> mItemMap; diff --git a/indra/newview/lljoystickbutton.cpp b/indra/newview/lljoystickbutton.cpp index d38f90015e..59e14e6cc0 100755 --- a/indra/newview/lljoystickbutton.cpp +++ b/indra/newview/lljoystickbutton.cpp @@ -424,6 +424,7 @@ void LLJoystickCameraRotate::updateSlop() BOOL LLJoystickCameraRotate::handleMouseDown(S32 x, S32 y, MASK mask) { + gAgent.setMovementLocked(TRUE); updateSlop(); // Set initial offset based on initial click location @@ -465,6 +466,11 @@ BOOL LLJoystickCameraRotate::handleMouseDown(S32 x, S32 y, MASK mask) return LLJoystick::handleMouseDown(x, y, mask); } +BOOL LLJoystickCameraRotate::handleMouseUp(S32 x, S32 y, MASK mask) +{ + gAgent.setMovementLocked(FALSE); + return LLJoystick::handleMouseUp(x, y, mask); +} void LLJoystickCameraRotate::onHeldDown() { diff --git a/indra/newview/lljoystickbutton.h b/indra/newview/lljoystickbutton.h index 8d76aa9531..4e6c774cad 100755 --- a/indra/newview/lljoystickbutton.h +++ b/indra/newview/lljoystickbutton.h @@ -146,6 +146,7 @@ public: virtual void setToggleState( BOOL left, BOOL top, BOOL right, BOOL bottom ); virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); + virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); virtual void onHeldDown(); virtual void draw(); diff --git a/indra/newview/lllocalbitmaps.cpp b/indra/newview/lllocalbitmaps.cpp index 2c2e66e08f..1380345164 100755 --- a/indra/newview/lllocalbitmaps.cpp +++ b/indra/newview/lllocalbitmaps.cpp @@ -64,6 +64,8 @@ #include "llimagedimensionsinfo.h" #include "llviewercontrol.h" #include "lltrans.h" +#include "llviewerdisplay.h" + /*=======================================*/ /* Formal declarations, constants, etc. */ /*=======================================*/ @@ -543,12 +545,14 @@ void LLLocalBitmap::updateUserLayers(LLUUID old_id, LLUUID new_id, LLWearableTyp LLAvatarAppearanceDefines::ETextureIndex reg_texind = getTexIndex(type, baked_texind); if (reg_texind != LLAvatarAppearanceDefines::TEX_NUM_INDICES) { - U32 index = gAgentWearables.getWearableIndex(wearable); - gAgentAvatarp->setLocalTexture(reg_texind, gTextureList.getImage(new_id), FALSE, index); - gAgentAvatarp->wearableUpdated(type); - - /* telling the manager to rebake once update cycle is fully done */ - LLLocalBitmapMgr::setNeedsRebake(); + U32 index; + if (gAgentWearables.getWearableIndex(wearable,index)) + { + gAgentAvatarp->setLocalTexture(reg_texind, gTextureList.getImage(new_id), FALSE, index); + gAgentAvatarp->wearableUpdated(type); + /* telling the manager to rebake once update cycle is fully done */ + LLLocalBitmapMgr::setNeedsRebake(); + } } } diff --git a/indra/newview/lllocationhistory.cpp b/indra/newview/lllocationhistory.cpp index 680b35b550..162d6e003e 100755 --- a/indra/newview/lllocationhistory.cpp +++ b/indra/newview/lllocationhistory.cpp @@ -127,7 +127,7 @@ void LLLocationHistory::save() const } // open a file for writing - llofstream file (resolved_filename); + llofstream file(resolved_filename.c_str()); if (!file.is_open()) { LL_WARNS() << "can't open location history file \"" << mFilename << "\" for writing" << LL_ENDL; @@ -148,7 +148,7 @@ void LLLocationHistory::load() // build filename for each user std::string resolved_filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, mFilename); - llifstream file(resolved_filename); + llifstream file(resolved_filename.c_str()); if (!file.is_open()) { diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index cadbc16f1e..7ddacf3033 100755 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -302,7 +302,7 @@ void LLLogChat::saveHistory(const std::string& filename, return; } - llofstream file (LLLogChat::makeLogFileName(filename), std::ios_base::app); + llofstream file(LLLogChat::makeLogFileName(filename).c_str(), std::ios_base::app); if (!file.is_open()) { LL_WARNS() << "Couldn't open chat history log! - " + filename << LL_ENDL; diff --git a/indra/newview/llmachineid.cpp b/indra/newview/llmachineid.cpp index cd6473921d..b5fd3df0f3 100755 --- a/indra/newview/llmachineid.cpp +++ b/indra/newview/llmachineid.cpp @@ -88,7 +88,7 @@ S32 LLMachineID::init() if (FAILED(hres)) { - LL_DEBUGS("AppInit") << "Failed to initialize security. Error code = 0x" << hex << hres << LL_ENDL; + LL_WARNS("AppInit") << "Failed to initialize security. Error code = 0x" << hex << hres << LL_ENDL; CoUninitialize(); return 1; // Program has failed. } @@ -106,7 +106,7 @@ S32 LLMachineID::init() if (FAILED(hres)) { - LL_DEBUGS("AppInit") << "Failed to create IWbemLocator object." << " Err code = 0x" << hex << hres << LL_ENDL; + LL_WARNS("AppInit") << "Failed to create IWbemLocator object." << " Err code = 0x" << hex << hres << LL_ENDL; CoUninitialize(); return 1; // Program has failed. } @@ -132,7 +132,7 @@ S32 LLMachineID::init() if (FAILED(hres)) { - LL_DEBUGS("AppInit") << "Could not connect. Error code = 0x" << hex << hres << LL_ENDL; + LL_WARNS("AppInit") << "Could not connect. Error code = 0x" << hex << hres << LL_ENDL; pLoc->Release(); CoUninitialize(); return 1; // Program has failed. @@ -157,7 +157,7 @@ S32 LLMachineID::init() if (FAILED(hres)) { - LL_DEBUGS("AppInit") << "Could not set proxy blanket. Error code = 0x" << hex << hres << LL_ENDL; + LL_WARNS("AppInit") << "Could not set proxy blanket. Error code = 0x" << hex << hres << LL_ENDL; pSvc->Release(); pLoc->Release(); CoUninitialize(); @@ -178,7 +178,7 @@ S32 LLMachineID::init() if (FAILED(hres)) { - LL_DEBUGS("AppInit") << "Query for operating system name failed." << " Error code = 0x" << hex << hres << LL_ENDL; + LL_WARNS("AppInit") << "Query for operating system name failed." << " Error code = 0x" << hex << hres << LL_ENDL; pSvc->Release(); pLoc->Release(); CoUninitialize(); @@ -205,7 +205,7 @@ S32 LLMachineID::init() // Get the value of the Name property hr = pclsObj->Get(L"SerialNumber", 0, &vtProp, 0, 0); - LL_DEBUGS("AppInit") << " Serial Number : " << vtProp.bstrVal << LL_ENDL; + LL_INFOS("AppInit") << " Serial Number : " << vtProp.bstrVal << LL_ENDL; // use characters in the returned Serial Number to create a byte array of size len BSTR serialNumber ( vtProp.bstrVal); unsigned int j = 0; @@ -252,7 +252,7 @@ S32 LLMachineID::getUniqueID(unsigned char *unique_id, size_t len) if (has_static_unique_id) { memcpy ( unique_id, &static_unique_id, len); - LL_DEBUGS("AppInit") << "UniqueID: 0x"; + LL_INFOS_ONCE("AppInit") << "UniqueID: 0x"; // Code between here and LL_ENDL is not executed unless the LL_DEBUGS // actually produces output for (size_t i = 0; i < len; ++i) diff --git a/indra/newview/llnotificationstorage.cpp b/indra/newview/llnotificationstorage.cpp index e9970de58c..3418b33d37 100755 --- a/indra/newview/llnotificationstorage.cpp +++ b/indra/newview/llnotificationstorage.cpp @@ -123,14 +123,18 @@ bool LLNotificationStorage::readNotifications(LLSD& pNotificationData, bool is_n { LLPointer<LLSDParser> parser = new LLSDXMLParser(); didFileRead = (parser->parse(notifyFile, pNotificationData, LLSDSerialize::SIZE_UNLIMITED) >= 0); + notifyFile.close(); + if (!didFileRead) { LL_WARNS("LLNotificationStorage") << "Failed to parse open notifications from file '" << mFileName - << "'" << LL_ENDL; + << "'" << LL_ENDL; + LLFile::remove(filename); + LL_WARNS("LLNotificationStorage") << "Removed invalid open notifications file '" << mFileName + << "'" << LL_ENDL; } } - - LL_INFOS("LLNotificationStorage") << "ending read '" << filename << "'" << LL_ENDL; + if (!didFileRead) { if(is_new_filename) diff --git a/indra/newview/llpanelcontents.cpp b/indra/newview/llpanelcontents.cpp index 407cbfc47b..451f41cd3b 100755 --- a/indra/newview/llpanelcontents.cpp +++ b/indra/newview/llpanelcontents.cpp @@ -197,9 +197,6 @@ void LLPanelContents::onClickNewScript(void *userdata) // *TODO: The script creation should round-trip back to the // viewer so the viewer can auto-open the script and start // editing ASAP. -#if 0 - LLFloaterReg::showInstance("preview_scriptedit", LLSD(inv_item->getUUID()), TAKE_FOCUS_YES); -#endif } } diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index 19a86cdcea..9bd6007772 100755 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -925,17 +925,17 @@ void LLPanelEditWearable::onCommitSexChange() if (!isAgentAvatarValid()) return; LLWearableType::EType type = mWearablePtr->getType(); - U32 index = gAgentWearables.getWearableIndex(mWearablePtr); - - if( !gAgentWearables.isWearableModifiable(type, index)) + U32 index; + if( !gAgentWearables.getWearableIndex(mWearablePtr, index) || + !gAgentWearables.isWearableModifiable(type, index)) { - return; + return; } LLViewerVisualParam* param = static_cast<LLViewerVisualParam*>(gAgentAvatarp->getVisualParam( "male" )); if( !param ) { - return; + return; } bool is_new_sex_male = (gSavedSettings.getU32("AvatarSex") ? SEX_MALE : SEX_FEMALE) == SEX_MALE; @@ -978,10 +978,17 @@ void LLPanelEditWearable::onTexturePickerCommit(const LLUICtrl* ctrl) } if (getWearable()) { - U32 index = gAgentWearables.getWearableIndex(getWearable()); - gAgentAvatarp->setLocalTexture(entry->mTextureIndex, image, FALSE, index); - LLVisualParamHint::requestHintUpdates(); - gAgentAvatarp->wearableUpdated(type); + U32 index; + if (gAgentWearables.getWearableIndex(getWearable(), index)) + { + gAgentAvatarp->setLocalTexture(entry->mTextureIndex, image, FALSE, index); + LLVisualParamHint::requestHintUpdates(); + gAgentAvatarp->wearableUpdated(type); + } + else + { + LL_WARNS() << "wearable not found in gAgentWearables" << LL_ENDL; + } } } else @@ -1058,7 +1065,12 @@ void LLPanelEditWearable::saveChanges(bool force_save_as) return; } - U32 index = gAgentWearables.getWearableIndex(mWearablePtr); + U32 index; + if (!gAgentWearables.getWearableIndex(mWearablePtr, index)) + { + LL_WARNS() << "wearable not found" << LL_ENDL; + return; + } std::string new_name = mNameEditor->getText(); @@ -1574,6 +1586,12 @@ void LLPanelEditWearable::onInvisibilityCommit(LLCheckBoxCtrl* checkbox_ctrl, LL LL_INFOS() << "onInvisibilityCommit, self " << this << " checkbox_ctrl " << checkbox_ctrl << LL_ENDL; + U32 index; + if (!gAgentWearables.getWearableIndex(getWearable(),index)) + { + LL_WARNS() << "wearable not found" << LL_ENDL; + return; + } bool new_invis_state = checkbox_ctrl->get(); if (new_invis_state) { @@ -1581,9 +1599,8 @@ void LLPanelEditWearable::onInvisibilityCommit(LLCheckBoxCtrl* checkbox_ctrl, LL mPreviousAlphaTexture[te] = lto->getID(); LLViewerFetchedTexture* image = LLViewerTextureManager::getFetchedTexture( IMG_INVISIBLE ); - U32 index = gAgentWearables.getWearableIndex(getWearable()); - gAgentAvatarp->setLocalTexture(te, image, FALSE, index); - gAgentAvatarp->wearableUpdated(getWearable()->getType()); + gAgentAvatarp->setLocalTexture(te, image, FALSE, index); + gAgentAvatarp->wearableUpdated(getWearable()->getType()); } else { @@ -1598,7 +1615,6 @@ void LLPanelEditWearable::onInvisibilityCommit(LLCheckBoxCtrl* checkbox_ctrl, LL LLViewerFetchedTexture* image = LLViewerTextureManager::getFetchedTexture(prev_id); if (!image) return; - U32 index = gAgentWearables.getWearableIndex(getWearable()); gAgentAvatarp->setLocalTexture(te, image, FALSE, index); gAgentAvatarp->wearableUpdated(getWearable()->getType()); } diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index cc8b7d2a52..afc1a789c4 100755 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -240,6 +240,8 @@ BOOL LLPanelFace::postBuild() if(mShinyColorSwatch) { mShinyColorSwatch->setCommitCallback(boost::bind(&LLPanelFace::onCommitShinyColor, this, _2)); + mShinyColorSwatch->setOnCancelCallback(boost::bind(&LLPanelFace::onCancelShinyColor, this, _2)); + mShinyColorSwatch->setOnSelectCallback(boost::bind(&LLPanelFace::onSelectShinyColor, this, _2)); mShinyColorSwatch->setFollowsTop(); mShinyColorSwatch->setFollowsLeft(); mShinyColorSwatch->setCanApplyImmediately(TRUE); @@ -898,52 +900,22 @@ void LLPanelFace::updateUI() getChildView("label maskcutoff")->setEnabled(editable && mIsAlpha); } } - - if (shinytexture_ctrl) - { - if (identical_spec && (shiny == SHINY_TEXTURE)) - { - shinytexture_ctrl->setTentative( FALSE ); - shinytexture_ctrl->setEnabled( editable ); - shinytexture_ctrl->setImageAssetID( specmap_id ); - } - else if (specmap_id.isNull()) - { - shinytexture_ctrl->setTentative( FALSE ); - shinytexture_ctrl->setEnabled( editable ); - shinytexture_ctrl->setImageAssetID( LLUUID::null ); - } - else - { - shinytexture_ctrl->setTentative( TRUE ); - shinytexture_ctrl->setEnabled( editable ); - shinytexture_ctrl->setImageAssetID( specmap_id ); + + if (shinytexture_ctrl) + { + shinytexture_ctrl->setTentative( !identical_spec ); + shinytexture_ctrl->setEnabled( editable ); + shinytexture_ctrl->setImageAssetID( specmap_id ); } - } - if (bumpytexture_ctrl) - { - if (identical_norm && (bumpy == BUMPY_TEXTURE)) - { - bumpytexture_ctrl->setTentative( FALSE ); - bumpytexture_ctrl->setEnabled( editable ); - bumpytexture_ctrl->setImageAssetID( normmap_id ); - } - else if (normmap_id.isNull()) - { - bumpytexture_ctrl->setTentative( FALSE ); - bumpytexture_ctrl->setEnabled( editable ); - bumpytexture_ctrl->setImageAssetID( LLUUID::null ); - } - else - { - bumpytexture_ctrl->setTentative( TRUE ); - bumpytexture_ctrl->setEnabled( editable ); - bumpytexture_ctrl->setImageAssetID( normmap_id ); - } + if (bumpytexture_ctrl) + { + bumpytexture_ctrl->setTentative( !identical_norm ); + bumpytexture_ctrl->setEnabled( editable ); + bumpytexture_ctrl->setImageAssetID( normmap_id ); } } - + // planar align bool align_planar = false; bool identical_planar_aligned = false; @@ -1461,12 +1433,23 @@ void LLPanelFace::onCancelColor(const LLSD& data) LLSelectMgr::getInstance()->selectionRevertColors(); } +void LLPanelFace::onCancelShinyColor(const LLSD& data) +{ + LLSelectMgr::getInstance()->selectionRevertShinyColors(); +} + void LLPanelFace::onSelectColor(const LLSD& data) { LLSelectMgr::getInstance()->saveSelectedObjectColors(); sendColor(); } +void LLPanelFace::onSelectShinyColor(const LLSD& data) +{ + LLSelectedTEMaterial::setSpecularLightColor(this, getChild<LLColorSwatchCtrl>("shinycolorswatch")->get()); + LLSelectMgr::getInstance()->saveSelectedShinyColors(); +} + // static void LLPanelFace::onCommitMaterialsMedia(LLUICtrl* ctrl, void* userdata) { diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h index e32f039921..9823e84cd9 100755 --- a/indra/newview/llpanelface.h +++ b/indra/newview/llpanelface.h @@ -143,7 +143,9 @@ protected: void onCommitShinyColor(const LLSD& data); void onCommitAlpha(const LLSD& data); void onCancelColor(const LLSD& data); + void onCancelShinyColor(const LLSD& data); void onSelectColor(const LLSD& data); + void onSelectShinyColor(const LLSD& data); void onCloseTexturePicker(const LLSD& data); diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index 75a3584a1e..1d73d4bd6e 100755 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -1173,7 +1173,8 @@ bool LLLandmarksPanel::canItemBeModified(const std::string& command_name, LLFold if ("copy" == command_name) { - return root_folder->canCopy(); + // we shouldn't be able to copy folders from My Inventory Panel + return can_be_modified && root_folder->canCopy(); } else if ("collapse" == command_name) { diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 89c898001f..cc8c3edd51 100755 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -308,10 +308,10 @@ void LLPanelLogin::addFavoritesToStartLocation() LLSD fav_llsd; llifstream file; - file.open(filename); + file.open(filename.c_str()); if (!file.is_open()) { - file.open(old_filename); + file.open(old_filename.c_str()); if (!file.is_open()) return; } LLSDSerialize::fromXML(fav_llsd, file); diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 37273a7793..17c0b226d0 100755 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -160,10 +160,9 @@ BOOL LLPanelMainInventory::postBuild() } // Now load the stored settings from disk, if available. - std::ostringstream filterSaveName; - filterSaveName << gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, FILTERS_FILENAME); - LL_INFOS() << "LLPanelMainInventory::init: reading from " << filterSaveName.str() << LL_ENDL; - llifstream file(filterSaveName.str()); + std::string filterSaveName(gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, FILTERS_FILENAME)); + LL_INFOS() << "LLPanelMainInventory::init: reading from " << filterSaveName << LL_ENDL; + llifstream file(filterSaveName.c_str()); LLSD savedFilterState; if (file.is_open()) { @@ -243,16 +242,17 @@ LLPanelMainInventory::~LLPanelMainInventory( void ) } } - std::ostringstream filterSaveName; - filterSaveName << gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, FILTERS_FILENAME); - llofstream filtersFile(filterSaveName.str()); + std::string filterSaveName(gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, FILTERS_FILENAME)); + llofstream filtersFile(filterSaveName.c_str()); if(!LLSDSerialize::toPrettyXML(filterRoot, filtersFile)) { - LL_WARNS() << "Could not write to filters save file " << filterSaveName.str() << LL_ENDL; + LL_WARNS() << "Could not write to filters save file " << filterSaveName << LL_ENDL; } else + { filtersFile.close(); - + } + gInventory.removeObserver(this); delete mSavedFolderState; } diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index 6354b5a02b..bf15f56b44 100755 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -654,7 +654,7 @@ void LLTaskInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags) return; } - if(gAgent.allowOperation(PERM_OWNER, item->getPermissions(), + if(!gAgent.allowOperation(PERM_OWNER, item->getPermissions(), GP_OBJECT_MANIPULATE) && item->getSaleInfo().isForSale()) { @@ -689,10 +689,6 @@ void LLTaskInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags) else if (canOpenItem()) { items.push_back(std::string("Task Open")); - if (!isItemCopyable()) - { - disabled_items.push_back(std::string("Task Open")); - } } items.push_back(std::string("Task Properties")); if(isItemRenameable()) @@ -909,6 +905,7 @@ void LLTaskTextureBridge::openItem() LLPreviewTexture* preview = LLFloaterReg::showTypedInstance<LLPreviewTexture>("preview_texture", LLSD(mUUID), TAKE_FOCUS_YES); if(preview) { + preview->setAuxItem(findItem()); preview->setObjectID(mPanel->getTaskUUID()); } } @@ -1107,7 +1104,10 @@ void LLTaskLSLBridge::openItem() } if (object->permModify() || gAgent.isGodlike()) { - LLLiveLSLEditor* preview = LLFloaterReg::showTypedInstance<LLLiveLSLEditor>("preview_scriptedit", LLSD(mUUID), TAKE_FOCUS_YES); + LLSD floater_key; + floater_key["taskid"] = mPanel->getTaskUUID(); + floater_key["itemid"] = mUUID; + LLLiveLSLEditor* preview = LLFloaterReg::showTypedInstance<LLLiveLSLEditor>("preview_scriptedit", floater_key, TAKE_FOCUS_YES); if (preview) { preview->setObjectID(mPanel->getTaskUUID()); diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index 58055d98c6..ce9231d6f2 100755 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -851,6 +851,14 @@ void LLPanelPermissions::refresh() combo_click_action->setValue(LLSD(combo_value)); } } + + if(LLSelectMgr::getInstance()->getSelection()->isAttachment()) + { + getChildView("checkbox for sale")->setEnabled(FALSE); + getChildView("Edit Cost")->setEnabled(FALSE); + getChild<LLComboBox>("sale type")->setEnabled(FALSE); + } + getChildView("label click action")->setEnabled(is_perm_modify && is_nonpermanent_enforced && all_volume); getChildView("clickaction")->setEnabled(is_perm_modify && is_nonpermanent_enforced && all_volume); } diff --git a/indra/newview/llpostcard.cpp b/indra/newview/llpostcard.cpp index 649bb2fb2c..5987044bff 100755 --- a/indra/newview/llpostcard.cpp +++ b/indra/newview/llpostcard.cpp @@ -95,6 +95,12 @@ public: { } + /*virtual*/ void httpFailure() + { + LL_WARNS() << "Sending postcard failed, status: " << getStatus() << LL_ENDL; + LLPostCard::reportPostResult(false); + } + /*virtual*/ void uploadComplete(const LLSD& content) { LL_INFOS() << "Postcard sent" << LL_ENDL; diff --git a/indra/newview/llpreview.cpp b/indra/newview/llpreview.cpp index 398f4e6e42..bf2652cb49 100755 --- a/indra/newview/llpreview.cpp +++ b/indra/newview/llpreview.cpp @@ -39,6 +39,7 @@ #include "llradiogroup.h" #include "llassetstorage.h" #include "llviewerassettype.h" +#include "llviewermessage.h" #include "llviewerobject.h" #include "llviewerobjectlist.h" #include "lldbstrings.h" @@ -53,7 +54,7 @@ LLPreview::LLPreview(const LLSD& key) : LLFloater(key), - mItemUUID(key.asUUID()), + mItemUUID(key.has("itemid") ? key.get("itemid").asUUID() : key.asUUID()), mObjectUUID(), // set later by setObjectID() mCopyToInvBtn( NULL ), mForceClose(FALSE), @@ -369,6 +370,20 @@ void LLPreview::onBtnCopyToInv(void* userdata) self->mNotecardInventoryID, item); } + else if (self->mObjectUUID.notNull()) + { + // item is in in-world inventory + LLViewerObject* object = gObjectList.findObject(self->mObjectUUID); + LLPermissions perm(item->getPermissions()); + if(object + &&(perm.allowCopyBy(gAgent.getID(), gAgent.getGroupID()) + && perm.allowTransferTo(gAgent.getID()))) + { + // copy to default folder + set_dad_inventory_item(item, LLUUID::null); + object->moveInventory(LLUUID::null, item->getUUID()); + } + } else { LLPointer<LLInventoryCallback> cb = NULL; @@ -453,7 +468,6 @@ LLMultiPreview::LLMultiPreview() setTitle(LLTrans::getString("MultiPreviewTitle")); buildTabContainer(); setCanResize(TRUE); - mAutoResize = FALSE; } void LLMultiPreview::onOpen(const LLSD& key) diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp index 337a63e627..1308d1e9a7 100755 --- a/indra/newview/llpreviewnotecard.cpp +++ b/indra/newview/llpreviewnotecard.cpp @@ -215,9 +215,12 @@ void LLPreviewNotecard::loadAsset() if(item) { - if (gAgent.allowOperation(PERM_COPY, item->getPermissions(), - GP_OBJECT_MANIPULATE) - || gAgent.isGodlike()) + LLPermissions perm(item->getPermissions()); + BOOL is_owner = gAgent.allowOperation(PERM_OWNER, perm, GP_OBJECT_MANIPULATE); + BOOL allow_copy = gAgent.allowOperation(PERM_COPY, perm, GP_OBJECT_MANIPULATE); + BOOL allow_modify = gAgent.allowOperation(PERM_MODIFY, perm, GP_OBJECT_MANIPULATE); + + if (allow_copy || gAgent.isGodlike()) { mAssetID = item->getAssetUUID(); if(mAssetID.isNull()) @@ -271,12 +274,17 @@ void LLPreviewNotecard::loadAsset() editor->setEnabled(FALSE); mAssetStatus = PREVIEW_ASSET_LOADED; } - if(!gAgent.allowOperation(PERM_MODIFY, item->getPermissions(), - GP_OBJECT_MANIPULATE)) + + if(!allow_modify) { editor->setEnabled(FALSE); getChildView("lock")->setVisible( TRUE); } + + if(allow_modify || is_owner) + { + getChildView("Delete")->setEnabled(TRUE); + } } else { @@ -492,14 +500,7 @@ bool LLPreviewNotecard::saveIfNeeded(LLInventoryItem* copyitem) void LLPreviewNotecard::deleteNotecard() { - LLViewerInventoryItem* item = gInventory.getItem(mItemUUID); - if (item != NULL) - { - const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH); - gInventory.changeItemParent(item, trash_id, FALSE); - } - - closeFloater(); + LLNotificationsUtil::add("DeleteNotecard", LLSD(), LLSD(), boost::bind(&LLPreviewNotecard::handleConfirmDeleteDialog,this, _1, _2)); } // static @@ -605,4 +606,43 @@ bool LLPreviewNotecard::handleSaveChangesDialog(const LLSD& notification, const return false; } +bool LLPreviewNotecard::handleConfirmDeleteDialog(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (option != 0) + { + // canceled + return false; + } + + if (mObjectUUID.isNull()) + { + // move item from agent's inventory into trash + LLViewerInventoryItem* item = gInventory.getItem(mItemUUID); + if (item != NULL) + { + const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH); + gInventory.changeItemParent(item, trash_id, FALSE); + } + } + else + { + // delete item from inventory of in-world object + LLViewerObject* object = gObjectList.findObject(mObjectUUID); + if(object) + { + LLViewerInventoryItem* item = dynamic_cast<LLViewerInventoryItem*>(object->getInventoryObject(mItemUUID)); + if (item != NULL) + { + object->removeInventory(mItemUUID); + } + } + } + + // close floater, ignore unsaved changes + mForceClose = TRUE; + closeFloater(); + return false; +} + // EOF diff --git a/indra/newview/llpreviewnotecard.h b/indra/newview/llpreviewnotecard.h index b53c0da6be..1cf08dedd6 100755 --- a/indra/newview/llpreviewnotecard.h +++ b/indra/newview/llpreviewnotecard.h @@ -93,6 +93,7 @@ protected: S32 status, LLExtStat ext_status); bool handleSaveChangesDialog(const LLSD& notification, const LLSD& response); + bool handleConfirmDeleteDialog(const LLSD& notification, const LLSD& response); protected: LLViewerTextEditor* mEditor; diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index 5415c273e2..7feb20332b 100755 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -1837,7 +1837,8 @@ void LLLiveLSLEditor::loadAsset() else if(item && mItem.notNull()) { // request the text from the object - LLUUID* user_data = new LLUUID(mItemUUID); // ^ mObjectUUID + LLSD* user_data = new LLSD(); + user_data->with("taskid", mObjectUUID).with("itemid", mItemUUID); gAssetStorage->getInvItemAsset(object->getRegion()->getHost(), gAgent.getID(), gAgent.getSessionID(), @@ -1914,9 +1915,9 @@ void LLLiveLSLEditor::onLoadComplete(LLVFS *vfs, const LLUUID& asset_id, { LL_DEBUGS() << "LLLiveLSLEditor::onLoadComplete: got uuid " << asset_id << LL_ENDL; - LLUUID* xored_id = (LLUUID*)user_data; + LLSD* floater_key = (LLSD*)user_data; - LLLiveLSLEditor* instance = LLFloaterReg::findTypedInstance<LLLiveLSLEditor>("preview_scriptedit", *xored_id); + LLLiveLSLEditor* instance = LLFloaterReg::findTypedInstance<LLLiveLSLEditor>("preview_scriptedit", *floater_key); if(instance ) { @@ -1945,7 +1946,7 @@ void LLLiveLSLEditor::onLoadComplete(LLVFS *vfs, const LLUUID& asset_id, } } - delete xored_id; + delete floater_key; } void LLLiveLSLEditor::loadScriptText(LLVFS *vfs, const LLUUID &uuid, LLAssetType::EType type) @@ -2304,7 +2305,10 @@ void LLLiveLSLEditor::onSaveTextComplete(const LLUUID& asset_uuid, void* user_da } else { - LLLiveLSLEditor* self = LLFloaterReg::findTypedInstance<LLLiveLSLEditor>("preview_scriptedit", data->mItem->getUUID()); // ^ data->mSaveObjectID + LLSD floater_key; + floater_key["taskid"] = data->mSaveObjectID; + floater_key["itemid"] = data->mItem->getUUID(); + LLLiveLSLEditor* self = LLFloaterReg::findTypedInstance<LLLiveLSLEditor>("preview_scriptedit", floater_key); if (self) { self->getWindow()->decBusyCount(); @@ -2329,7 +2333,10 @@ void LLLiveLSLEditor::onSaveBytecodeComplete(const LLUUID& asset_uuid, void* use if(0 ==status) { LL_INFOS() << "LSL Bytecode saved" << LL_ENDL; - LLLiveLSLEditor* self = LLFloaterReg::findTypedInstance<LLLiveLSLEditor>("preview_scriptedit", data->mItem->getUUID()); // ^ data->mSaveObjectID + LLSD floater_key; + floater_key["taskid"] = data->mSaveObjectID; + floater_key["itemid"] = data->mItem->getUUID(); + LLLiveLSLEditor* self = LLFloaterReg::findTypedInstance<LLLiveLSLEditor>("preview_scriptedit", floater_key); if (self) { // Tell the user that the compile worked. @@ -2407,7 +2414,10 @@ void LLLiveLSLEditor::processScriptRunningReply(LLMessageSystem* msg, void**) msg->getUUIDFast(_PREHASH_Script, _PREHASH_ObjectID, object_id); msg->getUUIDFast(_PREHASH_Script, _PREHASH_ItemID, item_id); - LLLiveLSLEditor* instance = LLFloaterReg::findTypedInstance<LLLiveLSLEditor>("preview_scriptedit", item_id); // ^ object_id + LLSD floater_key; + floater_key["taskid"] = object_id; + floater_key["itemid"] = item_id; + LLLiveLSLEditor* instance = LLFloaterReg::findTypedInstance<LLLiveLSLEditor>("preview_scriptedit", floater_key); if(instance) { instance->mHaveRunningInfo = TRUE; diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index 5c41c5ad97..f91a18d8d3 100755 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -65,6 +65,7 @@ LLPreviewTexture::LLPreviewTexture(const LLSD& key) mShowKeepDiscard(FALSE), mCopyToInv(FALSE), mIsCopyable(FALSE), + mIsFullPerm(FALSE), mUpdateDimensions(TRUE), mLastHeight(0), mLastWidth(0), @@ -182,12 +183,6 @@ void LLPreviewTexture::draw() if ( mImage.notNull() ) { - // Automatically bring up SaveAs dialog if we opened this to save the texture. - if (mPreviewToSave) - { - mPreviewToSave = FALSE; - saveAs(); - } // Draw the texture gGL.diffuseColor3f( 1.f, 1.f, 1.f ); gl_draw_scaled_image(interior.mLeft, @@ -269,7 +264,7 @@ void LLPreviewTexture::draw() // virtual BOOL LLPreviewTexture::canSaveAs() const { - return mIsCopyable && !mLoadingFullImage && mImage.notNull() && !mImage->isMissingAsset(); + return mIsFullPerm && !mLoadingFullImage && mImage.notNull() && !mImage->isMissingAsset(); } @@ -286,6 +281,12 @@ void LLPreviewTexture::saveAs() // User canceled or we failed to acquire save file. return; } + if(mPreviewToSave) + { + mPreviewToSave = FALSE; + LLFloaterReg::showTypedInstance<LLPreviewTexture>("preview_texture", item->getUUID()); + } + // remember the user-approved/edited file name. mSaveFileName = file_picker.getFirstFile(); mLoadingFullImage = TRUE; @@ -516,6 +517,11 @@ void LLPreviewTexture::loadAsset() mUpdateDimensions = TRUE; updateDimensions(); getChildView("save_tex_btn")->setEnabled(canSaveAs()); + if (mObjectUUID.notNull()) + { + // check that we can copy inworld items into inventory + getChildView("Keep")->setEnabled(mIsCopyable); + } } LLPreview::EAssetStatus LLPreviewTexture::getAssetStatus() @@ -580,7 +586,9 @@ void LLPreviewTexture::updateImageID() mShowKeepDiscard = TRUE; mCopyToInv = FALSE; - mIsCopyable = item->checkPermissionsSet(PERM_ITEM_UNRESTRICTED); + LLPermissions perm(item->getPermissions()); + mIsCopyable = perm.allowCopyBy(gAgent.getID(), gAgent.getGroupID()) && perm.allowTransferTo(gAgent.getID()); + mIsFullPerm = item->checkPermissionsSet(PERM_ITEM_UNRESTRICTED); } else // not an item, assume it's an asset id { @@ -588,6 +596,7 @@ void LLPreviewTexture::updateImageID() mShowKeepDiscard = FALSE; mCopyToInv = TRUE; mIsCopyable = TRUE; + mIsFullPerm = TRUE; } } diff --git a/indra/newview/llpreviewtexture.h b/indra/newview/llpreviewtexture.h index 97e74706cc..b104a91c75 100755 --- a/indra/newview/llpreviewtexture.h +++ b/indra/newview/llpreviewtexture.h @@ -90,6 +90,7 @@ private: // This is stored off in a member variable, because the save-as // button and drag and drop functionality need to know. BOOL mIsCopyable; + BOOL mIsFullPerm; BOOL mUpdateDimensions; S32 mLastHeight; S32 mLastWidth; diff --git a/indra/newview/llscriptfloater.cpp b/indra/newview/llscriptfloater.cpp index 590a1c2647..1d021ec28f 100755 --- a/indra/newview/llscriptfloater.cpp +++ b/indra/newview/llscriptfloater.cpp @@ -378,6 +378,7 @@ void LLScriptFloaterManager::onAddNotification(const LLUUID& notification_id) { // Pass the new_message icon state further. set_new_message = chicletp->getShowNewMessagesIcon(); + chicletp->hidePopupMenu(); } } diff --git a/indra/newview/llsearchhistory.cpp b/indra/newview/llsearchhistory.cpp index 7b4bf63740..0ea05a03d6 100755 --- a/indra/newview/llsearchhistory.cpp +++ b/indra/newview/llsearchhistory.cpp @@ -43,7 +43,7 @@ bool LLSearchHistory::load() { // build filename for each user std::string resolved_filename = getHistoryFilePath(); - llifstream file(resolved_filename); + llifstream file(resolved_filename.c_str()); if (!file.is_open()) { return false; @@ -76,7 +76,7 @@ bool LLSearchHistory::save() // build filename for each user std::string resolved_filename = getHistoryFilePath(); // open a file for writing - llofstream file (resolved_filename); + llofstream file(resolved_filename.c_str()); if (!file.is_open()) { return false; diff --git a/indra/newview/llsechandler_basic.cpp b/indra/newview/llsechandler_basic.cpp index fc9d9f0842..40516f9bbb 100755 --- a/indra/newview/llsechandler_basic.cpp +++ b/indra/newview/llsechandler_basic.cpp @@ -640,7 +640,7 @@ LLBasicCertificateStore::~LLBasicCertificateStore() // persist the store void LLBasicCertificateStore::save() { - llofstream file_store(mFilename, llofstream::binary); + llofstream file_store(mFilename.c_str(), std::ios_base::binary); if(!file_store.fail()) { for(iterator cert = begin(); @@ -1331,7 +1331,7 @@ void LLSecAPIBasicHandler::_writeProtectedData() std::string tmp_filename = mProtectedDataFilename + ".tmp"; llofstream protected_data_stream(tmp_filename.c_str(), - llofstream::binary); + std::ios_base::binary); try { @@ -1364,6 +1364,7 @@ void LLSecAPIBasicHandler::_writeProtectedData() } catch (...) { + LL_WARNS() << "LLProtectedDataException(Error writing Protected Data Store)" << LL_ENDL; // it's good practice to clean up any secure information on error // (even though this file isn't really secure. Perhaps in the future // it may be, however. @@ -1372,20 +1373,35 @@ void LLSecAPIBasicHandler::_writeProtectedData() // EXP-1825 crash in LLSecAPIBasicHandler::_writeProtectedData() // Decided throwing an exception here was overkill until we figure out why this happens //throw LLProtectedDataException("Error writing Protected Data Store"); - LL_INFOS() << "LLProtectedDataException(Error writing Protected Data Store)" << LL_ENDL; } - // move the temporary file to the specified file location. - if((((LLFile::isfile(mProtectedDataFilename) != 0) && - (LLFile::remove(mProtectedDataFilename) != 0))) || - (LLFile::rename(tmp_filename, mProtectedDataFilename))) + try + { + // move the temporary file to the specified file location. + if((( (LLFile::isfile(mProtectedDataFilename) != 0) + && (LLFile::remove(mProtectedDataFilename) != 0))) + || (LLFile::rename(tmp_filename, mProtectedDataFilename))) + { + LL_WARNS() << "LLProtectedDataException(Could not overwrite protected data store)" << LL_ENDL; + LLFile::remove(tmp_filename); + + // EXP-1825 crash in LLSecAPIBasicHandler::_writeProtectedData() + // Decided throwing an exception here was overkill until we figure out why this happens + //throw LLProtectedDataException("Could not overwrite protected data store"); + } + } + catch (...) { + LL_WARNS() << "LLProtectedDataException(Error renaming '" << tmp_filename + << "' to '" << mProtectedDataFilename << "')" << LL_ENDL; + // it's good practice to clean up any secure information on error + // (even though this file isn't really secure. Perhaps in the future + // it may be, however. LLFile::remove(tmp_filename); - // EXP-1825 crash in LLSecAPIBasicHandler::_writeProtectedData() + //crash in LLSecAPIBasicHandler::_writeProtectedData() // Decided throwing an exception here was overkill until we figure out why this happens - //throw LLProtectedDataException("Could not overwrite protected data store"); - LL_INFOS() << "LLProtectedDataException(Could not overwrite protected data store)" << LL_ENDL; + //throw LLProtectedDataException("Error writing Protected Data Store"); } } @@ -1552,7 +1568,7 @@ std::string LLSecAPIBasicHandler::_legacyLoadPassword() { const S32 HASHED_LENGTH = 32; std::vector<U8> buffer(HASHED_LENGTH); - llifstream password_file(mLegacyPasswordPath, llifstream::binary); + llifstream password_file(mLegacyPasswordPath.c_str(), llifstream::binary); if(password_file.fail()) { diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 9e0bd9b6ed..fdc95c7784 100755 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -365,7 +365,7 @@ LLObjectSelectionHandle LLSelectMgr::selectObjectOnly(LLViewerObject* object, S3 //----------------------------------------------------------------------------- // Select the object, parents and children. //----------------------------------------------------------------------------- -LLObjectSelectionHandle LLSelectMgr::selectObjectAndFamily(LLViewerObject* obj, BOOL add_to_end) +LLObjectSelectionHandle LLSelectMgr::selectObjectAndFamily(LLViewerObject* obj, BOOL add_to_end, BOOL ignore_select_owned) { llassert( obj ); @@ -382,7 +382,7 @@ LLObjectSelectionHandle LLSelectMgr::selectObjectAndFamily(LLViewerObject* obj, return NULL; } - if (!canSelectObject(obj)) + if (!canSelectObject(obj,ignore_select_owned)) { //make_ui_sound("UISndInvalidOp"); return NULL; @@ -1763,6 +1763,40 @@ void LLSelectMgr::selectionRevertColors() getSelection()->applyToObjects(&sendfunc); } +void LLSelectMgr::selectionRevertShinyColors() +{ + struct f : public LLSelectedTEFunctor + { + LLObjectSelectionHandle mSelectedObjects; + f(LLObjectSelectionHandle sel) : mSelectedObjects(sel) {} + bool apply(LLViewerObject* object, S32 te) + { + if (object->permModify()) + { + LLSelectNode* nodep = mSelectedObjects->findNode(object); + if (nodep && te < (S32)nodep->mSavedShinyColors.size()) + { + LLColor4 color = nodep->mSavedShinyColors[te]; + // update viewer side color in anticipation of update from simulator + LLMaterialPtr old_mat = object->getTE(te)->getMaterialParams(); + if (!old_mat.isNull()) + { + LLMaterialPtr new_mat = gFloaterTools->getPanelFace()->createDefaultMaterial(old_mat); + new_mat->setSpecularLightColor(color); + object->getTE(te)->setMaterialParams(new_mat); + LLMaterialMgr::getInstance()->put(object->getID(), te, *new_mat); + } + } + } + return true; + } + } setfunc(mSelectedObjects); + getSelection()->applyToTEs(&setfunc); + + LLSelectMgrSendFunctor sendfunc; + getSelection()->applyToObjects(&sendfunc); +} + BOOL LLSelectMgr::selectionRevertTextures() { struct f : public LLSelectedTEFunctor @@ -4498,6 +4532,19 @@ void LLSelectMgr::saveSelectedObjectColors() getSelection()->applyToNodes(&func); } +void LLSelectMgr::saveSelectedShinyColors() +{ + struct f : public LLSelectedNodeFunctor + { + virtual bool apply(LLSelectNode* node) + { + node->saveShinyColors(); + return true; + } + } func; + getSelection()->applyToNodes(&func); +} + void LLSelectMgr::saveSelectedObjectTextures() { // invalidate current selection so we update saved textures @@ -4593,11 +4640,18 @@ struct LLSelectMgrApplyFlags : public LLSelectedObjectFunctor BOOL mState; virtual bool apply(LLViewerObject* object) { - if ( object->permModify() && // preemptive permissions check - object->isRoot()) // don't send for child objects + if ( object->permModify()) { - object->setFlags( mFlags, mState); - } + if (object->isRoot()) // don't send for child objects + { + object->setFlags( mFlags, mState); + } + else if (FLAGS_WORLD & mFlags && ((LLViewerObject*)object->getRoot())->isSelected()) + { + // FLAGS_WORLD are shared by all items in linkset + object->setFlagsWithoutUpdate(FLAGS_WORLD & mFlags, mState); + } + }; return true; } }; @@ -5749,6 +5803,7 @@ LLSelectNode::LLSelectNode(LLViewerObject* object, BOOL glow) mCreationDate(0) { saveColors(); + saveShinyColors(); } LLSelectNode::LLSelectNode(const LLSelectNode& nodep) @@ -5794,6 +5849,11 @@ LLSelectNode::LLSelectNode(const LLSelectNode& nodep) { mSavedColors.push_back(*color_iter); } + mSavedShinyColors.clear(); + for (color_iter = nodep.mSavedShinyColors.begin(); color_iter != nodep.mSavedShinyColors.end(); ++color_iter) + { + mSavedShinyColors.push_back(*color_iter); + } saveTextures(nodep.mSavedTextures); } @@ -5877,6 +5937,26 @@ void LLSelectNode::saveColors() } } +void LLSelectNode::saveShinyColors() +{ + if (mObject.notNull()) + { + mSavedShinyColors.clear(); + for (S32 i = 0; i < mObject->getNumTEs(); i++) + { + const LLMaterialPtr mat = mObject->getTE(i)->getMaterialParams(); + if (!mat.isNull()) + { + mSavedShinyColors.push_back(mat->getSpecularLightColor()); + } + else + { + mSavedShinyColors.push_back(LLColor4::white); + } + } + } +} + void LLSelectNode::saveTextures(const uuid_vec_t& textures) { if (mObject.notNull()) @@ -6695,29 +6775,32 @@ void LLSelectMgr::validateSelection() getSelection()->applyToObjects(&func); } -BOOL LLSelectMgr::canSelectObject(LLViewerObject* object) +BOOL LLSelectMgr::canSelectObject(LLViewerObject* object, BOOL ignore_select_owned) { // Never select dead objects if (!object || object->isDead()) { return FALSE; } - + if (mForceSelection) { return TRUE; } - if ((gSavedSettings.getBOOL("SelectOwnedOnly") && !object->permYouOwner()) || - (gSavedSettings.getBOOL("SelectMovableOnly") && (!object->permMove() || object->isPermanentEnforced()))) + if(!ignore_select_owned) { - // only select my own objects - return FALSE; + if ((gSavedSettings.getBOOL("SelectOwnedOnly") && !object->permYouOwner()) || + (gSavedSettings.getBOOL("SelectMovableOnly") && (!object->permMove() || object->isPermanentEnforced()))) + { + // only select my own objects + return FALSE; + } } // Can't select orphans if (object->isOrphaned()) return FALSE; - + // Can't select avatars if (object->isAvatar()) return FALSE; diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h index a68328167a..23c41e4cc1 100755 --- a/indra/newview/llselectmgr.h +++ b/indra/newview/llselectmgr.h @@ -179,6 +179,7 @@ public: void setObject(LLViewerObject* object); // *NOTE: invalidate stored textures and colors when # faces change void saveColors(); + void saveShinyColors(); void saveTextures(const uuid_vec_t& textures); void saveTextureScaleRatios(LLRender::eTexIndex index_to_query); @@ -215,6 +216,7 @@ public: std::string mSitName; U64 mCreationDate; std::vector<LLColor4> mSavedColors; + std::vector<LLColor4> mSavedShinyColors; uuid_vec_t mSavedTextures; std::vector<LLVector3> mTextureScaleRatios; std::vector<LLVector3> mSilhouetteVertices; // array of vertices to render silhouette of object @@ -452,7 +454,7 @@ public: // // *NOTE: You must hold on to the object selection handle, otherwise // the objects will be automatically deselected in 1 frame. - LLObjectSelectionHandle selectObjectAndFamily(LLViewerObject* object, BOOL add_to_end = FALSE); + LLObjectSelectionHandle selectObjectAndFamily(LLViewerObject* object, BOOL add_to_end = FALSE, BOOL ignore_select_owned = FALSE); // For when you want just a child object. LLObjectSelectionHandle selectObjectOnly(LLViewerObject* object, S32 face = SELECT_ALL_TES); @@ -545,6 +547,7 @@ public: //////////////////////////////////////////////////////////////// void saveSelectedObjectTransform(EActionType action_type); void saveSelectedObjectColors(); + void saveSelectedShinyColors(); void saveSelectedObjectTextures(); // Sets which texture channel to query for scale and rot of display @@ -573,6 +576,7 @@ public: void selectionSetColorOnly(const LLColor4 &color); // Set only the RGB channels void selectionSetAlphaOnly(const F32 alpha); // Set only the alpha channel void selectionRevertColors(); + void selectionRevertShinyColors(); BOOL selectionRevertTextures(); void selectionSetBumpmap( U8 bumpmap ); void selectionSetTexGen( U8 texgen ); @@ -605,7 +609,7 @@ public: void validateSelection(); // returns TRUE if it is possible to select this object - BOOL canSelectObject(LLViewerObject* object); + BOOL canSelectObject(LLViewerObject* object, BOOL ignore_select_owned = FALSE); // Returns TRUE if the viewer has information on all selected objects BOOL selectGetAllRootsValid(); diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index 64f24cd291..ea7cf82674 100755 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -212,7 +212,8 @@ void LLSidepanelAppearance::updateToVisibility(const LLSD &new_visibility) } if (is_wearable_edit_visible) { - if (gAgentWearables.getWearableIndex(wearable_ptr) == LLAgentWearables::MAX_CLOTHING_PER_TYPE) + U32 index; + if (!gAgentWearables.getWearableIndex(wearable_ptr,index)) { // we're no longer wearing the wearable we were last editing, switch back to outfit editor showOutfitEditPanel(); diff --git a/indra/newview/llsidepaneliteminfo.cpp b/indra/newview/llsidepaneliteminfo.cpp index 1d20b7bed5..126f1fb9de 100755 --- a/indra/newview/llsidepaneliteminfo.cpp +++ b/indra/newview/llsidepaneliteminfo.cpp @@ -32,6 +32,7 @@ #include "llagent.h" #include "llavataractions.h" #include "llbutton.h" +#include "llcombobox.h" #include "llfloaterreg.h" #include "llgroupactions.h" #include "llinventorydefines.h" @@ -173,6 +174,8 @@ BOOL LLSidepanelItemInfo::postBuild() getChild<LLUICtrl>("CheckNextOwnerTransfer")->setCommitCallback(boost::bind(&LLSidepanelItemInfo::onCommitPermissions, this)); // Mark for sale or not, and sale info getChild<LLUICtrl>("CheckPurchase")->setCommitCallback(boost::bind(&LLSidepanelItemInfo::onCommitSaleInfo, this)); + // Change sale type, and sale info + getChild<LLUICtrl>("ComboBoxSaleType")->setCommitCallback(boost::bind(&LLSidepanelItemInfo::onCommitSaleInfo, this)); // "Price" label for edit getChild<LLUICtrl>("Edit Cost")->setCommitCallback(boost::bind(&LLSidepanelItemInfo::onCommitSaleInfo, this)); refresh(); @@ -435,7 +438,7 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) "CheckNextOwnerTransfer", "CheckPurchase", "SaleLabel", - "combobox sale copy", + "ComboBoxSaleType", "Edit Cost", "TextPrice" }; @@ -617,6 +620,9 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) const LLSaleInfo& sale_info = item->getSaleInfo(); BOOL is_for_sale = sale_info.isForSale(); + LLComboBox* combo_sale_type = getChild<LLComboBox>("ComboBoxSaleType"); + LLUICtrl* edit_cost = getChild<LLUICtrl>("Edit Cost"); + // Check for ability to change values. if (is_obj_modify && can_agent_sell && gAgent.allowOperation(PERM_TRANSFER, perm, GP_OBJECT_MANIPULATE)) @@ -630,7 +636,8 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) getChildView("CheckNextOwnerTransfer")->setEnabled((next_owner_mask & PERM_COPY) && !cannot_restrict_permissions); getChildView("TextPrice")->setEnabled(is_complete && is_for_sale); - getChildView("Edit Cost")->setEnabled(is_complete && is_for_sale); + combo_sale_type->setEnabled(is_complete && is_for_sale); + edit_cost->setEnabled(is_complete && is_for_sale); } else { @@ -643,13 +650,12 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) getChildView("CheckNextOwnerTransfer")->setEnabled(FALSE); getChildView("TextPrice")->setEnabled(FALSE); - getChildView("Edit Cost")->setEnabled(FALSE); + combo_sale_type->setEnabled(FALSE); + edit_cost->setEnabled(FALSE); } // Set values. getChild<LLUICtrl>("CheckPurchase")->setValue(is_for_sale); - getChildView("combobox sale copy")->setEnabled(is_for_sale); - getChildView("Edit Cost")->setEnabled(is_for_sale); getChild<LLUICtrl>("CheckNextOwnerModify")->setValue(LLSD(BOOL(next_owner_mask & PERM_MODIFY))); getChild<LLUICtrl>("CheckNextOwnerCopy")->setValue(LLSD(BOOL(next_owner_mask & PERM_COPY))); getChild<LLUICtrl>("CheckNextOwnerTransfer")->setValue(LLSD(BOOL(next_owner_mask & PERM_TRANSFER))); @@ -658,11 +664,13 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) { S32 numerical_price; numerical_price = sale_info.getSalePrice(); - getChild<LLUICtrl>("Edit Cost")->setValue(llformat("%d",numerical_price)); + edit_cost->setValue(llformat("%d",numerical_price)); + combo_sale_type->setValue(sale_info.getSaleType()); } else { - getChild<LLUICtrl>("Edit Cost")->setValue(llformat("%d",0)); + edit_cost->setValue(llformat("%d",0)); + combo_sale_type->setValue(LLSaleInfo::FS_COPY); } } @@ -918,24 +926,10 @@ void LLSidepanelItemInfo::updateSaleInfo() // turn on sale info LLSaleInfo::EForSale sale_type = LLSaleInfo::FS_COPY; - LLRadioGroup* RadioSaleType = getChild<LLRadioGroup>("RadioSaleType"); - if(RadioSaleType) + LLComboBox* combo_sale_type = getChild<LLComboBox>("ComboBoxSaleType"); + if (combo_sale_type) { - switch (RadioSaleType->getSelectedIndex()) - { - case 0: - sale_type = LLSaleInfo::FS_ORIGINAL; - break; - case 1: - sale_type = LLSaleInfo::FS_COPY; - break; - case 2: - sale_type = LLSaleInfo::FS_CONTENTS; - break; - default: - sale_type = LLSaleInfo::FS_COPY; - break; - } + sale_type = static_cast<LLSaleInfo::EForSale>(combo_sale_type->getValue().asInteger()); } if (sale_type == LLSaleInfo::FS_COPY diff --git a/indra/newview/llsidepaneltaskinfo.cpp b/indra/newview/llsidepaneltaskinfo.cpp index 636654ad23..17ecfab4fb 100755 --- a/indra/newview/llsidepaneltaskinfo.cpp +++ b/indra/newview/llsidepaneltaskinfo.cpp @@ -499,17 +499,19 @@ void LLSidepanelTaskInfo::refresh() // You own these objects. else if (self_owned || (group_owned && gAgent.hasPowerInGroup(group_id,GP_OBJECT_SET_SALE))) { + LLSpinCtrl *edit_price = getChild<LLSpinCtrl>("Edit Cost"); + // If there are multiple items for sale then set text to PRICE PER UNIT. if (num_for_sale > 1) { - getChild<LLUICtrl>("Cost")->setValue(getString("Cost Per Unit")); + std::string label_text = is_sale_price_mixed? "Cost Mixed" :"Cost Per Unit"; + edit_price->setLabel(getString(label_text)); } else { - getChild<LLUICtrl>("Cost")->setValue(getString("Cost Default")); + edit_price->setLabel(getString("Cost Default")); } - LLSpinCtrl *edit_price = getChild<LLSpinCtrl>("Edit Cost"); if (!edit_price->hasFocus()) { // If the sale price is mixed then set the cost to MIXED, otherwise @@ -547,16 +549,15 @@ void LLSidepanelTaskInfo::refresh() // If multiple items are for sale, set text to TOTAL PRICE. if (num_for_sale > 1) - getChild<LLUICtrl>("Cost")->setValue(getString("Cost Total")); + getChild<LLSpinCtrl>("Edit Cost")->setLabel(getString("Cost Total")); else - getChild<LLUICtrl>("Cost")->setValue(getString("Cost Default")); + getChild<LLSpinCtrl>("Edit Cost")->setLabel(getString("Cost Default")); } // This is a public object. else { getChildView("Cost")->setEnabled(FALSE); - getChild<LLUICtrl>("Cost")->setValue(getString("Cost Default")); - + getChild<LLSpinCtrl>("Edit Cost")->setLabel(getString("Cost Default")); getChild<LLUICtrl>("Edit Cost")->setValue(LLStringUtil::null); getChildView("Edit Cost")->setEnabled(FALSE); } diff --git a/indra/newview/llsnapshotlivepreview.cpp b/indra/newview/llsnapshotlivepreview.cpp index ee5fd7cb71..0ae8a338e0 100644 --- a/indra/newview/llsnapshotlivepreview.cpp +++ b/indra/newview/llsnapshotlivepreview.cpp @@ -116,6 +116,8 @@ LLSnapshotLivePreview::LLSnapshotLivePreview (const LLSnapshotLivePreview::Param mThumbnailUpdateLock = FALSE ; mThumbnailUpToDate = FALSE ; mBigThumbnailUpToDate = FALSE ; + + mForceUpdateSnapshot = FALSE; } LLSnapshotLivePreview::~LLSnapshotLivePreview() @@ -671,18 +673,19 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview ) // If we're in freeze-frame mode and camera has moved, update snapshot. LLVector3 new_camera_pos = LLViewerCamera::getInstance()->getOrigin(); LLQuaternion new_camera_rot = LLViewerCamera::getInstance()->getQuaternion(); - if (gSavedSettings.getBOOL("FreezeTime") && previewp->mAllowFullScreenPreview && - (new_camera_pos != previewp->mCameraPos || dot(new_camera_rot, previewp->mCameraRot) < 0.995f)) + if (previewp->mForceUpdateSnapshot || (gSavedSettings.getBOOL("FreezeTime") && previewp->mAllowFullScreenPreview && + (new_camera_pos != previewp->mCameraPos || dot(new_camera_rot, previewp->mCameraRot) < 0.995f))) { previewp->mCameraPos = new_camera_pos; previewp->mCameraRot = new_camera_rot; // request a new snapshot whenever the camera moves, with a time delay - BOOL autosnap = gSavedSettings.getBOOL("AutoSnapshot"); + BOOL new_snapshot = gSavedSettings.getBOOL("AutoSnapshot") || previewp->mForceUpdateSnapshot; LL_DEBUGS() << "camera moved, updating thumbnail" << LL_ENDL; previewp->updateSnapshot( - autosnap, // whether a new snapshot is needed or merely invalidate the existing one + new_snapshot, // whether a new snapshot is needed or merely invalidate the existing one FALSE, // or if 1st arg is false, whether to produce a new thumbnail image. - autosnap ? AUTO_SNAPSHOT_TIME_DELAY : 0.f); // shutter delay if 1st arg is true. + new_snapshot ? AUTO_SNAPSHOT_TIME_DELAY : 0.f); // shutter delay if 1st arg is true. + previewp->mForceUpdateSnapshot = FALSE; } // see if it's time yet to snap the shot and bomb out otherwise. diff --git a/indra/newview/llsnapshotlivepreview.h b/indra/newview/llsnapshotlivepreview.h index e1937187a3..fed33bf37c 100644 --- a/indra/newview/llsnapshotlivepreview.h +++ b/indra/newview/llsnapshotlivepreview.h @@ -182,6 +182,7 @@ private: public: static std::set<LLSnapshotLivePreview*> sList; BOOL mKeepAspectRatio ; + BOOL mForceUpdateSnapshot; }; #endif // LL_LLSNAPSHOTLIVEPREVIEW_H diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index e80756e4de..7867e1573c 100755 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -611,11 +611,14 @@ void LLSpeakerMgr::updateSpeakerList() setSpeaker(gAgentID, "", LLSpeaker::STATUS_VOICE_ACTIVE, LLSpeaker::SPEAKER_AGENT); } -void LLSpeakerMgr::setSpeakerNotInChannel(LLSpeaker* speakerp) +void LLSpeakerMgr::setSpeakerNotInChannel(LLPointer<LLSpeaker> speakerp) { - speakerp->mStatus = LLSpeaker::STATUS_NOT_IN_CHANNEL; - speakerp->mDotColor = INACTIVE_COLOR; - mSpeakerDelayRemover->setActionTimer(speakerp->mID); + if (speakerp.notNull()) + { + speakerp->mStatus = LLSpeaker::STATUS_NOT_IN_CHANNEL; + speakerp->mDotColor = INACTIVE_COLOR; + mSpeakerDelayRemover->setActionTimer(speakerp->mID); + } } bool LLSpeakerMgr::removeSpeaker(const LLUUID& speaker_id) @@ -795,7 +798,7 @@ void LLIMSpeakerMgr::updateSpeakers(const LLSD& update) if (agent_data.isMap() && agent_data.has("transition")) { - if (agent_data["transition"].asString() == "LEAVE" && speakerp.notNull()) + if (agent_data["transition"].asString() == "LEAVE") { setSpeakerNotInChannel(speakerp); } @@ -806,7 +809,7 @@ void LLIMSpeakerMgr::updateSpeakers(const LLSD& update) } else { - LL_WARNS() << "bad membership list update " << ll_print_sd(agent_data["transition"]) << LL_ENDL; + LL_WARNS() << "bad membership list update from 'agent_updates' for agent " << agent_id << ", transition " << ll_print_sd(agent_data["transition"]) << LL_ENDL; } } @@ -848,7 +851,7 @@ void LLIMSpeakerMgr::updateSpeakers(const LLSD& update) LLPointer<LLSpeaker> speakerp = findSpeaker(agent_id); std::string agent_transition = update_it->second.asString(); - if (agent_transition == "LEAVE" && speakerp.notNull()) + if (agent_transition == "LEAVE") { setSpeakerNotInChannel(speakerp); } @@ -859,8 +862,7 @@ void LLIMSpeakerMgr::updateSpeakers(const LLSD& update) } else { - LL_WARNS() << "bad membership list update " - << agent_transition << LL_ENDL; + LL_WARNS() << "bad membership list update from 'updates' for agent " << agent_id << ", transition " << agent_transition << LL_ENDL; } } } @@ -1041,8 +1043,8 @@ void LLLocalSpeakerMgr::updateSpeakerList() for (speaker_map_t::iterator speaker_it = mSpeakers.begin(); speaker_it != mSpeakers.end(); ++speaker_it) { LLUUID speaker_id = speaker_it->first; - LLSpeaker* speakerp = speaker_it->second; - if (speakerp->mStatus == LLSpeaker::STATUS_TEXT_ONLY) + LLPointer<LLSpeaker> speakerp = speaker_it->second; + if (speakerp.notNull() && speakerp->mStatus == LLSpeaker::STATUS_TEXT_ONLY) { LLVOAvatar* avatarp = (LLVOAvatar*)gObjectList.findObject(speaker_id); if (!avatarp || dist_vec_squared(avatarp->getPositionAgent(), gAgent.getPositionAgent()) > CHAT_NORMAL_RADIUS * CHAT_NORMAL_RADIUS) diff --git a/indra/newview/llspeakers.h b/indra/newview/llspeakers.h index e953dd0e1a..0e69184125 100755 --- a/indra/newview/llspeakers.h +++ b/indra/newview/llspeakers.h @@ -258,7 +258,7 @@ public: protected: virtual void updateSpeakerList(); - void setSpeakerNotInChannel(LLSpeaker* speackerp); + void setSpeakerNotInChannel(LLPointer<LLSpeaker> speackerp); bool removeSpeaker(const LLUUID& speaker_id); typedef std::map<LLUUID, LLPointer<LLSpeaker> > speaker_map_t; diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index d5f9268a64..42fc300187 100755 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1352,11 +1352,11 @@ bool idle_startup() { LLStringUtil::format_map_t args; args["[NUMBER]"] = llformat("%d", num_retries + 1); - set_startup_status(0.4f, LLTrans::getString("LoginRetrySeedCapGrant", args), gAgent.mMOTD); + set_startup_status(0.4f, LLTrans::getString("LoginRetrySeedCapGrant", args), gAgent.mMOTD.c_str()); } else { - set_startup_status(0.4f, LLTrans::getString("LoginRequestSeedCapGrant"), gAgent.mMOTD); + set_startup_status(0.4f, LLTrans::getString("LoginRequestSeedCapGrant"), gAgent.mMOTD.c_str()); } } display_startup(); @@ -2070,7 +2070,7 @@ bool idle_startup() update_texture_fetch(); set_startup_status(0.60f + 0.30f * timeout_frac, LLTrans::getString("LoginPrecaching"), - gAgent.mMOTD); + gAgent.mMOTD.c_str()); display_startup(); } diff --git a/indra/newview/llsyntaxid.cpp b/indra/newview/llsyntaxid.cpp index a763d42a8d..802dff1ead 100644 --- a/indra/newview/llsyntaxid.cpp +++ b/indra/newview/llsyntaxid.cpp @@ -83,7 +83,7 @@ public: const std::string xml = str.str(); // save the str to disk, usually to the cache. - llofstream file(mFileSpec, std::ios_base::out); + llofstream file(mFileSpec.c_str(), std::ios_base::out); file.write(xml.c_str(), str.str().size()); file.close(); @@ -269,7 +269,7 @@ void LLSyntaxIdLSL::loadKeywordsIntoLLSD() { LLSD content; llifstream file; - file.open(mFullFileSpec); + file.open(mFullFileSpec.c_str()); if (file.is_open()) { if (LLSDSerialize::fromXML(content, file) != LLSDParser::PARSE_FAILURE) diff --git a/indra/newview/llteleporthistorystorage.cpp b/indra/newview/llteleporthistorystorage.cpp index f88f88a4fa..8a5704939a 100755 --- a/indra/newview/llteleporthistorystorage.cpp +++ b/indra/newview/llteleporthistorystorage.cpp @@ -164,7 +164,7 @@ void LLTeleportHistoryStorage::save() std::string resolvedFilename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, mFilename); // open the history file for writing - llofstream file (resolvedFilename); + llofstream file(resolvedFilename.c_str()); if (!file.is_open()) { LL_WARNS() << "can't open teleport history file \"" << mFilename << "\" for writing" << LL_ENDL; @@ -186,7 +186,7 @@ void LLTeleportHistoryStorage::load() std::string resolved_filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, mFilename); // open the history file for reading - llifstream file(resolved_filename); + llifstream file(resolved_filename.c_str()); if (!file.is_open()) { LL_WARNS() << "can't load teleport history from file \"" << mFilename << "\"" << LL_ENDL; diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 3e5b91c8fc..717807f513 100755 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -580,9 +580,9 @@ void LLFloaterTexturePicker::draw() mTentativeLabel->setVisible( FALSE ); } - getChildView("Default")->setEnabled(mImageAssetID != mOwner->getDefaultImageAssetID()); - getChildView("Blank")->setEnabled(mImageAssetID != mOwner->getBlankImageAssetID()); - getChildView("None")->setEnabled(mOwner->getAllowNoTexture() && !mImageAssetID.isNull() ); + getChildView("Default")->setEnabled(mImageAssetID != mOwner->getDefaultImageAssetID() || mOwner->getTentative()); + getChildView("Blank")->setEnabled(mImageAssetID != mOwner->getBlankImageAssetID() || mOwner->getTentative()); + getChildView("None")->setEnabled(mOwner->getAllowNoTexture() && (!mImageAssetID.isNull() || mOwner->getTentative())); LLFloater::draw(); @@ -1505,8 +1505,8 @@ void LLTextureCtrl::draw() gl_draw_x( interior, LLColor4::black ); } - mTentativeLabel->setVisible( !mTexturep.isNull() && getTentative() ); - + mTentativeLabel->setVisible( getTentative() ); + // Show "Loading..." string on the top left corner while this texture is loading. // Using the discard level, do not show the string if the texture is almost but not // fully loaded. diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index e8f6c35662..526f8d1cd8 100755 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -34,6 +34,7 @@ #include "llagentcamera.h" #include "llagentwearables.h" #include "llappearancemgr.h" +#include "llavatarnamecache.h" #include "lldictionary.h" #include "llfloaterreg.h" #include "llfloatertools.h" @@ -1704,9 +1705,14 @@ bool LLToolDragAndDrop::handleGiveDragAndDrop(LLUUID dest_agent, LLUUID session_ return true; } - + std::string dest_name = session->mName; + LLAvatarName av_name; + if(LLAvatarNameCache::get(dest_agent, &av_name)) + { + dest_name = av_name.getCompleteName(); + } // If an IM session with destination agent is found item offer will be logged in this session. - show_object_sharing_confirmation(session->mName, inv_obj, dest, dest_agent, session_id); + show_object_sharing_confirmation(dest_name, inv_obj, dest, dest_agent, session_id); } } else diff --git a/indra/newview/lltoolfocus.cpp b/indra/newview/lltoolfocus.cpp index 7de91c7757..15f3c36674 100755 --- a/indra/newview/lltoolfocus.cpp +++ b/indra/newview/lltoolfocus.cpp @@ -135,7 +135,7 @@ BOOL LLToolCamera::handleMouseDown(S32 x, S32 y, MASK mask) gViewerWindow->hideCursor(); - gViewerWindow->pickAsync(x, y, mask, pickCallback); + gViewerWindow->pickAsync(x, y, mask, pickCallback, FALSE, TRUE); return TRUE; } diff --git a/indra/newview/llurlhistory.cpp b/indra/newview/llurlhistory.cpp index 8eea2b242a..f7064e152a 100755 --- a/indra/newview/llurlhistory.cpp +++ b/indra/newview/llurlhistory.cpp @@ -40,29 +40,32 @@ const int MAX_URL_COUNT = 10; // static bool LLURLHistory::loadFile(const std::string& filename) { + bool dataloaded = false; + sHistorySD = LLSD(); LLSD data; - { - std::string temp_str = gDirUtilp->getLindenUserDir() + gDirUtilp->getDirDelimiter(); - - llifstream file((temp_str + filename)); - - if (file.is_open()) - { - LL_INFOS() << "Loading history.xml file at " << filename << LL_ENDL; - LLSDSerialize::fromXML(data, file); - } - - if (data.isUndefined()) - { - LL_INFOS() << "file missing, ill-formed, " - "or simply undefined; not changing the" - " file" << LL_ENDL; - sHistorySD = LLSD(); - return false; - } - } - sHistorySD = data; - return true; + + std::string user_filename(gDirUtilp->getLindenUserDir() + gDirUtilp->getDirDelimiter() + filename); + + llifstream file(user_filename.c_str()); + if (file.is_open()) + { + LLSDSerialize::fromXML(data, file); + if (data.isUndefined()) + { + LL_WARNS() << "error loading " << user_filename << LL_ENDL; + } + else + { + LL_INFOS() << "Loaded history file at " << user_filename << LL_ENDL; + sHistorySD = data; + dataloaded = true; + } + } + else + { + LL_INFOS() << "Unable to open history file at " << user_filename << LL_ENDL; + } + return dataloaded; } // static @@ -76,10 +79,10 @@ bool LLURLHistory::saveFile(const std::string& filename) } temp_str += gDirUtilp->getDirDelimiter() + filename; - llofstream out(temp_str); + llofstream out(temp_str.c_str()); if (!out.good()) { - LL_WARNS() << "Unable to open " << filename << " for output." << LL_ENDL; + LL_WARNS() << "Unable to open " << temp_str << " for output." << LL_ENDL; return false; } diff --git a/indra/newview/llurlwhitelist.cpp b/indra/newview/llurlwhitelist.cpp index 8211ce12f6..3a7285974e 100755 --- a/indra/newview/llurlwhitelist.cpp +++ b/indra/newview/llurlwhitelist.cpp @@ -87,7 +87,7 @@ bool LLUrlWhiteList::load () std::string resolvedFilename = gDirUtilp->getExpandedFilename ( LL_PATH_PER_SL_ACCOUNT, mFilename ); // open a file for reading - llifstream file ( resolvedFilename ); + llifstream file(resolvedFilename.c_str()); if ( file.is_open () ) { // add each line in the file to the list @@ -122,7 +122,7 @@ bool LLUrlWhiteList::save () } // open a file for writing - llofstream file ( resolvedFilename ); + llofstream file(resolvedFilename.c_str()); if ( file.is_open () ) { // for each entry we have diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index cd9b2ed11b..afa00e3e6e 100755 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -930,8 +930,8 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) if (gSavedSettings.getBOOL("RenderDepthPrePass") && LLGLSLShader::sNoFixedFunction) { gGL.setColorMask(false, false); - - U32 types[] = { + + static const U32 types[] = { LLRenderPass::PASS_SIMPLE, LLRenderPass::PASS_FULLBRIGHT, LLRenderPass::PASS_SHINY diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index d6c8ba10f6..d112118082 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -2106,7 +2106,7 @@ LLWearableType::EType LLViewerInventoryItem::getWearableType() const { return LLWearableType::WT_INVALID; } - return LLWearableType::EType(getFlags() & LLInventoryItemFlags::II_FLAGS_WEARABLES_MASK); + return LLWearableType::inventoryFlagsToWearableType(getFlags()); } diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp index 9b8c913c6b..ada829eb4b 100755 --- a/indra/newview/llviewerkeyboard.cpp +++ b/indra/newview/llviewerkeyboard.cpp @@ -148,6 +148,8 @@ void camera_move_forward( EKeystate s ); void agent_push_forward( EKeystate s ) { + if(gAgent.isMovementLocked()) return; + //in free camera control mode we need to intercept keyboard events for avatar movements if (LLFloaterCamera::inFreeCameraMode()) { @@ -163,6 +165,8 @@ void camera_move_backward( EKeystate s ); void agent_push_backward( EKeystate s ) { + if(gAgent.isMovementLocked()) return; + //in free camera control mode we need to intercept keyboard events for avatar movements if (LLFloaterCamera::inFreeCameraMode()) { @@ -198,12 +202,14 @@ static void agent_slide_leftright( EKeystate s, S32 direction, LLAgent::EDoubleT void agent_slide_left( EKeystate s ) { + if(gAgent.isMovementLocked()) return; agent_slide_leftright(s, 1, LLAgent::DOUBLETAP_SLIDELEFT); } void agent_slide_right( EKeystate s ) { + if(gAgent.isMovementLocked()) return; agent_slide_leftright(s, -1, LLAgent::DOUBLETAP_SLIDERIGHT); } @@ -218,6 +224,8 @@ void agent_turn_left( EKeystate s ) return; } + if(gAgent.isMovementLocked()) return; + if (LLToolCamera::getInstance()->mouseSteerMode()) { agent_slide_left(s); @@ -246,6 +254,8 @@ void agent_turn_right( EKeystate s ) return; } + if(gAgent.isMovementLocked()) return; + if (LLToolCamera::getInstance()->mouseSteerMode()) { agent_slide_right(s); @@ -319,8 +329,8 @@ void camera_spin_around_cw( EKeystate s ) void camera_spin_around_ccw_sitting( EKeystate s ) { - if( KEYSTATE_UP == s ) return; - if (gAgent.rotateGrabbed() || gAgentCamera.sitCameraEnabled()) + if( KEYSTATE_UP == s && gAgent.mDoubleTapRunMode != LLAgent::DOUBLETAP_SLIDERIGHT ) return; + if (gAgent.rotateGrabbed() || gAgentCamera.sitCameraEnabled() || gAgent.getRunning()) { //send keystrokes, but do not change camera agent_turn_right(s); @@ -335,8 +345,8 @@ void camera_spin_around_ccw_sitting( EKeystate s ) void camera_spin_around_cw_sitting( EKeystate s ) { - if( KEYSTATE_UP == s ) return; - if (gAgent.rotateGrabbed() || gAgentCamera.sitCameraEnabled()) + if( KEYSTATE_UP == s && gAgent.mDoubleTapRunMode != LLAgent::DOUBLETAP_SLIDELEFT ) return; + if (gAgent.rotateGrabbed() || gAgentCamera.sitCameraEnabled() || gAgent.getRunning()) { //send keystrokes, but do not change camera agent_turn_left(s); @@ -412,8 +422,8 @@ void camera_move_backward( EKeystate s ) void camera_move_forward_sitting( EKeystate s ) { - if( KEYSTATE_UP == s ) return; - if (gAgent.forwardGrabbed() || gAgentCamera.sitCameraEnabled()) + if( KEYSTATE_UP == s && gAgent.mDoubleTapRunMode != LLAgent::DOUBLETAP_FORWARD ) return; + if (gAgent.forwardGrabbed() || gAgentCamera.sitCameraEnabled() || gAgent.getRunning()) { agent_push_forward(s); } @@ -426,9 +436,9 @@ void camera_move_forward_sitting( EKeystate s ) void camera_move_backward_sitting( EKeystate s ) { - if( KEYSTATE_UP == s ) return; + if( KEYSTATE_UP == s && gAgent.mDoubleTapRunMode != LLAgent::DOUBLETAP_BACKWARD ) return; - if (gAgent.backwardGrabbed() || gAgentCamera.sitCameraEnabled()) + if (gAgent.backwardGrabbed() || gAgentCamera.sitCameraEnabled() || gAgent.getRunning()) { agent_push_backward(s); } diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index c758bbcc9e..509227c683 100755 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -1278,7 +1278,7 @@ void LLViewerMedia::loadCookieFile() } // open the file for reading - llifstream file(resolved_filename); + llifstream file(resolved_filename.c_str()); if (!file.is_open()) { LL_WARNS() << "can't load plugin cookies from file \"" << PLUGIN_COOKIE_FILE_NAME << "\"" << LL_ENDL; @@ -1320,7 +1320,7 @@ void LLViewerMedia::saveCookieFile() } // open a file for writing - llofstream file (resolved_filename); + llofstream file(resolved_filename.c_str()); if (!file.is_open()) { LL_WARNS() << "can't open plugin cookie file \"" << PLUGIN_COOKIE_FILE_NAME << "\" for writing" << LL_ENDL; diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 793697b3df..cf44a5c69b 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -2577,9 +2577,13 @@ static LLStringExplicit get_default_item_label(const std::string& item_name) bool enable_object_touch(LLUICtrl* ctrl) { + bool new_value = false; LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); - - bool new_value = obj && obj->flagHandleTouch(); + if (obj) + { + LLViewerObject* parent = (LLViewerObject*)obj->getParent(); + new_value = obj->flagHandleTouch() || (parent && parent->flagHandleTouch()); + } std::string item_name = ctrl->getName(); init_default_item_label(item_name); @@ -2864,6 +2868,11 @@ bool enable_object_select_in_pathfinding_linksets() return LLPathfindingManager::getInstance()->isPathfindingEnabledForCurrentRegion() && LLSelectMgr::getInstance()->selectGetEditableLinksets(); } +bool visible_object_select_in_pathfinding_linksets() +{ + return LLPathfindingManager::getInstance()->isPathfindingEnabledForCurrentRegion(); +} + bool enable_object_select_in_pathfinding_characters() { return LLPathfindingManager::getInstance()->isPathfindingEnabledForCurrentRegion() && LLSelectMgr::getInstance()->selectGetViewableCharacters(); @@ -4358,7 +4367,10 @@ static bool get_derezzable_objects( break; case DRD_RETURN_TO_OWNER: - can_derez_current = TRUE; + if(!object->isAttachment()) + { + can_derez_current = TRUE; + } break; default: @@ -4766,7 +4778,7 @@ BOOL enable_take() && object->permModify()) || (node->mPermissions->getOwner() == gAgent.getID()))) { - return TRUE; + return !object->isAttachment(); } #endif } @@ -8290,6 +8302,10 @@ class LLWorldEnableEnvSettings : public view_listener_t { result = (LLEnvManagerNew::instance().getSkyPresetName() == "Midnight"); } + else if (tod == "region") + { + return false; + } else { LL_WARNS() << "Unknown time-of-day item: " << tod << LL_ENDL; @@ -8990,6 +9006,7 @@ void initialize_menus() enable.add("VisibleBuild", boost::bind(&enable_object_build)); commit.add("Pathfinding.Linksets.Select", boost::bind(&LLFloaterPathfindingLinksets::openLinksetsWithSelectedObjects)); enable.add("EnableSelectInPathfindingLinksets", boost::bind(&enable_object_select_in_pathfinding_linksets)); + enable.add("VisibleSelectInPathfindingLinksets", boost::bind(&visible_object_select_in_pathfinding_linksets)); commit.add("Pathfinding.Characters.Select", boost::bind(&LLFloaterPathfindingCharacters::openCharactersWithSelectedObjects)); enable.add("EnableSelectInPathfindingCharacters", boost::bind(&enable_object_select_in_pathfinding_characters)); diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index b2a37694fe..f8e50ba463 100755 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -503,6 +503,7 @@ class LLFileCloseWindow : public view_listener_t { LLFloater::closeFrontmostFloater(); } + if (gMenuHolder) gMenuHolder->hideMenus(); return true; } }; @@ -525,6 +526,7 @@ class LLFileCloseAllWindows : public view_listener_t bool app_quitting = false; gFloaterView->closeAllChildren(app_quitting); LLFloaterSnapshot::getInstance()->closeFloater(app_quitting); + if (gMenuHolder) gMenuHolder->hideMenus(); return true; } }; diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 762f75edd4..5cd92c9920 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -2686,7 +2686,8 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) LLSD args; args["SUBJECT"] = subj; args["MESSAGE"] = mes; - LLNotifications::instance().add(LLNotification::Params("GroupNotice").substitutions(args).payload(payload).time_stamp(LLDate(timestamp))); + LLDate notice_date = LLDate(timestamp).notNull() ? LLDate(timestamp) : LLDate::now(); + LLNotifications::instance().add(LLNotification::Params("GroupNotice").substitutions(args).payload(payload).time_stamp(notice_date)); } // Also send down the old path for now. diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 790301a3bb..382f077601 100755 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -3001,7 +3001,7 @@ void LLViewerObject::processTaskInvFile(void** user_data, S32 error_code, LLExtS BOOL LLViewerObject::loadTaskInvFile(const std::string& filename) { std::string filename_and_local_path = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, filename); - llifstream ifs(filename_and_local_path); + llifstream ifs(filename_and_local_path.c_str()); if(ifs.good()) { char buffer[MAX_STRING]; /* Flawfinder: ignore */ @@ -3374,8 +3374,17 @@ void LLViewerObject::setLinksetCost(F32 cost) { mLinksetCost = cost; mCostStale = false; - - if (isSelected()) + + BOOL needs_refresh = isSelected(); + child_list_t::iterator iter = mChildList.begin(); + while(iter != mChildList.end() && !needs_refresh) + { + LLViewerObject* child = *iter; + needs_refresh = child->isSelected(); + iter++; + } + + if (needs_refresh) { gFloaterTools->dirty(); } diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index 991f1c77a5..d9d4c34fb0 100755 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -705,7 +705,7 @@ bool LLViewerParcelMgr::allowAgentScripts(const LLViewerRegion* region, const LL bool LLViewerParcelMgr::allowAgentDamage(const LLViewerRegion* region, const LLParcel* parcel) const { return (region && region->getAllowDamage()) - || (parcel && parcel->getAllowDamage()); + && (parcel && parcel->getAllowDamage()); } BOOL LLViewerParcelMgr::isOwnedAt(const LLVector3d& pos_global) const diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index a42263ba1d..6d251dd9a4 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -2724,15 +2724,12 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames) capabilityNames.append("FlickrConnect"); capabilityNames.append("TwitterConnect"); - if (gSavedSettings.getBOOL("UseHTTPInventory")) - { - capabilityNames.append("FetchLib2"); - capabilityNames.append("FetchLibDescendents2"); - capabilityNames.append("FetchInventory2"); - capabilityNames.append("FetchInventoryDescendents2"); - capabilityNames.append("IncrementCOFVersion"); - AISCommand::getCapabilityNames(capabilityNames); - } + capabilityNames.append("FetchLib2"); + capabilityNames.append("FetchLibDescendents2"); + capabilityNames.append("FetchInventory2"); + capabilityNames.append("FetchInventoryDescendents2"); + capabilityNames.append("IncrementCOFVersion"); + AISCommand::getCapabilityNames(capabilityNames); capabilityNames.append("GetDisplayNames"); capabilityNames.append("GetMesh"); diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 023457c0c8..a957367f61 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -654,12 +654,36 @@ S8 LLViewerTexture::getType() const void LLViewerTexture::cleanup() { + notifyAboutMissingAsset(); + mFaceList[LLRender::DIFFUSE_MAP].clear(); mFaceList[LLRender::NORMAL_MAP].clear(); mFaceList[LLRender::SPECULAR_MAP].clear(); mVolumeList.clear(); } +void LLViewerTexture::notifyAboutCreatingTexture() +{ + for(U32 ch = 0; ch < LLRender::NUM_TEXTURE_CHANNELS; ++ch) + { + for(U32 f = 0; f < mNumFaces[ch]; f++) + { + mFaceList[ch][f]->notifyAboutCreatingTexture(this); + } + } +} + +void LLViewerTexture::notifyAboutMissingAsset() +{ + for(U32 ch = 0; ch < LLRender::NUM_TEXTURE_CHANNELS; ++ch) + { + for(U32 f = 0; f < mNumFaces[ch]; f++) + { + mFaceList[ch][f]->notifyAboutMissingAsset(this); + } + } +} + // virtual void LLViewerTexture::dump() { @@ -1280,7 +1304,7 @@ void LLViewerFetchedTexture::addToCreateTexture() llassert(mNumFaces[j] <= mFaceList[j].size()); for(U32 i = 0; i < mNumFaces[j]; i++) - { + { mFaceList[j][i]->dirtyTexture(); } } @@ -1430,9 +1454,11 @@ BOOL LLViewerFetchedTexture::createTexture(S32 usename/*= 0*/) destroyRawImage(); return FALSE; } - - res = mGLTexturep->createGLTexture(mRawDiscardLevel, mRawImage, usename, TRUE, mBoostLevel); - + + res = mGLTexturep->createGLTexture(mRawDiscardLevel, mRawImage, usename, TRUE, mBoostLevel); + + notifyAboutCreatingTexture(); + setActive(); if (!needsToSaveRawImage()) @@ -1440,6 +1466,7 @@ BOOL LLViewerFetchedTexture::createTexture(S32 usename/*= 0*/) mNeedsAux = FALSE; destroyRawImage(); } + return res; } @@ -2131,6 +2158,8 @@ void LLViewerFetchedTexture::setIsMissingAsset(BOOL is_missing) } if (is_missing) { + notifyAboutMissingAsset(); + if (mUrl.empty()) { LL_WARNS() << mID << ": Marking image as missing" << LL_ENDL; diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 05912404e4..aed7e94945 100755 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -169,9 +169,13 @@ public: /*virtual*/ void updateBindStatsForTester() ; protected: void cleanup() ; - void init(bool firstinit) ; + void init(bool firstinit) ; void reorganizeFaceList() ; void reorganizeVolumeList() ; + + void notifyAboutMissingAsset(); + void notifyAboutCreatingTexture(); + private: friend class LLBumpImageList; friend class LLUIImageList; @@ -307,10 +311,11 @@ public: void addToCreateTexture(); + // ONLY call from LLViewerTextureList BOOL createTexture(S32 usename = 0); - void destroyTexture() ; - + void destroyTexture() ; + virtual void processTextureStats() ; F32 calcDecodePriority() ; diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 33bf4f823e..926c40307b 100755 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -165,7 +165,7 @@ void LLViewerTextureList::doPreloadImages() static std::string get_texture_list_name() { - return std::string("texture_list_") + gSavedSettings.getString("LoginLocation") + ".xml"; + return gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "texture_list_" + gSavedSettings.getString("LoginLocation") + ".xml"); } void LLViewerTextureList::doPrefetchImages() @@ -178,13 +178,22 @@ void LLViewerTextureList::doPrefetchImages() // Pre-fetch textures from last logout LLSD imagelist; - std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, get_texture_list_name()); + std::string filename = get_texture_list_name(); llifstream file; - file.open(filename); + file.open(filename.c_str()); if (file.is_open()) { - LLSDSerialize::fromXML(imagelist, file); - } + if ( ! LLSDSerialize::fromXML(imagelist, file) ) + { + file.close(); + LL_WARNS() << "XML parse error reading texture list '" << filename << "'" << LL_ENDL; + LL_WARNS() << "Removing invalid texture list '" << filename << "'" << LL_ENDL; + LLFile::remove(filename); + return; + } + file.close(); + } + S32 texture_count = 0; for (LLSD::array_iterator iter = imagelist.beginArray(); iter != imagelist.endArray(); ++iter) { @@ -198,10 +207,12 @@ void LLViewerTextureList::doPrefetchImages() LLViewerFetchedTexture* image = LLViewerTextureManager::getFetchedTexture(uuid, FTT_DEFAULT, MIPMAP_TRUE, LLGLTexture::BOOST_NONE, texture_type); if (image) { + texture_count += 1; image->addTextureStats((F32)pixel_area); } } } + LL_DEBUGS() << "fetched " << texture_count << " images from " << filename << LL_ENDL; } /////////////////////////////////////////////////////////////////////////////// @@ -261,9 +272,10 @@ void LLViewerTextureList::shutdown() if (count > 0 && !gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "").empty()) { - std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, get_texture_list_name()); + std::string filename = get_texture_list_name(); llofstream file; - file.open(filename); + file.open(filename.c_str()); + LL_DEBUGS() << "saving " << imagelist.size() << " image list entries" << LL_ENDL; LLSDSerialize::toPrettyXML(imagelist, file); } @@ -622,7 +634,7 @@ void LLViewerTextureList::addImage(LLViewerFetchedTexture *new_image) { return; } - llassert(new_image); + //llassert(new_image); LLUUID image_id = new_image->getID(); LLViewerFetchedTexture *image = findImage(image_id); diff --git a/indra/newview/llviewertexturelist.h b/indra/newview/llviewertexturelist.h index 2f84d0947a..fbbfe9a7d4 100755 --- a/indra/newview/llviewertexturelist.h +++ b/indra/newview/llviewertexturelist.h @@ -61,8 +61,6 @@ typedef void (*LLImageCallback)(BOOL success, class LLViewerTextureList { - LOG_CLASS(LLViewerTextureList); - friend class LLTextureView; friend class LLViewerTextureManager; friend class LLLocalBitmap; @@ -206,6 +204,7 @@ private: private: static S32 sNumImages; static void (*sUUIDCallback)(void**, const LLUUID &); + LOG_CLASS(LLViewerTextureList); }; class LLUIImageList : public LLImageProviderInterface, public LLSingleton<LLUIImageList> diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 09173f0742..0f3b201c1a 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -3757,7 +3757,12 @@ BOOL LLViewerWindow::clickPointOnSurfaceGlobal(const S32 x, const S32 y, LLViewe return intersect; } -void LLViewerWindow::pickAsync(S32 x, S32 y_from_bot, MASK mask, void (*callback)(const LLPickInfo& info), BOOL pick_transparent) +void LLViewerWindow::pickAsync( S32 x, + S32 y_from_bot, + MASK mask, + void (*callback)(const LLPickInfo& info), + BOOL pick_transparent, + BOOL pick_unselectable) { BOOL in_build_mode = LLFloaterReg::instanceVisible("build"); if (in_build_mode || LLDrawPoolAlpha::sShowDebugAlpha) @@ -3767,7 +3772,7 @@ void LLViewerWindow::pickAsync(S32 x, S32 y_from_bot, MASK mask, void (*callback pick_transparent = TRUE; } - LLPickInfo pick_info(LLCoordGL(x, y_from_bot), mask, pick_transparent, FALSE, TRUE, callback); + LLPickInfo pick_info(LLCoordGL(x, y_from_bot), mask, pick_transparent, FALSE, TRUE, pick_unselectable, callback); schedulePick(pick_info); } @@ -3835,7 +3840,7 @@ LLPickInfo LLViewerWindow::pickImmediate(S32 x, S32 y_from_bot, BOOL pick_trans // shortcut queueing in mPicks and just update mLastPick in place MASK key_mask = gKeyboard->currentMask(TRUE); - mLastPick = LLPickInfo(LLCoordGL(x, y_from_bot), key_mask, pick_transparent, pick_particle, TRUE, NULL); + mLastPick = LLPickInfo(LLCoordGL(x, y_from_bot), key_mask, pick_transparent, pick_particle, TRUE, FALSE, NULL); mLastPick.fetchResults(); return mLastPick; @@ -4084,7 +4089,7 @@ BOOL LLViewerWindow::mousePointOnPlaneGlobal(LLVector3d& point, const S32 x, con // Returns global position -BOOL LLViewerWindow::mousePointOnLandGlobal(const S32 x, const S32 y, LLVector3d *land_position_global) +BOOL LLViewerWindow::mousePointOnLandGlobal(const S32 x, const S32 y, LLVector3d *land_position_global, BOOL ignore_distance) { LLVector3 mouse_direction_global = mouseDirectionGlobal(x,y); F32 mouse_dir_scale; @@ -4093,6 +4098,7 @@ BOOL LLViewerWindow::mousePointOnLandGlobal(const S32 x, const S32 y, LLVector3d F32 land_z; const F32 FIRST_PASS_STEP = 1.0f; // meters const F32 SECOND_PASS_STEP = 0.1f; // meters + const F32 draw_distance = ignore_distance ? MAX_FAR_CLIP : gAgentCamera.mDrawDistance; LLVector3d camera_pos_global; camera_pos_global = gAgentCamera.getCameraPositionGlobal(); @@ -4100,7 +4106,7 @@ BOOL LLViewerWindow::mousePointOnLandGlobal(const S32 x, const S32 y, LLVector3d LLVector3 probe_point_region; // walk forwards to find the point - for (mouse_dir_scale = FIRST_PASS_STEP; mouse_dir_scale < gAgentCamera.mDrawDistance; mouse_dir_scale += FIRST_PASS_STEP) + for (mouse_dir_scale = FIRST_PASS_STEP; mouse_dir_scale < draw_distance; mouse_dir_scale += FIRST_PASS_STEP) { LLVector3d mouse_direction_global_d; mouse_direction_global_d.setVec(mouse_direction_global * mouse_dir_scale); @@ -5247,6 +5253,7 @@ LLPickInfo::LLPickInfo(const LLCoordGL& mouse_pos, BOOL pick_transparent, BOOL pick_particle, BOOL pick_uv_coords, + BOOL pick_unselectable, void (*pick_callback)(const LLPickInfo& pick_info)) : mMousePt(mouse_pos), mKeyMask(keyboard_mask), @@ -5262,7 +5269,8 @@ LLPickInfo::LLPickInfo(const LLCoordGL& mouse_pos, mBinormal(), mHUDIcon(NULL), mPickTransparent(pick_transparent), - mPickParticle(pick_particle) + mPickParticle(pick_particle), + mPickUnselectable(pick_unselectable) { } @@ -5337,7 +5345,7 @@ void LLPickInfo::fetchResults() // put global position into land_pos LLVector3d land_pos; - if (!gViewerWindow->mousePointOnLandGlobal(mPickPt.mX, mPickPt.mY, &land_pos)) + if (!gViewerWindow->mousePointOnLandGlobal(mPickPt.mX, mPickPt.mY, &land_pos, mPickUnselectable)) { // The selected point is beyond the draw distance or is otherwise // not selectable. Return before calling mPickCallback(). diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index 5d2df2dfd7..7fde52d4e1 100755 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -91,6 +91,7 @@ public: BOOL pick_transparent, BOOL pick_particle, BOOL pick_surface_info, + BOOL pick_unselectable, void (*pick_callback)(const LLPickInfo& pick_info)); void fetchResults(); @@ -123,6 +124,7 @@ public: LLVector3 mBinormal; BOOL mPickTransparent; BOOL mPickParticle; + BOOL mPickUnselectable; void getSurfaceInfo(); private: @@ -360,7 +362,12 @@ public: void performPick(); void returnEmptyPicks(); - void pickAsync(S32 x, S32 y_from_bot, MASK mask, void (*callback)(const LLPickInfo& pick_info), BOOL pick_transparent = FALSE); + void pickAsync( S32 x, + S32 y_from_bot, + MASK mask, + void (*callback)(const LLPickInfo& pick_info), + BOOL pick_transparent = FALSE, + BOOL pick_unselectable = FALSE); LLPickInfo pickImmediate(S32 x, S32 y, BOOL pick_transparent, BOOL pick_particle = FALSE); LLHUDIcon* cursorIntersectIcon(S32 mouse_x, S32 mouse_y, F32 depth, LLVector4a* intersection); @@ -386,7 +393,7 @@ public: //const LLVector3d& lastNonFloraObjectHitOffset(); // mousePointOnLand() returns true if found point - BOOL mousePointOnLandGlobal(const S32 x, const S32 y, LLVector3d *land_pos_global); + BOOL mousePointOnLandGlobal(const S32 x, const S32 y, LLVector3d *land_pos_global, BOOL ignore_distance = FALSE); BOOL mousePointOnPlaneGlobal(LLVector3d& point, const S32 x, const S32 y, const LLVector3d &plane_point, const LLVector3 &plane_normal); LLVector3d clickPointInWorldGlobal(const S32 x, const S32 y_from_bot, LLViewerObject* clicked_object) const; BOOL clickPointOnSurfaceGlobal(const S32 x, const S32 y, LLViewerObject *objectp, LLVector3d &point_global) const; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index b3129a85cd..c3cc5a5fae 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -712,7 +712,9 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mIsEditingAppearance(FALSE), mUseLocalAppearance(FALSE), mLastUpdateRequestCOFVersion(-1), - mLastUpdateReceivedCOFVersion(-1) + mLastUpdateReceivedCOFVersion(-1), + mCachedMuteListUpdateTime(0), + mCachedInMuteList(false) { LL_DEBUGS("AvatarRender") << "LLVOAvatar Constructor (0x" << this << ") id:" << mID << LL_ENDL; @@ -3082,6 +3084,24 @@ bool LLVOAvatar::isVisuallyMuted() const return ( mVisuallyMuteSetting == ALWAYS_VISUAL_MUTE ); } +bool LLVOAvatar::isInMuteList() +{ + bool muted = false; + F64 now = LLFrameTimer::getTotalSeconds(); + if (now < mCachedMuteListUpdateTime) + { + muted = mCachedInMuteList; + } + else + { + muted = LLMuteList::getInstance()->isMuted(getID()); + + const F64 SECONDS_BETWEEN_MUTE_UPDATES = 1; + mCachedMuteListUpdateTime = now + SECONDS_BETWEEN_MUTE_UPDATES; + mCachedInMuteList = muted; + } + return muted; +} void LLVOAvatar::updateDebugText() { // clear debug text diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 48f7ea92e1..ba12cb35a7 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -385,6 +385,7 @@ public: public: U32 renderImpostor(LLColor4U color = LLColor4U(255,255,255,255), S32 diffuse_channel = 0); bool isVisuallyMuted() const; + bool isInMuteList(); void forceUpdateVisualMuteSettings(); enum VisualMuteSettings diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 32ccc75d39..33b26c8354 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -1570,8 +1570,16 @@ BOOL LLVOAvatarSelf::isTextureVisible(LLAvatarAppearanceDefines::ETextureIndex t return LLVOAvatar::isTextureVisible(type); } - U32 index = gAgentWearables.getWearableIndex(wearable); - return isTextureVisible(type,index); + U32 index; + if (gAgentWearables.getWearableIndex(wearable,index)) + { + return isTextureVisible(type,index); + } + else + { + LL_WARNS() << "Wearable not found" << LL_ENDL; + return FALSE; + } } bool LLVOAvatarSelf::areTexturesCurrent() const diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index 962cdf0268..e24884fe81 100755 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -1024,10 +1024,15 @@ void LLSpeakerVolumeStorage::load() LLSD settings_llsd; llifstream file; - file.open(filename); + file.open(filename.c_str()); if (file.is_open()) { - LLSDSerialize::fromXML(settings_llsd, file); + if (LLSDParser::PARSE_FAILURE == LLSDSerialize::fromXML(settings_llsd, file)) + { + LL_WARNS("Voice") << "failed to parse " << filename << LL_ENDL; + + } + } for (LLSD::map_const_iterator iter = settings_llsd.beginMap(); @@ -1062,7 +1067,7 @@ void LLSpeakerVolumeStorage::save() } llofstream file; - file.open(filename); + file.open(filename.c_str()); LLSDSerialize::toPrettyXML(settings_llsd, file); } } diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 18cc6d32a5..0432f6f27c 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -1740,6 +1740,8 @@ BOOL LLVOVolume::updateGeometry(LLDrawable *drawable) } } } + + genBBoxes(FALSE); } // it has its own drawable (it's moved) or it has changed UVs or it has changed xforms from global<->local else @@ -2036,21 +2038,235 @@ S32 LLVOVolume::setTEMaterialID(const U8 te, const LLMaterialID& pMaterialID) return res; } -S32 LLVOVolume::setTEMaterialParams(const U8 te, const LLMaterialPtr pMaterialParams) -{ - S32 res = 0; - - if (pMaterialParams && getTEImage(te) && 3 == getTEImage(te)->getComponents() && pMaterialParams->getDiffuseAlphaMode()) +bool LLVOVolume::notifyAboutCreatingTexture(LLViewerTexture *texture) +{ //Ok, here we have confirmation about texture creation, check our wait-list + //and make changes, or return false + + std::pair<mmap_UUID_MAP_t::iterator, mmap_UUID_MAP_t::iterator> range = mWaitingTextureInfo.equal_range(texture->getID()); + + typedef std::map<U8, LLMaterialPtr> map_te_material; + map_te_material new_material; + + for(mmap_UUID_MAP_t::iterator range_it = range.first; range_it != range.second; ++range_it) + { + LLMaterialPtr cur_material = getTEMaterialParams(range_it->second.te); + + //here we just interesting in DIFFUSE_MAP only! + if(NULL != cur_material.get() && LLRender::DIFFUSE_MAP == range_it->second.map && GL_RGBA != texture->getPrimaryFormat()) + { //ok let's check the diffuse mode + switch(cur_material->getDiffuseAlphaMode()) + { + case LLMaterial::DIFFUSE_ALPHA_MODE_BLEND: + case LLMaterial::DIFFUSE_ALPHA_MODE_EMISSIVE: + case LLMaterial::DIFFUSE_ALPHA_MODE_MASK: + { //uups... we have non 32 bit texture with LLMaterial::DIFFUSE_ALPHA_MODE_* => LLMaterial::DIFFUSE_ALPHA_MODE_NONE + + LLMaterialPtr mat = NULL; + map_te_material::iterator it = new_material.find(range_it->second.te); + if(new_material.end() == it) { + mat = new LLMaterial(cur_material->asLLSD()); + new_material.insert(map_te_material::value_type(range_it->second.te, mat)); + } else { + mat = it->second; + } + + mat->setDiffuseAlphaMode(LLMaterial::DIFFUSE_ALPHA_MODE_NONE); + + } break; + } //switch + } //if + } //for + + //setup new materials + for(map_te_material::const_iterator it = new_material.begin(), end = new_material.end(); it != end; ++it) { - LLViewerObject::setTEMaterialID(te, LLMaterialID::null); - res = LLViewerObject::setTEMaterialParams(te, NULL); + LLMaterialMgr::getInstance()->put(getID(), it->first, *it->second); + LLViewerObject::setTEMaterialParams(it->first, it->second); } - else + + //clear wait-list + mWaitingTextureInfo.erase(range.first, range.second); + + return 0 != new_material.size(); +} + +bool LLVOVolume::notifyAboutMissingAsset(LLViewerTexture *texture) +{ //Ok, here if we wait information about texture and it's missing + //then depending from the texture map (diffuse, normal, or specular) + //make changes in material and confirm it. If not return false. + std::pair<mmap_UUID_MAP_t::iterator, mmap_UUID_MAP_t::iterator> range = mWaitingTextureInfo.equal_range(texture->getID()); + if(range.first == range.second) return false; + + typedef std::map<U8, LLMaterialPtr> map_te_material; + map_te_material new_material; + + for(mmap_UUID_MAP_t::iterator range_it = range.first; range_it != range.second; ++range_it) { - res = LLViewerObject::setTEMaterialParams(te, pMaterialParams); + LLMaterialPtr cur_material = getTEMaterialParams(range_it->second.te); + + switch(range_it->second.map) + { + case LLRender::DIFFUSE_MAP: + { + if(LLMaterial::DIFFUSE_ALPHA_MODE_NONE != cur_material->getDiffuseAlphaMode()) + { //missing texture + !LLMaterial::DIFFUSE_ALPHA_MODE_NONE => LLMaterial::DIFFUSE_ALPHA_MODE_NONE + LLMaterialPtr mat = NULL; + map_te_material::iterator it = new_material.find(range_it->second.te); + if(new_material.end() == it) { + mat = new LLMaterial(cur_material->asLLSD()); + new_material.insert(map_te_material::value_type(range_it->second.te, mat)); + } else { + mat = it->second; + } + + mat->setDiffuseAlphaMode(LLMaterial::DIFFUSE_ALPHA_MODE_NONE); + } + } break; + case LLRender::NORMAL_MAP: + { //missing texture => reset material texture id + LLMaterialPtr mat = NULL; + map_te_material::iterator it = new_material.find(range_it->second.te); + if(new_material.end() == it) { + mat = new LLMaterial(cur_material->asLLSD()); + new_material.insert(map_te_material::value_type(range_it->second.te, mat)); + } else { + mat = it->second; + } + + mat->setNormalID(LLUUID::null); + } break; + case LLRender::SPECULAR_MAP: + { //missing texture => reset material texture id + LLMaterialPtr mat = NULL; + map_te_material::iterator it = new_material.find(range_it->second.te); + if(new_material.end() == it) { + mat = new LLMaterial(cur_material->asLLSD()); + new_material.insert(map_te_material::value_type(range_it->second.te, mat)); + } else { + mat = it->second; + } + + mat->setSpecularID(LLUUID::null); + } break; + case LLRender::NUM_TEXTURE_CHANNELS: + //nothing to do, make compiler happy + break; + } //switch + } //for + + //setup new materials + for(map_te_material::const_iterator it = new_material.begin(), end = new_material.end(); it != end; ++it) + { + LLMaterialMgr::getInstance()->put(getID(), it->first, *it->second); + LLViewerObject::setTEMaterialParams(it->first, it->second); + } + + //clear wait-list + mWaitingTextureInfo.erase(range.first, range.second); + + return 0 != new_material.size(); +} + +S32 LLVOVolume::setTEMaterialParams(const U8 te, const LLMaterialPtr pMaterialParams) +{ + LLMaterialPtr pMaterial = const_cast<LLMaterialPtr&>(pMaterialParams); + + if(pMaterialParams) + { //check all of them according to material settings + + LLViewerTexture *img_diffuse = getTEImage(te); + LLViewerTexture *img_normal = getTENormalMap(te); + LLViewerTexture *img_specular = getTESpecularMap(te); + + llassert(NULL != img_diffuse); + + LLMaterialPtr new_material = NULL; + + //diffuse + if(NULL != img_diffuse) + { //guard + if(0 == img_diffuse->getPrimaryFormat() && !img_diffuse->isMissingAsset()) + { //ok here we don't have information about texture, let's belief and leave material settings + //but we remember this case + mWaitingTextureInfo.insert(mmap_UUID_MAP_t::value_type(img_diffuse->getID(), material_info(LLRender::DIFFUSE_MAP, te))); + } + else + { + bool bSetDiffuseNone = false; + if(img_diffuse->isMissingAsset()) + { + bSetDiffuseNone = true; + } + else + { + switch(pMaterialParams->getDiffuseAlphaMode()) + { + case LLMaterial::DIFFUSE_ALPHA_MODE_BLEND: + case LLMaterial::DIFFUSE_ALPHA_MODE_EMISSIVE: + case LLMaterial::DIFFUSE_ALPHA_MODE_MASK: + { //all of them modes available only for 32 bit textures + if(GL_RGBA != img_diffuse->getPrimaryFormat()) + { + bSetDiffuseNone = true; + } + } break; + } + } //else + + + if(bSetDiffuseNone) + { //upps... we should substitute this material with LLMaterial::DIFFUSE_ALPHA_MODE_NONE + new_material = new LLMaterial(pMaterialParams->asLLSD()); + new_material->setDiffuseAlphaMode(LLMaterial::DIFFUSE_ALPHA_MODE_NONE); + } + } + } + + //normal + if(LLUUID::null != pMaterialParams->getNormalID()) + { + if(img_normal && img_normal->isMissingAsset() && img_normal->getID() == pMaterialParams->getNormalID()) + { + if(!new_material) { + new_material = new LLMaterial(pMaterialParams->asLLSD()); + } + new_material->setNormalID(LLUUID::null); + } + else if(NULL == img_normal || 0 == img_normal->getPrimaryFormat()) + { //ok here we don't have information about texture, let's belief and leave material settings + //but we remember this case + mWaitingTextureInfo.insert(mmap_UUID_MAP_t::value_type(pMaterialParams->getNormalID(), material_info(LLRender::NORMAL_MAP,te))); + } + + } + + + //specular + if(LLUUID::null != pMaterialParams->getSpecularID()) + { + if(img_specular && img_specular->isMissingAsset() && img_specular->getID() == pMaterialParams->getSpecularID()) + { + if(!new_material) { + new_material = new LLMaterial(pMaterialParams->asLLSD()); + } + new_material->setSpecularID(LLUUID::null); + } + else if(NULL == img_specular || 0 == img_specular->getPrimaryFormat()) + { //ok here we don't have information about texture, let's belief and leave material settings + //but we remember this case + mWaitingTextureInfo.insert(mmap_UUID_MAP_t::value_type(pMaterialParams->getSpecularID(), material_info(LLRender::SPECULAR_MAP, te))); + } + } + + if(new_material) { + pMaterial = new_material; + LLMaterialMgr::getInstance()->put(getID(),te,*pMaterial); + } } - LL_DEBUGS("MaterialTEs") << "te " << (S32)te << " material " << ((pMaterialParams) ? pMaterialParams->asLLSD() : LLSD("null")) << " res " << res + S32 res = LLViewerObject::setTEMaterialParams(te, pMaterial); + + LL_DEBUGS("MaterialTEs") << "te " << (S32)te << " material " << ((pMaterial) ? pMaterial->asLLSD() : LLSD("null")) << " res " << res << ( LLSelectMgr::getInstance()->getSelection()->contains(const_cast<LLVOVolume*>(this), te) ? " selected" : " not selected" ) << LL_ENDL; setChanged(ALL_CHANGED); @@ -4958,7 +5174,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) facep->clearVertexBuffer(); } } - + if (is_rigged) { if (!drawablep->isState(LLDrawable::RIGGED)) @@ -4974,7 +5190,6 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) { drawablep->clearState(LLDrawable::RIGGED); } - } } @@ -5449,8 +5664,8 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFac flexi = flexi || facep->getViewerObject()->getVolume()->isUnique(); } - } } + } if (flexi && buffer_usage && buffer_usage != GL_STREAM_DRAW_ARB) diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h index 7503f8c5aa..bbaca316b0 100755 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -372,17 +372,37 @@ private: // statics public: - static F32 sLODSlopDistanceFactor;// Changing this to zero, effectively disables the LOD transition slop + static F32 sLODSlopDistanceFactor;// Changing this to zero, effectively disables the LOD transition slop static F32 sLODFactor; // LOD scale factor static F32 sDistanceFactor; // LOD distance factor - + static LLPointer<LLObjectMediaDataClient> sObjectMediaClient; static LLPointer<LLObjectMediaNavigateClient> sObjectMediaNavigateClient; protected: static S32 sNumLODChanges; - + friend class LLVolumeImplFlexible; + +public: + bool notifyAboutCreatingTexture(LLViewerTexture *texture); + bool notifyAboutMissingAsset(LLViewerTexture *texture); + +private: + struct material_info + { + LLRender::eTexIndex map; + U8 te; + + material_info(LLRender::eTexIndex map_, U8 te_) + : map(map_) + , te(te_) + {} + }; + + typedef std::multimap<LLUUID, material_info> mmap_UUID_MAP_t; + mmap_UUID_MAP_t mWaitingTextureInfo; + }; #endif // LL_LLVOVOLUME_H diff --git a/indra/newview/llwaterparammanager.cpp b/indra/newview/llwaterparammanager.cpp index c854e1fc66..374792193c 100755 --- a/indra/newview/llwaterparammanager.cpp +++ b/indra/newview/llwaterparammanager.cpp @@ -150,7 +150,7 @@ void LLWaterParamManager::savePreset(const std::string & name) paramsData = mParamList[name].getAll(); // write to file - llofstream presetsXML(pathName); + llofstream presetsXML(pathName.c_str()); LLPointer<LLSDFormatter> formatter = new LLSDXMLFormatter(); formatter->format(paramsData, presetsXML, LLSDFormatter::OPTIONS_PRETTY); presetsXML.close(); diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp index fac0fd63ee..888ead0613 100755 --- a/indra/newview/llwearableitemslist.cpp +++ b/indra/newview/llwearableitemslist.cpp @@ -894,13 +894,13 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu setMenuItemVisible(menu, "wear_wear", n_already_worn == 0 && n_worn == 0 && can_be_worn); setMenuItemEnabled(menu, "wear_wear", n_already_worn == 0 && n_worn == 0); setMenuItemVisible(menu, "wear_add", wear_add_visible); - setMenuItemEnabled(menu, "wear_add", canAddWearables(ids)); + setMenuItemEnabled(menu, "wear_add", LLAppearanceMgr::instance().canAddWearables(ids)); setMenuItemVisible(menu, "wear_replace", n_worn == 0 && n_already_worn != 0 && can_be_worn); //visible only when one item selected and this item is worn setMenuItemVisible(menu, "edit", !standalone && mask & (MASK_CLOTHING|MASK_BODYPART) && n_worn == n_items && n_worn == 1); setMenuItemEnabled(menu, "edit", n_editable == 1 && n_worn == 1 && n_items == 1); setMenuItemVisible(menu, "create_new", mask & (MASK_CLOTHING|MASK_BODYPART) && n_items == 1); - setMenuItemEnabled(menu, "create_new", canAddWearables(ids)); + setMenuItemEnabled(menu, "create_new", LLAppearanceMgr::instance().canAddWearables(ids)); setMenuItemVisible(menu, "show_original", !standalone); setMenuItemEnabled(menu, "show_original", n_items == 1 && n_links == n_items); setMenuItemVisible(menu, "take_off", mask == MASK_CLOTHING && n_worn == n_items); @@ -1004,65 +1004,4 @@ void LLWearableItemsList::ContextMenu::createNewWearable(const LLUUID& item_id) LLAgentWearables::createWearable(item->getWearableType(), true); } -// Returns true if all the given objects and clothes can be added. -// static -bool LLWearableItemsList::ContextMenu::canAddWearables(const uuid_vec_t& item_ids) -{ - // TODO: investigate wearables may not be loaded at this point EXT-8231 - - U32 n_objects = 0; - boost::unordered_map<LLWearableType::EType, U32> clothes_by_type; - - // Count given clothes (by wearable type) and objects. - for (uuid_vec_t::const_iterator it = item_ids.begin(); it != item_ids.end(); ++it) - { - LLViewerInventoryItem* item = gInventory.getItem(*it); - if (!item) - { - return false; - } - - if (item->getType() == LLAssetType::AT_OBJECT) - { - ++n_objects; - } - else if (item->getType() == LLAssetType::AT_CLOTHING) - { - ++clothes_by_type[item->getWearableType()]; - } - else - { - LL_WARNS() << "Unexpected wearable type" << LL_ENDL; - return false; - } - } - - // Check whether we can add all the objects. - if (!isAgentAvatarValid() || !gAgentAvatarp->canAttachMoreObjects(n_objects)) - { - return false; - } - - // Check whether we can add all the clothes. - boost::unordered_map<LLWearableType::EType, U32>::const_iterator m_it; - for (m_it = clothes_by_type.begin(); m_it != clothes_by_type.end(); ++m_it) - { - LLWearableType::EType w_type = m_it->first; - U32 n_clothes = m_it->second; - - U32 wearable_count = gAgentWearables.getWearableCount(w_type); - if ((wearable_count > 0) && !LLWearableType::getAllowMultiwear(w_type)) - { - return false; - } - if ((wearable_count + n_clothes) > LLAgentWearables::MAX_CLOTHING_PER_TYPE) - { - return false; - } - - } - - return true; -} - // EOF diff --git a/indra/newview/llwearableitemslist.h b/indra/newview/llwearableitemslist.h index c731a7d6cf..e6788ab249 100755 --- a/indra/newview/llwearableitemslist.h +++ b/indra/newview/llwearableitemslist.h @@ -429,7 +429,6 @@ public: static void setMenuItemEnabled(LLContextMenu* menu, const std::string& name, bool val); static void updateMask(U32& mask, LLAssetType::EType at); static void createNewWearable(const LLUUID& item_id); - static bool canAddWearables(const uuid_vec_t& item_ids); LLWearableItemsList* mParent; }; diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp index 0f0d9ce703..0be6e49834 100755 --- a/indra/newview/llweb.cpp +++ b/indra/newview/llweb.cpp @@ -49,7 +49,7 @@ #include "llviewerregion.h" #include "llviewerwindow.h" #include "llnotificationsutil.h" - +#include "lluriparser.h" #include "uriparser/Uri.h" #include <boost/regex.hpp> @@ -240,19 +240,10 @@ bool LLWeb::useExternalBrowser(const std::string &url) } else if (gSavedSettings.getU32("PreferredBrowserBehavior") == BROWSER_INT_LL_EXT_OTHERS) { - UriParserStateA state; - UriUriA uri; - state.uri = &uri; - - std::string uri_string = url; - uriParseUriA(&state, uri_string.c_str()); - if (uri.hostText.first) - { - S32 length = uri.hostText.afterLast - uri.hostText.first; - std::string buf = uri.hostText.first; - uri_string = buf.substr(0,length); - } - uriFreeUriMembersA(&uri); + LLUriParser up(url); + up.normalize(); + up.extractParts(); + std::string uri_string = up.host(); boost::regex pattern = boost::regex("\\b(lindenlab.com|secondlife.com)$", boost::regex::perl|boost::regex::icase); boost::match_results<std::string::const_iterator> matches; diff --git a/indra/newview/llwldaycycle.cpp b/indra/newview/llwldaycycle.cpp index e9b0baf612..88079c5d26 100755 --- a/indra/newview/llwldaycycle.cpp +++ b/indra/newview/llwldaycycle.cpp @@ -109,7 +109,7 @@ LLSD LLWLDayCycle::loadDayCycleFromPath(const std::string& file_path) { LL_INFOS("Windlight") << "Loading DayCycle settings from " << file_path << LL_ENDL; - llifstream day_cycle_xml(file_path); + llifstream day_cycle_xml(file_path.c_str()); if (day_cycle_xml.is_open()) { // load and parse it @@ -137,7 +137,7 @@ void LLWLDayCycle::save(const std::string& file_path) { LLSD day_data = asLLSD(); - llofstream day_cycle_xml(file_path); + llofstream day_cycle_xml(file_path.c_str()); LLPointer<LLSDFormatter> formatter = new LLSDXMLFormatter(); formatter->format(day_data, day_cycle_xml, LLSDFormatter::OPTIONS_PRETTY); day_cycle_xml.close(); diff --git a/indra/newview/llwlparammanager.cpp b/indra/newview/llwlparammanager.cpp index 91ea10d43d..2b6d88efef 100755 --- a/indra/newview/llwlparammanager.cpp +++ b/indra/newview/llwlparammanager.cpp @@ -334,7 +334,7 @@ void LLWLParamManager::savePreset(LLWLParamKey key) paramsData = mParamList[key].getAll(); // write to file - llofstream presetsXML(pathName); + llofstream presetsXML(pathName.c_str()); LLPointer<LLSDFormatter> formatter = new LLSDXMLFormatter(); formatter->format(paramsData, presetsXML, LLSDFormatter::OPTIONS_PRETTY); presetsXML.close(); diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index 74fb1ec78e..5d657f7eef 100755 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -795,9 +795,12 @@ void LLWorld::updateNetStats() add(LLStatViewer::PACKETS_IN, packets_in); add(LLStatViewer::PACKETS_OUT, packets_out); add(LLStatViewer::PACKETS_LOST, packets_lost); - if (packets_in) + + F32 total_packets_in = LLViewerStats::instance().getRecording().getSum(LLStatViewer::PACKETS_IN); + if (total_packets_in > 0) { - sample(LLStatViewer::PACKETS_LOST_PERCENT, LLUnits::Ratio::fromValue((F32)packets_lost/(F32)packets_in)); + F32 total_packets_lost = LLViewerStats::instance().getRecording().getSum(LLStatViewer::PACKETS_LOST); + sample(LLStatViewer::PACKETS_LOST_PERCENT, LLUnits::Ratio::fromValue((F32)total_packets_lost/(F32)total_packets_in)); } mLastPacketsIn = gMessageSystem->mPacketsIn; diff --git a/indra/newview/skins/default/xui/da/menu_viewer.xml b/indra/newview/skins/default/xui/da/menu_viewer.xml index f2ed7c2e64..aa6bc53672 100755 --- a/indra/newview/skins/default/xui/da/menu_viewer.xml +++ b/indra/newview/skins/default/xui/da/menu_viewer.xml @@ -128,6 +128,7 @@ <menu_item_check label="Aktiver tips" name="Enable Hints"/> <menu_item_call label="Rapporter misbrug" name="Report Abuse"/> <menu_item_call label="Rapportér fejl" name="Report Bug"/> + <menu_item_call label="Stød, skub & slag" name="Bumps, Pushes &amp; Hits"/> <menu_item_call label="Om [APP_NAME]" name="About Second Life"/> </menu> <menu label="Avanceret" name="Advanced"> @@ -261,8 +262,7 @@ <menu label="Netværk" name="Network"> <menu_item_check label="Pause avatar" name="AgentPause"/> <menu_item_call label="Mist en netværkspakke" name="Drop a Packet"/> - </menu> - <menu_item_call label="Stød, skub & slag" name="Bumps, Pushes &amp; Hits"/> + </menu> <menu label="Verden" name="DevelopWorld"> <menu_item_check label="Vælg anden sol end region" name="Sim Sun Override"/> <menu_item_check label="Fast vejr" name="Fixed Weather"/> diff --git a/indra/newview/skins/default/xui/de/menu_viewer.xml b/indra/newview/skins/default/xui/de/menu_viewer.xml index c9fad9c9d3..50a6dafa91 100755 --- a/indra/newview/skins/default/xui/de/menu_viewer.xml +++ b/indra/newview/skins/default/xui/de/menu_viewer.xml @@ -176,6 +176,7 @@ <menu_item_call label="[SECOND_LIFE]-Blogs" name="Second Life Blogs"/> <menu_item_call label="Missbrauch melden" name="Report Abuse"/> <menu_item_call label="Fehler melden" name="Report Bug"/> + <menu_item_call label="Rempler, Stöße & Schläge" name="Bumps, Pushes &amp; Hits"/> <menu_item_call label="INFO ÜBER [APP_NAME]" name="About Second Life"/> </menu> <menu label="Erweitert" name="Advanced"> @@ -352,8 +353,7 @@ <menu_item_check label="Positionen der interpolierten Objekte anfragen" name="Ping Interpolate Object Positions"/> <menu_item_call label="Ein Paket fallenlassen" name="Drop a Packet"/> </menu> - <menu_item_call label="Geskriptete Kamera ausgeben" name="Dump Scripted Camera"/> - <menu_item_call label="Rempler, Stöße & Schläge" name="Bumps, Pushes &amp; Hits"/> + <menu_item_call label="Geskriptete Kamera ausgeben" name="Dump Scripted Camera"/> <menu label="Rekorder" name="Recorder"> <menu_item_call label="Wiedergabe starten" name="Start Playback"/> <menu_item_call label="Wiedergabe stoppen" name="Stop Playback"/> diff --git a/indra/newview/skins/default/xui/en/floater_inventory_item_properties.xml b/indra/newview/skins/default/xui/en/floater_inventory_item_properties.xml index adef066aef..6667238232 100755 --- a/indra/newview/skins/default/xui/en/floater_inventory_item_properties.xml +++ b/indra/newview/skins/default/xui/en/floater_inventory_item_properties.xml @@ -304,16 +304,20 @@ left_pad="5" layout="topleft" follows="left|top" - name="combobox sale copy" + name="ComboBoxSaleType" width="110"> - <combo_box.item - label="Copy" + <combo_box.item name="Copy" - value="Copy" /> - <combo_box.item - label="Original" + label="Copy" + value="2" /> + <combo_box.item + name="Contents" + label="Contents" + value="3" /> + <combo_box.item name="Original" - value="Original" /> + label="Original" + value="1" /> </combo_box> <spinner follows="left|top" @@ -427,34 +431,6 @@ Mark Item: </text--> - - <!--radio_group - draw_border="false" - follows="left|top|right" - height="16" - layout="topleft" - left_delta="78" - name="RadioSaleType" - top_delta="0" - width="252"> - <radio_item - height="16" - label="Original" - layout="topleft" - left="0" - name="radio" - top="0" - width="70" /> - <radio_item - height="16" - label="Copy" - layout="topleft" - left_delta="60" - name="radio2" - top_delta="0" - width="70" /> - </radio_group--> - <!--text type="string" length="1" diff --git a/indra/newview/skins/default/xui/en/floater_preview_gesture.xml b/indra/newview/skins/default/xui/en/floater_preview_gesture.xml index 8baa0a56f7..c4ac936334 100755 --- a/indra/newview/skins/default/xui/en/floater_preview_gesture.xml +++ b/indra/newview/skins/default/xui/en/floater_preview_gesture.xml @@ -2,10 +2,12 @@ <floater legacy_header_height="18" height="460" + min_height="460" layout="topleft" name="gesture_preview" help_topic="gesture_preview" - width="280"> + width="280" + min_width="280"> <floater.string name="step_anim"> Animation to play: diff --git a/indra/newview/skins/default/xui/en/floater_stats.xml b/indra/newview/skins/default/xui/en/floater_stats.xml index 2aa582beea..90f9591f29 100755 --- a/indra/newview/skins/default/xui/en/floater_stats.xml +++ b/indra/newview/skins/default/xui/en/floater_stats.xml @@ -41,6 +41,7 @@ show_bar="true"/> <stat_bar name="packet_loss" label="Packet Loss" + decimal_digits="1" stat="packetslostpercentstat"/> <stat_bar name="ping" label="Ping Sim" diff --git a/indra/newview/skins/default/xui/en/menu_avatar_other.xml b/indra/newview/skins/default/xui/en/menu_avatar_other.xml index 8bd013f14b..cfbbe41f95 100755 --- a/indra/newview/skins/default/xui/en/menu_avatar_other.xml +++ b/indra/newview/skins/default/xui/en/menu_avatar_other.xml @@ -96,14 +96,11 @@ function="Tools.LookAtSelection" parameter="zoom" /> </menu_item_call> - <menu_item_call - enabled="false" + <menu_item_call label="Pay" name="Pay..."> <menu_item_call.on_click - function="PayObject" /> - <menu_item_call.on_enable - function="EnablePayAvatar" /> + function="PayObject" /> </menu_item_call> <menu_item_separator /> diff --git a/indra/newview/skins/default/xui/en/menu_object.xml b/indra/newview/skins/default/xui/en/menu_object.xml index 5c98a98d3d..dc9622a27d 100755 --- a/indra/newview/skins/default/xui/en/menu_object.xml +++ b/indra/newview/skins/default/xui/en/menu_object.xml @@ -78,7 +78,7 @@ <menu_item_call.on_enable function="EnableSelectInPathfindingLinksets"/> <menu_item_call.on_visible - function="EnableSelectInPathfindingLinksets"/> + function="VisibleSelectInPathfindingLinksets"/> </menu_item_call> <menu_item_call label="Show in characters" diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 448d3f2ebe..2f2723d69c 100755 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -1417,7 +1417,14 @@ </menu_item_call> <menu_item_separator/> - + <menu_item_call + label="Bumps, Pushes & Hits" + name="Bumps, Pushes &amp; Hits"> + <menu_item_call.on_click + function="Floater.Show" + parameter="bumps" /> + </menu_item_call> + <menu_item_separator/> <menu_item_call label="About [APP_NAME]" name="About Second Life"> @@ -3011,15 +3018,7 @@ name="Dump Scripted Camera"> <menu_item_call.on_click function="Advanced.DumpScriptedCamera" /> - </menu_item_call> - <menu_item_call - label="Bumps, Pushes & Hits" - name="Bumps, Pushes &amp; Hits"> - <menu_item_call.on_click - function="Floater.Show" - parameter="bumps" /> - </menu_item_call> - + </menu_item_call> <menu create_jump_keys="true" label="Recorder" @@ -3571,16 +3570,6 @@ function="ToggleControl" parameter="ImagePipelineUseHTTP" /> </menu_item_check> - <menu_item_check - label="HTTP Inventory" - name="HTTP Inventory"> - <menu_item_check.on_check - function="CheckControl" - parameter="UseHTTPInventory" /> - <menu_item_check.on_click - function="ToggleControl" - parameter="UseHTTPInventory" /> - </menu_item_check> <menu_item_call label="Compress Images" name="Compress Images"> diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 82bd29499d..e354027fb5 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -1197,6 +1197,18 @@ Save Changes? <notification icon="alertmodal.tga" + name="DeleteNotecard" + type="alertmodal"> +Delete Notecard? + <tag>confirm</tag> + <usetemplate + name="okcancelbuttons" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" name="GestureSaveFailedTooManySteps" type="alertmodal"> Gesture save failed. @@ -5265,6 +5277,17 @@ Warning: The 'Pay object' click action has been set, but it will only <notification icon="alertmodal.tga" + name="PayObjectFailed" + type="alertmodal"> + Payment failed: object was not found. + <tag>fail</tag> + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" name="OpenObjectCannotCopy" type="alertmodal"> There are no items in this object that you are allowed to copy. @@ -10412,7 +10435,7 @@ Cannot create large prims that intersect other players. Please re-try when othe icon="alertmodal.tga" name="DefaultObjectPermissions" type="alert"> - There was a problem saving the default permissions due to the following reason: [REASON]. Please try setting the default permissions later. + There was a problem saving the default object permissions: [REASON]. Please try setting the default permissions later. <tag>fail</tag> <usetemplate name="okbutton" diff --git a/indra/newview/skins/default/xui/en/panel_login_first.xml b/indra/newview/skins/default/xui/en/panel_login_first.xml index 84753c55a3..d1416ece82 100644 --- a/indra/newview/skins/default/xui/en/panel_login_first.xml +++ b/indra/newview/skins/default/xui/en/panel_login_first.xml @@ -102,7 +102,7 @@ allow_text_entry="true" follows="left|bottom" height="32" - left="0" + left="2" label="Username" combo_editor.font="SansSerifLarge" max_chars="128" @@ -163,7 +163,7 @@ text_color="EmphasisColor" height="16" name="forgot_password_text" - left="216" + left="219" top="34" width="200"> Forgotten password diff --git a/indra/newview/skins/default/xui/en/panel_teleport_history_item.xml b/indra/newview/skins/default/xui/en/panel_teleport_history_item.xml index 26cac06648..5c728718ef 100755 --- a/indra/newview/skins/default/xui/en/panel_teleport_history_item.xml +++ b/indra/newview/skins/default/xui/en/panel_teleport_history_item.xml @@ -60,7 +60,7 @@ text_color="White" top="4" value="..." - width="45" /> + width="49" /> <button follows="right" height="20" diff --git a/indra/newview/skins/default/xui/en/sidepanel_item_info.xml b/indra/newview/skins/default/xui/en/sidepanel_item_info.xml index c5dfb703e5..9be01c5d4f 100755 --- a/indra/newview/skins/default/xui/en/sidepanel_item_info.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_item_info.xml @@ -395,16 +395,20 @@ left_pad="0" layout="topleft" follows="left|top" - name="combobox sale copy" + name="ComboBoxSaleType" width="170"> - <combo_box.item - label="Copy" - name="Copy" - value="Copy" /> - <combo_box.item - label="Original" - name="Original" - value="Original" /> + <combo_box.item + name="Copy" + label="Copy" + value="2" /> + <combo_box.item + name="Contents" + label="Contents" + value="3" /> + <combo_box.item + name="Original" + label="Original" + value="1" /> </combo_box> <spinner follows="left|top" diff --git a/indra/newview/skins/default/xui/en/sidepanel_task_info.xml b/indra/newview/skins/default/xui/en/sidepanel_task_info.xml index 6ee8fc3a4c..b84dce222f 100755 --- a/indra/newview/skins/default/xui/en/sidepanel_task_info.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_task_info.xml @@ -48,7 +48,7 @@ </panel.string> <panel.string name="Cost Total"> - Total Price: L$ + Sum Price: L$ </panel.string> <panel.string name="Cost Per Unit"> @@ -444,7 +444,7 @@ control_name="Edit Cost" name="Edit Cost" label="Price: L$" - label_width="65" + label_width="73" width="150" min_val="1" height="20" diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 51747eb0be..0b605fc3be 100755 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -2513,6 +2513,7 @@ The [[MARKETPLACE_CREATE_STORE_URL] Marketplace store] is returning errors. <string name="CompileSuccessful">Compile successful!</string> <string name="CompileSuccessfulSaving">Compile successful, saving...</string> <string name="SaveComplete">Save complete.</string> + <string name="UploadFailed">File upload failed: </string> <string name="ObjectOutOfRange">Script (object out of range)</string> <!-- god tools --> diff --git a/indra/newview/skins/default/xui/es/menu_viewer.xml b/indra/newview/skins/default/xui/es/menu_viewer.xml index d2117f08b6..9596a8277e 100755 --- a/indra/newview/skins/default/xui/es/menu_viewer.xml +++ b/indra/newview/skins/default/xui/es/menu_viewer.xml @@ -175,6 +175,7 @@ <menu_item_call label="Blogs de [SECOND_LIFE]" name="Second Life Blogs"/> <menu_item_call label="Denunciar una infracción" name="Report Abuse"/> <menu_item_call label="Informar de un fallo" name="Report Bug"/> + <menu_item_call label="Bumps, Pushes & Hits" name="Bumps, Pushes &amp; Hits"/> <menu_item_call label="Acerca de [APP_NAME]" name="About Second Life"/> </menu> <menu label="Avanzado" name="Advanced"> @@ -322,8 +323,7 @@ <menu label="Red" name="Network"> <menu_item_check label="Pause Avatar" name="AgentPause"/> <menu_item_call label="Drop a Packet" name="Drop a Packet"/> - </menu> - <menu_item_call label="Bumps, Pushes & Hits" name="Bumps, Pushes &amp; Hits"/> + </menu> <menu label="Mundo virtual" name="DevelopWorld"> <menu_item_check label="Anular el sol del Sim" name="Sim Sun Override"/> <menu_item_check label="Meteorología fija" name="Fixed Weather"/> diff --git a/indra/newview/skins/default/xui/es/panel_region_debug.xml b/indra/newview/skins/default/xui/es/panel_region_debug.xml index f6676967f5..2a98fb808d 100755 --- a/indra/newview/skins/default/xui/es/panel_region_debug.xml +++ b/indra/newview/skins/default/xui/es/panel_region_debug.xml @@ -27,9 +27,9 @@ <check_box label="En el terreno de otros" name="return_other_land" tool_tip="Devolver sólo los objetos que están en terreno de otro"/> <check_box label="En cada región de este estado" name="return_estate_wide" tool_tip="Devolver los objetos de todas las regiones que forman este estado"/> <button label="Devolver" name="return_btn"/> - <button label="Listar los objetos que colisionan..." name="top_colliders_btn" tool_tip="Lista de los objetos con más posibles colisiones potenciales" width="280"/> - <button label="Reiniciar la región" name="restart_btn" tool_tip="Cuenta atrás de 2 minutos y reiniciar la región"/> - <button label="Listar los scripts según su uso..." name="top_scripts_btn" tool_tip="Lista de los objetos que más tiempo emplean ejecutando scripts" width="280"/> - <button label="Cancelar reinicio" name="cancel_restart_btn" tool_tip="Cancelar el reinicio de región"/> - <button label="Consola de depuración de región" name="region_debug_console_btn" tool_tip="Abrir consola de depuración de región"/> + <button label="Listar los objetos que colisionan..." name="top_colliders_btn" tool_tip="Lista de los objetos con más posibles colisiones potenciales" width="240"/> + <button label="Reiniciar la región" name="restart_btn" tool_tip="Cuenta atrás de 2 minutos y reiniciar la región" left_pad="90" width="160"/> + <button label="Listar los scripts según su uso..." name="top_scripts_btn" tool_tip="Lista de los objetos que más tiempo emplean ejecutando scripts" width="240"/> + <button label="Cancelar reinicio" name="cancel_restart_btn" tool_tip="Cancelar el reinicio de región" left_pad="90" width="160"/> + <button label="Consola de depuración de región" name="region_debug_console_btn" tool_tip="Abrir consola de depuración de región" width="240"/> </panel> diff --git a/indra/newview/skins/default/xui/fr/menu_viewer.xml b/indra/newview/skins/default/xui/fr/menu_viewer.xml index 6e36d19ba9..2c30fe07b4 100755 --- a/indra/newview/skins/default/xui/fr/menu_viewer.xml +++ b/indra/newview/skins/default/xui/fr/menu_viewer.xml @@ -176,6 +176,7 @@ <menu_item_call label="Blogs [SECOND_LIFE]" name="Second Life Blogs"/> <menu_item_call label="Signaler une infraction" name="Report Abuse"/> <menu_item_call label="Signaler un bug" name="Report Bug"/> + <menu_item_call label="Collisions, coups et bousculades" name="Bumps, Pushes &amp; Hits"/> <menu_item_call label="À propos de [APP_NAME]" name="About Second Life"/> </menu> <menu label="Avancé" name="Advanced"> @@ -352,8 +353,7 @@ <menu_item_check label="Interpolation ping des positions des objets" name="Ping Interpolate Object Positions"/> <menu_item_call label="Abandonner un paquet" name="Drop a Packet"/> </menu> - <menu_item_call label="Dump caméra scriptée" name="Dump Scripted Camera"/> - <menu_item_call label="Collisions, coups et bousculades" name="Bumps, Pushes &amp; Hits"/> + <menu_item_call label="Dump caméra scriptée" name="Dump Scripted Camera"/> <menu label="Enregistreur" name="Recorder"> <menu_item_call label="Commencer la lecture" name="Start Playback"/> <menu_item_call label="Arrêter la lecture" name="Stop Playback"/> diff --git a/indra/newview/skins/default/xui/fr/panel_region_debug.xml b/indra/newview/skins/default/xui/fr/panel_region_debug.xml index d21695e9aa..461ada3108 100755 --- a/indra/newview/skins/default/xui/fr/panel_region_debug.xml +++ b/indra/newview/skins/default/xui/fr/panel_region_debug.xml @@ -27,9 +27,9 @@ <check_box label="Sur le terrain d'un autre résident" name="return_other_land" tool_tip="Ne renvoyer que les objets se trouvant sur le terrain de quelqu'un d'autre"/> <check_box label="Dans toutes les régions de ce domaine" name="return_estate_wide" tool_tip="Renvoyer les objets dans toutes les régions qui constituent ce domaine"/> <button label="Renvoyer" name="return_btn"/> - <button label="Collisions les plus consommatrices" name="top_colliders_btn" tool_tip="Liste des objets avec le plus de collisions potentielles" width="320"/> - <button label="Redémarrer la région" name="restart_btn" tool_tip="Redémarrer la région au bout de 2 minutes" width="160"/> - <button label="Scripts les plus consommateurs" name="top_scripts_btn" tool_tip="Liste des objets passant le plus de temps à exécuter des scripts" width="320"/> - <button label="Annuler le redémarrage" name="cancel_restart_btn" tool_tip="Annuler le redémarrage de la région." width="160"/> - <button label="Console de débogage de région" name="region_debug_console_btn" tool_tip="Ouvrir la console de débogage de région"/> + <button label="Collisions les plus consommatrices" name="top_colliders_btn" tool_tip="Liste des objets avec le plus de collisions potentielles" width="240"/> + <button label="Redémarrer la région" name="restart_btn" tool_tip="Redémarrer la région au bout de 2 minutes" left_pad="90" width="160"/> + <button label="Scripts les plus consommateurs" name="top_scripts_btn" tool_tip="Liste des objets passant le plus de temps à exécuter des scripts" width="240"/> + <button label="Annuler le redémarrage" name="cancel_restart_btn" tool_tip="Annuler le redémarrage de la région." left_pad="90" width="160"/> + <button label="Console de débogage de région" name="region_debug_console_btn" tool_tip="Ouvrir la console de débogage de région" width="240"/> </panel> diff --git a/indra/newview/skins/default/xui/it/menu_viewer.xml b/indra/newview/skins/default/xui/it/menu_viewer.xml index f535a53e66..d25e11e7a4 100755 --- a/indra/newview/skins/default/xui/it/menu_viewer.xml +++ b/indra/newview/skins/default/xui/it/menu_viewer.xml @@ -176,6 +176,7 @@ <menu_item_call label="[SECOND_LIFE] Blog" name="Second Life Blogs"/> <menu_item_call label="Segnala abuso" name="Report Abuse"/> <menu_item_call label="Segnala bug" name="Report Bug"/> + <menu_item_call label="Urti, spinte e contatti" name="Bumps, Pushes &amp; Hits"/> <menu_item_call label="Informazioni su [APP_NAME]" name="About Second Life"/> </menu> <menu label="Avanzate" name="Advanced"> @@ -323,8 +324,7 @@ <menu label="Rete" name="Network"> <menu_item_check label="Metti in pausa" name="AgentPause"/> <menu_item_call label="Lascia un pacchetto" name="Drop a Packet"/> - </menu> - <menu_item_call label="Urti, spinte e contatti" name="Bumps, Pushes &amp; Hits"/> + </menu> <menu label="Mondo" name="DevelopWorld"> <menu_item_check label="Esclusione al sole della simulazione" name="Sim Sun Override"/> <menu_item_check label="Clima fisso" name="Fixed Weather"/> diff --git a/indra/newview/skins/default/xui/it/panel_region_debug.xml b/indra/newview/skins/default/xui/it/panel_region_debug.xml index 88c056bf5e..ca39cf6d05 100755 --- a/indra/newview/skins/default/xui/it/panel_region_debug.xml +++ b/indra/newview/skins/default/xui/it/panel_region_debug.xml @@ -27,9 +27,9 @@ <check_box label="Sul terreno di un altro residente" name="return_other_land" tool_tip="Restituisci solo gli oggetti che sono in terreni appartenenti a qualcun altro"/> <check_box label="In tutte le regioni di questa proprietà" name="return_estate_wide" tool_tip="Restituisci tutti gli oggetti nelle varie regioni che costituiscono l'insieme dei possedimenti terrieri"/> <button label="Restituisci" name="return_btn"/> - <button label="Visualizza l'elenco dei maggiori collidenti..." name="top_colliders_btn" tool_tip="Elenco degli oggetti che stanno potenzialmente subendo le maggiori collisioni" width="280"/> - <button label="Riavvia la regione" name="restart_btn" tool_tip="Dai 2 minuti di tempo massimo e fai riavviare la regione"/> - <button label="Visualizza l'elenco degli script più pesanti..." name="top_scripts_btn" tool_tip="Elenco degli oggetti che impiegano più tempo a far girare gli script" width="280"/> - <button label="Annulla riavvio" name="cancel_restart_btn" tool_tip="Annulla riavvio regione"/> - <button label="Console di debug regione" name="region_debug_console_btn" tool_tip="Apri console di debug regione"/> + <button label="Visualizza l'elenco dei maggiori collidenti..." name="top_colliders_btn" tool_tip="Elenco degli oggetti che stanno potenzialmente subendo le maggiori collisioni" width="270"/> + <button label="Riavvia la regione" name="restart_btn" tool_tip="Dai 2 minuti di tempo massimo e fai riavviare la regione" left_pad="90" width="140"/> + <button label="Visualizza l'elenco degli script più pesanti..." name="top_scripts_btn" tool_tip="Elenco degli oggetti che impiegano più tempo a far girare gli script" width="270"/> + <button label="Annulla riavvio" name="cancel_restart_btn" tool_tip="Annulla riavvio regione" left_pad="90" width="140"/> + <button label="Console di debug regione" name="region_debug_console_btn" tool_tip="Apri console di debug regione" width="270"/> </panel> diff --git a/indra/newview/skins/default/xui/ja/menu_viewer.xml b/indra/newview/skins/default/xui/ja/menu_viewer.xml index 4e6c6808c6..0b85c693f0 100755 --- a/indra/newview/skins/default/xui/ja/menu_viewer.xml +++ b/indra/newview/skins/default/xui/ja/menu_viewer.xml @@ -176,6 +176,7 @@ <menu_item_call label="[SECOND_LIFE] ブログ" name="Second Life Blogs"/> <menu_item_call label="嫌がらせを報告する" name="Report Abuse"/> <menu_item_call label="バグを報告する" name="Report Bug"/> + <menu_item_call label="衝突・プッシュ・打撃" name="Bumps, Pushes &amp; Hits"/> <menu_item_call label="[APP_NAME] について" name="About Second Life"/> </menu> <menu label="アドバンス" name="Advanced"> @@ -352,8 +353,7 @@ <menu_item_check label="挿入されたオブジェクトの位置の Ping" name="Ping Interpolate Object Positions"/> <menu_item_call label="パケットドロップ" name="Drop a Packet"/> </menu> - <menu_item_call label="スクリプト付きカメラをダンプ" name="Dump Scripted Camera"/> - <menu_item_call label="衝突・プッシュ・打撃" name="Bumps, Pushes &amp; Hits"/> + <menu_item_call label="スクリプト付きカメラをダンプ" name="Dump Scripted Camera"/> <menu label="レコーダー" name="Recorder"> <menu_item_call label="再生開始" name="Start Playback"/> <menu_item_call label="再生停止" name="Stop Playback"/> diff --git a/indra/newview/skins/default/xui/pl/menu_viewer.xml b/indra/newview/skins/default/xui/pl/menu_viewer.xml index e1725fc308..a354cca9ad 100755 --- a/indra/newview/skins/default/xui/pl/menu_viewer.xml +++ b/indra/newview/skins/default/xui/pl/menu_viewer.xml @@ -126,6 +126,7 @@ <menu_item_check label="Włącz podpowiedzi" name="Enable Hints"/> <menu_item_call label="Złóż Raport o Nadużyciu" name="Report Abuse"/> <menu_item_call label="Zgłoś błędy klienta" name="Report Bug"/> + <menu_item_call label="Zderzenia, popchnięcia & uderzenia" name="Bumps, Pushes &amp; Hits"/> <menu_item_call label="O [APP_NAME]" name="About Second Life"/> </menu> <menu label="Zaawansowane" name="Advanced"> @@ -252,8 +253,7 @@ <menu label="Sieć" name="Network"> <menu_item_check label="Zatrzymaj awatara" name="AgentPause"/> <menu_item_call label="Upuść pakiet pamięci" name="Drop a Packet"/> - </menu> - <menu_item_call label="Zderzenia, popchnięcia & uderzenia" name="Bumps, Pushes &amp; Hits"/> + </menu> <menu label="Świat" name="DevelopWorld"> <menu_item_check label="Domyślne ustawienia środowiska Regionu" name="Sim Sun Override"/> <menu_item_check label="Ustalona pogoda" name="Fixed Weather"/> diff --git a/indra/newview/skins/default/xui/pt/menu_viewer.xml b/indra/newview/skins/default/xui/pt/menu_viewer.xml index a761cfa177..0bbb9683a0 100755 --- a/indra/newview/skins/default/xui/pt/menu_viewer.xml +++ b/indra/newview/skins/default/xui/pt/menu_viewer.xml @@ -176,6 +176,7 @@ <menu_item_call label="Blogs do [SECOND_LIFE]" name="Second Life Blogs"/> <menu_item_call label="Denunciar abuso" name="Report Abuse"/> <menu_item_call label="Relatar bug" name="Report Bug"/> + <menu_item_call label="Empurrões, trombadas e tapas" name="Bumps, Pushes &amp; Hits"/> <menu_item_call label="Sobre [APP_NAME]" name="About Second Life"/> </menu> <menu label="Avançado" name="Advanced"> @@ -323,8 +324,7 @@ <menu label="Rede" name="Network"> <menu_item_check label="Pausar avatar" name="AgentPause"/> <menu_item_call label="Drop a Packet" name="Drop a Packet"/> - </menu> - <menu_item_call label="Empurrões, trombadas e tapas" name="Bumps, Pushes &amp; Hits"/> + </menu> <menu label="Mundo" name="DevelopWorld"> <menu_item_check label="Impor sobre sol de simulação" name="Sim Sun Override"/> <menu_item_check label="Clima fixo" name="Fixed Weather"/> diff --git a/indra/newview/skins/default/xui/pt/panel_region_debug.xml b/indra/newview/skins/default/xui/pt/panel_region_debug.xml index 9070563fd0..2647c7a1e2 100755 --- a/indra/newview/skins/default/xui/pt/panel_region_debug.xml +++ b/indra/newview/skins/default/xui/pt/panel_region_debug.xml @@ -27,9 +27,9 @@ <check_box label="No terreno de outra pessoa" name="return_other_land" tool_tip="Devolver apenas objetos que estejam em terrenos de outra pessoa"/> <check_box label="Em todas as regiões desta propriedade" name="return_estate_wide" tool_tip="Devolver objetos em todas as regiões que constituem esta propriedade"/> <button label="Devolver" name="return_btn"/> - <button label="Principais colidentes..." name="top_colliders_btn" tool_tip="Lista dos objetos com maior potencial de colisão" width="280"/> - <button label="Reiniciar a região" name="restart_btn" tool_tip="Após 2 minutos de contagem regressiva, reiniciar a região"/> - <button label="Principais scripts..." name="top_scripts_btn" tool_tip="Lista de objetos que mais passam tempo executando scripts" width="280"/> - <button label="Cancelar reinício" name="cancel_restart_btn" tool_tip="Cancelar reinício da região"/> - <button label="Console de depuração de região" name="region_debug_console_btn" tool_tip="Abrir console de depuração de região"/> + <button label="Principais colidentes..." name="top_colliders_btn" tool_tip="Lista dos objetos com maior potencial de colisão" width="240"/> + <button label="Reiniciar a região" name="restart_btn" tool_tip="Após 2 minutos de contagem regressiva, reiniciar a região" left_pad="90" width="160"/> + <button label="Principais scripts..." name="top_scripts_btn" tool_tip="Lista de objetos que mais passam tempo executando scripts" width="240"/> + <button label="Cancelar reinício" name="cancel_restart_btn" tool_tip="Cancelar reinício da região" left_pad="90" width="160"/> + <button label="Console de depuração de região" name="region_debug_console_btn" tool_tip="Abrir console de depuração de região" width="240"/> </panel> diff --git a/indra/newview/skins/default/xui/ru/menu_viewer.xml b/indra/newview/skins/default/xui/ru/menu_viewer.xml index 26e3d37918..266a1fb877 100755 --- a/indra/newview/skins/default/xui/ru/menu_viewer.xml +++ b/indra/newview/skins/default/xui/ru/menu_viewer.xml @@ -173,6 +173,7 @@ <menu_item_call label="Блоги [SECOND_LIFE]" name="Second Life Blogs"/> <menu_item_call label="Жалоба" name="Report Abuse"/> <menu_item_call label="Сообщить об ошибке" name="Report Bug"/> + <menu_item_call label="Столкновения, толчки и удары" name="Bumps, Pushes &amp; Hits"/> <menu_item_call label="О [APP_NAME]" name="About Second Life"/> </menu> <menu label="Дополнительно" name="Advanced"> @@ -349,8 +350,7 @@ <menu_item_check label="Прикрепить объекты для интерполяции" name="Ping Interpolate Object Positions"/> <menu_item_call label="Опустить пакет" name="Drop a Packet"/> </menu> - <menu_item_call label="Дамп камеры со скриптами" name="Dump Scripted Camera"/> - <menu_item_call label="Столкновения, толчки и удары" name="Bumps, Pushes &amp; Hits"/> + <menu_item_call label="Дамп камеры со скриптами" name="Dump Scripted Camera"/> <menu label="Диктофон" name="Recorder"> <menu_item_call label="Начать воспроизведение" name="Start Playback"/> <menu_item_call label="Остановить воспроизведение" name="Stop Playback"/> diff --git a/indra/newview/skins/default/xui/ru/panel_region_debug.xml b/indra/newview/skins/default/xui/ru/panel_region_debug.xml index d294a9e22e..3eaa0b19e0 100755 --- a/indra/newview/skins/default/xui/ru/panel_region_debug.xml +++ b/indra/newview/skins/default/xui/ru/panel_region_debug.xml @@ -27,9 +27,9 @@ <check_box label="На чужой земле" name="return_other_land" tool_tip="Возвращаются только объекты, расположенные на чужой земле"/> <check_box label="С каждого региона этого землевладения" name="return_estate_wide" tool_tip="Возвращаются объекты со всех регионов, образующих это землевладение"/> <button label="Возврат" name="return_btn"/> - <button label="Самые активные участники столкновений..." name="top_colliders_btn" tool_tip="Список объектов, для которых столкновения наиболее вероятны"/> - <button label="Перезагрузить регион" name="restart_btn" tool_tip="Отсчитать 2 минуты и перезагрузить регион"/> - <button label="Список лучших скриптов..." name="top_scripts_btn" tool_tip="Объекты, в которых скрипты выполняются дольше всего"/> - <button label="Отменить перезапуск" name="cancel_restart_btn" tool_tip="Отменить перезапуск региона"/> - <button label="Консоль отладки региона" name="region_debug_console_btn" tool_tip="Открыть консоль отладки региона"/> + <button label="Самые активные участники столкновений..." name="top_colliders_btn" tool_tip="Список объектов, для которых столкновения наиболее вероятны" width="255"/> + <button label="Перезагрузить регион" name="restart_btn" tool_tip="Отсчитать 2 минуты и перезагрузить регион" left_pad="85"/> + <button label="Список лучших скриптов..." name="top_scripts_btn" tool_tip="Объекты, в которых скрипты выполняются дольше всего" width="255"/> + <button label="Отменить перезапуск" name="cancel_restart_btn" tool_tip="Отменить перезапуск региона" left_pad="85"/> + <button label="Консоль отладки региона" name="region_debug_console_btn" tool_tip="Открыть консоль отладки региона" width="255"/> </panel> diff --git a/indra/newview/skins/default/xui/tr/menu_viewer.xml b/indra/newview/skins/default/xui/tr/menu_viewer.xml index 23e2903e03..a488a0916f 100755 --- a/indra/newview/skins/default/xui/tr/menu_viewer.xml +++ b/indra/newview/skins/default/xui/tr/menu_viewer.xml @@ -174,6 +174,7 @@ <menu_item_call label="[SECOND_LIFE] Blogları" name="Second Life Blogs"/> <menu_item_call label="Kötüye Kullanımı Bildir" name="Report Abuse"/> <menu_item_call label="Hata Bildir" name="Report Bug"/> + <menu_item_call label="Toslamalar, İtmeler ve Vurmalar" name="Bumps, Pushes &amp; Hits"/> <menu_item_call label="[APP_NAME] Hakkında" name="About Second Life"/> </menu> <menu label="Gelişmiş" name="Advanced"> @@ -350,8 +351,7 @@ <menu_item_check label="Nesne Konumlarını Ping İle İnterpole Edin" name="Ping Interpolate Object Positions"/> <menu_item_call label="Paket Bırakın" name="Drop a Packet"/> </menu> - <menu_item_call label="Komut Dosyalı Kameranın Dökümünü Al" name="Dump Scripted Camera"/> - <menu_item_call label="Toslamalar, İtmeler ve Vurmalar" name="Bumps, Pushes &amp; Hits"/> + <menu_item_call label="Komut Dosyalı Kameranın Dökümünü Al" name="Dump Scripted Camera"/> <menu label="Kaydedici" name="Recorder"> <menu_item_call label="Oynatmayı Başlat" name="Start Playback"/> <menu_item_call label="Oynatmayı Durdur" name="Stop Playback"/> diff --git a/indra/newview/skins/default/xui/tr/panel_region_debug.xml b/indra/newview/skins/default/xui/tr/panel_region_debug.xml index 74a0a1569e..ec654aae82 100755 --- a/indra/newview/skins/default/xui/tr/panel_region_debug.xml +++ b/indra/newview/skins/default/xui/tr/panel_region_debug.xml @@ -27,9 +27,9 @@ <check_box label="Başkasına ait arazi üzerinde" name="return_other_land" tool_tip="Sadece başkasına ait arazi üzerinde olan nesneler iade edilsin"/> <check_box label="Bu gayrimenkulu oluşturan bölgelerin tümünde" name="return_estate_wide" tool_tip="Bu gayrimenkulu oluşturan bölgelerin tümündeki nesneler iade edilsin"/> <button label="İade Et" name="return_btn"/> - <button label="En Çok Çarpışanlar..." name="top_colliders_btn" tool_tip="En çok potansiyel çarpışma yaşayan nesnelerin listesi"/> - <button label="Bölgeyi Yeniden Başlat" name="restart_btn" tool_tip="2 dakikalık bir geri sayımdan sonra bölgeyi yeniden başlat"/> - <button label="En Çok Komut Dsy. Çalştr...." name="top_scripts_btn" tool_tip="Komut dosyalarını çalıştırırken en çok zaman harcayan nesnelerin listesi"/> - <button label="Yeniden Başlatmayı İptal Et" name="cancel_restart_btn" tool_tip="Bölge yeniden başlatmasını iptal et"/> - <button label="Bölge Hata Ayıklama Konsolu" name="region_debug_console_btn" tool_tip="Açık Bölge Hata Ayıklama Konsolu"/> + <button label="En Çok Çarpışanlar..." name="top_colliders_btn" tool_tip="En çok potansiyel çarpışma yaşayan nesnelerin listesi" width="180"/> + <button label="Bölgeyi Yeniden Başlat" name="restart_btn" tool_tip="2 dakikalık bir geri sayımdan sonra bölgeyi yeniden başlat" width="160"/> + <button label="En Çok Komut Dsy. Çalştr...." name="top_scripts_btn" tool_tip="Komut dosyalarını çalıştırırken en çok zaman harcayan nesnelerin listesi" width="180"/> + <button label="Yeniden Başlatmayı İptal Et" name="cancel_restart_btn" tool_tip="Bölge yeniden başlatmasını iptal et" width="160"/> + <button label="Bölge Hata Ayıklama Konsolu" name="region_debug_console_btn" tool_tip="Açık Bölge Hata Ayıklama Konsolu" width="180"/> </panel> diff --git a/indra/newview/skins/default/xui/zh/menu_viewer.xml b/indra/newview/skins/default/xui/zh/menu_viewer.xml index 46d46e901c..adc29a3944 100755 --- a/indra/newview/skins/default/xui/zh/menu_viewer.xml +++ b/indra/newview/skins/default/xui/zh/menu_viewer.xml @@ -174,6 +174,7 @@ <menu_item_call label="[SECOND_LIFE] 部落格" name="Second Life Blogs"/> <menu_item_call label="違規舉報" name="Report Abuse"/> <menu_item_call label="回報臭蟲" name="Report Bug"/> + <menu_item_call label="碰撞、推擠與打擊" name="Bumps, Pushes &amp; Hits"/> <menu_item_call label="關於 [APP_NAME]" name="About Second Life"/> </menu> <menu label="進階" name="Advanced"> @@ -350,8 +351,7 @@ <menu_item_check label="探詢內插物件位置" name="Ping Interpolate Object Positions"/> <menu_item_call label="丟出一個封包" name="Drop a Packet"/> </menu> - <menu_item_call label="傾印腳本控制的攝影機" name="Dump Scripted Camera"/> - <menu_item_call label="碰撞、推擠與打擊" name="Bumps, Pushes &amp; Hits"/> + <menu_item_call label="傾印腳本控制的攝影機" name="Dump Scripted Camera"/> <menu label="錄製器" name="Recorder"> <menu_item_call label="開始播放" name="Start Playback"/> <menu_item_call label="停止播放" name="Stop Playback"/> diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 32cf9d3df6..cae6bded9f 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -387,9 +387,13 @@ class Windows_i686_Manifest(ViewerManifest): if self.args['configuration'].lower() == 'debug': self.path("msvcr120d.dll") self.path("msvcp120d.dll") + self.path("msvcr100d.dll") + self.path("msvcp100d.dll") else: self.path("msvcr120.dll") self.path("msvcp120.dll") + self.path("msvcr100.dll") + self.path("msvcp100.dll") # Vivox runtimes self.path("SLVoice.exe") diff --git a/indra/test/llmessageconfig_tut.cpp b/indra/test/llmessageconfig_tut.cpp index 8088ce8558..df2151b1b1 100755 --- a/indra/test/llmessageconfig_tut.cpp +++ b/indra/test/llmessageconfig_tut.cpp @@ -68,7 +68,7 @@ namespace tut void writeConfigFile(const LLSD& config) { - llofstream file((mTestConfigDir + "/message.xml")); + llofstream file((mTestConfigDir + "/message.xml").c_str()); if (file.is_open()) { LLSDSerialize::toPrettyXML(config, file); diff --git a/indra/test/message_tut.cpp b/indra/test/message_tut.cpp index 57e423e550..aa23699de0 100755 --- a/indra/test/message_tut.cpp +++ b/indra/test/message_tut.cpp @@ -119,9 +119,8 @@ namespace tut void writeConfigFile(const LLSD& config) { - std::ostringstream ostr; - ostr << mTestConfigDir << mSep << "message.xml"; - llofstream file(ostr.str()); + std::string ostr(mTestConfigDir + mSep + "message.xml"); + llofstream file(ostr.c_str()); if (file.is_open()) { LLSDSerialize::toPrettyXML(config, file); diff --git a/indra/viewer_components/updater/llupdatedownloader.cpp b/indra/viewer_components/updater/llupdatedownloader.cpp index c42112af80..f868e5cc2c 100755 --- a/indra/viewer_components/updater/llupdatedownloader.cpp +++ b/indra/viewer_components/updater/llupdatedownloader.cpp @@ -270,7 +270,7 @@ void LLUpdateDownloader::Implementation::resume(void) } mDownloadRecordPath = downloadMarkerPath(); - llifstream dataStream(mDownloadRecordPath); + llifstream dataStream(mDownloadRecordPath.c_str()); if(!dataStream) { mClient.downloadError("no download marker"); @@ -362,7 +362,7 @@ size_t LLUpdateDownloader::Implementation::onHeader(void * buffer, size_t size) LL_INFOS("UpdaterService") << "download size is " << size << LL_ENDL; mDownloadData["size"] = LLSD(LLSD::Integer(size)); - llofstream odataStream(mDownloadRecordPath); + llofstream odataStream(mDownloadRecordPath.c_str()); LLSDSerialize::toPrettyXML(mDownloadData, odataStream); } catch (std::exception const & e) { LL_WARNS("UpdaterService") << "unable to read content length (" @@ -513,7 +513,7 @@ void LLUpdateDownloader::Implementation::resumeDownloading(size_t startByte) } throwOnCurlError(curl_easy_setopt(mCurl, CURLOPT_HTTPHEADER, mHeaderList)); - mDownloadStream.open(mDownloadData["path"].asString(), + mDownloadStream.open(mDownloadData["path"].asString().c_str(), std::ios_base::out | std::ios_base::binary | std::ios_base::app); start(); } @@ -534,10 +534,10 @@ void LLUpdateDownloader::Implementation::startDownloading(LLURI const & uri, std << " from " << uri.asString() << LL_ENDL; LL_INFOS("UpdaterService") << "hash of file is " << hash << LL_ENDL; - llofstream dataStream(mDownloadRecordPath); + llofstream dataStream(mDownloadRecordPath.c_str()); LLSDSerialize::toPrettyXML(mDownloadData, dataStream); - mDownloadStream.open(filePath, std::ios_base::out | std::ios_base::binary); + mDownloadStream.open(filePath.c_str(), std::ios_base::out | std::ios_base::binary); initializeCurlGet(uri.asString(), true); start(); } @@ -570,7 +570,7 @@ bool LLUpdateDownloader::Implementation::validateOrRemove(const std::string& fil bool LLUpdateDownloader::Implementation::validateDownload(const std::string& filePath) { - llifstream fileStream(filePath, std::ios_base::in | std::ios_base::binary); + llifstream fileStream(filePath.c_str(), std::ios_base::in | std::ios_base::binary); if(!fileStream) { LL_INFOS("UpdaterService") << "can't open " << filePath << ", invalid" << LL_ENDL; diff --git a/indra/viewer_components/updater/llupdaterservice.cpp b/indra/viewer_components/updater/llupdaterservice.cpp index cb3be5bbdc..c152493a51 100755 --- a/indra/viewer_components/updater/llupdaterservice.cpp +++ b/indra/viewer_components/updater/llupdaterservice.cpp @@ -285,7 +285,7 @@ bool LLUpdaterServiceImpl::checkForInstall(bool launchInstaller) { bool foundInstall = false; // return true if install is found. - llifstream update_marker(update_marker_path(), + llifstream update_marker(update_marker_path().c_str(), std::ios::in | std::ios::binary); if(update_marker.is_open()) @@ -365,7 +365,7 @@ bool LLUpdaterServiceImpl::checkForResume() std::string download_marker_path = mUpdateDownloader.downloadMarkerPath(); if(LLFile::isfile(download_marker_path)) { - llifstream download_marker_stream(download_marker_path, + llifstream download_marker_stream(download_marker_path.c_str(), std::ios::in | std::ios::binary); if(download_marker_stream.is_open()) { @@ -460,7 +460,7 @@ void LLUpdaterServiceImpl::downloadComplete(LLSD const & data) // Save out the download data to the SecondLifeUpdateReady // marker file. - llofstream update_marker(update_marker_path()); + llofstream update_marker(update_marker_path().c_str()); LLSDSerialize::toPrettyXML(data, update_marker); LLSD event; @@ -558,7 +558,7 @@ bool LLUpdaterServiceImpl::onMainLoop(LLSD const & event) LL_DEBUGS("UpdaterService") << "found marker " << ll_install_failed_marker_path() << LL_ENDL; int requiredValue = 0; { - llifstream stream(ll_install_failed_marker_path()); + llifstream stream(ll_install_failed_marker_path().c_str()); stream >> requiredValue; if(stream.fail()) { |