diff --git a/autobuild.xml b/autobuild.xml index 0b7450f402..4d9638e3f1 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -5,16 +5,16 @@ jemalloc - copyright - Copyright (C) 2002-present Jason Evans jasone@canonware.com. - description - jemalloc is a general purpose malloc(3) implementation that emphasizes fragmentation avoidance and scalable concurrency support. - license - jemalloc (BSD derived) - license_file - LICENSES/jemalloc.txt - name - jemalloc + copyright + Copyright (C) 2002-present Jason Evans jasone@canonware.com. + description + jemalloc is a general purpose malloc(3) implementation that emphasizes fragmentation avoidance and scalable concurrency support. + license + jemalloc (BSD derived) + license_file + LICENSES/jemalloc.txt + name + jemalloc platforms linux64 @@ -260,7 +260,7 @@ version 1.2.15 - + apr_suite copyright @@ -448,9 +448,9 @@ archive hash - 471b0b350955152fd87518575057dfc4 + 322dd6c45c384d454ae14ef127984a4e url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/60326/566593/bugsplat-1.0.7.542667-darwin64-542667.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/65457/612879/bugsplat-1.0.7.546418-darwin64-546418.tar.bz2 name darwin64 @@ -460,9 +460,9 @@ archive hash - 70e8bf46145c4cbae6f93e8b70ba5499 + 010a0e73c0fddaa2316411803fad8e69 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/60320/566541/bugsplat-3.6.0.4.542667-windows-542667.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/65456/612876/bugsplat-3.6.0.8.546418-windows-546418.tar.bz2 name windows @@ -472,16 +472,16 @@ archive hash - a73696e859fad3f19f835740815a2bd3 + 7e8530762e7b50663708a888c23b8780 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/60321/566542/bugsplat-3.6.0.4.542667-windows64-542667.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/65455/612874/bugsplat-3.6.0.8.546418-windows64-546418.tar.bz2 name windows64 version - 1.0.7.542667 + 3.6.0.8.546418 colladadom @@ -784,9 +784,9 @@ archive hash - e145f8ea99a21712434e0e868d1885dc + cc26af2ebfa241891caca829a6e46b88 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/62333/588183/dullahan-1.7.0.202006240858_81.3.10_gb223419_chromium-81.0.4044.138-darwin64-544091.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/65005/607316/dullahan-1.7.0.202008031101_81.3.10_gb223419_chromium-81.0.4044.138-darwin64-546064.tar.bz2 name darwin64 @@ -796,9 +796,9 @@ archive hash - e11da8884e44c27df3bf3adce01d5760 + 7599bb6b05a5e48ce78180735e5d3355 url - http://3p.firestormviewer.org/dullahan-1.8.0.202007201344_81.3.10_gb223419_chromium-81.0.4044.138-windows-202072245.tar.bz2 + http://3p.firestormviewer.org/dullahan-1.8.0.202007261348_81.3.10_gb223419_chromium-81.0.4044.138-windows-202081313.tar.bz2 name windows @@ -808,9 +808,9 @@ archive hash - 609dd2d70b73d83c382f73734c648156 + 92ced00cd0f89d0154ce2bcc6da086e0 url - http://3p.firestormviewer.org/dullahan-1.8.0.202007201344_81.3.10_gb223419_chromium-81.0.4044.138-windows64-202072240.tar.bz2 + http://3p.firestormviewer.org/dullahan-1.8.0.202007261348_81.3.10_gb223419_chromium-81.0.4044.138-windows64-202081325.tar.bz2 name windows64 @@ -820,16 +820,16 @@ archive hash - 79e5ef408ea7ee43fef0f738688485c6 + 2b29e6435ea9487bc2019a28b8287d6a url - http://3p.firestormviewer.org/dullahan-1.8.0.202007201635_81.3.10_gb223419_chromium-81.0.4044.138-linux64-202021435.tar.bz2 + http://3p.firestormviewer.org/dullahan-1.8.0.202011061705_81.3.10_gb223419_chromium-81.0.4044.138-linux64-203111605.tar.bz2 name linux64 version - 1.7.0.202006240858_81.3.10_gb223419_chromium-81.0.4044.138 + 1.7.0.202008031800_81.3.10_gb223419_chromium-81.0.4044.138 elfio @@ -964,11 +964,11 @@ archive hash - 2c7c5fb28c34d4833b14d49d4abb101a + fc2d285da5298b666fc3c54015a8669a hash_algorithm md5 url - file:///opt/firestorm/fmodstudio-2.01.04-darwin-202612342.tar.bz2 + file:///opt/firestorm/fmodstudio-2.01.05-darwin-202981448.tar.bz2 name darwin @@ -978,11 +978,11 @@ archive hash - 87a94446fed5e9bdaf7bb4f9b0c21574 + ee3c5e3449e06bc3dbb1c9dc29aca53d hash_algorithm md5 url - file:///opt/firestorm/fmodstudio-2.01.04-linux64-202721507.tar.bz2 + file:///opt/firestorm/fmodstudio-2.01.05-linux64-202931144.tar.bz2 name linux64 @@ -2375,16 +2375,18 @@ archive hash - b677ee43822212f0a27c838dc8bf3623 + 9f4687d7d328b0c13a9e651e805e880a + hash_algorithm + md5 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/67622/646614/llca-202009010215.548269-common-548269.tar.bz2 + https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/71501/691487/llca-202011010215.551526-common-551526.tar.bz2 name common version - 202009010215.548269 + 202011010215.551526 llphysicsextensions_source @@ -2936,33 +2938,21 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 5abf2d9c0b250821c59cc60cd94fd8af + 53966a7ba6342395acb7ce15bc3fbe0a url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/54840/510064/openjpeg-1.5.1.538970-darwin64-538970.tar.bz2 + http://3p.firestormviewer.org/openjpeg-2.3.1.203000304-darwin-203000304.tar.bz2 name darwin64 - linux - - archive - - hash - 4a5591349005afac44a688e99517a9f3 - url - http://3p.firestormviewer.org/openjpeg-1.5.1.180991818-linux-180991818.tar.bz2 - - name - linux - linux64 archive hash - addb209bb56a8f16602a7222f119191d + b7be1d6116fb5848ab2beef19b6a8b15 url - http://3p.firestormviewer.org/openjpeg-1.5.1.180991822-linux64-180991822.tar.bz2 + http://3p.firestormviewer.org/openjpeg-2.3.1.202991551-linux64-202991551.tar.bz2 name linux64 @@ -2972,9 +2962,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - b20c18f66ae63c9d3b1970af8866aeb9 + e235c5da10f29893e14b14c7a3184d91 url - http://3p.firestormviewer.org/openjpeg-1.4.202102107-windows-202102107.tar.bz2 + http://3p.firestormviewer.org/openjpeg-2.3.1.202821233-windows-202821233.tar.bz2 name windows @@ -2984,16 +2974,16 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 6f1e1d8796301c4e5737cb0db0f696d2 + d87183b9cab5910a4a0f15e8faebab06 url - http://3p.firestormviewer.org/openjpeg-1.4.202102110-windows64-202102110.tar.bz2 + http://3p.firestormviewer.org/openjpeg-2.3.1.202821246-windows64-202821246.tar.bz2 name windows64 version - 1.5.1.538970 + 2.3.1 openssl @@ -4222,7 +4212,26 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors name ReleaseFS - + ReleaseFS_open + + build + + options + + --platform darwin + + + configure + + options + + --platform darwin + + + name + ReleaseFS_open + + name darwin64 diff --git a/doc/contributions.txt b/doc/contributions.txt index 3bea15f003..22bd4ae794 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -225,6 +225,9 @@ Ansariel Hiller MAINT-8723 SL-10385 SL-10891 + SL-13364 + SL-13858 + SL-13697 Aralara Rajal Arare Chantilly CHUIBUG-191 @@ -840,7 +843,9 @@ Khyota Wulluf Kimar Coba Kithrak Kirkorian Kitty Barnett + BUG-228664 BUG-228665 + BUG-228719 VWR-19699 STORM-288 STORM-799 diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 2dc37af562..74e6669b6b 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -106,6 +106,8 @@ if (WINDOWS) /Zc:forScope /nologo /Oy- + /Oi + /Ot /arch:AVX /fp:fast ) @@ -118,8 +120,10 @@ if (WINDOWS) /Zc:forScope /nologo /Oy- + /Oi + /Ot /arch:AVX2 -# /fp:fast + /fp:fast ) else (USE_AVX_OPTIMIZATION) # AVX/AVX2 support @@ -131,6 +135,8 @@ if (WINDOWS) /Zc:forScope /nologo /Oy- + /Oi + /Ot # /arch:SSE2 /fp:fast ) diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index 33684e7b07..30f8794577 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -52,7 +52,7 @@ if(WINDOWS) set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}") set(release_files - openjpeg.dll + #openjp2.dll # Only copy OpenJPEG dll if needed libapr-1.dll libaprutil-1.dll libapriconv-1.dll @@ -63,6 +63,12 @@ if(WINDOWS) libhunspell.dll ) + # Only copy OpenJPEG dll if needed + if (NOT USE_KDU) + set(release_files ${release_files} openjp2.dll) + endif (NOT USE_KDU) + # + # Filenames are different for 32/64 bit BugSplat file and we don't # have any control over them so need to branch. if (BUGSPLAT_DB) diff --git a/indra/cmake/OpenJPEG.cmake b/indra/cmake/OpenJPEG.cmake index bf0bde2ba7..f254094df6 100644 --- a/indra/cmake/OpenJPEG.cmake +++ b/indra/cmake/OpenJPEG.cmake @@ -9,14 +9,7 @@ if (USESYSTEMLIBS) else (USESYSTEMLIBS) use_prebuilt_binary(openjpeg) - if(WINDOWS) - # Windows has differently named release and debug openjpeg(d) libs. - set(OPENJPEG_LIBRARIES - debug openjpegd - optimized openjpeg) - else(WINDOWS) - set(OPENJPEG_LIBRARIES openjpeg) - endif(WINDOWS) - - set(OPENJPEG_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/openjpeg) + set(OPENJPEG_LIBRARIES openjp2) + + set(OPENJPEG_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/openjpeg) endif (USESYSTEMLIBS) diff --git a/indra/integration_tests/llui_libtest/CMakeLists.txt b/indra/integration_tests/llui_libtest/CMakeLists.txt index 1cec660eb0..13487dd42b 100644 --- a/indra/integration_tests/llui_libtest/CMakeLists.txt +++ b/indra/integration_tests/llui_libtest/CMakeLists.txt @@ -99,14 +99,14 @@ if (WINDOWS) # Copy over OpenJPEG.dll # *NOTE: On Windows with VS2005, only the first comment prints set(OPENJPEG_RELEASE - "${ARCH_PREBUILT_DIRS_RELEASE}/openjpeg.dll") + "${ARCH_PREBUILT_DIRS_RELEASE}/openjp2.dll") add_custom_command( TARGET llui_libtest POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different ${OPENJPEG_RELEASE} ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Copying OpenJPEG DLLs to binary directory" ) set(OPENJPEG_DEBUG - "${ARCH_PREBUILT_DIRS_DEBUG}/openjpegd.dll") + "${ARCH_PREBUILT_DIRS_DEBUG}/openjp2.dll") add_custom_command( TARGET llui_libtest POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different ${OPENJPEG_DEBUG} ${CMAKE_CURRENT_BINARY_DIR} diff --git a/indra/llaudio/llaudioengine.cpp b/indra/llaudio/llaudioengine.cpp index 8be13d7834..397b7355f1 100644 --- a/indra/llaudio/llaudioengine.cpp +++ b/indra/llaudio/llaudioengine.cpp @@ -1347,7 +1347,7 @@ LLAudioSource::LLAudioSource(const LLUUID& id, const LLUUID& owner_id, const F32 std::map gSoundHistory; // static -void LLAudioSource::logSoundPlay(const LLUUID& id, LLAudioSource* audio_source, LLVector3d position, S32 type, const LLUUID& assetid, const LLUUID& ownerid, const LLUUID& sourceid, bool is_trigger, bool is_looped) +void LLAudioSource::logSoundPlay(const LLUUID& id, LLVector3d position, S32 type, const LLUUID& assetid, const LLUUID& ownerid, const LLUUID& sourceid, bool is_trigger, bool is_looped) { // Corrupt asset, do not bother if( gAudiop->isCorruptSound( assetid ) ) @@ -1362,7 +1362,6 @@ void LLAudioSource::logSoundPlay(const LLUUID& id, LLAudioSource* audio_source, LLSoundHistoryItem item; item.mID = id; - item.mAudioSource = audio_source; item.mPosition = position; item.mType = type; item.mAssetID = assetid; @@ -1387,7 +1386,6 @@ void LLAudioSource::logSoundStop(const LLUUID& id) { gSoundHistory[id].mPlaying = false; gSoundHistory[id].mTimeStopped = LLTimer::getElapsedSeconds(); - gSoundHistory[id].mAudioSource = NULL; // just in case pruneSoundLog(); } } @@ -1546,7 +1544,7 @@ bool LLAudioSource::play(const LLUUID &audio_uuid) // NaCl - Sound Explorer if(mType != LLAudioEngine::AUDIO_TYPE_UI) //&& mSourceID.notNull()) { - logSoundPlay(mLogID, this, mPositionGlobal, mType, audio_uuid, mOwnerID, mSourceID, mIsTrigger, mLoop); + logSoundPlay(mLogID, mPositionGlobal, mType, audio_uuid, mOwnerID, mSourceID, mIsTrigger, mLoop); } // NaCl End // Special abuse of play(); don't play a sound, but kill it. diff --git a/indra/llaudio/llaudioengine.h b/indra/llaudio/llaudioengine.h index 44ed31520f..2263d12343 100644 --- a/indra/llaudio/llaudioengine.h +++ b/indra/llaudio/llaudioengine.h @@ -372,7 +372,7 @@ protected: void setChannel(LLAudioChannel *channelp); LLAudioChannel *getChannel() const { return mChannelp; } // NaCl - Sound Explorer - static void logSoundPlay(const LLUUID& id, LLAudioSource* audio_source, LLVector3d position, S32 type, const LLUUID& assetid, const LLUUID& ownerid, const LLUUID& sourceid, bool is_trigger, bool is_looped); + static void logSoundPlay(const LLUUID& id, LLVector3d position, S32 type, const LLUUID& assetid, const LLUUID& ownerid, const LLUUID& sourceid, bool is_trigger, bool is_looped); static void logSoundStop(const LLUUID& id); static void pruneSoundLog(); static S32 sSoundHistoryPruneCounter; @@ -556,7 +556,6 @@ struct LLSoundHistoryItem F64 mTimeStopped; bool mReviewed; bool mReviewedCollision; - LLAudioSource* mAudioSource; LLSoundHistoryItem() : mType(0) @@ -567,7 +566,6 @@ struct LLSoundHistoryItem , mTimeStopped(0.f) , mReviewed(false) , mReviewedCollision(false) - , mAudioSource(0) { } }; diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp index 887e23e92e..f2c55c321f 100644 --- a/indra/llcommon/llapp.cpp +++ b/indra/llcommon/llapp.cpp @@ -182,7 +182,7 @@ LLApp::~LLApp() if(mExceptionHandler != 0) delete mExceptionHandler; - SUBSYSTEM_CLEANUP(LLCommon); + SUBSYSTEM_CLEANUP_DBG(LLCommon); } // static diff --git a/indra/llcommon/llapr.cpp b/indra/llcommon/llapr.cpp index 9494d6497c..4413d89186 100644 --- a/indra/llcommon/llapr.cpp +++ b/indra/llcommon/llapr.cpp @@ -68,7 +68,7 @@ void ll_cleanup_apr() { gAPRInitialized = false; - LL_INFOS("APR") << "Cleaning up APR" << LL_ENDL; + LL_DEBUGS("APR") << "Cleaning up APR" << LL_ENDL; LLThreadLocalPointerBase::destroyAllThreadLocalStorage(); diff --git a/indra/llcommon/llcleanup.cpp b/indra/llcommon/llcleanup.cpp index c5283507bf..1f34c2036a 100644 --- a/indra/llcommon/llcleanup.cpp +++ b/indra/llcommon/llcleanup.cpp @@ -20,10 +20,13 @@ #include "llerror.h" #include "llerrorcontrol.h" -void log_subsystem_cleanup(const char* file, int line, const char* function, +void log_subsystem_cleanup(LLError::ELevel level, + const char* file, + int line, + const char* function, const char* classname) { - LL_INFOS("Cleanup") << LLError::abbreviateFile(file) << "(" << line << "): " + LL_VLOGS(level, "Cleanup") << LLError::abbreviateFile(file) << "(" << line << "): " << "calling " << classname << "::cleanupClass() in " << function << LL_ENDL; } diff --git a/indra/llcommon/llcleanup.h b/indra/llcommon/llcleanup.h index a319171b5f..0f567ed5f6 100644 --- a/indra/llcommon/llcleanup.h +++ b/indra/llcommon/llcleanup.h @@ -21,13 +21,22 @@ // shutdown schemes. #define SUBSYSTEM_CLEANUP(CLASSNAME) \ do { \ - log_subsystem_cleanup(__FILE__, __LINE__, BOOST_CURRENT_FUNCTION, #CLASSNAME); \ + log_subsystem_cleanup(LLError::LEVEL_INFO, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, #CLASSNAME); \ + CLASSNAME::cleanupClass(); \ + } while (0) + +#define SUBSYSTEM_CLEANUP_DBG(CLASSNAME) \ + do { \ + log_subsystem_cleanup(LLError::LEVEL_DEBUG, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, #CLASSNAME); \ CLASSNAME::cleanupClass(); \ } while (0) // Use ancient do { ... } while (0) macro trick to permit a block of // statements with the same syntax as a single statement. -void log_subsystem_cleanup(const char* file, int line, const char* function, +void log_subsystem_cleanup(LLError::ELevel level, + const char* file, + int line, + const char* function, const char* classname); #endif /* ! defined(LL_LLCLEANUP_H) */ diff --git a/indra/llcommon/llcommon.cpp b/indra/llcommon/llcommon.cpp index 2d665c611b..96be913d17 100644 --- a/indra/llcommon/llcommon.cpp +++ b/indra/llcommon/llcommon.cpp @@ -63,7 +63,7 @@ void LLCommon::cleanupClass() sMasterThreadRecorder = NULL; LLTrace::set_master_thread_recorder(NULL); LLThreadSafeRefCount::cleanupThreadSafeRefCount(); - SUBSYSTEM_CLEANUP(LLTimer); + SUBSYSTEM_CLEANUP_DBG(LLTimer); if (sAprInitialized) { ll_cleanup_apr(); diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index 3e228bbbfc..58d90d46df 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -337,12 +337,9 @@ namespace LLError } // huh, that's odd, we should see one or the other prefix -- but don't // try to log unless logging is already initialized - if (is_available()) - { - // in Python, " or ".join(vector) -- but in C++, a PITB - LL_DEBUGS() << "Did not see 'class' or 'struct' prefix on '" - << name << "'" << LL_ENDL; - } + // in Python, " or ".join(vector) -- but in C++, a PITB + LL_DEBUGS() << "Did not see 'class' or 'struct' prefix on '" + << name << "'" << LL_ENDL; return name; #else // neither GCC nor Visual Studio @@ -443,9 +440,12 @@ namespace typedef std::vector Recorders; typedef std::vector CallSiteVector; - class Globals : public LLSingleton + class Globals { - LLSINGLETON(Globals); + public: + static Globals* getInstance(); + protected: + Globals(); public: std::ostringstream messageStream; bool messageStreamInUse; @@ -465,6 +465,16 @@ namespace { } + Globals* Globals::getInstance() + { + // According to C++11 Function-Local Initialization + // of static variables is supposed to be thread safe + // without risk of deadlocks. + static Globals inst; + + return &inst; + } + void Globals::addCallSite(LLError::CallSite& site) { callSites.push_back(&site); @@ -517,14 +527,17 @@ namespace LLError typedef LLPointer SettingsConfigPtr; - class Settings : public LLSingleton + class Settings { - LLSINGLETON(Settings); + public: + static Settings* getInstance(); + protected: + Settings(); public: SettingsConfigPtr getSettingsConfig(); void reset(); - SettingsStoragePtr saveAndReset(); + SettingsStoragePtr saveAndReset(); void restore(SettingsStoragePtr pSettingsStorage); private: @@ -558,6 +571,16 @@ namespace LLError { } + Settings* Settings::getInstance() + { + // According to C++11 Function-Local Initialization + // of static variables is supposed to be thread safe + // without risk of deadlocks. + static Settings inst; + + return &inst; + } + SettingsConfigPtr Settings::getSettingsConfig() { return mSettingsConfig; @@ -582,11 +605,6 @@ namespace LLError SettingsConfigPtr newSettingsConfig(dynamic_cast(pSettingsStorage.get())); mSettingsConfig = newSettingsConfig; } - - bool is_available() - { - return Settings::instanceExists() && Globals::instanceExists(); - } } namespace LLError @@ -1039,7 +1057,7 @@ namespace LLError std::pair, Recorders::iterator> findRecorderPos() { - SettingsConfigPtr s = Settings::instance().getSettingsConfig(); + SettingsConfigPtr s = Settings::getInstance()->getSettingsConfig(); // Since we promise to return an iterator, use a classic iterator // loop. auto end{s->mRecorders.end()}; @@ -1082,7 +1100,7 @@ namespace LLError auto found = findRecorderPos(); if (found.first) { - SettingsConfigPtr s = Settings::instance().getSettingsConfig(); + SettingsConfigPtr s = Settings::getInstance()->getSettingsConfig(); s->mRecorders.erase(found.second); } return bool(found.first); @@ -1323,14 +1341,6 @@ namespace LLError return false; } - // If we hit a logging request very late during shutdown processing, - // when either of the relevant LLSingletons has already been deleted, - // DO NOT resurrect them. - if (Settings::wasDeleted() || Globals::wasDeleted()) - { - return false; - } - SettingsConfigPtr s = Settings::getInstance()->getSettingsConfig(); s->mShouldLogCallCounter++; @@ -1369,10 +1379,8 @@ namespace LLError std::ostringstream* Log::out() { LLMutexTrylock lock(getMutex(),5); - // If we hit a logging request very late during shutdown processing, - // when either of the relevant LLSingletons has already been deleted, - // DO NOT resurrect them. - if (lock.isLocked() && ! (Settings::wasDeleted() || Globals::wasDeleted())) + + if (lock.isLocked()) { Globals* g = Globals::getInstance(); @@ -1394,14 +1402,6 @@ namespace LLError return; } - // If we hit a logging request very late during shutdown processing, - // when either of the relevant LLSingletons has already been deleted, - // DO NOT resurrect them. - if (Settings::wasDeleted() || Globals::wasDeleted()) - { - return; - } - if(strlen(out->str().c_str()) < 128) { strcpy(message, out->str().c_str()); @@ -1434,14 +1434,6 @@ namespace LLError return; } - // If we hit a logging request very late during shutdown processing, - // when either of the relevant LLSingletons has already been deleted, - // DO NOT resurrect them. - if (Settings::wasDeleted() || Globals::wasDeleted()) - { - return; - } - Globals* g = Globals::getInstance(); SettingsConfigPtr s = Settings::getInstance()->getSettingsConfig(); diff --git a/indra/llcommon/llerrorcontrol.h b/indra/llcommon/llerrorcontrol.h index bfa2269025..25786d5457 100644 --- a/indra/llcommon/llerrorcontrol.h +++ b/indra/llcommon/llerrorcontrol.h @@ -203,11 +203,6 @@ namespace LLError LL_COMMON_API std::string abbreviateFile(const std::string& filePath); LL_COMMON_API int shouldLogCallCount(); - - // Check whether Globals exists. This should only be used by LLSingleton - // infrastructure to avoid trying to log when our internal LLSingleton is - // unavailable -- circularity ensues. - LL_COMMON_API bool is_available(); }; #endif // LL_LLERRORCONTROL_H diff --git a/indra/llcommon/llsingleton.cpp b/indra/llcommon/llsingleton.cpp index d3d25201b2..83a4b64e8f 100644 --- a/indra/llcommon/llsingleton.cpp +++ b/indra/llcommon/llsingleton.cpp @@ -28,7 +28,7 @@ #include "llsingleton.h" #include "llerror.h" -#include "llerrorcontrol.h" // LLError::is_available() +#include "llerrorcontrol.h" #include "lldependencies.h" #include "llexception.h" #include "llcoros.h" @@ -41,8 +41,6 @@ namespace { void log(LLError::ELevel level, const char* p1, const char* p2, const char* p3, const char* p4); - -bool oktolog(); } // anonymous namespace // Our master list of all LLSingletons is itself an LLSingleton. We used to @@ -279,8 +277,6 @@ void LLSingletonBase::reset_initializing(list_t::size_type size) void LLSingletonBase::MasterList::LockedInitializing::log(const char* verb, const char* name) { - if (oktolog()) - { LL_DEBUGS("LLSingleton") << verb << ' ' << demangle(name) << ';'; if (mList) { @@ -292,7 +288,6 @@ void LLSingletonBase::MasterList::LockedInitializing::log(const char* verb, cons } } LL_ENDL; - } } void LLSingletonBase::capture_dependency() @@ -455,33 +450,11 @@ void LLSingletonBase::deleteAll() /*---------------------------- Logging helpers -----------------------------*/ namespace { -bool oktolog() -{ - // See comments in log() below. - return LLError::is_available(); -} void log(LLError::ELevel level, const char* p1, const char* p2, const char* p3, const char* p4) { - // The is_available() test below ensures that we'll stop logging once - // LLError has been cleaned up. If we had a similar portable test for - // std::cerr, this would be a good place to use it. - - // Check LLError::is_available() because some of LLError's infrastructure - // is itself an LLSingleton. If that LLSingleton has not yet been - // initialized, trying to log will engage LLSingleton machinery... and - // around and around we go. - if (LLError::is_available()) - { - LL_VLOGS(level, "LLSingleton") << p1 << p2 << p3 << p4 << LL_ENDL; - } - else - { - // Caller may be a test program, or something else whose stderr is - // visible to the user. - std::cerr << p1 << p2 << p3 << p4 << std::endl; - } + LL_VLOGS(level, "LLSingleton") << p1 << p2 << p3 << p4 << LL_ENDL; } } // anonymous namespace diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp index fc157f6d28..a11378259f 100644 --- a/indra/llcommon/llstring.cpp +++ b/indra/llcommon/llstring.cpp @@ -1285,7 +1285,9 @@ void LLStringUtil::formatNumber(std::string& numStr, std::string decimals) // std::locale() throws if the locale is unknown! (EXT-7926) try { - strStream.imbue(std::locale(sLocale.c_str())); + // FIRE-6070: Use user's system locale setting for number formatting + //strStream.imbue(std::locale(sLocale.c_str())); + strStream.imbue(std::locale("")); } catch (const std::exception &) { LL_WARNS_ONCE("Locale") << "Cannot set locale to " << sLocale << LL_ENDL; @@ -1300,6 +1302,11 @@ void LLStringUtil::formatNumber(std::string& numStr, std::string decimals) { strStream << intStr; numStr = strStream.str(); + // FIRE-6070: Fix random symbols in formatted numbers in some locales +#ifdef LL_WINDOWS + numStr = ll_convert_string_to_utf8_string(numStr); +#endif + // } } else @@ -1310,6 +1317,11 @@ void LLStringUtil::formatNumber(std::string& numStr, std::string decimals) { strStream << std::fixed << std::showpoint << std::setprecision(intDecimals) << floatStr; numStr = strStream.str(); + // FIRE-6070: Fix random symbols in formatted numbers in some locales +#ifdef LL_WINDOWS + numStr = ll_convert_string_to_utf8_string(numStr); +#endif + // } } } diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp index 54872e86f8..aacd32ef77 100644 --- a/indra/llcommon/llsys.cpp +++ b/indra/llcommon/llsys.cpp @@ -150,13 +150,13 @@ LLOSInfo::LLOSInfo() : #if LL_WINDOWS - if (IsWindowsVersionOrGreater(10, 0, 0)) + if (IsWindows10OrGreater()) { mMajorVer = 10; mMinorVer = 0; if (IsWindowsServer()) { - mOSStringSimple = "Windows Server 2016 "; + mOSStringSimple = "Windows Server "; } else { @@ -956,12 +956,20 @@ LLSD LLMemoryInfo::loadStatsMap( bool aProcessMemoryOnly ) DWORDLONG div = 1024; stats.add("Percent Memory use", state.dwMemoryLoad/div); - stats.add("Total Physical KB", state.ullTotalPhys/div); - stats.add("Avail Physical KB", state.ullAvailPhys/div); - stats.add("Total page KB", state.ullTotalPageFile/div); - stats.add("Avail page KB", state.ullAvailPageFile/div); - stats.add("Total Virtual KB", state.ullTotalVirtual/div); - stats.add("Avail Virtual KB", state.ullAvailVirtual/div); + // Ugly, but prevent overflow + //stats.add("Total Physical KB", state.ullTotalPhys/div); + //stats.add("Avail Physical KB", state.ullAvailPhys/div); + //stats.add("Total page KB", state.ullTotalPageFile/div); + //stats.add("Avail page KB", state.ullAvailPageFile/div); + //stats.add("Total Virtual KB", state.ullTotalVirtual/div); + //stats.add("Avail Virtual KB", state.ullAvailVirtual/div); + stats.add("Total Physical KB", llclamp(state.ullTotalPhys/div, U64(0), U64(S32_MAX))); + stats.add("Avail Physical KB", llclamp(state.ullAvailPhys/div, U64(0), U64(S32_MAX))); + stats.add("Total page KB", llclamp(state.ullTotalPageFile/div, U64(0), U64(S32_MAX))); + stats.add("Avail page KB", llclamp(state.ullAvailPageFile/div, U64(0), U64(S32_MAX))); + stats.add("Total Virtual KB", llclamp(state.ullTotalVirtual/div, U64(0), U64(S32_MAX))); + stats.add("Avail Virtual KB", llclamp(state.ullAvailVirtual/div, U64(0), U64(S32_MAX))); + // // Early out in case only process memory is requested. if( aProcessMemoryOnly ) diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 9b33aac1c4..246f3058b1 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -1079,9 +1079,10 @@ void LLImageRaw::composite( LLImageRaw* src ) return; } - llassert(3 == src->getComponents()); - llassert(3 == dst->getComponents()); - +// These assertions are nonsense. + // llassert(3 == src->getComponents()); + // llassert(3 == dst->getComponents()); +// if( 3 == dst->getComponents() ) { if( (src->getWidth() == dst->getWidth()) && (src->getHeight() == dst->getHeight()) ) @@ -1143,12 +1144,34 @@ void LLImageRaw::compositeUnscaled4onto3( LLImageRaw* src ) { LLImageRaw* dst = this; // Just for clarity. - llassert( (3 == src->getComponents()) || (4 == src->getComponents()) ); + // Correct bad assertion + // llassert( (3 == src->getComponents()) || (4 == src->getComponents()) ); + llassert( (4 == src->getComponents()) || (3 == dst->getComponents()) ); + // llassert( (src->getWidth() == dst->getWidth()) && (src->getHeight() == dst->getHeight()) ); U8* src_data = src->getData(); U8* dst_data = dst->getData(); S32 pixels = getWidth() * getHeight(); + // suspicious crash avoid potential causes. + if(!src_data) + { + LL_WARNS() << "source is null!" << LL_ENDL; + return; + } + if(!dst_data) + { + LL_WARNS() << "destination is null!" << LL_ENDL; + return; + } + auto src_comps = src->getComponents(); + if( src_comps != 4) + { + // This should never be reached, buit apparently it is. + LL_WARNS() << "src has incorrect number of layers (" << src_comps << ")" << LL_ENDL; + return; + } + // while( pixels-- ) { U8 alpha = src_data[3]; diff --git a/indra/llimagej2coj/llimagej2coj.cpp b/indra/llimagej2coj/llimagej2coj.cpp index 631f1f91d4..78d1e0313b 100644 --- a/indra/llimagej2coj/llimagej2coj.cpp +++ b/indra/llimagej2coj/llimagej2coj.cpp @@ -29,9 +29,140 @@ // this is defined so that we get static linking. #include "openjpeg.h" +#include "cio.h" +#include "event.h" +#define OPENJPEG2 #include "lltimer.h" -//#include "llmemory.h" + +// [SL:KB] - Patch: Viewer-OpenJPEG2 | Checked: Catznip-5.3 +#ifdef OPENJPEG2 +class LLJp2StreamReader { +public: + LLJp2StreamReader(LLImageJ2C* pImage) : m_pImage(pImage), m_Position(0) { } + + static OPJ_SIZE_T readStream(void* pBufferOut, OPJ_SIZE_T szBufferOut, void* pUserData) + { + LLJp2StreamReader* pStream = (LLJp2StreamReader*)pUserData; + if ( (!pBufferOut) || (!pStream) || (!pStream->m_pImage) ) + return (OPJ_SIZE_T)-1; + + OPJ_SIZE_T szBufferRead = llmin(szBufferOut, pStream->m_pImage->getDataSize() - pStream->m_Position); + if (!szBufferRead) + return (OPJ_SIZE_T)-1; + + memcpy(pBufferOut, pStream->m_pImage->getData() + pStream->m_Position, szBufferRead); + pStream->m_Position += szBufferRead; + return szBufferRead; + } + + static OPJ_OFF_T skipStream(OPJ_OFF_T bufferOffset, void* pUserData) + { + LLJp2StreamReader* pStream = (LLJp2StreamReader*)pUserData; + if ( (!pStream) || (!pStream->m_pImage) ) + return (OPJ_SIZE_T)-1; + + if (bufferOffset < 0) + { + // Skipping backward + if (pStream->m_Position == 0) + return (OPJ_SIZE_T)-1; // Already at the start of the stream + else if (pStream->m_Position + bufferOffset < 0) + bufferOffset = -(OPJ_OFF_T)pStream->m_Position; // Don't underflow + } + else + { + // Skipping forward + OPJ_SIZE_T szRemaining = pStream->m_pImage->getDataSize() - pStream->m_Position; + if (!szRemaining) + return (OPJ_SIZE_T)-1; // Already at the end of the stream + else if (bufferOffset > szRemaining) + bufferOffset = szRemaining; // Don't overflow + } + pStream->m_Position += bufferOffset; + + return bufferOffset; + } + + static OPJ_BOOL seekStream(OPJ_OFF_T bufferOffset, void* pUserData) + { + LLJp2StreamReader* pStream = (LLJp2StreamReader*)pUserData; + if ( (!pStream) || (!pStream->m_pImage) ) + return OPJ_FALSE; + + if ( (bufferOffset < 0) || (bufferOffset > pStream->m_pImage->getDataSize()) ) + return OPJ_FALSE; + + pStream->m_Position = bufferOffset; + return OPJ_TRUE; + } +protected: + LLImageJ2C* m_pImage = nullptr; + OPJ_SIZE_T m_Position = 0; +}; + +class LLJp2StreamWriter { +public: + LLJp2StreamWriter(LLImageJ2C* pImage) : m_pImage(pImage), m_Position(0) { } + + static OPJ_SIZE_T writeStream(void* pBufferIn, OPJ_SIZE_T szBufferIn, void* pUserData) + { + LLJp2StreamWriter* pStream = (LLJp2StreamWriter*)pUserData; + if ( (!pBufferIn) || (!pStream) || (!pStream->m_pImage) ) + return (OPJ_SIZE_T)-1; + + if (pStream->m_Position + szBufferIn > pStream->m_pImage->getDataSize()) + pStream->m_pImage->reallocateData(pStream->m_Position + szBufferIn); + + memcpy(pStream->m_pImage->getData() + pStream->m_Position, pBufferIn, szBufferIn); + pStream->m_Position += szBufferIn; + return szBufferIn; + } + + static OPJ_OFF_T skipStream(OPJ_OFF_T bufferOffset, void* pUserData) + { + LLJp2StreamWriter* pStream = (LLJp2StreamWriter*)pUserData; + if ( (!pStream) || (!pStream->m_pImage) ) + return -1; + + if (bufferOffset < 0) + { + // Skipping backward + if (pStream->m_Position == 0) + return -1; // Already at the start of the stream + else if (pStream->m_Position + bufferOffset < 0) + bufferOffset = -pStream->m_Position; // Don't underflow + } + else + { + // Skipping forward + if (pStream->m_Position + bufferOffset > pStream->m_pImage->getDataSize()) + return -1; // Don't allow skipping past the end of the stream + } + + pStream->m_Position += bufferOffset; + return bufferOffset; + } + + static OPJ_BOOL seekStream(OPJ_OFF_T bufferOffset, void* pUserData) + { + LLJp2StreamWriter* pStream = (LLJp2StreamWriter*)pUserData; + if ( (!pStream) || (!pStream->m_pImage) ) + return OPJ_FALSE; + + if ( (bufferOffset < 0) || (bufferOffset > pStream->m_pImage->getDataSize()) ) + return OPJ_FALSE; + + pStream->m_Position = bufferOffset; + return OPJ_TRUE; + } + +protected: + LLImageJ2C* m_pImage = nullptr; + OPJ_OFF_T m_Position = 0; +}; +#endif +// [/SL:KB] // Factory function: see declaration in llimagej2c.cpp LLImageJ2CImpl* fallbackCreateLLImageJ2CImpl() @@ -44,8 +175,10 @@ std::string LLImageJ2COJ::getEngineInfo() const #ifdef OPENJPEG_VERSION return std::string("OpenJPEG: " OPENJPEG_VERSION ", Runtime: ") + opj_version(); +#elif defined OPJ_PACKAGE_VERSION + return std::string("OpenJPEG: " OPJ_PACKAGE_VERSION ", Runtime: ") + opj_version(); #else - return std::string("OpenJPEG runtime: ") + opj_version(); + return std::string("OpenJPEG Runtime: ") + opj_version(); #endif } @@ -164,9 +297,10 @@ bool LLImageJ2COJ::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decod opj_event_mgr_t event_mgr; /* event manager */ opj_image_t *image = NULL; +#ifndef OPENJPEG2 opj_dinfo_t* dinfo = NULL; /* handle to a decompressor */ opj_cio_t *cio = NULL; - +#endif /* configure the event callbacks (not required) */ memset(&event_mgr, 0, sizeof(opj_event_mgr_t)); @@ -184,6 +318,45 @@ bool LLImageJ2COJ::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decod /* JPEG-2000 codestream */ +#ifdef OPENJPEG2 +// [SL:KB] - Patch: Viewer-OpenJPEG2 | Checked: Catznip-5.3 + /* get a decoder handle */ + opj_codec_t* opj_decoder_p = opj_create_decompress(OPJ_CODEC_J2K); + + /* catch events using our callbacks and give a local context */ + opj_set_error_handler(opj_decoder_p, error_callback, 0); + opj_set_warning_handler(opj_decoder_p, warning_callback, 0); + opj_set_info_handler(opj_decoder_p, info_callback, 0); + + /* setup the decoder decoding parameters using user parameters */ + opj_setup_decoder(opj_decoder_p, ¶meters); + + /* allow multi-threading */ + if (opj_has_thread_support()) + { + opj_codec_set_threads(opj_decoder_p, opj_get_num_cpus()); + } + + /* open a byte stream */ + LLJp2StreamReader streamReader(&base); + opj_stream_t* opj_stream_p = opj_stream_default_create(OPJ_STREAM_READ); + opj_stream_set_read_function(opj_stream_p, LLJp2StreamReader::readStream); + opj_stream_set_skip_function(opj_stream_p, LLJp2StreamReader::skipStream); + opj_stream_set_seek_function(opj_stream_p, LLJp2StreamReader::seekStream); + opj_stream_set_user_data(opj_stream_p, &streamReader, nullptr); + opj_stream_set_user_data_length(opj_stream_p, base.getDataSize()); + + /* decode the stream and fill the image structure */ + bool fSuccess = opj_read_header(opj_stream_p, opj_decoder_p, &image) && + opj_decode(opj_decoder_p, opj_stream_p, image) && + opj_end_decompress(opj_decoder_p, opj_stream_p); + + /* close the byte stream */ + opj_stream_destroy(opj_stream_p); + + /* free remaining structures */ + opj_destroy_codec(opj_decoder_p); +#else /* get a decoder handle */ dinfo = opj_create_decompress(CODEC_J2K); @@ -207,11 +380,19 @@ bool LLImageJ2COJ::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decod { opj_destroy_decompress(dinfo); } +#endif +// [/SL:KB] // The image decode failed if the return was NULL or the component // count was zero. The latter is just a sanity check before we // dereference the array. +// [SL:KB] - Patch: Viewer-OpenJPEG2 | Checked: Catznip-5.3 +#ifdef OPENJPEG2 + if ( (!fSuccess) || (!image) || (!image->numcomps) ) +#else if(!image || !image->numcomps) +#endif +// [/SL:KB] { LL_DEBUGS("Texture") << "ERROR -> decodeImpl: failed to decode image!" << LL_ENDL; if (image) @@ -219,21 +400,28 @@ bool LLImageJ2COJ::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decod opj_image_destroy(image); } +// [SL:KB] - Patch: Viewer-OpenJPEG2 | Checked: Catznip-5.3 + base.decodeFailed(); +// [SL:KB] return true; // done } // sometimes we get bad data out of the cache - check to see if the decode succeeded - for (S32 i = 0; i < image->numcomps; i++) - { - if (image->comps[i].factor != base.getRawDiscardLevel()) - { - // if we didn't get the discard level we're expecting, fail - opj_image_destroy(image); - base.mDecoding = false; - return true; - } - } - +// for (S32 i = 0; i < image->numcomps; i++) +// { +// if (image->comps[i].factor != base.getRawDiscardLevel()) +// { +// // if we didn't get the discard level we're expecting, fail +// +//// [SN:SG] - Patch: Import-MiscOpenJPEG +// LL_WARNS("Texture") << "Expected discard level not reached!" << LL_ENDL; +// base.decodeFailed(); +//// [SN:SG] +//// base.mDecoding = false; +// return true; +// } +// } + if(image->numcomps <= first_channel) { LL_WARNS() << "trying to decode more channels than are present in image: numcomps: " << image->numcomps << " first_channel: " << first_channel << LL_ENDL; @@ -241,7 +429,11 @@ bool LLImageJ2COJ::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decod { opj_image_destroy(image); } - + +// [SN:SG] - Patch: Import-MiscOpenJPEG + base.decodeFailed(); +// [SN:SG] + return true; } @@ -299,6 +491,9 @@ bool LLImageJ2COJ::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decod LL_DEBUGS("Texture") << "ERROR -> decodeImpl: failed to decode image! (NULL comp data - OpenJPEG bug)" << LL_ENDL; opj_image_destroy(image); +// [SN:SG] - Patch: Import-MiscOpenJPEG + base.decodeFailed(); +// [SN:SG] return true; // done } } @@ -364,7 +559,13 @@ bool LLImageJ2COJ::encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, con // // Fill in the source image from our raw image // +// [SL:KB] - Patch: Viewer-OpenJPEG2 | Checked: Catznip-5.3 +#ifdef OPENJPEG2 + OPJ_COLOR_SPACE color_space = OPJ_CLRSPC_SRGB; +#else OPJ_COLOR_SPACE color_space = CLRSPC_SRGB; +#endif +// [/SL:KB] opj_image_cmptparm_t cmptparm[MAX_COMPS]; opj_image_t * image = NULL; S32 numcomps = raw_image.getComponents(); @@ -409,6 +610,57 @@ bool LLImageJ2COJ::encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, con /* encode the destination image */ /* ---------------------------- */ +// [SL:KB] - Patch: Viewer-OpenJPEG2 | Checked: Catznip-5.3 +#ifdef OPENJPEG2 + /* get a J2K compressor handle */ + opj_codec_t* opj_encoder_p = opj_create_compress(OPJ_CODEC_J2K); + + /* catch events using our callbacks and give a local context */ + opj_set_error_handler(opj_encoder_p, error_callback, 0); + opj_set_warning_handler(opj_encoder_p, warning_callback, 0); + opj_set_info_handler(opj_encoder_p, info_callback, 0); + + /* setup the encoder parameters using the current image and using user parameters */ + bool fSuccess = opj_setup_encoder(opj_encoder_p, ¶meters, image); + if (!fSuccess) + { + opj_destroy_codec(opj_encoder_p); + opj_image_destroy(image); + LL_DEBUGS("Texture") << "Failed to encode image." << LL_ENDL; + return false; + } + + /* open a byte stream for writing */ + /* allocate memory for all tiles */ + LLJp2StreamWriter streamWriter(&base); + opj_stream_t* opj_stream_p = opj_stream_default_create(OPJ_STREAM_WRITE); + opj_stream_set_write_function(opj_stream_p, LLJp2StreamWriter::writeStream); + opj_stream_set_skip_function(opj_stream_p, LLJp2StreamWriter::skipStream); + opj_stream_set_seek_function(opj_stream_p, LLJp2StreamWriter::seekStream); + opj_stream_set_user_data(opj_stream_p, &streamWriter, nullptr); + opj_stream_set_user_data_length(opj_stream_p, raw_image.getDataSize()); + + /* encode the image */ + fSuccess = opj_start_compress(opj_encoder_p, image, opj_stream_p) && + opj_encode(opj_encoder_p, opj_stream_p) && + opj_end_compress(opj_encoder_p, opj_stream_p); + if (!fSuccess) + { + opj_stream_destroy(opj_stream_p); + opj_destroy_codec(opj_encoder_p); + opj_image_destroy(image); + LL_DEBUGS("Texture") << "Failed to encode image." << LL_ENDL; + return false; + } + + base.updateData(); // set width, height + + /* close and free the byte stream */ + opj_stream_destroy(opj_stream_p); + + /* free remaining compression structures */ + opj_destroy_codec(opj_encoder_p); +#else int codestream_length; opj_cio_t *cio = NULL; @@ -416,7 +668,7 @@ bool LLImageJ2COJ::encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, con opj_cinfo_t* cinfo = opj_create_compress(CODEC_J2K); /* catch events using our callbacks and give a local context */ - opj_set_event_mgr((opj_common_ptr)cinfo, &event_mgr, stderr); + opj_set_event_mgr((opj_common_ptr)cinfo, &event_mgr, stderr); /* setup the encoder parameters using the current image and using user parameters */ opj_setup_encoder(cinfo, ¶meters, image); @@ -447,6 +699,8 @@ bool LLImageJ2COJ::encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, con /* free user parameters structure */ if(parameters.cp_matrice) free(parameters.cp_matrice); +#endif + // [/SL:KB] /* free image data */ opj_image_destroy(image); @@ -535,9 +789,10 @@ bool LLImageJ2COJ::getMetadata(LLImageJ2C &base) opj_event_mgr_t event_mgr; /* event manager */ opj_image_t *image = NULL; +#ifndef OPENJPEG2 opj_dinfo_t* dinfo = NULL; /* handle to a decompressor */ opj_cio_t *cio = NULL; - +#endif /* configure the event callbacks (not required) */ memset(&event_mgr, 0, sizeof(opj_event_mgr_t)); @@ -549,7 +804,9 @@ bool LLImageJ2COJ::getMetadata(LLImageJ2C &base) opj_set_default_decoder_parameters(¶meters); // Only decode what's required to get the size data. +#ifndef OPENJPEG2 parameters.cp_limit_decoding=LIMIT_TO_MAIN_HEADER; +#endif //parameters.cp_reduce = mRawDiscardLevel; @@ -558,6 +815,50 @@ bool LLImageJ2COJ::getMetadata(LLImageJ2C &base) /* JPEG-2000 codestream */ +// [SL:KB] - Patch: Viewer-OpenJPEG2 | Checked: Catznip-5.3 +#ifdef OPENJPEG2 + /* get a decoder handle */ + opj_codec_t* opj_decoder_p = opj_create_decompress(OPJ_CODEC_J2K); + + /* catch events using our callbacks and give a local context */ + opj_set_error_handler(opj_decoder_p, error_callback, 0); + opj_set_warning_handler(opj_decoder_p, warning_callback, 0); + opj_set_info_handler(opj_decoder_p, info_callback, 0); + + /* setup the decoder decoding parameters using user parameters */ + bool fSuccess = opj_setup_decoder(opj_decoder_p, ¶meters); + if (!fSuccess) + { + opj_destroy_codec(opj_decoder_p); + LL_WARNS() << "ERROR -> getMetadata: failed to decode image!" << LL_ENDL; + return false; + } + + /* open a byte stream */ + LLJp2StreamReader streamReader(&base); + opj_stream_t* opj_stream_p = opj_stream_default_create(OPJ_STREAM_READ); + opj_stream_set_read_function(opj_stream_p, LLJp2StreamReader::readStream); + opj_stream_set_skip_function(opj_stream_p, LLJp2StreamReader::skipStream); + opj_stream_set_seek_function(opj_stream_p, LLJp2StreamReader::seekStream); + opj_stream_set_user_data(opj_stream_p, &streamReader, nullptr); + opj_stream_set_user_data_length(opj_stream_p, base.getDataSize()); + + /* decode the stream and fill the image structure */ + fSuccess = opj_read_header(opj_stream_p, opj_decoder_p, &image); + if (!fSuccess) + { + opj_stream_destroy(opj_stream_p); + opj_destroy_codec(opj_decoder_p); + LL_WARNS() << "ERROR -> getMetadata: failed to decode image!" << LL_ENDL; + return false; + } + + /* close the byte stream */ + opj_stream_destroy(opj_stream_p); + + /* free remaining structures */ + opj_destroy_codec(opj_decoder_p); +#else /* get a decoder handle */ dinfo = opj_create_decompress(CODEC_J2K); @@ -581,6 +882,8 @@ bool LLImageJ2COJ::getMetadata(LLImageJ2C &base) { opj_destroy_decompress(dinfo); } +#endif +// [/SL:KB] if(!image) { diff --git a/indra/llinventory/llinventory.cpp b/indra/llinventory/llinventory.cpp index 9e2b4b88c0..572ab966f6 100644 --- a/indra/llinventory/llinventory.cpp +++ b/indra/llinventory/llinventory.cpp @@ -41,7 +41,7 @@ /// Exported functions ///---------------------------------------------------------------------------- static const std::string INV_ITEM_ID_LABEL("item_id"); -static const std::string INV_FOLDER_ID_LABEL("folder_id"); +static const std::string INV_FOLDER_ID_LABEL("cat_id"); static const std::string INV_PARENT_ID_LABEL("parent_id"); static const std::string INV_ASSET_TYPE_LABEL("type"); static const std::string INV_PREFERRED_TYPE_LABEL("preferred_type"); @@ -228,22 +228,6 @@ BOOL LLInventoryObject::importLegacyStream(std::istream& input_stream) return TRUE; } -// exportFile should be replaced with exportLegacyStream -// not sure whether exportLegacyStream(llofstream(fp)) would work, fp may need to get icramented... -BOOL LLInventoryObject::exportFile(LLFILE* fp, BOOL) const -{ - std::string uuid_str; - fprintf(fp, "\tinv_object\t0\n\t{\n"); - mUUID.toString(uuid_str); - fprintf(fp, "\t\tobj_id\t%s\n", uuid_str.c_str()); - mParentUUID.toString(uuid_str); - fprintf(fp, "\t\tparent_id\t%s\n", uuid_str.c_str()); - fprintf(fp, "\t\ttype\t%s\n", LLAssetType::lookup(mType)); - fprintf(fp, "\t\tname\t%s|\n", mName.c_str()); - fprintf(fp,"\t}\n"); - return TRUE; -} - BOOL LLInventoryObject::exportLegacyStream(std::ostream& output_stream, BOOL) const { std::string uuid_str; @@ -681,243 +665,6 @@ int splitCacheLine( char *aBuffer, char *&aKeyword, char *&aValue ) } // -// virtual -BOOL LLInventoryItem::importFile(LLFILE* fp) -{ - // *NOTE: Changing the buffer size will require changing the scanf - // calls below. - char buffer[MAX_STRING]; /* Flawfinder: ignore */ - - // - cache speedups - //char keyword[MAX_STRING]; /* Flawfinder: ignore */ - //char valuestr[MAX_STRING]; /* Flawfinder: ignore */ - //char junk[MAX_STRING]; /* Flawfinder: ignore */ - //keyword[0] = '\0'; - //valuestr[0] = '\0' - char *keyword; /* Flawfinder: ignore */ - char *valuestr; /* Flawfinder: ignore */ - char *junk; /* Flawfinder: ignore */ - // - - BOOL success = TRUE; - - mInventoryType = LLInventoryType::IT_NONE; - mAssetUUID.setNull(); - while(success && (!feof(fp))) - { - if (fgets(buffer, MAX_STRING, fp) == NULL) - { - buffer[0] = '\0'; - } - - //sscanf(buffer, " %254s %254s", keyword, valuestr); /* Flawfinder: ignore */ - //if(0 == strcmp("{",keyword)) - int nKWLen = splitCacheLine( buffer, keyword, valuestr ); - if( !nKWLen ) - continue; - - if( sizeof("{")-1 == nKWLen && 0 == strcmp("{",keyword)) - { - continue; - } - //if(0 == strcmp("}", keyword)) - if( sizeof("}")-1 == nKWLen && 0 == strcmp("}", keyword)) - { - break; - } - else if( sizeof("item_id")-1 == nKWLen && 0 == strcmp("item_id", keyword)) - { - mUUID.set(valuestr); - } - //else if(0 == strcmp("parent_id", keyword)) - else if( sizeof("parent_id")-1 == nKWLen && 0 == strcmp("parent_id", keyword)) - { - mParentUUID.set(valuestr); - } - //else if(0 == strcmp("permissions", keyword)) - else if( sizeof("permissions" )-1 == nKWLen && 0 == strcmp("permissions", keyword)) - { - success = mPermissions.importFile(fp); - } - //else if(0 == strcmp("sale_info", keyword)) - else if(sizeof("sale_info")-1 == nKWLen && 0 == strcmp("sale_info", keyword)) - { - // Sale info used to contain next owner perm. It is now in - // the permissions. Thus, we read that out, and fix legacy - // objects. It's possible this op would fail, but it - // should pick up the vast majority of the tasks. - BOOL has_perm_mask = FALSE; - U32 perm_mask = 0; - success = mSaleInfo.importFile(fp, has_perm_mask, perm_mask); - if(has_perm_mask) - { - if(perm_mask == PERM_NONE) - { - perm_mask = mPermissions.getMaskOwner(); - } - // fair use fix. - if(!(perm_mask & PERM_COPY)) - { - perm_mask |= PERM_TRANSFER; - } - mPermissions.setMaskNext(perm_mask); - } - } - //else if(0 == strcmp("shadow_id", keyword)) - else if( sizeof("shadow_id")-1 == nKWLen && 0 == strcmp("shadow_id", keyword)) - { - mAssetUUID.set(valuestr); - LLXORCipher cipher(MAGIC_ID.mData, UUID_BYTES); - cipher.decrypt(mAssetUUID.mData, UUID_BYTES); - } - //else if(0 == strcmp("asset_id", keyword)) - else if( sizeof("asset_id")-1 == nKWLen && 0 == strcmp("asset_id", keyword)) - { - mAssetUUID.set(valuestr); - } - //else if(0 == strcmp("type", keyword)) - else if( sizeof("type")-1 == nKWLen && 0 == strcmp("type", keyword)) - { - mType = LLAssetType::lookup(valuestr); - } - //else if(0 == strcmp("inv_type", keyword)) - else if( sizeof("inv_type")-1 == nKWLen && 0 == strcmp("inv_type", keyword)) - { - mInventoryType = LLInventoryType::lookup(std::string(valuestr)); - } - //else if(0 == strcmp("flags", keyword)) - else if( sizeof("flags")-1 == nKWLen && 0 == strcmp("flags", keyword)) - { - //sscanf(valuestr, "%x", &mFlags); - mFlags = strtol( valuestr, 0, 16 ); - } - //else if(0 == strcmp("name", keyword)) - else if( sizeof("name")-1 == nKWLen && 0 == strcmp("name", keyword)) - { - //strcpy(valuestr, buffer + strlen(keyword) + 3); - // *NOTE: Not ANSI C, but widely supported. -// sscanf( /* Flawfinder: ignore */ -// buffer, -// " %254s%254[\t]%254[^|]", -// keyword, junk, valuestr); - - splitCacheDescOrName( valuestr, junk, valuestr ); - -// // IW: sscanf chokes and puts | in valuestr if there's no name -// if (valuestr[0] == '|') -// { -// valuestr[0] = '\000'; -// } - - mName.assign(valuestr); - LLStringUtil::replaceNonstandardASCII(mName, ' '); - LLStringUtil::replaceChar(mName, '|', ' '); - } - //else if(0 == strcmp("desc", keyword)) - else if( sizeof("desc")-1 == nKWLen && 0 == strcmp("desc", keyword)) - { - //strcpy(valuestr, buffer + strlen(keyword) + 3); - // *NOTE: Not ANSI C, but widely supported. -// sscanf( /* Flawfinder: ignore */ -// buffer, -// " %254s%254[\t]%254[^|]", -// keyword, junk, valuestr); - - splitCacheDescOrName( valuestr, junk, valuestr ); -// if (valuestr[0] == '|') -// { -// valuestr[0] = '\000'; -// } - - disclaimMem(mDescription); - mDescription.assign(valuestr); - claimMem(mDescription); - LLStringUtil::replaceNonstandardASCII(mDescription, ' '); - /* TODO -- ask Ian about this code - const char *donkey = mDescription.c_str(); - if (donkey[0] == '|') - { - LL_ERRS() << "Donkey" << LL_ENDL; - } - */ - } - //else if(0 == strcmp("creation_date", keyword)) - else if( sizeof("creation_date")-1 == nKWLen && 0 == strcmp("creation_date", keyword)) - { - //S32 date; - //sscanf(valuestr, "%d", &date); - //mCreationDate = date; - mCreationDate = atoi(valuestr); - } - else - { - LL_WARNS() << "unknown keyword '" << keyword - << "' in inventory import of item " << mUUID << LL_ENDL; - } - } - - // Need to convert 1.0 simstate files to a useful inventory type - // and potentially deal with bad inventory tyes eg, a landmark - // marked as a texture. - if((LLInventoryType::IT_NONE == mInventoryType) - || !inventory_and_asset_types_match(mInventoryType, mType)) - { - LL_DEBUGS() << "Resetting inventory type for " << mUUID << LL_ENDL; - mInventoryType = LLInventoryType::defaultForAssetType(mType); - } - - mPermissions.initMasks(mInventoryType); - - return success; -} - -BOOL LLInventoryItem::exportFile(LLFILE* fp, BOOL include_asset_key) const -{ - std::string uuid_str; - fprintf(fp, "\tinv_item\t0\n\t{\n"); - mUUID.toString(uuid_str); - fprintf(fp, "\t\titem_id\t%s\n", uuid_str.c_str()); - mParentUUID.toString(uuid_str); - fprintf(fp, "\t\tparent_id\t%s\n", uuid_str.c_str()); - mPermissions.exportFile(fp); - - // Check for permissions to see the asset id, and if so write it - // out as an asset id. Otherwise, apply our cheesy encryption. - if(include_asset_key) - { - U32 mask = mPermissions.getMaskBase(); - if(((mask & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED) - || (mAssetUUID.isNull())) - { - mAssetUUID.toString(uuid_str); - fprintf(fp, "\t\tasset_id\t%s\n", uuid_str.c_str()); - } - else - { - LLUUID shadow_id(mAssetUUID); - LLXORCipher cipher(MAGIC_ID.mData, UUID_BYTES); - cipher.encrypt(shadow_id.mData, UUID_BYTES); - shadow_id.toString(uuid_str); - fprintf(fp, "\t\tshadow_id\t%s\n", uuid_str.c_str()); - } - } - else - { - LLUUID::null.toString(uuid_str); - fprintf(fp, "\t\tasset_id\t%s\n", uuid_str.c_str()); - } - fprintf(fp, "\t\ttype\t%s\n", LLAssetType::lookup(mType)); - const std::string inv_type_str = LLInventoryType::lookup(mInventoryType); - if(!inv_type_str.empty()) fprintf(fp, "\t\tinv_type\t%s\n", inv_type_str.c_str()); - fprintf(fp, "\t\tflags\t%08x\n", mFlags); - mSaleInfo.exportFile(fp); - fprintf(fp, "\t\tname\t%s|\n", mName.c_str()); - fprintf(fp, "\t\tdesc\t%s|\n", mDescription.c_str()); - fprintf(fp, "\t\tcreation_date\t%d\n", (S32) mCreationDate); - fprintf(fp,"\t}\n"); - return TRUE; -} - // virtual BOOL LLInventoryItem::importLegacyStream(std::istream& input_stream) { @@ -1569,90 +1316,7 @@ void LLInventoryCategory::unpackMessage(LLMessageSystem* msg, msg->getStringFast(block, _PREHASH_Name, mName, block_num); LLStringUtil::replaceNonstandardASCII(mName, ' '); } - -// virtual -BOOL LLInventoryCategory::importFile(LLFILE* fp) -{ - // *NOTE: Changing the buffer size will require changing the scanf - // calls below. - char buffer[MAX_STRING]; /* Flawfinder: ignore */ - char keyword[MAX_STRING]; /* Flawfinder: ignore */ - char valuestr[MAX_STRING]; /* Flawfinder: ignore */ - keyword[0] = '\0'; - valuestr[0] = '\0'; - while(!feof(fp)) - { - if (fgets(buffer, MAX_STRING, fp) == NULL) - { - buffer[0] = '\0'; - } - - sscanf( /* Flawfinder: ignore */ - buffer, - " %254s %254s", - keyword, valuestr); - if(0 == strcmp("{",keyword)) - { - continue; - } - if(0 == strcmp("}", keyword)) - { - break; - } - else if(0 == strcmp("cat_id", keyword)) - { - mUUID.set(valuestr); - } - else if(0 == strcmp("parent_id", keyword)) - { - mParentUUID.set(valuestr); - } - else if(0 == strcmp("type", keyword)) - { - mType = LLAssetType::lookup(valuestr); - } - else if(0 == strcmp("pref_type", keyword)) - { - mPreferredType = LLFolderType::lookup(valuestr); - } - else if(0 == strcmp("name", keyword)) - { - //strcpy(valuestr, buffer + strlen(keyword) + 3); - // *NOTE: Not ANSI C, but widely supported. - sscanf( /* Flawfinder: ignore */ - buffer, - " %254s %254[^|]", - keyword, valuestr); - mName.assign(valuestr); - LLStringUtil::replaceNonstandardASCII(mName, ' '); - LLStringUtil::replaceChar(mName, '|', ' '); - } - else - { - LL_WARNS() << "unknown keyword '" << keyword - << "' in inventory import category " << mUUID << LL_ENDL; - } - } - return TRUE; -} - -BOOL LLInventoryCategory::exportFile(LLFILE* fp, BOOL) const -{ - std::string uuid_str; - fprintf(fp, "\tinv_category\t0\n\t{\n"); - mUUID.toString(uuid_str); - fprintf(fp, "\t\tcat_id\t%s\n", uuid_str.c_str()); - mParentUUID.toString(uuid_str); - fprintf(fp, "\t\tparent_id\t%s\n", uuid_str.c_str()); - fprintf(fp, "\t\ttype\t%s\n", LLAssetType::lookup(mType)); - fprintf(fp, "\t\tpref_type\t%s\n", LLFolderType::lookup(mPreferredType).c_str()); - fprintf(fp, "\t\tname\t%s|\n", mName.c_str()); - fprintf(fp,"\t}\n"); - return TRUE; -} - - // virtual BOOL LLInventoryCategory::importLegacyStream(std::istream& input_stream) { @@ -1731,6 +1395,45 @@ BOOL LLInventoryCategory::exportLegacyStream(std::ostream& output_stream, BOOL) return TRUE; } +LLSD LLInventoryCategory::exportLLSD() const +{ + LLSD cat_data; + cat_data[INV_FOLDER_ID_LABEL] = mUUID; + cat_data[INV_PARENT_ID_LABEL] = mParentUUID; + cat_data[INV_ASSET_TYPE_LABEL] = LLAssetType::lookup(mType); + cat_data[INV_PREFERRED_TYPE_LABEL] = LLFolderType::lookup(mPreferredType); + cat_data[INV_NAME_LABEL] = mName; + + return cat_data; +} + +bool LLInventoryCategory::importLLSD(const LLSD& cat_data) +{ + if (cat_data.has(INV_FOLDER_ID_LABEL)) + { + setUUID(cat_data[INV_FOLDER_ID_LABEL].asUUID()); + } + if (cat_data.has(INV_PARENT_ID_LABEL)) + { + setParent(cat_data[INV_PARENT_ID_LABEL].asUUID()); + } + if (cat_data.has(INV_ASSET_TYPE_LABEL)) + { + setType(LLAssetType::lookup(cat_data[INV_ASSET_TYPE_LABEL].asString())); + } + if (cat_data.has(INV_PREFERRED_TYPE_LABEL)) + { + setPreferredType(LLFolderType::lookup(cat_data[INV_PREFERRED_TYPE_LABEL].asString())); + } + if (cat_data.has(INV_NAME_LABEL)) + { + mName = cat_data[INV_NAME_LABEL].asString(); + LLStringUtil::replaceNonstandardASCII(mName, ' '); + LLStringUtil::replaceChar(mName, '|', ' '); + } + + return true; +} ///---------------------------------------------------------------------------- /// Local function definitions ///---------------------------------------------------------------------------- diff --git a/indra/llinventory/llinventory.h b/indra/llinventory/llinventory.h index 96659cd602..0f336a072f 100644 --- a/indra/llinventory/llinventory.h +++ b/indra/llinventory/llinventory.h @@ -95,8 +95,7 @@ public: // Implemented here so that a minimal information set can be transmitted // between simulator and viewer. //-------------------------------------------------------------------- - // virtual BOOL importFile(LLFILE* fp); - virtual BOOL exportFile(LLFILE* fp, BOOL include_asset_key = TRUE) const; + virtual BOOL importLegacyStream(std::istream& input_stream); virtual BOOL exportLegacyStream(std::ostream& output_stream, BOOL include_asset_key = TRUE) const; @@ -197,8 +196,6 @@ public: // File Support //-------------------------------------------------------------------- public: - virtual BOOL importFile(LLFILE* fp); - virtual BOOL exportFile(LLFILE* fp, BOOL include_asset_key = TRUE) const; virtual BOOL importLegacyStream(std::istream& input_stream); virtual BOOL exportLegacyStream(std::ostream& output_stream, BOOL include_asset_key = TRUE) const; @@ -269,11 +266,11 @@ public: // File Support //-------------------------------------------------------------------- public: - virtual BOOL importFile(LLFILE* fp); - virtual BOOL exportFile(LLFILE* fp, BOOL include_asset_key = TRUE) const; virtual BOOL importLegacyStream(std::istream& input_stream); virtual BOOL exportLegacyStream(std::ostream& output_stream, BOOL include_asset_key = TRUE) const; + LLSD exportLLSD() const; + bool importLLSD(const LLSD& cat_data); //-------------------------------------------------------------------- // Member Variables //-------------------------------------------------------------------- diff --git a/indra/llinventory/llinventorysettings.cpp b/indra/llinventory/llinventorysettings.cpp index a2ed9e1596..4d4c002a03 100644 --- a/indra/llinventory/llinventorysettings.cpp +++ b/indra/llinventory/llinventorysettings.cpp @@ -33,10 +33,6 @@ #include "llsingleton.h" #include "llinvtranslationbrdg.h" -//========================================================================= -namespace { - LLTranslationBridge::ptr_t sTranslator; -} //========================================================================= struct SettingsEntry : public LLDictionaryEntry @@ -49,14 +45,14 @@ struct SettingsEntry : public LLDictionaryEntry mLabel(name), mIconName(iconName) { - std::string transdname = sTranslator->getString(mLabel); + std::string transdname = LLSettingsType::getInstance()->mTranslator->getString(mLabel); if (!transdname.empty()) { mLabel = transdname; } // Name of newly created setting is not translated - transdname = sTranslator->getString(mDefaultNewName); + transdname = LLSettingsType::getInstance()->mTranslator->getString(mDefaultNewName); if (!transdname.empty()) { mDefaultNewName = transdname; @@ -92,6 +88,16 @@ void LLSettingsDictionary::initSingleton() //========================================================================= +LLSettingsType::LLSettingsType(LLTranslationBridge::ptr_t &trans) +{ + mTranslator = trans; +} + +LLSettingsType::~LLSettingsType() +{ + mTranslator.reset(); +} + LLSettingsType::type_e LLSettingsType::fromInventoryFlags(U32 flags) { return (LLSettingsType::type_e)(flags & LLInventoryItemFlags::II_FLAGS_SUBTYPE_MASK); @@ -112,13 +118,3 @@ std::string LLSettingsType::getDefaultName(LLSettingsType::type_e type) return getDefaultName(ST_INVALID); return entry->mDefaultNewName; } - -void LLSettingsType::initClass(LLTranslationBridge::ptr_t &trans) -{ - sTranslator = trans; -} - -void LLSettingsType::cleanupClass() -{ - sTranslator.reset(); -} diff --git a/indra/llinventory/llinventorysettings.h b/indra/llinventory/llinventorysettings.h index 906540689c..6b6685d088 100644 --- a/indra/llinventory/llinventorysettings.h +++ b/indra/llinventory/llinventorysettings.h @@ -30,9 +30,15 @@ #include "llinventorytype.h" #include "llinvtranslationbrdg.h" +#include "llsingleton.h" -class LLSettingsType +class LLSettingsType : public LLParamSingleton { + LLSINGLETON(LLSettingsType, LLTranslationBridge::ptr_t &trans); + ~LLSettingsType(); + + friend struct SettingsEntry; + public: enum type_e { @@ -48,8 +54,9 @@ public: static LLInventoryType::EIconName getIconName(type_e type); static std::string getDefaultName(type_e type); - static void initClass(LLTranslationBridge::ptr_t &trans); - static void cleanupClass(); +protected: + + LLTranslationBridge::ptr_t mTranslator; }; diff --git a/indra/llinventory/llpermissions.cpp b/indra/llinventory/llpermissions.cpp index 572af4cdfb..fd9997b885 100644 --- a/indra/llinventory/llpermissions.cpp +++ b/indra/llinventory/llpermissions.cpp @@ -565,153 +565,6 @@ void LLPermissions::unpackMessage(LLMessageSystem* msg, const char* block, S32 b } -// -// File support -// - -// -void splitCacheDescOrName( char *aBuffer, char *&aJunk, char *&aValue ); -int splitCacheLine( char *aBuffer, char *&aKeyword, char *&aValue ); -// - -BOOL LLPermissions::importFile(LLFILE* fp) -{ - init(LLUUID::null, LLUUID::null, LLUUID::null, LLUUID::null); - const S32 BUFSIZE = 16384; - - // *NOTE: Changing the buffer size will require changing the scanf - // calls below. - char buffer[BUFSIZE]; /* Flawfinder: ignore */ - char keyword[256]; /* Flawfinder: ignore */ - char valuestr[256]; /* Flawfinder: ignore */ - char uuid_str[256]; /* Flawfinder: ignore */ - U32 mask; - - keyword[0] = '\0'; - valuestr[0] = '\0'; - - while (!feof(fp)) - { - if (fgets(buffer, BUFSIZE, fp) == NULL) - { - buffer[0] = '\0'; - } - - sscanf( /* Flawfinder: ignore */ - buffer, - " %255s %255s", - keyword, valuestr); - if (!strcmp("{", keyword)) - { - continue; - } - if (!strcmp("}",keyword)) - { - break; - } - else if (!strcmp("creator_mask", keyword)) - { - // legacy support for "creator" masks - sscanf(valuestr, "%x", &mask); - mMaskBase = mask; - fixFairUse(); - } - else if (!strcmp("base_mask", keyword)) - { - sscanf(valuestr, "%x", &mask); - mMaskBase = mask; - //fixFairUse(); - } - else if (!strcmp("owner_mask", keyword)) - { - sscanf(valuestr, "%x", &mask); - mMaskOwner = mask; - } - else if (!strcmp("group_mask", keyword)) - { - sscanf(valuestr, "%x", &mask); - mMaskGroup = mask; - } - else if (!strcmp("everyone_mask", keyword)) - { - sscanf(valuestr, "%x", &mask); - mMaskEveryone = mask; - } - else if (!strcmp("next_owner_mask", keyword)) - { - sscanf(valuestr, "%x", &mask); - mMaskNextOwner = mask; - } - else if (!strcmp("creator_id", keyword)) - { - sscanf(valuestr, "%255s", uuid_str); /* Flawfinder: ignore */ - mCreator.set(uuid_str); - } - else if (!strcmp("owner_id", keyword)) - { - sscanf(valuestr, "%255s", uuid_str); /* Flawfinder: ignore */ - mOwner.set(uuid_str); - } - else if (!strcmp("last_owner_id", keyword)) - { - sscanf(valuestr, "%255s", uuid_str); /* Flawfinder: ignore */ - mLastOwner.set(uuid_str); - } - else if (!strcmp("group_id", keyword)) - { - sscanf(valuestr, "%255s", uuid_str); /* Flawfinder: ignore */ - mGroup.set(uuid_str); - } - else if (!strcmp("group_owned", keyword)) - { - sscanf(valuestr, "%d", &mask); - if(mask) mIsGroupOwned = true; - else mIsGroupOwned = false; - } - else - { - LL_INFOS() << "unknown keyword " << keyword << " in permissions import" << LL_ENDL; - } - } - fix(); - return TRUE; -} - - -BOOL LLPermissions::exportFile(LLFILE* fp) const -{ - std::string uuid_str; - - fprintf(fp, "\tpermissions 0\n"); - fprintf(fp, "\t{\n"); - - fprintf(fp, "\t\tbase_mask\t%08x\n", mMaskBase); - fprintf(fp, "\t\towner_mask\t%08x\n", mMaskOwner); - fprintf(fp, "\t\tgroup_mask\t%08x\n", mMaskGroup); - fprintf(fp, "\t\teveryone_mask\t%08x\n", mMaskEveryone); - fprintf(fp, "\t\tnext_owner_mask\t%08x\n", mMaskNextOwner); - - mCreator.toString(uuid_str); - fprintf(fp, "\t\tcreator_id\t%s\n", uuid_str.c_str()); - - mOwner.toString(uuid_str); - fprintf(fp, "\t\towner_id\t%s\n", uuid_str.c_str()); - - mLastOwner.toString(uuid_str); - fprintf(fp, "\t\tlast_owner_id\t%s\n", uuid_str.c_str()); - - mGroup.toString(uuid_str); - fprintf(fp, "\t\tgroup_id\t%s\n", uuid_str.c_str()); - - if(mIsGroupOwned) - { - fprintf(fp, "\t\tgroup_owned\t1\n"); - } - fprintf(fp,"\t}\n"); - return TRUE; -} - - BOOL LLPermissions::importLegacyStream(std::istream& input_stream) { init(LLUUID::null, LLUUID::null, LLUUID::null, LLUUID::null); diff --git a/indra/llinventory/llpermissions.h b/indra/llinventory/llpermissions.h index 09d9b9171d..8646224b7e 100644 --- a/indra/llinventory/llpermissions.h +++ b/indra/llinventory/llpermissions.h @@ -312,10 +312,6 @@ public: void packMessage(LLMessageSystem* msg) const; void unpackMessage(LLMessageSystem* msg, const char* block, S32 block_num = 0); - // Load/save support - BOOL importFile(LLFILE* fp); - BOOL exportFile(LLFILE* fp) const; - BOOL importLegacyStream(std::istream& input_stream); BOOL exportLegacyStream(std::ostream& output_stream) const; diff --git a/indra/llinventory/llsaleinfo.cpp b/indra/llinventory/llsaleinfo.cpp index 63e34d188e..b7231ee239 100644 --- a/indra/llinventory/llsaleinfo.cpp +++ b/indra/llinventory/llsaleinfo.cpp @@ -78,16 +78,6 @@ U32 LLSaleInfo::getCRC32() const return rv; } - -BOOL LLSaleInfo::exportFile(LLFILE* fp) const -{ - fprintf(fp, "\tsale_info\t0\n\t{\n"); - fprintf(fp, "\t\tsale_type\t%s\n", lookup(mSaleType)); - fprintf(fp, "\t\tsale_price\t%d\n", mSalePrice); - fprintf(fp,"\t}\n"); - return TRUE; -} - BOOL LLSaleInfo::exportLegacyStream(std::ostream& output_stream) const { output_stream << "\tsale_info\t0\n\t{\n"; @@ -129,69 +119,6 @@ bool LLSaleInfo::fromLLSD(const LLSD& sd, BOOL& has_perm_mask, U32& perm_mask) return true; } -// Deleted LLSaleInfo::exportFileXML() and LLSaleInfo::importXML() -// because I can't find any non-test code references to it. 2009-05-04 JC - -BOOL LLSaleInfo::importFile(LLFILE* fp, BOOL& has_perm_mask, U32& perm_mask) -{ - has_perm_mask = FALSE; - - // *NOTE: Changing the buffer size will require changing the scanf - // calls below. - char buffer[MAX_STRING]; /* Flawfinder: ignore */ - char keyword[MAX_STRING]; /* Flawfinder: ignore */ - char valuestr[MAX_STRING]; /* Flawfinder: ignore */ - BOOL success = TRUE; - - keyword[0] = '\0'; - valuestr[0] = '\0'; - while(success && (!feof(fp))) - { - if (fgets(buffer, MAX_STRING, fp) == NULL) - { - buffer[0] = '\0'; - } - - sscanf( /* Flawfinder: ignore */ - buffer, - " %254s %254s", - keyword, valuestr); - if(!keyword[0]) - { - continue; - } - if(0 == strcmp("{",keyword)) - { - continue; - } - if(0 == strcmp("}", keyword)) - { - break; - } - else if(0 == strcmp("sale_type", keyword)) - { - mSaleType = lookup(valuestr); - } - else if(0 == strcmp("sale_price", keyword)) - { - sscanf(valuestr, "%d", &mSalePrice); - mSalePrice = llclamp(mSalePrice, 0, S32_MAX); - } - else if (!strcmp("perm_mask", keyword)) - { - //LL_INFOS() << "found deprecated keyword perm_mask" << LL_ENDL; - has_perm_mask = TRUE; - sscanf(valuestr, "%x", &perm_mask); - } - else - { - LL_WARNS() << "unknown keyword '" << keyword - << "' in sale info import" << LL_ENDL; - } - } - return success; -} - BOOL LLSaleInfo::importLegacyStream(std::istream& input_stream, BOOL& has_perm_mask, U32& perm_mask) { has_perm_mask = FALSE; diff --git a/indra/llinventory/llsaleinfo.h b/indra/llinventory/llsaleinfo.h index 4e98ccf6ff..3c8952838b 100644 --- a/indra/llinventory/llsaleinfo.h +++ b/indra/llinventory/llsaleinfo.h @@ -84,11 +84,6 @@ public: void setSalePrice(S32 price); //void setNextOwnerPermMask(U32 mask) { mNextOwnerPermMask = mask; } - - // file serialization - BOOL exportFile(LLFILE* fp) const; - BOOL importFile(LLFILE* fp, BOOL& has_perm_mask, U32& perm_mask); - BOOL exportLegacyStream(std::ostream& output_stream) const; LLSD asLLSD() const; operator LLSD() const { return asLLSD(); } diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index 1d118f0789..f7a9d5b7cd 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -359,7 +359,6 @@ protected: virtual parammapping_t getParameterMap() const { return parammapping_t(); } LLSD mSettings; - bool mIsValid; LLSD cloneSettings() const; diff --git a/indra/llinventory/tests/inventorymisc_test.cpp b/indra/llinventory/tests/inventorymisc_test.cpp index 7b15552f24..e8b063bffe 100644 --- a/indra/llinventory/tests/inventorymisc_test.cpp +++ b/indra/llinventory/tests/inventorymisc_test.cpp @@ -28,9 +28,9 @@ #include "linden_common.h" #include "llsd.h" +#include "llsdserialize.h" #include "../llinventory.h" - #include "../test/lltut.h" @@ -320,27 +320,39 @@ namespace tut template<> template<> void inventory_object::test<7>() { - LLFILE* fp = LLFile::fopen("linden_file.dat","w+"); - if(!fp) + std::string filename("linden_file.dat"); + llofstream fileXML(filename.c_str()); + if (!fileXML.is_open()) { LL_ERRS() << "file could not be opened\n" << LL_ENDL; return; } LLPointer src1 = create_random_inventory_item(); - src1->exportFile(fp, TRUE); - fclose(fp); + fileXML << LLSDOStreamer(src1->asLLSD()) << std::endl; + fileXML.close(); - LLPointer src2 = new LLInventoryItem(); - fp = LLFile::fopen("linden_file.dat","r+"); - if(!fp) + + LLPointer src2 = new LLInventoryItem(); + llifstream file(filename.c_str()); + if (!file.is_open()) { LL_ERRS() << "file could not be opened\n" << LL_ENDL; return; } - - src2->importFile(fp); - fclose(fp); + std::string line; + LLPointer parser = new LLSDNotationParser(); + std::getline(file, line); + LLSD s_item; + std::istringstream iss(line); + if (parser->parse(iss, s_item, line.length()) == LLSDParser::PARSE_FAILURE) + { + LL_ERRS()<< "Parsing cache failed" << LL_ENDL; + return; + } + src2->fromLLSD(s_item); + + file.close(); ensure_equals("1.item id::getUUID() failed", src1->getUUID(), src2->getUUID()); ensure_equals("2.parent::getParentUUID() failed", src1->getParentUUID(), src2->getParentUUID()); @@ -457,27 +469,39 @@ namespace tut template<> template<> void inventory_object::test<13>() { - LLFILE* fp = LLFile::fopen("linden_file.dat","w"); - if(!fp) + std::string filename("linden_file.dat"); + llofstream fileXML(filename.c_str()); + if (!fileXML.is_open()) { - LL_ERRS() << "file coudnt be opened\n" << LL_ENDL; + LL_ERRS() << "file could not be opened\n" << LL_ENDL; return; } - - LLPointer src1 = create_random_inventory_cat(); - src1->exportFile(fp, TRUE); - fclose(fp); - LLPointer src2 = new LLInventoryCategory(); - fp = LLFile::fopen("linden_file.dat","r"); - if(!fp) + LLPointer src1 = create_random_inventory_cat(); + fileXML << LLSDOStreamer(src1->exportLLSD()) << std::endl; + fileXML.close(); + + llifstream file(filename.c_str()); + if (!file.is_open()) { - LL_ERRS() << "file coudnt be opened\n" << LL_ENDL; + LL_ERRS() << "file could not be opened\n" << LL_ENDL; return; } - - src2->importFile(fp); - fclose(fp); + std::string line; + LLPointer parser = new LLSDNotationParser(); + std::getline(file, line); + LLSD s_item; + std::istringstream iss(line); + if (parser->parse(iss, s_item, line.length()) == LLSDParser::PARSE_FAILURE) + { + LL_ERRS()<< "Parsing cache failed" << LL_ENDL; + return; + } + + file.close(); + + LLPointer src2 = new LLInventoryCategory(); + src2->importLLSD(s_item); ensure_equals("1.item id::getUUID() failed", src1->getUUID(), src2->getUUID()); ensure_equals("2.parent::getParentUUID() failed", src1->getParentUUID(), src2->getParentUUID()); diff --git a/indra/llkdu/include_kdu_xxxx.h b/indra/llkdu/include_kdu_xxxx.h index 61204b5689..4503d2b751 100644 --- a/indra/llkdu/include_kdu_xxxx.h +++ b/indra/llkdu/include_kdu_xxxx.h @@ -21,6 +21,7 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wself-assign-field" #pragma clang diagnostic ignored "-Wunused-private-field" +#pragma clang diagnostic ignored "-Woverloaded-virtual" // Silence Clang warning the flag doesn't for some reason #include kdu_xxxx #pragma clang diagnostic pop #elif LL_WINDOWS diff --git a/indra/llkdu/llimagej2ckdu.h b/indra/llkdu/llimagej2ckdu.h index 4895abdfc7..d82189b5df 100644 --- a/indra/llkdu/llimagej2ckdu.h +++ b/indra/llkdu/llimagej2ckdu.h @@ -32,7 +32,9 @@ // // KDU core header files // +#ifndef LL_WINDOWS #define KDU_NO_THREADS +#endif #include "kdu_elementary.h" #include "kdu_messaging.h" diff --git a/indra/llkdu/llkdumem.h b/indra/llkdu/llkdumem.h index 4d9a48e575..44757a4bfc 100644 --- a/indra/llkdu/llkdumem.h +++ b/indra/llkdu/llkdumem.h @@ -27,14 +27,10 @@ #ifndef LL_LLKDUMEM_H #define LL_LLKDUMEM_H -// Silence Clang warning the flag doesn't for some reason -#if __clang__ -#pragma clang diagnostic ignored "-Woverloaded-virtual" -#endif -// - // Support classes for reading and writing from memory buffers in KDU +#ifndef LL_WINDOWS #define KDU_NO_THREADS +#endif #define kdu_xxxx "kdu_image.h" #include "include_kdu_xxxx.h" diff --git a/indra/llmessage/llcoproceduremanager.cpp b/indra/llmessage/llcoproceduremanager.cpp index b4169f7dab..f3f87d15f6 100644 --- a/indra/llmessage/llcoproceduremanager.cpp +++ b/indra/llmessage/llcoproceduremanager.cpp @@ -360,7 +360,7 @@ LLUUID LLCoprocedurePool::enqueueCoprocedure(const std::string &name, LLCoproced } // The queue should never fill up. - LL_ERRS("CoProcMgr") << "Enqueue failed (" << unsigned(pushed) << ")" << LL_ENDL; + LL_ERRS("CoProcMgr") << "Enqueue into '" << name << "' failed (" << unsigned(pushed) << ")" << LL_ENDL; return {}; // never executed, pacify the compiler } diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp index a7172aa89a..1a839ed7e7 100644 --- a/indra/llplugin/llpluginclassmedia.cpp +++ b/indra/llplugin/llpluginclassmedia.cpp @@ -863,12 +863,12 @@ void LLPluginClassMedia::paste() } void LLPluginClassMedia::setUserDataPath(const std::string &user_data_path_cache, - const std::string &user_data_path_cookies, + const std::string &username, const std::string &user_data_path_cef_log) { LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "set_user_data_path"); - message.setValue("cache_path", user_data_path_cache); - message.setValue("cookies_path", user_data_path_cookies); + message.setValue("cache_path", user_data_path_cache); + message.setValue("username", username); // cef shares cache between users but creates user-based contexts message.setValue("cef_log_file", user_data_path_cef_log); bool cef_verbose_log = gSavedSettings.getBOOL("CefVerboseLog"); diff --git a/indra/llplugin/llpluginclassmedia.h b/indra/llplugin/llpluginclassmedia.h index 730dd79bb1..ed9de254fe 100644 --- a/indra/llplugin/llpluginclassmedia.h +++ b/indra/llplugin/llpluginclassmedia.h @@ -195,7 +195,7 @@ public: bool canPaste() const { return mCanPaste; }; // These can be called before init(), and they will be queued and sent before the media init message. - void setUserDataPath(const std::string &user_data_path_cache, const std::string &user_data_path_cookies, const std::string &user_data_path_cef_log); + void setUserDataPath(const std::string &user_data_path_cache, const std::string &username, const std::string &user_data_path_cef_log); void setLanguageCode(const std::string &language_code); void setPluginsEnabled(const bool enabled); void setJavascriptEnabled(const bool enabled); diff --git a/indra/llplugin/llpluginprocesschild.cpp b/indra/llplugin/llpluginprocesschild.cpp index c5304d2ccf..d93ec8cf4b 100644 --- a/indra/llplugin/llpluginprocesschild.cpp +++ b/indra/llplugin/llpluginprocesschild.cpp @@ -225,6 +225,18 @@ void LLPluginProcessChild::idle(void) } setState(STATE_UNLOADED); } + + if (mInstance) + { + // Provide some time to the plugin + // example: CEF on "cleanup" sets shutdown request, but it still needs idle loop to actually shutdown + LLPluginMessage message("base", "idle"); + message.setValueReal("time", PLUGIN_IDLE_SECONDS); + sendMessageToPlugin(message); + + mInstance->idle(); + } + break; case STATE_UNLOADED: diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index ea6b49616a..7acf904a77 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -2705,9 +2705,10 @@ LLGLSPipelineBlendSkyBox::LLGLSPipelineBlendSkyBox(bool depth_test, bool depth_w } #if LL_WINDOWS -// Expose desired use of high-performance graphics processor to Optimus driver +// Expose desired use of high-performance graphics processor to Optimus driver and to AMD driver extern "C" -{ - _declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001; +{ + __declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001; + __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1; } #endif diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index b9f74ab91c..dc49099bdd 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -1394,6 +1394,15 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const LLImageRaw* imageraw, S return FALSE; } + if (mHasExplicitFormat && + ((mFormatPrimary == GL_RGBA && mComponents < 4) || + (mFormatPrimary == GL_RGB && mComponents < 3))) + + { + LL_WARNS() << "Incorrect format: " << std::hex << mFormatPrimary << " components: " << (U32)mComponents << LL_ENDL; + mHasExplicitFormat = FALSE; + } + if( !mHasExplicitFormat ) { switch (mComponents) diff --git a/indra/llrender/llimagegl.h b/indra/llrender/llimagegl.h index 67037d7b18..01fb7b0ee1 100644 --- a/indra/llrender/llimagegl.h +++ b/indra/llrender/llimagegl.h @@ -136,6 +136,7 @@ public: S32 getMipBytes(S32 discard_level = -1) const; BOOL getBoundRecently() const; BOOL isJustBound() const; + BOOL getHasExplicitFormat() const { return mHasExplicitFormat; } LLGLenum getPrimaryFormat() const { return mFormatPrimary; } LLGLenum getFormatType() const { return mFormatType; } @@ -203,7 +204,7 @@ private: U16 mPickMaskWidth; U16 mPickMaskHeight; S8 mUseMipMaps; - S8 mHasExplicitFormat; // If false (default), GL format is f(mComponents) + BOOL mHasExplicitFormat; // If false (default), GL format is f(mComponents) S8 mAutoGenMips; BOOL mIsMask; diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 61bf6f2025..5130d75c5e 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -1097,7 +1097,12 @@ LLRender::LLRender() //mQuadCycle(0), // Remove QUADS rendering mode mMode(LLRender::TRIANGLES), mCurrTextureUnitIndex(0), - mMaxAnisotropy(0.f) + mMaxAnisotropy(0.f), + mLineWidth(1.f), // Line width OGL core profile fix by Rye Mutt + // Don't ignore OpenGL max line width + mMaxLineWidthSmooth(1.f), + mMaxLineWidthAliased(1.f) + // { mTexUnits.reserve(LL_NUM_TEXTURE_LAYERS); for (U32 i = 0; i < LL_NUM_TEXTURE_LAYERS; i++) @@ -1163,6 +1168,16 @@ void LLRender::init() initVB(); // stop_glerror(); + + // Don't ignore OpenGL max line width + GLint range[2]; + glGetIntegerv(GL_ALIASED_LINE_WIDTH_RANGE, range); + stop_glerror(); + mMaxLineWidthAliased = F32(range[1]); + glGetIntegerv(GL_SMOOTH_LINE_WIDTH_RANGE, range); + stop_glerror(); + mMaxLineWidthSmooth = F32(range[1]); + // } void LLRender::shutdown() @@ -1889,6 +1904,29 @@ void LLRender::setAmbientLightColor(const LLColor4& color) } } +// Line width OGL core profile fix by Rye Mutt +void LLRender::setLineWidth(F32 line_width) +{ + if (LLRender::sGLCoreProfile) + { + line_width = 1.f; + } + else if (line_width > 1.f) + { + line_width = llmin(line_width, glIsEnabled(GL_LINE_SMOOTH) ? mMaxLineWidthSmooth : mMaxLineWidthAliased); + } + if (mLineWidth != line_width || mDirty) + { + if (mMode == LLRender::LINES || mMode == LLRender::LINE_STRIP) + { + flush(); + } + mLineWidth = line_width; + glLineWidth(line_width); + } +} +// + bool LLRender::verifyTexUnitActive(U32 unitToVerify) { if (mCurrTextureUnitIndex == unitToVerify) diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h index 4c1ddb8903..4f3786ef9b 100644 --- a/indra/llrender/llrender.h +++ b/indra/llrender/llrender.h @@ -456,6 +456,8 @@ public: LLLightState* getLight(U32 index); void setAmbientLightColor(const LLColor4& color); + void setLineWidth(F32 line_width); // Line width OGL core profile fix by Rye Mutt + LLTexUnit* getTexUnit(U32 index); U32 getCurrentTexUnitIndex(void) const { return mCurrTextureUnitIndex; } @@ -500,6 +502,11 @@ private: bool mCurrColorMask[4]; eCompareFunc mCurrAlphaFunc; F32 mCurrAlphaFuncVal; + F32 mLineWidth; // Line width OGL core profile fix by Rye Mutt + // Don't ignore OpenGL max line width + F32 mMaxLineWidthSmooth; + F32 mMaxLineWidthAliased; + // LLPointer mBuffer; LLStrider mVerticesp; diff --git a/indra/llrender/llrender2dutils.cpp b/indra/llrender/llrender2dutils.cpp index b2ed145e12..92d90899c5 100644 --- a/indra/llrender/llrender2dutils.cpp +++ b/indra/llrender/llrender2dutils.cpp @@ -971,7 +971,7 @@ void gl_stippled_line_3d( const LLVector3& start, const LLVector3& end, const LL gGL.color4f(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], color.mV[VALPHA]); gGL.flush(); - glLineWidth(2.5f); + gGL.setLineWidth(2.5f); // Line width OGL core profile fix by Rye Mutt if (!LLGLSLShader::sNoFixedFunction) { @@ -2069,8 +2069,10 @@ void LLRender2D::loadIdentity() // static void LLRender2D::setLineWidth(F32 width) { - gGL.flush(); - glLineWidth(width * lerp(LLRender::sUIGLScaleFactor.mV[VX], LLRender::sUIGLScaleFactor.mV[VY], 0.5f)); + // Line width OGL core profile fix by Rye Mutt + //gGL.flush(); + //glLineWidth(width * lerp(LLRender::sUIGLScaleFactor.mV[VX], LLRender::sUIGLScaleFactor.mV[VY], 0.5f)); + gGL.setLineWidth(width * lerp(LLRender::sUIGLScaleFactor.mV[VX], LLRender::sUIGLScaleFactor.mV[VY], 0.5f)); } LLPointer LLRender2D::getUIImageByID(const LLUUID& image_id, S32 priority) diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 4a995fd60c..26b958fc99 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -1367,7 +1367,7 @@ bool LLVertexBuffer::createGLBuffer(U32 size) return true; } - bool sucsess = true; + bool success = true; mEmpty = true; @@ -1389,9 +1389,9 @@ bool LLVertexBuffer::createGLBuffer(U32 size) if (!mMappedData) { - sucsess = false; + success = false; } - return sucsess; + return success; } bool LLVertexBuffer::createGLIndices(U32 size) @@ -1406,7 +1406,7 @@ bool LLVertexBuffer::createGLIndices(U32 size) return true; } - bool sucsess = true; + bool success = true; mEmpty = true; @@ -1431,9 +1431,9 @@ bool LLVertexBuffer::createGLIndices(U32 size) if (!mMappedIndexData) { - sucsess = false; + success = false; } - return sucsess; + return success; } void LLVertexBuffer::destroyGLBuffer() @@ -1480,7 +1480,7 @@ bool LLVertexBuffer::updateNumVerts(S32 nverts) { llassert(nverts >= 0); - bool sucsess = true; + bool success = true; if (nverts > 65536) { @@ -1492,34 +1492,34 @@ bool LLVertexBuffer::updateNumVerts(S32 nverts) if (needed_size > mSize || needed_size <= mSize/2) { - sucsess &= createGLBuffer(needed_size); + success &= createGLBuffer(needed_size); } sVertexCount -= mNumVerts; mNumVerts = nverts; sVertexCount += mNumVerts; - return sucsess; + return success; } bool LLVertexBuffer::updateNumIndices(S32 nindices) { llassert(nindices >= 0); - bool sucsess = true; + bool success = true; U32 needed_size = sizeof(U16) * nindices; if (needed_size > mIndicesSize || needed_size <= mIndicesSize/2) { - sucsess &= createGLIndices(needed_size); + success &= createGLIndices(needed_size); } sIndexCount -= mNumIndices; mNumIndices = nindices; sIndexCount += mNumIndices; - return sucsess; + return success; } bool LLVertexBuffer::allocateBuffer(S32 nverts, S32 nindices, bool create) @@ -1532,10 +1532,10 @@ bool LLVertexBuffer::allocateBuffer(S32 nverts, S32 nindices, bool create) LL_ERRS() << "Bad vertex buffer allocation: " << nverts << " : " << nindices << LL_ENDL; } - bool sucsess = true; + bool success = true; - sucsess &= updateNumVerts(nverts); - sucsess &= updateNumIndices(nindices); + success &= updateNumVerts(nverts); + success &= updateNumIndices(nindices); if (create && (nverts || nindices)) { @@ -1551,7 +1551,7 @@ bool LLVertexBuffer::allocateBuffer(S32 nverts, S32 nindices, bool create) } } - return sucsess; + return success; } static LLTrace::BlockTimerStatHandle FTM_SETUP_VERTEX_ARRAY("Setup VAO"); diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 7a1c9a2749..1774ead25a 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -3422,6 +3422,22 @@ void LLFloaterView::setUtilityBarRect(LLLayoutPanel* panel, const LLRect& utilit // Just assume right end of utility bar is always the border of the window mUtilityBarRect.mRight = S32_MAX; } + +const LLRect& LLFloaterView::getToolbarRect(LLToolBarEnums::EToolBarLocation tb) const +{ + switch (tb) + { + case LLToolBarEnums::TOOLBAR_LEFT: + return mToolbarLeftRect; + case LLToolBarEnums::TOOLBAR_BOTTOM: + return mToolbarBottomRect; + case LLToolBarEnums::TOOLBAR_RIGHT: + return mToolbarRightRect; + default: + LL_WARNS() << "getToolbarRect() passed odd toolbar number " << (S32) tb << LL_ENDL; + return LLRect::null; + } +} // void LLFloater::setInstanceName(const std::string& name) diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 8f516bef9a..bf8df7b8ce 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -628,6 +628,9 @@ public: // Prevent floaters being dragged under main chat bar void setMainChatbarRect(LLLayoutPanel* panel, const LLRect& chatbar_rect); void setUtilityBarRect(LLLayoutPanel* panel, const LLRect& utility_bar_rect); + const LLRect& getMainChatbarRect() const { return mMainChatbarRect; } + const LLRect& getUtilityBarRect() const { return mUtilityBarRect; } + const LLRect& getToolbarRect(LLToolBarEnums::EToolBarLocation tb) const; private: void hiddenFloaterClosed(LLFloater* floater); diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index 31d255937b..c897130e5e 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -129,6 +129,7 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p) : LLView(p), mLabelWidth(0), mLabelWidthDirty(false), + mSuffixNeedsRefresh(false), mLabelPaddingRight(DEFAULT_LABEL_PADDING_RIGHT), mParentFolder( NULL ), mIsSelected( FALSE ), @@ -200,11 +201,25 @@ LLFolderViewItem::~LLFolderViewItem() BOOL LLFolderViewItem::postBuild() { - refresh(); + LLFolderViewModelItem& vmi = *getViewModelItem(); + // getDisplayName() is expensive (due to internal getLabelSuffix() and name building) + // it also sets search strings so it requires a filter reset + mLabel = vmi.getDisplayName(); + setToolTip(vmi.getName()); + + // Dirty the filter flag of the model from the view (CHUI-849) + vmi.dirtyFilter(); + + // Don't do full refresh on constructor if it is possible to avoid + // it significantly slows down bulk view creation. + // Todo: Ideally we need to move getDisplayName() out of constructor as well. + // Like: make a logic that will let filter update search string, + // while LLFolderViewItem::arrange() updates visual part + mSuffixNeedsRefresh = true; + mLabelWidthDirty = true; return TRUE; } - LLFolderView* LLFolderViewItem::getRoot() { return mRoot; @@ -299,24 +314,51 @@ BOOL LLFolderViewItem::isPotentiallyVisible(S32 filter_generation) void LLFolderViewItem::refresh() { - LLFolderViewModelItem& vmi = *getViewModelItem(); + LLFolderViewModelItem& vmi = *getViewModelItem(); - mLabel = vmi.getDisplayName(); + mLabel = vmi.getDisplayName(); + setToolTip(vmi.getName()); + // icons are slightly expensive to get, can be optimized + // see LLInventoryIcon::getIcon() + mIcon = vmi.getIcon(); + mIconOpen = vmi.getIconOpen(); + mIconOverlay = vmi.getIconOverlay(); - setToolTip(vmi.getName()); - mIcon = vmi.getIcon(); - mIconOpen = vmi.getIconOpen(); - mIconOverlay = vmi.getIconOverlay(); + if (mRoot->useLabelSuffix()) + { + // Very Expensive! + // Can do a number of expensive checks, like checking active motions, wearables or friend list + mLabelStyle = vmi.getLabelStyle(); + mLabelSuffix = vmi.getLabelSuffix(); + } + + // Dirty the filter flag of the model from the view (CHUI-849) + vmi.dirtyFilter(); + + mLabelWidthDirty = true; + mSuffixNeedsRefresh = false; +} + +void LLFolderViewItem::refreshSuffix() +{ + LLFolderViewModelItem const* vmi = getViewModelItem(); + + // icons are slightly expensive to get, can be optimized + // see LLInventoryIcon::getIcon() + mIcon = vmi->getIcon(); + mIconOpen = vmi->getIconOpen(); + mIconOverlay = vmi->getIconOverlay(); if (mRoot->useLabelSuffix()) { - mLabelStyle = vmi.getLabelStyle(); - mLabelSuffix = vmi.getLabelSuffix(); + // Very Expensive! + // Can do a number of expensive checks, like checking active motions, wearables or friend list + mLabelStyle = vmi->getLabelStyle(); + mLabelSuffix = vmi->getLabelSuffix(); } - mLabelWidthDirty = true; - // Dirty the filter flag of the model from the view (CHUI-849) - vmi.dirtyFilter(); + mLabelWidthDirty = true; + mSuffixNeedsRefresh = false; } // Utility function for LLFolderView @@ -385,6 +427,12 @@ S32 LLFolderViewItem::arrange( S32* width, S32* height ) if (mLabelWidthDirty) { + if (mSuffixNeedsRefresh) + { + // Expensive. But despite refreshing label, + // it is purely visual, so it is fine to do at our laisure + refreshSuffix(); + } mLabelWidth = getLabelXPos() + getLabelFontForStyle(mLabelStyle)->getWidth(mLabel) + getLabelFontForStyle(mLabelStyle)->getWidth(mLabelSuffix) + mLabelPaddingRight; mLabelWidthDirty = false; } diff --git a/indra/llui/llfolderviewitem.h b/indra/llui/llfolderviewitem.h index 51d07769fc..7baf88a629 100644 --- a/indra/llui/llfolderviewitem.h +++ b/indra/llui/llfolderviewitem.h @@ -99,6 +99,7 @@ protected: LLPointer mViewModelItem; LLFontGL::StyleFlags mLabelStyle; std::string mLabelSuffix; + bool mSuffixNeedsRefresh; //suffix and icons LLUIImagePtr mIcon, mIconOpen, mIconOverlay; @@ -276,8 +277,13 @@ public: virtual BOOL passedFilter(S32 filter_generation = -1); virtual BOOL isPotentiallyVisible(S32 filter_generation = -1); - // refresh information from the object being viewed. - virtual void refresh(); + // refresh information from the object being viewed. + // refreshes label, suffixes and sets icons. Expensive! + // Causes filter update + virtual void refresh(); + // refreshes suffixes and sets icons. Expensive! + // Does not need filter update + virtual void refreshSuffix(); // LLView functionality virtual BOOL handleRightMouseDown( S32 x, S32 y, MASK mask ); diff --git a/indra/llui/llfolderviewmodel.h b/indra/llui/llfolderviewmodel.h index cbd0cd8d46..082eb91368 100644 --- a/indra/llui/llfolderviewmodel.h +++ b/indra/llui/llfolderviewmodel.h @@ -295,26 +295,7 @@ public: typedef std::list child_list_t; virtual void addChild(LLFolderViewModelItem* child) - { - // Avoid duplicates: bail out if that child is already present in the list - // Note: this happens when models are created before views - - // Ugh, linear search! Replace this by simply looking if the parent matches - - // child_list_t::const_iterator iter; - // for (iter = mChildren.begin(); iter != mChildren.end(); iter++) - // { - // if (child == *iter) - // { - // return; - // } - // } - - if( child->getParent() == this ) - return; - - // - + { mChildren.push_back(child); child->setParent(this); dirtyFilter(); diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index c7f82dca0d..1b2d49ea36 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -4019,25 +4019,54 @@ void LLTearOffMenu::closeTearOff() } LLContextMenuBranch::LLContextMenuBranch(const LLContextMenuBranch::Params& p) -: LLMenuItemGL(p), - mBranch( p.branch()->getHandle() ) +: LLMenuItemGL(p) + //mBranch( p.branch()->getHandle() ) // Context menu memory leak fix by Rye Mutt { - mBranch.get()->hide(); - mBranch.get()->setParentMenuItem(this); + // Context menu memory leak fix by Rye Mutt + //mBranch.get()->hide(); + //mBranch.get()->setParentMenuItem(this); + // + LLContextMenu* branch = static_cast(p.branch); + if (branch) + { + mBranch = branch->getHandle(); + branch->hide(); + branch->setParentMenuItem(this); + } } +// Context menu memory leak fix by Rye Mutt +LLContextMenuBranch::~LLContextMenuBranch() +{ + if (mBranch.get()) + { + mBranch.get()->die(); + } +} +// + // called to rebuild the draw label void LLContextMenuBranch::buildDrawLabel( void ) { + // Context menu memory leak fix by Rye Mutt + auto menu = getBranch(); + if (menu) + // { // default enablement is this -- if any of the subitems are // enabled, this item is enabled. JC - U32 sub_count = mBranch.get()->getItemCount(); + // Context menu memory leak fix by Rye Mutt + //U32 sub_count = mBranch.get()->getItemCount(); + U32 sub_count = menu->getItemCount(); + // U32 i; BOOL any_enabled = FALSE; for (i = 0; i < sub_count; i++) { - LLMenuItemGL* item = mBranch.get()->getItem(i); + // Context menu memory leak fix by Rye Mutt + //LLMenuItemGL* item = mBranch.get()->getItem(i); + LLMenuItemGL* item = menu->getItem(i); + // item->buildDrawLabel(); if (item->getEnabled() && !item->getDrawTextDisabled() ) { @@ -4059,14 +4088,28 @@ void LLContextMenuBranch::buildDrawLabel( void ) void LLContextMenuBranch::showSubMenu() { - LLMenuItemGL* menu_item = mBranch.get()->getParentMenuItem(); - if (menu_item != NULL && menu_item->getVisible()) + // Context menu memory leak fix by Rye Mutt + //LLMenuItemGL* menu_item = mBranch.get()->getParentMenuItem(); + //if (menu_item != NULL && menu_item->getVisible()) + //{ + // S32 center_x; + // S32 center_y; + // localPointToScreen(getRect().getWidth(), getRect().getHeight() , ¢er_x, ¢er_y); + // mBranch.get()->show(center_x, center_y); + //} + auto menu = getBranch(); + if (menu) { - S32 center_x; - S32 center_y; - localPointToScreen(getRect().getWidth(), getRect().getHeight() , ¢er_x, ¢er_y); - mBranch.get()->show(center_x, center_y); + LLMenuItemGL* menu_item = menu->getParentMenuItem(); + if (menu_item != NULL && menu_item->getVisible()) + { + S32 center_x; + S32 center_y; + localPointToScreen(getRect().getWidth(), getRect().getHeight() , ¢er_x, ¢er_y); + menu->show(center_x, center_y); + } } + // } // onCommit() - do the primary funcationality of the menu item. @@ -4079,14 +4122,28 @@ void LLContextMenuBranch::setHighlight( BOOL highlight ) { if (highlight == getHighlight()) return; LLMenuItemGL::setHighlight(highlight); - if( highlight ) + // Context menu memory leak fix by Rye Mutt + //if( highlight ) + //{ + // showSubMenu(); + //} + //else + //{ + // mBranch.get()->hide(); + //} + auto menu = getBranch(); + if (menu) { - showSubMenu(); - } - else - { - mBranch.get()->hide(); + if (highlight) + { + showSubMenu(); + } + else + { + menu->hide(); + } } + // } diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h index e86aea1ebf..e47dfd7523 100644 --- a/indra/llui/llmenugl.h +++ b/indra/llui/llmenugl.h @@ -744,8 +744,11 @@ public: LLContextMenuBranch(const Params&); - virtual ~LLContextMenuBranch() - {} + // Context menu memory leak fix by Rye Mutt + //virtual ~LLContextMenuBranch() + //{} + virtual ~LLContextMenuBranch(); + // // called to rebuild the draw label virtual void buildDrawLabel( void ); diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index 2295ec04b8..d7df19f5cb 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -499,7 +499,8 @@ LLNotification::LLNotification(const LLSDParamAdapter& p) : mResponderObj(NULL), mId(p.id.isProvided() ? p.id : LLUUID::generateNewID()), mOfferFromAgent(p.offer_from_agent), - mIsDND(p.is_dnd) + mIsDND(p.is_dnd), + mIsFromStorage(false)// FIRE-11339: Persisted group notifications get logged to IM on each login { if (p.functor.name.isChosen()) { diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index 1d2f3e75ec..3b9f61b345 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -400,6 +400,7 @@ private: LLNotificationResponderPtr mResponder; bool mOfferFromAgent; bool mIsDND; + bool mIsFromStorage; // FIRE-11339: Persisted group notifications get logged to IM on each login // a reference to the template LLNotificationTemplatePtr mTemplatep; @@ -557,6 +558,18 @@ public: mIsDND = flag; } + // FIRE-11339: Persisted group notifications get logged to IM on each login + bool isFromStorage() const + { + return mIsFromStorage; + } + + void setIsFromStorage(bool logged) + { + mIsFromStorage = logged; + } + // + std::string getType() const; std::string getMessage() const; std::string getFooter() const; diff --git a/indra/llui/llspellcheck.cpp b/indra/llui/llspellcheck.cpp index 63a86fc0b2..8331f7bad9 100644 --- a/indra/llui/llspellcheck.cpp +++ b/indra/llui/llspellcheck.cpp @@ -49,8 +49,6 @@ LLSpellChecker::settings_change_signal_t LLSpellChecker::sSettingsChangeSignal; LLSpellChecker::LLSpellChecker() : mHunspell(NULL) { - // Load initial dictionary information - //refreshDictionaryMap(); // FIRE-29649: Crash when opening spellcheck settings } LLSpellChecker::~LLSpellChecker() @@ -58,13 +56,11 @@ LLSpellChecker::~LLSpellChecker() delete mHunspell; } -// FIRE-29649: Crash when opening spellcheck settings void LLSpellChecker::initSingleton() { // Load initial dictionary information refreshDictionaryMap(); } -// bool LLSpellChecker::checkSpelling(const std::string& word) const { diff --git a/indra/llui/llspellcheck.h b/indra/llui/llspellcheck.h index 36628780a3..3da5e30955 100644 --- a/indra/llui/llspellcheck.h +++ b/indra/llui/llspellcheck.h @@ -47,7 +47,7 @@ public: protected: void addToDictFile(const std::string& dict_path, const std::string& word); void initHunspell(const std::string& dict_language); - void initSingleton(); // FIRE-29649: Crash when opening spellcheck settings + void initSingleton(); public: typedef std::list dict_list_t; diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 2278791af9..ab40ecc0c9 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1139,7 +1139,10 @@ BOOL LLTextBase::handleMouseDown(S32 x, S32 y, MASK mask) BOOL LLTextBase::handleMouseUp(S32 x, S32 y, MASK mask) { LLTextSegmentPtr cur_segment = getSegmentAtLocalPos(x, y); - if (hasMouseCapture() && cur_segment && cur_segment->handleMouseUp(x, y, mask)) + // FIRE-23523 left click does not work on notifications with embedded links + // if (hasMouseCapture() && cur_segment && cur_segment->handleMouseUp(x, y, mask)) + if (cur_segment && cur_segment->handleMouseUp(x, y, mask)) + // { // Did we just click on a link? if (mURLClickSignal diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index ab938cb2e7..493060886c 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -486,6 +486,19 @@ void LLUI::positionViewNearMouse(LLView* view, S32 spawn_x, S32 spawn_y) LLRect virtual_window_rect = parent->getLocalRect(); + // FIRE-5369: Make sure inspect floater and tooltips don't open partially underneath toolbars + if (parent == gFloaterView) + { + S32 left_toolbar_width = gFloaterView->getToolbarRect(LLToolBarEnums::TOOLBAR_LEFT).getWidth(); + S32 right_toolbar_width = gFloaterView->getToolbarRect(LLToolBarEnums::TOOLBAR_RIGHT).getWidth(); + S32 bottom_toolbar_height = gFloaterView->getToolbarRect(LLToolBarEnums::TOOLBAR_BOTTOM).getHeight(); + virtual_window_rect.mLeft += (left_toolbar_width - 2 * FLOATER_MIN_VISIBLE_PIXELS); + virtual_window_rect.mRight -= (right_toolbar_width - 2 * FLOATER_MIN_VISIBLE_PIXELS); + virtual_window_rect.mBottom += (bottom_toolbar_height - 2 * FLOATER_MIN_VISIBLE_PIXELS); + virtual_window_rect.mBottom += gFloaterView->getUtilityBarRect().getHeight(); + } + // + LLRect mouse_rect; const S32 MOUSE_CURSOR_PADDING = 1; mouse_rect.setLeftTopAndSize(mouse_x - MOUSE_CURSOR_PADDING, diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index dfe7575fcd..529d21b3bd 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -520,13 +520,17 @@ std::string LLUrlEntrySLURL::getLocation(const std::string &url) const } // -// LLUrlEntrySeconlifeURL Describes *secondlife.com/ *lindenlab.com/ and *tilia-inc.com/ urls to substitute icon 'hand.png' before link +// LLUrlEntrySeconlifeURL Describes *secondlife.com/ *lindenlab.com/ *secondlifegrid.net/ and *tilia-inc.com/ urls to substitute icon 'hand.png' before link // LLUrlEntrySecondlifeURL::LLUrlEntrySecondlifeURL() { mPattern = boost::regex("((http://([-\\w\\.]*\\.)?(secondlife|lindenlab|tilia-inc)\\.com)" "|" - "(https://([-\\w\\.]*\\.)?(secondlife|lindenlab|tilia-inc)\\.com(:\\d{1,5})?))" + "(http://([-\\w\\.]*\\.)?secondlifegrid\\.net)" + "|" + "(https://([-\\w\\.]*\\.)?(secondlife|lindenlab|tilia-inc)\\.com(:\\d{1,5})?)" + "|" + "(https://([-\\w\\.]*\\.)?secondlifegrid\\.net(:\\d{1,5})?))" "\\/\\S*", boost::regex::perl|boost::regex::icase); @@ -564,12 +568,14 @@ std::string LLUrlEntrySecondlifeURL::getTooltip(const std::string &url) const } // -// LLUrlEntrySimpleSecondlifeURL Describes *secondlife.com *lindenlab.com and *tilia-inc.com urls to substitute icon 'hand.png' before link +// LLUrlEntrySimpleSecondlifeURL Describes *secondlife.com *lindenlab.com *secondlifegrid.net and *tilia-inc.com urls to substitute icon 'hand.png' before link // LLUrlEntrySimpleSecondlifeURL::LLUrlEntrySimpleSecondlifeURL() { - mPattern = boost::regex("https?://([-\\w\\.]*\\.)?(secondlife|lindenlab|tilia-inc)\\.com(?!\\S)", - boost::regex::perl|boost::regex::icase); + mPattern = boost::regex("https?://([-\\w\\.]*\\.)?(secondlife|lindenlab|tilia-inc)\\.com(?!\\S)" + "|" + "https?://([-\\w\\.]*\\.)?secondlifegrid\\.net(?!\\S)", + boost::regex::perl|boost::regex::icase); mIcon = "Hand"; mMenuName = "menu_url_http.xml"; diff --git a/indra/llwindow/lldxhardware.cpp b/indra/llwindow/lldxhardware.cpp index ebdfb94b5a..82074f386d 100644 --- a/indra/llwindow/lldxhardware.cpp +++ b/indra/llwindow/lldxhardware.cpp @@ -229,7 +229,9 @@ S32 LLDXHardware::getMBVideoMemoryViaWMI() } //Getting the version of graphics controller driver via WMI -std::string LLDXHardware::getDriverVersionWMI() +// FIRE-8264: System info displays wrong driver version on Optimus systems +//std::string LLDXHardware::getDriverVersionWMI() +std::string LLDXHardware::getDriverVersionWMI(const std::string& vendor) { std::string mDriverVersion; HRESULT hrCoInitialize = S_OK; @@ -328,6 +330,29 @@ std::string LLDXHardware::getDriverVersionWMI() VARIANT vtProp; + // FIRE-8264: System info displays wrong driver version on Optimus systems + hr = pclsObj->Get(L"AdapterCompatibility", 0, &vtProp, 0, 0); + + if (FAILED(hr)) + { + LL_WARNS("AppInit") << "Query for name property failed." << " Error code = 0x" << hr << LL_ENDL; + pSvc->Release(); + pLoc->Release(); + CoUninitialize(); + return std::string(); // Program has failed. + } + + BSTR vendorCompatibility(vtProp.bstrVal); + std::wstring vc_ws(vendorCompatibility, SysStringLen(vendorCompatibility)); + std::string vc_str(vc_ws.begin(), vc_ws.end()); + + LLStringUtil::toUpper(vc_str); + if (vc_str.find(vendor) == std::string::npos) + { + continue; + } + // + // Get the value of the Name property hr = pclsObj->Get(L"DriverVersion", 0, &vtProp, 0, 0); diff --git a/indra/llwindow/lldxhardware.h b/indra/llwindow/lldxhardware.h index 9f586524e3..db03742761 100644 --- a/indra/llwindow/lldxhardware.h +++ b/indra/llwindow/lldxhardware.h @@ -91,7 +91,9 @@ public: BOOL getInfo(BOOL vram_only, bool disable_wmi); // - std::string getDriverVersionWMI(); + // FIRE-8264: System info displays wrong driver version on Optimus systems + //std::string getDriverVersionWMI(); + std::string getDriverVersionWMI(const std::string& vendor); S32 getVRAM() const { return mVRAM; } diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index f2959e60ad..7c0e54a973 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -787,9 +787,6 @@ void LLWindowWin32::close() resetDisplayResolution(); } - // Don't process events in our mainWindowProc any longer. - SetWindowLongPtr(mWindowHandle, GWLP_USERDATA, NULL); - // Make sure cursor is visible and we haven't mangled the clipping state. showCursor(); setMouseClipping(FALSE); @@ -835,16 +832,24 @@ void LLWindowWin32::close() LL_DEBUGS("Window") << "Destroying Window" << LL_ENDL; - // Make sure we don't leave a blank toolbar button. - ShowWindow(mWindowHandle, SW_HIDE); + if (IsWindow(mWindowHandle)) + { + // Make sure we don't leave a blank toolbar button. + ShowWindow(mWindowHandle, SW_HIDE); - // This causes WM_DESTROY to be sent *immediately* - if (!destroy_window_handler(mWindowHandle)) - { - OSMessageBox(mCallbacks->translateString("MBDestroyWinFailed"), - mCallbacks->translateString("MBShutdownErr"), - OSMB_OK); - } + // This causes WM_DESTROY to be sent *immediately* + if (!destroy_window_handler(mWindowHandle)) + { + OSMessageBox(mCallbacks->translateString("MBDestroyWinFailed"), + mCallbacks->translateString("MBShutdownErr"), + OSMB_OK); + } + } + else + { + // Something killed the window while we were busy destroying gl or handle somehow got broken + LL_WARNS("Window") << "Failed to destroy Window, invalid handle!" << LL_ENDL; + } mWindowHandle = NULL; } @@ -1136,7 +1141,10 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO << " Height: " << (window_rect.bottom - window_rect.top) << " Fullscreen: " << mFullscreen << LL_ENDL; - DestroyWindow(mWindowHandle); + if (!destroy_window_handler(mWindowHandle)) + { + LL_WARNS("Window") << "Failed to properly close window before recreating it!" << LL_ENDL; + } mWindowHandle = CreateWindowEx(dw_ex_style, mWindowClassName, mWindowTitle, @@ -1456,8 +1464,12 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO ReleaseDC (mWindowHandle, mhDC); // Release The Device Context mhDC = 0; // Zero The Device Context } - DestroyWindow (mWindowHandle); // Destroy The Window - + + // Destroy The Window + if (!destroy_window_handler(mWindowHandle)) + { + LL_WARNS("Window") << "Failed to properly close window!" << LL_ENDL; + } mWindowHandle = CreateWindowEx(dw_ex_style, mWindowClassName, @@ -1559,9 +1571,9 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO if (wglCreateContextAttribsARB) { //attempt to create a specific versioned context S32 attribs[] = - { //start at 4.2 + { //start at 4.6 WGL_CONTEXT_MAJOR_VERSION_ARB, 4, - WGL_CONTEXT_MINOR_VERSION_ARB, 2, + WGL_CONTEXT_MINOR_VERSION_ARB, 6, WGL_CONTEXT_PROFILE_MASK_ARB, LLRender::sGLCoreProfile ? WGL_CONTEXT_CORE_PROFILE_BIT_ARB : WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB, WGL_CONTEXT_FLAGS_ARB, gDebugGL ? WGL_CONTEXT_DEBUG_BIT_ARB : 0, 0 @@ -3455,7 +3467,10 @@ void LLSplashScreenWin32::hideImpl() { if (mWindow) { - DestroyWindow(mWindow); + if (!destroy_window_handler(mWindow)) + { + LL_WARNS("Window") << "Failed to properly close splash screen window!" << LL_ENDL; + } mWindow = NULL; } } diff --git a/indra/media_plugins/CMakeLists.txt b/indra/media_plugins/CMakeLists.txt index ba472f9d32..32e440a829 100644 --- a/indra/media_plugins/CMakeLists.txt +++ b/indra/media_plugins/CMakeLists.txt @@ -5,17 +5,17 @@ if (LINUX) # add_subdirectory(gstreamer010) add_subdirectory(cef) add_subdirectory(libvlc) - add_subdirectory(example) + #add_subdirectory(example) endif (LINUX) if (DARWIN) add_subdirectory(cef) add_subdirectory(libvlc) - add_subdirectory(example) + #add_subdirectory(example) endif (DARWIN) if (WINDOWS) add_subdirectory(cef) add_subdirectory(libvlc) - add_subdirectory(example) + #add_subdirectory(example) endif (WINDOWS) diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index 35c53ab532..e845e81808 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -99,7 +99,9 @@ private: bool mCanCut; bool mCanCopy; bool mCanPaste; + std::string mRootCachePath; std::string mCachePath; + std::string mContextCachePath; std::string mCefLogFile; bool mCefLogVerbose; std::vector mPickedFiles; @@ -459,7 +461,6 @@ void MediaPluginCEF::receiveMessage(const char* message_string) } else if (message_name == "cleanup") { - mVolumeCatcher.setVolume(0); // Hack: masks CEF exit issues mCEFLib->requestExit(); } else if (message_name == "force_exit") @@ -528,7 +529,9 @@ void MediaPluginCEF::receiveMessage(const char* message_string) settings.accept_language_list = mHostLanguage; settings.background_color = 0xffffffff; settings.cache_enabled = true; + settings.root_cache_path = mRootCachePath; settings.cache_path = mCachePath; + settings.context_cache_path = mContextCachePath; settings.cookies_enabled = mCookiesEnabled; settings.disable_gpu = mDisableGPU; #if LL_DARWIN @@ -586,9 +589,25 @@ void MediaPluginCEF::receiveMessage(const char* message_string) else if (message_name == "set_user_data_path") { std::string user_data_path_cache = message_in.getValue("cache_path"); - std::string user_data_path_cookies = message_in.getValue("cookies_path"); + std::string subfolder = message_in.getValue("username"); - mCachePath = user_data_path_cache + "cef_cache"; + mRootCachePath = user_data_path_cache + "cef_cache"; + if (!subfolder.empty()) + { + std::string delim; +#if LL_WINDOWS + // media plugin doesn't have access to gDirUtilp + delim = "\\"; +#else + delim = "/"; +#endif + mCachePath = mRootCachePath + delim + subfolder; + } + else + { + mCachePath = mRootCachePath; + } + mContextCachePath = ""; // disabled by "" mCefLogFile = message_in.getValue("cef_log_file"); mCefLogVerbose = message_in.getValueBoolean("cef_verbose_log"); } diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index d052d04331..54a1778485 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -2211,9 +2211,11 @@ if (WINDOWS) ${SHARED_LIB_STAGING_DIR}/Release/libcollada14dom22.dll ${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/libcollada14dom22.dll ${SHARED_LIB_STAGING_DIR}/Debug/libcollada14dom22-d.dll - ${SHARED_LIB_STAGING_DIR}/Release/openjpeg.dll - ${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/openjpeg.dll - ${SHARED_LIB_STAGING_DIR}/Debug/openjpegd.dll + # Only copy OpenJPEG dll if needed + #${SHARED_LIB_STAGING_DIR}/Release/openjp2.dll + #${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/openjp2.dll + #${SHARED_LIB_STAGING_DIR}/Debug/openjp2.dll + # ${SHARED_LIB_STAGING_DIR}/Release/libhunspell.dll ${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/libhunspell.dll ${SHARED_LIB_STAGING_DIR}/Debug/libhunspell.dll @@ -2233,10 +2235,20 @@ if (WINDOWS) SLPlugin media_plugin_cef media_plugin_libvlc - media_plugin_example + #media_plugin_example # Don't package example plugin windows-crash-logger ) + # Only copy OpenJPEG dll if needed + if (NOT USE_KDU) + list(APPEND COPY_INPUT_DEPENDENCIES + ${SHARED_LIB_STAGING_DIR}/Release/openjp2.dll + ${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/openjp2.dll + ${SHARED_LIB_STAGING_DIR}/Debug/openjp2.dll + ) + endif (NOT USE_KDU) + # + if (ADDRESS_SIZE EQUAL 64) list(APPEND COPY_INPUT_DEPENDENCIES ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/vivoxsdk_x64.dll diff --git a/indra/newview/NACLfloaterexploresounds.cpp b/indra/newview/NACLfloaterexploresounds.cpp index c4473f0fbf..f28f675b4e 100644 --- a/indra/newview/NACLfloaterexploresounds.cpp +++ b/indra/newview/NACLfloaterexploresounds.cpp @@ -386,32 +386,40 @@ void NACLFloaterExploreSounds::handleLookAt() void NACLFloaterExploreSounds::handleStop() { std::vector selection = mHistoryScroller->getAllSelected(); - std::vector::iterator selection_iter = selection.begin(); - std::vector::iterator selection_end = selection.end(); - for( ; selection_iter != selection_end; ++selection_iter) + for (const auto& selection_item : selection) { - LLSoundHistoryItem item = getItem((*selection_iter)->getValue()); - if(item.mID.isNull()) continue; - if(item.mPlaying) + LLSoundHistoryItem item = getItem(selection_item->getValue()); + if (item.mID.notNull() && item.mPlaying) { - // Make sure the audio source in question is still in the system to prevent - // crashes by using a stale pointer. This can happen when the same UUID is - // played twice without stopping it first. -Zi - if(!gAudiop->findAudioSource(item.mSourceID)) - { - LL_WARNS("SoundExplorer") << "audio source " << item.mAudioSource << " already gone but still marked as playing. Fixing ..." << LL_ENDL; - gSoundHistory[item.mID].mPlaying = false; - gSoundHistory[item.mID].mAudioSource = NULL; - gSoundHistory[item.mID].mTimeStopped = LLTimer::getElapsedSeconds(); - continue; - } - - if(item.mAudioSource) + LLAudioSource* audio_source = gAudiop->findAudioSource(item.mSourceID); + if (audio_source) { S32 type = item.mType; - item.mAudioSource->setType(LLAudioEngine::AUDIO_TYPE_UI); - item.mAudioSource->play(LLUUID::null); - item.mAudioSource->setType(type); + audio_source->setType(LLAudioEngine::AUDIO_TYPE_UI); + audio_source->play(LLUUID::null); + audio_source->setType(type); + } + else + { + LL_WARNS("SoundExplorer") << "audio source for source ID " << item.mSourceID << " already gone but still marked as playing. Fixing ..." << LL_ENDL; + if (gSoundHistory.find(item.mID) != gSoundHistory.end()) + { + gSoundHistory[item.mID].mPlaying = false; + gSoundHistory[item.mID].mTimeStopped = LLTimer::getElapsedSeconds(); + } + else + { + for (auto& histItem : mLastHistory) + { + if (histItem.mID == item.mID) + { + histItem.mPlaying = false; + histItem.mTimeStopped = LLTimer::getElapsedSeconds(); + break; + } + } + } + continue; } } } diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt index e5a66bad38..d613169e88 100644 --- a/indra/newview/VIEWER_VERSION.txt +++ b/indra/newview/VIEWER_VERSION.txt @@ -1 +1 @@ -6.4.11 +6.4.12 diff --git a/indra/newview/ao.cpp b/indra/newview/ao.cpp index 9867381df8..a0e3077d62 100644 --- a/indra/newview/ao.cpp +++ b/indra/newview/ao.cpp @@ -39,14 +39,14 @@ #include "utilitybar.h" FloaterAO::FloaterAO(const LLSD& key) -: LLTransientDockableFloater(NULL, true, key), LLEventTimer(10.f), +: LLTransientDockableFloater(nullptr, true, key), LLEventTimer(10.f), mSetList(0), mSelectedSet(0), mSelectedState(0), - mCanDragAndDrop(FALSE), - mImportRunning(FALSE), - mCurrentBoldItem(NULL), - mMore(TRUE) + mCanDragAndDrop(false), + mImportRunning(false), + mCurrentBoldItem(nullptr), + mMore(true) { mEventTimer.stop(); } @@ -55,9 +55,9 @@ FloaterAO::~FloaterAO() { } -void FloaterAO::reloading(BOOL yes) +void FloaterAO::reloading(bool reload) { - if (yes) + if (reload) { mEventTimer.start(); } @@ -66,9 +66,9 @@ void FloaterAO::reloading(BOOL yes) mEventTimer.stop(); } - mReloadCoverPanel->setVisible(yes); - enableSetControls(!yes); - enableStateControls(!yes); + mReloadCoverPanel->setVisible(reload); + enableSetControls(!reload); + enableStateControls(!reload); } BOOL FloaterAO::tick() @@ -84,7 +84,7 @@ void FloaterAO::updateSetParameters() mOverrideSitsCheckBox->setValue(mSelectedSet->getSitOverride()); mOverrideSitsCheckBoxSmall->setValue(mSelectedSet->getSitOverride()); mSmartCheckBox->setValue(mSelectedSet->getSmart()); - mDisableMouselookCheckBox->setValue(mSelectedSet->getMouselookDisable()); + mDisableMouselookCheckBox->setValue(mSelectedSet->getMouselookStandDisable()); BOOL isDefault = (mSelectedSet == AOEngine::instance().getDefaultSet()); mDefaultCheckBox->setValue(isDefault); mDefaultCheckBox->setEnabled(!isDefault); @@ -112,7 +112,7 @@ void FloaterAO::updateAnimationList() mStateSelector->add(stateName, state, ADD_BOTTOM, TRUE); } - enableStateControls(TRUE); + enableStateControls(true); if (currentStateSelected == -1) { @@ -129,7 +129,7 @@ void FloaterAO::updateAnimationList() void FloaterAO::updateList() { mReloadButton->setEnabled(TRUE); - mImportRunning = FALSE; + mImportRunning = false; // Lambda provides simple Alpha sorting, note this is case sensitive. auto sortRuleLambda = [](const AOSet* s1, const AOSet* s2) -> bool @@ -137,7 +137,7 @@ void FloaterAO::updateList() return s1->getName() < s2->getName(); }; - mSetList=AOEngine::instance().getSetList(); + mSetList = AOEngine::instance().getSetList(); std::sort(mSetList.begin(), mSetList.end(), sortRuleLambda); // remember currently selected animation set name @@ -149,8 +149,8 @@ void FloaterAO::updateList() mSetSelectorSmall->clear(); mAnimationList->deleteAllItems(); - mCurrentBoldItem = NULL; - reloading(FALSE); + mCurrentBoldItem = nullptr; + reloading(false); if (mSetList.empty()) { @@ -292,43 +292,43 @@ BOOL FloaterAO::postBuild() return LLDockableFloater::postBuild(); } -void FloaterAO::enableSetControls(BOOL yes) +void FloaterAO::enableSetControls(BOOL enable) { - mSetSelector->setEnabled(yes); - mSetSelectorSmall->setEnabled(yes); - mActivateSetButton->setEnabled(yes); - mRemoveButton->setEnabled(yes); - mDefaultCheckBox->setEnabled(yes && (mSelectedSet != AOEngine::instance().getDefaultSet())); - mOverrideSitsCheckBox->setEnabled(yes); - mOverrideSitsCheckBoxSmall->setEnabled(yes); - mDisableMouselookCheckBox->setEnabled(yes); + mSetSelector->setEnabled(enable); + mSetSelectorSmall->setEnabled(enable); + mActivateSetButton->setEnabled(enable); + mRemoveButton->setEnabled(enable); + mDefaultCheckBox->setEnabled(enable && (mSelectedSet != AOEngine::instance().getDefaultSet())); + mOverrideSitsCheckBox->setEnabled(enable); + mOverrideSitsCheckBoxSmall->setEnabled(enable); + mDisableMouselookCheckBox->setEnabled(enable); - if (!yes) + if (!enable) { - enableStateControls(yes); + enableStateControls(enable); } } -void FloaterAO::enableStateControls(BOOL yes) +void FloaterAO::enableStateControls(BOOL enable) { - mStateSelector->setEnabled(yes); - mAnimationList->setEnabled(yes); - mCycleCheckBox->setEnabled(yes); - if (yes) + mStateSelector->setEnabled(enable); + mAnimationList->setEnabled(enable); + mCycleCheckBox->setEnabled(enable); + if (enable) { updateCycleParameters(); } else { - mRandomizeCheckBox->setEnabled(yes); - mCycleTimeTextLabel->setEnabled(yes); - mCycleTimeSpinner->setEnabled(yes); + mRandomizeCheckBox->setEnabled(enable); + mCycleTimeTextLabel->setEnabled(enable); + mCycleTimeSpinner->setEnabled(enable); } - mPreviousButton->setEnabled(yes); - mPreviousButtonSmall->setEnabled(yes); - mNextButton->setEnabled(yes); - mNextButtonSmall->setEnabled(yes); - mCanDragAndDrop = yes; + mPreviousButton->setEnabled(enable); + mPreviousButtonSmall->setEnabled(enable); + mNextButton->setEnabled(enable); + mNextButtonSmall->setEnabled(enable); + mCanDragAndDrop = enable; } void FloaterAO::onOpen(const LLSD& key) @@ -440,7 +440,7 @@ LLScrollListItem* FloaterAO::addAnimation(const std::string& name) void FloaterAO::onSelectState() { mAnimationList->deleteAllItems(); - mCurrentBoldItem = NULL; + mCurrentBoldItem = nullptr; mAnimationList->setCommentText(getString("ao_no_animations_loaded")); mAnimationList->setEnabled(FALSE); @@ -482,10 +482,10 @@ void FloaterAO::onSelectState() void FloaterAO::onClickReload() { - reloading(TRUE); + reloading(true); - mSelectedSet = 0; - mSelectedState = 0; + mSelectedSet = nullptr; + mSelectedState = nullptr; AOEngine::instance().reload(false); updateList(); @@ -496,7 +496,7 @@ void FloaterAO::onClickAdd() LLNotificationsUtil::add("NewAOSet", LLSD(), LLSD(), boost::bind(&FloaterAO::newSetCallback, this, _1, _2)); } -BOOL FloaterAO::newSetCallback(const LLSD& notification, const LLSD& response) +bool FloaterAO::newSetCallback(const LLSD& notification, const LLSD& response) { std::string newSetName = response["message"].asString(); S32 option = LLNotificationsUtil::getSelectedOption(notification, response); @@ -507,7 +507,7 @@ BOOL FloaterAO::newSetCallback(const LLSD& notification, const LLSD& response) if (newSetName.empty()) { - return FALSE; + return false; } else if ( !LLTextValidate::validateASCIIPrintableNoPipe(new_set_name.getWString()) || // only allow ASCII @@ -516,18 +516,18 @@ BOOL FloaterAO::newSetCallback(const LLSD& notification, const LLSD& response) LLSD args; args["AO_SET_NAME"] = newSetName; LLNotificationsUtil::add("NewAOCantContainNonASCII", args); - return FALSE; + return false; } if (option == 0) { if (AOEngine::instance().addSet(newSetName).notNull()) { - reloading(TRUE); - return TRUE; + reloading(true); + return true; } } - return FALSE; + return false; } void FloaterAO::onClickRemove() @@ -542,7 +542,7 @@ void FloaterAO::onClickRemove() LLNotificationsUtil::add("RemoveAOSet", args, LLSD(), boost::bind(&FloaterAO::removeSetCallback, this, _1, _2)); } -BOOL FloaterAO::removeSetCallback(const LLSD& notification, const LLSD& response) +bool FloaterAO::removeSetCallback(const LLSD& notification, const LLSD& response) { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); @@ -550,7 +550,7 @@ BOOL FloaterAO::removeSetCallback(const LLSD& notification, const LLSD& response { if (AOEngine::instance().removeSet(mSelectedSet)) { - reloading(TRUE); + reloading(true); // to prevent snapping back to deleted set mSetSelector->removeall(); mSetSelectorSmall->removeall(); @@ -558,11 +558,11 @@ BOOL FloaterAO::removeSetCallback(const LLSD& notification, const LLSD& response mSetSelector->clear(); mSetSelectorSmall->clear(); mAnimationList->deleteAllItems(); - mCurrentBoldItem = NULL; - return TRUE; + mCurrentBoldItem = nullptr; + return true; } } - return FALSE; + return false; } void FloaterAO::onCheckDefault() @@ -606,7 +606,7 @@ void FloaterAO::onCheckDisableStands() { if (mSelectedSet) { - AOEngine::instance().setDisableStands(mSelectedSet, mDisableMouselookCheckBox->getValue().asBoolean()); + AOEngine::instance().setDisableMouselookStands(mSelectedSet, mDisableMouselookCheckBox->getValue().asBoolean()); } } @@ -698,7 +698,7 @@ void FloaterAO::onClickTrash() } std::vector list = mAnimationList->getAllSelected(); - if (list.size() == 0) + if (list.empty()) { return; } @@ -709,23 +709,23 @@ void FloaterAO::onClickTrash() } mAnimationList->deleteSelectedItems(); - mCurrentBoldItem = NULL; + mCurrentBoldItem = nullptr; } void FloaterAO::updateCycleParameters() { - BOOL yes = mCycleCheckBox->getValue().asBoolean(); - mRandomizeCheckBox->setEnabled(yes); - mCycleTimeTextLabel->setEnabled(yes); - mCycleTimeSpinner->setEnabled(yes); + BOOL enabled = mCycleCheckBox->getValue().asBoolean(); + mRandomizeCheckBox->setEnabled(enabled); + mCycleTimeTextLabel->setEnabled(enabled); + mCycleTimeSpinner->setEnabled(enabled); } void FloaterAO::onCheckCycle() { if (mSelectedState) { - BOOL yes = mCycleCheckBox->getValue().asBoolean(); - AOEngine::instance().setCycle(mSelectedState, yes); + bool cycle = mCycleCheckBox->getValue().asBoolean(); + AOEngine::instance().setCycle(mSelectedState, cycle); updateCycleParameters(); } } @@ -770,7 +770,7 @@ void FloaterAO::onClickMore() fullSize.setOriginAndSize(fullSize.mLeft, fullSize.mBottom, getRect().getWidth(), fullSize.getHeight()); } - mMore = TRUE; + mMore = true; mSmallInterfacePanel->setVisible(FALSE); mMainInterfacePanel->setVisible(TRUE); @@ -789,7 +789,7 @@ void FloaterAO::onClickLess() gSavedPerAccountSettings.setRect("floater_rect_animation_overrider_full", fullSize); - mMore = FALSE; + mMore = false; mSmallInterfacePanel->setVisible(TRUE); mMainInterfacePanel->setVisible(FALSE); @@ -812,7 +812,7 @@ void FloaterAO::onAnimationChanged(const LLUUID& animation) LLScrollListText* column = (LLScrollListText*)mCurrentBoldItem->getColumn(1); column->setFontStyle(LLFontGL::NORMAL); - mCurrentBoldItem = NULL; + mCurrentBoldItem = nullptr; } if (animation.isNull()) @@ -888,7 +888,7 @@ BOOL FloaterAO::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDr // TODO: this would be the right thing to do, but it blocks multi drop // before final release this must be resolved - reloading(TRUE); + reloading(true); } } } diff --git a/indra/newview/ao.h b/indra/newview/ao.h index 0a6813583b..45482bab45 100644 --- a/indra/newview/ao.h +++ b/indra/newview/ao.h @@ -92,16 +92,16 @@ class FloaterAO void onAnimationChanged(const LLUUID& animation); - void reloading(BOOL yes); + void reloading(bool reload); void updateSmart(); void updateCycleParameters(); - void enableSetControls(BOOL yes); - void enableStateControls(BOOL yes); + void enableSetControls(BOOL enable); + void enableStateControls(BOOL enable); - BOOL newSetCallback(const LLSD& notification, const LLSD& response); - BOOL removeSetCallback(const LLSD& notification, const LLSD& response); + bool newSetCallback(const LLSD& notification, const LLSD& response); + bool removeSetCallback(const LLSD& notification, const LLSD& response); virtual BOOL tick(); @@ -151,9 +151,9 @@ class FloaterAO LLButton* mNextButtonSmall; LLCheckBoxCtrl* mOverrideSitsCheckBoxSmall; - BOOL mCanDragAndDrop; - BOOL mImportRunning; - BOOL mMore; + bool mCanDragAndDrop; + bool mImportRunning; + bool mMore; }; #endif // AO_H diff --git a/indra/newview/aoengine.cpp b/indra/newview/aoengine.cpp index 424af81590..0f54723867 100644 --- a/indra/newview/aoengine.cpp +++ b/indra/newview/aoengine.cpp @@ -42,7 +42,6 @@ #include "llviewercontrol.h" #include "llviewerinventory.h" -//#define ROOT_FIRESTORM_FOLDER "#Firestorm" //moved to llinventoryfunctions.h #define ROOT_AO_FOLDER "#AO" #include @@ -50,13 +49,13 @@ const F32 INVENTORY_POLLING_INTERVAL = 5.0f; AOEngine::AOEngine() : LLSingleton(), - mCurrentSet(NULL), - mDefaultSet(NULL), - mEnabled(FALSE), - mEnabledStands(FALSE), - mInMouselook(FALSE), - mUnderWater(FALSE), - mImportSet(NULL), + mCurrentSet(nullptr), + mDefaultSet(nullptr), + mEnabled(false), + mEnabledStands(false), + mInMouselook(false), + mUnderWater(false), + mImportSet(nullptr), mImportCategory(LLUUID::null), mAOFolder(LLUUID::null), mLastMotion(ANIM_AGENT_STAND), @@ -86,14 +85,14 @@ void AOEngine::init() { // enable_stands() calls enable(), but we need to set the // mEnabled variable properly - mEnabled = TRUE; + mEnabled = true; // Enabling the AO always enables stands to start with - enable_stands(TRUE); + enableStands(true); } else { - enable_stands(do_enable_stands); - enable(FALSE); + enableStands(do_enable_stands); + enable(false); } } @@ -115,19 +114,19 @@ void AOEngine::onToggleAOControl() void AOEngine::onToggleAOStandsControl() { - enable_stands(gSavedPerAccountSettings.getBOOL("UseAOStands")); + enableStands(gSavedPerAccountSettings.getBOOL("UseAOStands")); } -void AOEngine::clear(bool aFromTimer) +void AOEngine::clear(bool from_timer) { mOldSets.insert(mOldSets.end(), mSets.begin(), mSets.end()); mSets.clear(); - mCurrentSet = NULL; + mCurrentSet = nullptr; // FIRE-3801; We cannot delete any AOSet object if we're called from a timer tick. AOSet is derived from LLEventTimer and destruction will // fail in ~LLInstanceTracker when a destructor runs during iteration. - if (!aFromTimer) + if (!from_timer) { std::for_each(mOldSets.begin(), mOldSets.end(), DeletePointer()); mOldSets.clear(); @@ -189,12 +188,12 @@ void AOEngine::setLastOverriddenMotion(const LLUUID& motion) } } -BOOL AOEngine::foreignAnimations() +bool AOEngine::foreignAnimations() { // checking foreign animations only makes sense when smart sit is enabled if (!mCurrentSet->getSmart()) { - return FALSE; + return false; } // get the seat the avatar is sitting on @@ -202,14 +201,14 @@ BOOL AOEngine::foreignAnimations() if (!agentRoot) { // this should not happen, ever - return FALSE; + return false; } LLUUID seat = agentRoot->getID(); if (seat == gAgentID) { LL_DEBUGS("AOEngine") << "Not checking for foreign animation when not sitting." << LL_ENDL; - return FALSE; + return false; } LL_DEBUGS("AOEngine") << "Checking for foreign animation on seat " << seat << LL_ENDL; @@ -221,26 +220,27 @@ BOOL AOEngine::foreignAnimations() if (sourceIterator->first != gAgentID) { // find the source object where the animation came from - LLViewerObject* source=gObjectList.findObject(sourceIterator->first); + LLViewerObject* source = gObjectList.findObject(sourceIterator->first); // proceed if it's not an attachment - if(!source->isAttachment()) + if (source && !source->isAttachment()) { LL_DEBUGS("AOEngine") << "Source " << sourceIterator->first << " is running animation " << sourceIterator->second << LL_ENDL; // get the source's root prim - LLViewerObject* sourceRoot=dynamic_cast(source->getRoot()); + LLViewerObject* sourceRoot = dynamic_cast(source->getRoot()); // if the root prim is the same as the animation source, report back as TRUE if (sourceRoot && sourceRoot->getID() == seat) { LL_DEBUGS("AOEngine") << "foreign animation " << sourceIterator->second << " found on seat." << LL_ENDL; - return TRUE; + return true; } } } } - return FALSE; + + return false; } // map motion to underwater state, return nullptr if not applicable @@ -274,10 +274,10 @@ AOSet::AOState* AOEngine::mapSwimming(const LLUUID& motion) const } // switch between swimming and flying on transition in and out of Linden region water -void AOEngine::checkBelowWater(BOOL yes) +void AOEngine::checkBelowWater(bool check_underwater) { // there was no transition, do nothing - if (mUnderWater == yes) + if (mUnderWater == check_underwater) { return; } @@ -287,12 +287,12 @@ void AOEngine::checkBelowWater(BOOL yes) if (!mapped || mapped->mAnimations.empty()) { // set underwater status but do nothing else - mUnderWater = yes; + mUnderWater = check_underwater; return; } // find animation id to stop when transitioning - LLUUID id = override(mLastMotion, FALSE); + LLUUID id = override(mLastMotion, false); if (id.isNull()) { // no animation in overrider for this state, use Linden Lab motion @@ -311,10 +311,10 @@ void AOEngine::checkBelowWater(BOOL yes) } // set requested underwater status for overrider - mUnderWater = yes; + mUnderWater = check_underwater; // find animation id to start when transitioning - id = override(mLastMotion, TRUE); + id = override(mLastMotion, true); if (id.isNull()) { // no animation in overrider for this state, use Linden Lab motion @@ -353,22 +353,22 @@ AOSet::AOState* AOEngine::getStateForMotion(const LLUUID& motion) const return mapped; } -void AOEngine::enable_stands(BOOL yes) +void AOEngine::enableStands(bool enable_stands) { - mEnabledStands = yes; + mEnabledStands = enable_stands; // let the main enable routine decide if we need to change animations // but don't actually change the state of the enabled flag enable(mEnabled); } -void AOEngine::enable(BOOL yes) +void AOEngine::enable(bool enable) { - LL_DEBUGS("AOEngine") << "using " << mLastMotion << " enable " << yes << LL_ENDL; - mEnabled = yes; + LL_DEBUGS("AOEngine") << "using " << mLastMotion << " enable " << enable << LL_ENDL; + mEnabled = enable; if (!mCurrentSet) { - LL_DEBUGS("AOEngine") << "enable(" << yes << ") without animation set loaded." << LL_ENDL; + LL_DEBUGS("AOEngine") << "enable(" << enable << ") without animation set loaded." << LL_ENDL; return; } @@ -385,7 +385,7 @@ void AOEngine::enable(BOOL yes) gAgent.sendAnimationRequest(mLastOverriddenMotion, ANIM_REQUEST_STOP); } - LLUUID animation = override(mLastMotion, TRUE); + LLUUID animation = override(mLastMotion, true); if (animation.isNull()) { return; @@ -483,7 +483,7 @@ void AOEngine::setStateCycleTimer(const AOSet::AOState* state) } } -const LLUUID AOEngine::override(const LLUUID& pMotion, BOOL start) +const LLUUID AOEngine::override(const LLUUID& pMotion, bool start) { LL_DEBUGS("AOEngine") << "override(" << pMotion << "," << start << ")" << LL_ENDL; @@ -621,7 +621,7 @@ const LLUUID AOEngine::override(const LLUUID& pMotion, BOOL start) LL_DEBUGS("AOEngine") << "(enabled AO) setting last motion id to " << gAnimLibrary.animationName(mLastMotion) << LL_ENDL; // Disable start stands in Mouselook - if (mCurrentSet->getMouselookDisable() && + if (mCurrentSet->getMouselookStandDisable() && motion == ANIM_AGENT_STAND && mInMouselook) { @@ -837,7 +837,7 @@ void AOEngine::cycle(eCycleMode cycleMode) return; } // do not cycle if we're standing and mouselook stand override is disabled while being in mouselook - else if (mLastMotion == ANIM_AGENT_STAND && mCurrentSet->getMouselookDisable() && mInMouselook) + else if (mLastMotion == ANIM_AGENT_STAND && mCurrentSet->getMouselookStandDisable() && mInMouselook) { return; } @@ -954,7 +954,7 @@ void AOEngine::updateSortOrder(AOSet::AOState* state) } } -LLUUID AOEngine::addSet(const std::string& name, BOOL reload) +LLUUID AOEngine::addSet(const std::string& name, bool reload) { if (mAOFolder.isNull()) { @@ -971,12 +971,12 @@ LLUUID AOEngine::addSet(const std::string& name, BOOL reload) if (reload) { - mTimerCollection.enableReloadTimer(TRUE); + mTimerCollection.enableReloadTimer(true); } return newUUID; } -BOOL AOEngine::createAnimationLink(const AOSet* set, AOSet::AOState* state, const LLInventoryItem* item) +bool AOEngine::createAnimationLink(const AOSet* set, AOSet::AOState* state, const LLInventoryItem* item) { LL_DEBUGS("AOEngine") << "Asset ID " << item->getAssetUUID() << " inventory id " << item->getUUID() << " category id " << state->mInventoryUUID << LL_ENDL; if (state->mInventoryUUID.isNull()) @@ -1009,19 +1009,19 @@ BOOL AOEngine::createAnimationLink(const AOSet* set, AOSet::AOState* state, cons if (state->mInventoryUUID.isNull()) { LL_DEBUGS("AOEngine") << "state inventory UUID not found, failing." << LL_ENDL; - return FALSE; + return false; } LLInventoryObject::const_object_list_t obj_array; obj_array.push_back(LLConstPointer(item)); link_inventory_array(state->mInventoryUUID, obj_array, - LLPointer(NULL)); + LLPointer(nullptr)); - return TRUE; + return true; } -BOOL AOEngine::addAnimation(const AOSet* set, AOSet::AOState* state, const LLInventoryItem* item, BOOL reload) +bool AOEngine::addAnimation(const AOSet* set, AOSet::AOState* state, const LLInventoryItem* item, bool reload) { AOSet::AOAnimation anim; anim.mAssetUUID = item->getAssetUUID(); @@ -1037,62 +1037,69 @@ BOOL AOEngine::addAnimation(const AOSet* set, AOSet::AOState* state, const LLInv if (reload) { - mTimerCollection.enableReloadTimer(TRUE); + mTimerCollection.enableReloadTimer(true); } - return TRUE; + return true; } -BOOL AOEngine::findForeignItems(const LLUUID& uuid) const +bool AOEngine::findForeignItems(const LLUUID& uuid) const { - BOOL moved = FALSE; + bool moved = false; LLInventoryModel::item_array_t* items; LLInventoryModel::cat_array_t* cats; gInventory.getDirectDescendentsOf(uuid, cats, items); - for (S32 index = 0; index < cats->size(); ++index) + + if (cats) { - // recurse into subfolders - if (findForeignItems(cats->at(index)->getUUID())) + for (const auto& cat : *cats) { - moved = TRUE; + if (findForeignItems(cat->getUUID())) + { + moved = true; + } } } // count backwards in case we have to remove items BOOL wasProtected = gSavedPerAccountSettings.getBOOL("LockAOFolders"); gSavedPerAccountSettings.setBOOL("LockAOFolders", FALSE); - for (S32 index = items->size() - 1; index >= 0; --index) - { - BOOL move = FALSE; - LLPointer item = items->at(index); - if (item->getIsLinkType()) + if (items) + { + for (S32 index = items->size() - 1; index >= 0; --index) { - if (item->getInventoryType() != LLInventoryType::IT_ANIMATION) + bool move = false; + + LLPointer item = items->at(index); + if (item->getIsLinkType()) { - LL_DEBUGS("AOEngine") << item->getName() << " is a link but does not point to an animation." << LL_ENDL; - move = TRUE; + if (item->getInventoryType() != LLInventoryType::IT_ANIMATION) + { + LL_DEBUGS("AOEngine") << item->getName() << " is a link but does not point to an animation." << LL_ENDL; + move = true; + } + else + { + LL_DEBUGS("AOEngine") << item->getName() << " is an animation link." << LL_ENDL; + } } else { - LL_DEBUGS("AOEngine") << item->getName() << " is an animation link." << LL_ENDL; + LL_DEBUGS("AOEngine") << item->getName() << " is not a link!" << LL_ENDL; + move = true; + } + + if (move) + { + moved = true; + gInventory.changeItemParent(item, gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND), false); + LL_DEBUGS("AOEngine") << item->getName() << " moved to lost and found!" << LL_ENDL; } } - else - { - LL_DEBUGS("AOEngine") << item->getName() << " is not a link!" << LL_ENDL; - move = TRUE; - } - - if (move) - { - moved = TRUE; - LLInventoryModel* model = &gInventory; - model->changeItemParent(item, gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND), FALSE); - LL_DEBUGS("AOEngine") << item->getName() << " moved to lost and found!" << LL_ENDL; - } } + gSavedPerAccountSettings.setBOOL("LockAOFolders", wasProtected); return moved; @@ -1115,48 +1122,48 @@ void AOEngine::purgeFolder(const LLUUID& uuid) const gInventory.removeCategory(uuid); // clean it - purge_descendents_of(uuid, NULL); + purge_descendents_of(uuid, nullptr); gInventory.notifyObservers(); // purge it - remove_inventory_object(uuid, NULL); + remove_inventory_object(uuid, nullptr); gInventory.notifyObservers(); // protect it gSavedPerAccountSettings.setBOOL("LockAOFolders", wasProtected); } -BOOL AOEngine::removeSet(AOSet* set) +bool AOEngine::removeSet(AOSet* set) { purgeFolder(set->getInventoryUUID()); - mTimerCollection.enableReloadTimer(TRUE); - return TRUE; + mTimerCollection.enableReloadTimer(true); + return true; } -BOOL AOEngine::removeAnimation(const AOSet* set, AOSet::AOState* state, S32 index) +bool AOEngine::removeAnimation(const AOSet* set, AOSet::AOState* state, S32 index) { if (index < 0) { - return FALSE; + return false; } S32 numOfAnimations = state->mAnimations.size(); if (numOfAnimations == 0) { - return FALSE; + return false; } LLViewerInventoryItem* item = gInventory.getItem(state->mAnimations[index].mInventoryUUID); // check if this item is actually an animation link - BOOL move = TRUE; + bool move = true; if (item->getIsLinkType()) { if (item->getInventoryType() == LLInventoryType::IT_ANIMATION) { // it is an animation link, so mark it to be purged - move = FALSE; + move = false; } } @@ -1164,15 +1171,15 @@ BOOL AOEngine::removeAnimation(const AOSet* set, AOSet::AOState* state, S32 inde if (move) { LLInventoryModel* model = &gInventory; - model->changeItemParent(item, gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND), FALSE); + model->changeItemParent(item, gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND), false); LLNotificationsUtil::add("AOForeignItemsFound", LLSD()); update(); - return FALSE; + return false; } // purge the item from inventory LL_DEBUGS("AOEngine") << __LINE__ << " purging: " << state->mAnimations[index].mInventoryUUID << LL_ENDL; - remove_inventory_object(state->mAnimations[index].mInventoryUUID, NULL); // item->getUUID()); + remove_inventory_object(state->mAnimations[index].mInventoryUUID, nullptr); // item->getUUID()); gInventory.notifyObservers(); state->mAnimations.erase(state->mAnimations.begin() + index); @@ -1185,20 +1192,23 @@ BOOL AOEngine::removeAnimation(const AOSet* set, AOSet::AOState* state, S32 inde LLInventoryModel::cat_array_t* cats; gInventory.getDirectDescendentsOf(set->getInventoryUUID(), cats, items); - for (LLInventoryModel::cat_array_t::iterator it = cats->begin(); it != cats->end(); ++it) + if (cats) { - LLPointer cat = (*it); - std::vector params; - LLStringUtil::getTokens(cat->getName(), params, ":"); - std::string stateName = params[0]; - - if (state->mName.compare(stateName) == 0) + for (LLInventoryModel::cat_array_t::iterator it = cats->begin(); it != cats->end(); ++it) { - LL_DEBUGS("AOEngine") << "folder found: " << cat->getName() << " purging uuid " << cat->getUUID() << LL_ENDL; + LLPointer cat = (*it); + std::vector params; + LLStringUtil::getTokens(cat->getName(), params, ":"); + std::string stateName = params[0]; - purgeFolder(cat->getUUID()); - state->mInventoryUUID.setNull(); - break; + if (state->mName.compare(stateName) == 0) + { + LL_DEBUGS("AOEngine") << "folder found: " << cat->getName() << " purging uuid " << cat->getUUID() << LL_ENDL; + + purgeFolder(cat->getUUID()); + state->mInventoryUUID.setNull(); + break; + } } } } @@ -1207,15 +1217,15 @@ BOOL AOEngine::removeAnimation(const AOSet* set, AOSet::AOState* state, S32 inde updateSortOrder(state); } - return TRUE; + return true; } -BOOL AOEngine::swapWithPrevious(AOSet::AOState* state, S32 index) +bool AOEngine::swapWithPrevious(AOSet::AOState* state, S32 index) { S32 numOfAnimations = state->mAnimations.size(); if (numOfAnimations < 2 || index == 0) { - return FALSE; + return false; } AOSet::AOAnimation tmpAnim = state->mAnimations[index]; @@ -1224,15 +1234,15 @@ BOOL AOEngine::swapWithPrevious(AOSet::AOState* state, S32 index) updateSortOrder(state); - return TRUE; + return true; } -BOOL AOEngine::swapWithNext(AOSet::AOState* state, S32 index) +bool AOEngine::swapWithNext(AOSet::AOState* state, S32 index) { S32 numOfAnimations = state->mAnimations.size(); if (numOfAnimations < 2 || index == (numOfAnimations - 1)) { - return FALSE; + return false; } AOSet::AOAnimation tmpAnim = state->mAnimations[index]; @@ -1241,7 +1251,7 @@ BOOL AOEngine::swapWithNext(AOSet::AOState* state, S32 index) updateSortOrder(state); - return TRUE; + return true; } void AOEngine::reloadStateAnimations(AOSet::AOState* state) @@ -1252,57 +1262,61 @@ void AOEngine::reloadStateAnimations(AOSet::AOState* state) state->mAnimations.clear(); gInventory.getDirectDescendentsOf(state->mInventoryUUID, dummy, items); - for (S32 num = 0; num < items->size(); ++num) + + if (items) { - LL_DEBUGS("AOEngine") << "Found animation link " << items->at(num)->LLInventoryItem::getName() - << " desc " << items->at(num)->LLInventoryItem::getDescription() - << " asset " << items->at(num)->getAssetUUID() << LL_ENDL; - - AOSet::AOAnimation anim; - anim.mAssetUUID = items->at(num)->getAssetUUID(); - LLViewerInventoryItem* linkedItem = items->at(num)->getLinkedItem(); - if (!linkedItem) + for (S32 num = 0; num < items->size(); ++num) { - LL_WARNS("AOEngine") << "linked item for link " << items->at(num)->LLInventoryItem::getName() << " not found (broken link). Skipping." << LL_ENDL; - continue; - } - anim.mName = linkedItem->LLInventoryItem::getName(); - anim.mInventoryUUID = items->at(num)->getUUID(); + LL_DEBUGS("AOEngine") << "Found animation link " << items->at(num)->LLInventoryItem::getName() + << " desc " << items->at(num)->LLInventoryItem::getDescription() + << " asset " << items->at(num)->getAssetUUID() << LL_ENDL; - S32 sortOrder; - if (!LLStringUtil::convertToS32(items->at(num)->LLInventoryItem::getDescription(), sortOrder)) - { - sortOrder = -1; - } - anim.mSortOrder = sortOrder; - - LL_DEBUGS("AOEngine") << "current sort order is " << sortOrder << LL_ENDL; - - if (sortOrder == -1) - { - LL_WARNS("AOEngine") << "sort order was unknown so append to the end of the list" << LL_ENDL; - state->mAnimations.push_back(anim); - } - else - { - BOOL inserted = FALSE; - for (U32 index = 0; index < state->mAnimations.size(); ++index) + AOSet::AOAnimation anim; + anim.mAssetUUID = items->at(num)->getAssetUUID(); + LLViewerInventoryItem* linkedItem = items->at(num)->getLinkedItem(); + if (!linkedItem) { - if (state->mAnimations[index].mSortOrder > sortOrder) - { - LL_DEBUGS("AOEngine") << "inserting at index " << index << LL_ENDL; - state->mAnimations.insert(state->mAnimations.begin() + index, anim); - inserted = TRUE; - break; - } + LL_WARNS("AOEngine") << "linked item for link " << items->at(num)->LLInventoryItem::getName() << " not found (broken link). Skipping." << LL_ENDL; + continue; } - if (!inserted) + anim.mName = linkedItem->LLInventoryItem::getName(); + anim.mInventoryUUID = items->at(num)->getUUID(); + + S32 sortOrder; + if (!LLStringUtil::convertToS32(items->at(num)->LLInventoryItem::getDescription(), sortOrder)) { - LL_DEBUGS("AOEngine") << "not inserted yet, appending to the list instead" << LL_ENDL; + sortOrder = -1; + } + anim.mSortOrder = sortOrder; + + LL_DEBUGS("AOEngine") << "current sort order is " << sortOrder << LL_ENDL; + + if (sortOrder == -1) + { + LL_WARNS("AOEngine") << "sort order was unknown so append to the end of the list" << LL_ENDL; state->mAnimations.push_back(anim); } + else + { + bool inserted = false; + for (U32 index = 0; index < state->mAnimations.size(); ++index) + { + if (state->mAnimations[index].mSortOrder > sortOrder) + { + LL_DEBUGS("AOEngine") << "inserting at index " << index << LL_ENDL; + state->mAnimations.insert(state->mAnimations.begin() + index, anim); + inserted = true; + break; + } + } + if (!inserted) + { + LL_DEBUGS("AOEngine") << "not inserted yet, appending to the list instead" << LL_ENDL; + state->mAnimations.push_back(anim); + } + } + LL_DEBUGS("AOEngine") << "Animation count now: " << state->mAnimations.size() << LL_ENDL; } - LL_DEBUGS("AOEngine") << "Animation count now: " << state->mAnimations.size() << LL_ENDL; } updateSortOrder(state); @@ -1324,133 +1338,137 @@ void AOEngine::update() LLInventoryModel::cat_array_t* categories; LLInventoryModel::item_array_t* items; - BOOL allComplete = TRUE; - mTimerCollection.enableSettingsTimer(FALSE); + bool allComplete = true; + mTimerCollection.enableSettingsTimer(false); gInventory.getDirectDescendentsOf(mAOFolder, categories, items); - for (S32 index = 0; index < categories->size(); ++index) + + if (categories) { - LLViewerInventoryCategory* currentCategory = categories->at(index); - const std::string& setFolderName = currentCategory->getName(); - - if (setFolderName.empty()) + for (S32 index = 0; index < categories->size(); ++index) { - LL_WARNS("AOEngine") << "Folder with emtpy name in AO folder" << LL_ENDL; - continue; - } + LLViewerInventoryCategory* currentCategory = categories->at(index); + const std::string& setFolderName = currentCategory->getName(); - std::vector params; - LLStringUtil::getTokens(setFolderName, params, ":"); - - AOSet* newSet = getSetByName(params[0]); - if (!newSet) - { - LL_DEBUGS("AOEngine") << "Adding set " << setFolderName << " to AO." << LL_ENDL; - newSet = new AOSet(currentCategory->getUUID()); - newSet->setName(params[0]); - mSets.push_back(newSet); - } - else - { - if (newSet->getComplete()) + if (setFolderName.empty()) { - LL_DEBUGS("AOEngine") << "Set " << params[0] << " already complete. Skipping." << LL_ENDL; + LL_WARNS("AOEngine") << "Folder with emtpy name in AO folder" << LL_ENDL; continue; } - LL_DEBUGS("AOEngine") << "Updating set " << setFolderName << " in AO." << LL_ENDL; - } - allComplete = FALSE; - for (U32 num = 1; num < params.size(); ++num) - { - if (params[num].size() != 2) + std::vector params; + LLStringUtil::getTokens(setFolderName, params, ":"); + + AOSet* newSet = getSetByName(params[0]); + if (!newSet) { - LL_WARNS("AOEngine") << "Unknown AO set option " << params[num] << LL_ENDL; - } - else if (params[num] == "SO") - { - newSet->setSitOverride(TRUE); - } - else if (params[num] == "SM") - { - newSet->setSmart(TRUE); - } - else if (params[num] == "DM") - { - newSet->setMouselookDisable(TRUE); - } - else if (params[num] == "**") - { - mDefaultSet = newSet; - mCurrentSet = newSet; + LL_DEBUGS("AOEngine") << "Adding set " << setFolderName << " to AO." << LL_ENDL; + newSet = new AOSet(currentCategory->getUUID()); + newSet->setName(params[0]); + mSets.push_back(newSet); } else { - LL_WARNS("AOEngine") << "Unknown AO set option " << params[num] << LL_ENDL; + if (newSet->getComplete()) + { + LL_DEBUGS("AOEngine") << "Set " << params[0] << " already complete. Skipping." << LL_ENDL; + continue; + } + LL_DEBUGS("AOEngine") << "Updating set " << setFolderName << " in AO." << LL_ENDL; } - } + allComplete = false; - if (gInventory.isCategoryComplete(currentCategory->getUUID())) - { - LL_DEBUGS("AOEngine") << "Set " << params[0] << " is complete, reading states ..." << LL_ENDL; - - LLInventoryModel::cat_array_t* stateCategories; - gInventory.getDirectDescendentsOf(currentCategory->getUUID(), stateCategories, items); - newSet->setComplete(TRUE); - - for (S32 state_index = 0; state_index < stateCategories->size(); ++state_index) + for (U32 num = 1; num < params.size(); ++num) { - std::vector state_params; - LLStringUtil::getTokens(stateCategories->at(state_index)->getName(), state_params, ":"); - std::string stateName = state_params[0]; - - AOSet::AOState* state = newSet->getStateByName(stateName); - if (!state) + if (params[num].size() != 2) { - LL_WARNS("AOEngine") << "Unknown state " << stateName << ". Skipping." << LL_ENDL; - continue; + LL_WARNS("AOEngine") << "Unknown AO set option " << params[num] << LL_ENDL; } - LL_DEBUGS("AOEngine") << "Reading state " << stateName << LL_ENDL; - - state->mInventoryUUID = stateCategories->at(state_index)->getUUID(); - for (U32 num = 1; num < state_params.size(); ++num) + else if (params[num] == "SO") { - if (state_params[num] == "CY") - { - state->mCycle = TRUE; - LL_DEBUGS("AOEngine") << "Cycle on" << LL_ENDL; - } - else if (state_params[num] == "RN") - { - state->mRandom = TRUE; - LL_DEBUGS("AOEngine") << "Random on" << LL_ENDL; - } - else if (state_params[num].substr(0, 2) == "CT") - { - LLStringUtil::convertToS32(state_params[num].substr(2, state_params[num].size() - 2), state->mCycleTime); - LL_DEBUGS("AOEngine") << "Cycle Time specified:" << state->mCycleTime << LL_ENDL; - } - else - { - LL_WARNS("AOEngine") << "Unknown AO set option " << state_params[num] << LL_ENDL; - } + newSet->setSitOverride(true); } - - if (!gInventory.isCategoryComplete(state->mInventoryUUID)) + else if (params[num] == "SM") { - LL_DEBUGS("AOEngine") << "State category " << stateName << " is incomplete, fetching descendents" << LL_ENDL; - gInventory.fetchDescendentsOf(state->mInventoryUUID); - allComplete = FALSE; - newSet->setComplete(FALSE); - continue; + newSet->setSmart(true); + } + else if (params[num] == "DM") + { + newSet->setMouselookStandDisable(true); + } + else if (params[num] == "**") + { + mDefaultSet = newSet; + mCurrentSet = newSet; + } + else + { + LL_WARNS("AOEngine") << "Unknown AO set option " << params[num] << LL_ENDL; } - reloadStateAnimations(state); } - } - else - { - LL_DEBUGS("AOEngine") << "Set " << params[0] << " is incomplete, fetching descendents" << LL_ENDL; - gInventory.fetchDescendentsOf(currentCategory->getUUID()); + + if (gInventory.isCategoryComplete(currentCategory->getUUID())) + { + LL_DEBUGS("AOEngine") << "Set " << params[0] << " is complete, reading states ..." << LL_ENDL; + + LLInventoryModel::cat_array_t* stateCategories; + gInventory.getDirectDescendentsOf(currentCategory->getUUID(), stateCategories, items); + newSet->setComplete(true); + + for (S32 state_index = 0; state_index < stateCategories->size(); ++state_index) + { + std::vector state_params; + LLStringUtil::getTokens(stateCategories->at(state_index)->getName(), state_params, ":"); + std::string stateName = state_params[0]; + + AOSet::AOState* state = newSet->getStateByName(stateName); + if (!state) + { + LL_WARNS("AOEngine") << "Unknown state " << stateName << ". Skipping." << LL_ENDL; + continue; + } + LL_DEBUGS("AOEngine") << "Reading state " << stateName << LL_ENDL; + + state->mInventoryUUID = stateCategories->at(state_index)->getUUID(); + for (U32 num = 1; num < state_params.size(); ++num) + { + if (state_params[num] == "CY") + { + state->mCycle = true; + LL_DEBUGS("AOEngine") << "Cycle on" << LL_ENDL; + } + else if (state_params[num] == "RN") + { + state->mRandom = true; + LL_DEBUGS("AOEngine") << "Random on" << LL_ENDL; + } + else if (state_params[num].substr(0, 2) == "CT") + { + LLStringUtil::convertToS32(state_params[num].substr(2, state_params[num].size() - 2), state->mCycleTime); + LL_DEBUGS("AOEngine") << "Cycle Time specified:" << state->mCycleTime << LL_ENDL; + } + else + { + LL_WARNS("AOEngine") << "Unknown AO set option " << state_params[num] << LL_ENDL; + } + } + + if (!gInventory.isCategoryComplete(state->mInventoryUUID)) + { + LL_DEBUGS("AOEngine") << "State category " << stateName << " is incomplete, fetching descendents" << LL_ENDL; + gInventory.fetchDescendentsOf(state->mInventoryUUID); + allComplete = false; + newSet->setComplete(false); + continue; + } + reloadStateAnimations(state); + } + } + else + { + LL_DEBUGS("AOEngine") << "Set " << params[0] << " is incomplete, fetching descendents" << LL_ENDL; + gInventory.fetchDescendentsOf(currentCategory->getUUID()); + } } } @@ -1464,8 +1482,8 @@ void AOEngine::update() selectSet(mSets[0]); } - mTimerCollection.enableInventoryTimer(FALSE); - mTimerCollection.enableSettingsTimer(TRUE); + mTimerCollection.enableInventoryTimer(false); + mTimerCollection.enableSettingsTimer(true); LL_INFOS("AOEngine") << "sending update signal" << LL_ENDL; mUpdatedSignal(); @@ -1475,13 +1493,13 @@ void AOEngine::update() void AOEngine::reload(bool aFromTimer) { - BOOL wasEnabled = mEnabled; + bool wasEnabled = mEnabled; - mTimerCollection.enableReloadTimer(FALSE); + mTimerCollection.enableReloadTimer(false); if (wasEnabled) { - enable(FALSE); + enable(false); } gAgent.stopCurrentAnimations(); @@ -1489,18 +1507,18 @@ void AOEngine::reload(bool aFromTimer) clear(aFromTimer); mAOFolder.setNull(); - mTimerCollection.enableInventoryTimer(TRUE); + mTimerCollection.enableInventoryTimer(true); tick(); if (wasEnabled) { - enable(TRUE); + enable(true); } } AOSet* AOEngine::getSetByName(const std::string& name) const { - AOSet* found = NULL; + AOSet* found = nullptr; for (U32 index = 0; index < mSets.size(); ++index) { if (mSets[index]->getName().compare(name) == 0) @@ -1514,7 +1532,7 @@ AOSet* AOEngine::getSetByName(const std::string& name) const const std::string AOEngine::getCurrentSetName() const { - if(mCurrentSet) + if (mCurrentSet) { return mCurrentSet->getName(); } @@ -1544,7 +1562,7 @@ void AOEngine::selectSet(AOSet* set) if (mEnabled) { LL_DEBUGS("AOEngine") << "enabling with motion " << gAnimLibrary.animationName(mLastMotion) << LL_ENDL; - gAgent.sendAnimationRequest(override(mLastMotion, TRUE), ANIM_REQUEST_START); + gAgent.sendAnimationRequest(override(mLastMotion, true), ANIM_REQUEST_START); } } @@ -1557,7 +1575,7 @@ AOSet* AOEngine::selectSetByName(const std::string& name) return set; } LL_WARNS("AOEngine") << "Could not find AO set " << name << LL_ENDL; - return NULL; + return nullptr; } const std::vector AOEngine::getSetList() const @@ -1581,7 +1599,7 @@ void AOEngine::saveSet(const AOSet* set) { setParams += ":SM"; } - if (set->getMouselookDisable()) + if (set->getMouselookStandDisable()) { setParams += ":DM"; } @@ -1610,16 +1628,16 @@ void AOEngine::saveSet(const AOSet* set) mUpdatedSignal(); } -BOOL AOEngine::renameSet(AOSet* set, const std::string& name) +bool AOEngine::renameSet(AOSet* set, const std::string& name) { if (name.empty() || name.find(":") != std::string::npos) { - return FALSE; + return false; } set->setName(name); - set->setDirty(TRUE); + set->setDirty(true); - return TRUE; + return true; } void AOEngine::saveState(const AOSet::AOState* state) @@ -1656,7 +1674,7 @@ void AOEngine::saveSettings() { saveSet(set); LL_INFOS("AOEngine") << "dirty set saved " << set->getName() << LL_ENDL; - set->setDirty(FALSE); + set->setDirty(false); } for (S32 stateIndex = 0; stateIndex < AOSet::AOSTATES_MAX; ++stateIndex) @@ -1666,27 +1684,27 @@ void AOEngine::saveSettings() { saveState(state); LL_INFOS("AOEngine") << "dirty state saved " << state->mName << LL_ENDL; - state->mDirty = FALSE; + state->mDirty = false; } } } } -void AOEngine::inMouselook(BOOL yes) +void AOEngine::inMouselook(bool mouselook) { - if (mInMouselook == yes) + if (mInMouselook == mouselook) { return; } - mInMouselook = yes; + mInMouselook = mouselook; if (!mCurrentSet) { return; } - if (!mCurrentSet->getMouselookDisable()) + if (!mCurrentSet->getMouselookStandDisable()) { return; } @@ -1701,7 +1719,7 @@ void AOEngine::inMouselook(BOOL yes) return; } - if (yes) + if (mouselook) { AOSet::AOState* state = mCurrentSet->getState(AOSet::Standing); if (!state) @@ -1722,7 +1740,7 @@ void AOEngine::inMouselook(BOOL yes) else { stopAllStandVariants(); - gAgent.sendAnimationRequest(override(ANIM_AGENT_STAND, TRUE), ANIM_REQUEST_START); + gAgent.sendAnimationRequest(override(ANIM_AGENT_STAND, true), ANIM_REQUEST_START); } } @@ -1731,14 +1749,14 @@ void AOEngine::setDefaultSet(AOSet* set) mDefaultSet = set; for (U32 index = 0; index < mSets.size(); ++index) { - mSets[index]->setDirty(TRUE); + mSets[index]->setDirty(true); } } -void AOEngine::setOverrideSits(AOSet* set, BOOL yes) +void AOEngine::setOverrideSits(AOSet* set, bool override_sit) { - set->setSitOverride(yes); - set->setDirty(TRUE); + set->setSitOverride(override_sit); + set->setDirty(true); if (mCurrentSet != set) { @@ -1755,7 +1773,7 @@ void AOEngine::setOverrideSits(AOSet* set, BOOL yes) return; } - if (yes) + if (override_sit) { stopAllSitVariants(); gAgent.sendAnimationRequest(ANIM_AGENT_SIT_GENERIC, ANIM_REQUEST_START); @@ -1783,17 +1801,17 @@ void AOEngine::setOverrideSits(AOSet* set, BOOL yes) } } -void AOEngine::setSmart(AOSet* set, BOOL yes) +void AOEngine::setSmart(AOSet* set, bool smart) { - set->setSmart(yes); - set->setDirty(TRUE); + set->setSmart(smart); + set->setDirty(true); if (!mEnabled) { return; } - if (yes) + if (smart) { // make sure to restart the sit cancel timer to fix sit overrides when the object we are // sitting on is playing its own animation @@ -1805,10 +1823,10 @@ void AOEngine::setSmart(AOSet* set, BOOL yes) } } -void AOEngine::setDisableStands(AOSet* set, BOOL yes) +void AOEngine::setDisableMouselookStands(AOSet* set, bool disabled) { - set->setMouselookDisable(yes); - set->setDirty(TRUE); + set->setMouselookStandDisable(disabled); + set->setDirty(true); if (mCurrentSet != set) { @@ -1825,22 +1843,22 @@ void AOEngine::setDisableStands(AOSet* set, BOOL yes) inMouselook(!mInMouselook); } -void AOEngine::setCycle(AOSet::AOState* state, BOOL yes) +void AOEngine::setCycle(AOSet::AOState* state, bool cycle) { - state->mCycle = yes; - state->mDirty = TRUE; + state->mCycle = cycle; + state->mDirty = true; } -void AOEngine::setRandomize(AOSet::AOState* state, BOOL yes) +void AOEngine::setRandomize(AOSet::AOState* state, bool randomize) { - state->mRandom = yes; - state->mDirty = TRUE; + state->mRandom = randomize; + state->mDirty = true; } void AOEngine::setCycleTime(AOSet::AOState* state, F32 time) { state->mCycleTime = time; - state->mDirty = TRUE; + state->mDirty = true; } void AOEngine::tick() @@ -1890,7 +1908,7 @@ void AOEngine::tick() } } -BOOL AOEngine::importNotecard(const LLInventoryItem* item) +bool AOEngine::importNotecard(const LLInventoryItem* item) { if (item) { @@ -1898,13 +1916,13 @@ BOOL AOEngine::importNotecard(const LLInventoryItem* item) if (getSetByName(item->getName())) { LLNotificationsUtil::add("AOImportSetAlreadyExists", LLSD()); - return FALSE; + return false; } if (!gAgent.allowOperation(PERM_COPY, item->getPermissions(), GP_OBJECT_MANIPULATE) && !gAgent.isGodlike()) { LLNotificationsUtil::add("AOImportPermissionDenied", LLSD()); - return FALSE; + return false; } if (item->getAssetUUID().notNull()) @@ -1929,10 +1947,10 @@ BOOL AOEngine::importNotecard(const LLInventoryItem* item) TRUE ); - return TRUE; + return true; } } - return FALSE; + return false; } // static @@ -1944,7 +1962,7 @@ void AOEngine::onNotecardLoadComplete(LLVFS* vfs, const LLUUID& assetUUID, LLAss // AOImportDownloadFailed LLNotificationsUtil::add("AOImportDownloadFailed", LLSD()); // NULL tells the importer to cancel all operations and free the import set memory - AOEngine::instance().parseNotecard(NULL); + AOEngine::instance().parseNotecard(nullptr); return; } LL_DEBUGS("AOEngine") << "Downloading import notecard complete." << LL_ENDL; @@ -2105,30 +2123,30 @@ void AOEngine::parseNotecard(const char* buffer) LLNotificationsUtil::add("AOImportInvalid", LLSD()); // NOTE: cleanup is always the same, needs streamlining delete mImportSet; - mImportSet = NULL; + mImportSet = nullptr; mUpdatedSignal(); return; } - mTimerCollection.enableImportTimer(TRUE); + mTimerCollection.enableImportTimer(true); mImportRetryCount = 0; processImport(false); } -void AOEngine::processImport(bool aFromTimer) +void AOEngine::processImport(bool from_timer) { if (mImportCategory.isNull()) { - mImportCategory = addSet(mImportSet->getName(), FALSE); + mImportCategory = addSet(mImportSet->getName(), false); if (mImportCategory.isNull()) { mImportRetryCount++; if (mImportRetryCount == 5) { // NOTE: cleanup is the same as at the end of this function. Needs streamlining. - mTimerCollection.enableImportTimer(FALSE); + mTimerCollection.enableImportTimer(false); delete mImportSet; - mImportSet = NULL; + mImportSet = nullptr; mImportCategory.setNull(); mUpdatedSignal(); LLSD args; @@ -2177,11 +2195,11 @@ void AOEngine::processImport(bool aFromTimer) if (allComplete) { - mTimerCollection.enableImportTimer(FALSE); + mTimerCollection.enableImportTimer(false); mOldImportSets.push_back(mImportSet); // FIRE-3801; Cannot delete here, or LLInstanceTracker gets upset. Just remember and delete mOldImportSets once we can. - mImportSet = NULL; + mImportSet = nullptr; mImportCategory.setNull(); - reload(aFromTimer); + reload(from_timer); } } @@ -2279,10 +2297,10 @@ BOOL AOSitCancelTimer::tick() AOTimerCollection::AOTimerCollection() : LLEventTimer(INVENTORY_POLLING_INTERVAL), - mInventoryTimer(TRUE), - mSettingsTimer(FALSE), - mReloadTimer(FALSE), - mImportTimer(FALSE) + mInventoryTimer(true), + mSettingsTimer(false), + mReloadTimer(false), + mImportTimer(false) { updateTimers(); } @@ -2318,27 +2336,27 @@ BOOL AOTimerCollection::tick() return FALSE; } -void AOTimerCollection::enableInventoryTimer(BOOL yes) +void AOTimerCollection::enableInventoryTimer(bool enable) { - mInventoryTimer = yes; + mInventoryTimer = enable; updateTimers(); } -void AOTimerCollection::enableSettingsTimer(BOOL yes) +void AOTimerCollection::enableSettingsTimer(bool enable) { - mSettingsTimer = yes; + mSettingsTimer = enable; updateTimers(); } -void AOTimerCollection::enableReloadTimer(BOOL yes) +void AOTimerCollection::enableReloadTimer(bool enable) { - mReloadTimer = yes; + mReloadTimer = enable; updateTimers(); } -void AOTimerCollection::enableImportTimer(BOOL yes) +void AOTimerCollection::enableImportTimer(bool enable) { - mImportTimer = yes; + mImportTimer = enable; updateTimers(); } diff --git a/indra/newview/aoengine.h b/indra/newview/aoengine.h index 50f55519b5..2bfb85d10b 100644 --- a/indra/newview/aoengine.h +++ b/indra/newview/aoengine.h @@ -25,17 +25,13 @@ #ifndef AOENGINE_H #define AOENGINE_H -#include - #include "aoset.h" #include "llassettype.h" #include "lleventtimer.h" -#include "llsingleton.h" - -// NaCl - feex #include "llextendedstatus.h" -// NaCl End +#include "llsingleton.h" +#include class AOTimerCollection : public LLEventTimer @@ -46,18 +42,18 @@ class AOTimerCollection virtual BOOL tick(); - void enableInventoryTimer(BOOL yes); - void enableSettingsTimer(BOOL yes); - void enableReloadTimer(BOOL yes); - void enableImportTimer(BOOL yes); + void enableInventoryTimer(bool enable); + void enableSettingsTimer(bool enable); + void enableReloadTimer(bool enable); + void enableImportTimer(bool enable); protected: void updateTimers(); - BOOL mInventoryTimer; - BOOL mSettingsTimer; - BOOL mReloadTimer; - BOOL mImportTimer; + bool mInventoryTimer; + bool mSettingsTimer; + bool mReloadTimer; + bool mImportTimer; }; // ---------------------------------------------------- @@ -98,35 +94,35 @@ class AOEngine CyclePrevious }; - void enable(BOOL yes); - void enable_stands(BOOL yes); - const LLUUID override(const LLUUID& motion, BOOL start); + void enable(bool enable); + void enableStands(bool enable_stands); + const LLUUID override(const LLUUID& motion, bool start); void tick(); void update(); void reload(bool); void reloadStateAnimations(AOSet::AOState* state); - void clear( bool ); + void clear(bool from_timer); const LLUUID& getAOFolder() const; - LLUUID addSet(const std::string& name, BOOL reload = TRUE); - BOOL removeSet(AOSet* set); + LLUUID addSet(const std::string& name, bool reload = true); + bool removeSet(AOSet* set); - BOOL addAnimation(const AOSet* set, AOSet::AOState* state, const LLInventoryItem* item, BOOL reload = TRUE); - BOOL removeAnimation(const AOSet* set, AOSet::AOState* state, S32 index); + bool addAnimation(const AOSet* set, AOSet::AOState* state, const LLInventoryItem* item, bool reload = true); + bool removeAnimation(const AOSet* set, AOSet::AOState* state, S32 index); void checkSitCancel(); - void checkBelowWater(BOOL yes); + void checkBelowWater(bool check_underwater); - BOOL importNotecard(const LLInventoryItem* item); - void processImport(bool); + bool importNotecard(const LLInventoryItem* item); + void processImport(bool from_timer); - BOOL swapWithPrevious(AOSet::AOState* state, S32 index); - BOOL swapWithNext(AOSet::AOState* state, S32 index); + bool swapWithPrevious(AOSet::AOState* state, S32 index); + bool swapWithNext(AOSet::AOState* state, S32 index); void cycleTimeout(const AOSet* set); void cycle(eCycleMode cycleMode); - void inMouselook(BOOL yes); + void inMouselook(bool mouselook); void selectSet(AOSet* set); AOSet* selectSetByName(const std::string& name); AOSet* getSetByName(const std::string& name) const; @@ -137,14 +133,14 @@ class AOEngine const std::vector getSetList() const; const std::string getCurrentSetName() const; const AOSet* getDefaultSet() const; - BOOL renameSet(AOSet* set, const std::string& name); + bool renameSet(AOSet* set, const std::string& name); void setDefaultSet(AOSet* set); - void setOverrideSits(AOSet* set, BOOL yes); - void setSmart(AOSet* set, BOOL yes); - void setDisableStands(AOSet* set, BOOL yes); - void setCycle(AOSet::AOState* set, BOOL yes); - void setRandomize(AOSet::AOState* state, BOOL yes); + void setOverrideSits(AOSet* set, bool override_sit); + void setSmart(AOSet* set, bool smart); + void setDisableMouselookStands(AOSet* set, bool disabled); + void setCycle(AOSet::AOState* set, bool cycle); + void setRandomize(AOSet::AOState* state, bool randomize); void setCycleTime(AOSet::AOState* state, F32 time); void saveSettings(); @@ -171,7 +167,7 @@ class AOEngine void stopAllStandVariants(); void stopAllSitVariants(); - BOOL foreignAnimations(); + bool foreignAnimations(); AOSet::AOState* mapSwimming(const LLUUID& motion) const; AOSet::AOState* getStateForMotion(const LLUUID& motion) const; @@ -179,8 +175,8 @@ class AOEngine void saveSet(const AOSet* set); void saveState(const AOSet::AOState* state); - BOOL createAnimationLink(const AOSet* set, AOSet::AOState* state, const LLInventoryItem* item); - BOOL findForeignItems(const LLUUID& uuid) const; + bool createAnimationLink(const AOSet* set, AOSet::AOState* state, const LLInventoryItem* item); + bool findForeignItems(const LLUUID& uuid) const; void purgeFolder(const LLUUID& uuid) const; void onRegionChange(); @@ -197,10 +193,10 @@ class AOEngine AOTimerCollection mTimerCollection; AOSitCancelTimer mSitCancelTimer; - BOOL mEnabled; - BOOL mEnabledStands; - BOOL mInMouselook; - BOOL mUnderWater; + bool mEnabled; + bool mEnabledStands; + bool mInMouselook; + bool mUnderWater; LLUUID mAOFolder; LLUUID mLastMotion; diff --git a/indra/newview/aoset.cpp b/indra/newview/aoset.cpp index 01b64092ea..18f5b5621e 100644 --- a/indra/newview/aoset.cpp +++ b/indra/newview/aoset.cpp @@ -32,11 +32,11 @@ AOSet::AOSet(const LLUUID inventoryID) : LLEventTimer(10000.0f), mInventoryID(inventoryID), mName("** New AO Set **"), - mSitOverride(FALSE), - mSmart(FALSE), - mMouselookDisable(FALSE), - mComplete(FALSE), - mDirty(FALSE), + mSitOverride(false), + mSmart(false), + mMouselookStandDisable(false), + mComplete(false), + mDirty(false), mCurrentMotion(LLUUID()) { LL_DEBUGS("AOEngine") << "Creating new AO set: " << this << LL_ENDL; @@ -113,10 +113,10 @@ AOSet::AOSet(const LLUUID inventoryID) mStates[index].mInventoryUUID = LLUUID::null; mStates[index].mCurrentAnimation = 0; mStates[index].mCurrentAnimationID = LLUUID::null; - mStates[index].mCycle = FALSE; - mStates[index].mRandom = FALSE; + mStates[index].mCycle = false; + mStates[index].mRandom = false; mStates[index].mCycleTime = 0.0f; - mStates[index].mDirty = FALSE; + mStates[index].mDirty = false; mStateNames.push_back(stateNameList[0]); } stopTimer(); @@ -145,7 +145,7 @@ AOSet::AOState* AOSet::getStateByName(const std::string& name) } } } - return NULL; + return nullptr; } AOSet::AOState* AOSet::getStateByRemapID(const LLUUID& id) @@ -163,7 +163,7 @@ AOSet::AOState* AOSet::getStateByRemapID(const LLUUID& id) return &mStates[index]; } } - return NULL; + return nullptr; } const LLUUID& AOSet::getAnimationForState(AOState* state) const @@ -240,54 +240,54 @@ void AOSet::setName(const std::string& name) mName=name; } -BOOL AOSet::getSitOverride() const +bool AOSet::getSitOverride() const { return mSitOverride; } -void AOSet::setSitOverride(BOOL yes) +void AOSet::setSitOverride(bool override_sit) { - mSitOverride = yes; + mSitOverride = override_sit; } -BOOL AOSet::getSmart() const +bool AOSet::getSmart() const { return mSmart; } -void AOSet::setSmart(BOOL yes) +void AOSet::setSmart(bool smart) { - mSmart = yes; + mSmart = smart; } -BOOL AOSet::getMouselookDisable() const +bool AOSet::getMouselookStandDisable() const { - return mMouselookDisable; + return mMouselookStandDisable; } -void AOSet::setMouselookDisable(BOOL yes) +void AOSet::setMouselookStandDisable(bool disable) { - mMouselookDisable = yes; + mMouselookStandDisable = disable; } -BOOL AOSet::getComplete() const +bool AOSet::getComplete() const { return mComplete; } -void AOSet::setComplete(BOOL yes) +void AOSet::setComplete(bool complete) { - mComplete = yes; + mComplete = complete; } -BOOL AOSet::getDirty() const +bool AOSet::getDirty() const { return mDirty; } -void AOSet::setDirty(BOOL yes) +void AOSet::setDirty(bool dirty) { - mDirty = yes; + mDirty = dirty; } void AOSet::setMotion(const LLUUID& motion) diff --git a/indra/newview/aoset.h b/indra/newview/aoset.h index 4d9b17409d..0e7d229bac 100644 --- a/indra/newview/aoset.h +++ b/indra/newview/aoset.h @@ -79,14 +79,14 @@ class AOSet std::string mName; std::vector mAlternateNames; LLUUID mRemapID; - BOOL mCycle; - BOOL mRandom; + bool mCycle; + bool mRandom; S32 mCycleTime; std::vector mAnimations; U32 mCurrentAnimation; LLUUID mCurrentAnimationID; LLUUID mInventoryUUID; - BOOL mDirty; + bool mDirty; }; const LLUUID& getInventoryUUID() const; @@ -95,23 +95,23 @@ class AOSet const std::string& getName() const; void setName(const std::string& name); - BOOL getSitOverride() const; - void setSitOverride(BOOL yes); + bool getSitOverride() const; + void setSitOverride(bool override_sit); - BOOL getSmart() const; - void setSmart(BOOL yes); + bool getSmart() const; + void setSmart(bool smart); - BOOL getMouselookDisable() const; - void setMouselookDisable(BOOL yes); + bool getMouselookStandDisable() const; + void setMouselookStandDisable(bool disable); - BOOL getComplete() const; - void setComplete(BOOL yes); + bool getComplete() const; + void setComplete(bool complete); const LLUUID& getMotion() const; void setMotion(const LLUUID& motion); - BOOL getDirty() const; - void setDirty(BOOL yes); + bool getDirty() const; + void setDirty(bool dirty); AOState* getState(S32 eName); AOState* getStateByName(const std::string& name); @@ -128,12 +128,12 @@ class AOSet LLUUID mInventoryID; std::string mName; - BOOL mSitOverride; - BOOL mSmart; - BOOL mMouselookDisable; - BOOL mComplete; + bool mSitOverride; + bool mSmart; + bool mMouselookStandDisable; + bool mComplete; LLUUID mCurrentMotion; - BOOL mDirty; + bool mDirty; AOState mStates[AOSTATES_MAX]; }; diff --git a/indra/newview/app_settings/grids.xml b/indra/newview/app_settings/grids.xml index 187d532449..6541975346 100644 --- a/indra/newview/app_settings/grids.xml +++ b/indra/newview/app_settings/grids.xml @@ -1108,5 +1108,47 @@ name login.aurorascape.com:8002 + vidadupla.com.br:8002 + + DirectoryFee + 0 + LastModified + 2020-11-06T14:42:01.07Z + SendGridInfoToViewerOnLogin + true + about + http://vidadupla.com.br + gatekeeper + vidadupla.com.br:8002 + gridname + Vida Dupla + gridnick + VD + helperuri + http://vidadupla.com.br/helper_scripts/helper/ + login_identifier_types + + agent + account + + loginpage + http://vidadupla.com.br/splash + loginuri + + http://vidadupla.com.br:8002/ + + name + vidadupla.com.br:8002 + password + http://vidadupla.com.br:8002/wifi/forgotpassword + platform + OpenSim + register + http://vidadupla.com.br:8002/wifi/user/account/ + search + http://vidadupla.com.br/ossearch/query.php + slurl_base + hop://vidadupla.com.br:8002/ + diff --git a/indra/newview/app_settings/posestand.xml b/indra/newview/app_settings/posestand.xml index 48ad752eb7..abf7b9cf3c 100644 --- a/indra/newview/app_settings/posestand.xml +++ b/indra/newview/app_settings/posestand.xml @@ -1,56 +1,56 @@ - febde518-eba6-1628-9070-a2c227852324 + d6fee4de-09af-80b2-72c9-dd5eb509f18c name PS_T_Pose - 8c607ae7-80a9-0004-5186-4e2bedafb256 + 63db3570-950d-089c-54c5-b406cb32635b name PS_Arms_Down_Legs_together - 7ec0f76c-88ac-b9f2-778f-8fd95a30c7fc + 46d5043d-6d86-c237-ab9c-c088d5608f37 name PS_Arms_down_sitting - a0f213b6-5506-3cf8-32ac-cfc9684048e7 + 767d488a-faa5-aeca-128f-af0b196967f1 name PS_Arms_downward_Legs_apart - 9e95943d-8020-e622-a4e0-4c9f8058091a + c2a3ba2f-499f-6129-2c43-2085815b3c81 name PS_Arms_downward_Legs_together - 6c5e15de-7079-f558-d635-7123b7379dec + 9e6fbfdb-d83e-a590-d59d-571c49002a7c name PS_Arms_forward_Legs_apart - 58401663-f5d3-828c-6cb5-ff618308e6be + 64d9b2e0-a124-b5fa-73f1-8703218f9aa8 name PS_Arms_forward_Legs_together - 7598be4b-6b1d-afaf-bc5e-0708fa3c214a + a5b4ae9f-05d2-998f-5ca5-63ac5cfdf595 name PS_Arms_straight_Legs_apart - 5acb15c0-1b14-6276-bd52-afdaad13cc1d + 16ca97b1-732d-8964-f044-1575d8bc2f98 name PS_Arms_straight_sitting - b28ee0ca-81b3-82f0-c3a3-5308efacf774 + 284ff48c-5f45-8351-c459-020f0bc1cd77 name PS_Arms_upward_Legs_apart - e2f67928-18ab-3991-4612-658cd88a1b4f + 76e563a3-6a97-0487-f8dc-70a673fa58d8 name PS_Arms_upward_Legs_together diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 30a32eecbd..0d55401aca 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -9129,6 +9129,188 @@ Backup 0 + MeshPreviewCanvasColor + + Comment + Canvas colour for the Mesh uploader + Persist + 1 + Type + Color4 + Value + + 0.169 + 0.169 + 0.169 + 1.0 + + + MeshPreviewEdgeColor + + Comment + Edge colour for the Mesh uploader preview + Persist + 1 + Type + Color4 + Value + + 0.4 + 0.4 + 0.4 + 1.0 + + + MeshPreviewBaseColor + + Comment + base diffuse colour for the Mesh uploader + Persist + 1 + Type + Color4 + Value + + 0.5 + 0.5 + 0.5 + 1.0 + + + MeshPreviewBrightnessColor + + Comment + Brightness modifier + Persist + 1 + Type + Color3 + Value + + 0.9 + 0.9 + 0.9 + + + MeshPreviewEdgeWidth + + Comment + line thickness used when display edges is selected in mesh preview + Persist + 1 + Type + F32 + Value + 1.0 + + MeshPreviewPhysicsEdgeColor + + Comment + Edge colour for the Mesh uploader physics preview + Persist + 1 + Type + Color4 + Value + + 0.0 + 0.25 + 0.5 + 0.25 + + + MeshPreviewPhysicsFillColor + + Comment + Fill colour for the Mesh uploader physics preview + Persist + 1 + Type + Color4 + Value + + 0.0 + 0.5 + 1.0 + 0.5 + + + MeshPreviewPhysicsEdgeWidth + + Comment + line thickness used when display physics is selected in mesh preview + Persist + 1 + Type + F32 + Value + 1.0 + + MeshPreviewDegenerateEdgeColor + + Comment + Edge colour for the Mesh uploader Degenerate preview + Persist + 1 + Type + Color4 + Value + + 1.0 + 0.0 + 0.0 + 1.0 + + + MeshPreviewDegenerateFillColor + + Comment + Fill colour for the Mesh uploader Degenerate preview + Persist + 1 + Type + Color4 + Value + + 1.0 + 0.0 + 0.0 + 0.5 + + + MeshPreviewDegenerateEdgeWidth + + Comment + line thickness used when display Degenerate is selected in mesh preview + Persist + 1 + Type + F32 + Value + 3.0 + + MeshPreviewDegeneratePointSize + + Comment + Large point size used to highlight degenerate triangle vertices in Mesh preview + Persist + 1 + Type + F32 + Value + 8.0 + + MeshPreviewZoomLimit + + Comment + Maximum Zoom level in preview + Persist + 1 + Type + F32 + Value + 10.0 + FSMeshPreviewUVGuideFile Comment @@ -10485,6 +10667,17 @@ Change of this parameter will affect the layout of buttons in notification toast Value 13 + PreviewRenderSize + + Comment + Resolution of the image rendered for the mesh upload preview (must be a power of 2) + Persist + 1 + Type + S32 + Value + 1024 + PreviewAmbientColor Comment @@ -12528,7 +12721,7 @@ Change of this parameter will affect the layout of buttons in notification toast RenderGLCoreProfile Comment - Don't use a compatibility profile OpenGL context. Requires restart. Basic shaders MUST be enabled. + Don't use a compatibility profile OpenGL context. Requires restart. Persist 1 Type @@ -15010,7 +15203,7 @@ Change of this parameter will affect the layout of buttons in notification toast Comment SyncMaterialSettings Persist - 1 + 0 Type Boolean Value @@ -24624,6 +24817,17 @@ Change of this parameter will affect the layout of buttons in notification toast Value 0 + FSLegacyNotificationWellAutoResize + + Comment + Enables the automatic resizing of the legacy notifications and system messages well + Persist + 1 + Type + Boolean + Value + 0 + FSShowIMSendButton Comment @@ -25239,5 +25443,71 @@ Change of this parameter will affect the layout of buttons in notification toast Value 0 + FSAllowWaterDistortionOcclusion + + Comment + If allowed, object occlusion setting will be restored for generating the water reflection distortion. This was allowed pre-EEP and got disabled for EEP. While generating is more exact without occlusion, it can cause a huge performance impact. + Persist + 1 + Type + Boolean + Value + 0 + + FSDynamicTextureMemory + + Comment + If enabled, Firestorm dynamically uses available memory for textures + Persist + 1 + Type + Boolean + Value + 1 + + FSDynamicTextureMemoryCacheReserve + + Comment + Percentage of total physical GPU memory to reserve for textures loaded, but currently not being rendered + Persist + 1 + Type + S32 + Value + 10 + + FSDynamicTextureMemoryGPUReserve + + Comment + Percentage of total physical video memory to reserve for other usage + Persist + 1 + Type + S32 + Value + 10 + + FSDynamicTextureMemoryMinTextureMemory + + Comment + Minimum amount of GPU memory in Megabytes that should be used for textures (takes reserves and total physical GPU memory into account) + Persist + 1 + Type + S32 + Value + 512 + + FSAllowDoubleClickOnScriptedObjects + + Comment + If enabled, allows double-click movement action (walk/teleport) to scripted objects + Persist + 1 + Type + Boolean + Value + 1 + diff --git a/indra/newview/app_settings/shaders/class1/objects/previewV.glsl b/indra/newview/app_settings/shaders/class1/objects/previewV.glsl index 1d2daeaf82..4bb588335a 100644 --- a/indra/newview/app_settings/shaders/class1/objects/previewV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/previewV.glsl @@ -91,7 +91,7 @@ void main() // Collect normal lights (need to be divided by two, as we later multiply by 2) col.rgb += light_diffuse[1].rgb * calcDirectionalLight(norm, light_position[1].xyz); - col.rgb += light_diffuse[2].rgb * calcDirectionalLight(norm, light_position[2].xyz); - col.rgb += light_diffuse[3].rgb * calcDirectionalLight(norm, light_position[3].xyz); + col.rgb += light_diffuse[2].rgb*calcLocalLight(pos.xyz, norm, light_position[2], light_direction[2], light_attenuation[2].x, light_attenuation[2].z); + col.rgb += light_diffuse[3].rgb*calcLocalLight(pos.xyz, norm, light_position[3], light_direction[3], light_attenuation[3].x, light_attenuation[3].z); vertex_color = col*color; } diff --git a/indra/newview/fs_viewer_manifest.py b/indra/newview/fs_viewer_manifest.py index 1aa007fd1c..933c43be6a 100644 --- a/indra/newview/fs_viewer_manifest.py +++ b/indra/newview/fs_viewer_manifest.py @@ -181,7 +181,7 @@ class FSViewerManifest: os.rename("%s/firestorm-symbols-%s-%d.tar.bz2" % (self.args['configuration'].lower(), osname, self.address_size), sName) - # New llmanifest is braindead and does not allow any optional files. for some files. + # New llmanifest is braindead and does not allow any optional files. # For some files likes jemalloc or openjpeg it makes sense to allow them to be abesent def fs_try_path( self, src, dst=None ): if self.path( src,dst ) == 0: diff --git a/indra/newview/fschathistory.cpp b/indra/newview/fschathistory.cpp index ca44855f3f..262d0fe1f2 100644 --- a/indra/newview/fschathistory.cpp +++ b/indra/newview/fschathistory.cpp @@ -65,6 +65,7 @@ #include "llstring.h" #include "llurlaction.h" #include "llviewercontrol.h" +#include "llviewermenu.h" #include "llviewernetwork.h" #include "fscommon.h" @@ -156,6 +157,18 @@ public: { mAvatarNameCacheConnection.disconnect(); } + auto menu = mPopupMenuHandleAvatar.get(); + if (menu) + { + menu->die(); + mPopupMenuHandleAvatar.markDead(); + } + menu = mPopupMenuHandleObject.get(); + if (menu) + { + menu->die(); + mPopupMenuHandleObject.markDead(); + } } BOOL handleMouseUp(S32 x, S32 y, MASK mask) @@ -557,36 +570,6 @@ public: BOOL postBuild() { - LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; - LLUICtrl::EnableCallbackRegistry::ScopedRegistrar registrar_enable; - - registrar.add("AvatarIcon.Action", boost::bind(&FSChatHistoryHeader::onAvatarIconContextMenuItemClicked, this, _2)); - registrar_enable.add("AvatarIcon.Check", boost::bind(&FSChatHistoryHeader::onAvatarIconContextMenuItemChecked, this, _2)); - registrar_enable.add("AvatarIcon.Enable", boost::bind(&FSChatHistoryHeader::onAvatarIconContextMenuItemEnabled, this, _2)); - registrar_enable.add("AvatarIcon.Visible", boost::bind(&FSChatHistoryHeader::onAvatarIconContextMenuItemVisible, this, _2)); - registrar.add("ObjectIcon.Action", boost::bind(&FSChatHistoryHeader::onObjectIconContextMenuItemClicked, this, _2)); - registrar_enable.add("ObjectIcon.Visible", boost::bind(&FSChatHistoryHeader::onObjectIconContextMenuItemVisible, this, _2)); - - LLMenuGL* menu = LLUICtrlFactory::getInstance()->createFromFile("menu_avatar_icon.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); - if (menu) - { - mPopupMenuHandleAvatar = menu->getHandle(); - } - else - { - LL_WARNS() << " Failed to create menu_avatar_icon.xml" << LL_ENDL; - } - - menu = LLUICtrlFactory::getInstance()->createFromFile("menu_object_icon.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); - if (menu) - { - mPopupMenuHandleObject = menu->getHandle(); - } - else - { - LL_WARNS() << " Failed to create menu_object_icon.xml" << LL_ENDL; - } - setDoubleClickCallback(boost::bind(&FSChatHistoryHeader::showInspector, this)); setMouseEnterCallback(boost::bind(&FSChatHistoryHeader::showInfoCtrl, this)); @@ -930,14 +913,57 @@ protected: void showObjectContextMenu(S32 x,S32 y) { LLMenuGL* menu = (LLMenuGL*)mPopupMenuHandleObject.get(); - if(menu) + if (!menu) + { + LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; + LLUICtrl::EnableCallbackRegistry::ScopedRegistrar registrar_enable; + + registrar.add("ObjectIcon.Action", boost::bind(&FSChatHistoryHeader::onObjectIconContextMenuItemClicked, this, _2)); + registrar_enable.add("ObjectIcon.Visible", boost::bind(&FSChatHistoryHeader::onObjectIconContextMenuItemVisible, this, _2)); + + menu = LLUICtrlFactory::getInstance()->createFromFile("menu_object_icon.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); + if (menu) + { + mPopupMenuHandleObject = menu->getHandle(); + menu->updateParent(LLMenuGL::sMenuContainer); + LLMenuGL::showPopup(this, menu, x, y); + } + else + { + LL_WARNS() << " Failed to create menu_object_icon.xml" << LL_ENDL; + } + } + else + { LLMenuGL::showPopup(this, menu, x, y); + } } void showAvatarContextMenu(S32 x,S32 y) { LLMenuGL* menu = (LLMenuGL*)mPopupMenuHandleAvatar.get(); + if (!menu) + { + LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; + LLUICtrl::EnableCallbackRegistry::ScopedRegistrar registrar_enable; + + registrar.add("AvatarIcon.Action", boost::bind(&FSChatHistoryHeader::onAvatarIconContextMenuItemClicked, this, _2)); + registrar_enable.add("AvatarIcon.Check", boost::bind(&FSChatHistoryHeader::onAvatarIconContextMenuItemChecked, this, _2)); + registrar_enable.add("AvatarIcon.Enable", boost::bind(&FSChatHistoryHeader::onAvatarIconContextMenuItemEnabled, this, _2)); + registrar_enable.add("AvatarIcon.Visible", boost::bind(&FSChatHistoryHeader::onAvatarIconContextMenuItemVisible, this, _2)); + + menu = LLUICtrlFactory::getInstance()->createFromFile("menu_avatar_icon.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); + if (menu) + { + mPopupMenuHandleAvatar = menu->getHandle(); + } + else + { + LL_WARNS() << " Failed to create menu_avatar_icon.xml" << LL_ENDL; + } + } + if(menu) { bool is_friend = LLAvatarActions::isFriend(mAvatarID); diff --git a/indra/newview/fsdata.cpp b/indra/newview/fsdata.cpp index 90b84869e9..40414960c3 100644 --- a/indra/newview/fsdata.cpp +++ b/indra/newview/fsdata.cpp @@ -1012,12 +1012,14 @@ LLSD FSData::getSystemInfo() LLSD info = LLAppViewer::instance()->getViewerInfo(); std::string sysinfo1("\n"); - sysinfo1 += llformat("%s %s (%d) %s %s (%s %dbit) %s\n\n", LLAppViewer::instance()->getSecondLifeTitle().c_str(), - LLVersionInfo::getInstance()->getShortVersion().c_str(), - LLVersionInfo::getInstance()->getBuild(), - info["BUILD_DATE"].asString().c_str(), info["BUILD_TIME"].asString().c_str(), - LLVersionInfo::getInstance()->getChannel().c_str(), - info["ADDRESS_SIZE"].asInteger(), info["BUILD_TYPE"].asString().c_str()); + sysinfo1 += llformat("%s %s (%d) %s %s (%s %dbit / %s) %s\n\n", LLAppViewer::instance()->getSecondLifeTitle().c_str(), + LLVersionInfo::getInstance()->getShortVersion().c_str(), + LLVersionInfo::getInstance()->getBuild(), + info["BUILD_DATE"].asString().c_str(), info["BUILD_TIME"].asString().c_str(), + LLVersionInfo::getInstance()->getChannel().c_str(), + info["ADDRESS_SIZE"].asInteger(), + info["SIMD"].asString().c_str(), + info["BUILD_TYPE"].asString().c_str()); sysinfo1 += llformat("Build with %s version %s\n\n", info["COMPILER"].asString().c_str(), info["COMPILER_VERSION"].asString().c_str()); sysinfo1 += llformat("I am in %s located at %s (%s)\n", info["REGION"].asString().c_str(), info["HOSTNAME"].asString().c_str(), info["HOSTIP"].asString().c_str()); sysinfo1 += llformat("%s\n\n", info["SERVER_VERSION"].asString().c_str()); @@ -1027,7 +1029,8 @@ LLSD FSData::getSystemInfo() sysinfo1 += llformat("OS: %s\n", info["OS_VERSION"].asString().c_str()); sysinfo1 += llformat("Graphics Card Vendor: %s\n", info["GRAPHICS_CARD_VENDOR"].asString().c_str()); sysinfo1 += llformat("Graphics Card: %s\n", info["GRAPHICS_CARD"].asString().c_str()); - + sysinfo1 += llformat("Graphics Card Memory: %d MB\n", info["GRAPHICS_CARD_MEMORY"].asInteger()); + if (info.has("GRAPHICS_DRIVER_VERSION")) { sysinfo1 += llformat("Graphics Card Driver Version: %s\n", info["GRAPHICS_DRIVER_VERSION"].asString().c_str()); @@ -1058,9 +1061,16 @@ LLSD FSData::getSystemInfo() sysinfo2 += llformat("Draw Distance: %d m\n", info["DRAW_DISTANCE"].asInteger()); sysinfo2 += llformat("Bandwidth: %d kbit/s\n", info["BANDWIDTH"].asInteger()); sysinfo2 += llformat("LOD Factor: %.3f\n", info["LOD"].asReal()); - sysinfo2 += llformat("Render quality: %s\n", info["RENDERQUALITY_FSDATA_ENGLISH"].asString().c_str()); // FIRE-4785: Current render quality setting in sysinfo / about floater + sysinfo2 += llformat("Render quality: %s\n", info["RENDERQUALITY_FSDATA_ENGLISH"].asString().c_str()); sysinfo2 += llformat("ALM enabled: %s\n", info["ALMSTATUS_FSDATA_ENGLISH"].asString().c_str()); - sysinfo2 += llformat("Texture memory: %d MB (%.2f)\n", info["TEXTUREMEMORY"].asInteger(), info["TEXTUREMEMORYMULTIPLIER"].asReal()); + if (info["TEXTUREMEMORYDYNAMIC"].asBoolean()) + { + sysinfo2 += llformat("Texture memory: Dynamic (%d MB min / %d%% Cache / %d%% VRAM)\n", info["TEXTUREMEMORYMIN"].asInteger(), info["TEXTUREMEMORYCACHERESERVE"].asInteger(), info["TEXTUREMEMORYGPURESERVE"].asInteger()); + } + else + { + sysinfo2 += llformat("Texture memory: %d MB (%.2f)\n", info["TEXTUREMEMORY"].asInteger(), info["TEXTUREMEMORYMULTIPLIER"].asReal()); + } sysinfo2 += "VFS (cache) creation time (UTC) " + info["VFS_DATE"].asString(); LLSD sysinfos; diff --git a/indra/newview/fsexportperms.cpp b/indra/newview/fsexportperms.cpp index d0d25fa3b7..607f849e1c 100644 --- a/indra/newview/fsexportperms.cpp +++ b/indra/newview/fsexportperms.cpp @@ -105,8 +105,7 @@ bool FSExportPermsCheck::canExportNode(LLSelectNode* node, bool dae) { if (dae) { - LLSD mesh_header = gMeshRepo.getMeshHeader(sculpt_params->getSculptTexture()); - exportable = mesh_header["creator"].asUUID() == gAgentID; + exportable = gMeshRepo.getCreatorFromHeader(sculpt_params->getSculptTexture()) == gAgentID; } else { diff --git a/indra/newview/fsfloateraddtocontactset.cpp b/indra/newview/fsfloateraddtocontactset.cpp index 3375139ffb..a8ebb4b7b6 100644 --- a/indra/newview/fsfloateraddtocontactset.cpp +++ b/indra/newview/fsfloateraddtocontactset.cpp @@ -36,8 +36,8 @@ #include "llslurl.h" FSFloaterAddToContactSet::FSFloaterAddToContactSet(const LLSD& target) -: LLFloater(target) -, mContactSetsCombo(NULL) +: LLFloater(target), + mContactSetsCombo(NULL) { if (target.isArray()) { @@ -56,6 +56,14 @@ FSFloaterAddToContactSet::FSFloaterAddToContactSet(const LLSD& target) mContactSetChangedConnection = LGGContactSets::getInstance()->setContactSetChangeCallback(boost::bind(&FSFloaterAddToContactSet::updateSets, this, _1)); } +FSFloaterAddToContactSet::~FSFloaterAddToContactSet() +{ + if (mContactSetChangedConnection.connected()) + { + mContactSetChangedConnection.disconnect(); + } +} + BOOL FSFloaterAddToContactSet::postBuild() { if (mHasMultipleAgents) diff --git a/indra/newview/fsfloateraddtocontactset.h b/indra/newview/fsfloateraddtocontactset.h index d7ede61a06..873f9d16fd 100644 --- a/indra/newview/fsfloateraddtocontactset.h +++ b/indra/newview/fsfloateraddtocontactset.h @@ -43,7 +43,7 @@ public: BOOL postBuild(); private: - ~FSFloaterAddToContactSet(){}; + ~FSFloaterAddToContactSet(); void onClickAdd(); void onClickCancel(); void onClickAddSet(); diff --git a/indra/newview/fsfloatercontactsetconfiguration.cpp b/indra/newview/fsfloatercontactsetconfiguration.cpp index 839f750a75..e4d2d45d50 100644 --- a/indra/newview/fsfloatercontactsetconfiguration.cpp +++ b/indra/newview/fsfloatercontactsetconfiguration.cpp @@ -63,22 +63,13 @@ BOOL FSFloaterContactSetConfiguration::postBuild() mRenameButton->setCommitCallback(boost::bind(&FSFloaterContactSetConfiguration::onRenameSet, this)); mSetSwatch = getChild("set_swatch"); - if (mSetSwatch) - { - mSetSwatch->setCommitCallback(boost::bind(&FSFloaterContactSetConfiguration::onCommitSetColor, this)); - } + mSetSwatch->setCommitCallback(boost::bind(&FSFloaterContactSetConfiguration::onCommitSetColor, this)); mGlobalSwatch = getChild("global_swatch"); - if (mGlobalSwatch) - { - mGlobalSwatch->setCommitCallback(boost::bind(&FSFloaterContactSetConfiguration::onCommitDefaultColor, this)); - } + mGlobalSwatch->setCommitCallback(boost::bind(&FSFloaterContactSetConfiguration::onCommitDefaultColor, this)); mNotificationCheckBox = getChild("show_set_notifications"); - if (mNotificationCheckBox) - { - mNotificationCheckBox->setCommitCallback(boost::bind(&FSFloaterContactSetConfiguration::onCommitSetNotifications, this)); - } + mNotificationCheckBox->setCommitCallback(boost::bind(&FSFloaterContactSetConfiguration::onCommitSetNotifications, this)); return TRUE; } diff --git a/indra/newview/fsfloaterexport.cpp b/indra/newview/fsfloaterexport.cpp index af4b8442bb..4e6bd43315 100644 --- a/indra/newview/fsfloaterexport.cpp +++ b/indra/newview/fsfloaterexport.cpp @@ -32,7 +32,6 @@ #include "lfsimfeaturehandler.h" #include "llagent.h" -//#include "llagentconstants.h" #include "llagentdata.h" #include "llavatarnamecache.h" #include "llbufferstream.h" @@ -212,6 +211,15 @@ FSFloaterObjectExport::~FSFloaterObjectExport() { gIdleCallbacks.deleteFunction(FSFloaterObjectExport::onIdle, this); } + + for (const auto& object_id : mInventoryRequests) + { + LLViewerObject* object = gObjectList.findObject(object_id); + if (object) + { + object->removeInventoryListener(this); + } + } } BOOL FSFloaterObjectExport::postBuild() @@ -1098,7 +1106,7 @@ void FSFloaterObjectExport::onExportFileSelected(const std::vector& if (!exportSelection()) { LLNotificationsUtil::add("ExportFailed"); - //closeFloater(); + closeFloater(); } } diff --git a/indra/newview/fsfloatervoicecontrols.cpp b/indra/newview/fsfloatervoicecontrols.cpp index 13729f2f6a..94d3a40a46 100644 --- a/indra/newview/fsfloatervoicecontrols.cpp +++ b/indra/newview/fsfloatervoicecontrols.cpp @@ -42,6 +42,7 @@ #include "fsfloaterim.h" #include "llimview.h" #include "llfloaterreg.h" +#include "lloutputmonitorctrl.h" #include "fsparticipantlist.h" #include "llspeakers.h" #include "lltextutil.h" diff --git a/indra/newview/fsgridhandler.cpp b/indra/newview/fsgridhandler.cpp index befe182bda..392132f27c 100644 --- a/indra/newview/fsgridhandler.cpp +++ b/indra/newview/fsgridhandler.cpp @@ -587,17 +587,23 @@ void LLGridManager::addGrid(GridEntry* grid_entry, AddState state) if (FETCH == state || RETRY == state) { std::string grid = utf8str_tolower(grid_entry->grid[GRID_VALUE]); +// FIRE-24068 allow https support - based on patch by unregi resident + std::string uri; std::string match = "://"; size_t find_scheme = grid.find(match); if ( std::string::npos != find_scheme) { - // We only support http so just remove anything the user might have chosen - grid.erase(0,find_scheme+match.length()); - grid_entry->grid[GRID_VALUE] = grid; + uri = grid; // assign the full URI + grid.erase(0, find_scheme + match.length()); // trim the protocol + grid_entry->grid[GRID_VALUE] = grid; // keep the name + } + else + { + // no protocol was specified let's assume http + // GRID_VALUE remains unchanged + uri = "http://" + grid; } - - std::string uri = "http://" + grid; if (std::string::npos != uri.find("lindenlab.com")) { @@ -762,6 +768,8 @@ void LLGridManager::addGrid(GridEntry* grid_entry, AddState state) if (existing_grid.has("DEPRECATED")) { LL_DEBUGS("GridManager") << "Removing entry marked as deprecated in the fallback list: " << grid << LL_ENDL; + mGridList[grid] = grid_entry->grid; + list_changed = true; } else if (grid_entry->grid.has("USER_DELETED")) { diff --git a/indra/newview/fspanelcontactsets.cpp b/indra/newview/fspanelcontactsets.cpp index c9dada71f8..a6fb47ed86 100644 --- a/indra/newview/fspanelcontactsets.cpp +++ b/indra/newview/fspanelcontactsets.cpp @@ -75,20 +75,14 @@ BOOL FSPanelContactSets::postBuild() childSetAction("remove_displayname_btn", boost::bind(&FSPanelContactSets::onClickRemoveDisplayName, this)); mContactSetCombo = getChild("combo_sets"); - if (mContactSetCombo) - { - mContactSetCombo->setCommitCallback(boost::bind(&FSPanelContactSets::refreshSetList, this)); - refreshContactSets(); - } + mContactSetCombo->setCommitCallback(boost::bind(&FSPanelContactSets::refreshSetList, this)); + refreshContactSets(); mAvatarList = getChild("contact_list"); - if (mAvatarList) - { - mAvatarList->setCommitCallback(boost::bind(&FSPanelContactSets::onSelectAvatar, this)); - mAvatarList->setNoItemsCommentText(getString("empty_list")); - mAvatarList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu); - generateAvatarList(mContactSetCombo->getValue().asString()); - } + mAvatarList->setCommitCallback(boost::bind(&FSPanelContactSets::onSelectAvatar, this)); + mAvatarList->setNoItemsCommentText(getString("empty_list")); + mAvatarList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu); + generateAvatarList(mContactSetCombo->getValue().asString()); return TRUE; } @@ -324,22 +318,24 @@ void FSPanelContactSets::onClickSetPseudonym() void FSPanelContactSets::onClickRemovePseudonym() { + LGGContactSets& contact_sets = LGGContactSets::instance(); for (auto const& id : mAvatarSelections) { - if (LGGContactSets::getInstance()->hasPseudonym(id)) + if (contact_sets.hasPseudonym(id)) { - LGGContactSets::getInstance()->clearPseudonym(id); + contact_sets.clearPseudonym(id); } } } void FSPanelContactSets::onClickRemoveDisplayName() { + LGGContactSets& contact_sets = LGGContactSets::instance(); for (auto const& id : mAvatarSelections) { - if (!LGGContactSets::getInstance()->hasDisplayNameRemoved(id)) + if (!contact_sets.hasDisplayNameRemoved(id)) { - LGGContactSets::getInstance()->removeDisplayName(id); + contact_sets.removeDisplayName(id); } } } diff --git a/indra/newview/fspanellogin.cpp b/indra/newview/fspanellogin.cpp index 12a7d3dcee..6699d6bed9 100644 --- a/indra/newview/fspanellogin.cpp +++ b/indra/newview/fspanellogin.cpp @@ -1110,9 +1110,11 @@ void FSPanelLogin::onSelectServer() LLGridManager::getInstance()->addGridListChangedCallback(boost::bind(&FSPanelLogin::gridListChanged, this, _1)); LLGridManager::getInstance()->addGrid(sPendingNewGridURI); } + else #endif - - LLGridManager::getInstance()->setGridChoice(server_combo_val.asString()); + { + LLGridManager::getInstance()->setGridChoice(server_combo_val.asString()); + } /* * Determine whether or not the value in the start_location_combo makes sense @@ -1385,9 +1387,12 @@ void FSPanelLogin::updateServerCombo() if (!sPendingNewGridURI.empty()) { LLSD grid_name = LLGridManager::getInstance()->getGridByAttribute(GRID_LOGIN_URI_VALUE, sPendingNewGridURI, false); - LL_INFOS("AppInit") << "new grid for ["<setSelectedByValue(grid_name, true); - LLGridManager::getInstance()->setGridChoice(grid_name.asString()); + LL_INFOS("AppInit") << "new grid for ["<setSelectedByValue(grid_name, true); + LLGridManager::getInstance()->setGridChoice(grid_name.asString()); + } } #endif diff --git a/indra/newview/fspanelprofile.cpp b/indra/newview/fspanelprofile.cpp index c0b91e1bd1..d4081fb6d5 100644 --- a/indra/newview/fspanelprofile.cpp +++ b/indra/newview/fspanelprofile.cpp @@ -66,6 +66,7 @@ #include "llparcel.h" #include "lltrans.h" #include "llviewercontrol.h" +#include "llviewermenu.h" #include "llviewernetwork.h" //LLGridManager #include "llviewerparcelmgr.h" #include "llviewerregion.h" diff --git a/indra/newview/fsparticipantlist.cpp b/indra/newview/fsparticipantlist.cpp index 35e28977dd..b4b6c20caa 100644 --- a/indra/newview/fsparticipantlist.cpp +++ b/indra/newview/fsparticipantlist.cpp @@ -37,6 +37,7 @@ #include "llimview.h" #include "llnotifications.h" #include "llnotificationsutil.h" +#include "lloutputmonitorctrl.h" #include "llspeakers.h" #include "llviewercontrol.h" #include "llviewermenu.h" diff --git a/indra/newview/fsradar.cpp b/indra/newview/fsradar.cpp index 8fcbcc433a..c50b04578c 100644 --- a/indra/newview/fsradar.cpp +++ b/indra/newview/fsradar.cpp @@ -176,9 +176,17 @@ void FSRadar::updateRadarList() LLWorld* world = LLWorld::getInstance(); LLMuteList* mutelist = LLMuteList::getInstance(); FSAssetBlacklist* blacklist = FSAssetBlacklist::getInstance(); + LGGContactSets* contactsets = LGGContactSets::getInstance(); + LLLocalSpeakerMgr* speakermgr = LLLocalSpeakerMgr::getInstance(); + LLVoiceClient* voice_client = LLVoiceClient::getInstance(); + LLViewerParcelMgr& parcelmgr = LLViewerParcelMgr::instance(); + LLUIColorTable& colortable = LLUIColorTable::instance(); + LLAvatarTracker& avatartracker = LLAvatarTracker::instance(); + FSLSLBridge& bridge = FSLSLBridge::instance(); - const F32 chat_range_say = LFSimFeatureHandler::getInstance()->sayRange(); - const F32 chat_range_shout = LFSimFeatureHandler::getInstance()->shoutRange(); + LFSimFeatureHandler& simfeaturehandler = LFSimFeatureHandler::instance(); + const F32 chat_range_say = simfeaturehandler.sayRange(); + const F32 chat_range_shout = simfeaturehandler.shoutRange(); static const std::string str_chat_entering = LLTrans::getString("entering_chat_range"); static const std::string str_chat_leaving = LLTrans::getString("leaving_chat_range"); @@ -205,7 +213,7 @@ void FSRadar::updateRadarList() static LLCachedControl sFSRadarColorNamesByDistance(gSavedSettings, "FSRadarColorNamesByDistance", false); static LLCachedControl sFSRadarShowMutedAndDerendered(gSavedSettings, "FSRadarShowMutedAndDerendered"); static LLCachedControl sFSRadarEnhanceByBridge(gSavedSettings, "FSRadarEnhanceByBridge"); - bool sUseLSLBridge = FSLSLBridge::instance().canUseBridge(); + bool sUseLSLBridge = bridge.canUseBridge(); F32 drawRadius(sRenderFarClip); const LLVector3d& posSelf = gAgent.getPositionGlobal(); @@ -272,8 +280,8 @@ void FSRadar::updateRadarList() mEntryList[avid] = new FSRadarEntry(avid); } - LLLocalSpeakerMgr::getInstance()->update(TRUE); - + speakermgr->update(TRUE); + //STEP 2: Transform detected model list data into more flexible multimap data structure; //TS: Count avatars in chat range and in the same region U32 inChatRange = 0; @@ -333,7 +341,7 @@ void FSRadar::updateRadarList() avRegion = reg->getRegionID(); } bool isInSameRegion = (avRegion == regionSelf); - bool isOnSameParcel = LLViewerParcelMgr::instance().inAgentParcel(avPos); + bool isOnSameParcel = parcelmgr.inAgentParcel(avPos); S32 seentime = (S32)difftime(now, ent->mFirstSeen); S32 hours = (S32)(seentime / 3600); S32 mins = (S32)((seentime - hours * 3600) / 60); @@ -524,7 +532,7 @@ void FSRadar::updateRadarList() entry["age"] = (avAge > -1 ? llformat("%d", avAge) : ""); if (ent->hasAlertAge()) { - entry_options["age_color"] = LLUIColorTable::instance().getColor("AvatarListItemAgeAlert", LLColor4::red).get().getValue(); + entry_options["age_color"] = colortable.getColor("AvatarListItemAgeAlert", LLColor4::red).get().getValue(); if (sRadarAvatarAgeAlert && !ent->hasAgeAlertPerformed()) { @@ -549,21 +557,21 @@ void FSRadar::updateRadarList() { if (avRange <= chat_range_say) { - range_color = LLUIColorTable::instance().getColor("AvatarListItemChatRange", LLColor4::red); + range_color = colortable.getColor("AvatarListItemChatRange", LLColor4::red); inChatRange++; } else if (avRange <= chat_range_shout) { - range_color = LLUIColorTable::instance().getColor("AvatarListItemShoutRange", LLColor4::white); + range_color = colortable.getColor("AvatarListItemShoutRange", LLColor4::white); } else { - range_color = LLUIColorTable::instance().getColor("AvatarListItemBeyondShoutRange", LLColor4::white); + range_color = colortable.getColor("AvatarListItemBeyondShoutRange", LLColor4::white); } } else { - range_color = LLUIColorTable::instance().getColor("AvatarListItemBeyondShoutRange", LLColor4::white); + range_color = colortable.getColor("AvatarListItemBeyondShoutRange", LLColor4::white); } entry_options["range_color"] = range_color.get().getValue(); @@ -579,7 +587,7 @@ void FSRadar::updateRadarList() // Set friends colors / styles LLFontGL::StyleFlags nameCellStyle = LLFontGL::NORMAL; - const LLRelationship* relation = LLAvatarTracker::instance().getBuddyInfo(avId); + const LLRelationship* relation = avatartracker.getBuddyInfo(avId); if (relation && !sFSLegacyRadarFriendColoring && !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) { nameCellStyle = (LLFontGL::StyleFlags)(nameCellStyle | LLFontGL::BOLD); @@ -590,18 +598,17 @@ void FSRadar::updateRadarList() } entry_options["name_style"] = nameCellStyle; - LLColor4 name_color = LLUIColorTable::instance().getColor("AvatarListItemIconDefaultColor", LLColor4::white).get(); - name_color = LGGContactSets::getInstance()->colorize(avId, (sFSRadarColorNamesByDistance ? range_color.get() : name_color), LGG_CS_RADAR); + LLColor4 name_color = colortable.getColor("AvatarListItemIconDefaultColor", LLColor4::white).get(); + name_color = contactsets->colorize(avId, (sFSRadarColorNamesByDistance ? range_color.get() : name_color), LGG_CS_RADAR); - LGGContactSets::getInstance()->hasFriendColorThatShouldShow(avId, LGG_CS_RADAR, name_color); + contactsets->hasFriendColorThatShouldShow(avId, LGG_CS_RADAR, name_color); entry_options["name_color"] = name_color.getValue(); // Voice power level indicator - LLVoiceClient* voice_client = LLVoiceClient::getInstance(); if (voice_client->voiceEnabled() && voice_client->isVoiceWorking()) { - LLSpeaker* speaker = LLLocalSpeakerMgr::getInstance()->findSpeaker(avId); + LLSpeaker* speaker = speakermgr->findSpeaker(avId); if (speaker && speaker->isInVoiceChannel()) { EVoicePowerLevel power_level = voice_client->getPowerLevel(avId); @@ -656,7 +663,7 @@ void FSRadar::updateRadarList() if (++updatesPerRequest > FSRADAR_MAX_OFFSET_REQUESTS) { msg = msg.substr(0, msg.size() - 1); - FSLSLBridge::instance().viewerToLSL(prefix + msg, FSLSLBridgeRequestRadarPos_Success); + bridge.viewerToLSL(prefix + msg, FSLSLBridgeRequestRadarPos_Success); //LL_INFOS() << " OFFSET REQUEST SEGMENT"<< prefix << msg << LL_ENDL; msg = ""; updatesPerRequest = 0; @@ -665,7 +672,7 @@ void FSRadar::updateRadarList() if (updatesPerRequest > 0) { msg = msg.substr(0, msg.size() - 1); - FSLSLBridge::instance().viewerToLSL(prefix + msg, FSLSLBridgeRequestRadarPos_Success); + bridge.viewerToLSL(prefix + msg, FSLSLBridgeRequestRadarPos_Success); //LL_INFOS() << " OFFSET REQUEST FINAL " << prefix << msg << LL_ENDL; } diff --git a/indra/newview/fsregioncross.cpp b/indra/newview/fsregioncross.cpp index f7644d8bfe..737427a087 100644 --- a/indra/newview/fsregioncross.cpp +++ b/indra/newview/fsregioncross.cpp @@ -147,10 +147,9 @@ bool RegionCrossExtrapolate::ifsaton(const LLViewerObject& vo) // true if root return false; // not root, cannot be sat upon } - for (auto iter = vo.getChildren().begin(); // check for avatar as child of root - iter != vo.getChildren().end(); iter++) + LLViewerObject::const_child_list_t& children = vo.getChildren(); + for (const auto child : children) { - LLViewerObject* child = *iter; if (child->isAvatar()) { return true; diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index caebeb1d90..0d6b84e20b 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -154,6 +154,7 @@ Var SKIP_DIALOGS # Set from command line in .onInit. autoinstall GUI and # Var SKIP_AUTORUN # Skip automatic launch of the viewer after install -- Commented out: Disable autorun Var DO_UNINSTALL_V2 # If non-null, path to a previous Viewer 2 installation that will be uninstalled. Var NO_STARTMENU # Optional start menu entry +Var FRIENDLY_APP_NAME # FIRE-30446: Set FriendlyAppName for protocols # Function definitions should go before file includes, because calls to # DLLs like LangDLL trigger an implicit file include, so if that call is at @@ -450,6 +451,15 @@ ${Else} WriteRegDWORD SHELL_CONTEXT "${MSUNINSTALL_KEY}" "EstimatedSize" "0x00061800" # 390 MB ${EndIf} +# FIRE-30446: Set FriendlyAppName for protocols +${If} ${ISOPENSIM} == "1" + StrCpy $FRIENDLY_APP_NAME "${INSTNAME} $(ForOpenSimSuffix)" +${Else} + StrCpy $FRIENDLY_APP_NAME "${INSTNAME}" +${EndIf} +# + + # from FS:Ansariel WriteRegStr SHELL_CONTEXT "${MSUNINSTALL_KEY}" "DisplayIcon" '"$INSTDIR\$VIEWER_EXE"' @@ -469,18 +479,33 @@ WriteRegStr HKEY_CLASSES_ROOT "${URLNAME}\DefaultIcon" "" '"$INSTDIR\$VIEWER_EXE # URL param must be last item passed to viewer, it ignores subsequent params to avoid parameter injection attacks. # MAINT-8305: On SLURL click, directly invoke the viewer, not the launcher. WriteRegExpandStr HKEY_CLASSES_ROOT "${URLNAME}\shell\open\command" "" '"$INSTDIR\$VIEWER_EXE" -url "%1"' -WriteRegStr HKEY_CLASSES_ROOT "x-grid-location-info" "(default)" "URL:Second Life" +# FIRE-30446: Set FriendlyAppName for protocols +WriteRegStr HKEY_CLASSES_ROOT "${URLNAME}\shell\open" "FriendlyAppName" "$FRIENDLY_APP_NAME" + +WriteRegStr HKEY_CLASSES_ROOT "x-grid-location-info" "(default)" "URL:Hypergrid" WriteRegStr HKEY_CLASSES_ROOT "x-grid-location-info" "URL Protocol" "" WriteRegStr HKEY_CLASSES_ROOT "x-grid-location-info\DefaultIcon" "" '"$INSTDIR\$VIEWER_EXE"' # URL param must be last item passed to viewer, it ignores subsequent params to avoid parameter injection attacks. WriteRegExpandStr HKEY_CLASSES_ROOT "x-grid-location-info\shell\open\command" "" '"$INSTDIR\$VIEWER_EXE" -url "%1"' +# FIRE-30446: Set FriendlyAppName for protocols +WriteRegStr HKEY_CLASSES_ROOT "x-grid-location-info\shell\open" "FriendlyAppName" "$FRIENDLY_APP_NAME" + +# FIRE-30446: Register x-grid-info hypergrid protocol +WriteRegStr HKEY_CLASSES_ROOT "x-grid-info" "(default)" "URL:Hypergrid" +WriteRegStr HKEY_CLASSES_ROOT "x-grid-info" "URL Protocol" "" +WriteRegStr HKEY_CLASSES_ROOT "x-grid-info\DefaultIcon" "" '"$INSTDIR\$VIEWER_EXE"' +WriteRegExpandStr HKEY_CLASSES_ROOT "x-grid-info\shell\open\command" "" '"$INSTDIR\$VIEWER_EXE" -url "%1"' +WriteRegStr HKEY_CLASSES_ROOT "x-grid-info\shell\open" "FriendlyAppName" "$FRIENDLY_APP_NAME" # Register hop:// protocol registry info -WriteRegStr HKEY_CLASSES_ROOT "hop" "(default)" "URL:Second Life" -WriteRegStr HKEY_CLASSES_ROOT "hop" "URL Protocol" "" -WriteRegStr HKEY_CLASSES_ROOT "hop\DefaultIcon" "" '"$INSTDIR\$VIEWER_EXE"' -WriteRegExpandStr HKEY_CLASSES_ROOT "hop\shell\open\command" "" '"$INSTDIR\$VIEWER_EXE" -url "%1"' +${If} ${ISOPENSIM} == "1" + WriteRegStr HKEY_CLASSES_ROOT "hop" "(default)" "URL:Hypergrid" + WriteRegStr HKEY_CLASSES_ROOT "hop" "URL Protocol" "" + WriteRegStr HKEY_CLASSES_ROOT "hop\DefaultIcon" "" '"$INSTDIR\$VIEWER_EXE"' + WriteRegExpandStr HKEY_CLASSES_ROOT "hop\shell\open\command" "" '"$INSTDIR\$VIEWER_EXE" -url "%1"' + WriteRegStr HKEY_CLASSES_ROOT "hop\shell\open" "FriendlyAppName" "$FRIENDLY_APP_NAME" +${EndIf} # # Ask before creating protocol registry entries @@ -732,8 +757,11 @@ Push $2 Delete "$2\AppData\Roaming\Firestorm\plugin_cookies.txt" Delete "$2\AppData\Roaming\Firestorm\typed_locations.txt" # Delete files in \Users\\AppData\Local\Firestorm - RMDir /r "$2\AppData\Local\Firestorm" #Delete the Havok cache folder - RMDir /r "$2\AppData\Local\FirestormOS" #Delete the OpenSim cache folder + ${If} ${ISOPENSIM} == "0" + RMDir /r "$2\AppData\Local\Firestorm" #Delete the Havok cache folder + ${Else} + RMDir /r "$2\AppData\Local\FirestormOS" #Delete the OpenSim cache folder + ${EndIf} CONTINUE: IntOp $0 $0 + 1 @@ -806,12 +834,18 @@ NOFOLDER: MessageBox MB_YESNO $(DeleteRegistryKeysMB) IDYES DeleteKeys IDNO NoDelete DeleteKeys: - DeleteRegKey SHELL_CONTEXT "SOFTWARE\Classes\hop" # Unregister hop:// protocol registry info + DeleteRegKey SHELL_CONTEXT "SOFTWARE\Classes\x-grid-info" # FIRE-30446: Register x-grid-info hypergrid protocol DeleteRegKey SHELL_CONTEXT "SOFTWARE\Classes\x-grid-location-info" DeleteRegKey SHELL_CONTEXT "SOFTWARE\Classes\secondlife" - DeleteRegKey HKEY_CLASSES_ROOT "hop" # Unregister hop:// protocol registry info + DeleteRegKey HKEY_CLASSES_ROOT "x-grid-info" # FIRE-30446: Register x-grid-info hypergrid protocol DeleteRegKey HKEY_CLASSES_ROOT "x-grid-location-info" DeleteRegKey HKEY_CLASSES_ROOT "secondlife" + # Unregister hop:// protocol registry info + ${If} ${ISOPENSIM} == "1" + DeleteRegKey SHELL_CONTEXT "SOFTWARE\Classes\hop" + DeleteRegKey HKEY_CLASSES_ROOT "hop" + ${EndIf} + # NoDelete: diff --git a/indra/newview/installers/windows/lang_da.nsi b/indra/newview/installers/windows/lang_da.nsi index 8daa818030..f803b509ee 100644 Binary files a/indra/newview/installers/windows/lang_da.nsi and b/indra/newview/installers/windows/lang_da.nsi differ diff --git a/indra/newview/installers/windows/lang_de.nsi b/indra/newview/installers/windows/lang_de.nsi index 3b81a616f3..a49fb02737 100755 Binary files a/indra/newview/installers/windows/lang_de.nsi and b/indra/newview/installers/windows/lang_de.nsi differ diff --git a/indra/newview/installers/windows/lang_en-us.nsi b/indra/newview/installers/windows/lang_en-us.nsi index e1ec013626..17cd63d242 100644 Binary files a/indra/newview/installers/windows/lang_en-us.nsi and b/indra/newview/installers/windows/lang_en-us.nsi differ diff --git a/indra/newview/installers/windows/lang_es.nsi b/indra/newview/installers/windows/lang_es.nsi index c7b478a44c..9150cbf3fe 100755 Binary files a/indra/newview/installers/windows/lang_es.nsi and b/indra/newview/installers/windows/lang_es.nsi differ diff --git a/indra/newview/installers/windows/lang_fr.nsi b/indra/newview/installers/windows/lang_fr.nsi index b221b3c8be..bbe204eda7 100755 Binary files a/indra/newview/installers/windows/lang_fr.nsi and b/indra/newview/installers/windows/lang_fr.nsi differ diff --git a/indra/newview/installers/windows/lang_it.nsi b/indra/newview/installers/windows/lang_it.nsi index f18f1c9cc5..ad79c360f4 100755 Binary files a/indra/newview/installers/windows/lang_it.nsi and b/indra/newview/installers/windows/lang_it.nsi differ diff --git a/indra/newview/installers/windows/lang_ja.nsi b/indra/newview/installers/windows/lang_ja.nsi index 8b338460ea..8584327aca 100755 Binary files a/indra/newview/installers/windows/lang_ja.nsi and b/indra/newview/installers/windows/lang_ja.nsi differ diff --git a/indra/newview/installers/windows/lang_pl.nsi b/indra/newview/installers/windows/lang_pl.nsi index acbb136f6f..8779c30ac0 100644 Binary files a/indra/newview/installers/windows/lang_pl.nsi and b/indra/newview/installers/windows/lang_pl.nsi differ diff --git a/indra/newview/installers/windows/lang_pt-br.nsi b/indra/newview/installers/windows/lang_pt-br.nsi index f53da4d6b6..aad994dfd7 100755 Binary files a/indra/newview/installers/windows/lang_pt-br.nsi and b/indra/newview/installers/windows/lang_pt-br.nsi differ diff --git a/indra/newview/installers/windows/lang_ru.nsi b/indra/newview/installers/windows/lang_ru.nsi index 8be2086b7d..b554270bd7 100755 Binary files a/indra/newview/installers/windows/lang_ru.nsi and b/indra/newview/installers/windows/lang_ru.nsi differ diff --git a/indra/newview/installers/windows/lang_tr.nsi b/indra/newview/installers/windows/lang_tr.nsi index 374ac85a7b..31e805a143 100755 Binary files a/indra/newview/installers/windows/lang_tr.nsi and b/indra/newview/installers/windows/lang_tr.nsi differ diff --git a/indra/newview/installers/windows/lang_zh.nsi b/indra/newview/installers/windows/lang_zh.nsi index 27e417abb6..375803e51f 100755 Binary files a/indra/newview/installers/windows/lang_zh.nsi and b/indra/newview/installers/windows/lang_zh.nsi differ diff --git a/indra/newview/lfsimfeaturehandler.cpp b/indra/newview/lfsimfeaturehandler.cpp index 9c62b17010..a8eb3d5b60 100644 --- a/indra/newview/lfsimfeaturehandler.cpp +++ b/indra/newview/lfsimfeaturehandler.cpp @@ -24,7 +24,7 @@ #include "llviewercontrol.h" #include "llviewernetwork.h" #include "llviewerregion.h" - +#include "llworld.h" // #include "llnotificationsutil.h" #include "tea.h" @@ -104,6 +104,20 @@ void LFSimFeatureHandler::setSupportedFeatures() mShoutRange = extras.has("shout-range") ? extras["shout-range"].asInteger() : 100; mWhisperRange = extras.has("whisper-range") ? extras["whisper-range"].asInteger() : 10; + if(extras.has("GridURL")) + { + mGridURL = extras["GridURL"].asString(); + auto pos = mGridURL.find("://"); + if( pos != std::string::npos) + { + mGridURL = mGridURL.substr(pos+3,mGridURL.size()-(pos+3)); + } + } + else + { + mGridURL = LLGridManager::instance().getGridId(); + } + if (extras.has("SimulatorFPS") && extras.has("SimulatorFPSFactor") && extras.has("SimulatorFPSWarnPercent") && extras.has("SimulatorFPSCritPercent")) { @@ -190,6 +204,21 @@ void LFSimFeatureHandler::setSupportedFeatures() mCurrencySymbolOverride = LLStringUtil::null; } // + // Adding feature extensions adopted from Aurora to OpenSim + auto regionSettings=LLWorld::getInstance(); + if(extras.has("MinPrimScale")) + { + regionSettings->setRegionMinPrimScale(extras["MinPrimScale"].asReal()); + } + if(extras.has("MaxPrimScale")) + { + regionSettings->setRegionMaxPrimScale(extras["MaxPrimScale"].asReal()); + regionSettings->setRegionMaxPrimScaleNoMesh(extras["MaxPrimScale"].asReal()); + } + if(extras.has("MaxPhysPrimScale")) + { + regionSettings->setMaxPhysPrimScale(extras["MaxPhysPrimScale"].asReal()); + } } else // OpenSim specifics are unsupported reset all to default { @@ -203,6 +232,7 @@ void LFSimFeatureHandler::setSupportedFeatures() mSimulatorFPSFactor = 1.f; mSimulatorFPSWarn = 30.f; mSimulatorFPSCrit = 20.f; + LLWorld::getInstance()->refreshLimits();// reset prim scales etc. if (LLLoginInstance::getInstance()->hasResponse("search")) { diff --git a/indra/newview/lfsimfeaturehandler.h b/indra/newview/lfsimfeaturehandler.h index 06096ab9d6..9a348857e2 100644 --- a/indra/newview/lfsimfeaturehandler.h +++ b/indra/newview/lfsimfeaturehandler.h @@ -88,6 +88,7 @@ public: // Accessors bool simSupportsExport() const { return mSupportsExport; } std::string mapServerURL() const { return mMapServerURL; } + std::string gridURL() const { return mGridURL; } std::string searchURL() const { return mSearchURL; } U32 sayRange() const { return mSayRange; } U32 shoutRange() const { return mShoutRange; } @@ -113,6 +114,7 @@ private: // SignaledTypes SignaledType mSupportsExport; std::string mMapServerURL; + std::string mGridURL; SignaledType mSearchURL; SignaledType mSayRange; SignaledType mShoutRange; diff --git a/indra/newview/lggcontactsets.cpp b/indra/newview/lggcontactsets.cpp index f1070ca36b..8ad4cce2df 100644 --- a/indra/newview/lggcontactsets.cpp +++ b/indra/newview/lggcontactsets.cpp @@ -690,9 +690,11 @@ bool LGGContactSets::notifyForFriend(const LLUUID& friend_id) void LGGContactSets::addToSet(const uuid_vec_t& avatar_ids, const std::string& set_name) { + LLAvatarTracker& tracker = LLAvatarTracker::instance(); + for (auto const& avatar_id : avatar_ids) { - if (!LLAvatarTracker::instance().isBuddy(avatar_id)) + if (!tracker.isBuddy(avatar_id)) { mExtraAvatars.insert(avatar_id); } @@ -709,12 +711,13 @@ void LGGContactSets::addToSet(const uuid_vec_t& avatar_ids, const std::string& s void LGGContactSets::removeNonFriendFromList(const LLUUID& non_friend_id, bool save_changes /*= true*/) { + LLAvatarTracker& tracker = LLAvatarTracker::instance(); uuid_set_t::iterator found = mExtraAvatars.find(non_friend_id); if (found != mExtraAvatars.end()) { mExtraAvatars.erase(found); - if (!LLAvatarTracker::instance().isBuddy(non_friend_id)) + if (!tracker.isBuddy(non_friend_id)) { clearPseudonym(non_friend_id, save_changes); removeFriendFromAllSets(non_friend_id, save_changes); @@ -749,13 +752,12 @@ bool LGGContactSets::isNonFriend(const LLUUID& non_friend_id) uuid_vec_t LGGContactSets::getListOfNonFriends() { + LLAvatarTracker& tracker = LLAvatarTracker::instance(); uuid_vec_t nonfriends; - for (uuid_set_t::iterator itr = mExtraAvatars.begin(); itr != mExtraAvatars.end(); ++itr) + for (const auto& friend_id : mExtraAvatars) { - LLUUID friend_id = *itr; - - if (!LLAvatarTracker::instance().isBuddy(friend_id)) + if (!tracker.isBuddy(friend_id)) { nonfriends.push_back(friend_id); } @@ -817,9 +819,9 @@ void LGGContactSets::clearPseudonym(const LLUUID& friend_id, bool save_changes / inst->erase(friend_id); inst->fetch(friend_id); // update LLVOAvatar::invalidateNameTag(friend_id); - if (!LLAvatarTracker::instance().isBuddy(friend_id) && LGGContactSets::getInstance()->getFriendSets(friend_id).size() == 0) + if (!LLAvatarTracker::instance().isBuddy(friend_id) && getFriendSets(friend_id).size() == 0) { - LGGContactSets::getInstance()->removeNonFriendFromList(friend_id, save_changes); + removeNonFriendFromList(friend_id, save_changes); } avatar_name_cache_connection_map_t::iterator it = mAvatarNameCacheConnections.find(friend_id); @@ -863,7 +865,7 @@ bool LGGContactSets::hasPseudonym(uuid_vec_t ids) bool has_pseudonym = false; for (uuid_vec_t::const_iterator id = ids.begin(); id != ids.end(); ++id) { - if (LGGContactSets::getInstance()->hasPseudonym(*id)) + if (hasPseudonym(*id)) { has_pseudonym = true; break; @@ -882,7 +884,7 @@ bool LGGContactSets::hasDisplayNameRemoved(uuid_vec_t ids) bool has_pseudonym = false; for (uuid_vec_t::const_iterator id = ids.begin(); id != ids.end(); ++id) { - if (LGGContactSets::getInstance()->hasDisplayNameRemoved(*id)) + if (hasDisplayNameRemoved(*id)) { has_pseudonym = true; break; @@ -964,13 +966,14 @@ void LGGContactSets::removeSet(const std::string& set_name) contact_set_map_t::iterator found = mContactSets.find(set_name); if (found != mContactSets.end()) { + LLAvatarTracker& tracker = LLAvatarTracker::instance(); uuid_vec_t non_friends_for_removal; ContactSet* cset = found->second; for (uuid_set_t::iterator member_it = cset->mFriends.begin(); member_it != cset->mFriends.end(); ++member_it) { - if (!LLAvatarTracker::instance().isBuddy(*member_it) && - LGGContactSets::getInstance()->getFriendSets(*member_it).size() == 1 && // Current set is only set! - !LGGContactSets::getInstance()->hasPseudonym(*member_it)) + if (!tracker.isBuddy(*member_it) && + getFriendSets(*member_it).size() == 1 && // Current set is only set! + !hasPseudonym(*member_it)) { non_friends_for_removal.push_back(*member_it); } @@ -978,7 +981,7 @@ void LGGContactSets::removeSet(const std::string& set_name) for (uuid_vec_t::iterator nf_it = non_friends_for_removal.begin(); nf_it != non_friends_for_removal.end(); ++nf_it) { - LGGContactSets::getInstance()->removeNonFriendFromList(*nf_it, false); + removeNonFriendFromList(*nf_it, false); } delete found->second; @@ -1016,7 +1019,6 @@ void LGGContactSets::setSetColor(const std::string& set_name, const LLColor4& co set->mColor = color; saveToDisk(); } - } bool LGGContactSets::isInternalSetName(const std::string& set_name) @@ -1076,6 +1078,7 @@ bool LGGContactSets::handleRemoveAvatarFromSetCallback(const LLSD& notification, if (option == 0) { LGGContactSets& instance = LGGContactSets::instance(); + LLAvatarTracker& tracker = LLAvatarTracker::instance(); for (LLSD::array_const_iterator it = notification["payload"]["ids"].beginArray(); it != notification["payload"]["ids"].endArray(); @@ -1086,7 +1089,7 @@ bool LGGContactSets::handleRemoveAvatarFromSetCallback(const LLSD& notification, instance.removeFriendFromSet(id, set_name, false); - if (!LLAvatarTracker::instance().isBuddy(id) && + if (!tracker.isBuddy(id) && instance.getFriendSets(id).size() == 0 && !instance.hasPseudonym(id)) { diff --git a/indra/newview/llaccountingcostmanager.h b/indra/newview/llaccountingcostmanager.h index 55e1d19f05..d133c6437b 100644 --- a/indra/newview/llaccountingcostmanager.h +++ b/indra/newview/llaccountingcostmanager.h @@ -30,12 +30,6 @@ #include "llhandle.h" #include "llaccountingcost.h" -#include "httpcommon.h" -#include "llcoros.h" -#include "lleventcoro.h" -#include "httprequest.h" -#include "httpheaders.h" -#include "httpoptions.h" //=============================================================================== // An interface class for panels which display the parcel accounting information. diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index d003fb0dc0..8d99856e4a 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -155,6 +155,10 @@ public: EStatus getStatus() const {return mStatus;}; void setStatus(EStatus pStatus) {mStatus = pStatus;}; + static std::map sTeleportStatusName; + static const std::string& statusName(EStatus status); + virtual void toOstream(std::ostream& os) const; + virtual bool canRestartTeleport(); virtual void startTeleport() = 0; @@ -166,12 +170,19 @@ private: EStatus mStatus; }; +std::map LLTeleportRequest::sTeleportStatusName = { { kPending, "kPending" }, + { kStarted, "kStarted" }, + { kFailed, "kFailed" }, + { kRestartPending, "kRestartPending"} }; + class LLTeleportRequestViaLandmark : public LLTeleportRequest { public: LLTeleportRequestViaLandmark(const LLUUID &pLandmarkId); virtual ~LLTeleportRequestViaLandmark(); + virtual void toOstream(std::ostream& os) const; + virtual bool canRestartTeleport(); virtual void startTeleport(); @@ -190,6 +201,8 @@ public: LLTeleportRequestViaLure(const LLUUID &pLureId, BOOL pIsLureGodLike); virtual ~LLTeleportRequestViaLure(); + virtual void toOstream(std::ostream& os) const; + virtual bool canRestartTeleport(); virtual void startTeleport(); @@ -207,6 +220,8 @@ public: LLTeleportRequestViaLocation(const LLVector3d &pPosGlobal); virtual ~LLTeleportRequestViaLocation(); + virtual void toOstream(std::ostream& os) const; + virtual bool canRestartTeleport(); virtual void startTeleport(); @@ -229,6 +244,8 @@ public: // LLTeleportRequestViaLocationLookAt(const LLVector3d &pPosGlobal); virtual ~LLTeleportRequestViaLocationLookAt(); + virtual void toOstream(std::ostream& os) const; + virtual bool canRestartTeleport(); virtual void startTeleport(); @@ -569,6 +586,8 @@ void LLAgent::init() void LLAgent::cleanup() { mRegionp = NULL; + mTeleportRequest = NULL; + mTeleportCanceled = NULL; if (mTeleportFinishedSlot.connected()) { mTeleportFinishedSlot.disconnect(); @@ -1020,7 +1039,12 @@ void LLAgent::setRegion(LLViewerRegion *regionp) if (mRegionp != regionp) { - LL_INFOS("AgentLocation") << "Moving agent into region: " << regionp->getName() << LL_ENDL; + LL_INFOS("AgentLocation","Teleport") << "Moving agent into region: handle " << regionp->getHandle() + << " id " << regionp->getRegionID() + << " name " << regionp->getName() + << " previous region " + << (mRegionp ? mRegionp->getRegionID() : LLUUID::null) + << LL_ENDL; if (mRegionp) { // NaCl - Antispam Registry clear anti-spam queues when changing regions @@ -3226,6 +3250,7 @@ void LLAgent::handlePreferredMaturityResult(U8 pServerMaturity) else { mMaturityPreferenceNumRetries = 0; + LL_WARNS() << "Too many retries for maturity preference" << LL_ENDL; reportPreferredMaturityError(); } } @@ -3277,6 +3302,7 @@ void LLAgent::reportPreferredMaturityError() mIsMaturityRatingChangingDuringTeleport = false; if (hasPendingTeleportRequest()) { + LL_WARNS("Teleport") << "Teleport failing due to preferred maturity error" << LL_ENDL; setTeleportState(LLAgent::TELEPORT_NONE); } @@ -4556,7 +4582,7 @@ bool LLAgent::teleportBridgeGlobal(const LLVector3d& pos_global) // protected bool LLAgent::teleportCore(bool is_local) { - LL_INFOS("Teleport") << "In teleport core!" << LL_ENDL; + LL_DEBUGS("Teleport") << "In teleport core" << LL_ENDL; if ((TELEPORT_NONE != mTeleportState) && (mTeleportState != TELEPORT_PENDING)) { LL_WARNS() << "Attempt to teleport when already teleporting." << LL_ENDL; @@ -4623,11 +4649,13 @@ bool LLAgent::teleportCore(bool is_local) add(LLStatViewer::TELEPORT, 1); if (is_local) { + LL_INFOS("Teleport") << "Setting teleport state to TELEPORT_LOCAL" << LL_ENDL; gAgent.setTeleportState( LLAgent::TELEPORT_LOCAL ); } else { gTeleportDisplay = TRUE; + LL_INFOS("Teleport") << "Non-local, setting teleport state to TELEPORT_START" << LL_ENDL; gAgent.setTeleportState( LLAgent::TELEPORT_START ); //release geometry from old location @@ -4711,6 +4739,7 @@ void LLAgent::startTeleportRequest() if (!isMaturityPreferenceSyncedWithServer()) { gTeleportDisplay = TRUE; + LL_INFOS("Teleport") << "Maturity preference not synced yet, setting teleport state to TELEPORT_PENDING" << LL_ENDL; setTeleportState(TELEPORT_PENDING); } else @@ -4754,10 +4783,19 @@ void LLAgent::handleTeleportFinished() { if (mRegionp->capabilitiesReceived()) { + LL_DEBUGS("Teleport") << "capabilities have been received for region handle " + << mRegionp->getHandle() + << " id " << mRegionp->getRegionID() + << ", calling onCapabilitiesReceivedAfterTeleport()" + << LL_ENDL; onCapabilitiesReceivedAfterTeleport(); } else { + LL_DEBUGS("Teleport") << "Capabilities not yet received for region handle " + << mRegionp->getHandle() + << " id " << mRegionp->getRegionID() + << LL_ENDL; mRegionp->setCapabilitiesReceivedCallback(boost::bind(&LLAgent::onCapabilitiesReceivedAfterTeleport)); } } @@ -4795,6 +4833,18 @@ void LLAgent::handleTeleportFailed() /*static*/ void LLAgent::onCapabilitiesReceivedAfterTeleport() { + if (gAgent.getRegion()) + { + LL_DEBUGS("Teleport") << "running after capabilities received callback has been triggered, agent region " + << gAgent.getRegion()->getHandle() + << " id " << gAgent.getRegion()->getRegionID() + << " name " << gAgent.getRegion()->getName() + << LL_ENDL; + } + else + { + LL_WARNS("Teleport") << "called when agent region is null!" << LL_ENDL; + } check_merchant_status(); } @@ -4811,8 +4861,8 @@ void LLAgent::teleportRequest(const U64& region_handle, const LLVector3& pos_loc LLViewerRegion* regionp = getRegion(); if (regionp && teleportCore(region_handle == regionp->getHandle())) { - LL_INFOS("") << "TeleportLocationRequest: '" << region_handle << "':" - << pos_local << LL_ENDL; + LL_INFOS("Teleport") << "Sending TeleportLocationRequest: '" << region_handle << "':" + << pos_local << LL_ENDL; LLMessageSystem* msg = gMessageSystem; msg->newMessage("TeleportLocationRequest"); msg->nextBlockFast(_PREHASH_AgentData); @@ -4870,6 +4920,11 @@ void LLAgent::doTeleportViaLandmark(const LLUUID& landmark_asset_id) LLViewerRegion *regionp = getRegion(); if(regionp && teleportCore()) { + LL_INFOS("Teleport") << "Sending TeleportLandmarkRequest. Current region handle " << regionp->getHandle() + << " region id " << regionp->getRegionID() + << " requested landmark id " << landmark_asset_id + << LL_ENDL; + LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_TeleportLandmarkRequest); msg->nextBlockFast(_PREHASH_Info); @@ -4902,6 +4957,11 @@ void LLAgent::doTeleportViaLure(const LLUUID& lure_id, BOOL godlike) teleport_flags |= TELEPORT_FLAGS_VIA_LURE; } + LL_INFOS("Teleport") << "Sending TeleportLureRequest." + << " Current region handle " << regionp->getHandle() + << " region id " << regionp->getRegionID() + << " lure id " << lure_id + << LL_ENDL; // send the message LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_TeleportLureRequest); @@ -4924,6 +4984,8 @@ void LLAgent::teleportCancel() LLViewerRegion* regionp = getRegion(); if(regionp) { + LL_INFOS("Teleport") << "Sending TeleportCancel" << LL_ENDL; + // send the message LLMessageSystem* msg = gMessageSystem; msg->newMessage("TeleportCancel"); @@ -4936,13 +4998,14 @@ void LLAgent::teleportCancel() } clearTeleportRequest(); gAgent.setTeleportState( LLAgent::TELEPORT_NONE ); - gPipeline.resetVertexBuffers(); + gPipeline.resetVertexBuffers(); } void LLAgent::restoreCanceledTeleportRequest() { if (mTeleportCanceled != NULL) { + LL_INFOS() << "Restoring canceled teleport request, setting state to TELEPORT_REQUESTED" << LL_ENDL; gAgent.setTeleportState( LLAgent::TELEPORT_REQUESTED ); mTeleportRequest = mTeleportCanceled; mTeleportCanceled.reset(); @@ -5004,7 +5067,6 @@ void LLAgent::doTeleportViaLocation(const LLVector3d& pos_global) } else if(regionp && teleportCore(isLocal)) { - LL_WARNS() << "Using deprecated teleportlocationrequest." << LL_ENDL; // send the message LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_TeleportLocationRequest); @@ -5025,6 +5087,14 @@ void LLAgent::doTeleportViaLocation(const LLVector3d& pos_global) msg->addVector3Fast(_PREHASH_Position, pos); pos.mV[VX] += 1; msg->addVector3Fast(_PREHASH_LookAt, pos); + + LL_WARNS("Teleport") << "Sending deprecated(?) TeleportLocationRequest." + << " pos_global " << pos_global + << " region_x " << region_x + << " region_y " << region_y + << " region_handle " << region_handle + << LL_ENDL; + sendReliableMessage(); } // Client LSL Bridge @@ -5131,7 +5201,11 @@ void LLAgent::setTeleportState(ETeleportState state) " for previously failed teleport. Ignore!" << LL_ENDL; return; } - LL_DEBUGS("Teleport") << "Setting teleport state to " << state << " Previous state: " << mTeleportState << LL_ENDL; + LL_DEBUGS("Teleport") << "Setting teleport state to " + << LLAgent::teleportStateName(state) << "(" << state << ")" + << " Previous state: " + << teleportStateName(mTeleportState) << "(" << mTeleportState << ")" + << LL_ENDL; mTeleportState = state; if (mTeleportState > TELEPORT_NONE && gSavedSettings.getBOOL("FreezeTime")) { @@ -5482,6 +5556,34 @@ void LLAgent::observeFriends() } } +std::map LLAgent::sTeleportStateName = { { TELEPORT_NONE, "TELEPORT_NONE" }, + { TELEPORT_START, "TELEPORT_START" }, + { TELEPORT_REQUESTED, "TELEPORT_REQUESTED" }, + { TELEPORT_MOVING, "TELEPORT_MOVING" }, + { TELEPORT_START_ARRIVAL, "TELEPORT_START_ARRIVAL" }, + { TELEPORT_ARRIVING, "TELEPORT_ARRIVING" }, + { TELEPORT_LOCAL, "TELEPORT_LOCAL" }, + { TELEPORT_PENDING, "TELEPORT_PENDING" } }; + +const std::string& LLAgent::teleportStateName(S32 state) +{ + static std::string invalid_state_str("INVALID"); + auto iter = LLAgent::sTeleportStateName.find(state); + if (iter != LLAgent::sTeleportStateName.end()) + { + return iter->second; + } + else + { + return invalid_state_str; + } +} + +const std::string& LLAgent::getTeleportStateName() const +{ + return teleportStateName(getTeleportState()); +} + void LLAgent::parseTeleportMessages(const std::string& xml_filename) { LLXMLNodePtr root; @@ -5645,40 +5747,70 @@ void LLTeleportRequest::restartTeleport() llassert(0); } +// TODO this enum -> name idiom should be in a common class rather than repeated various places. +const std::string& LLTeleportRequest::statusName(EStatus status) +{ + static std::string invalid_status_str("INVALID"); + auto iter = LLTeleportRequest::sTeleportStatusName.find(status); + if (iter != LLTeleportRequest::sTeleportStatusName.end()) + { + return iter->second; + } + else + { + return invalid_status_str; + } +} + +std::ostream& operator<<(std::ostream& os, const LLTeleportRequest& req) +{ + req.toOstream(os); + return os; +} + +void LLTeleportRequest::toOstream(std::ostream& os) const +{ + os << "status " << statusName(mStatus) << "(" << mStatus << ")"; +} + //----------------------------------------------------------------------------- // LLTeleportRequestViaLandmark //----------------------------------------------------------------------------- - LLTeleportRequestViaLandmark::LLTeleportRequestViaLandmark(const LLUUID &pLandmarkId) : LLTeleportRequest(), mLandmarkId(pLandmarkId) { - LL_INFOS("Teleport") << "LLTeleportRequestViaLandmark created." << LL_ENDL; + LL_INFOS("Teleport") << "LLTeleportRequestViaLandmark created, " << *this << LL_ENDL; } LLTeleportRequestViaLandmark::~LLTeleportRequestViaLandmark() { - LL_INFOS("Teleport") << "~LLTeleportRequestViaLandmark" << LL_ENDL; + LL_INFOS("Teleport") << "~LLTeleportRequestViaLandmark, " << *this << LL_ENDL; +} + +void LLTeleportRequestViaLandmark::toOstream(std::ostream& os) const +{ + os << "landmark " << mLandmarkId << " "; + LLTeleportRequest::toOstream(os); } bool LLTeleportRequestViaLandmark::canRestartTeleport() { - LL_INFOS("Teleport") << "LLTeleportRequestViaLandmark::canRestartTeleport? -> true" << LL_ENDL; + LL_INFOS("Teleport") << "LLTeleportRequestViaLandmark::canRestartTeleport? -> true, " << *this << LL_ENDL; return true; } void LLTeleportRequestViaLandmark::startTeleport() { - LL_INFOS("Teleport") << "LLTeleportRequestViaLandmark::startTeleport" << LL_ENDL; + LL_INFOS("Teleport") << "LLTeleportRequestViaLandmark::startTeleport, " << *this << LL_ENDL; gAgent.doTeleportViaLandmark(getLandmarkId()); } void LLTeleportRequestViaLandmark::restartTeleport() { - LL_INFOS("Teleport") << "LLTeleportRequestViaLandmark::restartTeleport" << LL_ENDL; + LL_INFOS("Teleport") << "LLTeleportRequestViaLandmark::restartTeleport, " << *this << LL_ENDL; gAgent.doTeleportViaLandmark(getLandmarkId()); } - //----------------------------------------------------------------------------- // LLTeleportRequestViaLure //----------------------------------------------------------------------------- @@ -5695,6 +5827,12 @@ LLTeleportRequestViaLure::~LLTeleportRequestViaLure() LL_INFOS("Teleport") << "~LLTeleportRequestViaLure" << LL_ENDL; } +void LLTeleportRequestViaLure::toOstream(std::ostream& os) const +{ + os << "mIsLureGodLike " << (S32) mIsLureGodLike << " "; + LLTeleportRequestViaLandmark::toOstream(os); +} + bool LLTeleportRequestViaLure::canRestartTeleport() { // stinson 05/17/2012 : cannot restart a teleport via lure because of server-side restrictions @@ -5733,6 +5871,12 @@ LLTeleportRequestViaLocation::~LLTeleportRequestViaLocation() { } +void LLTeleportRequestViaLocation::toOstream(std::ostream& os) const +{ + os << "mPosGlobal " << mPosGlobal << " "; + LLTeleportRequest::toOstream(os); +} + bool LLTeleportRequestViaLocation::canRestartTeleport() { LL_INFOS("Teleport") << "LLTeleportRequestViaLocation::canRestartTeleport -> true" << LL_ENDL; @@ -5772,6 +5916,11 @@ LLTeleportRequestViaLocationLookAt::~LLTeleportRequestViaLocationLookAt() { } +void LLTeleportRequestViaLocationLookAt::toOstream(std::ostream& os) const +{ + LLTeleportRequestViaLocation::toOstream(os); +} + bool LLTeleportRequestViaLocationLookAt::canRestartTeleport() { LL_INFOS("Teleport") << "LLTeleportRequestViaLocationLookAt::canRestartTeleport -> true" << LL_ENDL; diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index 897b2e1661..78ac900284 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -50,20 +50,15 @@ extern const BOOL ANIMATE; extern const U8 AGENT_STATE_TYPING; // Typing indication extern const U8 AGENT_STATE_EDITING; // Set when agent has objects selected -class LLChat; class LLViewerRegion; class LLMotion; -class LLToolset; class LLMessageSystem; class LLPermissions; class LLHost; class LLFriendObserver; -class LLPickInfo; -class LLViewerObject; class LLAgentDropGroupViewerNode; class LLAgentAccess; class LLSLURL; -class LLPauseRequestHandle; class LLUIColor; class LLTeleportRequest; @@ -94,8 +89,6 @@ struct LLGroupData class LLAgentListener; -class LLAgentImpl; - //------------------------------------------------------------------------ // LLAgent //------------------------------------------------------------------------ @@ -709,6 +702,10 @@ public: TELEPORT_PENDING = 7 }; + static std::map sTeleportStateName; + static const std::string& teleportStateName(S32); + const std::string& getTeleportStateName() const; + public: static void parseTeleportMessages(const std::string& xml_filename); const void getTeleportSourceSLURL(LLSLURL& slurl) const; diff --git a/indra/newview/llagentui.cpp b/indra/newview/llagentui.cpp index a27ae92ba4..4ad701f45c 100644 --- a/indra/newview/llagentui.cpp +++ b/indra/newview/llagentui.cpp @@ -44,6 +44,10 @@ // FIRE-1874: Show server channel in statusbar #include "llappviewer.h" +// FIRE-10549 etc, incorrect grid URL on HG back links +#include "fsgridhandler.h" +#include "lfsimfeaturehandler.h" +// //static void LLAgentUI::buildFullname(std::string& name) @@ -55,15 +59,21 @@ void LLAgentUI::buildFullname(std::string& name) //static void LLAgentUI::buildSLURL(LLSLURL& slurl, const bool escaped /*= true*/) { - LLSLURL return_slurl; - LLViewerRegion *regionp = gAgent.getRegion(); - if (regionp) - { + LLSLURL return_slurl; + LLViewerRegion *regionp = gAgent.getRegion(); + if (regionp) + { // Aurora-sim var region teleports - //return_slurl = LLSLURL(regionp->getName(), gAgent.getPositionGlobal()); - return_slurl = LLSLURL(regionp->getName(), gAgent.getPositionAgent()); +#ifdef OPENSIM + if (LLGridManager::instance().isInOpenSim()) + { + return_slurl = LLSLURL(LFSimFeatureHandler::getInstance()->gridURL(), regionp->getName(), gAgent.getPositionAgent()); + } + else +#endif // - } + return_slurl = LLSLURL(regionp->getName(), gAgent.getPositionGlobal()); + } slurl = return_slurl; } diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index c981e25016..21b63f069a 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -987,13 +987,6 @@ void LLAgentWearables::addWearableToAgentInventory(LLPointer AISAPI::sPostponedQuery; + +const S32 MAX_SIMULTANEOUS_COROUTINES = 2048; + //------------------------------------------------------------------------- /*static*/ bool AISAPI::isAvailable() @@ -371,9 +375,51 @@ void AISAPI::UpdateItem(const LLUUID &itemId, const LLSD &updates, completion_t /*static*/ void AISAPI::EnqueueAISCommand(const std::string &procName, LLCoprocedureManager::CoProcedure_t proc) { + LLCoprocedureManager &inst = LLCoprocedureManager::instance(); + S32 pending_in_pool = inst.countPending("AIS"); std::string procFullName = "AIS(" + procName + ")"; - LLCoprocedureManager::instance().enqueueCoprocedure("AIS", procFullName, proc); + if (pending_in_pool < MAX_SIMULTANEOUS_COROUTINES) + { + inst.enqueueCoprocedure("AIS", procFullName, proc); + } + else + { + // As I understand it, coroutines have built-in 'pending' pool + // but unfortunately it has limited size which inventory often goes over + // so this is a workaround to not overfill it. + if (sPostponedQuery.empty()) + { + sPostponedQuery.push_back(ais_query_item_t(procFullName, proc)); + gIdleCallbacks.addFunction(onIdle, NULL); + } + else + { + sPostponedQuery.push_back(ais_query_item_t(procFullName, proc)); + } + } +} +/*static*/ +void AISAPI::onIdle(void *userdata) +{ + if (!sPostponedQuery.empty()) + { + LLCoprocedureManager &inst = LLCoprocedureManager::instance(); + S32 pending_in_pool = inst.countPending("AIS"); + while (pending_in_pool < MAX_SIMULTANEOUS_COROUTINES && !sPostponedQuery.empty()) + { + ais_query_item_t &item = sPostponedQuery.front(); + inst.enqueueCoprocedure("AIS", item.first, item.second); + sPostponedQuery.pop_front(); + pending_in_pool++; + } + } + + if (sPostponedQuery.empty()) + { + // Nothing to do anymore + gIdleCallbacks.deleteFunction(onIdle, NULL); + } } /*static*/ diff --git a/indra/newview/llaisapi.h b/indra/newview/llaisapi.h index 200af0c67f..fbacf418c0 100644 --- a/indra/newview/llaisapi.h +++ b/indra/newview/llaisapi.h @@ -31,7 +31,6 @@ #include #include #include -#include "llhttpretrypolicy.h" #include "llviewerinventory.h" #include "llcorehttputil.h" #include "llcoproceduremanager.h" @@ -72,6 +71,7 @@ private: const std::string, LLSD, LLCore::HttpOptions::ptr_t, LLCore::HttpHeaders::ptr_t) > invokationFn_t; static void EnqueueAISCommand(const std::string &procName, LLCoprocedureManager::CoProcedure_t proc); + static void onIdle(void *userdata); // launches postponed AIS commands static std::string getInvCap(); static std::string getLibCap(); @@ -80,6 +80,8 @@ private: invokationFn_t invoke, std::string url, LLUUID targetId, LLSD body, completion_t callback, COMMAND_TYPE type); + typedef std::pair ais_query_item_t; + static std::list sPostponedQuery; }; class AISUpdate diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index bdfedef350..e4272b2bed 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -3669,6 +3669,50 @@ void update_base_outfit_after_ordering() bool copy_folder_links = false; app_mgr.slamCategoryLinks(app_mgr.getCOF(), base_outfit_id, copy_folder_links, dirty_state_updater); + if (base_outfit_id.notNull()) + { + LLIsValidItemLink collector; + + LLInventoryModel::cat_array_t cof_cats; + LLInventoryModel::item_array_t cof_item_array; + gInventory.collectDescendentsIf(app_mgr.getCOF(), cof_cats, cof_item_array, + LLInventoryModel::EXCLUDE_TRASH, collector); + + for (U32 i = 0; i < outfit_item_array.size(); ++i) + { + LLViewerInventoryItem* linked_item = outfit_item_array.at(i)->getLinkedItem(); + if (linked_item != NULL && linked_item->getActualType() == LLAssetType::AT_TEXTURE) + { + outfit_item_array.erase(outfit_item_array.begin() + i); + break; + } + } + + if (outfit_item_array.size() != cof_item_array.size()) + { + return; + } + + std::sort(cof_item_array.begin(), cof_item_array.end(), sort_by_linked_uuid); + std::sort(outfit_item_array.begin(), outfit_item_array.end(), sort_by_linked_uuid); + + for (U32 i = 0; i < cof_item_array.size(); ++i) + { + LLViewerInventoryItem *cof_it = cof_item_array.at(i); + LLViewerInventoryItem *base_it = outfit_item_array.at(i); + + if (cof_it->getActualDescription() != base_it->getActualDescription()) + { + if (cof_it->getLinkedUUID() == base_it->getLinkedUUID()) + { + base_it->setDescription(cof_it->getActualDescription()); + gInventory.updateItem(base_it); + } + } + } + LLAppearanceMgr::getInstance()->updateIsDirty(); + } + } // Save COF changes - update the contents of the current base outfit diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index e2af86feb4..68d8e0cc83 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -597,7 +597,8 @@ bool create_text_segment_icon_from_url_match(LLUrlMatch* match,LLTextBase* base) LLIconCtrl* icon; - if(gAgent.isInGroup(match_id, TRUE)) + if( match->getMenuName() == "menu_url_group.xml" // See LLUrlEntryGroup constructor + || gAgent.isInGroup(match_id, TRUE)) //This check seems unfiting, urls are either /agent or /group { LLGroupIconCtrl::Params icon_params; icon_params.group_id = match_id; @@ -679,8 +680,9 @@ static void settings_to_globals() static void settings_modify() { LLRenderTarget::sUseFBO = gSavedSettings.getBOOL("RenderDeferred"); + LLPipeline::sRenderTransparentWater = gSavedSettings.getBOOL("RenderTransparentWater"); LLPipeline::sRenderBump = gSavedSettings.getBOOL("RenderObjectBump"); - LLPipeline::sRenderDeferred = LLPipeline::sRenderBump && gSavedSettings.getBOOL("RenderDeferred"); + LLPipeline::sRenderDeferred = LLPipeline::sRenderTransparentWater && LLPipeline::sRenderBump && gSavedSettings.getBOOL("RenderDeferred"); LLVOSurfacePatch::sLODFactor = gSavedSettings.getF32("RenderTerrainLODFactor"); LLVOSurfacePatch::sLODFactor *= LLVOSurfacePatch::sLODFactor; //square lod factor to get exponential range of [1,4] gDebugGL = gSavedSettings.getBOOL("RenderDebugGL") || gDebugSession; @@ -1052,7 +1054,7 @@ bool LLAppViewer::init() LLWearableType::initParamSingleton(new LLUITranslationBridge()); LLTranslationBridge::ptr_t trans = std::make_shared(); - LLSettingsType::initClass(trans); + LLSettingsType::initParamSingleton(trans); // // Setup notifications after LLUI::initClass() has been called. @@ -1230,13 +1232,27 @@ bool LLAppViewer::init() { // can't use an alert here since we're exiting and // all hell breaks lose. + LLUIString details = LLNotifications::instance().getGlobalString("UnsupportedGLRequirements"); OSMessageBox( - LLNotifications::instance().getGlobalString("UnsupportedGLRequirements"), + details.getString(), LLStringUtil::null, OSMB_OK); return 0; } + // If we don't have the right shader requirements. + if (!gGLManager.mHasShaderObjects + || !gGLManager.mHasVertexShader + || !gGLManager.mHasFragmentShader) + { + LLUIString details = LLNotifications::instance().getGlobalString("UnsupportedShaderRequirements"); + OSMessageBox( + details.getString(), + LLStringUtil::null, + OSMB_OK); + return 0; + } + // Without SSE2 support we will crash almost immediately, warn here. if (!gSysCPU.hasSSE2()) { @@ -1503,6 +1519,7 @@ void LLAppViewer::initMaxHeapSize() BOOL enable_mem_failure_prevention = (BOOL)gSavedSettings.getBOOL("MemoryFailurePreventionEnabled") ; // Enable low memory checks on 32bit builds #if ADDRESS_SIZE == 64 + max_heap_size_gb = F32Gigabytes(128); enable_mem_failure_prevention = FALSE; #endif // @@ -1779,8 +1796,10 @@ bool LLAppViewer::doFrame() } // yield cooperatively when not running as foreground window - if ( (gViewerWindow && !gViewerWindow->getWindow()->getVisible()) - || !gFocusMgr.getAppHasFocus()) + // and when not quiting (causes trouble at mac's cleanup stage) + if (!LLApp::isExiting() + && ((gViewerWindow && !gViewerWindow->getWindow()->getVisible()) + || !gFocusMgr.getAppHasFocus())) { // Sleep if we're not rendering, or the window is minimized. static LLCachedControl s_bacground_yeild_time(gSavedSettings, "BackgroundYieldTime", 40); @@ -2489,8 +2508,6 @@ bool LLAppViewer::cleanup() LLError::LLCallStacks::cleanup(); - removeMarkerFiles(); - // It's not at first obvious where, in this long sequence, a generic cleanup // call OUGHT to go. So let's say this: as we migrate cleanup from // explicit hand-placed calls into the generic mechanism, eventually @@ -2498,14 +2515,12 @@ bool LLAppViewer::cleanup() // still see above are calls that MUST happen before the generic cleanup // kicks in. - // The logging subsystem depends on an LLSingleton. Any logging after - // LLSingletonBase::deleteAll() won't be recorded. - LL_INFOS() << "Goodbye!" << LL_ENDL; - // This calls every remaining LLSingleton's cleanupSingleton() and // deleteSingleton() methods. LLSingletonBase::deleteAll(); + LL_INFOS() << "Goodbye!" << LL_ENDL; + removeDumpDir(); // return 0; @@ -3434,7 +3449,7 @@ void LLAppViewer::initStrings() { // initial check to make sure files are there failed gDirUtilp->dumpCurrentDirectories(LLError::LEVEL_WARN); - LL_ERRS() << "Viewer failed to find localization and UI files. Please reinstall viewer from https://secondlife.com/support/downloads/ and contact https://support.secondlife.com if issue persists after reinstall." << LL_ENDL; + LL_ERRS() << "Viewer failed to find localization and UI files. Please reinstall viewer from https://www.firestormviewer.org/downloads and contact https://www.firestormviewer.org/support if issue persists after reinstall." << LL_ENDL; } LLTransUtil::parseStrings(strings_file, default_trans_args); LLTransUtil::parseLanguageStrings("language_settings.xml"); @@ -3670,6 +3685,13 @@ LLSD LLAppViewer::getViewerInfo() const //{ // info["BUILD_CONFIG"] = build_config; //} +#ifdef USE_AVX2_OPTIMIZATION + info["SIMD"] = "AVX2"; +#elif USE_AVX_OPTIMIZATION + info["SIMD"] = "AVX"; +#else + info["SIMD"] = "SSE2"; +#endif // FIRE-8273: Add Open-sim indicator to About floater #if defined OPENSIM @@ -3778,9 +3800,12 @@ LLSD LLAppViewer::getViewerInfo() const info["OS_VERSION"] = LLOSInfo::instance().getOSString(); info["GRAPHICS_CARD_VENDOR"] = ll_safe_string((const char*)(glGetString(GL_VENDOR))); info["GRAPHICS_CARD"] = ll_safe_string((const char*)(glGetString(GL_RENDERER))); + info["GRAPHICS_CARD_MEMORY"] = gGLManager.mVRAM; #if LL_WINDOWS - std::string drvinfo = gDXHardware.getDriverVersionWMI(); + // FIRE-8264: System info displays wrong driver version on Optimus systems + //std::string drvinfo = gDXHardware.getDriverVersionWMI(); + std::string drvinfo = gDXHardware.getDriverVersionWMI(gGLManager.mGLVendorShort); if (!drvinfo.empty()) { info["GRAPHICS_DRIVER_VERSION"] = drvinfo; @@ -3965,8 +3990,12 @@ LLSD LLAppViewer::getViewerInfo() const // // FIRE-11768: Include texture memory settings + info["TEXTUREMEMORYDYNAMIC"] = LLViewerTextureList::canUseDynamicTextureMemory() && gSavedSettings.getBOOL("FSDynamicTextureMemory"); info["TEXTUREMEMORY"] = gSavedSettings.getS32("TextureMemory"); info["TEXTUREMEMORYMULTIPLIER"] = gSavedSettings.getF32("RenderTextureMemoryMultiple"); + info["TEXTUREMEMORYMIN"] = gSavedSettings.getS32("FSDynamicTextureMemoryMinTextureMemory"); + info["TEXTUREMEMORYCACHERESERVE"] = gSavedSettings.getS32("FSDynamicTextureMemoryCacheReserve"); + info["TEXTUREMEMORYGPURESERVE"] = gSavedSettings.getS32("FSDynamicTextureMemoryGPUReserve"); // // Add creation time of VFS (cache) @@ -4047,6 +4076,21 @@ std::string LLAppViewer::getViewerInfoString(bool default_string) const { support << "\n" << LLTrans::getString("AboutSettings", args, default_string); } + if (info.has("TEXTUREMEMORYDYNAMIC")) + { + if (info["TEXTUREMEMORYDYNAMIC"].asBoolean()) + { + support << "\n" << LLTrans::getString("AboutTextureMemoryDynamic", args, default_string); + } + else + { + support << "\n" << LLTrans::getString("AboutTextureMemory", args, default_string); + } + } + if (info.has("VFS_DATE")) + { + support << "\n" << LLTrans::getString("AboutVFS", args, default_string); + } // if (info.has("COMPILER")) { @@ -6239,7 +6283,10 @@ void LLAppViewer::disconnectViewer() } // - if (LLSelectMgr::getInstance()) + // Wrong instance check + //if (LLSelectMgr::getInstance()) + if (LLSelectMgr::instanceExists()) + // deselectAll(); } diff --git a/indra/newview/llattachmentsmgr.cpp b/indra/newview/llattachmentsmgr.cpp index d929467065..e19c870fbf 100644 --- a/indra/newview/llattachmentsmgr.cpp +++ b/indra/newview/llattachmentsmgr.cpp @@ -195,7 +195,10 @@ void LLAttachmentsMgr::requestAttachments(attachments_vec_t& attachment_requests // For unknown reasons, requesting many attachments at once causes // frequent server-side failures. Here we're limiting the number // of attachments requested per idle loop. - const S32 max_objects_per_request = 5; + // FIRE-6070: Batching attachment requests is most-likely causing issues + // when replacing already worn attachments + //const S32 max_objects_per_request = 5; + const S32 max_objects_per_request = 1; S32 obj_count = llmin((S32)attachment_requests.size(),max_objects_per_request); if (obj_count == 0) { diff --git a/indra/newview/llattachmentsmgr.h b/indra/newview/llattachmentsmgr.h index d9ffdca7ba..7455b06070 100644 --- a/indra/newview/llattachmentsmgr.h +++ b/indra/newview/llattachmentsmgr.h @@ -30,8 +30,6 @@ #include "llsingleton.h" -class LLViewerInventoryItem; - //-------------------------------------------------------------------------------- // LLAttachmentsMgr // diff --git a/indra/newview/llavatariconctrl.h b/indra/newview/llavatariconctrl.h index 7c0e570d89..b616b0798b 100644 --- a/indra/newview/llavatariconctrl.h +++ b/indra/newview/llavatariconctrl.h @@ -31,7 +31,7 @@ #include "lliconctrl.h" #include "llavatarpropertiesprocessor.h" -#include "llviewermenu.h" +#include "llviewernetwork.h" class LLAvatarName; @@ -63,9 +63,17 @@ protected: }; inline +// FIRE-10607: Avatar icon controls show wrong picture when switching between SL main/beta grid +//LLAvatarIconIDCache::LLAvatarIconIDCache() +// : mFilename("avatar_icons_cache.txt") +//{} LLAvatarIconIDCache::LLAvatarIconIDCache() - : mFilename("avatar_icons_cache.txt") -{} +{ + const std::string grid_id_str = LLDir::getScrubbedFileName(LLGridManager::getInstance()->getGridId()); + const std::string& grid_id_lower = utf8str_tolower(grid_id_str); + mFilename = "avatar_icons_cache." + grid_id_lower + ".txt"; +} +// namespace LLAvatarIconCtrlEnums { diff --git a/indra/newview/llavatarlistitem.h b/indra/newview/llavatarlistitem.h index 3b4b6f50f7..41498dbc02 100644 --- a/indra/newview/llavatarlistitem.h +++ b/indra/newview/llavatarlistitem.h @@ -30,7 +30,6 @@ #include #include "llpanel.h" -#include "lloutputmonitorctrl.h" #include "llbutton.h" #include "lltextbox.h" #include "llstyle.h" @@ -38,6 +37,7 @@ #include "llcallingcard.h" // for LLFriendObserver class LLAvatarIconCtrl; +class LLOutputMonitorCtrl; class LLAvatarName; class LLIconCtrl; class LLUICtrl; diff --git a/indra/newview/llchatbar.cpp b/indra/newview/llchatbar.cpp index 88ee5ccc47..5a596bb29b 100644 --- a/indra/newview/llchatbar.cpp +++ b/indra/newview/llchatbar.cpp @@ -58,7 +58,6 @@ #include "llinventorymodel.h" #include "llmultigesture.h" #include "llui.h" -#include "llviewermenu.h" #include "lluictrlfactory.h" // diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index bc6d8c28a6..ad59fcc4d2 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -66,6 +66,7 @@ #include "llstring.h" #include "llurlaction.h" #include "llviewercontrol.h" +#include "llviewermenu.h" #include "llviewerobjectlist.h" // [RLVa:KB] - Checked: 2010-04-22 (RLVa-1.2.0f) #include "rlvactions.h" diff --git a/indra/newview/llchatitemscontainerctrl.cpp b/indra/newview/llchatitemscontainerctrl.cpp index a18e8938ea..2d3fea0451 100644 --- a/indra/newview/llchatitemscontainerctrl.cpp +++ b/indra/newview/llchatitemscontainerctrl.cpp @@ -27,6 +27,7 @@ #include "llviewerprecompiledheaders.h" #include "llchatitemscontainerctrl.h" +#include "llchatmsgbox.h" #include "lltextbox.h" #include "llavataractions.h" diff --git a/indra/newview/llchatitemscontainerctrl.h b/indra/newview/llchatitemscontainerctrl.h index bf977002f3..d50b9f4955 100644 --- a/indra/newview/llchatitemscontainerctrl.h +++ b/indra/newview/llchatitemscontainerctrl.h @@ -28,12 +28,13 @@ #define LL_LLCHATITEMSCONTAINERCTRL_H_ #include "llchat.h" -#include "llchatmsgbox.h" #include "llpanel.h" #include "llscrollbar.h" #include "llviewerchat.h" #include "lltoastpanel.h" +class LLChatMsgBox; + typedef enum e_show_item_header { CHATITEMHEADER_SHOW_ONLY_NAME = 0, diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index 7845651e97..ae54043cba 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -38,6 +38,7 @@ #include "llsingleton.h" #include "llsyswellwindow.h" #include "llfloaternotificationstabbed.h" +#include "llviewermenu.h" // [SL:KB] - Patch: UI-Notifications | Checked: 2013-05-09 (Catznip-3.5) #include "llchannelmanager.h" // [/SL:KB] diff --git a/indra/newview/llchicletbar.cpp b/indra/newview/llchicletbar.cpp index ddf1998c89..1d8952a268 100644 --- a/indra/newview/llchicletbar.cpp +++ b/indra/newview/llchicletbar.cpp @@ -162,8 +162,10 @@ BOOL LLChicletBar::postBuild() } // - LLPanelTopInfoBar::instance().setResizeCallback(boost::bind(&LLChicletBar::fitWithTopInfoBar, this)); - LLPanelTopInfoBar::instance().setVisibleCallback(boost::bind(&LLChicletBar::fitWithTopInfoBar, this)); + // FIRE-7179: Width of chiclet bar seems to change randomly + //LLPanelTopInfoBar::instance().setResizeCallback(boost::bind(&LLChicletBar::fitWithTopInfoBar, this)); + //LLPanelTopInfoBar::instance().setVisibleCallback(boost::bind(&LLChicletBar::fitWithTopInfoBar, this)); + // // Option to hide IM/Group chat chiclets gSavedSettings.getControl("FSDisableIMChiclets")->getSignal()->connect(boost::bind(&LLChicletBar::updateVisibility, this, _2)); diff --git a/indra/newview/llcofwearables.cpp b/indra/newview/llcofwearables.cpp index e7cb584232..39f7f9ebd8 100644 --- a/indra/newview/llcofwearables.cpp +++ b/indra/newview/llcofwearables.cpp @@ -141,10 +141,31 @@ protected: { LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; + registrar.add("Attachment.Touch", boost::bind(handleMultiple, handle_attachment_touch, mUUIDs)); + registrar.add("Attachment.Edit", boost::bind(handleMultiple, handle_item_edit, mUUIDs)); registrar.add("Attachment.Detach", boost::bind(&LLAppearanceMgr::removeItemsFromAvatar, LLAppearanceMgr::getInstance(), mUUIDs)); + LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar; + enable_registrar.add("Attachment.OnEnable", boost::bind(&CofAttachmentContextMenu::onEnable, this, _2)); + return createFromFile("menu_cof_attachment.xml"); } + + bool onEnable(const LLSD& userdata) + { + const std::string event_name = userdata.asString(); + + if ("touch" == event_name) + { + return (1 == mUUIDs.size()) && (enable_attachment_touch(mUUIDs.front())); + } + else if ("edit" == event_name) + { + return (1 == mUUIDs.size()) && (get_is_item_editable(mUUIDs.front())); + } + + return true; + } }; ////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llcolorswatch.h b/indra/newview/llcolorswatch.h index 380fdccfa3..a17cab486a 100644 --- a/indra/newview/llcolorswatch.h +++ b/indra/newview/llcolorswatch.h @@ -36,7 +36,6 @@ // Classes // class LLColor4; -class LLFloaterColorPicker; class LLColorSwatchCtrl : public LLUICtrl diff --git a/indra/newview/llcommandlineparser.cpp b/indra/newview/llcommandlineparser.cpp index fe14bc081f..06d959ba3c 100644 --- a/indra/newview/llcommandlineparser.cpp +++ b/indra/newview/llcommandlineparser.cpp @@ -402,23 +402,30 @@ bool LLCommandLineParser::parseCommandLineString(const std::string& str) } } - // Split the string content into tokens - const char* escape_chars = "\\"; - const char* separator_chars = "\r\n "; - const char* quote_chars = "\"'"; - boost::escaped_list_separator sep(escape_chars, separator_chars, quote_chars); - boost::tokenizer< boost::escaped_list_separator > tok(cmd_line_string, sep); std::vector tokens; - // std::copy(tok.begin(), tok.end(), std::back_inserter(tokens)); - for(boost::tokenizer< boost::escaped_list_separator >::iterator i = tok.begin(); - i != tok.end(); - ++i) + try { - if(0 != i->size()) + // Split the string content into tokens + const char* escape_chars = "\\"; + const char* separator_chars = "\r\n "; + const char* quote_chars = "\"'"; + boost::escaped_list_separator sep(escape_chars, separator_chars, quote_chars); + boost::tokenizer< boost::escaped_list_separator > tok(cmd_line_string, sep); + // std::copy(tok.begin(), tok.end(), std::back_inserter(tokens)); + for (boost::tokenizer< boost::escaped_list_separator >::iterator i = tok.begin(); + i != tok.end(); + ++i) { - tokens.push_back(*i); + if (0 != i->size()) + { + tokens.push_back(*i); + } } } + catch (...) + { + CRASH_ON_UNHANDLED_EXCEPTION(STRINGIZE("Unexpected crash while parsing: " << str)); + } po::command_line_parser clp(tokens); return parseAndStoreResults(clp); diff --git a/indra/newview/llcompilequeue.h b/indra/newview/llcompilequeue.h index f54c7f9ac3..fbee3d9fb6 100644 --- a/indra/newview/llcompilequeue.h +++ b/indra/newview/llcompilequeue.h @@ -29,14 +29,11 @@ #include "llinventory.h" #include "llviewerobject.h" -#include "llvoinventorylistener.h" #include "lluuid.h" #include "llfloater.h" #include "llscrolllistctrl.h" -#include "llviewerinventory.h" - #include "llevents.h" // [LSL PreProc] diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp index 80166f1a10..d176c9647c 100644 --- a/indra/newview/llconversationmodel.cpp +++ b/indra/newview/llconversationmodel.cpp @@ -94,6 +94,23 @@ LLConversationItem::~LLConversationItem() } } +//virtual +void LLConversationItem::addChild(LLFolderViewModelItem* child) +{ + // Avoid duplicates: bail out if that child is already present in the list + // Note: this happens when models are created and 'parented' before views + // This is performance unfriendly, but conversation can addToFolder multiple times + child_list_t::const_iterator iter; + for (iter = mChildren.begin(); iter != mChildren.end(); iter++) + { + if (child == *iter) + { + return; + } + } + LLFolderViewModelItemCommon::addChild(child); +} + void LLConversationItem::postEvent(const std::string& event_type, LLConversationItemSession* session, LLConversationItemParticipant* participant) { LLUUID session_id = (session ? session->getUUID() : LLUUID()); diff --git a/indra/newview/llconversationmodel.h b/indra/newview/llconversationmodel.h index fbdffc4997..68bc6d65f4 100644 --- a/indra/newview/llconversationmodel.h +++ b/indra/newview/llconversationmodel.h @@ -99,6 +99,7 @@ public: virtual void buildContextMenu(LLMenuGL& menu, U32 flags) { } virtual BOOL isUpToDate() const { return TRUE; } virtual bool hasChildren() const { return FALSE; } + virtual void addChild(LLFolderViewModelItem* child); virtual bool potentiallyVisible() { return true; } virtual bool filter( LLFolderViewFilter& filter) { return false; } diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp index 805646a2aa..0cf9ea6dfd 100644 --- a/indra/newview/llconversationview.cpp +++ b/indra/newview/llconversationview.cpp @@ -432,7 +432,7 @@ void LLConversationViewSession::refresh() // Refresh the session view from its model data LLConversationItem* vmi = dynamic_cast(getViewModelItem()); vmi->resetRefresh(); - + if (mSessionTitle) { mSessionTitle->setText(vmi->getDisplayName()); @@ -547,7 +547,9 @@ BOOL LLConversationViewParticipant::postBuild() } updateChildren(); - return LLFolderViewItem::postBuild(); + LLFolderViewItem::postBuild(); + refresh(); + return TRUE; } void LLConversationViewParticipant::draw() @@ -621,7 +623,7 @@ void LLConversationViewParticipant::refresh() // *TODO: We should also do something with vmi->isModerator() to echo that state in the UI somewhat mSpeakingIndicator->setIsModeratorMuted(participant_model->isModeratorMuted()); - + // Do the regular upstream refresh LLFolderViewItem::refresh(); } diff --git a/indra/newview/llconversationview.h b/indra/newview/llconversationview.h index fb14d32a71..70e0a2d8e0 100644 --- a/indra/newview/llconversationview.h +++ b/indra/newview/llconversationview.h @@ -36,6 +36,7 @@ #include "lloutputmonitorctrl.h" class LLTextBox; +class LLFloater; class LLFloaterIMContainer; class LLConversationViewSession; class LLConversationViewParticipant; diff --git a/indra/newview/lldebugview.cpp b/indra/newview/lldebugview.cpp index dfa1049d21..1d70ecf76e 100644 --- a/indra/newview/lldebugview.cpp +++ b/indra/newview/lldebugview.cpp @@ -110,7 +110,7 @@ void LLDebugView::init() // Fix texture console width //r.set(150, rect.getHeight() - 50, 820, 100); - r.set(150, rect.getHeight() - 50, 900, 100); + r.set(150, rect.getHeight() - 50, 930, 100); // LLTextureView::Params tvp; tvp.name("gTextureView"); diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index aed51cfc36..e51817a0c3 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -38,7 +38,6 @@ #include "lldrawable.h" #include "lldrawpoolbump.h" #include "llface.h" -#include "llvolume.h" #include "llmeshrepository.h" #include "llsky.h" #include "llviewercamera.h" @@ -1501,7 +1500,7 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) // Add avatar hitbox debug static LLCachedControl render_hitbox(gSavedSettings, "DebugRenderHitboxes", false); - if (render_hitbox && pass == 1) + if (render_hitbox && pass == 2) { LLGLSLShader* current_shader_program = NULL; @@ -1516,25 +1515,15 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) LLGLEnable blend(GL_BLEND); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - // save current world matrix - gGL.matrixMode(LLRender::MM_MODELVIEW); - gGL.pushMatrix(); - LLColor4 avatar_color = LLNetMap::getAvatarColor(avatarp->getID()); gGL.diffuseColor4f(avatar_color.mV[VRED], avatar_color.mV[VGREEN], avatar_color.mV[VBLUE], avatar_color.mV[VALPHA]); - glLineWidth(2.0f); + gGL.setLineWidth(2.0f); LLQuaternion rot = avatarp->getRotationRegion(); LLVector3 pos = avatarp->getPositionAgent(); LLVector3 size = avatarp->getScale(); - - // *NOTE: Tried this so I wouldn't have to duplcate code, but I didn't find a way to rotate - // the matrix by "rot" so the drawBoxOutline function would do the right thing. So - // I settled for copying the code and rotating the 4 corner points individually. -Zi - // gGL.translatef(pos.mV[VX],pos.mV[VY],pos.mV[VZ]); - // gGL.rotatef(rot.mQ[VS]*RAD_TO_DEG,rot.mQ[VX],rot.mQ[VY],rot.mQ[VZ]); - // drawBoxOutline(LLVector3::zero,size/2.0); - // // drawBoxOutline partly copied from llspatialpartition.cpp below + + // drawBoxOutline partly copied from llspatialpartition.cpp below // set up and rotate hitbox to avatar orientation, half the avatar scale in either direction LLVector3 v1 = size.scaledVec(LLVector3( 0.5f, 0.5f, 0.5f)) * rot; @@ -1581,9 +1570,6 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) gGL.end(); - // restore world matrix - gGL.popMatrix(); - // unload debug shader if (LLGLSLShader::sNoFixedFunction) { @@ -2275,6 +2261,14 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) continue; } + // Niran's optimization + const LLTextureEntry* tex_entry = face->getTextureEntry(); + if (tex_entry && tex_entry->getAlpha() == 0.f) + { + continue; + } + // + //stop_glerror(); //const LLVolumeFace& vol_face = volume->getVolumeFace(te); @@ -2286,7 +2280,8 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) LLVertexBuffer* buff = face->getVertexBuffer(); - const LLTextureEntry* tex_entry = face->getTextureEntry(); + // Niran's optimization + //const LLTextureEntry* tex_entry = face->getTextureEntry(); LLMaterial* mat = tex_entry ? tex_entry->getMaterialParams().get() : nullptr; if (LLDrawPoolAvatar::sShadowPass >= 0) diff --git a/indra/newview/lldrawpoolwater.cpp b/indra/newview/lldrawpoolwater.cpp index f2bb2198d0..5a9cc27f98 100644 --- a/indra/newview/lldrawpoolwater.cpp +++ b/indra/newview/lldrawpoolwater.cpp @@ -62,9 +62,6 @@ F32 LLDrawPoolWater::sWaterFogEnd = 0.f; LLDrawPoolWater::LLDrawPoolWater() : LLFacePool(POOL_WATER) { // Render speedup for water parameters - gSavedSettings.getControl("RenderTransparentWater")->getCommitSignal()->connect(boost::bind(&LLDrawPoolWater::onRenderTransparentWaterChanged, this)); - onRenderTransparentWaterChanged(); - gSavedSettings.getControl("RenderWaterMipNormal")->getCommitSignal()->connect(boost::bind(&LLDrawPoolWater::onRenderWaterMipNormalChanged, this)); onRenderWaterMipNormalChanged(); // @@ -170,10 +167,7 @@ void LLDrawPoolWater::render(S32 pass) std::sort(mDrawFace.begin(), mDrawFace.end(), LLFace::CompareDistanceGreater()); // See if we are rendering water as opaque or not - // Render speedup for water parameters - // if (!gSavedSettings.getBOOL("RenderTransparentWater")) - if (!mRenderTransparentWater) - // + if (!LLPipeline::sRenderTransparentWater) { // render water for low end hardware renderOpaqueLegacyWater(); @@ -832,13 +826,8 @@ LLColor3 LLDrawPoolWater::getDebugColor() const } // Render speedup for water parameters -void LLDrawPoolWater::onRenderTransparentWaterChanged() -{ - mRenderTransparentWater = gSavedSettings.getBOOL("RenderTransparentWater"); -} - void LLDrawPoolWater::onRenderWaterMipNormalChanged() { - mRenderWaterMipNormal = gSavedSettings.getBOOL("RenderWaterMipNormal"); + mRenderWaterMipNormal = (bool)gSavedSettings.getBOOL("RenderWaterMipNormal"); } // diff --git a/indra/newview/lldrawpoolwater.h b/indra/newview/lldrawpoolwater.h index 7948d4d1d2..301244c9a4 100644 --- a/indra/newview/lldrawpoolwater.h +++ b/indra/newview/lldrawpoolwater.h @@ -89,11 +89,9 @@ protected: void renderOpaqueLegacyWater(); // Render speedup for water parameters - void onRenderTransparentWaterChanged(); void onRenderWaterMipNormalChanged(); - BOOL mRenderTransparentWater; - BOOL mRenderWaterMipNormal; + bool mRenderWaterMipNormal; // }; diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp index 753fe9ff8c..f472c29a42 100644 --- a/indra/newview/llenvironment.cpp +++ b/indra/newview/llenvironment.cpp @@ -813,6 +813,25 @@ const F32 LLEnvironment::SUN_DELTA_YAW(F_PI); // 180deg const U32 LLEnvironment::DayInstance::NO_ANIMATE_SKY(0x01); const U32 LLEnvironment::DayInstance::NO_ANIMATE_WATER(0x02); +std::string env_selection_to_string(LLEnvironment::EnvSelection_t sel) +{ +#define RTNENUM(E) case LLEnvironment::E: return #E + switch (sel){ + RTNENUM(ENV_EDIT); + RTNENUM(ENV_LOCAL); + RTNENUM(ENV_PUSH); + RTNENUM(ENV_PARCEL); + RTNENUM(ENV_REGION); + RTNENUM(ENV_DEFAULT); + RTNENUM(ENV_END); + RTNENUM(ENV_CURRENT); + RTNENUM(ENV_NONE); + default: + return llformat("Unknown(%d)", sel); + } +#undef RTNENUM +} + //------------------------------------------------------------------------- LLEnvironment::LLEnvironment(): @@ -1062,7 +1081,7 @@ bool LLEnvironment::canAgentUpdateRegionEnvironment() const if (gAgent.isGodlike()) return true; - return gAgent.getRegion()->canManageEstate(); + return gAgent.canManageEstate(); } bool LLEnvironment::isExtendedEnvironmentEnabled() const @@ -1118,7 +1137,8 @@ F32 LLEnvironment::getCamHeight() const F32 LLEnvironment::getWaterHeight() const { - return gAgent.getRegion()->getWaterHeight(); + LLViewerRegion* cur_region = gAgent.getRegion(); + return cur_region ? cur_region->getWaterHeight() : DEFAULT_WATER_HEIGHT; } bool LLEnvironment::getIsSunUp() const @@ -1147,6 +1167,7 @@ void LLEnvironment::setSelectedEnvironment(LLEnvironment::EnvSelection_t env, LL mSelectedEnvironment = env; updateEnvironment(transition, forced); + LL_DEBUGS("ENVIRONMENT") << "Setting environment " << env_selection_to_string(env) << " with transition: " << transition << LL_ENDL; } bool LLEnvironment::hasEnvironment(LLEnvironment::EnvSelection_t env) @@ -1183,11 +1204,13 @@ LLEnvironment::DayInstance::ptr_t LLEnvironment::getEnvironmentInstance(LLEnviro void LLEnvironment::setEnvironment(LLEnvironment::EnvSelection_t env, const LLSettingsDay::ptr_t &pday, LLSettingsDay::Seconds daylength, LLSettingsDay::Seconds dayoffset, S32 env_version) { if ((env < ENV_EDIT) || (env >= ENV_DEFAULT)) - { - LL_WARNS("ENVIRONMENT") << "Attempt to change invalid environment selection." << LL_ENDL; + { + LL_WARNS("ENVIRONMENT") << "Attempt to change invalid environment selection (" << env_selection_to_string(env) << ")." << LL_ENDL; return; } + logEnvironment(env, pday, env_version); + DayInstance::ptr_t environment = getEnvironmentInstance(env, true); environment->clear(); @@ -1204,7 +1227,7 @@ void LLEnvironment::setEnvironment(LLEnvironment::EnvSelection_t env, LLEnvironm { if ((env < ENV_EDIT) || (env >= ENV_DEFAULT)) { - LL_WARNS("ENVIRONMENT") << "Attempt to change invalid environment selection." << LL_ENDL; + LL_WARNS("ENVIRONMENT") << "Attempt to change invalid environment selection (" << env_selection_to_string(env) << ")." << LL_ENDL; return; } @@ -1213,12 +1236,13 @@ void LLEnvironment::setEnvironment(LLEnvironment::EnvSelection_t env, LLEnvironm if (fixed.first) { + logEnvironment(env, fixed.first, env_version); environment->setSky(fixed.first); environment->setFlags(DayInstance::NO_ANIMATE_SKY); } else if (!environment->getSky()) { - if (mCurrentEnvironment->getEnvironmentSelection() != ENV_NONE) + LL_DEBUGS("ENVIRONMENT") << "Blank sky for " << env_selection_to_string(env) << ". Reusing environment for sky." << LL_ENDL; if (mCurrentEnvironment->getEnvironmentSelection() != ENV_NONE) { // Note: This looks suspicious. Shouldn't we assign whole day if mCurrentEnvironment has whole day? // and then add water/sky on top @@ -1254,12 +1278,13 @@ void LLEnvironment::setEnvironment(LLEnvironment::EnvSelection_t env, LLEnvironm if (fixed.second) { + logEnvironment(env, fixed.second, env_version); environment->setWater(fixed.second); environment->setFlags(DayInstance::NO_ANIMATE_WATER); } else if (!environment->getWater()) { - if (mCurrentEnvironment->getEnvironmentSelection() != ENV_NONE) + LL_DEBUGS("ENVIRONMENT") << "Blank water for " << env_selection_to_string(env) << ". Reusing environment for water." << LL_ENDL; if (mCurrentEnvironment->getEnvironmentSelection() != ENV_NONE) { // Note: This looks suspicious. Shouldn't we assign whole day if mCurrentEnvironment has whole day? // and then add water/sky on top @@ -1295,8 +1320,6 @@ void LLEnvironment::setEnvironment(LLEnvironment::EnvSelection_t env, LLEnvironm if (!mSignalEnvChanged.empty()) mSignalEnvChanged(env, env_version); - - /*TODO: readjust environment*/ } void LLEnvironment::setEnvironment(LLEnvironment::EnvSelection_t env, const LLSettingsBase::ptr_t &settings, S32 env_version) @@ -1390,10 +1413,12 @@ void LLEnvironment::onSetEnvAssetLoaded(EnvSelection_t env, if (!settings || status) { LLSD args; - args["NAME"] = asset_id.asString();// fix the args to match the template. + args["NAME"] = asset_id.asString(); LLNotificationsUtil::add("FailedToFindSettings", args); + LL_DEBUGS("ENVIRONMENT") << "Failed to find settings for " << env_selection_to_string(env) << ", asset_id: " << asset_id << LL_ENDL; return; } + LL_DEBUGS("ENVIRONMENT") << "Loaded asset: " << asset_id << LL_ENDL; setEnvironment(env, settings); updateEnvironment(transition); @@ -1407,19 +1432,48 @@ void LLEnvironment::clearEnvironment(LLEnvironment::EnvSelection_t env) return; } + LL_DEBUGS("ENVIRONMENT") << "Cleaning environment " << env_selection_to_string(env) << LL_ENDL; + mEnvironments[env].reset(); if (!mSignalEnvChanged.empty()) mSignalEnvChanged(env, VERSION_CLEANUP); +} - /*TODO: readjust environment*/ +void LLEnvironment::logEnvironment(EnvSelection_t env, const LLSettingsBase::ptr_t &settings, S32 env_version) +{ + LL_DEBUGS("ENVIRONMENT") << "Setting Day environment " << env_selection_to_string(env) << " with version(update type): " << env_version << LL_NEWLINE; + // code between LL_DEBUGS and LL_ENDL won't execute unless log is enabled + if (settings) + { + LLUUID asset_id = settings->getAssetId(); + if (asset_id.notNull()) + { + LL_CONT << "Asset id: " << asset_id << LL_NEWLINE; + } + + LLUUID id = settings->getId(); // Not in use? + if (id.notNull()) + { + LL_CONT << "Settings id: " << id << LL_NEWLINE; + } + + LL_CONT << "Name: " << settings->getName() << LL_NEWLINE + << "Type: " << settings->getSettingsType() << LL_NEWLINE + << "Flags: " << settings->getFlags(); // Not in use? + } + else + { + LL_CONT << "Empty settings!"; + } + LL_CONT << LL_ENDL; } LLSettingsDay::ptr_t LLEnvironment::getEnvironmentDay(LLEnvironment::EnvSelection_t env) { if ((env < ENV_EDIT) || (env > ENV_DEFAULT)) { - LL_WARNS("ENVIRONMENT") << "Attempt to retrieve invalid environment selection." << LL_ENDL; + LL_WARNS("ENVIRONMENT") << "Attempt to retrieve invalid environment selection (" << env_selection_to_string(env) << ")." << LL_ENDL; return LLSettingsDay::ptr_t(); } @@ -1435,7 +1489,7 @@ LLSettingsDay::Seconds LLEnvironment::getEnvironmentDayLength(EnvSelection_t env { if ((env < ENV_EDIT) || (env > ENV_DEFAULT)) { - LL_WARNS("ENVIRONMENT") << "Attempt to retrieve invalid environment selection." << LL_ENDL; + LL_WARNS("ENVIRONMENT") << "Attempt to retrieve invalid environment selection (" << env_selection_to_string(env) << ")." << LL_ENDL; return LLSettingsDay::Seconds(0); } @@ -1451,7 +1505,7 @@ LLSettingsDay::Seconds LLEnvironment::getEnvironmentDayOffset(EnvSelection_t env { if ((env < ENV_EDIT) || (env > ENV_DEFAULT)) { - LL_WARNS("ENVIRONMENT") << "Attempt to retrieve invalid environment selection." << LL_ENDL; + LL_WARNS("ENVIRONMENT") << "Attempt to retrieve invalid environment selection (" << env_selection_to_string(env) << ")." << LL_ENDL; return LLSettingsDay::Seconds(0); } @@ -1494,7 +1548,7 @@ LLEnvironment::fixedEnvironment_t LLEnvironment::getEnvironmentFixed(LLEnvironme if ((env < ENV_EDIT) || (env > ENV_DEFAULT)) { - LL_WARNS("ENVIRONMENT") << "Attempt to retrieve invalid environment selection." << LL_ENDL; + LL_WARNS("ENVIRONMENT") << "Attempt to retrieve invalid environment selection (" << env_selection_to_string(env) << ")." << LL_ENDL; return fixedEnvironment_t(); } @@ -2579,7 +2633,7 @@ void LLEnvironment::onSetExperienceEnvAssetLoaded(LLUUID experience_id, LLSettin if (!settings || status) { LLSD args; - args["NAME"] = experience_id.asString();// fix the args to match the template. + args["NAME"] = experience_id.asString(); LLNotificationsUtil::add("FailedToFindSettings", args); return; } @@ -3550,7 +3604,7 @@ namespace return; } - LL_WARNS("PUSHENV") << "Underlying environment has changed (" << env << ")! Base env is type " << base_env << LL_ENDL; + LL_WARNS("PUSHENV", "ENVIRONMENT") << "Underlying environment has changed (" << env << ")! Base env is type " << base_env << LL_ENDL; LLEnvironment::DayInstance::ptr_t trans = std::make_shared(std::static_pointer_cast(shared_from_this()), mBaseDayInstance->getSky(), mBaseDayInstance->getWater(), nextbase, LLEnvironment::TRANSITION_DEFAULT); diff --git a/indra/newview/llenvironment.h b/indra/newview/llenvironment.h index a974e3893c..a664513de8 100644 --- a/indra/newview/llenvironment.h +++ b/indra/newview/llenvironment.h @@ -152,8 +152,11 @@ public: void setEnvironment(EnvSelection_t env, const LLUUID &assetId, S32 env_version = NO_VERSION); void setSharedEnvironment(); - void clearEnvironment(EnvSelection_t env); + + static void logEnvironment(EnvSelection_t env, const LLSettingsBase::ptr_t &settings, S32 env_version = NO_VERSION); + + LLSettingsDay::ptr_t getEnvironmentDay(EnvSelection_t env); LLSettingsDay::Seconds getEnvironmentDayLength(EnvSelection_t env); LLSettingsDay::Seconds getEnvironmentDayOffset(EnvSelection_t env); diff --git a/indra/newview/llestateinfomodel.cpp b/indra/newview/llestateinfomodel.cpp index 4fdb860592..02f3808515 100644 --- a/indra/newview/llestateinfomodel.cpp +++ b/indra/newview/llestateinfomodel.cpp @@ -150,7 +150,9 @@ void LLEstateInfoModel::commitEstateInfoCapsCoro(std::string url) body["deny_age_unverified"] = getDenyAgeUnverified(); body["allow_voice_chat"] = getAllowVoiceChat(); body["override_public_access"] = getAllowAccessOverride(); - +// FIRE-29683 Update the (currently unused in SL) Cap to align to EEP as Opensim needs it + body["override_environment"] = getAllowEnvironmentOverride(); +// body["invoice"] = LLFloaterRegionInfo::getLastInvoice(); LL_DEBUGS("WindlightSync") << "Sending estate caps: " diff --git a/indra/newview/lleventpoll.cpp b/indra/newview/lleventpoll.cpp index a51d9a4a2c..bb2aa7d248 100644 --- a/indra/newview/lleventpoll.cpp +++ b/indra/newview/lleventpoll.cpp @@ -191,6 +191,14 @@ namespace Details // LL_DEBUGS("LLEventPollImpl::eventPollCoro") << "<" << counter << "> result = " // << LLSDXMLStreamer(result) << LL_ENDL; + if (gDisconnected) + { + // Lost connection or disconnected during quit, don't process sim/region update + // messages, they might populate some cleaned up classes (LLWorld, region and object list) + LL_INFOS("LLEventPollImpl") << "Dropping event messages" << LL_ENDL; + break; + } + LLSD httpResults = result["http_result"]; LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); @@ -246,7 +254,7 @@ namespace Details llcoro::suspendUntilTimeout(waitToRetry); - if (mDone) + if (mDone || gDisconnected) break; LL_INFOS("LLEventPollImpl") << "<" << counter << "> About to retry request." << LL_ENDL; continue; diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 8a16b8e766..6576ab783a 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -716,7 +716,7 @@ void LLFace::renderOneWireframe(const LLColor4 &color, F32 fogCfx, bool wirefram LLGLEnable offset(GL_POLYGON_OFFSET_LINE); glPolygonOffset(3.f, 3.f); - glLineWidth(5.f); + gGL.setLineWidth(5.f); // Line width OGL core profile fix by Rye Mutt glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); renderFace(mDrawablep, this); } diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index 1a36962343..31c26e29ac 100644 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -1095,8 +1095,10 @@ void LLFastTimerView::drawLineGraph() //fatten highlighted timer if (mHoverID == idp) { - gGL.flush(); - glLineWidth(3); + // Line width OGL core profile fix by Rye Mutt + //gGL.flush(); + //glLineWidth(3); + gGL.setLineWidth(3.f); } llassert(idp->getIndex() < sTimerColors.size()); @@ -1155,8 +1157,10 @@ void LLFastTimerView::drawLineGraph() if (mHoverID == idp) { - gGL.flush(); - glLineWidth(1); + // Line width OGL core profile fix by Rye Mutt + //gGL.flush(); + //glLineWidth(1); + gGL.setLineWidth(1.f); } if (idp->getTreeNode().mCollapsed) diff --git a/indra/newview/llfloaterconversationpreview.cpp b/indra/newview/llfloaterconversationpreview.cpp index 3ea64a30c4..75d2341ed8 100644 --- a/indra/newview/llfloaterconversationpreview.cpp +++ b/indra/newview/llfloaterconversationpreview.cpp @@ -102,7 +102,12 @@ BOOL LLFloaterConversationPreview::postBuild() file = "chat"; } mChatHistoryFileName = file; - + // Obsolete because of https://bitbucket.org/lindenlab/viewer/commits/57b32eb01cd35bbac440569df885036eb24f2369 + //if (mIsGroup && !LLStringUtil::endsWith(mChatHistoryFileName, GROUP_CHAT_SUFFIX)) + //{ + // mChatHistoryFileName += GROUP_CHAT_SUFFIX; + //} + // LLStringUtil::format_map_t args; args["[NAME]"] = name; std::string title = getString("Title", args); diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp index ea22043de8..a7c2cbbeaa 100644 --- a/indra/newview/llfloatereditextdaycycle.cpp +++ b/indra/newview/llfloatereditextdaycycle.cpp @@ -1498,7 +1498,7 @@ void LLFloaterEditExtDayCycle::onAssetLoaded(LLUUID asset_id, LLSettingsBase::pt if (!settings || status) { LLSD args; - args["NAME"] = (mInventoryItem) ? mInventoryItem->getName() : "Unknown"; + args["NAME"] = (mInventoryItem) ? mInventoryItem->getName() : asset_id.asString(); LLNotificationsUtil::add("FailedToFindSettings", args); closeFloater(); return; diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index 5ce217fb33..327314969a 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -346,7 +346,7 @@ void LLFloaterFixedEnvironment::onAssetLoaded(LLUUID asset_id, LLSettingsBase::p if (!settings || status) { LLSD args; - args["NAME"] = (mInventoryItem) ? mInventoryItem->getName() : "Unknown"; + args["NAME"] = (mInventoryItem) ? mInventoryItem->getName() : asset_id.asString(); LLNotificationsUtil::add("FailedToFindSettings", args); closeFloater(); return; diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index 3323656a67..84fdaecaf4 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -55,6 +55,7 @@ #include "llcallbacklist.h" #include "llworld.h" #include "llsdserialize.h" +#include "llviewermenu.h" // is_agent_mappable #include "llviewerobjectlist.h" // [RLVa:KB] - @pay #include "rlvactions.h" diff --git a/indra/newview/llfloaterlinkreplace.cpp b/indra/newview/llfloaterlinkreplace.cpp index 1e81b05de4..204e7b036e 100644 --- a/indra/newview/llfloaterlinkreplace.cpp +++ b/indra/newview/llfloaterlinkreplace.cpp @@ -44,9 +44,12 @@ LLFloaterLinkReplace::LLFloaterLinkReplace(const LLSD& key) mSourceUUID(LLUUID::null), mTargetUUID(LLUUID::null), mBatchSize(gSavedSettings.getU32("LinkReplaceBatchSize")), + mActiveItems(0), mDeleteOnly(false) // FIRE-17695 - Delete links capability { mEventTimer.stop(); + + LL_INFOS() << "Link replace settings: Batch size = " << mBatchSize << " - Pause time = " << mPeriod << LL_ENDL; } LLFloaterLinkReplace::~LLFloaterLinkReplace() @@ -333,6 +336,7 @@ void LLFloaterLinkReplace::itemRemovedCallback(LLHandle fl void LLFloaterLinkReplace::decreaseOpenItemCount() { + mActiveItems--; mRemainingItems--; if (mRemainingItems == 0) @@ -358,7 +362,7 @@ BOOL LLFloaterLinkReplace::tick() LLInventoryModel::item_array_t current_batch; - for (U32 i = 0; i < mBatchSize; ++i) + for (U32 i = 0; i < mBatchSize && mActiveItems <= 250; ++i, ++mActiveItems) { if (!mRemainingInventoryItems.size()) { diff --git a/indra/newview/llfloaterlinkreplace.h b/indra/newview/llfloaterlinkreplace.h index 614b9c9663..6a5bbd0b8c 100644 --- a/indra/newview/llfloaterlinkreplace.h +++ b/indra/newview/llfloaterlinkreplace.h @@ -119,6 +119,7 @@ private: LLUUID mTargetUUID; U32 mRemainingItems; U32 mBatchSize; + U32 mActiveItems; LLInventoryModel::item_array_t mRemainingInventoryItems; bool mDeleteOnly;// FIRE-17695 - Delete links capability diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index e50bb7fa3a..cac30efe11 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -80,7 +80,7 @@ const double RETAIN_COEFFICIENT = 100; // should be represented by Smooth combobox with only 10 values. // So this const is used as a size of Smooth combobox list. const S32 SMOOTH_VALUES_NUMBER = 10; -const S32 PREVIEW_RENDER_SIZE = 1024; +// const S32 PREVIEW_RENDER_SIZE = 1024; // Fix up regressions from LL uploader merge const F32 PREVIEW_CAMERA_DISTANCE = 16.f; class LLMeshFilePicker : public LLFilePickerThread @@ -357,21 +357,24 @@ void LLFloaterModelPreview::initModelPreview() S32 tex_width = 512; S32 tex_height = 512; - - S32 max_width = llmin(PREVIEW_RENDER_SIZE, (S32)gPipeline.mScreenWidth); - S32 max_height = llmin(PREVIEW_RENDER_SIZE, (S32)gPipeline.mScreenHeight); - - while ((tex_width << 1) < max_width) + // Fix up regressions from LL's merge of uploader changes + // S32 max_width = llmin(PREVIEW_RENDER_SIZE, (S32)gPipeline.mScreenWidth); + // S32 max_height = llmin(PREVIEW_RENDER_SIZE, (S32)gPipeline.mScreenHeight); + S32 max_width = llmin(gSavedSettings.getS32("PreviewRenderSize"), (S32)gPipeline.mScreenWidth); + S32 max_height = llmin(gSavedSettings.getS32("PreviewRenderSize"), (S32)gPipeline.mScreenHeight); + // + + while ((tex_width << 1) <= max_width) // Fix up regressions from LL's merge of uploader changes { tex_width <<= 1; } - while ((tex_height << 1) < max_height) + while ((tex_height << 1) <= max_height) // Fix up regressions from LL's merge of uploader changes { tex_height <<= 1; } mModelPreview = new LLModelPreview(tex_width, tex_height, this); - mModelPreview->setPreviewTarget(PREVIEW_CAMERA_DISTANCE); + mModelPreview->setPreviewTarget(PREVIEW_CAMERA_DISTANCE); mModelPreview->setDetailsCallback(boost::bind(&LLFloaterModelPreview::setDetails, this, _1, _2, _3, _4, _5)); mModelPreview->setModelUpdatedCallback(boost::bind(&LLFloaterModelPreview::modelUpdated, this, _1)); } diff --git a/indra/newview/llfloaternotificationstabbed.cpp b/indra/newview/llfloaternotificationstabbed.cpp index 9805d2d68b..d263cb36c8 100644 --- a/indra/newview/llfloaternotificationstabbed.cpp +++ b/indra/newview/llfloaternotificationstabbed.cpp @@ -169,7 +169,7 @@ void LLFloaterNotificationsTabbed::initChannel() mChannel = dynamic_cast(channel); if(NULL == mChannel) { - LL_WARNS() << "LLSysWellWindow::initChannel() - could not get a requested screen channel" << LL_ENDL; + LL_WARNS() << "LLFloaterNotificationsTabbed::initChannel() - could not get a requested screen channel" << LL_ENDL; } if(mChannel) diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index c8b21a142d..aeddc0b7ec 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -639,6 +639,9 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) // FIRE-2912: Reset voice button mCommitCallbackRegistrar.add("Pref.ResetVoice", boost::bind(&LLFloaterPreference::onClickResetVoice, this)); + + // Dynamic texture memory calculation + gSavedSettings.getControl("FSDynamicTextureMemory")->getCommitSignal()->connect(boost::bind(&LLFloaterPreference::handleDynamicTextureMemoryChanged, this)); } void LLFloaterPreference::processProperties( void* pData, EAvatarProcessorType type ) @@ -2137,9 +2140,11 @@ void LLFloaterPreference::refreshEnabledState() ////Deferred/SSAO/Shadows //BOOL bumpshiny = gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps && LLFeatureManager::getInstance()->isFeatureAvailable("RenderObjectBump") && gSavedSettings.getBOOL("RenderObjectBump"); + //BOOL transparent_water = LLFeatureManager::getInstance()->isFeatureAvailable("RenderTransparentWater") && gSavedSettings.getBOOL("RenderTransparentWater"); //BOOL shaders = gSavedSettings.getBOOL("WindLightUseAtmosShaders"); //BOOL enabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") && // bumpshiny && + // transparent_water && // shaders && // gGLManager.mHasFramebufferObject && // gSavedSettings.getBOOL("RenderAvatarVP") && @@ -2154,6 +2159,9 @@ void LLFloaterPreference::refreshEnabledState() getChild("GraphicsCardTextureMemory")->setMinValue(min_tex_mem.value()); getChild("GraphicsCardTextureMemory")->setMaxValue(max_tex_mem.value()); + // Dynamic texture memory calculation + handleDynamicTextureMemoryChanged(); + #if ADDRESS_SIZE == 32 childSetEnabled("FSRestrictMaxTextureSize", false); #endif @@ -2219,12 +2227,15 @@ void LLFloaterPreference::refreshEnabledState() bool bumpshiny = gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps && LLFeatureManager::getInstance()->isFeatureAvailable("RenderObjectBump"); bumpshiny_ctrl->setEnabled(bumpshiny ? TRUE : FALSE); - // Does not exist + // Transparent Water + LLCheckBoxCtrl* transparent_water_ctrl = getChild("TransparentWater"); + + // Does not exist //LLCheckBoxCtrl* ctrl_enhanced_skel = getChild("AvatarEnhancedSkeleton"); //bool enhanced_skel_enabled = gSavedSettings.getBOOL("IncludeEnhancedSkeleton"); //ctrl_enhanced_skel->setValue(enhanced_skel_enabled); - // - + // + // Avatar Mode // Enable Avatar Shaders LLCheckBoxCtrl* ctrl_avatar_vp = getChild("AvatarVertexProgram"); @@ -2249,10 +2260,12 @@ void LLFloaterPreference::refreshEnabledState() ctrl_avatar_cloth->setEnabled(true); } + /* remove orphaned code left over from EEP // Vertex Shaders, Global Shader Enable LLRadioGroup* terrain_detail = getChild("TerrainDetailRadio"); // can be linked with control var terrain_detail->setEnabled(FALSE); + */ // WindLight LLCheckBoxCtrl* ctrl_wind_light = getChild("WindLightUseAtmosShaders"); @@ -2271,6 +2284,7 @@ void LLFloaterPreference::refreshEnabledState() BOOL enabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") && ((bumpshiny_ctrl && bumpshiny_ctrl->get()) ? TRUE : FALSE) && + ((transparent_water_ctrl && transparent_water_ctrl->get()) ? TRUE : FALSE) && gGLManager.mHasFramebufferObject && gSavedSettings.getBOOL("RenderAvatarVP") && (ctrl_wind_light->get()) ? TRUE : FALSE; @@ -2303,6 +2317,29 @@ void LLFloaterPreference::refreshEnabledState() getChildView("block_list")->setEnabled(LLLoginInstance::getInstance()->authSuccess()); } +// Dynamic texture memory calculation +void LLFloaterPreference::handleDynamicTextureMemoryChanged() +{ + if (LLViewerTextureList::canUseDynamicTextureMemory()) + { + bool dynamic_tex_mem_enabled = gSavedSettings.getBOOL("FSDynamicTextureMemory"); + childSetEnabled("FSDynamicTextureMemory", true); + childSetEnabled("FSDynamicTextureMemoryMinTextureMemory", dynamic_tex_mem_enabled); + childSetEnabled("FSDynamicTextureMemoryCacheReserve", dynamic_tex_mem_enabled); + childSetEnabled("FSDynamicTextureMemoryGPUReserve", dynamic_tex_mem_enabled); + childSetEnabled("GraphicsCardTextureMemory", !dynamic_tex_mem_enabled); + } + else + { + childSetEnabled("FSDynamicTextureMemory", false); + childSetEnabled("FSDynamicTextureMemoryMinTextureMemory", false); + childSetEnabled("FSDynamicTextureMemoryCacheReserve", false); + childSetEnabled("FSDynamicTextureMemoryGPUReserve", false); + childSetEnabled("GraphicsCardTextureMemory", true); + } +} +// + void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledState() { LLComboBox* ctrl_reflections = getChild("Reflections"); @@ -2312,7 +2349,10 @@ void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledState() BOOL reflections = gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps; ctrl_reflections->setEnabled(reflections); reflections_text->setEnabled(reflections); - + + // Transparent Water + LLCheckBoxCtrl* transparent_water_ctrl = getChild("TransparentWater"); + // Bump & Shiny LLCheckBoxCtrl* bumpshiny_ctrl = getChild("BumpShiny"); bool bumpshiny = gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps && LLFeatureManager::getInstance()->isFeatureAvailable("RenderObjectBump"); @@ -2342,12 +2382,14 @@ void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledState() ctrl_avatar_cloth->setEnabled(TRUE); } + /* remove orphaned code left over from EEP // Vertex Shaders, Global Shader Enable // SL-12594 Basic shaders are always enabled. DJH TODO clean up now-orphaned state handling code LLSliderCtrl* terrain_detail = getChild("TerrainDetail"); // can be linked with control var LLTextBox* terrain_text = getChild("TerrainDetailText"); terrain_detail->setEnabled(FALSE); terrain_text->setEnabled(FALSE); + */ // WindLight LLCheckBoxCtrl* ctrl_wind_light = getChild("WindLightUseAtmosShaders"); @@ -2366,6 +2408,7 @@ void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledState() BOOL enabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") && ((bumpshiny_ctrl && bumpshiny_ctrl->get()) ? TRUE : FALSE) && + ((transparent_water_ctrl && transparent_water_ctrl->get()) ? TRUE : FALSE) && gGLManager.mHasFramebufferObject && gSavedSettings.getBOOL("RenderAvatarVP") && (ctrl_wind_light->get()) ? TRUE : FALSE; diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index bde0b39898..d2a7b655e4 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -167,6 +167,9 @@ protected: // Group Notices and chiclets location setting conversion BOOL => S32 void onShowGroupNoticesTopRightChanged(); + // Dynamic texture memory calculation + void handleDynamicTextureMemoryChanged(); + public: // This function squirrels away the current values of the controls so that // cancel() can restore them. diff --git a/indra/newview/llfloatersnapshot.h b/indra/newview/llfloatersnapshot.h index 802f8b51f4..d6b5e1cd56 100644 --- a/indra/newview/llfloatersnapshot.h +++ b/indra/newview/llfloatersnapshot.h @@ -34,6 +34,7 @@ class LLSpinCtrl; class LLSnapshotLivePreview; +class LLToolset; class LLFloaterSnapshotBase : public LLFloater { diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index 31c4ba550d..2a2887c257 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -82,6 +82,7 @@ #include "llsdutil.h" #include "llsdutil_math.h" #include "alfloaterregiontracker.h" +#include "llstartup.h" //--------------------------------------------------------------------------- // Constants @@ -129,6 +130,13 @@ public: bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) { + // FIRE-17927: Viewer crashes when opening worldmap SLURL command from login panel + if (LLStartUp::getStartupState() < STATE_STARTED) + { + return true; + } + // + if (!LLUI::getInstance()->mSettingGroups["config"]->getBOOL("EnableWorldMap")) { LLNotificationsUtil::add("NoWorldMap", LLSD(), LLSD(), std::string("SwitchToStandardSkinAndQuit")); diff --git a/indra/newview/llgesturemgr.cpp b/indra/newview/llgesturemgr.cpp index 07bb73015d..ec82c17a00 100644 --- a/indra/newview/llgesturemgr.cpp +++ b/indra/newview/llgesturemgr.cpp @@ -542,7 +542,9 @@ void LLGestureMgr::playGesture(LLMultiGesture* gesture) // [/RLVa:KB] // Reset gesture to first step - gesture->mCurrentStep = 0; + // Do a proper reset or we might end up reading random data from wrong memory locations due to invalid gesture state + //gesture->mCurrentStep = 0; + gesture->reset(); // Add to list of playing gesture->mPlaying = TRUE; @@ -944,8 +946,7 @@ void LLGestureMgr::stepGesture(LLMultiGesture* gesture) LLGestureStepWait* wait_step = (LLGestureStepWait*)step; F32 elapsed = gesture->mWaitTimer.getElapsedTimeF32(); - //if (elapsed > wait_step->mWaitSeconds) // Fix for fire-5819 Gestures sticking on wait states - if (elapsed > wait_step->mWaitSeconds || wait_step->mWaitSeconds == 19426740371009173000000000000000.0f) // Im not to happy with how this fixes gestures getting stuck in the wait state, but, it does fix the problem + if (elapsed > wait_step->mWaitSeconds) { // wait is done, continue execution gesture->mWaitingTimer = FALSE; diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index 9d4568dcf1..4d8e4b8866 100644 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -108,13 +108,17 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask) S32 top = llmax(y, mDragStartY); S32 bottom =llmin(y, mDragStartY); - left = ll_round((F32) left * LLUI::getScaleFactor().mV[VX]); - right = ll_round((F32) right * LLUI::getScaleFactor().mV[VX]); - top = ll_round((F32) top * LLUI::getScaleFactor().mV[VY]); - bottom = ll_round((F32) bottom * LLUI::getScaleFactor().mV[VY]); + // Factor out getInstance calls + LLViewerCamera& camera = LLViewerCamera::instance(); + LLVector2& scale_factor = LLUI::getScaleFactor(); - F32 old_far_plane = LLViewerCamera::getInstance()->getFar(); - F32 old_near_plane = LLViewerCamera::getInstance()->getNear(); + left = ll_round((F32) left * scale_factor.mV[VX]); + right = ll_round((F32) right * scale_factor.mV[VX]); + top = ll_round((F32) top * scale_factor.mV[VY]); + bottom = ll_round((F32) bottom * scale_factor.mV[VY]); + + F32 old_far_plane = camera.getFar(); + F32 old_near_plane = camera.getNear(); S32 width = right - left + 1; S32 height = top - bottom + 1; @@ -155,19 +159,19 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask) { // ...select distance from control LLVector3 relative_av_pos = av_pos; - relative_av_pos -= LLViewerCamera::getInstance()->getOrigin(); + relative_av_pos -= camera.getOrigin(); // Use faster LLCachedControls //F32 new_far = relative_av_pos * LLViewerCamera::getInstance()->getAtAxis() + gSavedSettings.getF32("MaxSelectDistance"); //F32 new_near = relative_av_pos * LLViewerCamera::getInstance()->getAtAxis() - gSavedSettings.getF32("MaxSelectDistance"); - F32 new_far = relative_av_pos * LLViewerCamera::getInstance()->getAtAxis() + maxSelectDistance; - F32 new_near = relative_av_pos * LLViewerCamera::getInstance()->getAtAxis() - maxSelectDistance; + F32 new_far = relative_av_pos * camera.getAtAxis() + maxSelectDistance; + F32 new_near = relative_av_pos * camera.getAtAxis() - maxSelectDistance; // new_near = llmax(new_near, 0.1f); - LLViewerCamera::getInstance()->setFar(new_far); - LLViewerCamera::getInstance()->setNear(new_near); + camera.setFar(new_far); + camera.setNear(new_near); } // [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.0e) | Modified: RLVa-1.0.0g if (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) @@ -177,22 +181,22 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask) // We'll allow drag selection under fartouch, but only within the fartouch range // (just copy/paste the code above us to make that work, thank you Lindens!) LLVector3 relative_av_pos = av_pos; - relative_av_pos -= LLViewerCamera::getInstance()->getOrigin(); + relative_av_pos -= camera.getOrigin(); - F32 new_far = relative_av_pos * LLViewerCamera::getInstance()->getAtAxis() + s_nFartouchDist; - F32 new_near = relative_av_pos * LLViewerCamera::getInstance()->getAtAxis() - s_nFartouchDist; + F32 new_far = relative_av_pos * camera.getAtAxis() + s_nFartouchDist; + F32 new_near = relative_av_pos * camera.getAtAxis() - s_nFartouchDist; new_near = llmax(new_near, 0.1f); - LLViewerCamera::getInstance()->setFar(new_far); - LLViewerCamera::getInstance()->setNear(new_near); + camera.setFar(new_far); + camera.setNear(new_near); // Usurp these two limit_select_distance = TRUE; select_dist_squared = s_nFartouchDist * s_nFartouchDist; } // [/RLVa:KB] - LLViewerCamera::getInstance()->setPerspective(FOR_SELECTION, + camera.setPerspective(FOR_SELECTION, center_x-width/2, center_y-height/2, width, height, limit_select_distance); @@ -242,7 +246,7 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask) LLSpatialPartition* part = region->getSpatialPartition(i); if (part) { - part->cull(*LLViewerCamera::getInstance(), &potentials, TRUE); + part->cull(camera, &potentials, TRUE); } } } @@ -282,14 +286,14 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask) } // [/RLVa:KB] - S32 result = LLViewerCamera::getInstance()->sphereInFrustum(drawable->getPositionAgent(), drawable->getRadius()); + S32 result = camera.sphereInFrustum(drawable->getPositionAgent(), drawable->getRadius()); if (result) { switch (result) { case 1: // check vertices - if (LLViewerCamera::getInstance()->areVertsVisible(vobjp, LLSelectMgr::sRectSelectInclusive)) + if (camera.areVertsVisible(vobjp, LLSelectMgr::sRectSelectInclusive)) { LLSelectMgr::getInstance()->highlightObjectOnly(vobjp); } @@ -310,8 +314,8 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask) gGL.matrixMode(LLRender::MM_MODELVIEW); // restore camera - LLViewerCamera::getInstance()->setFar(old_far_plane); - LLViewerCamera::getInstance()->setNear(old_near_plane); + camera.setFar(old_far_plane); + camera.setNear(old_near_plane); gViewerWindow->setup3DRender(); } @@ -381,10 +385,12 @@ void LLViewerParcelMgr::renderRect(const LLVector3d &west_south_bottom_global, // resolves correctly so we can get a height value. const F32 FUDGE = 0.01f; - F32 sw_bottom = LLWorld::getInstance()->resolveLandHeightAgent( LLVector3( west, south, 0.f ) ); - F32 se_bottom = LLWorld::getInstance()->resolveLandHeightAgent( LLVector3( east-FUDGE, south, 0.f ) ); - F32 ne_bottom = LLWorld::getInstance()->resolveLandHeightAgent( LLVector3( east-FUDGE, north-FUDGE, 0.f ) ); - F32 nw_bottom = LLWorld::getInstance()->resolveLandHeightAgent( LLVector3( west, north-FUDGE, 0.f ) ); + // Factor out getInstance calls + LLWorld& world = LLWorld::instance(); + F32 sw_bottom = world.resolveLandHeightAgent( LLVector3( west, south, 0.f ) ); + F32 se_bottom = world.resolveLandHeightAgent( LLVector3( east-FUDGE, south, 0.f ) ); + F32 ne_bottom = world.resolveLandHeightAgent( LLVector3( east-FUDGE, north-FUDGE, 0.f ) ); + F32 nw_bottom = world.resolveLandHeightAgent( LLVector3( west, north-FUDGE, 0.f ) ); F32 sw_top = sw_bottom + PARCEL_POST_HEIGHT; F32 se_top = se_bottom + PARCEL_POST_HEIGHT; @@ -950,8 +956,10 @@ void LLViewerObjectList::renderObjectBeacons() S32 line_width = debug_beacon.mLineWidth; if (line_width != last_line_width) { - gGL.flush(); - glLineWidth( (F32)line_width ); + // Line width OGL core profile fix by Rye Mutt + //gGL.flush(); + //glLineWidth( (F32)line_width ); + gGL.setLineWidth((F32)line_width); last_line_width = line_width; } @@ -980,8 +988,10 @@ void LLViewerObjectList::renderObjectBeacons() S32 line_width = debug_beacon.mLineWidth; if (line_width != last_line_width) { - gGL.flush(); - glLineWidth( (F32)line_width ); + // Line width OGL core profile fix by Rye Mutt + //gGL.flush(); + //glLineWidth( (F32)line_width ); + gGL.setLineWidth((F32)line_width); last_line_width = line_width; } @@ -994,8 +1004,10 @@ void LLViewerObjectList::renderObjectBeacons() gGL.end(); } - gGL.flush(); - glLineWidth(1.f); + // Line width OGL core profile fix by Rye Mutt + //gGL.flush(); + //glLineWidth(1.f); + gGL.setLineWidth(1.f); for (std::vector::iterator iter = mDebugBeacons.begin(); iter != mDebugBeacons.end(); ++iter) { @@ -1033,7 +1045,7 @@ void LLSky::renderSunMoonBeacons(const LLVector3& pos_agent, const LLVector3& di { pos_end.mV[i] = pos_agent.mV[i] + (50 * direction.mV[i]); } - glLineWidth(LLPipeline::DebugBeaconLineWidth); + gGL.setLineWidth(LLPipeline::DebugBeaconLineWidth); // Line width OGL core profile fix by Rye Mutt gGL.begin(LLRender::LINES); color.mV[3] *= 0.5f; gGL.color4fv(color.mV); @@ -1044,7 +1056,7 @@ void LLSky::renderSunMoonBeacons(const LLVector3& pos_agent, const LLVector3& di gGL.end(); gGL.flush(); - glLineWidth(1.f); + gGL.setLineWidth(1.f); // Line width OGL core profile fix by Rye Mutt } diff --git a/indra/newview/llimprocessing.cpp b/indra/newview/llimprocessing.cpp index 64fa0680b1..1fb4b77094 100644 --- a/indra/newview/llimprocessing.cpp +++ b/indra/newview/llimprocessing.cpp @@ -1194,6 +1194,15 @@ void LLIMProcessing::processNewMessage(LLUUID from_id, LLStringUtil::format_map_t args; args["NAME"] = name; from_name += LLTrans::getString("InvOfferGroupNoticeName", args); + + // FIRE-29677 / SL-13720 workaround + if (LLUUID::validate(name)) + { + LLStringUtil::format_map_t args; + args["NAME"] = "%s"; + std::string placeholder_from_name = LLTrans::getString("InvOfferGroupNoticeName", args); + from_name = name + "|" + placeholder_from_name; + } // info->mFromName = from_name; @@ -1772,13 +1781,52 @@ void LLIMProcessing::processNewMessage(LLUUID from_id, // else { -// if (is_do_not_disturb) + // FS autoresponse feature + //if (is_do_not_disturb) + //{ + // send_do_not_disturb_message(gMessageSystem, from_id); + //} // [RLVa:KB] - Checked: RLVa-1.4.9 - if ( (is_do_not_disturb) && (!fRlvAutoAccept) ) + if (!fRlvAutoAccept) // [/RLVa:KB] { - send_do_not_disturb_message(gMessageSystem, from_id); + std::string my_name; + std::string response; + LLAgentUI::buildFullname(my_name); + if (is_do_not_disturb) + { + response = gSavedPerAccountSettings.getString("DoNotDisturbModeResponse"); + } + else if (is_autorespond_nonfriends && !is_friend) + { + response = gSavedPerAccountSettings.getString("FSAutorespondNonFriendsResponse"); + } + else if (is_autorespond) + { + response = gSavedPerAccountSettings.getString("FSAutorespondModeResponse"); + } + else if (is_afk && FSSendAwayAvatarResponse) + { + response = gSavedPerAccountSettings.getString("FSAwayAvatarResponse"); + } + + if (!response.empty()) + { + pack_instant_message( + gMessageSystem, + gAgentID, + FALSE, + gAgentSessionID, + from_id, + my_name, + response, + IM_ONLINE, + IM_DO_NOT_DISTURB_AUTO_RESPONSE, + LLUUID::null); + gAgent.sendReliableMessage(); + } } + // FS autoresponse feature LLVector3 pos, look_at; U64 region_handle(0); diff --git a/indra/newview/llinspectavatar.cpp b/indra/newview/llinspectavatar.cpp index 624eddcf92..ac78e06a4e 100644 --- a/indra/newview/llinspectavatar.cpp +++ b/indra/newview/llinspectavatar.cpp @@ -317,10 +317,16 @@ void LLInspectAvatar::onOpen(const LLSD& data) mAvatarID = data["avatar_id"]; // Undo CHUI-90 and make avatar inspector useful again - BOOL self = mAvatarID == gAgent.getID(); + BOOL self = mAvatarID == gAgentID; - getChild("gear_self_btn")->setVisible(self); getChild("gear_btn")->setVisible(!self); + LLMenuButton* gear_self_btn = getChild("gear_self_btn"); + gear_self_btn->setVisible(self); + + if (self) + { + gear_self_btn->setMenu(gMenuInspectSelf); + } // // Position the inspector relative to the mouse cursor @@ -356,6 +362,7 @@ void LLInspectAvatar::onOpen(const LLSD& data) void LLInspectAvatar::onClose(bool app_quitting) { getChild("gear_btn")->hideMenu(); + getChild("gear_self_btn")->hideMenu(); } // diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 4142f3d132..6a920eabda 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -95,10 +95,7 @@ #include "aoengine.h" // -#include "llparcel.h" -#include "llviewerparcelmgr.h" - -// Do not allow "Restore To Last Postiion" for no-copy items +// Do not allow "Restore To Last Position" for no-copy items #ifdef OPENSIM #include "fsgridhandler.h" #endif @@ -6987,70 +6984,6 @@ LLInventoryObject* LLObjectBridge::getObject() const return object; } -// [RLVa:KB] - Checked: 2012-08-15 (RLVa-1.4.7) -bool enable_attachment_touch(const LLUUID& idItem) -{ - const LLInventoryItem* pItem = gInventory.getItem(idItem); - if ( (isAgentAvatarValid()) && (pItem) && (LLAssetType::AT_OBJECT == pItem->getType()) ) - { - const LLViewerObject* pAttachObj = gAgentAvatarp->getWornAttachment(pItem->getLinkedUUID()); - return (pAttachObj) && (pAttachObj->flagHandleTouch()) && ( (!RlvActions::isRlvEnabled()) || (RlvActions::canTouch(gAgentAvatarp->getWornAttachment(idItem))) ); - } - return false; -} -// [/RLVa:KB] - -// Touch worn objects -void handle_attachment_touch(const LLUUID& idItem) -{ - if (!enable_attachment_touch(idItem)) - { - return; - } - - const LLInventoryItem* pItem = gInventory.getItem(idItem); - if ( (!isAgentAvatarValid()) || (!pItem) ) - return; - - LLViewerObject* pAttachObj = gAgentAvatarp->getWornAttachment(pItem->getLinkedUUID()); - if (!pAttachObj) - return; - - LLMessageSystem *msg = gMessageSystem; - - msg->newMessageFast(_PREHASH_ObjectGrab); - msg->nextBlockFast( _PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - msg->nextBlockFast( _PREHASH_ObjectData); - msg->addU32Fast( _PREHASH_LocalID, pAttachObj->mLocalID); - msg->addVector3Fast(_PREHASH_GrabOffset, LLVector3::zero); - msg->nextBlock("SurfaceInfo"); - msg->addVector3("UVCoord", LLVector3::zero); - msg->addVector3("STCoord", LLVector3::zero); - msg->addS32Fast(_PREHASH_FaceIndex, 0); - msg->addVector3("Position", pAttachObj->getPosition()); - msg->addVector3("Normal", LLVector3::zero); - msg->addVector3("Binormal", LLVector3::zero); - msg->sendMessage( pAttachObj->getRegion()->getHost()); - - msg->newMessageFast(_PREHASH_ObjectDeGrab); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - msg->nextBlockFast(_PREHASH_ObjectData); - msg->addU32Fast(_PREHASH_LocalID, pAttachObj->mLocalID); - msg->nextBlock("SurfaceInfo"); - msg->addVector3("UVCoord", LLVector3::zero); - msg->addVector3("STCoord", LLVector3::zero); - msg->addS32Fast(_PREHASH_FaceIndex, 0); - msg->addVector3("Position", pAttachObj->getPosition()); - msg->addVector3("Normal", LLVector3::zero); - msg->addVector3("Binormal", LLVector3::zero); - msg->sendMessage(pAttachObj->getRegion()->getHost()); -} -// - // Texture Refresh on worn attachments void handle_attachment_texture_refresh(const LLUUID& idItem) { @@ -7116,18 +7049,14 @@ void LLObjectBridge::performAction(LLInventoryModel* model, std::string action) { LLAppearanceMgr::instance().wearItemOnAvatar(mUUID, true, false); // Don't replace if adding. } -// [SL:KB] - Patch: Inventory-AttachmentEdit - Checked: 2010-08-25 (Catznip-2.2.0a) | Added: Catznip-2.1.2a - else if ("edit" == action) - { - handle_attachment_edit(mUUID); - } -// [/SL:KB] - // Touch worn objects else if ("touch" == action) { handle_attachment_touch(mUUID); } - // + else if ("edit" == action) + { + handle_attachment_edit(mUUID); + } // Texture Refresh on worn attachments else if ("texture_refresh_attachment" == action) { @@ -7315,14 +7244,18 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) if( get_is_item_worn( mUUID ) ) { items.push_back(std::string("Wearable And Object Separator")); -// [SL:KB] - Patch: Inventory-AttachmentEdit - Checked: 2010-08-25 (Catznip-2.2.0a) | Added: Catznip-2.1.2a - // TOOD-Catznip: should really be "Wearable And Object Edit" if we ever plan on pushing this upstream - items.push_back(std::string("Wearable Edit")); -// [/SL:KB] - items.push_back(std::string("Touch Attachment")); - if ( ((flags & FIRST_SELECTED_ITEM) == 0) || (!enable_attachment_touch(mUUID)) ) - disabled_items.push_back(std::string("Touch Attachment")); + items.push_back(std::string("Attachment Touch")); + if ( ((flags & FIRST_SELECTED_ITEM) == 0) || !enable_attachment_touch(mUUID) ) + { + disabled_items.push_back(std::string("Attachment Touch")); + } + + items.push_back(std::string("Wearable Edit")); + if ( ((flags & FIRST_SELECTED_ITEM) == 0) || !get_is_item_editable(mUUID) ) + { + disabled_items.push_back(std::string("Wearable Edit")); + } // Texture Refresh on worn attachments if (item->getType() == LLAssetType::AT_OBJECT) diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index f5ada6e12e..7dc8d71176 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -78,6 +78,7 @@ #include "lltooldraganddrop.h" #include "lltrans.h" #include "lluictrlfactory.h" +#include "llviewermenu.h" #include "llviewermessage.h" #include "llviewerfoldertype.h" #include "llviewerobjectlist.h" @@ -695,6 +696,50 @@ BOOL get_is_item_removable(const LLInventoryModel* model, const LLUUID& id) return TRUE; } +bool get_is_item_editable(const LLUUID& inv_item_id) +{ + if (const LLInventoryItem* inv_item = gInventory.getLinkedItem(inv_item_id)) + { + switch (inv_item->getType()) + { + case LLAssetType::AT_BODYPART: + case LLAssetType::AT_CLOTHING: + return gAgentWearables.isWearableModifiable(inv_item_id); + case LLAssetType::AT_OBJECT: + return true; + default: + return false;; + } + } + return gAgentAvatarp->getWornAttachment(inv_item_id) != nullptr; +} + +void handle_item_edit(const LLUUID& inv_item_id) +{ + if (get_is_item_editable(inv_item_id)) + { + if (const LLInventoryItem* inv_item = gInventory.getLinkedItem(inv_item_id)) + { + switch (inv_item->getType()) + { + case LLAssetType::AT_BODYPART: + case LLAssetType::AT_CLOTHING: + LLAgentWearables::editWearable(inv_item_id); + break; + case LLAssetType::AT_OBJECT: + handle_attachment_edit(inv_item_id); + break; + default: + break; + } + } + else + { + handle_attachment_edit(inv_item_id); + } + } +} + BOOL get_is_category_removable(const LLInventoryModel* model, const LLUUID& id) { // NOTE: This function doesn't check the folder's children. diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h index becdb9a63c..65771c35e9 100644 --- a/indra/newview/llinventoryfunctions.h +++ b/indra/newview/llinventoryfunctions.h @@ -57,6 +57,10 @@ BOOL get_can_item_be_worn(const LLUUID& id); BOOL get_is_item_removable(const LLInventoryModel* model, const LLUUID& id); +// Performs the appropiate edit action (if one exists) for this item +bool get_is_item_editable(const LLUUID& inv_item_id); +void handle_item_edit(const LLUUID& inv_item_id); + BOOL get_is_category_removable(const LLInventoryModel* model, const LLUUID& id); BOOL get_is_category_renameable(const LLInventoryModel* model, const LLUUID& id); diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index d27920ef3d..d3cc03914f 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -56,6 +56,7 @@ #include "llcallbacklist.h" #include "llvoavatarself.h" #include "llgesturemgr.h" +#include "llsdserialize.h" #include "llsdutil.h" #include "bufferarray.h" #include "bufferstream.h" @@ -92,8 +93,8 @@ BOOL LLInventoryModel::sFirstTimeInViewer2 = TRUE; ///---------------------------------------------------------------------------- //BOOL decompress_file(const char* src_filename, const char* dst_filename); -static const char PRODUCTION_CACHE_FORMAT_STRING[] = "%s.inv"; -static const char GRID_CACHE_FORMAT_STRING[] = "%s.%s.inv"; +static const char PRODUCTION_CACHE_FORMAT_STRING[] = "%s.inv.llsd"; +static const char GRID_CACHE_FORMAT_STRING[] = "%s.%s.inv.llsd"; static const char * const LOG_INV("Inventory"); struct InventoryIDPtrLess @@ -733,17 +734,59 @@ void LLInventoryModel::createNewCategoryCoro(std::string url, LLSD postData, inv LLUUID categoryId = result["folder_id"].asUUID(); - // Add the category to the internal representation - LLPointer cat = new LLViewerInventoryCategory(categoryId, - result["parent_id"].asUUID(), (LLFolderType::EType)result["type"].asInteger(), - result["name"].asString(), gAgent.getID()); + LLViewerInventoryCategory* folderp = gInventory.getCategory(categoryId); + if (!folderp) + { + // Add the category to the internal representation + LLPointer cat = new LLViewerInventoryCategory(categoryId, + result["parent_id"].asUUID(), (LLFolderType::EType)result["type"].asInteger(), + result["name"].asString(), gAgent.getID()); - cat->setVersion(LLViewerInventoryCategory::VERSION_INITIAL - 1); // accountForUpdate() will icrease version by 1 - cat->setDescendentCount(0); - LLInventoryModel::LLCategoryUpdate update(cat->getParentUUID(), 1); - - accountForUpdate(update); - updateCategory(cat); + LLInventoryModel::LLCategoryUpdate update(cat->getParentUUID(), 1); + accountForUpdate(update); + + cat->setVersion(LLViewerInventoryCategory::VERSION_INITIAL - 1); // accountForUpdate() will icrease version by 1 + cat->setDescendentCount(0); + updateCategory(cat); + } + else + { + // bulk processing was faster than coroutine (coro request->processBulkUpdateInventory->coro response) + // category already exists, but needs an update + if (folderp->getVersion() != LLViewerInventoryCategory::VERSION_INITIAL + || folderp->getDescendentCount() != LLViewerInventoryCategory::DESCENDENT_COUNT_UNKNOWN) + { + LL_WARNS() << "Inventory desync on folder creation. Newly created folder already has descendants or got a version.\n" + << "Name: " << folderp->getName() + << " Id: " << folderp->getUUID() + << " Version: " << folderp->getVersion() + << " Descendants: " << folderp->getDescendentCount() + << LL_ENDL; + } + // Recreate category with correct values + // Creating it anew just simplifies figuring out needed change-masks + // and making all needed updates, see updateCategory + LLPointer cat = new LLViewerInventoryCategory(categoryId, + result["parent_id"].asUUID(), (LLFolderType::EType)result["type"].asInteger(), + result["name"].asString(), gAgent.getID()); + + if (folderp->getParentUUID() != cat->getParentUUID()) + { + LL_WARNS() << "Inventory desync on folder creation. Newly created folder has wrong parent.\n" + << "Name: " << folderp->getName() + << " Id: " << folderp->getUUID() + << " Expected parent: " << cat->getParentUUID() + << " Actual parent: " << folderp->getParentUUID() + << LL_ENDL; + LLInventoryModel::LLCategoryUpdate update(cat->getParentUUID(), 1); + accountForUpdate(update); + } + // else: Do not update parent, parent is already aware of the change. See processBulkUpdateInventory + + cat->setVersion(LLViewerInventoryCategory::VERSION_INITIAL - 1); // accountForUpdate() will icrease version by 1 + cat->setDescendentCount(0); + updateCategory(cat); + } if (callback) { @@ -1018,42 +1061,30 @@ U32 LLInventoryModel::updateItem(const LLViewerInventoryItem* item, U32 mask) LLUUID new_parent_id = item->getParentUUID(); bool update_parent_on_server = false; - // Fix attachments falsely being moved to Lost&Found - //if (new_parent_id.isNull()) - //{ - // // item with null parent will end in random location and then in Lost&Found, - // // either move to default folder as if it is new item or don't move at all - // LL_WARNS(LOG_INV) << "Update attempts to reparent item " << item->getUUID() - // << " to null folder. Moving to Lost&Found. Old item name: " << old_item->getName() - // << ". New name: " << item->getName() - // << "." << LL_ENDL; - // new_parent_id = findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND); - // update_parent_on_server = true; - //} if (new_parent_id.isNull() && !LLApp::isExiting()) { - if (old_parent_id.isNull()) - { - // item with null parent will end in random location and then in Lost&Found, - // either move to default folder as if it is new item or don't move at all - LL_WARNS(LOG_INV) << "Update attempts to reparent item " << item->getUUID() - << " to null folder. Moving to Lost&Found. Old item name: " << old_item->getName() - << ". New name: " << item->getName() - << "." << LL_ENDL; - new_parent_id = findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND); - update_parent_on_server = true; - } - else - { - LL_WARNS(LOG_INV) << "Update attempts to reparent item " << item->getUUID() - << " to null folder. Old parent not null. Moving to old parent. Old item name: " << old_item->getName() - << ". New name: " << item->getName() - << "." << LL_ENDL; - new_parent_id = old_parent_id; - update_parent_on_server = true; - } + if (old_parent_id.isNull()) + { + // Item with null parent will end in random location and then in Lost&Found, + // either move to default folder as if it is new item or don't move at all + LL_WARNS(LOG_INV) << "Update attempts to reparent item " << item->getUUID() + << " to null folder. Moving to Lost&Found. Old item name: " << old_item->getName() + << ". New name: " << item->getName() + << "." << LL_ENDL; + new_parent_id = findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND); + update_parent_on_server = true; + } + else + { + // Probably not the best way to handle this, we might encounter real case of 'lost&found' at some point + LL_WARNS(LOG_INV) << "Update attempts to reparent item " << item->getUUID() + << " to null folder. Old parent not null. Moving to old parent. Old item name: " << old_item->getName() + << ". New name: " << item->getName() + << "." << LL_ENDL; + new_parent_id = old_parent_id; + update_parent_on_server = true; + } } - // if(old_parent_id != new_parent_id) { @@ -2877,29 +2908,37 @@ bool LLInventoryModel::loadFromFile(const std::string& filename, { if(filename.empty()) { - LL_ERRS(LOG_INV) << "Filename is Null!" << LL_ENDL; + LL_ERRS(LOG_INV) << "filename is Null!" << LL_ENDL; return false; } - LL_INFOS(LOG_INV) << "LLInventoryModel::loadFromFile(" << filename << ")" << LL_ENDL; - LLFILE* file = LLFile::fopen(filename, "rb"); /*Flawfinder: ignore*/ - if(!file) + LL_INFOS(LOG_INV) << "loading inventory from: (" << filename << ")" << LL_ENDL; + + llifstream file(filename.c_str()); + + if (!file.is_open()) { LL_INFOS(LOG_INV) << "unable to load inventory from: " << filename << LL_ENDL; return false; } - // *NOTE: This buffer size is hard coded into scanf() below. - char buffer[MAX_STRING]; /*Flawfinder: ignore*/ - char keyword[MAX_STRING]; /*Flawfinder: ignore*/ - char value[MAX_STRING]; /*Flawfinder: ignore*/ - is_cache_obsolete = true; // Obsolete until proven current - while(!feof(file) && fgets(buffer, MAX_STRING, file)) + + is_cache_obsolete = true; // Obsolete until proven current + + std::string line; + LLPointer parser = new LLSDNotationParser(); + while (std::getline(file, line)) { - sscanf(buffer, " %126s %126s", keyword, value); /* Flawfinder: ignore */ - if(0 == strcmp("inv_cache_version", keyword)) + LLSD s_item; + std::istringstream iss(line); + if (parser->parse(iss, s_item, line.length()) == LLSDParser::PARSE_FAILURE) { - S32 version; - int succ = sscanf(value,"%d",&version); - if ((1 == succ) && (version == sCurrentInvCacheVersion)) + LL_WARNS(LOG_INV)<< "Parsing inventory cache failed" << LL_ENDL; + break; + } + + if (s_item.has("inv_cache_version")) + { + S32 version = s_item["inv_cache_version"].asInteger(); + if (version == sCurrentInvCacheVersion) { // Cache is up to date is_cache_obsolete = false; @@ -2907,43 +2946,33 @@ bool LLInventoryModel::loadFromFile(const std::string& filename, } else { - // Cache is out of date + LL_WARNS(LOG_INV)<< "Inventory cache is out of date" << LL_ENDL; break; } } - else if(0 == strcmp("inv_category", keyword)) + else if (s_item.has("cat_id")) { if (is_cache_obsolete) break; - + LLPointer inv_cat = new LLViewerInventoryCategory(LLUUID::null); - if(inv_cat->importFileLocal(file)) + if(inv_cat->importLLSD(s_item)) { categories.push_back(inv_cat); } - else - { - LL_WARNS(LOG_INV) << "loadInventoryFromFile(). Ignoring invalid inventory category: " << inv_cat->getName() << LL_ENDL; - //delete inv_cat; // automatic when inv_cat is reassigned or destroyed - } } - else if(0 == strcmp("inv_item", keyword)) + else if (s_item.has("item_id")) { if (is_cache_obsolete) break; LLPointer inv_item = new LLViewerInventoryItem; - if( inv_item->importFileLocal(file) ) + if( inv_item->fromLLSD(s_item) ) { - // *FIX: Need a better solution, this prevents the - // application from freezing, but breaks inventory - // caching. if(inv_item->getUUID().isNull()) { - //delete inv_item; // automatic when inv_cat is reassigned or destroyed LL_WARNS(LOG_INV) << "Ignoring inventory with null item id: " - << inv_item->getName() << LL_ENDL; - + << inv_item->getName() << LL_ENDL; } else { @@ -2956,62 +2985,63 @@ bool LLInventoryModel::loadFromFile(const std::string& filename, items.push_back(inv_item); } } - } - else - { - LL_WARNS(LOG_INV) << "loadInventoryFromFile(). Ignoring invalid inventory item: " << inv_item->getName() << LL_ENDL; - //delete inv_item; // automatic when inv_cat is reassigned or destroyed - } - } - else - { - LL_WARNS(LOG_INV) << "Unknown token in inventory file '" << keyword << "'" - << LL_ENDL; + } } } - fclose(file); - if (is_cache_obsolete) - return false; - return true; + + file.close(); + + return !is_cache_obsolete; } // static bool LLInventoryModel::saveToFile(const std::string& filename, - const cat_array_t& categories, - const item_array_t& items) + const cat_array_t& categories, + const item_array_t& items) { - if(filename.empty()) + if (filename.empty()) { LL_ERRS(LOG_INV) << "Filename is Null!" << LL_ENDL; return false; } - LL_INFOS(LOG_INV) << "LLInventoryModel::saveToFile(" << filename << ")" << LL_ENDL; - LLFILE* file = LLFile::fopen(filename, "wb"); /*Flawfinder: ignore*/ - if(!file) + + LL_INFOS(LOG_INV) << "saving inventory to: (" << filename << ")" << LL_ENDL; + + llofstream fileXML(filename.c_str()); + if (!fileXML.is_open()) { LL_WARNS(LOG_INV) << "unable to save inventory to: " << filename << LL_ENDL; return false; } - fprintf(file, "\tinv_cache_version\t%d\n",sCurrentInvCacheVersion); + LLSD cache_ver; + cache_ver["inv_cache_version"] = sCurrentInvCacheVersion; + + fileXML << LLSDOStreamer(cache_ver) << std::endl; + S32 count = categories.size(); + S32 cat_count = 0; S32 i; for(i = 0; i < count; ++i) { LLViewerInventoryCategory* cat = categories[i]; if(cat->getVersion() != LLViewerInventoryCategory::VERSION_UNKNOWN) { - cat->exportFileLocal(file); + fileXML << LLSDOStreamer(cat->exportLLSD()) << std::endl; + cat_count++; } } - count = items.size(); - for(i = 0; i < count; ++i) + S32 it_count = items.size(); + for(i = 0; i < it_count; ++i) { - items[i]->exportFile(file); + fileXML << LLSDOStreamer(items[i]->asLLSD()) << std::endl; } - fclose(file); + fileXML.close(); + + LL_INFOS(LOG_INV) << "Inventory saved: " << cat_count << " categories, " << it_count << " items." << LL_ENDL; + return true; } diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index cce26eec8f..39f5743b11 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -153,7 +153,7 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) : mCompletionObserver(NULL), mScroller(NULL), mSortOrderSetting(p.sort_order_setting), - mInventory(p.inventory), + mInventory(p.inventory), //inventory("", &gInventory) mAcceptsDragAndDrop(p.accepts_drag_and_drop), mAllowMultiSelect(p.allow_multi_select), mAllowDrag(p.allow_drag), @@ -566,7 +566,18 @@ void LLInventoryPanel::itemChanged(const LLUUID& item_id, U32 mask, const LLInve view_item->destroyView(); removeItemID(idp); } - view_item = buildNewViews(item_id); + + LLInventoryObject const* objectp = mInventory->getObject(item_id); + if (objectp) + { + // providing NULL directly avoids unnessesary getItemByID calls + view_item = buildNewViews(item_id, objectp, NULL); + } + else + { + view_item = NULL; + } + viewmodel_item = static_cast(view_item ? view_item->getViewModelItem() : NULL); view_folder = dynamic_cast(view_item); @@ -609,7 +620,13 @@ void LLInventoryPanel::itemChanged(const LLUUID& item_id, U32 mask, const LLInve if (model_item && !view_item) { // Add the UI element for this item. - buildNewViews(item_id); + LLInventoryObject const* objectp = mInventory->getObject(item_id); + if (objectp) + { + // providing NULL directly avoids unnessesary getItemByID calls + buildNewViews(item_id, objectp, NULL); + } + // Select any newly created object that has the auto rename at top of folder root set. if(mFolderRoot.get()->getRoot()->needsAutoRename()) { @@ -924,7 +941,7 @@ LLFolderViewItem * LLInventoryPanel::createFolderViewItem(LLInvFVBridge * bridge LLFolderViewItem* LLInventoryPanel::buildNewViews(const LLUUID& id) { - LLInventoryObject const* objectp = gInventory.getObject(id); + LLInventoryObject const* objectp = mInventory->getObject(id); return buildNewViews(id, objectp); } @@ -934,11 +951,43 @@ LLFolderViewItem* LLInventoryPanel::buildNewViews(const LLUUID& id, LLInventoryO { return NULL; } - LLFolderViewItem* folder_view_item = getItemByID(id); + if (!typedViewsFilter(id, objectp)) + { + // if certain types are not allowed permanently, no reason to create views + return NULL; + } const LLUUID &parent_id = objectp->getParentUUID(); - LLFolderViewFolder* parent_folder = (LLFolderViewFolder*)getItemByID(parent_id); - + LLFolderViewItem* folder_view_item = getItemByID(id); + LLFolderViewFolder* parent_folder = (LLFolderViewFolder*)getItemByID(parent_id); + + return buildViewsTree(id, parent_id, objectp, folder_view_item, parent_folder); +} + +LLFolderViewItem* LLInventoryPanel::buildNewViews(const LLUUID& id, LLInventoryObject const* objectp, LLFolderViewItem *folder_view_item) +{ + if (!objectp) + { + return NULL; + } + if (!typedViewsFilter(id, objectp)) + { + // if certain types are not allowed permanently, no reason to create views + return NULL; + } + + const LLUUID &parent_id = objectp->getParentUUID(); + LLFolderViewFolder* parent_folder = (LLFolderViewFolder*)getItemByID(parent_id); + + return buildViewsTree(id, parent_id, objectp, folder_view_item, parent_folder); +} + +LLFolderViewItem* LLInventoryPanel::buildViewsTree(const LLUUID& id, + const LLUUID& parent_id, + LLInventoryObject const* objectp, + LLFolderViewItem *folder_view_item, + LLFolderViewFolder *parent_folder) +{ // Force the creation of an extra root level folder item if required by the inventory panel (default is "false") bool allow_drop = true; bool create_root = false; @@ -959,7 +1008,7 @@ LLFolderViewItem* LLInventoryPanel::buildNewViews(const LLUUID& id, LLInventoryO { if (objectp->getType() <= LLAssetType::AT_NONE) { - LL_WARNS() << "LLInventoryPanel::buildNewViews called with invalid objectp->mType : " + LL_WARNS() << "LLInventoryPanel::buildViewsTree called with invalid objectp->mType : " << ((S32)objectp->getType()) << " name " << objectp->getName() << " UUID " << objectp->getUUID() << LL_ENDL; return NULL; @@ -968,7 +1017,7 @@ LLFolderViewItem* LLInventoryPanel::buildNewViews(const LLUUID& id, LLInventoryO if (objectp->getType() >= LLAssetType::AT_COUNT) { // Example: Happens when we add assets of new, not yet supported type to library - LL_DEBUGS() << "LLInventoryPanel::buildNewViews called with unknown objectp->mType : " + LL_DEBUGS() << "LLInventoryPanel::buildViewsTree called with unknown objectp->mType : " << ((S32) objectp->getType()) << " name " << objectp->getName() << " UUID " << objectp->getUUID() << LL_ENDL; @@ -1045,26 +1094,52 @@ LLFolderViewItem* LLInventoryPanel::buildNewViews(const LLUUID& id, LLInventoryO LLViewerInventoryCategory::cat_array_t* categories; LLViewerInventoryItem::item_array_t* items; mInventory->lockDirectDescendentArrays(id, categories, items); - + + LLFolderViewFolder *parentp = dynamic_cast(folder_view_item); + if(categories) - { + { + bool has_folders = parentp->getFoldersCount() > 0; for (LLViewerInventoryCategory::cat_array_t::const_iterator cat_iter = categories->begin(); cat_iter != categories->end(); ++cat_iter) { const LLViewerInventoryCategory* cat = (*cat_iter); - buildNewViews(cat->getUUID()); + if (typedViewsFilter(cat->getUUID(), cat)) + { + if (has_folders) + { + // This can be optimized: we don't need to call getItemByID() + // each time, especially since content is growing, we can just + // iter over copy of mItemMap in some way + LLFolderViewItem* view_itemp = getItemByID(cat->getUUID()); + buildViewsTree(cat->getUUID(), id, cat, view_itemp, parentp); + } + else + { + buildViewsTree(cat->getUUID(), id, cat, NULL, parentp); + } + } } } if(items) - { + { for (LLViewerInventoryItem::item_array_t::const_iterator item_iter = items->begin(); item_iter != items->end(); ++item_iter) { const LLViewerInventoryItem* item = (*item_iter); - buildNewViews(item->getUUID()); + if (typedViewsFilter(item->getUUID(), item)) + { + + // This can be optimized: we don't need to call getItemByID() + // each time, especially since content is growing, we can just + // iter over copy of mItemMap in some way + LLFolderViewItem* view_itemp = getItemByID(item->getUUID()); + buildViewsTree(item->getUUID(), id, item, view_itemp, parentp); + } + } } mInventory->unlockDirectDescendentArrays(id); @@ -2000,21 +2075,20 @@ BOOL LLAssetFilteredInventoryPanel::handleDragAndDrop(S32 x, S32 y, MASK mask, B return result; } -LLFolderViewItem* LLAssetFilteredInventoryPanel::buildNewViews(const LLUUID& id) +/*virtual*/ +bool LLAssetFilteredInventoryPanel::typedViewsFilter(const LLUUID& id, LLInventoryObject const* objectp) { - LLInventoryObject const* objectp = gInventory.getObject(id); - if (!objectp) { - return NULL; + return false; } if (objectp->getType() != mAssetType && objectp->getType() != LLAssetType::AT_CATEGORY) { - return NULL; + return false; } - return LLInventoryPanel::buildNewViews(id, objectp); + return true; } void LLAssetFilteredInventoryPanel::itemChanged(const LLUUID& id, U32 mask, const LLInventoryObject* model_item) diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 631749e069..625de2f4ed 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -335,8 +335,15 @@ protected: static LLUIColor sLibraryColor; static LLUIColor sLinkColor; - virtual LLFolderViewItem* buildNewViews(const LLUUID& id); - LLFolderViewItem* buildNewViews(const LLUUID& id, LLInventoryObject const* objectp); + LLFolderViewItem* buildNewViews(const LLUUID& id); + LLFolderViewItem* buildNewViews(const LLUUID& id, + LLInventoryObject const* objectp); + LLFolderViewItem* buildNewViews(const LLUUID& id, + LLInventoryObject const* objectp, + LLFolderViewItem *target_view); + // if certain types are not allowed, no reason to create views + virtual bool typedViewsFilter(const LLUUID& id, LLInventoryObject const* objectp) { return true; } + virtual void itemChanged(const LLUUID& item_id, U32 mask, const LLInventoryObject* model_item); BOOL getIsHiddenFolderType(LLFolderType::EType folder_type) const; @@ -344,10 +351,39 @@ protected: virtual LLFolderViewFolder* createFolderViewFolder(LLInvFVBridge * bridge, bool allow_drop); virtual LLFolderViewItem* createFolderViewItem(LLInvFVBridge * bridge); private: + // buildViewsTree does not include some checks and is meant + // for recursive use, use buildNewViews() for first call + LLFolderViewItem* buildViewsTree(const LLUUID& id, + const LLUUID& parent_id, + LLInventoryObject const* objectp, + LLFolderViewItem *target_view, + LLFolderViewFolder *parent_folder_view); + bool mBuildDefaultHierarchy; // default inventory hierarchy should be created in postBuild() bool mViewsInitialized; // Views have been generated }; + +class LLInventoryFavoriteItemsPanel : public LLInventoryPanel +{ +public: + struct Params : public LLInitParam::Block + {}; + + void initFromParams(const Params& p); + bool isSelectionRemovable() { return false; } + void setSelectCallback(const boost::function& items, BOOL user_action)>& cb); + +protected: + LLInventoryFavoriteItemsPanel(const Params& params); + ~LLInventoryFavoriteItemsPanel() { mFolderChangedSignal.disconnect(); } + void updateFavoritesRootFolder(); + + boost::signals2::connection mFolderChangedSignal; + boost::function& items, BOOL user_action)> mSelectionCallback; + friend class LLUICtrlFactory; +}; + /************************************************************************/ /* Asset Pre-Filtered Inventory Panel related class */ /* Exchanges filter's flexibility for speed of generation and */ @@ -379,7 +415,7 @@ public: std::string& tooltip_msg) override; protected: - /*virtual*/ LLFolderViewItem* buildNewViews(const LLUUID& id) override; + /*virtual*/ bool typedViewsFilter(const LLUUID& id, LLInventoryObject const* objectp) override; /*virtual*/ void itemChanged(const LLUUID& item_id, U32 mask, const LLInventoryObject* model_item) override; private: diff --git a/indra/newview/lljoystickbutton.cpp b/indra/newview/lljoystickbutton.cpp index e4cef236bd..cacd63624a 100644 --- a/indra/newview/lljoystickbutton.cpp +++ b/indra/newview/lljoystickbutton.cpp @@ -55,7 +55,7 @@ static LLDefaultChildRegistry::Register r6("joystick_quat" const F32 NUDGE_TIME = 0.25f; // in seconds const F32 ORBIT_NUDGE_RATE = 0.05f; // fraction of normal speed -const S32 CENTER_DOT_RADIUS = 7; +//const S32 CENTER_DOT_RADIUS = 7; // FIRE-30414 Camera control arrows not clickable // // Public Methods @@ -145,20 +145,35 @@ bool LLJoystick::pointInCircle(S32 x, S32 y) const return in_circle; } -bool LLJoystick::pointInCenterDot(S32 x, S32 y, S32 radius) const +// FIRE-30414 Camera control arrows not clickable +// bool LLJoystick::pointInCenterDot(S32 x, S32 y, S32 radius) const +// { +// if (this->getLocalRect().getHeight() != this->getLocalRect().getWidth()) +// { +// LL_WARNS() << "Joystick shape is not square" << LL_ENDL; +// return true; +// } + +// S32 center = this->getLocalRect().getHeight() / 2; + +// bool in_center_circle = (x - center) * (x - center) + (y - center) * (y - center) <= radius * radius; + +// return in_center_circle; +// } +bool LLJoystick::pointInCenterDot(S32 x, S32 y) const { - if (this->getLocalRect().getHeight() != this->getLocalRect().getWidth()) - { - LL_WARNS() << "Joystick shape is not square" << LL_ENDL; - return true; - } + constexpr auto center_dot_scale{0.15};// based on current images. + S32 center_dot_x_rad = this->getLocalRect().getWidth()/2*center_dot_scale; + S32 center_dot_y_rad = this->getLocalRect().getHeight()/2*center_dot_scale; + auto a{this->getLocalRect().getCenterX()}; + auto b{this->getLocalRect().getCenterY()}; + // point inside ellipse if result 1 or less. + auto result = ((((x - a)*(x - a)) / (center_dot_x_rad*center_dot_x_rad)) + +(((y - b)*(y - b)) / (center_dot_y_rad*center_dot_y_rad))); - S32 center = this->getLocalRect().getHeight() / 2; - - bool in_center_circle = (x - center) * (x - center) + (y - center) * (y - center) <= radius * radius; - - return in_center_circle; + return result<=1?true:false; } +// BOOL LLJoystick::handleMouseDown(S32 x, S32 y, MASK mask) { @@ -455,8 +470,10 @@ BOOL LLJoystickCameraRotate::handleMouseDown(S32 x, S32 y, MASK mask) S32 dx = x - horiz_center; S32 dy = y - vert_center; - - if (pointInCenterDot(x, y, CENTER_DOT_RADIUS)) + // FIRE-30414 + // if (pointInCenterDot(x, y, CENTER_DOT_RADIUS)) + if (pointInCenterDot(x, y)) + // { mInitialOffset.mX = 0; mInitialOffset.mY = 0; @@ -506,7 +523,10 @@ BOOL LLJoystickCameraRotate::handleMouseUp(S32 x, S32 y, MASK mask) BOOL LLJoystickCameraRotate::handleHover(S32 x, S32 y, MASK mask) { - if (!pointInCenterDot(x, y, CENTER_DOT_RADIUS)) + // FIRE-30414 + // if (!pointInCenterDot(x, y, CENTER_DOT_RADIUS)) + if (!pointInCenterDot(x, y)) + // { mInCenter = FALSE; } diff --git a/indra/newview/lljoystickbutton.h b/indra/newview/lljoystickbutton.h index b7fdf63e58..0647cba0e4 100644 --- a/indra/newview/lljoystickbutton.h +++ b/indra/newview/lljoystickbutton.h @@ -81,8 +81,10 @@ public: * circle. Make sure to change method according to shape other than square. */ bool pointInCircle(S32 x, S32 y) const; - bool pointInCenterDot(S32 x, S32 y, S32 radius) const; - + // FIRE-30414 Camera control arrows not clickable + // bool pointInCenterDot(S32 x, S32 y, S32 radius) const; + bool pointInCenterDot(S32 x, S32 y) const; + // static std::string nameFromQuadrant(const EJoystickQuadrant quadrant); static EJoystickQuadrant quadrantFromName(const std::string& name); static EJoystickQuadrant selectQuadrant(LLXMLNodePtr node); diff --git a/indra/newview/lllandmarklist.cpp b/indra/newview/lllandmarklist.cpp index d0bb736735..0a05ce6ab8 100644 --- a/indra/newview/lllandmarklist.cpp +++ b/indra/newview/lllandmarklist.cpp @@ -40,8 +40,8 @@ LLLandmarkList gLandmarkList; // number is mostly arbitrary, but it should be below DEFAULT_QUEUE_SIZE pool size, -// which is 4096, to not overfill the pool if user has more than 4K of landmarks, -// and low number helps with not flooding server with requests +// which is 4096, to not overfill the pool if user has more than 4K of landmarks +// and it should leave some space for other potential simultaneous asset request const S32 MAX_SIMULTANEOUS_REQUESTS = 512; @@ -98,7 +98,11 @@ LLLandmark* LLLandmarkList::getAsset(const LLUUID& asset_uuid, loaded_callback_t if (mRequestedList.size() > MAX_SIMULTANEOUS_REQUESTS) { - // Postpone download till queu is emptier + // Workarounds for corutines pending list size limit: + // Postpone download till queue is emptier. + // Coroutines have own built in 'pending' list, but unfortunately + // it is too small compared to potential amount of landmarks + // or assets. mWaitList.insert(asset_uuid); return NULL; } @@ -179,17 +183,27 @@ void LLLandmarkList::processGetAssetReply( // todo: this should clean mLoadedCallbackMap! } - if (!gLandmarkList.mWaitList.empty()) + // getAssetData can fire callback immediately, causing + // a recursion which is suboptimal for very large wait list. + // 'scheduling' indicates that we are inside request and + // shouldn't be launching more requests. + static bool scheduling = false; + if (!scheduling && !gLandmarkList.mWaitList.empty()) { - // start new download from wait list - landmark_uuid_list_t::iterator iter = gLandmarkList.mWaitList.begin(); - LLUUID asset_uuid = *iter; - gLandmarkList.mWaitList.erase(iter); - gAssetStorage->getAssetData(asset_uuid, - LLAssetType::AT_LANDMARK, - LLLandmarkList::processGetAssetReply, - NULL); - gLandmarkList.mRequestedList[asset_uuid] = gFrameTimeSeconds; + scheduling = true; + while (!gLandmarkList.mWaitList.empty() && gLandmarkList.mRequestedList.size() < MAX_SIMULTANEOUS_REQUESTS) + { + // start new download from wait list + landmark_uuid_list_t::iterator iter = gLandmarkList.mWaitList.begin(); + LLUUID asset_uuid = *iter; + gLandmarkList.mWaitList.erase(iter); + gAssetStorage->getAssetData(asset_uuid, + LLAssetType::AT_LANDMARK, + LLLandmarkList::processGetAssetReply, + NULL); + gLandmarkList.mRequestedList[asset_uuid] = gFrameTimeSeconds; + } + scheduling = false; } } diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index 660f628701..6a23d9acf1 100644 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -147,6 +147,16 @@ void append_to_last_message(std::list& messages, const std::string& line) messages.back()[LL_IM_TEXT] = im_text; } +std::string remove_utf8_bom(const char* buf) +{ + std::string res(buf); + if (res[0] == (char)0xEF && res[1] == (char)0xBB && res[2] == (char)0xBF) + { + res.erase(0, 3); + } + return res; +} + class LLLogChatTimeScanner: public LLSingleton { LLSINGLETON(LLLogChatTimeScanner); @@ -504,18 +514,7 @@ void LLLogChat::loadChatHistory(const std::string& file_name, std::list& m continue; } - std::string line(buffer); - - // FIRE-28990: Unable to open chat transcript if file is UTF-8-BOM encoded - // Technically it doesn't make sense to do it each iteration and ideally we - // would do it once before the loop starts, but seeking backwards to the start of - // the file causes the viewer's process being locked up for several seconds - // during login, we just do it here to skip seeking backwards. - if (line.length() > 3 && line[0] == char(239) && line[1] == char(187) && line[2] == char(191)) - { - line = line.substr(3); - } - // + std::string line(remove_utf8_bom(buffer)); //updated 1.23 plain text log format requires a space added before subsequent lines in a multilined message if (' ' == line[0]) @@ -919,19 +918,11 @@ bool LLLogChat::isTranscriptFileFound(std::string fullname) if (bytes_to_read > 0 && NULL != fgets(buffer, bytes_to_read, filep)) { - // FIRE-28990: Unable to open chat transcript if file is UTF-8-BOM encoded - std::string bufferstr(buffer); - if (bufferstr.length() > 3 && bufferstr[0] == char(239) && bufferstr[1] == char(187) && bufferstr[2] == char(191)) - { - bufferstr = bufferstr.substr(3); - } - // - //matching a timestamp boost::match_results matches; // Seconds in timestamp - //if (boost::regex_match(std::string(buffer), matches, TIMESTAMP)) - if (boost::regex_match(bufferstr, matches, TIMESTAMP) || boost::regex_match(bufferstr, matches, TIMESTAMP_AND_SEC)) + //if (boost::regex_match(remove_utf8_bom(buffer), matches, TIMESTAMP)) + if (boost::regex_match(remove_utf8_bom(buffer), matches, TIMESTAMP) || boost::regex_match(remove_utf8_bom(buffer), matches, TIMESTAMP_AND_SEC)) // { result = true; @@ -1295,19 +1286,7 @@ void LLLoadHistoryThread::loadHistory(const std::string& file_name, std::list FIRE-28990: Unable to open chat transcript if file is UTF-8-BOM encoded - // Technically it doesn't make sense to do it each iteration and ideally we - // would do it once before the loop starts, but since this code was duplicated - // from further above and in the other case seeking backwards to the start of - // the file causes the viewer's process being locked up for several seconds - // during login, we just do it here the same way we do above. - if (line.length() > 3 && line[0] == char(239) && line[1] == char(187) && line[2] == char(191)) - { - line = line.substr(3); - } - // + std::string line(remove_utf8_bom(buffer)); //updated 1.23 plaint text log format requires a space added before subsequent lines in a multilined message if (' ' == line[0]) diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 3929e54a1e..f674a89971 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -100,7 +100,7 @@ // locking actions. In particular, the following operations // on LLMeshRepository are very averse to any stalls: // * loadMesh -// * getMeshHeader (For structural details, see: +// * search in mMeshHeader (For structural details, see: // http://wiki.secondlife.com/wiki/Mesh/Mesh_Asset_Format) // * notifyLoadedMeshes // * getSkinInfo @@ -2012,6 +2012,12 @@ EMeshProcessingResult LLMeshRepoThread::lodReceived(const LLVolumeParams& mesh_p { LLMutexLock lock(mMutex); mLoadedQ.push(mesh); + // LLPointer is not thread safe, since we added this pointer into + // threaded list, make sure counter gets decreased inside mutex lock + // and won't affect mLoadedQ processing + volume = NULL; + // might be good idea to turn mesh into pointer to avoid making a copy + mesh.mVolume = NULL; } return MESH_OK; } @@ -2964,12 +2970,12 @@ void LLMeshRepoThread::notifyLoadedMeshes() mMutex->unlock(); break; } - LoadedMesh mesh = mLoadedQ.front(); + LoadedMesh mesh = mLoadedQ.front(); // make sure nothing else owns volume pointer by this point mLoadedQ.pop(); mMutex->unlock(); update_metrics = true; - if (mesh.mVolume && mesh.mVolume->getNumVolumeFaces() > 0) + if (mesh.mVolume->getNumVolumeFaces() > 0) { gMeshRepo.notifyMeshLoaded(mesh.mMeshParams, mesh.mVolume); } @@ -3317,7 +3323,6 @@ void LLMeshHeaderHandler::processData(LLCore::BufferArray * /* body */, S32 /* b header_bytes = (S32)gMeshRepo.mThread->mMeshHeaderSize[mesh_id]; header = iter->second; } - gMeshRepo.mThread->mHeaderMutex->unlock(); if (header_bytes > 0 && !header.has("404") @@ -3338,7 +3343,10 @@ void LLMeshHeaderHandler::processData(LLCore::BufferArray * /* body */, S32 /* b lod_bytes = llmax(lod_bytes, header["skin"]["offset"].asInteger() + header["skin"]["size"].asInteger()); lod_bytes = llmax(lod_bytes, header["physics_convex"]["offset"].asInteger() + header["physics_convex"]["size"].asInteger()); - S32 header_bytes = (S32) gMeshRepo.mThread->mMeshHeaderSize[mesh_id]; + // Do not unlock mutex untill we are done with LLSD. + // LLSD is smart and can work like smart pointer, is not thread safe. + gMeshRepo.mThread->mHeaderMutex->unlock(); + S32 bytes = lod_bytes + header_bytes; @@ -3374,6 +3382,8 @@ void LLMeshHeaderHandler::processData(LLCore::BufferArray * /* body */, S32 /* b { LL_WARNS(LOG_MESH) << "Trying to cache nonexistent mesh, mesh id: " << mesh_id << LL_ENDL; + gMeshRepo.mThread->mHeaderMutex->unlock(); + // headerReceived() parsed header, but header's data is invalid so none of the LODs will be available LLMutexLock lock(gMeshRepo.mThread->mMutex); for (int i(0); i < 4; ++i) @@ -4314,44 +4324,74 @@ void LLMeshRepository::buildHull(const LLVolumeParams& params, S32 detail) bool LLMeshRepository::hasPhysicsShape(const LLUUID& mesh_id) { - LLSD mesh = mThread->getMeshHeader(mesh_id); - if (mesh.has("physics_mesh") && mesh["physics_mesh"].has("size") && (mesh["physics_mesh"]["size"].asInteger() > 0)) - { - return true; - } + if (mesh_id.isNull()) + { + return false; + } - LLModel::Decomposition* decomp = getDecomposition(mesh_id); - if (decomp && !decomp->mHull.empty()) - { - return true; - } + if (mThread->hasPhysicsShapeInHeader(mesh_id)) + { + return true; + } - return false; + LLModel::Decomposition* decomp = getDecomposition(mesh_id); + if (decomp && !decomp->mHull.empty()) + { + return true; + } + + return false; } -LLSD& LLMeshRepository::getMeshHeader(const LLUUID& mesh_id) +bool LLMeshRepoThread::hasPhysicsShapeInHeader(const LLUUID& mesh_id) { - LL_RECORD_BLOCK_TIME(FTM_MESH_FETCH); + LLMutexLock lock(mHeaderMutex); + if (mMeshHeaderSize[mesh_id] > 0) + { + mesh_header_map::iterator iter = mMeshHeader.find(mesh_id); + if (iter != mMeshHeader.end()) + { + LLSD &mesh = iter->second; + if (mesh.has("physics_mesh") && mesh["physics_mesh"].has("size") && (mesh["physics_mesh"]["size"].asInteger() > 0)) + { + return true; + } + } + } - return mThread->getMeshHeader(mesh_id); + return false; } -LLSD& LLMeshRepoThread::getMeshHeader(const LLUUID& mesh_id) +// DAE export +LLUUID LLMeshRepository::getCreatorFromHeader(const LLUUID& mesh_id) { - static LLSD dummy_ret; - if (mesh_id.notNull()) + if (mesh_id.isNull()) + { + return LLUUID(); + } + + return mThread->getCreatorFromHeader(mesh_id); +} + +LLUUID LLMeshRepoThread::getCreatorFromHeader(const LLUUID& mesh_id) +{ + LLMutexLock lock(mHeaderMutex); + if (mMeshHeaderSize[mesh_id] > 0) { - LLMutexLock lock(mHeaderMutex); mesh_header_map::iterator iter = mMeshHeader.find(mesh_id); - if (iter != mMeshHeader.end() && mMeshHeaderSize[mesh_id] > 0) + if (iter != mMeshHeader.end()) { - return iter->second; + LLSD& mesh = iter->second; + if (mesh.has("creator") && mesh["creator"].isUUID()) + { + return mesh["creator"].asUUID(); + } } } - return dummy_ret; + return LLUUID(); } - +// void LLMeshRepository::uploadModel(std::vector& data, LLVector3& scale, bool upload_textures, bool upload_skin, bool upload_joints, bool lock_scale_if_joint_position, diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index c18dee60ed..038bfabdc1 100644 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -351,7 +351,7 @@ public: bool skinInfoReceived(const LLUUID& mesh_id, U8* data, S32 data_size); bool decompositionReceived(const LLUUID& mesh_id, U8* data, S32 data_size); EMeshProcessingResult physicsShapeReceived(const LLUUID& mesh_id, U8* data, S32 data_size); - LLSD& getMeshHeader(const LLUUID& mesh_id); + bool hasPhysicsShapeInHeader(const LLUUID& mesh_id); void notifyLoadedMeshes(); S32 getActualMeshLOD(const LLVolumeParams& mesh_params, S32 lod); @@ -392,6 +392,9 @@ public: void constructUrl(LLUUID mesh_id, std::string * url, int * legacy_version); // [UDP Assets] + // DAE export + LLUUID getCreatorFromHeader(const LLUUID& mesh_id); + private: // Issue a GET request to a URL with 'Range' header using // the correct policy class and other attributes. If an invalid @@ -616,9 +619,6 @@ public: bool meshUploadEnabled(); bool meshRezEnabled(); - - - LLSD& getMeshHeader(const LLUUID& mesh_id); void uploadModel(std::vector& data, LLVector3& scale, bool upload_textures, bool upload_skin, bool upload_joints, bool lock_scale_if_joint_position, @@ -637,6 +637,9 @@ public: typedef std::map > mesh_load_map; mesh_load_map mLoadingMeshes[4]; + // DAE export + LLUUID getCreatorFromHeader(const LLUUID& mesh_id); + // Faster lookup //typedef std::map skin_map; typedef boost::unordered_map skin_map; diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp index 8f63a0ada1..293876692c 100644 --- a/indra/newview/llmodelpreview.cpp +++ b/indra/newview/llmodelpreview.cpp @@ -73,23 +73,23 @@ // bool LLModelPreview::sIgnoreLoadedCallback = false; - -// Extra configurability, to be exposed later in xml (LLModelPreview probably -// should become UI control at some point or get split into preview control) -static const LLColor4 PREVIEW_CANVAS_COL(0.169f, 0.169f, 0.169f, 1.f); -static const LLColor4 PREVIEW_EDGE_COL(0.4f, 0.4f, 0.4f, 1.0); -static const LLColor4 PREVIEW_BASE_COL(1.f, 1.f, 1.f, 1.f); -static const LLColor3 PREVIEW_BRIGHTNESS(0.9f, 0.9f, 0.9f); -static const F32 PREVIEW_EDGE_WIDTH(1.f); -static const LLColor4 PREVIEW_PSYH_EDGE_COL(0.f, 0.25f, 0.5f, 0.25f); -static const LLColor4 PREVIEW_PSYH_FILL_COL(0.f, 0.5f, 1.0f, 0.5f); -static const F32 PREVIEW_PSYH_EDGE_WIDTH(1.f); -static const LLColor4 PREVIEW_DEG_EDGE_COL(1.f, 0.f, 0.f, 1.f); -static const LLColor4 PREVIEW_DEG_FILL_COL(1.f, 0.f, 0.f, 0.5f); -static const F32 PREVIEW_DEG_EDGE_WIDTH(3.f); -static const F32 PREVIEW_DEG_POINT_SIZE(8.f); -static const F32 PREVIEW_ZOOM_LIMIT(10.f); - +// fix up and restore stuff removed by lab +// // Extra configurability, to be exposed later in xml (LLModelPreview probably +// // should become UI control at some point or get split into preview control) +// static const LLColor4 PREVIEW_CANVAS_COL(0.169f, 0.169f, 0.169f, 1.f); +// static const LLColor4 PREVIEW_EDGE_COL(0.4f, 0.4f, 0.4f, 1.0); +// static const LLColor4 PREVIEW_BASE_COL(1.f, 1.f, 1.f, 1.f); +// static const LLColor3 PREVIEW_BRIGHTNESS(0.9f, 0.9f, 0.9f); +// static const F32 PREVIEW_EDGE_WIDTH(1.f); +// static const LLColor4 PREVIEW_PSYH_EDGE_COL(0.f, 0.25f, 0.5f, 0.25f); +// static const LLColor4 PREVIEW_PSYH_FILL_COL(0.f, 0.5f, 1.0f, 0.5f); +// static const F32 PREVIEW_PSYH_EDGE_WIDTH(1.f); +// static const LLColor4 PREVIEW_DEG_EDGE_COL(1.f, 0.f, 0.f, 1.f); +// static const LLColor4 PREVIEW_DEG_FILL_COL(1.f, 0.f, 0.f, 0.5f); +// static const F32 PREVIEW_DEG_EDGE_WIDTH(3.f); +// static const F32 PREVIEW_DEG_POINT_SIZE(8.f); +// static const F32 PREVIEW_ZOOM_LIMIT(10.f); +// const F32 SKIN_WEIGHT_CAMERA_DISTANCE = 16.f; BOOL stop_gloderror() @@ -225,8 +225,6 @@ LLModelPreview::LLModelPreview(S32 width, S32 height, LLFloater* fmp) } mViewOption["show_textures"] = false; - mViewOption["verbose_logging"] = mImporterDebug;// initialise verbose logging from debug - fmp->childSetValue("verbose_logging", LLSD(mImporterDebug)); mFMP = fmp; mHasPivot = false; @@ -468,7 +466,7 @@ void LLModelPreview::rebuildUploadData() if (mImporterDebug) { std::ostringstream out; - out << "Search of" << name_to_match; + out << "Search of " << name_to_match; out << " in LOD" << i; out << " list failed. Searching for alternative among LOD lists."; LL_INFOS() << out.str() << LL_ENDL; @@ -538,7 +536,7 @@ void LLModelPreview::rebuildUploadData() else if (mImporterDebug) { std::ostringstream out; - out << "List of models does not include index " << idx; + out << "LOD" << i << ": List of models does not include index " << idx << " scene is missing a LOD model"; LL_INFOS() << out.str() << LL_ENDL; LLFloaterModelPreview::addStringToLog(out, false); } @@ -573,7 +571,7 @@ void LLModelPreview::rebuildUploadData() if (mImporterDebug) { std::ostringstream out; - out << "List of models does not include " << instance.mLabel; + out << "LOD" << i << ": List of models does not include " << instance.mLabel; LL_INFOS() << out.str() << LL_ENDL; LLFloaterModelPreview::addStringToLog(out, false); } @@ -2110,7 +2108,7 @@ void LLModelPreview::updateStatusMessages() // Better error handling if (num_hulls > 256) // decomp cannot have more than 256 hulls (http://wiki.secondlife.com/wiki/Mesh/Mesh_physics) { - // improve uplaoder error reporting + // improve uploader error reporting // LL_INFOS() << "Physical model " << mdl->mLabel << " exceeds 256 hull limitation." << LL_ENDL; std::ostringstream out; out << "Physical model " << mdl->mLabel << " exceeds 256 hull limitation."; @@ -2194,7 +2192,7 @@ void LLModelPreview::updateStatusMessages() if (getLoadState() >= LLModelLoader::ERROR_PARSING) { mModelNoErrors = false; - // improve uplaoder error reporting + // improve uploader error reporting // LL_INFOS() << "Loader returned errors, model can't be uploaded" << LL_ENDL; std::ostringstream out; out << "Loader returned errors, model can't be uploaded"; @@ -2212,7 +2210,7 @@ void LLModelPreview::updateStatusMessages() if (uploadingJointPositions && !isRigValidForJointPositionUpload()) { mModelNoErrors = false; - // improve uplaoder error reporting + // improve uploader error reporting // LL_INFOS() << "Invalid rig, there might be issues with uploading Joint positions" << LL_ENDL; std::ostringstream out; out << "Invalid rig, there might be issues with uploading Joint positions"; @@ -2332,7 +2330,7 @@ void LLModelPreview::updateStatusMessages() // fmp->childSetValue("show_physics", false); //} - // mViewOption["show_physics"] = true; // merge LL uplaoder changes + // mViewOption["show_physics"] = true; // merge LL uploader changes if (phys_hulls > 0) { fmp->enableViewOption("physics_explode"); @@ -2788,7 +2786,7 @@ void LLModelPreview::createPreviewAvatar(void) } else { - // improve uplaoder error reporting + // improve uploader error reporting // LL_INFOS() << "Failed to create preview avatar for upload model window" << LL_ENDL; std::ostringstream out; out << "Failed to create preview avatar for upload model window"; @@ -2974,13 +2972,6 @@ BOOL LLModelPreview::render() assert_main_thread(); LLMutexLock lock(this); - // enable the import debug importer debug control - if(mNeedsUpdate) - { - bool verbose_logging = mViewOption["verbose_logging"]; - gSavedSettings.setBOOL("ImporterDebug",verbose_logging); - } - // mNeedsUpdate = FALSE; bool use_shaders = LLGLSLShader::sNoFixedFunction; @@ -2993,6 +2984,22 @@ BOOL LLModelPreview::render() bool physics = mViewOption["show_physics"]; bool uv_guide = mViewOption["show_uv_guide"]; // Add UV guide overlay in mesh preview + // restore things lost by the lab during importer work + // Extra configurability, to be exposed later as controls? + static LLCachedControl canvas_col(gSavedSettings, "MeshPreviewCanvasColor"); + static LLCachedControl edge_col(gSavedSettings, "MeshPreviewEdgeColor"); + static LLCachedControl base_col(gSavedSettings, "MeshPreviewBaseColor"); + static LLCachedControl brightness(gSavedSettings, "MeshPreviewBrightnessColor"); + static LLCachedControl edge_width(gSavedSettings, "MeshPreviewEdgeWidth"); + static LLCachedControl phys_edge_col(gSavedSettings, "MeshPreviewPhysicsEdgeColor"); + static LLCachedControl phys_fill_col(gSavedSettings, "MeshPreviewPhysicsFillColor"); + static LLCachedControl phys_edge_width(gSavedSettings, "MeshPreviewPhysicsEdgeWidth"); + static LLCachedControl deg_edge_col(gSavedSettings, "MeshPreviewDegenerateEdgeColor"); + static LLCachedControl deg_fill_col(gSavedSettings, "MeshPreviewDegenerateFillColor"); + static LLCachedControl deg_edge_width(gSavedSettings, "MeshPreviewDegenerateEdgeWidth"); + static LLCachedControl deg_point_size(gSavedSettings, "MeshPreviewDegeneratePointSize"); + // + S32 width = getWidth(); S32 height = getHeight(); @@ -3017,7 +3024,7 @@ BOOL LLModelPreview::render() gGL.pushMatrix(); gGL.loadIdentity(); - gGL.color4fv(PREVIEW_CANVAS_COL.mV); + gGL.color4fv(canvas_col().mV); // restore changes removed by the lab gl_rect_2d_simple(width, height); gGL.matrixMode(LLRender::MM_PROJECTION); @@ -3207,7 +3214,7 @@ BOOL LLModelPreview::render() stop_glerror(); gGL.pushMatrix(); - gGL.color4fv(PREVIEW_EDGE_COL.mV); + gGL.color4fv(edge_col().mV); // restore changes removed by the lab const U32 type_mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD0; @@ -3300,25 +3307,25 @@ BOOL LLModelPreview::render() gGL.getTexUnit(0)->bind(mUVGuideTexture, true); } } - gGL.diffuseColor4fv(PREVIEW_BASE_COL.mV); + gGL.diffuseColor4fv(base_col().mV); // restore changes removed by the lab } // else { - gGL.diffuseColor4fv(PREVIEW_BASE_COL.mV); + gGL.diffuseColor4fv(base_col().mV); // restore changes removed by the lab } buffer->drawRange(LLRender::TRIANGLES, 0, buffer->getNumVerts() - 1, buffer->getNumIndices(), 0); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - gGL.diffuseColor4fv(PREVIEW_EDGE_COL.mV); + gGL.diffuseColor4fv(edge_col().mV); // restore changes removed by the lab if (edges) { - glLineWidth(PREVIEW_EDGE_WIDTH); + gGL.setLineWidth(edge_width()); // restore changes removed by the lab glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); buffer->drawRange(LLRender::TRIANGLES, 0, buffer->getNumVerts() - 1, buffer->getNumIndices(), 0); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - glLineWidth(1.f); + gGL.setLineWidth(1.f); // Line width OGL core profile fix by Rye Mutt } } gGL.popMatrix(); @@ -3425,18 +3432,21 @@ BOOL LLModelPreview::render() LLVertexBuffer* buffer = mVertexBuffer[LLModel::LOD_PHYSICS][model][i]; gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - gGL.diffuseColor4fv(PREVIEW_PSYH_FILL_COL.mV); + gGL.diffuseColor4fv(phys_fill_col().mV); // restore changes removed by the lab buffer->setBuffer(type_mask & buffer->getTypeMask()); buffer->drawRange(LLRender::TRIANGLES, 0, buffer->getNumVerts() - 1, buffer->getNumIndices(), 0); - - gGL.diffuseColor4fv(PREVIEW_PSYH_EDGE_COL.mV); - glLineWidth(PREVIEW_PSYH_EDGE_WIDTH); + // restore changes removed by the lab + // gGL.diffuseColor4fv(PREVIEW_PSYH_EDGE_COL.mV); + // gGL.setLineWidth(PREVIEW_PSYH_EDGE_WIDTH); // Line width OGL core profile fix by Rye Mutt + gGL.diffuseColor4fv(phys_edge_col().mV); + gGL.setLineWidth(phys_edge_width()); + // glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); buffer->drawRange(LLRender::TRIANGLES, 0, buffer->getNumVerts() - 1, buffer->getNumIndices(), 0); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - glLineWidth(1.f); + gGL.setLineWidth(1.f); // Line width OGL core profile fix by Rye Mutt } } } @@ -3446,13 +3456,19 @@ BOOL LLModelPreview::render() // only do this if mDegenerate was set in the preceding mesh checks [Check this if the ordering ever breaks] if (mHasDegenerate) { - glLineWidth(PREVIEW_DEG_EDGE_WIDTH); - glPointSize(PREVIEW_DEG_POINT_SIZE); - gPipeline.enableLightsFullbright(); + // restore older functionality lost in lab importer + // gGL.setLineWidth(PREVIEW_DEG_EDGE_WIDTH); // Line width OGL core profile fix by Rye Mutt + // glPointSize(PREVIEW_DEG_POINT_SIZE); + // gPipeline.enableLightsFullbright(); + gGL.setLineWidth(deg_edge_width()); + glPointSize(deg_point_size()); + // gPipeline.enableLightsFullbright(); // This may need to be restored when I fined the cause of the black rendering + // //show degenerate triangles LLGLDepthTest depth(GL_TRUE, GL_TRUE, GL_ALWAYS); LLGLDisable cull(GL_CULL_FACE); - gGL.diffuseColor4f(1.f, 0.f, 0.f, 1.f); + + // gGL.diffuseColor4f(1.f, 0.f, 0.f, 1.f); // restore proper functionality const LLVector4a scale(0.5f); for (LLMeshUploadThread::instance_list::iterator iter = mUploadData.begin(); iter != mUploadData.end(); ++iter) @@ -3508,6 +3524,14 @@ BOOL LLModelPreview::render() if (ll_is_degenerate(v1, v2, v3)) { + // restore (configurable) coloured overlay + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + gGL.diffuseColor4fv(deg_fill_col().mV); + buffer->draw(LLRender::TRIANGLES, 3, i); + glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); + gGL.diffuseColor3fv(deg_edge_col().mV); + gGL.color3fv(deg_edge_col().mV); + // buffer->draw(LLRender::LINE_LOOP, 3, i); buffer->draw(LLRender::POINTS, 3, i); } @@ -3518,7 +3542,7 @@ BOOL LLModelPreview::render() gGL.popMatrix(); } - glLineWidth(1.f); + gGL.setLineWidth(1.f); // Line width OGL core profile fix by Rye Mutt glPointSize(1.f); gPipeline.enableLightsPreview(); gGL.setSceneBlendType(LLRender::BT_ALPHA); @@ -3678,12 +3702,16 @@ BOOL LLModelPreview::render() if (edges) { - gGL.diffuseColor4fv(PREVIEW_EDGE_COL.mV); - glLineWidth(PREVIEW_EDGE_WIDTH); + // restore behaviour removed by lab + // gGL.diffuseColor4fv(PREVIEW_EDGE_COL.mV); + // gGL.setLineWidth(PREVIEW_EDGE_WIDTH); + gGL.diffuseColor4fv(edge_col().mV); + gGL.setLineWidth(edge_width()); + // glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); buffer->draw(LLRender::TRIANGLES, buffer->getNumIndices(), 0); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - glLineWidth(1.f); + gGL.setLineWidth(1.f); // Line width OGL core profile fix by Rye Mutt } } } @@ -3755,7 +3783,11 @@ void LLModelPreview::zoom(F32 zoom_amt) { F32 new_zoom = mCameraZoom + zoom_amt; // TODO: stop clamping in render - mCameraZoom = llclamp(new_zoom, 1.f, PREVIEW_ZOOM_LIMIT); + // restore settings control + // mCameraZoom = llclamp(new_zoom, 1.f, PREVIEW_ZOOM_LIMIT); + static LLCachedControl zoom_limit(gSavedSettings, "MeshPreviewZoomLimit"); + mCameraZoom = llclamp(new_zoom, 1.f, zoom_limit()); + // } void LLModelPreview::pan(F32 right, F32 up) diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp index 32ec9b7d05..6be25911db 100644 --- a/indra/newview/llmoveview.cpp +++ b/indra/newview/llmoveview.cpp @@ -539,8 +539,7 @@ void LLFloaterMove::setModeButtonToggleState(const EMovementMode mode) F32 LLFloaterMove::getCurrentTransparency() { static LLCachedControl camera_opacity(gSavedSettings, "CameraOpacity"); - static LLCachedControl active_floater_transparency(gSavedSettings, "ActiveFloaterTransparency"); - return llmin(camera_opacity(), active_floater_transparency()); + return camera_opacity(); } // diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index f0eafeb38a..e50a8ae999 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -1894,16 +1894,18 @@ LLColor4 LLNetMap::getAvatarColor(const LLUUID& avatar_id) { static LLUIColor map_avatar_color = LLUIColorTable::instance().getColor("MapAvatarColor", LLColor4::white); LLColor4 color = map_avatar_color; - + + LGGContactSets& cs_instance = LGGContactSets::instance(); + // Color "special" avatars with special colors (Friends, muted, Lindens, etc) - color = LGGContactSets::getInstance()->colorize(avatar_id, color, LGG_CS_MINIMAP); + color = cs_instance.colorize(avatar_id, color, LGG_CS_MINIMAP); // Color based on contact sets prefs - if(LGGContactSets::getInstance()->hasFriendColorThatShouldShow(avatar_id, LGG_CS_MINIMAP)) + if (cs_instance.hasFriendColorThatShouldShow(avatar_id, LGG_CS_MINIMAP)) { - color = LGGContactSets::getInstance()->getFriendColor(avatar_id); + color = cs_instance.getFriendColor(avatar_id); } - + // Mark Avatars with special colors avatar_marks_map_t::iterator found = sAvatarMarksMap.find(avatar_id); if (found != sAvatarMarksMap.end()) diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp index 15f57d98ad..4b231ca72b 100644 --- a/indra/newview/llnotificationhandlerutil.cpp +++ b/indra/newview/llnotificationhandlerutil.cpp @@ -204,6 +204,12 @@ void LLHandlerUtil::logToIMP2P(const LLNotificationPtr& notification, bool to_fi void LLHandlerUtil::logGroupNoticeToIMGroup( const LLNotificationPtr& notification) { + // FIRE-11339: Persisted group notifications get logged to IM on each login + if (notification->isFromStorage()) + { + return; + } + // const LLSD& payload = notification->getPayload(); LLGroupData groupData; diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 5d1b582d1f..37ed4bc74c 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -44,6 +44,7 @@ #include "llavatariconctrl.h" #include "llfloaterreg.h" #include "llnotificationsutil.h" +#include "llviewermenu.h" // is_agent_mappable #include "llvoiceclient.h" #include "lltextbox.h" #include "lltrans.h" diff --git a/indra/newview/llpanelgroupcreate.cpp b/indra/newview/llpanelgroupcreate.cpp index 9ec79eb802..c47a827077 100644 --- a/indra/newview/llpanelgroupcreate.cpp +++ b/indra/newview/llpanelgroupcreate.cpp @@ -45,6 +45,7 @@ #include "llfloaterreg.h" #include "llfloater.h" #include "llgroupmgr.h" +#include "llstatusbar.h" // to re-request balance #include "lltrans.h" #include "llnotificationsutil.h" #include "lluicolortable.h" @@ -136,6 +137,7 @@ void LLPanelGroupCreate::refreshCreatedGroup(const LLUUID& group_id) LLFloaterSidePanelContainer::showPanel("people", "panel_group_info_sidetray", params); } // + LLStatusBar::sendMoneyBalanceRequest(); } void LLPanelGroupCreate::addMembershipRow(const std::string &name) diff --git a/indra/newview/llpanellandmarkinfo.cpp b/indra/newview/llpanellandmarkinfo.cpp index 06bb886ae8..6751c25fb9 100644 --- a/indra/newview/llpanellandmarkinfo.cpp +++ b/indra/newview/llpanellandmarkinfo.cpp @@ -39,6 +39,7 @@ #include "llagent.h" #include "llagentui.h" #include "lllandmarkactions.h" +#include "llparcel.h" #include "llslurl.h" #include "llviewerinventory.h" #include "llviewerparcelmgr.h" @@ -77,7 +78,7 @@ BOOL LLPanelLandmarkInfo::postBuild() mCreator = getChild("creator"); mCreated = getChild("created"); - mLandmarkTitle = getChild("title_value"); + mLandmarkTitle = getChild("title_value"); mLandmarkTitleEditor = getChild("title_editor"); mNotesEditor = getChild("notes_editor"); mFolderCombo = getChild("folder_combo"); @@ -113,6 +114,7 @@ void LLPanelLandmarkInfo::setInfoType(EInfoType type) landmark_info_panel->setVisible(type == LANDMARK); getChild("folder_label")->setVisible(is_info_type_create_landmark); + getChild("edit_btn")->setVisible(!is_info_type_create_landmark); mFolderCombo->setVisible(is_info_type_create_landmark); switch(type) @@ -126,13 +128,10 @@ void LLPanelLandmarkInfo::setInfoType(EInfoType type) mNotesEditor->setEnabled(TRUE); LLViewerParcelMgr* parcel_mgr = LLViewerParcelMgr::getInstance(); - std::string name = parcel_mgr->getAgentParcelName(); + LLParcel* parcel = parcel_mgr->getAgentParcel(); + std::string name = parcel->getName(); LLVector3 agent_pos = gAgent.getPositionAgent(); - std::string desc; - LLAgentUI::buildLocationString(desc, LLAgentUI::LOCATION_FORMAT_FULL, agent_pos); - mNotesEditor->setText(desc); - if (name.empty()) { S32 region_x = ll_round(agent_pos.mV[VX]); @@ -147,6 +146,7 @@ void LLPanelLandmarkInfo::setInfoType(EInfoType type) } else { + std::string desc; LLAgentUI::buildLocationString(desc, LLAgentUI::LOCATION_FORMAT_NORMAL, agent_pos); region_name = desc; } @@ -159,6 +159,25 @@ void LLPanelLandmarkInfo::setInfoType(EInfoType type) mLandmarkTitleEditor->setText(name); } + LLUUID owner_id = parcel->getOwnerID(); + if (owner_id.notNull()) + { + if (parcel->getIsGroupOwned()) + { + std::string owner_name = LLSLURL("group", parcel->getGroupID(), "inspect").getSLURLString(); + mParcelOwner->setText(owner_name); + } + else + { + std::string owner_name = LLSLURL("agent", owner_id, "inspect").getSLURLString(); + mParcelOwner->setText(owner_name); + } + } + else + { + mParcelOwner->setText(getString("public")); + } + // Moved landmark creation here from LLPanelLandmarkInfo::processParcelInfo() // because we use only agent's current coordinates instead of waiting for // remote parcel request to complete. @@ -210,6 +229,24 @@ void LLPanelLandmarkInfo::processParcelInfo(const LLParcelData& parcel_data) mMaturityRatingText->setText(LLViewerRegion::accessToString(SIM_ACCESS_PG)); } + if (parcel_data.owner_id.notNull()) + { + if (parcel_data.flags & 0x4) // depends onto DRTSIM-453 + { + std::string owner_name = LLSLURL("group", parcel_data.owner_id, "inspect").getSLURLString(); + mParcelOwner->setText(owner_name); + } + else + { + std::string owner_name = LLSLURL("agent", parcel_data.owner_id, "inspect").getSLURLString(); + mParcelOwner->setText(owner_name); + } + } + else + { + mParcelOwner->setText(getString("public")); + } + LLSD info; info["update_verbs"] = true; info["global_x"] = parcel_data.global_x; @@ -264,7 +301,8 @@ void LLPanelLandmarkInfo::displayItemInfo(const LLInventoryItem* pItem) } else { - mOwner->setText(getString("public")); + std::string public_str = getString("public"); + mOwner->setText(public_str); } ////////////////// @@ -311,6 +349,7 @@ void LLPanelLandmarkInfo::toggleLandmarkEditMode(BOOL enabled) mNotesEditor->setReadOnly(!enabled); mFolderCombo->setVisible(enabled); getChild("folder_label")->setVisible(enabled); + getChild("edit_btn")->setVisible(!enabled); // HACK: To change the text color in a text editor // when it was enabled/disabled we set the text once again. @@ -357,7 +396,7 @@ void LLPanelLandmarkInfo::createLandmark(const LLUUID& folder_id) // If no parcel exists use the region name instead. if (name.empty()) { - name = mRegionName->getText(); + name = mRegionTitle; } } diff --git a/indra/newview/llpanellandmarkinfo.h b/indra/newview/llpanellandmarkinfo.h index 01a6fd6b3d..9712736182 100644 --- a/indra/newview/llpanellandmarkinfo.h +++ b/indra/newview/llpanellandmarkinfo.h @@ -71,7 +71,7 @@ private: LLTextBox* mOwner; LLTextBox* mCreator; LLTextBox* mCreated; - LLTextBox* mLandmarkTitle; + LLLineEditor* mLandmarkTitle; LLLineEditor* mLandmarkTitleEditor; LLTextEditor* mNotesEditor; LLComboBox* mFolderCombo; diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 7a8fdc2b54..75b1d400a5 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -568,7 +568,7 @@ void LLPanelLogin::populateFields(LLPointer credential, bool remem { sInstance->getChild("remember_name")->setValue(remember_user); LLUICtrl* remember_password = sInstance->getChild("remember_password"); - remember_password->setValue(remember_psswrd); + remember_password->setValue(remember_user && remember_psswrd); remember_password->setEnabled(remember_user); sInstance->populateUserList(credential); } @@ -692,7 +692,6 @@ void LLPanelLogin::getFields(LLPointer& credential, if (LLPanelLogin::sInstance->mPasswordModified) { - authenticator = LLSD::emptyMap(); // password is plaintext authenticator["type"] = CRED_AUTHENTICATOR_TYPE_CLEAR; authenticator["secret"] = password; @@ -703,6 +702,15 @@ void LLPanelLogin::getFields(LLPointer& credential, if (credential.notNull()) { authenticator = credential->getAuthenticator(); + if (authenticator.emptyMap()) + { + // Likely caused by user trying to log in to non-system grid + // with unsupported name format, just retry + LL_WARNS() << "Authenticator failed to load for: " << username << LL_ENDL; + // password is plaintext + authenticator["type"] = CRED_AUTHENTICATOR_TYPE_CLEAR; + authenticator["secret"] = password; + } } } } @@ -1142,7 +1150,11 @@ void LLPanelLogin::onRememberUserCheck(void*) remember_name->setValue(true); LLNotificationsUtil::add("LoginCantRemoveUsername"); } - remember_psswrd->setEnabled(remember); + if (!remember) + { + remember_psswrd->setValue(false); + } + remember_psswrd->setEnabled(remember); } } diff --git a/indra/newview/llpanelplaceinfo.cpp b/indra/newview/llpanelplaceinfo.cpp index d0e331c5e4..452d92a1a3 100644 --- a/indra/newview/llpanelplaceinfo.cpp +++ b/indra/newview/llpanelplaceinfo.cpp @@ -43,6 +43,7 @@ #include "llagent.h" #include "llexpandabletextbox.h" #include "llpanelpick.h" +#include "llslurl.h" #include "lltexturectrl.h" #include "llviewerregion.h" #include "llhttpconstants.h" @@ -80,6 +81,7 @@ BOOL LLPanelPlaceInfo::postBuild() mSnapshotCtrl = getChild("logo"); mRegionName = getChild("region_title"); mParcelName = getChild("parcel_title"); + mParcelOwner = getChild("parcel_owner"); // Custom place profile layout mDescEditor = getChild("description"); // FIRE-2717: Display traffic and area in landmark mInfoText = findChild("information"); @@ -112,11 +114,13 @@ void LLPanelPlaceInfo::resetLocation() mParcelID.setNull(); mRequestedID.setNull(); mPosRegion.clearVec(); + mRegionTitle.clear(); std::string loading = LLTrans::getString("LoadingData"); mMaturityRatingText->setValue(loading); - mRegionName->setText(loading); + mRegionName->setTextArg("[REGIONAMEPOS]", loading); mParcelName->setText(loading); + mParcelOwner->setText(loading); mDescEditor->setText(loading); // FIRE-2717: Display traffic and area in landmark if (mInfoText) @@ -205,8 +209,9 @@ void LLPanelPlaceInfo::setErrorStatus(S32 status, const std::string& reason) std::string not_available = getString("not_available"); mMaturityRatingText->setValue(not_available); - mRegionName->setText(not_available); + mRegionName->setTextArg("[REGIONAMEPOS]", not_available); mParcelName->setText(not_available); + mParcelOwner->setText(not_available); // FIRE-2717: Display traffic and area in landmark if (mInfoText) { @@ -217,6 +222,7 @@ void LLPanelPlaceInfo::setErrorStatus(S32 status, const std::string& reason) //mMaturityRatingIcon->setValue(LLUUID::null); mMaturityRatingIcon->setValue(LLSD("Unknown_Icon")); // Fix loading icon + mRegionTitle.clear(); // Enable "Back" button that was disabled when parcel request was sent. getChild("back_btn")->setEnabled(TRUE); @@ -230,12 +236,34 @@ void LLPanelPlaceInfo::processParcelInfo(const LLParcelData& parcel_data) mSnapshotCtrl->setImageAssetID(parcel_data.snapshot_id); } - if(!parcel_data.sim_name.empty()) - { - mRegionName->setText(parcel_data.sim_name); + S32 region_x; + S32 region_y; + S32 region_z; + + // If the region position is zero, grab position from the global + if (mPosRegion.isExactlyZero()) + { + region_x = ll_round(parcel_data.global_x) % REGION_WIDTH_UNITS; + region_y = ll_round(parcel_data.global_y) % REGION_WIDTH_UNITS; + region_z = ll_round(parcel_data.global_z); + } + else + { + region_x = ll_round(mPosRegion.mV[VX]); + region_y = ll_round(mPosRegion.mV[VY]); + region_z = ll_round(mPosRegion.mV[VZ]); + } + + if (!parcel_data.sim_name.empty()) + { + mRegionTitle = parcel_data.sim_name; + std::string name_and_pos = llformat("%s (%d, %d, %d)", + mRegionTitle.c_str(), region_x, region_y, region_z); + mRegionName->setTextArg("[REGIONAMEPOS]", name_and_pos); } else { + mRegionTitle.clear(); mRegionName->setText(LLStringUtil::null); } @@ -248,30 +276,11 @@ void LLPanelPlaceInfo::processParcelInfo(const LLParcelData& parcel_data) mDescEditor->setText(getString("not_available")); } - S32 region_x; - S32 region_y; - S32 region_z; - - // If the region position is zero, grab position from the global - if(mPosRegion.isExactlyZero()) - { - region_x = ll_round(parcel_data.global_x) % REGION_WIDTH_UNITS; - region_y = ll_round(parcel_data.global_y) % REGION_WIDTH_UNITS; - region_z = ll_round(parcel_data.global_z); - } - else - { - region_x = ll_round(mPosRegion.mV[VX]); - region_y = ll_round(mPosRegion.mV[VY]); - region_z = ll_round(mPosRegion.mV[VZ]); - } - if (!parcel_data.name.empty()) { mParcelTitle = parcel_data.name; - mParcelName->setText(llformat("%s (%d, %d, %d)", - mParcelTitle.c_str(), region_x, region_y, region_z)); + mParcelName->setText(mParcelTitle); } else { @@ -330,12 +339,10 @@ void LLPanelPlaceInfo::reshape(S32 width, S32 height, BOOL called_from_parent) void LLPanelPlaceInfo::createPick(const LLVector3d& pos_global, LLPanelPickEdit* pick_panel) { - std::string region_name = mRegionName->getText(); - LLPickData data; data.pos_global = pos_global; - data.name = mParcelTitle.empty() ? region_name : mParcelTitle; - data.sim_name = region_name; + data.name = mParcelTitle.empty() ? mRegionTitle : mParcelTitle; + data.sim_name = mRegionTitle; data.desc = mDescEditor->getText(); data.snapshot_id = mSnapshotCtrl->getImageAssetID(); data.parcel_id = mParcelID; diff --git a/indra/newview/llpanelplaceinfo.h b/indra/newview/llpanelplaceinfo.h index 0780975073..10b6c8a1bc 100644 --- a/indra/newview/llpanelplaceinfo.h +++ b/indra/newview/llpanelplaceinfo.h @@ -122,6 +122,7 @@ protected: LLUUID mRequestedID; LLVector3 mPosRegion; std::string mParcelTitle; // used for pick title without coordinates + std::string mRegionTitle; std::string mCurrentTitle; S32 mScrollingPanelMinHeight; S32 mScrollingPanelWidth; @@ -133,6 +134,7 @@ protected: LLTextureCtrl* mSnapshotCtrl; LLTextBox* mRegionName; LLTextBox* mParcelName; + LLTextBox* mParcelOwner; LLExpandableTextBox* mDescEditor; LLIconCtrl* mMaturityRatingIcon; LLTextBox* mMaturityRatingText; diff --git a/indra/newview/llpanelplaceprofile.cpp b/indra/newview/llpanelplaceprofile.cpp index edf85774f7..91d51d6594 100644 --- a/indra/newview/llpanelplaceprofile.cpp +++ b/indra/newview/llpanelplaceprofile.cpp @@ -107,8 +107,6 @@ BOOL LLPanelPlaceProfile::postBuild() mForSalePanel->getChild("icon_for_sale")-> setMouseDownCallback(boost::bind(&LLPanelPlaceProfile::onForSaleBannerClick, this)); - mParcelOwner = getChild("owner_value"); - mParcelRatingIcon = getChild("rating_icon"); mParcelRatingText = getChild("rating_value"); mVoiceIcon = getChild("voice_icon"); @@ -189,7 +187,6 @@ void LLPanelPlaceProfile::resetLocation() const std::string unknown("Unknown_Icon"); std::string loading = LLTrans::getString("LoadingData"); - mParcelOwner->setValue(loading); // Fix loading icon; don't use translated string! //mParcelRatingIcon->setValue(loading); @@ -266,14 +263,14 @@ void LLPanelPlaceProfile::setInfoType(EInfoType type) const S32 SEARCH_DESC_HEIGHT = 150; // Remember original geometry (once). - static const S32 sOrigDescVPad = getChildView("parcel_title")->getRect().mBottom - mDescEditor->getRect().mTop; + static const S32 sOrigDescVPad = getChildView("owner_label")->getRect().mBottom - mDescEditor->getRect().mTop; static const S32 sOrigDescHeight = mDescEditor->getRect().getHeight(); static const S32 sOrigMRIconVPad = mDescEditor->getRect().mBottom - mMaturityRatingIcon->getRect().mTop; static const S32 sOrigMRTextVPad = mDescEditor->getRect().mBottom - mMaturityRatingText->getRect().mTop; // Resize the description. const S32 desc_height = is_info_type_agent ? sOrigDescHeight : SEARCH_DESC_HEIGHT; - const S32 desc_top = getChildView("parcel_title")->getRect().mBottom - sOrigDescVPad; + const S32 desc_top = getChildView("owner_label")->getRect().mBottom - sOrigDescVPad; LLRect desc_rect = mDescEditor->getRect(); desc_rect.setOriginAndSize(desc_rect.mLeft, desc_top - desc_height, desc_rect.getWidth(), desc_height); mDescEditor->reshape(desc_rect.getWidth(), desc_rect.getHeight()); @@ -419,6 +416,7 @@ void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel, parcel_data.global_x = pos_global.mdV[VX]; parcel_data.global_y = pos_global.mdV[VY]; parcel_data.global_z = pos_global.mdV[VZ]; + parcel_data.owner_id = parcel->getOwnerID(); std::string on = getString("on"); std::string off = getString("off"); diff --git a/indra/newview/llpanelplaceprofile.h b/indra/newview/llpanelplaceprofile.h index 3d2654fc12..16478bc179 100644 --- a/indra/newview/llpanelplaceprofile.h +++ b/indra/newview/llpanelplaceprofile.h @@ -76,8 +76,6 @@ private: LLPanel* mForSalePanel; LLPanel* mYouAreHerePanel; - LLTextBox* mParcelOwner; - LLIconCtrl* mParcelRatingIcon; LLTextBox* mParcelRatingText; LLIconCtrl* mVoiceIcon; diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index a7d0a89882..04045d555d 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -59,6 +59,7 @@ #include "llinventorymodel.h" #include "lllandmarkactions.h" #include "lllandmarklist.h" +#include "lllayoutstack.h" #include "llpanellandmarkinfo.h" #include "llpanellandmarks.h" #include "llpanelpick.h" @@ -291,9 +292,6 @@ BOOL LLPanelPlaces::postBuild() mShowOnMapBtn = getChild("map_btn"); mShowOnMapBtn->setClickedCallback(boost::bind(&LLPanelPlaces::onShowOnMapButtonClicked, this)); - mEditBtn = getChild("edit_btn"); - mEditBtn->setClickedCallback(boost::bind(&LLPanelPlaces::onEditButtonClicked, this)); - mSaveBtn = getChild("save_btn"); mSaveBtn->setClickedCallback(boost::bind(&LLPanelPlaces::onSaveButtonClicked, this)); @@ -366,6 +364,9 @@ BOOL LLPanelPlaces::postBuild() LLComboBox* folder_combo = mLandmarkInfo->getChild("folder_combo"); folder_combo->setCommitCallback(boost::bind(&LLPanelPlaces::onEditButtonClicked, this)); + LLButton* edit_btn = mLandmarkInfo->getChild("edit_btn"); + edit_btn->setCommitCallback(boost::bind(&LLPanelPlaces::onEditButtonClicked, this)); + createTabs(); updateVerbs(); @@ -566,7 +567,6 @@ void LLPanelPlaces::setItem(LLInventoryItem* item) BOOL is_landmark_editable = gInventory.isObjectDescendentOf(mItem->getUUID(), gInventory.getRootFolderID()) && mItem->getPermissions().allowModifyBy(gAgent.getID()); - mEditBtn->setEnabled(is_landmark_editable); mSaveBtn->setEnabled(is_landmark_editable); if (is_landmark_editable) @@ -1254,13 +1254,16 @@ void LLPanelPlaces::updateVerbs() mTeleportBtn->setVisible(!is_create_landmark_visible && !isLandmarkEditModeOn && !is_pick_panel_visible); mShowOnMapBtn->setVisible(!is_create_landmark_visible && !isLandmarkEditModeOn && !is_pick_panel_visible); - mOverflowBtn->setVisible(is_place_info_visible && !is_create_landmark_visible && !isLandmarkEditModeOn); - mEditBtn->setVisible(mPlaceInfoType == LANDMARK_INFO_TYPE && !isLandmarkEditModeOn); mSaveBtn->setVisible(isLandmarkEditModeOn); mCancelBtn->setVisible(isLandmarkEditModeOn); mCloseBtn->setVisible(is_create_landmark_visible && !isLandmarkEditModeOn); mPlaceInfoBtn->setVisible(!is_place_info_visible && !is_create_landmark_visible && !isLandmarkEditModeOn && !is_pick_panel_visible); + bool show_options_btn = is_place_info_visible && !is_create_landmark_visible && !isLandmarkEditModeOn; + mOverflowBtn->setVisible(show_options_btn); + getChild("lp_options")->setVisible(show_options_btn); + getChild("lp2")->setVisible(!show_options_btn); + mPlaceInfoBtn->setEnabled(!is_create_landmark_visible && !isLandmarkEditModeOn && have_3d_pos); if (is_place_info_visible) diff --git a/indra/newview/llpanelplaces.h b/indra/newview/llpanelplaces.h index 097b6a6ed4..c4281cfdf9 100644 --- a/indra/newview/llpanelplaces.h +++ b/indra/newview/llpanelplaces.h @@ -128,7 +128,6 @@ private: LLButton* mPlaceProfileBackBtn; LLButton* mTeleportBtn; LLButton* mShowOnMapBtn; - LLButton* mEditBtn; LLButton* mSaveBtn; LLButton* mCancelBtn; LLButton* mCloseBtn; diff --git a/indra/newview/llpanelwearing.cpp b/indra/newview/llpanelwearing.cpp index 2b6f6a8596..76cb8fcf99 100644 --- a/indra/newview/llpanelwearing.cpp +++ b/indra/newview/llpanelwearing.cpp @@ -61,28 +61,6 @@ static void edit_outfit() LLFloaterSidePanelContainer::showPanel("appearance", LLSD().with("type", "edit_outfit")); } -// [SL:KB] - Patch: Inventory-AttachmentEdit - Checked: 2010-09-04 (Catznip-2.2.0a) | Added: Catznip-2.1.2a -static void edit_item(const LLUUID& idItem) -{ - const LLViewerInventoryItem* pItem = gInventory.getItem(idItem); - if (!pItem) - return; - - switch (pItem->getType()) - { - case LLAssetType::AT_BODYPART: - case LLAssetType::AT_CLOTHING: - LLAgentWearables::editWearable(idItem); - break; - case LLAssetType::AT_OBJECT: - handle_attachment_edit(idItem); - break; - default: - break; - } -} -// [/SL:KB] - ////////////////////////////////////////////////////////////////////////// class LLWearingGearMenu @@ -94,7 +72,9 @@ public: LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar; - registrar.add("Gear.Edit", boost::bind(&edit_outfit)); + registrar.add("Gear.TouchAttach", boost::bind(&LLWearingGearMenu::handleMultiple, this, handle_attachment_touch)); + registrar.add("Gear.EditItem", boost::bind(&LLWearingGearMenu::handleMultiple, this, handle_item_edit)); + registrar.add("Gear.EditOutfit", boost::bind(&edit_outfit)); registrar.add("Gear.TakeOff", boost::bind(&LLPanelWearing::onRemoveItem, mPanelWearing)); registrar.add("Gear.Copy", boost::bind(&LLPanelWearing::copyToClipboard, mPanelWearing)); @@ -108,6 +88,16 @@ public: LLToggleableMenu* getMenu() { return mMenu; } private: + void handleMultiple(std::function functor) + { + uuid_vec_t selected_item_ids; + mPanelWearing->getSelectedItemsUUIDs(selected_item_ids); + + for (const LLUUID& item_id : selected_item_ids) + { + functor(item_id); + } + } LLToggleableMenu* mMenu; LLPanelWearing* mPanelWearing; @@ -122,10 +112,9 @@ protected: { LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; - registrar.add("Wearing.Edit", boost::bind(&edit_outfit)); -// [SL:KB] - Patch: Inventory-AttachmentEdit - Checked: 2010-09-04 (Catznip-2.2.0a) | Added: Catznip-2.1.2a - registrar.add("Wearing.EditItem", boost::bind(handleMultiple, edit_item, mUUIDs)); -// [/SL:KB] + registrar.add("Wearing.TouchAttach", boost::bind(handleMultiple, handle_attachment_touch, mUUIDs)); + registrar.add("Wearing.EditItem", boost::bind(handleMultiple, handle_item_edit, mUUIDs)); + registrar.add("Wearing.EditOutfit", boost::bind(&edit_outfit)); registrar.add("Wearing.ShowOriginal", boost::bind(show_item_original, mUUIDs.front())); registrar.add("Wearing.TakeOff", boost::bind(&LLAppearanceMgr::removeItemsFromAvatar, LLAppearanceMgr::getInstance(), mUUIDs)); @@ -187,11 +176,19 @@ protected: // [RLVa:KB] - Checked: 2012-07-28 (RLVa-1.4.7) bool rlv_blocked = (mUUIDs.size() == rlv_locked_count); // [/RLVa:KB] + bool show_touch = !bp_selected && !clothes_selected && attachments_selected; + bool show_edit = bp_selected || clothes_selected || attachments_selected; bool allow_detach = !bp_selected && !clothes_selected && attachments_selected; bool allow_take_off = !bp_selected && clothes_selected && !attachments_selected; + menu->setItemVisible("touch_attach", show_touch); + menu->setItemEnabled("touch_attach", 1 == mUUIDs.size() && enable_attachment_touch(mUUIDs.front())); + menu->setItemVisible("edit_item", show_edit); + menu->setItemEnabled("edit_item", 1 == mUUIDs.size() && get_is_item_editable(mUUIDs.front())); menu->setItemVisible("take_off", allow_take_off); menu->setItemVisible("detach", allow_detach); + menu->setItemVisible("edit_outfit_separator", show_touch | show_edit | allow_take_off || allow_detach); + menu->setItemVisible("show_original", mUUIDs.size() == 1); // [SL:KB] - Patch: Inventory-AttachmentEdit - Checked: 2010-09-04 (Catznip-2.2.0a) | Added: Catznip-2.1.2a menu->setItemVisible("take_off_or_detach", (!allow_detach) && (!allow_take_off) && (clothes_selected) && (attachments_selected)); // [/SL:KB] @@ -199,13 +196,6 @@ protected: menu->setItemEnabled("take_off", !rlv_blocked); menu->setItemEnabled("detach", !rlv_blocked); // [/RLVa:KB] - menu->setItemVisible("edit_outfit_separator", allow_take_off || allow_detach); - menu->setItemVisible("show_original", mUUIDs.size() == 1); -// menu->setItemVisible("edit_item", FALSE); -// [SL:KB] - Patch: Inventory-AttachmentEdit - Checked: 2010-09-04 (Catznip-2.2.0a) | Added: Catznip-2.1.2a - menu->setItemVisible("edit_item", bp_selected || clothes_selected || attachments_selected); - menu->setItemEnabled("edit_item", 1 == mUUIDs.size()); -// [/SL:KB] } }; @@ -233,15 +223,18 @@ protected: void updateMenuItemsVisibility(LLContextMenu* menu) { + menu->setItemVisible("touch_attach", TRUE); + menu->setItemEnabled("touch_attach", 1 == mUUIDs.size()); + menu->setItemVisible("edit_item", TRUE); + menu->setItemEnabled("edit_item", 1 == mUUIDs.size()); menu->setItemVisible("take_off", FALSE); menu->setItemVisible("detach", TRUE); // [SL:KB] - Patch: Inventory-AttachmentEdit - Checked: 2010-09-04 (Catznip-2.2.0a) | Added: Catznip-2.1.2a menu->setItemVisible("take_off_or_detach", FALSE); // [/SL:KB] - menu->setItemVisible("edit_outfit_separator", TRUE); + menu->setItemVisible("edit_outfit_separator", FALSE); menu->setItemVisible("show_original", FALSE); - menu->setItemVisible("edit_item", TRUE); - menu->setItemVisible("edit", FALSE); + menu->setItemVisible("edit_outfit", FALSE); } LLPanelWearing* mPanelWearing; @@ -419,6 +412,18 @@ bool LLPanelWearing::isActionEnabled(const LLSD& userdata) } } + uuid_vec_t selected_uuids; + getSelectedItemsUUIDs(selected_uuids); + + if (command_name == "touch_attach") + { + return (1 == selected_uuids.size()) && (enable_attachment_touch(selected_uuids.front())); + } + else if (command_name == "edit_item") + { + return (1 == selected_uuids.size()) && (get_is_item_editable(selected_uuids.front())); + } + return false; } @@ -681,6 +686,9 @@ void LLPanelWearing::onDoubleClick() ids.push_back(selected_item_id); LLViewerInventoryItem* item = gInventory.getItem(selected_item_id); + if (!item) + return; + if ((item->getType() == LLAssetType::AT_CLOTHING && (!RlvActions::isRlvEnabled() || gRlvWearableLocks.canRemove(item))) || ((item->getType() == LLAssetType::AT_OBJECT) && (!RlvActions::isRlvEnabled() || gRlvAttachmentLocks.canDetach(item)))) { diff --git a/indra/newview/llpersistentnotificationstorage.cpp b/indra/newview/llpersistentnotificationstorage.cpp index 221dfa4244..0020bab035 100644 --- a/indra/newview/llpersistentnotificationstorage.cpp +++ b/indra/newview/llpersistentnotificationstorage.cpp @@ -153,6 +153,9 @@ void LLPersistentNotificationStorage::loadNotifications() LLNotificationResponderPtr responder(createResponder(notification_params["name"], notification_params["responder"])); notification->setResponseFunctor(responder); + // FIRE-11339: Persisted group notifications get logged to IM on each login + notification->setIsFromStorage(true); + instance.add(notification); // hide script floaters so they don't confuse the user and don't overlap startup toast diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp index 45c6b20b61..4d898c0169 100644 --- a/indra/newview/llpreviewnotecard.cpp +++ b/indra/newview/llpreviewnotecard.cpp @@ -269,6 +269,7 @@ void LLPreviewNotecard::loadAsset() if (!editor) return; + bool fail = false; if(item) { @@ -344,7 +345,7 @@ void LLPreviewNotecard::loadAsset() { editor->setEnabled(FALSE); getChildView("lock")->setVisible( TRUE); - getChildView("Edit")->setEnabled(FALSE); // Don't enable external editor button on no mod notecards. + getChildView("Edit")->setEnabled(FALSE); } if((allow_modify || is_owner) && !source_library) @@ -352,7 +353,31 @@ void LLPreviewNotecard::loadAsset() getChildView("Delete")->setEnabled(TRUE); } } - else + else if (mObjectUUID.notNull() && mItemUUID.notNull()) + { + LLViewerObject* objectp = gObjectList.findObject(mObjectUUID); + if (objectp && (objectp->isInventoryPending() || objectp->isInventoryDirty())) + { + // It's a notecard in object's inventory and we failed to get it because inventory is not up to date. + // Subscribe for callback and retry at inventoryChanged() + registerVOInventoryListener(objectp, NULL); //removes previous listener + + if (objectp->isInventoryDirty()) + { + objectp->requestInventory(); + } + } + else + { + fail = true; + } + } + else + { + fail = true; + } + + if (fail) { editor->setText(LLStringUtil::null); editor->makePristine(); @@ -656,6 +681,17 @@ void LLPreviewNotecard::syncExternal() } } +/*virtual*/ +void LLPreviewNotecard::inventoryChanged(LLViewerObject* object, + LLInventoryObject::object_list_t* inventory, + S32 serial_num, + void* user_data) +{ + removeVOInventoryListener(); + loadAsset(); +} + + void LLPreviewNotecard::deleteNotecard() { LLNotificationsUtil::add("DeleteNotecard", LLSD(), LLSD(), boost::bind(&LLPreviewNotecard::handleConfirmDeleteDialog,this, _1, _2)); diff --git a/indra/newview/llpreviewnotecard.h b/indra/newview/llpreviewnotecard.h index 0bc4db2e49..5b8e092551 100644 --- a/indra/newview/llpreviewnotecard.h +++ b/indra/newview/llpreviewnotecard.h @@ -31,6 +31,7 @@ #include "llassetstorage.h" #include "llpreviewscript.h" #include "lliconctrl.h" +#include "llvoinventorylistener.h" //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLPreviewNotecard @@ -44,7 +45,7 @@ class LLButton; class LLTextEditor; // [/SL:KB] -class LLPreviewNotecard : public LLPreview +class LLPreviewNotecard : public LLPreview, public LLVOInventoryListener { public: LLPreviewNotecard(const LLSD& key); @@ -84,6 +85,11 @@ public: void syncExternal(); + void inventoryChanged(LLViewerObject* object, + LLInventoryObject::object_list_t* inventory, + S32 serial_num, + void* user_data) override; + // FIRE-9039: Close notecard after choosing "Save" in close confirmation void checkCloseAfterSave(); diff --git a/indra/newview/llremoteparcelrequest.h b/indra/newview/llremoteparcelrequest.h index 5b0d189137..70c117be44 100644 --- a/indra/newview/llremoteparcelrequest.h +++ b/indra/newview/llremoteparcelrequest.h @@ -45,7 +45,7 @@ struct LLParcelData std::string desc; S32 actual_area; S32 billable_area; - U8 flags; + U8 flags; // group owned, maturity F32 global_x; F32 global_y; F32 global_z; diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp index 84f16d897e..c8fe6cafec 100644 --- a/indra/newview/llscreenchannel.cpp +++ b/indra/newview/llscreenchannel.cpp @@ -644,6 +644,9 @@ void LLScreenChannel::redrawToasts() //-------------------------------------------------------------------------- void LLScreenChannel::showToastsBottom() { + // FIRE-7007: Position of chiclets in bottom right corner are off when changing UI scaling + LLRect channel_rect = getChannelRect(); + LLRect toast_rect; S32 bottom = getRect().mBottom - gFloaterView->getRect().mBottom; S32 toast_margin = 0; @@ -671,7 +674,9 @@ void LLScreenChannel::showToastsBottom() return; } - bottom = toast->getRect().mTop - toast->getTopPad(); + // Unify chiclet calculation + //bottom = toast->getRect().mTop + toast->getTopPad(); + bottom = toast->getRect().mTop; toast_margin = gSavedSettings.getS32("ToastGap"); } @@ -683,7 +688,9 @@ void LLScreenChannel::showToastsBottom() } toast_rect = toast->getRect(); - toast_rect.setOriginAndSize(getRect().mRight - toast_rect.getWidth(), + // FIRE-7007: Position of chiclets in bottom right corner are off when changing UI scaling + //toast_rect.setOriginAndSize(getRect().mRight - toast_rect.getWidth(), + toast_rect.setOriginAndSize(channel_rect.mRight - toast_rect.getWidth(), bottom + toast_margin, toast_rect.getWidth(), toast_rect.getHeight()); toast->setRect(toast_rect); @@ -701,7 +708,8 @@ void LLScreenChannel::showToastsBottom() toast->translate(0, shift); } - LLRect channel_rect = getChannelRect(); + // Already defined + //LLRect channel_rect = getChannelRect(); // don't show toasts if there is not enough space if(toast_rect.mTop > channel_rect.mTop) { @@ -709,14 +717,18 @@ void LLScreenChannel::showToastsBottom() } } - bool stop_showing_toasts = toast->getRect().mTop > getRect().mTop; + // FIRE-7007: Position of chiclets in bottom right corner are off when changing UI scaling + //bool stop_showing_toasts = toast->getRect().mTop > getRect().mTop; + bool stop_showing_toasts = toast->getRect().mTop > channel_rect.mTop; if(!stop_showing_toasts) { if( it != vToastList.rend()-1) { S32 toast_top = toast->getRect().mTop + gSavedSettings.getS32("ToastGap"); - stop_showing_toasts = toast_top > getRect().mTop; + // FIRE-7007: Position of chiclets in bottom right corner are off when changing UI scaling + //stop_showing_toasts = toast_top > getRect().mTop; + stop_showing_toasts = toast_top > channel_rect.mTop; } } @@ -801,6 +813,7 @@ void LLScreenChannel::showToastsTop() LLRect toast_rect; S32 top = channel_rect.mTop; + S32 toast_margin = 0; // Unify chiclet calculation std::vector::reverse_iterator it; updateRect(); @@ -825,8 +838,12 @@ void LLScreenChannel::showToastsTop() return; } - top = toast->getRect().mBottom - toast->getTopPad(); - gSavedSettings.getS32("ToastGap"); + // Unify chiclet calculation + //top = toast->getRect().mBottom - toast->getTopPad(); + //gSavedSettings.getS32("ToastGap"); + top = toast->getRect().mBottom; + toast_margin = gSavedSettings.getS32("ToastGap"); + // } LLToast* toast = it->getToast(); @@ -838,7 +855,10 @@ void LLScreenChannel::showToastsTop() toast_rect = toast->getRect(); toast_rect.setLeftTopAndSize(channel_rect.mRight - toast_rect.getWidth(), - top, toast_rect.getWidth(), + // Unify chiclet calculation + //top, toast_rect.getWidth(), + top - toast_margin, toast_rect.getWidth(), + // toast_rect.getHeight()); toast->setRect(toast_rect); @@ -855,7 +875,8 @@ void LLScreenChannel::showToastsTop() toast->translate(0, shift); } - LLRect channel_rect = getChannelRect(); + // Already defined + //LLRect channel_rect = getChannelRect(); // don't show toasts if there is not enough space if(toast_rect.mBottom < channel_rect.mBottom) { diff --git a/indra/newview/llscriptfloater.cpp b/indra/newview/llscriptfloater.cpp index 98b253f291..c4d54afc40 100644 --- a/indra/newview/llscriptfloater.cpp +++ b/indra/newview/llscriptfloater.cpp @@ -369,7 +369,9 @@ void LLScriptFloater::onFocusReceived() } } -void LLScriptFloater::dockToChiclet(bool dock) +// FIRE-12929: Fix script floater docking issues +//void LLScriptFloater::dockToChiclet(bool dock) +void LLScriptFloater::dockToChiclet(bool dock, bool scroll_to_chiclet /* = true */) { if (getDockControl() == NULL) { @@ -383,7 +385,13 @@ void LLScriptFloater::dockToChiclet(bool dock) return; } - chiclet_panelp->scrollToChiclet(chicletp); + // FIRE-12929: Fix script floater docking issues + //chiclet_panelp->scrollToChiclet(chicletp); + if (scroll_to_chiclet) + { + chiclet_panelp->scrollToChiclet(chicletp); + } + // // Stop saving position while we dock floater bool save = getSavePosition(); @@ -710,7 +718,7 @@ LLScriptFloaterManager::EObjectType LLScriptFloaterManager::getObjectType(const return it->second; } - LL_WARNS() << "Unknown object type" << LL_ENDL; + LL_WARNS() << "Unknown object type: " << notification->getName() << LL_ENDL; return OBJ_UNKNOWN; } @@ -754,6 +762,7 @@ LLScriptFloaterManager::object_type_map LLScriptFloaterManager::initObjectTypeMa type_map["ScriptDialogGroup"] = OBJ_SCRIPT; type_map["LoadWebPage"] = OBJ_LOAD_URL; type_map["ObjectGiveItem"] = OBJ_GIVE_INVENTORY; + type_map["OwnObjectGiveItem"] = OBJ_GIVE_INVENTORY; // Fix log warning about unkown script message type return type_map; } @@ -936,121 +945,99 @@ LLScriptFloater* LLScriptFloater::show(const LLUUID& notification_id) //LLDialog(LLGiveInventory and LLLoadURL) should no longer steal focus (see EXT-5445) floater->setAutoFocus(FALSE); - LLScriptFloaterManager::e_object_type floaterType=LLScriptFloaterManager::getObjectType(notification_id); + eDialogPosition dialog_position = (eDialogPosition)gSavedSettings.getS32("ScriptDialogsPosition"); BOOL chicletsDisabled = gSavedSettings.getBOOL("FSDisableIMChiclets"); - LLRect pos = floater->getRect(); - - // FIRE-12037: Inventory Offer Dialog boxes hidden - // They should be ALWAYS visible on screen, all of them, not only the most recent one - so use the ScriptDialogsPosition detection as well - // Otherwise (after accepting/declining that most recent one) user may not notice, that still has something to click (with chiclets hidden, or just too many of them visible on screen), relog and lost pending inventory offer items - // if (floaterType == LLScriptFloaterManager::OBJ_SCRIPT) - if (floaterType == LLScriptFloaterManager::OBJ_SCRIPT || floaterType == LLScriptFloaterManager::OBJ_UNKNOWN || floaterType == LLScriptFloaterManager::OBJ_GIVE_INVENTORY) - // + if (dialog_position == POS_DOCKED && chicletsDisabled) { - eDialogPosition dialog_position = (eDialogPosition)gSavedSettings.getS32("ScriptDialogsPosition"); - - if (dialog_position == POS_DOCKED && chicletsDisabled) - { - dialog_position = POS_TOP_RIGHT; - } - - if (dialog_position != POS_DOCKED) - { - // undock the dialog - floater->setDocked(false, true); - } - - S32 topPad = LLScriptFloaterManager::instance().getTopPad(); - - S32 bottomPad = 0; - if (gToolBarView->getToolbar(LLToolBarEnums::TOOLBAR_BOTTOM)->hasButtons()) - { - bottomPad = gToolBarView->getToolbar(LLToolBarEnums::TOOLBAR_BOTTOM)->getRect().getHeight(); - } - - S32 leftPad = 0; - if (gToolBarView->getToolbar(LLToolBarEnums::TOOLBAR_LEFT)->hasButtons()) - { - leftPad = gToolBarView->getToolbar(LLToolBarEnums::TOOLBAR_LEFT)->getRect().getWidth(); - } - - S32 rightPad = 0; - if (gToolBarView->getToolbar(LLToolBarEnums::TOOLBAR_RIGHT)->hasButtons()) - { - rightPad = gToolBarView->getToolbar(LLToolBarEnums::TOOLBAR_RIGHT)->getRect().getWidth(); - } - - S32 width = pos.getWidth(); - S32 height = pos.getHeight(); - - floater->setOpenPositioning(LLFloaterEnums::POSITIONING_SPECIFIED); - - switch (dialog_position) - { - case POS_DOCKED: - { - floater->dockToChiclet(true); - break; - } - case POS_TOP_LEFT: - { - pos.setOriginAndSize(leftPad, - gViewerWindow->getWorldViewHeightScaled() - height - topPad, - width, height); - break; - } - case POS_TOP_RIGHT: - { - pos.setOriginAndSize(gViewerWindow->getWorldViewWidthScaled() - width - rightPad, - gViewerWindow->getWorldViewHeightScaled() - height - topPad, - width, height); - break; - } - case POS_BOTTOM_LEFT: - { - pos.setOriginAndSize(leftPad, - bottomPad, - width, height); - break; - } - case POS_BOTTOM_RIGHT: - { - pos.setOriginAndSize(gViewerWindow->getWorldViewWidthScaled() - width - rightPad, - bottomPad, - width, height); - break; - } - default: - { - LL_WARNS() << "dialog_position value " << dialog_position << " not handled in switch() statement." << LL_ENDL; - } - } + dialog_position = POS_TOP_RIGHT; } - else - { - floater->setSavePosition(true); + if (dialog_position != POS_DOCKED) + { + // undock the dialog + floater->setDocked(false, true); if (chicletsDisabled) { - S32 width = pos.getWidth(); - S32 height = pos.getHeight(); - - pos.setOriginAndSize(gViewerWindow->getWorldViewWidthScaled() - width, - gViewerWindow->getWorldViewHeightScaled() - height, - width, height); + // Remove the dock icon in case chiclets are hidden since there is nothing to dock to + floater->setCanDock(false); } - else + } + + S32 topPad = LLScriptFloaterManager::instance().getTopPad(); + + S32 bottomPad = 0; + if (gToolBarView->getToolbar(LLToolBarEnums::TOOLBAR_BOTTOM)->hasButtons()) + { + bottomPad = gToolBarView->getToolbar(LLToolBarEnums::TOOLBAR_BOTTOM)->getRect().getHeight(); + } + + S32 leftPad = 0; + if (gToolBarView->getToolbar(LLToolBarEnums::TOOLBAR_LEFT)->hasButtons()) + { + leftPad = gToolBarView->getToolbar(LLToolBarEnums::TOOLBAR_LEFT)->getRect().getWidth(); + } + + S32 rightPad = 0; + if (gToolBarView->getToolbar(LLToolBarEnums::TOOLBAR_RIGHT)->hasButtons()) + { + rightPad = gToolBarView->getToolbar(LLToolBarEnums::TOOLBAR_RIGHT)->getRect().getWidth(); + } + + LLRect pos = floater->getRect(); + S32 width = pos.getWidth(); + S32 height = pos.getHeight(); + + floater->setOpenPositioning(LLFloaterEnums::POSITIONING_SPECIFIED); + + if (!gSavedSettings.getBOOL("FSDisableIMChiclets")) + { + // This also sets up the dock, so we always need to call this (unless chiclets are hidden) + // or the dock button won't work at all. + floater->dockToChiclet(dialog_position == POS_DOCKED, dialog_position == POS_DOCKED); + } + + switch (dialog_position) + { + case POS_TOP_LEFT: { - floater->dockToChiclet(true); + pos.setOriginAndSize(leftPad, + gViewerWindow->getWorldViewHeightScaled() - height - topPad, + width, height); + break; + } + case POS_TOP_RIGHT: + { + pos.setOriginAndSize(gViewerWindow->getWorldViewWidthScaled() - width - rightPad, + gViewerWindow->getWorldViewHeightScaled() - height - topPad, + width, height); + break; + } + case POS_BOTTOM_LEFT: + { + pos.setOriginAndSize(leftPad, + bottomPad, + width, height); + break; + } + case POS_BOTTOM_RIGHT: + { + pos.setOriginAndSize(gViewerWindow->getWorldViewWidthScaled() - width - rightPad, + bottomPad, + width, height); + break; + } + default: + { + LL_WARNS() << "dialog_position value " << dialog_position << " not handled in switch() statement." << LL_ENDL; } } //LLDialog(LLGiveInventory and LLLoadURL) should no longer steal focus (see EXT-5445) LLFloaterReg::showTypedInstance("script_floater", notification_id, FALSE); - if(!floater->isDocked()) + if (!floater->isDocked()) { // reposition the floater which might have been shifted to cascade floater->setRect(pos); diff --git a/indra/newview/llscriptfloater.h b/indra/newview/llscriptfloater.h index 73e20e36ad..551d3ef4f8 100644 --- a/indra/newview/llscriptfloater.h +++ b/indra/newview/llscriptfloater.h @@ -227,7 +227,9 @@ protected: /*virtual*/ void onFocusReceived(); - void dockToChiclet(bool dock); + // FIRE-12929: Fix script floater docking issues + //void dockToChiclet(bool dock); + void dockToChiclet(bool dock, bool scroll_to_chiclet = true); private: bool isScriptTextbox(LLNotificationPtr notification); diff --git a/indra/newview/llsearchableui.cpp b/indra/newview/llsearchableui.cpp index bbaf20ab30..acd325e0af 100644 --- a/indra/newview/llsearchableui.cpp +++ b/indra/newview/llsearchableui.cpp @@ -68,7 +68,10 @@ ll::prefs::PanelData::~PanelData() bool ll::prefs::PanelData::hightlightAndHide( LLWString const &aFilter ) { for( tSearchableItemList::iterator itr = mChildren.begin(); itr != mChildren.end(); ++itr ) - (*itr)->setNotHighlighted( ); + (*itr)->setNotHighlighted(); + + for (tPanelDataList::iterator itr = mChildPanel.begin(); itr != mChildPanel.end(); ++itr) + (*itr)->setNotHighlighted(); // FIRE-23969: This breaks prefs search - and isn't needed on FS //if (aFilter.empty()) @@ -87,6 +90,15 @@ bool ll::prefs::PanelData::hightlightAndHide( LLWString const &aFilter ) return bVisible; } +void ll::prefs::PanelData::setNotHighlighted() +{ + for (tSearchableItemList::iterator itr = mChildren.begin(); itr != mChildren.end(); ++itr) + (*itr)->setNotHighlighted(); + + for (tPanelDataList::iterator itr = mChildPanel.begin(); itr != mChildPanel.end(); ++itr) + (*itr)->setNotHighlighted(); +} + bool ll::prefs::TabContainerData::hightlightAndHide( LLWString const &aFilter ) { for( tSearchableItemList::iterator itr = mChildren.begin(); itr != mChildren.end(); ++itr ) diff --git a/indra/newview/llsearchableui.h b/indra/newview/llsearchableui.h index 9741557e49..e033cae3ab 100644 --- a/indra/newview/llsearchableui.h +++ b/indra/newview/llsearchableui.h @@ -73,6 +73,7 @@ namespace ll virtual ~PanelData(); + void setNotHighlighted(); virtual bool hightlightAndHide( LLWString const &aFilter ); }; diff --git a/indra/newview/llsecapi.cpp b/indra/newview/llsecapi.cpp index 7fabe7fbf4..78c8aa1dcf 100644 --- a/indra/newview/llsecapi.cpp +++ b/indra/newview/llsecapi.cpp @@ -135,7 +135,7 @@ LLSD LLCredential::getLoginParams() else if (mIdentifier["type"].asString() == "account") { result["username"] = mIdentifier["account_name"]; - result["passwd"] = mAuthenticator["secret"]; + result["passwd"] = mAuthenticator["secret"].asString(); username = result["username"].asString(); } } diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index eab23eeae9..4763f1e263 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -1126,10 +1126,7 @@ LLSelectNode *LLSelectMgr::getPrimaryHoverNode() return mHoverObjects->mSelectNodeMap[mHoverObjects->mPrimaryObject]; } -// Color per highlighted object -//void LLSelectMgr::highlightObjectOnly(LLViewerObject* objectp) -void LLSelectMgr::highlightObjectOnly(LLViewerObject *objectp, LLColor4 const &aColor ) -// +void LLSelectMgr::highlightObjectOnly(LLViewerObject* objectp) { if (!objectp) { @@ -1163,8 +1160,6 @@ void LLSelectMgr::highlightObjectOnly(LLViewerObject *objectp, LLColor4 const &a // mRectSelectedObjects.insert(objectp); - - mHighlightColor[ objectp ] = aColor; // Color per highlighted object } void LLSelectMgr::highlightObjectAndFamily(LLViewerObject* objectp) @@ -1226,7 +1221,6 @@ void LLSelectMgr::unhighlightObjectOnly(LLViewerObject* objectp) } mRectSelectedObjects.erase(objectp); - mHighlightColor.erase( objectp ); // Color per highlighted object } void LLSelectMgr::unhighlightObjectAndFamily(LLViewerObject* objectp) @@ -1254,8 +1248,6 @@ void LLSelectMgr::unhighlightAll() { mRectSelectedObjects.clear(); mHighlightedObjects->deleteAllNodes(); - - mHighlightColor.clear(); // Color per highlighted object } LLObjectSelectionHandle LLSelectMgr::selectHighlightedObjects() @@ -5969,11 +5961,6 @@ void LLSelectMgr::updateSilhouettes() LLSelectNode* rect_select_root_node = new LLSelectNode(objectp, TRUE); rect_select_root_node->selectAllTEs(TRUE); - // Color per highlighted object - if( mHighlightColor.find( objectp ) != mHighlightColor.end() ) - rect_select_root_node->mHighlightColor = mHighlightColor[ objectp ]; - // - if (!select_linked_set) { rect_select_root_node->mIndividualSelection = TRUE; @@ -6235,7 +6222,7 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud) gGL.popMatrix(); gGL.popMatrix(); - glLineWidth(1.f); + gGL.setLineWidth(1.f); // Line width OGL core profile fix by Rye Mutt glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); if (shader) @@ -6713,17 +6700,8 @@ BOOL LLSelectNode::allowOperationOnNode(PermissionBit op, U64 group_proxy_power) //----------------------------------------------------------------------------- // renderOneSilhouette() //----------------------------------------------------------------------------- -// Color per highlighted object -//void LLSelectNode::renderOneSilhouette(const LLColor4 &color) -void LLSelectNode::renderOneSilhouette(const LLColor4 &aColor) -// +void LLSelectNode::renderOneSilhouette(const LLColor4 &color) { - // Color per highlighted object - LLColor4 color( aColor ); - if( this->mHighlightColor.lengthSquared() > 0 ) - color = this->mHighlightColor; - // - LLViewerObject* objectp = getObject(); if (!objectp) { diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h index e9ca79797d..bb0080b5ff 100644 --- a/indra/newview/llselectmgr.h +++ b/indra/newview/llselectmgr.h @@ -247,8 +247,6 @@ public: std::vector mSilhouetteNormals; // array of normals to render silhouette of object BOOL mSilhouetteExists; // need to generate silhouette? - LLColor4 mHighlightColor; // Color per highlighted object - protected: LLPointer mObject; S32 mTESelectMask; @@ -568,11 +566,7 @@ public: LLSelectNode *getHoverNode(); LLSelectNode *getPrimaryHoverNode(); - // Color per highlighted object - // void highlightObjectOnly(LLViewerObject *objectp); - void highlightObjectOnly(LLViewerObject *objectp, LLColor4 const &aColor = LLColor4() ); - // - + void highlightObjectOnly(LLViewerObject *objectp); void highlightObjectAndFamily(LLViewerObject *objectp); void highlightObjectAndFamily(const std::vector& list); @@ -945,8 +939,6 @@ private: LLObjectSelectionHandle mHoverObjects; LLObjectSelectionHandle mHighlightedObjects; std::set > mRectSelectedObjects; - - std::map< LLPointer< LLViewerObject >, LLColor4 > mHighlightColor; // Color per highlighted object LLObjectSelection mGridObjects; LLQuaternion mGridRotation; diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index 26d5facf1b..bdf5a3a2bd 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -104,7 +104,10 @@ BOOL LLSidepanelAppearance::postBuild() childSetAction("edit_outfit_btn", boost::bind(&LLSidepanelAppearance::showOutfitEditPanel, this)); - mFilterEditor = getChild("Filter"); + // Don't filter outfits list on keypress + //mFilterEditor = getChild("Filter"); + mFilterEditor = findChild("Filter"); + // if (mFilterEditor) { mFilterEditor->setCommitCallback(boost::bind(&LLSidepanelAppearance::onFilterEdit, this, _2)); diff --git a/indra/newview/llsidepanelappearance.h b/indra/newview/llsidepanelappearance.h index 1db7ec4a9c..90025d9619 100644 --- a/indra/newview/llsidepanelappearance.h +++ b/indra/newview/llsidepanelappearance.h @@ -33,7 +33,10 @@ #include "llinventory.h" #include "llpaneloutfitedit.h" -class LLFilterEditor; +// Don't filter outfits list on keypress +//class LLFilterEditor; +class LLSearchEditor; +// class LLCurrentlyWornFetchObserver; class LLPanelEditWearable; class LLViewerWearable; @@ -91,7 +94,10 @@ private: void toggleOutfitEditPanel(BOOL visible, BOOL disable_camera_switch = FALSE); void toggleWearableEditPanel(BOOL visible, LLViewerWearable* wearable = NULL, BOOL disable_camera_switch = FALSE); - LLFilterEditor* mFilterEditor; + // Don't filter outfits list on keypress + //LLFilterEditor* mFilterEditor; + LLSearchEditor* mFilterEditor; + // LLPanelOutfitsInventory* mPanelOutfitsInventory; LLPanelOutfitEdit* mOutfitEdit; LLPanelEditWearable* mEditWearable; diff --git a/indra/newview/llsnapshotlivepreview.cpp b/indra/newview/llsnapshotlivepreview.cpp index eb46895b10..f3df947a71 100644 --- a/indra/newview/llsnapshotlivepreview.cpp +++ b/indra/newview/llsnapshotlivepreview.cpp @@ -160,7 +160,7 @@ F32 LLSnapshotLivePreview::getImageAspect() void LLSnapshotLivePreview::updateSnapshot(BOOL new_snapshot, BOOL new_thumbnail, F32 delay) { - LL_DEBUGS() << "updateSnapshot: mSnapshotUpToDate = " << getSnapshotUpToDate() << LL_ENDL; + LL_DEBUGS("Snapshot") << "updateSnapshot: mSnapshotUpToDate = " << getSnapshotUpToDate() << LL_ENDL; // Update snapshot if requested. if (new_snapshot) @@ -243,11 +243,11 @@ void LLSnapshotLivePreview::drawPreviewRect(S32 offset_x, S32 offset_y) { F32 line_width ; glGetFloatv(GL_LINE_WIDTH, &line_width) ; - glLineWidth(2.0f * line_width) ; + gGL.setLineWidth(2.0f * line_width) ; // Line width OGL core profile fix by Rye Mutt LLColor4 color(0.0f, 0.0f, 0.0f, 1.0f) ; gl_rect_2d( mPreviewRect.mLeft + offset_x, mPreviewRect.mTop + offset_y, mPreviewRect.mRight + offset_x, mPreviewRect.mBottom + offset_y, color, FALSE ) ; - glLineWidth(line_width) ; + gGL.setLineWidth(line_width) ; // Line width OGL core profile fix by Rye Mutt //draw four alpha rectangles to cover areas outside of the snapshot image if(!mKeepAspectRatio) @@ -372,7 +372,7 @@ void LLSnapshotLivePreview::draw() } else if (mShineAnimTimer.getStarted()) { - LL_DEBUGS() << "Drawing shining animation" << LL_ENDL; + LL_DEBUGS("Snapshot") << "Drawing shining animation" << LL_ENDL; F32 shine_interp = llmin(1.f, mShineAnimTimer.getElapsedTimeF32() / SHINE_TIME); // draw "shine" effect @@ -450,7 +450,7 @@ void LLSnapshotLivePreview::draw() S32 old_image_index = (mCurImageIndex + 1) % 2; if (mViewerImage[old_image_index].notNull() && mFallAnimTimer.getElapsedTimeF32() < FALL_TIME) { - LL_DEBUGS() << "Drawing fall animation" << LL_ENDL; + LL_DEBUGS("Snapshot") << "Drawing fall animation" << LL_ENDL; F32 fall_interp = mFallAnimTimer.getElapsedTimeF32() / FALL_TIME; F32 alpha = clamp_rescale(fall_interp, 0.f, 1.f, 0.8f, 0.4f); LLColor4 image_color(1.f, 1.f, 1.f, alpha); @@ -517,7 +517,7 @@ void LLSnapshotLivePreview::reshape(S32 width, S32 height, BOOL called_from_pare LLView::reshape(width, height, called_from_parent); if (old_rect.getWidth() != width || old_rect.getHeight() != height) { - LL_DEBUGS() << "window reshaped, updating thumbnail" << LL_ENDL; + LL_DEBUGS("Window", "Snapshot") << "window reshaped, updating thumbnail" << LL_ENDL; if (mViewContainer && mViewContainer->isInVisibleChain()) { // We usually resize only on window reshape, so give it a chance to redraw, assign delay @@ -693,7 +693,7 @@ void LLSnapshotLivePreview::generateThumbnailImage(BOOL force_update) } else { - LL_WARNS() << "Couldn't find a path to the following filter : " << getFilter() << LL_ENDL; + LL_WARNS("Snapshot") << "Couldn't find a path to the following filter : " << getFilter() << LL_ENDL; } } // Scale to a power of 2 so it can be mapped to a texture @@ -741,7 +741,7 @@ LLViewerTexture* LLSnapshotLivePreview::getBigThumbnailImage() } else { - LL_WARNS() << "Couldn't find a path to the following filter : " << getFilter() << LL_ENDL; + LL_WARNS("Snapshot") << "Couldn't find a path to the following filter : " << getFilter() << LL_ENDL; } } // Scale to a power of 2 so it can be mapped to a texture @@ -761,7 +761,7 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview ) LLSnapshotLivePreview* previewp = (LLSnapshotLivePreview*)snapshot_preview; if (previewp->getWidth() == 0 || previewp->getHeight() == 0) { - LL_WARNS() << "Incorrect dimensions: " << previewp->getWidth() << "x" << previewp->getHeight() << LL_ENDL; + LL_WARNS("Snapshot") << "Incorrect dimensions: " << previewp->getWidth() << "x" << previewp->getHeight() << LL_ENDL; return FALSE; } @@ -792,7 +792,7 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview ) previewp->mCameraRot = new_camera_rot; // request a new snapshot whenever the camera moves, with a time delay BOOL new_snapshot = gSavedSettings.getBOOL("AutoSnapshot") || previewp->mForceUpdateSnapshot; - LL_DEBUGS() << "camera moved, updating thumbnail" << LL_ENDL; + LL_DEBUGS("Snapshot") << "camera moved, updating thumbnail" << LL_ENDL; previewp->updateSnapshot( 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. @@ -808,7 +808,7 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview ) // time to produce a snapshot if(!previewp->getSnapshotUpToDate()) { - LL_DEBUGS() << "producing snapshot" << LL_ENDL; + LL_DEBUGS("Snapshot") << "producing snapshot" << LL_ENDL; if (!previewp->mPreviewImage) { previewp->mPreviewImage = new LLImageRaw; @@ -858,7 +858,7 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview ) previewp->getWindow()->decBusyCount(); previewp->setVisible(gSavedSettings.getBOOL("UseFreezeFrame") && previewp->mAllowFullScreenPreview); // only show fullscreen preview when in freeze frame mode previewp->mSnapshotActive = FALSE; - LL_DEBUGS() << "done creating snapshot" << LL_ENDL; + LL_DEBUGS("Snapshot") << "done creating snapshot" << LL_ENDL; } if (!previewp->getThumbnailUpToDate()) @@ -949,7 +949,7 @@ LLPointer LLSnapshotLivePreview::getEncodedImage() if (getSnapshotType() == LLSnapshotModel::SNAPSHOT_TEXTURE) { // We don't store the intermediate formatted image in mFormattedImage in the J2C case - LL_DEBUGS() << "Encoding new image of format J2C" << LL_ENDL; + LL_DEBUGS("Snapshot") << "Encoding new image of format J2C" << LL_ENDL; LLPointer formatted = new LLImageJ2C; // Copy the preview LLPointer scaled = new LLImageRaw( @@ -1034,13 +1034,13 @@ LLPointer LLSnapshotLivePreview::getFormattedImage() } else { - LL_WARNS() << "Couldn't find a path to the following filter : " << getFilter() << LL_ENDL; + LL_WARNS("Snapshot") << "Couldn't find a path to the following filter : " << getFilter() << LL_ENDL; } } // Create the new formatted image of the appropriate format. LLSnapshotModel::ESnapshotFormat format = getSnapshotFormat(); - LL_DEBUGS() << "Encoding new image of format " << format << LL_ENDL; + LL_DEBUGS("Snapshot") << "Encoding new image of format " << format << LL_ENDL; switch (format) { @@ -1065,7 +1065,7 @@ LLPointer LLSnapshotLivePreview::getFormattedImage() void LLSnapshotLivePreview::setSize(S32 w, S32 h) { - LL_DEBUGS() << "setSize(" << w << ", " << h << ")" << LL_ENDL; + LL_DEBUGS("Snapshot") << "setSize(" << w << ", " << h << ")" << LL_ENDL; setWidth(w); setHeight(h); } @@ -1087,7 +1087,7 @@ void LLSnapshotLivePreview::getSize(S32& w, S32& h) const void LLSnapshotLivePreview::saveTexture(BOOL outfit_snapshot, std::string name) { - LL_DEBUGS() << "saving texture: " << mPreviewImage->getWidth() << "x" << mPreviewImage->getHeight() << LL_ENDL; + LL_DEBUGS("Snapshot") << "saving texture: " << mPreviewImage->getWidth() << "x" << mPreviewImage->getHeight() << LL_ENDL; // gen a new uuid for this asset LLTransactionID tid; tid.generate(); @@ -1110,12 +1110,12 @@ void LLSnapshotLivePreview::saveTexture(BOOL outfit_snapshot, std::string name) } else { - LL_WARNS() << "Couldn't find a path to the following filter : " << getFilter() << LL_ENDL; + LL_WARNS("Snapshot") << "Couldn't find a path to the following filter : " << getFilter() << LL_ENDL; } } scaled->biasedScaleToPowerOfTwo(MAX_TEXTURE_SIZE); - LL_DEBUGS() << "scaled texture to " << scaled->getWidth() << "x" << scaled->getHeight() << LL_ENDL; + LL_DEBUGS("Snapshot") << "scaled texture to " << scaled->getWidth() << "x" << scaled->getHeight() << LL_ENDL; if (formatted->encode(scaled, 0.0f)) { @@ -1143,7 +1143,7 @@ void LLSnapshotLivePreview::saveTexture(BOOL outfit_snapshot, std::string name) else { LLNotificationsUtil::add("ErrorEncodingSnapshot"); - LL_WARNS() << "Error encoding snapshot" << LL_ENDL; + LL_WARNS("Snapshot") << "Error encoding snapshot" << LL_ENDL; } add(LLStatViewer::SNAPSHOT, 1); diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 4112de4377..2d5f0dc923 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -1738,12 +1738,12 @@ void renderOctree(LLSpatialGroup* group) gGL.diffuseColor4f(1,0,0,group->mBuilt); gGL.flush(); - glLineWidth(5.f); + gGL.setLineWidth(5.f); // Line width OGL core profile fix by Rye Mutt const LLVector4a* bounds = group->getObjectBounds(); drawBoxOutline(bounds[0], bounds[1]); gGL.flush(); - glLineWidth(1.f); + gGL.setLineWidth(1.f); // Line width OGL core profile fix by Rye Mutt gGL.flush(); for (LLSpatialGroup::element_iter i = group->getDataBegin(); i != group->getDataEnd(); ++i) { @@ -1880,10 +1880,10 @@ void renderVisibility(LLSpatialGroup* group, LLCamera* camera) pushBufferVerts(group, LLVertexBuffer::MAP_VERTEX, false); glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - glLineWidth(4.f); + gGL.setLineWidth(4.f); // Line width OGL core profile fix by Rye Mutt gGL.diffuseColor4f(0.f, 0.5f, 0.f, 1.f); pushBufferVerts(group, LLVertexBuffer::MAP_VERTEX, false); - glLineWidth(1.f); + gGL.setLineWidth(1.f); // Line width OGL core profile fix by Rye Mutt glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); bool selected = false; @@ -2257,12 +2257,12 @@ void renderBoundingBox(LLDrawable* drawable, BOOL set_color = TRUE) if (vobj && vobj->onActiveList()) { gGL.flush(); - glLineWidth(llmax(4.f*sinf(gFrameTimeSeconds*2.f)+1.f, 1.f)); - //glLineWidth(4.f*(sinf(gFrameTimeSeconds*2.f)*0.25f+0.75f)); + gGL.setLineWidth(llmax(4.f*sinf(gFrameTimeSeconds*2.f)+1.f, 1.f)); // Line width OGL core profile fix by Rye Mutt + //gGL.setLineWidth(4.f*(sinf(gFrameTimeSeconds*2.f)*0.25f+0.75f)); // Line width OGL core profile fix by Rye Mutt stop_glerror(); drawBoxOutline(pos,size); gGL.flush(); - glLineWidth(1.f); + gGL.setLineWidth(1.f); // Line width OGL core profile fix by Rye Mutt } else { @@ -2462,10 +2462,10 @@ void render_hull(LLModel::PhysicsMesh& mesh, const LLColor4& color, const LLColo LLGLEnable offset(GL_POLYGON_OFFSET_LINE); glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); glPolygonOffset(3.f, 3.f); - glLineWidth(3.f); + gGL.setLineWidth(3.f); // Line width OGL core profile fix by Rye Mutt gGL.diffuseColor4fv(line_color.mV); LLVertexBuffer::drawArrays(LLRender::TRIANGLES, mesh.mPositions, mesh.mNormals); - glLineWidth(1.f); + gGL.setLineWidth(1.f); // Line width OGL core profile fix by Rye Mutt glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); } @@ -3237,7 +3237,7 @@ public: if (i == 1) { gGL.flush(); - glLineWidth(3.f); + gGL.setLineWidth(3.f); // Line width OGL core profile fix by Rye Mutt } gGL.begin(LLRender::TRIANGLES); @@ -3256,7 +3256,7 @@ public: if (i == 1) { gGL.flush(); - glLineWidth(1.f); + gGL.setLineWidth(1.f); // Line width OGL core profile fix by Rye Mutt } } } @@ -3269,13 +3269,13 @@ void renderRaycast(LLDrawable* drawablep) LLGLEnable blend(GL_BLEND); gGL.diffuseColor4f(0,1,1,0.5f); - if (drawablep->getVOVolume()) + LLVOVolume* vobj = drawablep->getVOVolume(); + if (vobj && !vobj->isDead()) { //glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); //pushVerts(drawablep->getFace(gDebugRaycastFaceHit), LLVertexBuffer::MAP_VERTEX); //glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - LLVOVolume* vobj = drawablep->getVOVolume(); LLVolume* volume = vobj->getVolume(); bool transform = true; @@ -3516,7 +3516,7 @@ public: for (OctreeNode::const_element_iter i = branch->getDataBegin(); i != branch->getDataEnd(); ++i) { LLDrawable* drawable = (LLDrawable*)(*i)->getDrawable(); - if(!drawable) + if(!drawable || drawable->isDead()) { continue; } @@ -3860,11 +3860,11 @@ void LLSpatialPartition::renderPhysicsShapes() gGL.flush(); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - glLineWidth(3.f); + gGL.setLineWidth(3.f); // Line width OGL core profile fix by Rye Mutt LLOctreeRenderPhysicsShapes render_physics(camera); render_physics.traverse(mOctree); gGL.flush(); - glLineWidth(1.f); + gGL.setLineWidth(1.f); // Line width OGL core profile fix by Rye Mutt } void LLSpatialPartition::renderDebug() diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index e9b7badb46..7a839d7b1b 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1522,8 +1522,11 @@ bool idle_startup() // Load location history LLLocationHistory::getInstance()->load(); + // FIRE-10607: Avatar icon controls show wrong picture when switching between SL main/beta grid + // Moved further down until we know what grid we are connecting to // Load Avatars icons cache - LLAvatarIconIDCache::getInstance()->load(); + //LLAvatarIconIDCache::getInstance()->load(); + // // [FS Persisted Avatar Render Settings] //LLRenderMuteList::getInstance()->loadFromFile(); @@ -1880,6 +1883,11 @@ bool idle_startup() } // + // FIRE-10607: Avatar icon controls show wrong picture when switching between SL main/beta grid + // Load Avatars icons cache - once we know the grid we are connecting to + LLAvatarIconIDCache::getInstance()->load(); + // + // Restore original LLMessageSystem HTTP options for OpenSim gMessageSystem->setIsInSecondLife(LLGridManager::getInstance()->isInSecondLife()); @@ -1888,7 +1896,6 @@ bool idle_startup() display_startup(); gAgentCamera.init(); display_startup(); - set_underclothes_menu_options(); display_startup(); // Since we connected, save off the settings so the user doesn't have to diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 011203494d..134dfd5a73 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -588,6 +588,7 @@ void LLStatusBar::refresh() } // Pathfinding rebake functions + LLMenuOptionPathfindingRebakeNavmesh& navmesh = LLMenuOptionPathfindingRebakeNavmesh::instance(); static LLMenuOptionPathfindingRebakeNavmesh::ERebakeNavMeshMode pathfinding_mode = LLMenuOptionPathfindingRebakeNavmesh::kRebakeNavMesh_Default; LLViewerRegion* current_region = gAgent.getRegion(); @@ -597,7 +598,7 @@ void LLStatusBar::refresh() bakingStarted = false; mRebakeStuck = false; } - if (LLMenuOptionPathfindingRebakeNavmesh::getInstance()->isRebaking()) + if (navmesh.isRebaking()) { if (!bakingStarted) { @@ -615,9 +616,9 @@ void LLStatusBar::refresh() updateParcelIcons(); } } - else if (pathfinding_mode != LLMenuOptionPathfindingRebakeNavmesh::getInstance()->getMode()) + else if (pathfinding_mode != navmesh.getMode()) { - pathfinding_mode = LLMenuOptionPathfindingRebakeNavmesh::getInstance()->getMode(); + pathfinding_mode = navmesh.getMode(); updateParcelIcons(); } // @@ -661,7 +662,7 @@ void LLStatusBar::refresh() ); mMediaToggle->setEnabled(button_enabled); // Note the "sense" of the toggle is opposite whether media is playing or not - bool any_media_playing = (media_inst->isAnyMediaShowing() || + bool any_media_playing = (media_inst->isAnyMediaPlaying() || media_inst->isParcelMediaPlaying()); mMediaToggle->setValue(!any_media_playing); @@ -1382,9 +1383,10 @@ void LLStatusBar::updateParcelIcons() bool is_for_sale = (!current_parcel->isPublic() && vpm->canAgentBuyParcel(current_parcel, false)); bool pathfinding_dynamic_enabled = agent_region->dynamicPathfindingEnabled(); - bool pathfinding_navmesh_dirty = LLMenuOptionPathfindingRebakeNavmesh::getInstance()->isRebakeNeeded(); + LLMenuOptionPathfindingRebakeNavmesh& navmesh = LLMenuOptionPathfindingRebakeNavmesh::instance(); + bool pathfinding_navmesh_dirty = navmesh.isRebakeNeeded(); F32 pathfinding_dirty_icon_alpha = 1.0f; - if (LLMenuOptionPathfindingRebakeNavmesh::getInstance()->isRebaking()) + if (navmesh.isRebaking()) { // Stop the blinking after a while if (mRebakeStuck) diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp index d56c98a516..72c7d4715b 100644 --- a/indra/newview/llsyswellwindow.cpp +++ b/indra/newview/llsyswellwindow.cpp @@ -54,7 +54,8 @@ LLSysWellWindow::LLSysWellWindow(const LLSD& key) : LLTransientDockableFloater(N mSysWellChiclet(NULL), NOTIFICATION_WELL_ANCHOR_NAME("notification_well_panel"), IM_WELL_ANCHOR_NAME("im_well_panel"), - mIsReshapedByUser(false) + mIsReshapedByUser(false), + mIsFirstOpen(true) // FIRE-11537: Fix well lists size appearing random { setOverlapsScreenChannel(true); @@ -71,6 +72,27 @@ BOOL LLSysWellWindow::postBuild() return LLTransientDockableFloater::postBuild(); } +// FIRE-11537: Fix well lists size appearing random +void LLSysWellWindow::onOpen(const LLSD& key) +{ + if (mIsFirstOpen) + { + mReshapedByUserControlName = mInstanceName + "_user_reshaped"; + if (!getControlGroup()->controlExists(mReshapedByUserControlName)) + { + getControlGroup()->declareBOOL(mReshapedByUserControlName, FALSE, llformat("Has system well %s been resized by the user", mInstanceName.c_str()), LLControlVariable::PERSIST_NONDFT); + } + mIsReshapedByUser = getControlGroup()->getBOOL(mReshapedByUserControlName); + + mIsFirstOpen = false; + } + + reshapeWindow(); + + LLTransientDockableFloater::onOpen(key); +} +// + //--------------------------------------------------------------------------------- void LLSysWellWindow::setMinimized(BOOL minimize) { @@ -81,6 +103,14 @@ void LLSysWellWindow::setMinimized(BOOL minimize) void LLSysWellWindow::handleReshape(const LLRect& rect, bool by_user) { mIsReshapedByUser |= by_user; // mark floater that it is reshaped by user + + // FIRE-11537: Fix well lists size appearing random + if (by_user) + { + getControlGroup()->setBOOL(mReshapedByUserControlName, TRUE); + } + // + LLTransientDockableFloater::handleReshape(rect, by_user); } @@ -208,7 +238,10 @@ void LLSysWellWindow::reshapeWindow() // it includes height from floater top to list top and from floater bottom and list bottom static S32 parent_list_delta_height = getRect().getHeight() - mMessageList->getRect().getHeight(); - if (!mIsReshapedByUser) // Don't reshape Well window, if it ever was reshaped by user. See EXT-5715. + // FIRE-11537: Fix well lists size appearing random + //if (!mIsReshapedByUser) // Don't reshape Well window, if it ever was reshaped by user. See EXT-5715. + if (gSavedSettings.getBOOL("FSLegacyNotificationWellAutoResize") || (!mIsReshapedByUser && !mIsFirstOpen)) + // { S32 notif_list_height = mMessageList->getItemsRect().getHeight() + 2 * mMessageList->getBorderWidth(); diff --git a/indra/newview/llsyswellwindow.h b/indra/newview/llsyswellwindow.h index 6524f8df4d..3957047e1a 100644 --- a/indra/newview/llsyswellwindow.h +++ b/indra/newview/llsyswellwindow.h @@ -55,7 +55,10 @@ public: LLSysWellWindow(const LLSD& key); virtual ~LLSysWellWindow(); - BOOL postBuild(); + BOOL postBuild() override; + + // FIRE-11537: Fix well lists size appearing random + virtual void onOpen(const LLSD& key) override; // other interface functions // check is window empty @@ -66,12 +69,12 @@ public: LLPanel * findItemByID(const LLUUID& id); // Operating with outfit - virtual void setVisible(BOOL visible); + virtual void setVisible(BOOL visible) override; void adjustWindowPosition(); - /*virtual*/ void setDocked(bool docked, bool pop_on_undock = true); + /*virtual*/ void setDocked(bool docked, bool pop_on_undock = true) override; // override LLFloater's minimization according to EXT-1216 - /*virtual*/ void setMinimized(BOOL minimize); - /*virtual*/ void handleReshape(const LLRect& rect, bool by_user); + /*virtual*/ void setMinimized(BOOL minimize) override; + /*virtual*/ void handleReshape(const LLRect& rect, bool by_user) override; void onStartUpToastClick(S32 x, S32 y, MASK mask); @@ -101,6 +104,10 @@ protected: LLSysWellChiclet* mSysWellChiclet; bool mIsReshapedByUser; + + // FIRE-11537: Fix well lists size appearing random + std::string mReshapedByUserControlName; + bool mIsFirstOpen; }; // Optional legacy notification well diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index f95a7acaa3..5532843972 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -52,7 +52,8 @@ const S32 TEXTURE_CACHE_ENTRY_SIZE = FIRST_PACKET_SIZE;//1024; const F32 TEXTURE_CACHE_PURGE_AMOUNT = .20f; // % amount to reduce the cache by when it exceeds its limit const F32 TEXTURE_CACHE_LRU_SIZE = .10f; // % amount for LRU list (low overhead to regenerate) const S32 TEXTURE_FAST_CACHE_ENTRY_OVERHEAD = sizeof(S32) * 4; //w, h, c, level -const S32 TEXTURE_FAST_CACHE_ENTRY_SIZE = 16 * 16 * 4 + TEXTURE_FAST_CACHE_ENTRY_OVERHEAD; +const S32 TEXTURE_FAST_CACHE_DATA_SIZE = 16 * 16 * 4; +const S32 TEXTURE_FAST_CACHE_ENTRY_SIZE = TEXTURE_FAST_CACHE_DATA_SIZE + TEXTURE_FAST_CACHE_ENTRY_OVERHEAD; const F32 TEXTURE_LAZY_PURGE_TIME_LIMIT = .004f; // 4ms. Would be better to autoadjust, but there is a major cache rework in progress. class LLTextureCacheWorker : public LLWorkerClass @@ -616,6 +617,9 @@ bool LLTextureCacheRemoteWorker::doWrite() if(idx >= 0) { // write to the fast cache. + // mRawImage is not entirely safe here since it is a pointer to one owned by cache worker, + // it could have been retrieved via getRequestFinished() and then modified. + // If writeToFastCache crashes, something is wrong around fetch worker. if(!mCache->writeToFastCache(mID, idx, mRawImage, mRawDiscardLevel)) { LL_WARNS() << "writeToFastCache failed" << LL_ENDL; @@ -2107,7 +2111,9 @@ LLPointer LLTextureCache::readFromFastCache(const LLUUID& id, S32& d } S32 image_size = head[0] * head[1] * head[2]; - if(!image_size) //invalid + if(image_size <= 0 + || image_size > TEXTURE_FAST_CACHE_DATA_SIZE + || head[3] < 0) //invalid { closeFastCache(); return NULL; @@ -2186,7 +2192,7 @@ bool LLTextureCache::writeToFastCache(LLUUID image_id, S32 id, LLPointer> i) * (h >> i) * c) > TEXTURE_FAST_CACHE_ENTRY_SIZE - TEXTURE_FAST_CACHE_ENTRY_OVERHEAD) + while(((w >> i) * (h >> i) * c) > TEXTURE_FAST_CACHE_DATA_SIZE) { ++i ; } @@ -2197,8 +2203,8 @@ bool LLTextureCache::writeToFastCache(LLUUID image_id, S32 id, LLPointer>= i; if(w * h *c > 0) //valid { - //make a duplicate to keep the original raw image untouched. - + // Make a duplicate to keep the original raw image untouched. + // Might be good idea to do a copy during writeToCache() call instead of here try { #if LL_WINDOWS diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index cce94dffd4..e9ca039f53 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -152,17 +152,25 @@ void LLFloaterTexturePicker::setImageID(const LLUUID& image_id, bool set_selecti if (LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(mImageAssetID)) { - if ( mBakeTextureEnabled && mModeSelector->getValue().asInteger() != 2) + // FIRE-30431: Keep radio button mode selection in texture selection + //if ( mBakeTextureEnabled && mModeSelector->getValue().asInteger() != 2) + if ( mBakeTextureEnabled && mModeSelector->getSelectedIndex() != 2) { - mModeSelector->selectByValue(2); + // FIRE-30431: Keep radio button mode selection in texture selection + //mModeSelector->selectByValue(2); + mModeSelector->setSelectedIndex(2, 0); onModeSelect(0,this); } } else { - if (mModeSelector->getValue().asInteger() == 2) + // FIRE-30431: Keep radio button mode selection in texture selection + //if (mModeSelector->getValue().asInteger() == 2) + if (mModeSelector->getSelectedIndex() == 2) { - mModeSelector->selectByValue(0); + // FIRE-30431: Keep radio button mode selection in texture selection + //mModeSelector->selectByValue(0); + mModeSelector->setSelectedIndex(0, 0); onModeSelect(0,this); } @@ -417,9 +425,14 @@ BOOL LLFloaterTexturePicker::postBuild() mInventoryPanel = getChild("inventory panel"); - mModeSelector = getChild("mode_selection"); + // FIRE-30431: Keep radio button mode selection in texture selection + //mModeSelector = getChild("mode_selection"); + //mModeSelector->setCommitCallback(onModeSelect, this); + //mModeSelector->selectByValue(0); + mModeSelector = getChild("mode_selection"); mModeSelector->setCommitCallback(onModeSelect, this); - mModeSelector->selectByValue(0); + mModeSelector->setSelectedIndex(0, 0); + // if(mInventoryPanel) { @@ -870,7 +883,9 @@ void LLFloaterTexturePicker::onSelectionChange(const std::dequemModeSelector->getValue().asInteger(); + // FIRE-30431: Keep radio button mode selection in texture selection + //int index = self->mModeSelector->getValue().asInteger(); + int index = self->mModeSelector->getSelectedIndex(); self->getChild("Default")->setVisible(index == 0 ? TRUE : FALSE); self->getChild("Blank")->setVisible(index == 0 ? TRUE : FALSE); @@ -1213,28 +1228,45 @@ void LLFloaterTexturePicker::onFilterEdit(const std::string& search_string ) void LLFloaterTexturePicker::setLocalTextureEnabled(BOOL enabled) { - mModeSelector->setEnabledByValue(1, enabled); -} + // FIRE-30431: Keep radio button mode selection in texture selection + //mModeSelector->setEnabledByValue(1, enabled); + mModeSelector->setIndexEnabled(1,enabled);} void LLFloaterTexturePicker::setBakeTextureEnabled(BOOL enabled) { BOOL changed = (enabled != mBakeTextureEnabled); mBakeTextureEnabled = enabled; - mModeSelector->setEnabledByValue(2, enabled); + // FIRE-30431: Keep radio button mode selection in texture selection + //mModeSelector->setEnabledByValue(2, enabled); - if (!mBakeTextureEnabled && (mModeSelector->getValue().asInteger() == 2)) + //if (!mBakeTextureEnabled && (mModeSelector->getValue().asInteger() == 2)) + //{ + // mModeSelector->selectByValue(0); + //} + // + //if (changed && mBakeTextureEnabled && LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(mImageAssetID)) + //{ + // if (mModeSelector->getValue().asInteger() != 2) + // { + // mModeSelector->selectByValue(2); + // } + //} + mModeSelector->setIndexEnabled(2, enabled); + + if (!mBakeTextureEnabled && (mModeSelector->getSelectedIndex() == 2)) { - mModeSelector->selectByValue(0); + mModeSelector->setSelectedIndex(0, 0); } if (changed && mBakeTextureEnabled && LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(mImageAssetID)) { - if (mModeSelector->getValue().asInteger() != 2) + if (mModeSelector->getSelectedIndex() != 2) { - mModeSelector->selectByValue(2); + mModeSelector->setSelectedIndex(2, 0); } } + // onModeSelect(0, this); } diff --git a/indra/newview/lltexturectrl.h b/indra/newview/lltexturectrl.h index 470708319e..10e1f0e1d5 100644 --- a/indra/newview/lltexturectrl.h +++ b/indra/newview/lltexturectrl.h @@ -43,7 +43,9 @@ #include "llviewertexture.h" #include "llwindow.h" -class LLComboBox; +// FIRE-30431: Keep radio button mode selection in texture selection +//class LLComboBox; +class LLRadioGroup; class LLFloaterTexturePicker; class LLInventoryItem; class LLViewerFetchedTexture; @@ -382,7 +384,9 @@ protected: LLSaveFolderState mSavedFolderState; BOOL mSelectedItemPinned; - LLComboBox* mModeSelector; + // FIRE-30431: Keep radio button mode selection in texture selection + //LLComboBox* mModeSelector; + LLRadioGroup* mModeSelector; LLScrollListCtrl* mLocalScrollCtrl; private: diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index ed5a6f00c7..f7b1a0d3d0 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -1998,6 +1998,11 @@ bool LLTextureFetchWorker::doWork(S32 param) setState(WAIT_ON_WRITE); ++mCacheWriteCount; CacheWriteResponder* responder = new CacheWriteResponder(mFetcher, mID); + // This call might be under work mutex, but mRawImage is not nessesary safe here. + // If something retrieves it via getRequestFinished() and modifies, image won't + // be protected by work mutex and won't be safe to use here nor in cache worker. + // So make sure users of getRequestFinished() does not attempt to modify image while + // fetcher is working mCacheWriteHandle = mFetcher->mTextureCache->writeToCache(mID, cache_priority, mFormattedImage->getData(), datasize, mFileSize, mRawImage, mDecodedDiscard, responder); diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h index cdf8868597..2aa194e141 100644 --- a/indra/newview/lltexturefetch.h +++ b/indra/newview/lltexturefetch.h @@ -92,6 +92,7 @@ public: void deleteAllRequests(); // Threads: T* + // keep in mind that if fetcher isn't done, it still might need original raw image bool getRequestFinished(const LLUUID& id, S32& discard_level, LLPointer& raw, LLPointer& aux, LLCore::HttpStatus& last_http_get_status); diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp index 6adf1c7193..6406ef7ff4 100644 --- a/indra/newview/lltextureview.cpp +++ b/indra/newview/lltextureview.cpp @@ -231,12 +231,16 @@ void LLTextureBar::draw() struct { const std::string desc; LLColor4 color; } fetch_state_desc[] = { { "---", LLColor4::red }, // INVALID { "INI", LLColor4::white }, // INIT - { "DSK", LLColor4::cyan }, // LOAD_FROM_TEXTURE_CACHE + // Unique state codes + //{ "DSK", LLColor4::cyan }, // LOAD_FROM_TEXTURE_CACHE + { "CCH", LLColor4::cyan }, // LOAD_FROM_TEXTURE_CACHE { "DSK", LLColor4::blue }, // CACHE_POST { "NET", LLColor4::green }, // LOAD_FROM_NETWORK { "SIM", LLColor4::green }, // LOAD_FROM_SIMULATOR { "HTW", LLColor4::green }, // WAIT_HTTP_RESOURCE - { "HTW", LLColor4::green }, // WAIT_HTTP_RESOURCE2 + // Unique state codes + //{ "HTW", LLColor4::green }, // WAIT_HTTP_RESOURCE2 + { "HTI", LLColor4::green }, // WAIT_HTTP_RESOURCE2 { "REQ", LLColor4::yellow },// SEND_HTTP_REQ { "HTP", LLColor4::green }, // WAIT_HTTP_REQ { "DEC", LLColor4::yellow },// DECODE_IMAGE @@ -515,9 +519,50 @@ public: virtual LLRect getRequiredRect(); // Return the height of this object, given the set options. private: + S32Megabytes getGPUMemoryUsed(); // Texture memory bars + LLTextureView* mTextureView; }; +// Texture memory bars +S32Megabytes LLGLTexMemBar::getGPUMemoryUsed() +{ + static const F32 GPU_MEMORY_CHECK_WAIT_TIME = 1.0f; + + static LLFrameTimer timer; + static S32Megabytes gpu_res = S32Megabytes(0); + + if (timer.getElapsedTimeF32() < GPU_MEMORY_CHECK_WAIT_TIME) //call this once per second. + { + return gpu_res; + } + timer.reset(); + + if (gGLManager.mHasATIMemInfo) + { + S32 meminfo[4]; + glGetIntegerv(GL_TEXTURE_FREE_MEMORY_ATI, meminfo); + S32Megabytes free = S32Megabytes(meminfo[0]); + + //glGetIntegerv(GL_VBO_FREE_MEMORY_ATI, meminfo); + //S32Megabytes free = free + S32Megabytes(meminfo[0]); + + //glGetIntegerv(GL_RENDERBUFFER_FREE_MEMORY_ATI, meminfo); + //S32Megabytes free = free + S32Megabytes(meminfo[0]); + + gpu_res = S32Megabytes(gGLManager.mVRAM) - free; + } + else if (gGLManager.mHasNVXMemInfo) + { + S32 free_memory; + glGetIntegerv(GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX, &free_memory); + gpu_res = S32Megabytes(gGLManager.mVRAM) - S32Megabytes(free_memory / 1024); + } + + return gpu_res; +} + // + void LLGLTexMemBar::draw() { S32Megabytes bound_mem = LLViewerTexture::sBoundTextureMemory; @@ -569,12 +614,23 @@ void LLGLTexMemBar::draw() U32 texFetchLatMed = U32(recording.getMean(LLTextureFetch::sTexFetchLatency).value() * 1000.0f); U32 texFetchLatMax = U32(recording.getMax(LLTextureFetch::sTexFetchLatency).value() * 1000.0f); - text = llformat("GL Tot: %d/%d MB Bound: %4d/%4d MB FBO: %d MB Raw Tot: %d MB Bias: %.2f Cache: %.1f/%.1f MB", + // Texture memory bars + S32Megabytes gpu, system; + S32Megabytes gpu_used = getGPUMemoryUsed(); + + // Texture memory bars + //text = llformat("GL Tot: %d/%d MB Bound: %4d/%4d MB FBO: %d MB Raw Tot: %d MB Bias: %.2f Cache: %.1f/%.1f MB", + text = llformat("GL Tot: %d/%d MB Bound: %d/%d MB FBO: %d MB VRAM: %d/%d MB Raw Tot: %d MB Bias: %.2f Cache: %.1f/%.1f MB", + // total_mem.value(), max_total_mem.value(), bound_mem.value(), max_bound_mem.value(), LLRenderTarget::sBytesAllocated/(1024*1024), + // Texture memory bars + gpu_used.value(), + gGLManager.mVRAM, + // LLImageRaw::sGlobalRawMemory >> 20, discard_bias, cache_usage, @@ -600,7 +656,7 @@ void LLGLTexMemBar::draw() gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); // GL Mem Bar - + left = bar_left; text = "GL"; LLFontGL::getFontMonospace()->renderUTF8(text, 0, left, v_offset + line_height*6, @@ -619,8 +675,7 @@ void LLGLTexMemBar::draw() color = (total_mem.value() < llfloor(max_total_mem.value() * texmem_lower_bound_scale)) ? LLColor4::green : (total_mem.value() < max_total_mem.value()) ? LLColor4::yellow : LLColor4::red; color[VALPHA] = .75f; -// gGL.diffuseColor4fv(color.mV); - + gl_rect_2d(left, top, right, bottom, color); // red/yellow/green // @@ -642,11 +697,33 @@ void LLGLTexMemBar::draw() color = (bound_mem.value() < llfloor(max_bound_mem.value() * texmem_lower_bound_scale)) ? LLColor4::green : (bound_mem.value() < max_bound_mem.value()) ? LLColor4::yellow : LLColor4::red; color[VALPHA] = .75f; -// gGL.diffuseColor4fv(color.mV); bar_scale = (F32)bar_width / (max_bound_mem.value() * 1.5f); right = left + llfloor(bound_mem.value() * bar_scale); + gl_rect_2d(left, top, right, bottom, color); + + bar_left = left + bar_width + 10; + + // VRAM Mem Bar + + left = bar_left; + text = "VRAM"; + LLFontGL::getFontMonospace()->renderUTF8(text, 0, left, v_offset + line_height*6, + text_color, LLFontGL::LEFT, LLFontGL::TOP); + left = bar_left + 35; + right = left + bar_width; + + gGL.color4f(0.5f, 0.5f, 0.5f, 0.75f); + gl_rect_2d(left, top, right, bottom); + + color = (gpu_used.value() < llfloor(gGLManager.mVRAM * texmem_lower_bound_scale)) ? LLColor4::green : + (gpu_used.value() < gGLManager.mVRAM) ? LLColor4::yellow : LLColor4::red; + color[VALPHA] = .75f; + + bar_scale = (F32)bar_width / gGLManager.mVRAM; + right = left + llfloor(gpu_used.value() * bar_scale); + gl_rect_2d(left, top, right, bottom, color); // diff --git a/indra/newview/lltoastgroupnotifypanel.cpp b/indra/newview/lltoastgroupnotifypanel.cpp index ceb451ebfb..1bc315cc06 100644 --- a/indra/newview/lltoastgroupnotifypanel.cpp +++ b/indra/newview/lltoastgroupnotifypanel.cpp @@ -182,9 +182,18 @@ LLToastGroupNotifyPanel::LLToastGroupNotifyPanel(const LLNotificationPtr& notifi setDefaultBtn(pOkBtn); //group notices button - LLButton* pOkNotices = getChild("btn_notices"); - if (pOkNotices) - pOkNotices->setClickedCallback((boost::bind(&LLToastGroupNotifyPanel::onClickGroupNotices, this))); + LLButton* pNoticesBtn = findChild("btn_notices"); + if (pNoticesBtn) + { + pNoticesBtn->setClickedCallback((boost::bind(&LLToastGroupNotifyPanel::onClickGroupNotices, this))); + } + + // group chat button + LLButton* pGroupChatBtn = findChild("btn_groupchat"); + if (pGroupChatBtn) + { + pGroupChatBtn->setClickedCallback((boost::bind(&LLGroupActions::startIM, mGroupID))); + } S32 maxLinesCount; std::istringstream ss( getString("message_max_lines_count") ); diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 568e7e9ad1..64f8511d46 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -947,8 +947,14 @@ BOOL LLToolPie::handleDoubleClick(S32 x, S32 y, MASK mask) { return TRUE; } + + // FIRE-1765: Allow double-click walk/teleport to scripted objects + bool allowDoubleClickOnScriptedObjects = gSavedSettings.getBOOL("FSAllowDoubleClickOnScriptedObjects"); - if (!mDoubleClickTimer.getStarted() || (mDoubleClickTimer.getElapsedTimeF32() > 0.3f)) + // FIRE-1765: Allow double-click walk/teleport to scripted objects + //if (!mDoubleClickTimer.getStarted() || (mDoubleClickTimer.getElapsedTimeF32() > 0.3f)) + if (!allowDoubleClickOnScriptedObjects && (!mDoubleClickTimer.getStarted() || (mDoubleClickTimer.getElapsedTimeF32() > 0.3f))) + // { mDoubleClickTimer.stop(); return FALSE; @@ -1011,7 +1017,10 @@ BOOL LLToolPie::handleDoubleClick(S32 x, S32 y, MASK mask) bool has_touch_handler = (objp && objp->flagHandleTouch()) || (parentp && parentp->flagHandleTouch()); bool has_click_action = final_click_action(objp); - if (pos_non_zero && (is_land || (is_in_world && !has_touch_handler && !has_click_action))) + // FIRE-1765: Allow double-click walk/teleport to scripted objects + //if (pos_non_zero && (is_land || (is_in_world && !has_touch_handler && !has_click_action))) + if (pos_non_zero && (is_land || (is_in_world && ((allowDoubleClickOnScriptedObjects && objp->getClickAction() != CLICK_ACTION_SIT) || (!has_touch_handler && !has_click_action))))) + // { LLVector3d pos = mPick.mPosGlobal; pos.mdV[VZ] += gAgentAvatarp->getPelvisToFoot(); diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index d372f0e822..48f9ed7477 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -269,6 +269,16 @@ static bool handleRenderPerfTestChanged(const LLSD& newvalue) bool handleRenderTransparentWaterChanged(const LLSD& newvalue) { + LLRenderTarget::sUseFBO = newvalue.asBoolean(); + if (gPipeline.isInit()) + { + gPipeline.updateRenderTransparentWater(); + gPipeline.updateRenderDeferred(); + gPipeline.releaseGLBuffers(); + gPipeline.createGLBuffers(); + gPipeline.resetVertexBuffers(); + LLViewerShaderMgr::instance()->setShaders(); + } LLWorld::getInstance()->updateWaterObjects(); return true; } @@ -403,6 +413,17 @@ static bool handleVideoMemoryChanged(const LLSD& newvalue) return true; } +// Dynamic texture memory calculation +static bool handleDynamicTextureMemoryChanged(const LLSD& newvalue) +{ + if (!newvalue.asBoolean()) + { + gTextureList.updateMaxResidentTexMem(S32Megabytes(gSavedSettings.getS32("TextureMemory"))); + } + return true; +} +// + static bool handleChatFontSizeChanged(const LLSD& newvalue) { if(gConsole) @@ -1239,6 +1260,9 @@ void settings_setup_listeners() // Output device selection gSavedSettings.getControl("FSOutputDeviceUUID")->getSignal()->connect(boost::bind(&handleOutputDeviceChanged, _2)); + + // Dynamic texture memory calculation + gSavedSettings.getControl("FSDynamicTextureMemory")->getSignal()->connect(boost::bind(&handleDynamicTextureMemoryChanged, _2)); } #if TEST_CACHED_CONTROL diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index a04914de49..52d4ae3d4b 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -471,6 +471,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) if( (gAgent.getTeleportState() != LLAgent::TELEPORT_START) && (teleport_percent > 100.f) ) { // Give up. Don't keep the UI locked forever. + LL_WARNS("Teleport") << "Giving up on teleport. elapsed time " << teleport_elapsed << " exceeds max time " << teleport_save_time << LL_ENDL; gAgent.setTeleportState( LLAgent::TELEPORT_NONE ); gAgent.setTeleportMessage(std::string()); } @@ -509,7 +510,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) gTeleportDisplayTimer.reset(); gViewerWindow->setShowProgress(TRUE,!gSavedSettings.getBOOL("FSDisableTeleportScreens")); gViewerWindow->setProgressPercent(llmin(teleport_percent, 0.0f)); - + LL_INFOS("Teleport") << "A teleport request has been sent, setting state to TELEPORT_REQUESTED" << LL_ENDL; gAgent.setTeleportState( LLAgent::TELEPORT_REQUESTED ); gAgent.setTeleportMessage( LLAgent::sTeleportProgressMessages["requesting"]); @@ -535,6 +536,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) gTeleportArrivalTimer.reset(); gViewerWindow->setProgressCancelButtonVisible(FALSE, LLTrans::getString("Cancel")); gViewerWindow->setProgressPercent(75.f); + LL_INFOS("Teleport") << "Changing state to TELEPORT_ARRIVING" << LL_ENDL; gAgent.setTeleportState( LLAgent::TELEPORT_ARRIVING ); gAgent.setTeleportMessage( LLAgent::sTeleportProgressMessages["arriving"]); @@ -556,6 +558,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) { arrival_fraction = 1.f; //LLFirstUse::useTeleport(); + LL_INFOS("Teleport") << "arrival_fraction is " << arrival_fraction << " changing state to TELEPORT_NONE" << LL_ENDL; gAgent.setTeleportState( LLAgent::TELEPORT_NONE ); } gViewerWindow->setProgressCancelButtonVisible(FALSE, LLTrans::getString("Cancel")); @@ -573,6 +576,10 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) // { //LLFirstUse::useTeleport(); + LL_INFOS("Teleport") << "State is local and gTeleportDisplayTimer " << gTeleportDisplayTimer.getElapsedTimeF32() + << " exceeds teleport_local_delete " << teleport_local_delay + << "; setting state to TELEPORT_NONE" + << LL_ENDL; gAgent.setTeleportState( LLAgent::TELEPORT_NONE ); } } diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index df8e60d14d..0e20f9fc54 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -84,6 +84,9 @@ static const char * const LOG_INV("Inventory"); static const char * const LOG_LOCAL("InventoryLocalize"); static const char * const LOG_NOTECARD("copy_inventory_from_notecard"); +static const std::string INV_OWNER_ID("owner_id"); +static const std::string INV_VERSION("version"); + #if 1 // *TODO$: LLInventoryCallback should be deprecated to conform to the new boost::bind/coroutine model. // temp code in transition @@ -545,14 +548,6 @@ void LLViewerInventoryItem::packMessage(LLMessageSystem* msg) const msg->addU32Fast(_PREHASH_CRC, crc); } -// virtual -BOOL LLViewerInventoryItem::importFile(LLFILE* fp) -{ - BOOL rv = LLInventoryItem::importFile(fp); - mIsComplete = TRUE; - return rv; -} - // virtual BOOL LLViewerInventoryItem::importLegacyStream(std::istream& input_stream) { @@ -561,32 +556,6 @@ BOOL LLViewerInventoryItem::importLegacyStream(std::istream& input_stream) return rv; } -bool LLViewerInventoryItem::importFileLocal(LLFILE* fp) -{ - // TODO: convert all functions that return BOOL to return bool - bool rv = (LLInventoryItem::importFile(fp) ? true : false); - mIsComplete = false; - return rv; -} - -bool LLViewerInventoryItem::exportFileLocal(LLFILE* fp) const -{ - std::string uuid_str; - fprintf(fp, "\tinv_item\t0\n\t{\n"); - mUUID.toString(uuid_str); - fprintf(fp, "\t\titem_id\t%s\n", uuid_str.c_str()); - mParentUUID.toString(uuid_str); - fprintf(fp, "\t\tparent_id\t%s\n", uuid_str.c_str()); - mPermissions.exportFile(fp); - fprintf(fp, "\t\ttype\t%s\n", LLAssetType::lookup(mType)); - const std::string inv_type_str = LLInventoryType::lookup(mInventoryType); - if(!inv_type_str.empty()) fprintf(fp, "\t\tinv_type\t%s\n", inv_type_str.c_str()); - fprintf(fp, "\t\tname\t%s|\n", mName.c_str()); - fprintf(fp, "\t\tcreation_date\t%d\n", (S32) mCreationDate); - fprintf(fp,"\t}\n"); - return true; -} - void LLViewerInventoryItem::updateParentOnServer(BOOL restamp) const { LLMessageSystem* msg = gMessageSystem; @@ -793,90 +762,26 @@ S32 LLViewerInventoryCategory::getViewerDescendentCount() const return descendents_actual; } -bool LLViewerInventoryCategory::importFileLocal(LLFILE* fp) +LLSD LLViewerInventoryCategory::exportLLSD() const { - // *NOTE: This buffer size is hard coded into scanf() below. - char buffer[MAX_STRING]; /* Flawfinder: ignore */ - char keyword[MAX_STRING]; /* Flawfinder: ignore */ - char valuestr[MAX_STRING]; /* Flawfinder: ignore */ + LLSD cat_data = LLInventoryCategory::exportLLSD(); + cat_data[INV_OWNER_ID] = mOwnerID; + cat_data[INV_VERSION] = mVersion; - keyword[0] = '\0'; - valuestr[0] = '\0'; - while(!feof(fp)) - { - if (fgets(buffer, MAX_STRING, fp) == NULL) - { - buffer[0] = '\0'; - } - - sscanf( /* Flawfinder: ignore */ - buffer, " %254s %254s", keyword, valuestr); - if(0 == strcmp("{",keyword)) - { - continue; - } - if(0 == strcmp("}", keyword)) - { - break; - } - else if(0 == strcmp("cat_id", keyword)) - { - mUUID.set(valuestr); - } - else if(0 == strcmp("parent_id", keyword)) - { - mParentUUID.set(valuestr); - } - else if(0 == strcmp("type", keyword)) - { - mType = LLAssetType::lookup(valuestr); - } - else if(0 == strcmp("pref_type", keyword)) - { - mPreferredType = LLFolderType::lookup(valuestr); - } - else if(0 == strcmp("name", keyword)) - { - //strcpy(valuestr, buffer + strlen(keyword) + 3); - // *NOTE: Not ANSI C, but widely supported. - sscanf( /* Flawfinder: ignore */ - buffer, " %254s %254[^|]", keyword, valuestr); - mName.assign(valuestr); - LLStringUtil::replaceNonstandardASCII(mName, ' '); - LLStringUtil::replaceChar(mName, '|', ' '); - } - else if(0 == strcmp("owner_id", keyword)) - { - mOwnerID.set(valuestr); - } - else if(0 == strcmp("version", keyword)) - { - sscanf(valuestr, "%d", &mVersion); - } - else - { - LL_WARNS(LOG_INV) << "unknown keyword '" << keyword - << "' in inventory import category " << mUUID << LL_ENDL; - } - } - return true; + return cat_data; } -bool LLViewerInventoryCategory::exportFileLocal(LLFILE* fp) const +bool LLViewerInventoryCategory::importLLSD(const LLSD& cat_data) { - std::string uuid_str; - fprintf(fp, "\tinv_category\t0\n\t{\n"); - mUUID.toString(uuid_str); - fprintf(fp, "\t\tcat_id\t%s\n", uuid_str.c_str()); - mParentUUID.toString(uuid_str); - fprintf(fp, "\t\tparent_id\t%s\n", uuid_str.c_str()); - fprintf(fp, "\t\ttype\t%s\n", LLAssetType::lookup(mType)); - fprintf(fp, "\t\tpref_type\t%s\n", LLFolderType::lookup(mPreferredType).c_str()); - fprintf(fp, "\t\tname\t%s|\n", mName.c_str()); - mOwnerID.toString(uuid_str); - fprintf(fp, "\t\towner_id\t%s\n", uuid_str.c_str()); - fprintf(fp, "\t\tversion\t%d\n", mVersion); - fprintf(fp,"\t}\n"); + LLInventoryCategory::importLLSD(cat_data); + if (cat_data.has(INV_OWNER_ID)) + { + mOwnerID = cat_data[INV_OWNER_ID].asUUID(); + } + if (cat_data.has(INV_VERSION)) + { + setVersion(cat_data[INV_VERSION].asInteger()); + } return true; } diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h index 17c163ad02..78f04f8baf 100644 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -131,14 +131,8 @@ public: virtual void packMessage(LLMessageSystem* msg) const; virtual BOOL unpackMessage(LLMessageSystem* msg, const char* block, S32 block_num = 0); virtual BOOL unpackMessage(const LLSD& item); - virtual BOOL importFile(LLFILE* fp); virtual BOOL importLegacyStream(std::istream& input_stream); - // file handling on the viewer. These are not meant for anything - // other than cacheing. - bool exportFileLocal(LLFILE* fp) const; - bool importFileLocal(LLFILE* fp); - // new methods BOOL isFinished() const { return mIsComplete; } void setComplete(BOOL complete) { mIsComplete = complete; } @@ -226,10 +220,9 @@ public: // How many descendents do we currently have information for in the InventoryModel? S32 getViewerDescendentCount() const; - // file handling on the viewer. These are not meant for anything - // other than caching. - bool exportFileLocal(LLFILE* fp) const; - bool importFileLocal(LLFILE* fp); + LLSD exportLLSD() const; + bool importLLSD(const LLSD& cat_data); + void determineFolderType(); void changeType(LLFolderType::EType new_folder_type); virtual void unpackMessage(LLMessageSystem* msg, const char* block, S32 block_num = 0); diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 591320c4f3..e7b095a1b6 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -194,7 +194,8 @@ static F32 sGlobalVolume = 1.0f; static bool sForceUpdate = false; static LLUUID sOnlyAudibleTextureID = LLUUID::null; static F64 sLowestLoadableImplInterest = 0.0f; -static bool sAnyMediaShowing = false; +// Unused +//static bool sAnyMediaShowing = false; ////////////////////////////////////////////////////////////////////////////////////////// static void add_media_impl(LLViewerMediaImpl* media) @@ -882,7 +883,10 @@ void LLViewerMedia::updateMedia(void *dummy_arg) if (!pimpl->getUsedInUI() && pimpl->hasMedia()) { - sAnyMediaShowing = true; + // Need to set the right instance var + // sAnyMediaShowing = true; + mAnyMediaShowing = true; + // } if (!pimpl->getUsedInUI() && pimpl->hasMedia() && (pimpl->isMediaPlaying() || !pimpl->isMediaTimeBased())) @@ -1760,23 +1764,8 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_ std::string user_data_path_cache = gDirUtilp->getCacheDir(false); user_data_path_cache += gDirUtilp->getDirDelimiter(); - std::string user_data_path_cookies = gDirUtilp->getOSUserAppDir(); - user_data_path_cookies += gDirUtilp->getDirDelimiter(); - std::string user_data_path_cef_log = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "cef_log.txt"); - // Fix for EXT-5960 - make browser profile specific to user (cache, cookies etc.) - // If the linden username returned is blank, that can only mean we are - // at the login page displaying login Web page or Web browser test via Develop menu. - // In this case we just use whatever gDirUtilp->getOSUserAppDir() gives us (this - // is what we always used before this change) - std::string linden_user_dir = gDirUtilp->getLindenUserDir(); - if ( ! linden_user_dir.empty() ) - { - user_data_path_cookies = linden_user_dir; - user_data_path_cookies += gDirUtilp->getDirDelimiter(); - }; - // See if the plugin executable exists llstat s; if(LLFile::stat(launcher_name, &s)) @@ -1793,7 +1782,7 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_ { media_source = new LLPluginClassMedia(owner); media_source->setSize(default_width, default_height); - media_source->setUserDataPath(user_data_path_cache, user_data_path_cookies, user_data_path_cef_log); + media_source->setUserDataPath(user_data_path_cache, gDirUtilp->getUserName(), user_data_path_cef_log); media_source->setLanguageCode(LLUI::getLanguage()); media_source->setZoomFactor(zoom_factor); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 810c50cebe..bedabd9233 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -222,6 +222,12 @@ PieMenu *gPieMenuLand = NULL; PieMenu *gPieMenuMuteParticle = NULL; // Pie menu +// FIRE-7893: Detach function on inspect self toast without function +LLToggleableMenu *gMenuInspectSelf = NULL; +LLContextMenu *gInspectSelfDetachScreenMenu = NULL; +LLContextMenu *gInspectSelfDetachMenu = NULL; +// + const std::string SAVE_INTO_TASK_INVENTORY("Save Object Back to Object Contents"); LLMenuGL* gAttachSubMenu = NULL; @@ -447,20 +453,6 @@ void initialize_menus(); // Break up groups of more than 6 items with separators //----------------------------------------------------------------------------- -void set_underclothes_menu_options() -{ - if (gMenuHolder && gAgent.isTeen()) - { - gMenuHolder->getChild("Self Underpants")->setVisible(FALSE); - gMenuHolder->getChild("Self Undershirt")->setVisible(FALSE); - } - if (gMenuBarView && gAgent.isTeen()) - { - gMenuBarView->getChild("Menu Underpants")->setVisible(FALSE); - gMenuBarView->getChild("Menu Undershirt")->setVisible(FALSE); - } -} - void set_merchant_SLM_menu() { // All other cases (new merchant, not merchant, migrated merchant): show the new Marketplace Listings menu and enable the tool @@ -573,6 +565,14 @@ void init_menus() "menu_pie_mute_particle.xml", gMenuHolder, registry); // Pie menu + // FIRE-7893: Detach function on inspect self toast without function + gMenuInspectSelf = LLUICtrlFactory::createFromFile( + "menu_inspect_self_gear.xml", gMenuHolder, registry); + + gInspectSelfDetachScreenMenu = gMenuHolder->getChild("Inspect Self Detach HUD", true); + gInspectSelfDetachMenu = gMenuHolder->getChild("Inspect Self Detach", true); + // + /// /// set up the colors /// @@ -2893,6 +2893,11 @@ void cleanup_menus() gPieMenuMuteParticle = NULL; // + // FIRE-7893: Detach function on inspect self toast without function + delete gMenuInspectSelf; + gMenuInspectSelf = NULL; + // + delete gMenuBarView; gMenuBarView = NULL; @@ -3405,7 +3410,6 @@ class LLObjectBuild : public view_listener_t } }; - void handle_object_edit() { LLViewerParcelMgr::getInstance()->deselectLand(); @@ -3450,23 +3454,59 @@ void handle_object_edit() return; } -// [SL:KB] - Patch: Inventory-AttachmentEdit - Checked: 2010-08-25 (Catznip-2.2.0a) | Added: Catznip-2.1.2a -void handle_attachment_edit(const LLUUID& idItem) +void handle_attachment_edit(const LLUUID& inv_item_id) { - const LLInventoryItem* pItem = gInventory.getItem(idItem); - if ( (!isAgentAvatarValid()) || (!pItem) ) - return; + if (isAgentAvatarValid()) + { + if (LLViewerObject* attached_obj = gAgentAvatarp->getWornAttachment(inv_item_id)) + { + LLSelectMgr::getInstance()->deselectAll(); + LLSelectMgr::getInstance()->selectObjectAndFamily(attached_obj); - LLViewerObject* pAttachObj = gAgentAvatarp->getWornAttachment(pItem->getLinkedUUID()); - if (!pAttachObj) - return; - - LLSelectMgr::getInstance()->deselectAll(); - LLSelectMgr::getInstance()->selectObjectAndFamily(pAttachObj); - - handle_object_edit(); + handle_object_edit(); + } + } +} + +void handle_attachment_touch(const LLUUID& inv_item_id) +{ + if ( (isAgentAvatarValid()) && (enable_attachment_touch(inv_item_id)) ) + { + if (LLViewerObject* attach_obj = gAgentAvatarp->getWornAttachment(gInventory.getLinkedItemID(inv_item_id))) + { + LLSelectMgr::getInstance()->deselectAll(); + + LLObjectSelectionHandle sel = LLSelectMgr::getInstance()->selectObjectAndFamily(attach_obj); + if (!LLToolMgr::getInstance()->inBuildMode()) + { + struct SetTransient : public LLSelectedNodeFunctor + { + bool apply(LLSelectNode* node) + { + node->setTransient(TRUE); + return true; + } + } f; + sel->applyToNodes(&f); + } + + handle_object_touch(); + } + } +} + +bool enable_attachment_touch(const LLUUID& inv_item_id) +{ + if (isAgentAvatarValid()) + { + const LLViewerObject* attach_obj = gAgentAvatarp->getWornAttachment(gInventory.getLinkedItemID(inv_item_id)); + return (attach_obj) && (attach_obj->flagHandleTouch()) && ( (!RlvActions::isRlvEnabled()) || (RlvActions::canTouch(gAgentAvatarp->getWornAttachment(inv_item_id))) ); +// [RLVa:KB] - Checked: 2012-08-15 (RLVa-1.4.7) + //return (attach_obj) && (attach_obj->flagHandleTouch()); +// [/RLVa:KB] + } + return false; } -// [/SL:KB] void handle_object_inspect() { diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h index b84d55ff83..836f0ad304 100644 --- a/indra/newview/llviewermenu.h +++ b/indra/newview/llviewermenu.h @@ -29,6 +29,7 @@ #include "llmenugl.h" #include "llsafehandle.h" +#include "lltoggleablemenu.h" // FIRE-7893: Detach function on inspect self toast without function #include "piemenu.h" class LLMessageSystem; @@ -87,13 +88,9 @@ void handle_detach_from_avatar(const LLSD& user_data); void attach_label(std::string& label, const LLSD&); void detach_label(std::string& label, const LLSD&); void handle_detach(void*); -// [SL:KB] - Patch: Inventory-AttachmentEdit - Checked: 2010-08-25 (Catznip-2.2.0a) | Added: Catznip-2.1.2a -void handle_attachment_edit(const LLUUID& idItem); -// [/SL:KB] BOOL enable_god_full(void* user_data); BOOL enable_god_liaison(void* user_data); BOOL enable_god_basic(void* user_data); -void set_underclothes_menu_options(); void check_merchant_status(bool force = false); void exchange_callingcard(const LLUUID& dest_id); @@ -126,6 +123,10 @@ void handle_object_return(); void handle_object_delete(); void handle_object_edit(); +void handle_attachment_edit(const LLUUID& inv_item_id); +void handle_attachment_touch(const LLUUID& inv_item_id); +bool enable_attachment_touch(const LLUUID& inv_item_id); + // area search // expose this function so other classes can call it void handle_object_edit(); @@ -248,6 +249,12 @@ extern PieMenu* gPieAttachBodyPartMenus[PIE_MAX_SLICES]; extern PieMenu* gPieDetachBodyPartMenus[PIE_MAX_SLICES]; // Pie Menu +// FIRE-7893: Detach function on inspect self toast without function +extern LLToggleableMenu *gMenuInspectSelf; +extern LLContextMenu *gInspectSelfDetachScreenMenu; +extern LLContextMenu *gInspectSelfDetachMenu; +// + extern LLMenuItemCallGL* gAutorespondMenu; extern LLMenuItemCallGL* gAutorespondNonFriendsMenu; diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 92feb9b563..f72babf61b 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -488,6 +488,7 @@ void give_money(const LLUUID& uuid, LLViewerRegion* region, S32 amount, BOOL is_ void send_complete_agent_movement(const LLHost& sim_host) { + LL_DEBUGS("Teleport", "Messaging") << "Sending CompleteAgentMovement to sim_host " << sim_host << LL_ENDL; LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_CompleteAgentMovement); msg->nextBlockFast(_PREHASH_AgentData); @@ -1964,6 +1965,13 @@ void LLOfferInfo::handleRespond(const LLSD& notification, const LLSD& response) mRespondFunctions[name](notification, response); } +void inventory_offer_name_callback(const LLAvatarName& av_name, std::string message) +{ + LLSD args; + args["MESSAGE"] = llformat(message.c_str(), av_name.getUserName().c_str()); + LLNotificationsUtil::add("SystemMessageTip", args); +} + bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& response) { LLChat chat; @@ -2096,11 +2104,29 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& { // This breaks object owner name parsing //log_message = "" + chatHistory_string + " " + LLTrans::getString("InvOfferGaveYou") + " " + getSanitizedDescription() + LLTrans::getString("."); - log_message = chatHistory_string + " " + LLTrans::getString("InvOfferGaveYou") + " " + getSanitizedDescription() + LLTrans::getString("."); + // FIRE-29677 / SL-13720 workaround + //log_message = chatHistory_string + " " + LLTrans::getString("InvOfferGaveYou") + " " + getSanitizedDescription() + LLTrans::getString("."); + // + + //LLSD args; + //args["MESSAGE"] = log_message; + //LLNotificationsUtil::add("SystemMessageTip", args); + log_message = " " + LLTrans::getString("InvOfferGaveYou") + " " + getSanitizedDescription() + LLTrans::getString("."); + + LLUUID inv_sender_id; + size_t separator_idx = mFromName.find('|'); + if (separator_idx != std::string::npos && LLUUID::parseUUID(mFromName.substr(0, separator_idx), &inv_sender_id) && mFromName.size() > (++separator_idx)) + { + log_message = mFromName.substr(separator_idx) + log_message; + LLAvatarNameCache::instance().get(inv_sender_id, boost::bind(&inventory_offer_name_callback, _2, log_message)); + } + else + { + LLSD args; + args["MESSAGE"] = chatHistory_string + log_message; + LLNotificationsUtil::add("SystemMessageTip", args); + } // - LLSD args; - args["MESSAGE"] = log_message; - LLNotificationsUtil::add("SystemMessageTip", args); } // FIRE-3832: Silent accept/decline of inventory offers @@ -3618,12 +3644,12 @@ BOOL LLPostTeleportNotifiers::tick() // We're going to pretend to be a new agent void process_teleport_finish(LLMessageSystem* msg, void**) { - LL_DEBUGS("Messaging") << "Got teleport location message" << LL_ENDL; + LL_DEBUGS("Teleport","Messaging") << "Received TeleportFinish message" << LL_ENDL; LLUUID agent_id; msg->getUUIDFast(_PREHASH_Info, _PREHASH_AgentID, agent_id); if (agent_id != gAgent.getID()) { - LL_WARNS("Messaging") << "Got teleport notification for wrong agent!" << LL_ENDL; + LL_WARNS("Teleport","Messaging") << "Got teleport notification for wrong agent " << agent_id << " expected " << gAgent.getID() << ", ignoring!" << LL_ENDL; return; } @@ -3633,12 +3659,13 @@ void process_teleport_finish(LLMessageSystem* msg, void**) { // Server either ignored teleport cancel message or did not receive it in time. // This message can't be ignored since teleport is complete at server side + LL_INFOS("Teleport") << "Restoring canceled teleport request" << LL_ENDL; gAgent.restoreCanceledTeleportRequest(); } else { // Race condition? Make sure all variables are set correctly for teleport to work - LL_WARNS("Messaging") << "Teleport 'finish' message without 'start'" << LL_ENDL; + LL_WARNS("Teleport","Messaging") << "Teleport 'finish' message without 'start'. Setting state to TELEPORT_REQUESTED" << LL_ENDL; gTeleportDisplay = TRUE; LLViewerMessage::getInstance()->mTeleportStartedSignal(); gAgent.setTeleportState(LLAgent::TELEPORT_REQUESTED); @@ -3647,7 +3674,7 @@ void process_teleport_finish(LLMessageSystem* msg, void**) } else if (gAgent.getTeleportState() == LLAgent::TELEPORT_MOVING) { - LL_WARNS("Messaging") << "Teleport message in the middle of other teleport" << LL_ENDL; + LL_WARNS("Teleport","Messaging") << "Teleport message in the middle of other teleport" << LL_ENDL; } // Teleport is finished; it can't be cancelled now. @@ -3699,6 +3726,14 @@ void process_teleport_finish(LLMessageSystem* msg, void**) std::string seedCap; msg->getStringFast(_PREHASH_Info, _PREHASH_SeedCapability, seedCap); + LL_DEBUGS("Teleport") << "TeleportFinish message params are:" + << " sim_ip " << sim_ip + << " sim_port " << sim_port + << " region_handle " << region_handle + << " teleport_flags " << teleport_flags + << " seedCap " << seedCap + << LL_ENDL; + // update home location if we are teleporting out of prelude - specific to teleporting to welcome area if((teleport_flags & TELEPORT_FLAGS_SET_HOME_TO_TARGET) && (!gAgent.isGodlike())) @@ -3750,7 +3785,7 @@ void process_teleport_finish(LLMessageSystem* msg, void**) gAgent.standUp(); // now, use the circuit info to tell simulator about us! - LL_INFOS("Messaging") << "process_teleport_finish() Enabling " + LL_INFOS("Teleport","Messaging") << "process_teleport_finish() sending UseCircuitCode to enable sim_host " << sim_host << " with code " << msg->mOurCircuitCode << LL_ENDL; msg->newMessageFast(_PREHASH_UseCircuitCode); msg->nextBlockFast(_PREHASH_CircuitCode); @@ -3759,11 +3794,12 @@ void process_teleport_finish(LLMessageSystem* msg, void**) msg->addUUIDFast(_PREHASH_ID, gAgent.getID()); msg->sendReliable(sim_host); + LL_INFOS("Teleport") << "Calling send_complete_agent_movement() and setting state to TELEPORT_MOVING" << LL_ENDL; send_complete_agent_movement(sim_host); gAgent.setTeleportState( LLAgent::TELEPORT_MOVING ); gAgent.setTeleportMessage(LLAgent::sTeleportProgressMessages["contacting"]); - LL_DEBUGS("CrossingCaps") << "Calling setSeedCapability from process_teleport_finish(). Seed cap == " + LL_DEBUGS("CrossingCaps") << "Calling setSeedCapability(). Seed cap == " << seedCap << LL_ENDL; regionp->setSeedCapability(seedCap); @@ -3811,6 +3847,8 @@ void process_avatar_init_complete(LLMessageSystem* msg, void**) void process_agent_movement_complete(LLMessageSystem* msg, void**) { + LL_INFOS("Teleport","Messaging") << "Received ProcessAgentMovementComplete" << LL_ENDL; + gShiftFrame = true; gAgentMovementCompleted = true; @@ -3820,13 +3858,13 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_SessionID, session_id); if((gAgent.getID() != agent_id) || (gAgent.getSessionID() != session_id)) { - LL_WARNS("Messaging") << "Incorrect id in process_agent_movement_complete()" - << LL_ENDL; + LL_WARNS("Teleport", "Messaging") << "Incorrect agent or session id in process_agent_movement_complete()" + << " agent " << agent_id << " expected " << gAgent.getID() + << " session " << session_id << " expected " << gAgent.getSessionID() + << ", ignoring" << LL_ENDL; return; } - LL_DEBUGS("Messaging") << "process_agent_movement_complete()" << LL_ENDL; - // *TODO: check timestamp to make sure the movement compleation // makes sense. LLVector3 agent_pos; @@ -3843,7 +3881,7 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) { // Could happen if you were immediately god-teleported away on login, // maybe other cases. Continue, but warn. - LL_WARNS("Messaging") << "agent_movement_complete() with NULL avatarp." << LL_ENDL; + LL_WARNS("Teleport", "Messaging") << "agent_movement_complete() with NULL avatarp." << LL_ENDL; } F32 x, y; @@ -3853,13 +3891,15 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) { if (gAgent.getRegion()) { - LL_WARNS("Messaging") << "current region " << gAgent.getRegion()->getOriginGlobal() << LL_ENDL; + LL_WARNS("Teleport", "Messaging") << "current region origin " + << gAgent.getRegion()->getOriginGlobal() << " id " << gAgent.getRegion()->getRegionID() << LL_ENDL; } - LL_WARNS("Messaging") << "Agent being sent to invalid home region: " - << x << ":" << y - << " current pos " << gAgent.getPositionGlobal() - << LL_ENDL; + LL_WARNS("Teleport", "Messaging") << "Agent being sent to invalid home region: " + << x << ":" << y + << " current pos " << gAgent.getPositionGlobal() + << ", calling forceDisconnect()" + << LL_ENDL; LLAppViewer::instance()->forceDisconnect(LLTrans::getString("SentToInvalidRegion")); return; @@ -3868,13 +3908,13 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) // Crash fix if (!gAgent.getRegion()) { - LL_WARNS("Messaging") << "Agent was disconnected from the region" << LL_ENDL; + LL_WARNS("Teleport","Messaging") << "Agent was disconnected from the region" << LL_ENDL; LLAppViewer::instance()->forceDisconnect(LLTrans::getString("YouHaveBeenDisconnected")); return; } // - LL_INFOS("Messaging") << "Changing home region to " << x << ":" << y << LL_ENDL; + LL_INFOS("Teleport","Messaging") << "Changing home region to region id " << regionp->getRegionID() << " handle " << region_handle << " == x,y " << x << "," << y << LL_ENDL; // set our upstream host the new simulator and shuffle things as // appropriate. @@ -3928,6 +3968,7 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) gAgentCamera.slamLookAt(look_at); gAgentCamera.updateCamera(); + LL_INFOS("Teleport") << "Agent movement complete, setting state to TELEPORT_START_ARRIVAL" << LL_ENDL; gAgent.setTeleportState( LLAgent::TELEPORT_START_ARRIVAL ); // [Legacy Bake] @@ -3961,6 +4002,8 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) else { // This is initial log-in or a region crossing + LL_INFOS("Teleport") << "State is not TELEPORT_MOVING, so this is initial log-in or region crossing. " + << "Setting state to TELEPORT_NONE" << LL_ENDL; gAgent.setTeleportState( LLAgent::TELEPORT_NONE ); if(LLStartUp::getStartupState() < STATE_STARTED) @@ -7234,14 +7277,6 @@ void process_script_question(LLMessageSystem *msg, void **user_data) msg->getUUIDFast(_PREHASH_Data, _PREHASH_TaskID, taskid ); // itemid -> script asset key of script requesting permissions msg->getUUIDFast(_PREHASH_Data, _PREHASH_ItemID, itemid ); - - // NaCl - Antispam Registry - if (NACLAntiSpamRegistry::instance().checkQueue(ANTISPAM_QUEUE_SCRIPT_DIALOG, taskid, ANTISPAM_SOURCE_OBJECT)) - { - return; - } - // NaCl End - msg->getStringFast(_PREHASH_Data, _PREHASH_ObjectName, object_name); msg->getStringFast(_PREHASH_Data, _PREHASH_ObjectOwner, owner_name); msg->getS32Fast(_PREHASH_Data, _PREHASH_Questions, questions ); @@ -7270,21 +7305,23 @@ void process_script_question(LLMessageSystem *msg, void **user_data) typedef LLKeyThrottle LLStringThrottle; static LLStringThrottle question_throttle( LLREQUEST_PERMISSION_THROTTLE_LIMIT, LLREQUEST_PERMISSION_THROTTLE_INTERVAL ); - switch (question_throttle.noteAction(throttle_name)) - { - case LLStringThrottle::THROTTLE_NEWLY_BLOCKED: - LL_INFOS("Messaging") << "process_script_question throttled" - << " owner_name:" << owner_name - << LL_ENDL; - // Fall through + // FIRE-7374: Moved spam/throttle check after RLVa check + //switch (question_throttle.noteAction(throttle_name)) + //{ + // case LLStringThrottle::THROTTLE_NEWLY_BLOCKED: + // LL_INFOS("Messaging") << "process_script_question throttled" + // << " owner_name:" << owner_name + // << LL_ENDL; + // // Fall through - case LLStringThrottle::THROTTLE_BLOCKED: - // Escape altogether until we recover - return; + // case LLStringThrottle::THROTTLE_BLOCKED: + // // Escape altogether until we recover + // return; - case LLStringThrottle::THROTTLE_OK: - break; - } + // case LLStringThrottle::THROTTLE_OK: + // break; + //} + // std::string script_question; if (questions) @@ -7328,7 +7365,6 @@ void process_script_question(LLMessageSystem *msg, void **user_data) LL_WARNS("Messaging") << "Object \"" << object_name << "\" requested " << script_question << " permission. Permission is unknown and can't be granted. Item id: " << itemid << " taskid:" << taskid << LL_ENDL; - make_ui_sound("UISndScriptFloaterOpen"); // FIRE-16958: Incoming script permission request doesn't trigger a sound } if (known_questions) @@ -7371,6 +7407,31 @@ void process_script_question(LLMessageSystem *msg, void **user_data) LLNotification::Params("ScriptQuestion").substitutions(args).payload(payload), 0/*YES*/); return; } + + // FIRE-7374: Moved spam/throttle check after RLVa check + // NaCl - Antispam Registry + if (NACLAntiSpamRegistry::instance().checkQueue(ANTISPAM_QUEUE_SCRIPT_DIALOG, taskid, ANTISPAM_SOURCE_OBJECT)) + { + return; + } + // NaCl End + + switch (question_throttle.noteAction(throttle_name)) + { + case LLStringThrottle::THROTTLE_NEWLY_BLOCKED: + LL_INFOS("Messaging") << "process_script_question throttled" + << " owner_name:" << owner_name + << LL_ENDL; + // Fall through + + case LLStringThrottle::THROTTLE_BLOCKED: + // Escape altogether until we recover + return; + + case LLStringThrottle::THROTTLE_OK: + break; + } + // // [/RLVa:KB] // check whether cautions are even enabled or not @@ -7392,6 +7453,35 @@ void process_script_question(LLMessageSystem *msg, void **user_data) make_ui_sound("UISndScriptFloaterOpen"); // FIRE-16958: Incoming script permission request doesn't trigger a sound } } + // FIRE-7374: Moved spam/throttle check after RLVa check + else + { + // Throttle permission requests from scripts requesting no permission at all!?!? + + // NaCl - Antispam Registry + if (NACLAntiSpamRegistry::instance().checkQueue(ANTISPAM_QUEUE_SCRIPT_DIALOG, taskid, ANTISPAM_SOURCE_OBJECT)) + { + return; + } + // NaCl End + + switch (question_throttle.noteAction(throttle_name)) + { + case LLStringThrottle::THROTTLE_NEWLY_BLOCKED: + LL_INFOS("Messaging") << "process_script_question throttled" + << " owner_name:" << owner_name + << LL_ENDL; + // Fall through + + case LLStringThrottle::THROTTLE_BLOCKED: + // Escape altogether until we recover + return; + + case LLStringThrottle::THROTTLE_OK: + break; + } + } + // } @@ -7528,6 +7618,8 @@ std::string formatted_time(const time_t& the_time) void process_teleport_failed(LLMessageSystem *msg, void**) { + LL_WARNS("Teleport","Messaging") << "Received TeleportFailed message" << LL_ENDL; + std::string message_id; // Tag from server, like "RegionEntryAccessBlocked" std::string big_reason; // Actual message to display LLSD args; @@ -7546,6 +7638,7 @@ void process_teleport_failed(LLMessageSystem *msg, void**) // Nothing found in the map - use what the server returned in the original message block msg->getStringFast(_PREHASH_Info, _PREHASH_Reason, big_reason); } + LL_WARNS("Teleport") << "AlertInfo message_id " << message_id << " reason: " << big_reason << LL_ENDL; LLSD llsd_block; std::string llsd_raw; @@ -7555,10 +7648,11 @@ void process_teleport_failed(LLMessageSystem *msg, void**) std::istringstream llsd_data(llsd_raw); if (!LLSDSerialize::deserialize(llsd_block, llsd_data, llsd_raw.length())) { - LL_WARNS() << "process_teleport_failed: Attempted to read alert parameter data into LLSD but failed:" << llsd_raw << LL_ENDL; + LL_WARNS("Teleport") << "process_teleport_failed: Attempted to read alert parameter data into LLSD but failed:" << llsd_raw << LL_ENDL; } else { + LL_WARNS("Teleport") << "AlertInfo llsd block received: " << llsd_block << LL_ENDL; if(llsd_block.has("REGION_NAME")) { std::string region_name = llsd_block["REGION_NAME"].asString(); @@ -7574,6 +7668,7 @@ void process_teleport_failed(LLMessageSystem *msg, void**) { if( gAgent.getTeleportState() != LLAgent::TELEPORT_NONE ) { + LL_WARNS("Teleport") << "called handle_teleport_access_blocked, setting state to TELEPORT_NONE" << LL_ENDL; gAgent.setTeleportState( LLAgent::TELEPORT_NONE ); } return; @@ -7596,6 +7691,7 @@ void process_teleport_failed(LLMessageSystem *msg, void**) args["REASON"] = message_id; } } + LL_WARNS("Teleport") << "Displaying CouldNotTeleportReason string, REASON= " << args["REASON"] << LL_ENDL; // Stop typing after teleport (possible fix for FIRE-7273) gAgent.stopTyping(); @@ -7609,17 +7705,21 @@ void process_teleport_failed(LLMessageSystem *msg, void**) if( gAgent.getTeleportState() != LLAgent::TELEPORT_NONE ) { + LL_WARNS("Teleport") << "End of process_teleport_failed(). Reason message arg is " << args["REASON"] + << ". Setting state to TELEPORT_NONE" << LL_ENDL; gAgent.setTeleportState( LLAgent::TELEPORT_NONE ); } } void process_teleport_local(LLMessageSystem *msg,void**) { + LL_INFOS("Teleport","Messaging") << "Received TeleportLocal message" << LL_ENDL; + LLUUID agent_id; msg->getUUIDFast(_PREHASH_Info, _PREHASH_AgentID, agent_id); if (agent_id != gAgent.getID()) { - LL_WARNS("Messaging") << "Got teleport notification for wrong agent!" << LL_ENDL; + LL_WARNS("Teleport", "Messaging") << "Got teleport notification for wrong agent " << agent_id << " expected " << gAgent.getID() << ", ignoring!" << LL_ENDL; return; } @@ -7631,6 +7731,7 @@ void process_teleport_local(LLMessageSystem *msg,void**) msg->getVector3Fast(_PREHASH_Info, _PREHASH_LookAt, look_at); msg->getU32Fast(_PREHASH_Info, _PREHASH_TeleportFlags, teleport_flags); + LL_INFOS("Teleport") << "Message params are location_id " << location_id << " teleport_flags " << teleport_flags << LL_ENDL; if( gAgent.getTeleportState() != LLAgent::TELEPORT_NONE ) { if( gAgent.getTeleportState() == LLAgent::TELEPORT_LOCAL ) @@ -7643,6 +7744,8 @@ void process_teleport_local(LLMessageSystem *msg,void**) } else { + LL_WARNS("Teleport") << "State is not TELEPORT_LOCAL: " << gAgent.getTeleportStateName() + << ", setting state to TELEPORT_NONE" << LL_ENDL; gAgent.setTeleportState( LLAgent::TELEPORT_NONE ); } } diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 90fbb4805c..00deddbf73 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -4642,7 +4642,8 @@ void LLViewerObject::setPositionRegion(const LLVector3 &pos_region, BOOL damped) { LLViewerObject::setPosition(pos_region); mPositionRegion = pos_region; - mPositionAgent = mRegionp->getPosAgentFromRegion(mPositionRegion); + if(mRegionp)// Avoid crash when region null + mPositionAgent = mRegionp->getPosAgentFromRegion(mPositionRegion); } } @@ -4953,9 +4954,7 @@ LLViewerTexture* LLViewerObject::getBakedTextureForMagicId(const LLUUID& id) } LLVOAvatar* avatar = getAvatar(); - if (avatar && !isHUDAttachment() - && isMesh() - && getVolume() && getVolume()->getParams().getSculptID().notNull()) // checking for the rigged mesh by params instead of using isRiggedMesh() to avoid false negatives when skin info isn't ready + if (avatar && !isHUDAttachment()) { LLAvatarAppearanceDefines::EBakedTextureIndex texIndex = LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::assetIdToBakedTextureIndex(id); LLViewerTexture* bakedTexture = avatar->getBakedTexture(texIndex); diff --git a/indra/newview/llviewerparcelaskplay.cpp b/indra/newview/llviewerparcelaskplay.cpp index 74586dadc3..afbe2c94de 100644 --- a/indra/newview/llviewerparcelaskplay.cpp +++ b/indra/newview/llviewerparcelaskplay.cpp @@ -59,7 +59,10 @@ void LLViewerParcelAskPlay::initSingleton() } void LLViewerParcelAskPlay::cleanupSingleton() { - cancelNotification(); + if (LLNotifications::instanceExists()) + { + cancelNotification(); + } } void LLViewerParcelAskPlay::askToPlay(const LLUUID ®ion_id, const S32 &parcel_id, const std::string &url, ask_callback cb) diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 3837506aab..ec68ee5297 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -298,6 +298,7 @@ void LLViewerRegionImpl::requestBaseCapabilitiesCoro(U64 regionHandle) LL_INFOS("AppInit", "Capabilities") << "Requesting seed from " << url << " region name " << regionp->getName() + << " handle " << regionp->getHandle() << " (attempt #" << mSeedCapAttempts + 1 << ")" << LL_ENDL; LL_DEBUGS("AppInit", "Capabilities") << "Capabilities requested: " << capabilityNames << LL_ENDL; @@ -361,9 +362,9 @@ void LLViewerRegionImpl::requestBaseCapabilitiesCoro(U64 regionHandle) log_capabilities(mCapabilities); #endif + LL_DEBUGS("AppInit", "Capabilities", "Teleport") << "received caps for handle " << regionHandle + << " region name " << regionp->getName() << LL_ENDL; regionp->setCapabilitiesReceived(true); - LL_DEBUGS("AppInit", "Capabilities") << "received caps for handle " << regionHandle - << " region name " << regionp->getName() << LL_ENDL; if (STATE_SEED_GRANTED_WAIT == LLStartUp::getStartupState()) { diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index d30b6d269b..b0f2beeabe 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -401,6 +401,15 @@ void LLViewerShaderMgr::setShaders() return; } + if (!gGLManager.mHasShaderObjects + || !gGLManager.mHasVertexShader + || !gGLManager.mHasFragmentShader) + { + // Viewer will show 'hardware requirements' warning later + LL_INFOS("ShaderLoading") << "Shaders not supported" << LL_ENDL; + return; + } + static LLCachedControl max_texture_index(gSavedSettings, "RenderMaxTextureIndex", 16); LLGLSLShader::sIndexedTextureChannels = llmax(llmin(gGLManager.mNumTextureImageUnits, (S32) max_texture_index), 1); diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 831a5502a5..3cd7ccd3ee 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -569,9 +569,11 @@ void LLViewerTexture::getGPUMemoryForTextures(S32Megabytes &gpu, S32Megabytes &p glGetIntegerv(GL_TEXTURE_FREE_MEMORY_ATI, meminfo); gpu_res = (S32Megabytes)meminfo[0]; + // Maybe do this independently from AMD cards???? //check main memory, only works for windows. - LLMemory::updateMemoryInfo(); - physical_res = LLMemory::getAvailableMemKB(); + //LLMemory::updateMemoryInfo(); + //physical_res = LLMemory::getAvailableMemKB(); + // } else if (gGLManager.mHasNVXMemInfo) { @@ -580,6 +582,12 @@ void LLViewerTexture::getGPUMemoryForTextures(S32Megabytes &gpu, S32Megabytes &p gpu_res = (S32Megabytes)(free_memory / 1024); } + // Maybe do this independently from AMD cards???? + //check main memory, only works for windows. + LLMemory::updateMemoryInfo(); + physical_res = LLMemory::getAvailableMemKB(); + // + gpu = gpu_res; physical = physical_res; } @@ -604,6 +612,9 @@ void LLViewerTexture::updateClass(const F32 velocity, const F32 angular_velocity LLViewerMediaTexture::updateClass(); } + // Dynamic texture memory calculation + gTextureList.updateTexMemDynamic(); + sBoundTextureMemory = LLImageGL::sBoundTextureMemory; sTotalTextureMemory = LLImageGL::sGlobalTextureMemory; sMaxBoundTextureMemory = gTextureList.getMaxResidentTexMem(); @@ -1307,20 +1318,22 @@ void LLViewerFetchedTexture::loadFromFastCache() else { if (mBoostLevel == LLGLTexture::BOOST_ICON) - { - S32 expected_width = mKnownDrawWidth > 0 ? mKnownDrawWidth : DEFAULT_ICON_DIMENTIONS; - S32 expected_height = mKnownDrawHeight > 0 ? mKnownDrawHeight : DEFAULT_ICON_DIMENTIONS; - if (mRawImage && (mRawImage->getWidth() > expected_width || mRawImage->getHeight() > expected_height)) { - // scale oversized icon, no need to give more work to gl - mRawImage->scale(expected_width, expected_height); - } + // Shouldn't do anything usefull since texures in fast cache are 16x16, + // it is here in case fast cache changes. + S32 expected_width = mKnownDrawWidth > 0 ? mKnownDrawWidth : DEFAULT_ICON_DIMENTIONS; + S32 expected_height = mKnownDrawHeight > 0 ? mKnownDrawHeight : DEFAULT_ICON_DIMENTIONS; + if (mRawImage && (mRawImage->getWidth() > expected_width || mRawImage->getHeight() > expected_height)) + { + // scale oversized icon, no need to give more work to gl + mRawImage->scale(expected_width, expected_height); + } } - mRequestedDiscardLevel = mDesiredDiscardLevel + 1; - mIsRawImageValid = TRUE; - addToCreateTexture(); - } + mRequestedDiscardLevel = mDesiredDiscardLevel + 1; + mIsRawImageValid = TRUE; + addToCreateTexture(); + } } else { @@ -1595,7 +1608,8 @@ BOOL LLViewerFetchedTexture::createTexture(S32 usename/*= 0*/) mOrigWidth = mRawImage->getWidth(); mOrigHeight = mRawImage->getHeight(); - + // This is only safe because it's a local image and fetcher doesn't use raw data + // from local images, but this might become unsafe in case of changes to fetcher if (mBoostLevel == BOOST_PREVIEW) { mRawImage->biasedScaleToPowerOfTwo(1024); @@ -1651,6 +1665,26 @@ BOOL LLViewerFetchedTexture::createTexture(S32 usename/*= 0*/) return FALSE; } + if (mGLTexturep->getHasExplicitFormat()) + { + LLGLenum format = mGLTexturep->getPrimaryFormat(); + S8 components = mRawImage->getComponents(); + if ((format == GL_RGBA && components < 4) + || (format == GL_RGB && components < 3)) + { + LL_WARNS() << "Can't create a texture " << mID << ": invalid image format " << std::hex << format << " vs components " << (U32)components << LL_ENDL; + // Was expecting specific format but raw texture has insufficient components for + // such format, using such texture will result in crash or will display wrongly + // if we change format. Texture might be corrupted server side, so just set as + // missing and clear cashed texture (do not cause reload loop, will retry&recover + // during new session) + setIsMissingAsset(); + destroyRawImage(); + LLAppViewer::getTextureCache()->removeFromCache(mID); + return FALSE; + } + } + res = mGLTexturep->createGLTexture(mRawDiscardLevel, mRawImage, usename, TRUE, mBoostLevel); notifyAboutCreatingTexture(); @@ -2130,6 +2164,7 @@ bool LLViewerFetchedTexture::updateFetch() if (mRawImage.notNull()) sRawCount--; if (mAuxRawImage.notNull()) sAuxCount--; + // keep in mind that fetcher still might need raw image, don't modify original bool finished = LLAppViewer::getTextureFetch()->getRequestFinished(getID(), fetch_discard, mRawImage, mAuxRawImage, mLastHttpGetStatus); if (mRawImage.notNull()) sRawCount++; @@ -2192,7 +2227,8 @@ bool LLViewerFetchedTexture::updateFetch() if (mRawImage && (mRawImage->getWidth() > expected_width || mRawImage->getHeight() > expected_height)) { // scale oversized icon, no need to give more work to gl - mRawImage->scale(expected_width, expected_height); + // since we got mRawImage from thread worker and image may be in use (ex: writing cache), make a copy + mRawImage = mRawImage->scaled(expected_width, expected_height); } } diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 49ad783fcf..feb6f5a56d 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -197,6 +197,7 @@ private: static bool isMemoryForTextureLow() ; static bool isMemoryForTextureSuficientlyFree(); +public: // Dynamic texture memory calculation static void getGPUMemoryForTextures(S32Megabytes &gpu, S32Megabytes &physical); protected: diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 18656e40a3..88777fbc15 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -1523,6 +1523,62 @@ void LLViewerTextureList::updateMaxResidentTexMem(S32Megabytes mem) LL_INFOS() << "Available Texture Memory set to: " << mMaxResidentTexMemInMegaBytes << " MB" << LL_ENDL; } +// Dynamic texture memory calculation +//static +bool LLViewerTextureList::canUseDynamicTextureMemory() +{ +#if ADDRESS_SIZE == 64 + return (gGLManager.mHasATIMemInfo || gGLManager.mHasNVXMemInfo) && gGLManager.mVRAM >= 512; +#else + return false; +#endif +} + +void LLViewerTextureList::updateTexMemDynamic() +{ + if (!canUseDynamicTextureMemory()) + { + return; + } + + static LLCachedControl fsDynamicTexMem(gSavedSettings, "FSDynamicTextureMemory"); + if (!fsDynamicTexMem) + { + return; + } + + static LLCachedControl fsDynamicTexMemCacheReserve(gSavedSettings, "FSDynamicTextureMemoryCacheReserve"); + static LLCachedControl fsDynamicTexMemGPUReserve(gSavedSettings, "FSDynamicTextureMemoryGPUReserve"); + static LLCachedControl fsDynamicTexMemMinTextureMemory(gSavedSettings, "FSDynamicTextureMemoryMinTextureMemory"); + + // Make sure to keep the percentages within sane limits + S32 cache_reserve_perc = llclamp(fsDynamicTexMemCacheReserve(), 5, 30); + S32 gpu_reserve_perc = llclamp(fsDynamicTexMemGPUReserve(), 5, 30); + + // Percentage-based memory reserves + S32Megabytes cache_reserve = S32Megabytes((gGLManager.mVRAM / 100) * cache_reserve_perc); + S32Megabytes gpu_reserve = S32Megabytes((gGLManager.mVRAM / 100) * gpu_reserve_perc); + + S32Megabytes gpu_available; + S32Megabytes system_available; + LLViewerTexture::getGPUMemoryForTextures(gpu_available, system_available); + + // Maximum texture memory is remaining available memory + what's already used for textures by the viewer + S32Megabytes max_tex_mem_in_gpu = gpu_available + LLImageGL::sGlobalTextureMemory; + + // Don't let the minimum texture memory + reserves exceed the total phyiscal memory of the GPU + S32Megabytes min_texture_mem = llmin(S32Megabytes(gGLManager.mVRAM), S32Megabytes(fsDynamicTexMemMinTextureMemory()) + cache_reserve + gpu_reserve); + + // Always use at least the specified minimum amount of texture memory, even if it would exceed available + // GPU memory, but always take the GPU memory reserve into account. + // We need to set MaxTotalTextureMem first, since it contains all textures currently in GPU memory + // (displayed = bound AND cached = loaded, but currently not displayed). The cached textures will + // get evicted from GPU memory, if available memory gets low (see LLViewerFetchedTexture::destroyTexture()). + mMaxTotalTextureMemInMegaBytes = llmax(max_tex_mem_in_gpu, min_texture_mem) - gpu_reserve; + mMaxResidentTexMemInMegaBytes = mMaxTotalTextureMemInMegaBytes - cache_reserve; +} +// + /////////////////////////////////////////////////////////////////////////////// // static diff --git a/indra/newview/llviewertexturelist.h b/indra/newview/llviewertexturelist.h index 4eff6e67e6..6feae4d897 100644 --- a/indra/newview/llviewertexturelist.h +++ b/indra/newview/llviewertexturelist.h @@ -129,6 +129,10 @@ public: S32 getNumImages() { return mImageList.size(); } void updateMaxResidentTexMem(S32Megabytes mem); + // Dynamic texture memory calculation + void updateTexMemDynamic(); + static bool canUseDynamicTextureMemory(); + // void doPreloadImages(); void doPrefetchImages(); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 289c3ed6ec..931f4f0f98 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -372,6 +372,12 @@ public: void update() { + if (!gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) + { + clearText(); + return; + } + static LLCachedControl log_texture_traffic(gSavedSettings,"LogTextureNetworkTraffic", false) ; std::string wind_vel_text; @@ -781,19 +787,23 @@ public: addText(xpos, ypos, "View Matrix"); ypos += y_inc; } - // - //if (gSavedSettings.getBOOL("DebugShowColor") && !LLRender::sNsightDebugSupport) - //static LLCachedControl debugShowColor(gSavedSettings, "DebugShowColor"); - static LLCachedControl debugShowColor(gSavedSettings, "DebugShowColor"); - // - if (debugShowColor && !LLRender::sNsightDebugSupport) - { - U8 color[4]; - LLCoordGL coord = gViewerWindow->getCurrentMouse(); - glReadPixels(coord.mX, coord.mY, 1,1,GL_RGBA, GL_UNSIGNED_BYTE, color); - addText(xpos, ypos, llformat("%d %d %d %d", color[0], color[1], color[2], color[3])); - ypos += y_inc; - } + // + //static LLCachedControl debugShowColor(gSavedSettings, "DebugShowColor"); + static LLCachedControl debugShowColor(gSavedSettings, "DebugShowColor"); + if (debugShowColor && !LLRender::sNsightDebugSupport) + // + { + U8 color[4]; + LLCoordGL coord = gViewerWindow->getCurrentMouse(); + + // Convert x,y to raw pixel coords + S32 x_raw = llround(coord.mX * gViewerWindow->getWindowWidthRaw() / (F32) gViewerWindow->getWindowWidthScaled()); + S32 y_raw = llround(coord.mY * gViewerWindow->getWindowHeightRaw() / (F32) gViewerWindow->getWindowHeightScaled()); + + glReadPixels(x_raw, y_raw, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, color); + addText(xpos, ypos, llformat("Pixel <%1d, %1d> R:%1d G:%1d B:%1d A:%1d", x_raw, y_raw, color[0], color[1], color[2], color[3])); + ypos += y_inc; + } // FIRE-29880: Movelock static LLCachedControl fsRenderMovelockState(gSavedPerAccountSettings, "UseMoveLock"); @@ -2591,7 +2601,7 @@ void LLViewerWindow::shutdownGL() LLViewerWindow::~LLViewerWindow() { LL_INFOS() << "Destroying Window" << LL_ENDL; - gDebugWindowProc = TRUE; // event catching, at this point it shouldn't output at all + gDebugWindowProc = TRUE; // event catching, disable once we figure out cause for exit crashes destroyWindow(); delete mDebugText; @@ -4365,7 +4375,7 @@ void renderMeshPhysicsTriangles(const LLColor4& color, const LLColor4& line_colo LLGLEnable offset(GL_POLYGON_OFFSET_FILL); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); glPolygonOffset(offset_factor, offset_units); - glLineWidth(1.f); + gGL.setLineWidth(1.f); // Line width OGL core profile fix by Rye Mutt LLVertexBuffer::drawArrays(LLRender::TRIANGLES, decomp->mPhysicsShapeMesh.mPositions, decomp->mPhysicsShapeMesh.mNormals); } { @@ -4373,7 +4383,7 @@ void renderMeshPhysicsTriangles(const LLColor4& color, const LLColor4& line_colo LLGLEnable offset(GL_POLYGON_OFFSET_LINE); glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); glPolygonOffset(offset_factor, offset_units); - glLineWidth(3.f); + gGL.setLineWidth(3.f); // Line width OGL core profile fix by Rye Mutt LLVertexBuffer::drawArrays(LLRender::TRIANGLES, decomp->mPhysicsShapeMesh.mPositions, decomp->mPhysicsShapeMesh.mNormals); } } @@ -4401,12 +4411,12 @@ void renderMeshPhysicsTriangles(const LLColor4& color, const LLColor4& line_colo LLVertexBuffer::drawArrays(LLRender::TRIANGLES, decomp->mPhysicsShapeMesh.mPositions, decomp->mPhysicsShapeMesh.mNormals); glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); gGL.diffuseColor4fv(line_color.mV); - glLineWidth(3.f); + gGL.setLineWidth(3.f); // Line width OGL core profile fix by Rye Mutt LLVertexBuffer::drawArrays(LLRender::TRIANGLES, decomp->mPhysicsShapeMesh.mPositions, decomp->mPhysicsShapeMesh.mNormals); } } - glLineWidth(1.f); + gGL.setLineWidth(1.f); // Line width OGL core profile fix by Rye Mutt glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); gGL.popMatrix(); @@ -6895,7 +6905,8 @@ void LLViewerWindow::setUIVisibility(bool visible) FSNearbyChat::instance().showDefaultChatBar(visible && !gSavedSettings.getBOOL("AutohideChatBar")); gSavedSettings.setBOOL("FSInternalShowNavbarNavigationPanel", visible && gSavedSettings.getBOOL("ShowNavbarNavigationPanel")); gSavedSettings.setBOOL("FSInternalShowNavbarFavoritesPanel", visible && gSavedSettings.getBOOL("ShowNavbarFavoritesPanel")); - mRootView->getChildView("chiclet_container")->setVisible(visible); + mRootView->getChildView("chiclet_container")->setVisible(visible && gSavedSettings.getBOOL("InternalShowGroupNoticesTopRight")); + mRootView->getChildView("chiclet_container_bottom")->setVisible(visible && !gSavedSettings.getBOOL("InternalShowGroupNoticesTopRight")); // // Is done inside XUI now, using visibility_control diff --git a/indra/newview/llvlcomposition.cpp b/indra/newview/llvlcomposition.cpp index 25326f7e05..8ba0f89fdc 100644 --- a/indra/newview/llvlcomposition.cpp +++ b/indra/newview/llvlcomposition.cpp @@ -307,6 +307,14 @@ BOOL LLVLComposition::generateTexture(const F32 x, const F32 y, mDetailTextures[i]->getComponents() != 3) { LLPointer newraw = new LLImageRaw(BASE_SIZE, BASE_SIZE, 3); + // guard against bad alloc here that leads to crash in composite + if(!newraw) + { + // Not much that is useful to do here, this ship is sinking it seems. + LL_WARNS("Terrain") << "allocation of new raw image failed" << LL_ENDL; + return(FALSE); + } + // newraw->composite(mRawImages[i]); mRawImages[i] = newraw; // deletes old } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 83a227d628..0bd378ce8c 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5749,7 +5749,7 @@ U32 LLVOAvatar::renderImpostor(LLColor4U color, S32 diffuse_channel) gGL.begin(LLRender::LINES); gGL.color4f(1.f,1.f,1.f,1.f); F32 thickness = llmax(F32(5.0f-5.0f*(gFrameTimeSeconds-mLastImpostorUpdateFrameTime)),1.0f); - glLineWidth(thickness); + gGL.setLineWidth(thickness); // Line width OGL core profile fix by Rye Mutt gGL.vertex3fv((pos+left-up).mV); gGL.vertex3fv((pos-left-up).mV); gGL.vertex3fv((pos-left-up).mV); @@ -6601,7 +6601,7 @@ BOOL LLVOAvatar::startMotion(const LLUUID& id, F32 time_offset) LLUUID remap_id; if (isSelf()) { - remap_id = AOEngine::getInstance()->override(id, TRUE); + remap_id = AOEngine::getInstance()->override(id, true); if (remap_id.isNull()) { remap_id = remapMotionID(id); @@ -6647,7 +6647,7 @@ BOOL LLVOAvatar::stopMotion(const LLUUID& id, BOOL stop_immediate) LLUUID remap_id; if (isSelf()) { - remap_id = AOEngine::getInstance()->override(id, FALSE); + remap_id = AOEngine::getInstance()->override(id, false); if (remap_id.isNull()) { remap_id = remapMotionID(id); diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index f2022109dd..a37e8319ae 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -583,6 +583,8 @@ BOOL LLVOAvatarSelf::buildMenus() if (gDetachBodyPartPieMenus[i]) { gDetachPieMenu->appendContextSubMenu( gDetachBodyPartPieMenus[i] ); + // FIRE-7893: "Detach" sub-menu on inspect menu without function + gInspectSelfDetachMenu->appendContextSubMenu( gDetachBodyPartPieMenus[i] ); } else { @@ -611,6 +613,8 @@ BOOL LLVOAvatarSelf::buildMenus() LLMenuItemCallGL* item = LLUICtrlFactory::create(item_params); gDetachPieMenu->addChild(item); + // FIRE-7893: "Detach" sub-menu on inspect menu without function + gInspectSelfDetachMenu->addChild(item); break; } @@ -754,6 +758,8 @@ BOOL LLVOAvatarSelf::buildMenus() item_params.on_enable.parameter = iter->first; item = LLUICtrlFactory::create(item_params); gDetachScreenPieMenu->addChild(item); + // FIRE-7893: "Detach" sub-menu on inspect menu without function + gInspectSelfDetachScreenMenu->addChild(item); // Pie menu slice_params.name =(slice_params.label ); diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index fa8f89dfd0..5b707fa36f 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -1046,7 +1046,12 @@ LLSpeakerVolumeStorage::LLSpeakerVolumeStorage() LLSpeakerVolumeStorage::~LLSpeakerVolumeStorage() { - save(); +} + +//virtual +void LLSpeakerVolumeStorage::cleanupSingleton() +{ + save(); } void LLSpeakerVolumeStorage::storeSpeakerVolume(const LLUUID& speaker_id, F32 volume) diff --git a/indra/newview/llvoiceclient.h b/indra/newview/llvoiceclient.h index 1bded82dd4..6f0add2288 100644 --- a/indra/newview/llvoiceclient.h +++ b/indra/newview/llvoiceclient.h @@ -534,9 +534,13 @@ protected: **/ class LLSpeakerVolumeStorage : public LLSingleton { - LLSINGLETON(LLSpeakerVolumeStorage); + LLSINGLETON_C11(LLSpeakerVolumeStorage); ~LLSpeakerVolumeStorage(); LOG_CLASS(LLSpeakerVolumeStorage); + +protected: + virtual void cleanupSingleton() override; + public: /** diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 51bd0839d7..3620ba8d9f 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -251,7 +251,8 @@ LLVOVolume::LLVOVolume(const LLUUID &id, const LLPCode pcode, LLViewerRegion *re mLastFetchedMediaVersion = -1; memset(&mIndexInTex, 0, sizeof(S32) * LLRender::NUM_VOLUME_TEXTURE_CHANNELS); mMDCImplCount = 0; - mLastRiggingInfoLOD = -1; + mLastRiggingInfoLOD = -1; + mResetDebugText = false; } LLVOVolume::~LLVOVolume() @@ -1545,6 +1546,15 @@ BOOL LLVOVolume::calcLOD() { std::string debug_object_text = get_debug_object_lod_text(this); setDebugText(debug_object_text); + mResetDebugText = true; + } + } + else + { + if (mResetDebugText) + { + restoreHudText(); + mResetDebugText = false; } } diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h index e2a4dcbf1e..4fa7a062d2 100644 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -434,6 +434,8 @@ private: S32 mIndexInTex[LLRender::NUM_VOLUME_TEXTURE_CHANNELS]; S32 mMDCImplCount; + bool mResetDebugText; + LLPointer mRiggedVolume; // statics diff --git a/indra/newview/llvowater.cpp b/indra/newview/llvowater.cpp index 63374b8865..ead944c42b 100644 --- a/indra/newview/llvowater.cpp +++ b/indra/newview/llvowater.cpp @@ -148,7 +148,7 @@ BOOL LLVOWater::updateGeometry(LLDrawable *drawable) static const unsigned int vertices_per_quad = 4; static const unsigned int indices_per_quad = 6; - const S32 size = gSavedSettings.getBOOL("RenderTransparentWater") && LLGLSLShader::sNoFixedFunction ? 16 : 1; + const S32 size = LLPipeline::sRenderTransparentWater && LLGLSLShader::sNoFixedFunction ? 16 : 1; const S32 num_quads = size * size; face->setSize(vertices_per_quad * num_quads, diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp index 5098525b6d..18dccaea3a 100644 --- a/indra/newview/llwearableitemslist.cpp +++ b/indra/newview/llwearableitemslist.cpp @@ -38,9 +38,7 @@ #include "llgesturemgr.h" #include "lltransutil.h" #include "llviewerattachmenu.h" -// [SL:KB] - Patch: Inventory-AttachmentEdit - Checked: 2010-09-04 (Catznip-2.2.0a) | Added: Catznip-2.1.2a #include "llviewermenu.h" -// [/SL:KB] #include "llvoavatarself.h" // [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1a) #include "rlvactions.h" @@ -736,29 +734,6 @@ bool LLWearableItemCreationDateComparator::doCompare(const LLPanelInventoryListI ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// -// [SL:KB] - Patch: Inventory-AttachmentEdit - Checked: 2010-09-04 (Catznip-2.2.0a) | Added: Catznip-2.1.2a -// TODO-Catznip: [Catznip-2.1.3] This function is duplicated in llpanelwearing.cpp so find a better place where it can be shared instead -static void edit_item(const LLUUID& idItem) -{ - const LLViewerInventoryItem* pItem = gInventory.getItem(idItem); - if (!pItem) - return; - - switch (pItem->getType()) - { - case LLAssetType::AT_BODYPART: - case LLAssetType::AT_CLOTHING: - LLAgentWearables::editWearable(idItem); - break; - case LLAssetType::AT_OBJECT: - handle_attachment_edit(idItem); - break; - default: - break; - } -} -// [/SL:KB] - static LLWearableItemTypeNameComparator WEARABLE_TYPE_NAME_COMPARATOR; static const LLWearableItemTypeNameComparator WEARABLE_TYPE_LAYER_COMPARATOR; static const LLWearableItemNameComparator WEARABLE_NAME_COMPARATOR; @@ -1017,10 +992,7 @@ LLContextMenu* LLWearableItemsList::ContextMenu::createMenu() // Register handlers common for all wearable types. registrar.add("Wearable.Wear", boost::bind(wear_multiple, ids, true)); registrar.add("Wearable.Add", boost::bind(wear_multiple, ids, false)); -// registrar.add("Wearable.Edit", boost::bind(handleMultiple, LLAgentWearables::editWearable, ids)); -// [SL:KB] - Patch: Inventory-AttachmentEdit - Checked: 2010-09-04 (Catznip-2.2.0a) | Added: Catznip-2.1.2a - registrar.add("Wearable.Edit", boost::bind(handleMultiple, edit_item, ids)); -// [/SL:KB] + registrar.add("Wearable.Edit", boost::bind(handle_item_edit, selected_id)); registrar.add("Wearable.CreateNew", boost::bind(createNewWearable, selected_id)); registrar.add("Wearable.ShowOriginal", boost::bind(show_item_original, selected_id)); registrar.add("Wearable.TakeOffDetach", @@ -1035,6 +1007,7 @@ LLContextMenu* LLWearableItemsList::ContextMenu::createMenu() // Register handlers for attachments. registrar.add("Attachment.Detach", boost::bind(&LLAppearanceMgr::removeItemsFromAvatar, LLAppearanceMgr::getInstance(), ids)); + registrar.add("Attachment.Touch", boost::bind(handle_attachment_touch, selected_id)); registrar.add("Attachment.Profile", boost::bind(show_item_profile, selected_id)); registrar.add("Object.Attach", boost::bind(LLViewerAttachMenu::attachObjects, ids, _2)); @@ -1064,6 +1037,7 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu U32 n_already_worn = 0; // number of items worn of same type as selected items U32 n_links = 0; // number of links among the selected items U32 n_editable = 0; // number of editable items among the selected ones + U32 n_touchable = 0; // number of touchable items among the selected ones bool can_be_worn = true; @@ -1091,16 +1065,17 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu const LLWearableType::EType wearable_type = item->getWearableType(); const bool is_link = item->getIsLinkType(); const bool is_worn = get_is_item_worn(id); -// const bool is_editable = gAgentWearables.isWearableModifiable(id); -// [SL:KB] - Patch: Inventory-AttachmentEdit - Checked: 2010-09-04 (Catznip-2.2.0a) | Added: Catznip-2.1.2a - const bool is_editable = - (item->isWearableType()) ? gAgentWearables.isWearableModifiable(id) : (LLAssetType::AT_OBJECT == item->getType()); -// [/SL:KB] + const bool is_editable = get_is_item_editable(id); + const bool is_touchable = enable_attachment_touch(id); const bool is_already_worn = gAgentWearables.selfHasWearable(wearable_type); if (is_worn) { ++n_worn; } + if (is_touchable) + { + ++n_touchable; + } if (is_editable) { ++n_editable; @@ -1166,11 +1141,10 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu setMenuItemEnabled(menu, "wear_replace", rlvCanWearReplace); // [/RLVa:KB] //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); -// [SL:KB] - Patch: Inventory-AttachmentEdit - Checked: 2010-09-04 (Catznip-2.2.0a) | Added: Catznip-2.1.2a - setMenuItemVisible(menu, "edit", !standalone && mask & (MASK_CLOTHING|MASK_BODYPART|MASK_ATTACHMENT) && n_worn == n_items && n_worn == 1); -// [/SL:KB] - setMenuItemEnabled(menu, "edit", n_editable == 1 && n_worn == 1 && n_items == 1); + setMenuItemVisible(menu, "touch", !standalone && mask == MASK_ATTACHMENT && n_worn == n_items); + setMenuItemEnabled(menu, "touch", n_touchable && n_worn == 1 && n_items == 1); + setMenuItemVisible(menu, "edit", !standalone && mask & (MASK_CLOTHING|MASK_BODYPART|MASK_ATTACHMENT) && n_worn == n_items); + setMenuItemEnabled(menu, "edit", n_editable && n_worn == 1 && n_items == 1); // Optional "Create new" menu item //setMenuItemVisible(menu, "create_new", mask & (MASK_CLOTHING|MASK_BODYPART) && n_items == 1); setMenuItemVisible(menu, "create_new", show_create_new && mask & (MASK_CLOTHING|MASK_BODYPART) && n_items == 1); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 6d2a26ec01..9ff89a4651 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -342,6 +342,7 @@ bool LLPipeline::sDelayVBUpdate = true; bool LLPipeline::sAutoMaskAlphaDeferred = true; bool LLPipeline::sAutoMaskAlphaNonDeferred = false; bool LLPipeline::sDisableShaders = false; +bool LLPipeline::sRenderTransparentWater = true; bool LLPipeline::sRenderBump = true; bool LLPipeline::sBakeSunlight = false; bool LLPipeline::sNoAlpha = false; @@ -1132,6 +1133,12 @@ bool LLPipeline::allocateShadowBuffer(U32 resX, U32 resY) return true; } +//static +void LLPipeline::updateRenderTransparentWater() +{ + sRenderTransparentWater = gSavedSettings.getBOOL("RenderTransparentWater"); +} + //static void LLPipeline::updateRenderBump() { @@ -1145,6 +1152,7 @@ void LLPipeline::updateRenderDeferred() RenderDeferred && LLRenderTarget::sUseFBO && LLPipeline::sRenderBump && + LLPipeline::sRenderTransparentWater && RenderAvatarVP && WindLightUseAtmosShaders && (bool) LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred"); @@ -5122,7 +5130,7 @@ void LLPipeline::renderDebug() if ( pathfindingConsole->isRenderNavMesh() ) { gGL.flush(); - glLineWidth(2.0f); + gGL.setLineWidth(2.0f); // Line width OGL core profile fix by Rye Mutt LLGLEnable cull(GL_CULL_FACE); LLGLDisable blend(GL_BLEND); @@ -5153,7 +5161,7 @@ void LLPipeline::renderDebug() gGL.flush(); glPolygonMode( GL_FRONT_AND_BACK, GL_FILL ); - glLineWidth(1.0f); + gGL.setLineWidth(1.0f); // Line width OGL core profile fix by Rye Mutt gGL.flush(); } //User designated path @@ -5290,11 +5298,11 @@ void LLPipeline::renderDebug() gPathfindingProgram.uniform1f(sTint, 1.f); gPathfindingProgram.uniform1f(sAlphaScale, 1.f); - glLineWidth(gSavedSettings.getF32("PathfindingLineWidth")); + gGL.setLineWidth(gSavedSettings.getF32("PathfindingLineWidth")); // Line width OGL core profile fix by Rye Mutt LLGLDisable blendOut(GL_BLEND); llPathingLibInstance->renderNavMeshShapesVBO( render_order[i] ); gGL.flush(); - glLineWidth(1.f); + gGL.setLineWidth(1.f); // Line width OGL core profile fix by Rye Mutt } glPolygonMode( GL_FRONT_AND_BACK, GL_FILL ); @@ -5317,7 +5325,7 @@ void LLPipeline::renderDebug() LLGLEnable blend(GL_BLEND); LLGLDepthTest depth(GL_TRUE, GL_FALSE, GL_GREATER); gGL.flush(); - glLineWidth(2.0f); + gGL.setLineWidth(2.0f); // Line width OGL core profile fix by Rye Mutt LLGLEnable cull(GL_CULL_FACE); gPathfindingProgram.uniform1f(sTint, gSavedSettings.getF32("PathfindingXRayTint")); @@ -5351,7 +5359,7 @@ void LLPipeline::renderDebug() } gGL.flush(); - glLineWidth(1.0f); + gGL.setLineWidth(1.0f); // Line width OGL core profile fix by Rye Mutt } glPolygonOffset(0.f, 0.f); @@ -5616,7 +5624,7 @@ void LLPipeline::renderDebug() } /*gGL.flush(); - glLineWidth(16-i*2); + gGL.setLineWidth(16-i*2); // Line width OGL core profile fix by Rye Mutt for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); iter != LLWorld::getInstance()->getRegionList().end(); ++iter) { @@ -5634,7 +5642,7 @@ void LLPipeline::renderDebug() } } gGL.flush(); - glLineWidth(1.f);*/ + gGL.setLineWidth(1.f);*/ // Line width OGL core profile fix by Rye Mutt } } @@ -6199,25 +6207,18 @@ static F32 calc_light_dist(LLVOVolume* light, const LLVector3& cam_pos, F32 max_ { return max_dist; } - F32 radius = light->getLightRadius(); bool selected = light->isSelected(); - LLVector3 dpos = light->getRenderPosition() - cam_pos; - F32 dist2 = dpos.lengthSquared(); - if (!selected && dist2 > (max_dist + radius)*(max_dist + radius)) - { - return max_dist; - } - F32 dist = (F32) sqrt(dist2); - dist *= 1.f / inten; - dist -= radius; if (selected) { - dist -= 10000.f; // selected lights get highest priority + return 0.f; // selected lights get highest priority } + F32 radius = light->getLightRadius(); + F32 dist = dist_vec(light->getRenderPosition(), cam_pos); + dist = llmax(dist - radius, 0.f); if (light->mDrawable.notNull() && light->mDrawable->isState(LLDrawable::ACTIVE)) { // moving lights get a little higher priority (too much causes artifacts) - dist -= light->getLightRadius()*0.25f; + dist = llmax(dist - light->getLightRadius()*0.25f, 0.f); } return dist; } @@ -6236,13 +6237,18 @@ void LLPipeline::calcNearbyLights(LLCamera& camera) // mNearbyLight (and all light_set_t's) are sorted such that // begin() == the closest light and rbegin() == the farthest light const S32 MAX_LOCAL_LIGHTS = 6; -// LLVector3 cam_pos = gAgent.getCameraPositionAgent(); - LLVector3 cam_pos = LLViewerJoystick::getInstance()->getOverrideCamera() ? - camera.getOrigin() : - gAgent.getPositionAgent(); - - F32 max_dist = LIGHT_MAX_RADIUS * 4.f; // ignore enitrely lights > 4 * max light rad + LLVector3 cam_pos = camera.getOrigin(); + F32 max_dist; + if (LLPipeline::sRenderDeferred) + { + max_dist = RenderFarClip; + } + else + { + max_dist = llmin(RenderFarClip, LIGHT_MAX_RADIUS * 4.f); + } + // UPDATE THE EXISTING NEARBY LIGHTS light_set_t cur_nearby_lights; for (light_set_t::iterator iter = mNearbyLights.begin(); @@ -6276,8 +6282,38 @@ void LLPipeline::calcNearbyLights(LLCamera& camera) continue; } - F32 dist = calc_light_dist(volight, cam_pos, max_dist); - cur_nearby_lights.insert(Light(drawable, dist, light->fade)); + F32 dist = calc_light_dist(volight, cam_pos, max_dist); + F32 fade = light->fade; + // actual fade gets decreased/increased by setupHWLights + // light->fade value is 'time'. + // >=0 and light will become visible as value increases + // <0 and light will fade out + if (dist < max_dist) + { + if (fade < 0) + { + // mark light to fade in + // if fade was -LIGHT_FADE_TIME - it was fully invisible + // if fade -0 - it was fully visible + // visibility goes up from 0 to LIGHT_FADE_TIME. + fade += LIGHT_FADE_TIME; + } + } + else + { + // mark light to fade out + // visibility goes down from -0 to -LIGHT_FADE_TIME. + if (fade >= LIGHT_FADE_TIME) + { + fade = -0.0001f; // was fully visible + } + else if (fade >= 0) + { + // 0.75 visible light should stay 0.75 visible, but should reverse direction + fade -= LIGHT_FADE_TIME; + } + } + cur_nearby_lights.insert(Light(drawable, dist, fade)); } mNearbyLights = cur_nearby_lights; @@ -6296,17 +6332,23 @@ void LLPipeline::calcNearbyLights(LLCamera& camera) { continue; // no lighting from HUD objects } - F32 dist = calc_light_dist(light, cam_pos, max_dist); - if (dist >= max_dist) + if (!sRenderAttachedLights && light && light->isAttachment()) { continue; } - if (!sRenderAttachedLights && light && light->isAttachment()) + LLVOAvatar * av = light->getAvatar(); + if (av && (av->isTooComplex() || av->isInMuteList())) + { + // avatars that are already in the list will be removed by removeMutedAVsLights + continue; + } + F32 dist = calc_light_dist(light, cam_pos, max_dist); + if (dist >= max_dist) { continue; } new_nearby_lights.insert(Light(drawable, dist, 0.f)); - if (new_nearby_lights.size() > (U32)MAX_LOCAL_LIGHTS) + if (!LLPipeline::sRenderDeferred && new_nearby_lights.size() > (U32)MAX_LOCAL_LIGHTS) { new_nearby_lights.erase(--new_nearby_lights.end()); const Light& last = *new_nearby_lights.rbegin(); @@ -6319,7 +6361,7 @@ void LLPipeline::calcNearbyLights(LLCamera& camera) iter != new_nearby_lights.end(); iter++) { const Light* light = &(*iter); - if (mNearbyLights.size() < (U32)MAX_LOCAL_LIGHTS) + if (LLPipeline::sRenderDeferred || mNearbyLights.size() < (U32)MAX_LOCAL_LIGHTS) { mNearbyLights.insert(*light); ((LLDrawable*) light->drawable)->setState(LLDrawable::NEARBY_LIGHT); @@ -6332,10 +6374,22 @@ void LLPipeline::calcNearbyLights(LLCamera& camera) Light* farthest_light = (const_cast(&(*(mNearbyLights.rbegin())))); if (light->dist < farthest_light->dist) { - if (farthest_light->fade >= 0.f) - { - farthest_light->fade = -(gFrameIntervalSeconds.value()); - } + // mark light to fade out + // visibility goes down from -0 to -LIGHT_FADE_TIME. + // + // This is a mess, but for now it needs to be in sync + // with fade code above. Ex: code above detects distance < max, + // sets fade time to positive, this code then detects closer + // lights and sets fade time negative, fully compensating + // for the code above + if (farthest_light->fade >= LIGHT_FADE_TIME) + { + farthest_light->fade = -0.0001f; // was fully visible + } + else if (farthest_light->fade >= 0) + { + farthest_light->fade -= LIGHT_FADE_TIME; + } } else { @@ -6455,12 +6509,6 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) } } - const LLViewerObject *vobj = drawable->getVObj(); - if(vobj && vobj->getAvatar() && vobj->getAvatar()->isInMuteList()) - { - continue; - } - if (drawable->isState(LLDrawable::ACTIVE)) { mLightMovingMask |= (1<setBuffer(LLVertexBuffer::MAP_VERTEX); LLGLDepthTest depth(GL_TRUE, GL_FALSE); - for (LLDrawable::drawable_set_t::iterator iter = mLights.begin(); iter != mLights.end(); ++iter) + // mNearbyLights already includes distance calculation and excludes muted avatars. + // It is calculated from mLights + // mNearbyLights also provides fade value to gracefully fade-out out of range lights + for (light_set_t::iterator iter = mNearbyLights.begin(); iter != mNearbyLights.end(); ++iter) { - LLDrawable *drawablep = *iter; - - LLVOVolume *volume = drawablep->getVOVolume(); + LLDrawable * drawablep = iter->drawable; + LLVOVolume * volume = drawablep->getVOVolume(); if (!volume) { continue; @@ -8899,30 +8949,32 @@ void LLPipeline::renderDeferredLighting(LLRenderTarget *screen_target) } } - const LLViewerObject *vobj = drawablep->getVObj(); - if (vobj) - { - LLVOAvatar *av = vobj->getAvatar(); - if (av && (av->isTooComplex() || av->isInMuteList())) - { - continue; - } - } - - const LLVector3 position = drawablep->getPositionAgent(); - if (dist_vec(position, LLViewerCamera::getInstance()->getOrigin()) > RenderFarClip + volume->getLightRadius()) - { - continue; - } - LLVector4a center; - center.load3(position.mV); + center.load3(drawablep->getPositionAgent().mV); const F32 *c = center.getF32ptr(); F32 s = volume->getLightRadius() * 1.5f; // send light color to shader in linear space LLColor3 col = volume->getLightLinearColor(); + // fade also works as flicker prevention during reparenting + // because reparenting causes distance to jump temporary + F32 fade = iter->fade; + if (fade < LIGHT_FADE_TIME) + { + // fade in/out light + if (fade >= 0.f) + { + fade = fade / LIGHT_FADE_TIME; + } + else + { + fade = 1.f + fade / LIGHT_FADE_TIME; + } + fade = llclamp(fade, 0.f, 1.f); + col *= fade; + } + if (col.magVecSquared() < 0.001f) { continue; @@ -9589,6 +9641,10 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) } //LLPipeline::sUseOcclusion = occlusion; + // Add option to allow object occlusion for water distortion generation + static LLCachedControl fsAllowWaterDistortionOcclusion(gSavedSettings, "FSAllowWaterDistortionOcclusion"); + LLPipeline::sUseOcclusion = fsAllowWaterDistortionOcclusion ? occlusion : 0; + // camera.setOrigin(camera_in.getOrigin()); //render distortion map diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index a9a80ad01c..9e4fb5e7c5 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -409,6 +409,7 @@ public: static bool getRenderHighlights(); static void setRenderHighlightTextureChannel(LLRender::eTexIndex channel); // sets which UV setup to display in highlight overlay + static void updateRenderTransparentWater(); static void updateRenderBump(); static void updateRenderDeferred(); static void refreshCachedSettings(); @@ -589,6 +590,7 @@ public: static bool sAutoMaskAlphaDeferred; static bool sAutoMaskAlphaNonDeferred; static bool sDisableShaders; // if true, rendering will be done without shaders + static bool sRenderTransparentWater; static bool sRenderBump; static bool sBakeSunlight; static bool sNoAlpha; diff --git a/indra/newview/quickprefs.cpp b/indra/newview/quickprefs.cpp index 75c9b7e893..afe9251a31 100644 --- a/indra/newview/quickprefs.cpp +++ b/indra/newview/quickprefs.cpp @@ -1033,9 +1033,11 @@ void FloaterQuickPrefs::refreshSettings() sky_default_button->setEnabled(TRUE); BOOL bumpshiny = gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps && LLFeatureManager::getInstance()->isFeatureAvailable("RenderObjectBump") && gSavedSettings.getBOOL("RenderObjectBump"); + BOOL transparent_water = LLFeatureManager::getInstance()->isFeatureAvailable("RenderTransparentWater") && gSavedSettings.getBOOL("RenderTransparentWater"); BOOL shaders = gSavedSettings.getBOOL("WindLightUseAtmosShaders"); BOOL enabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") && bumpshiny && + transparent_water && shaders && gGLManager.mHasFramebufferObject && gSavedSettings.getBOOL("RenderAvatarVP") && @@ -1351,7 +1353,7 @@ void FloaterQuickPrefs::updateControl(const std::string& controlName, ControlEnt remove_button->setCommitCallback(boost::bind(&FloaterQuickPrefs::onRemoveClicked, this, _1, entry.panel)); // and the commit signal for the alpha value in a color4 control - alpha_widget->setCommitCallback(boost::bind(&FloaterQuickPrefs::onAlphaChanged, this, _1, widget)); + alpha_widget->setCommitCallback(boost::bind(&FloaterQuickPrefs::onAlphaChanged, this, _1, entry.panel->getChild("option_color4_control"))); // save the text label pointer in the internal list entry.label_textbox = label_textbox; @@ -1573,20 +1575,19 @@ void FloaterQuickPrefs::selectControl(std::string controlName) mControlIncrementSpinner->setEnabled(enable_floating_point); } -void FloaterQuickPrefs::onClickLabel(LLUICtrl* ctrl, void* userdata) +void FloaterQuickPrefs::onClickLabel(LLUICtrl* ctrl, LLPanel* panel) { // don't do anything when we are not in edit mode if (!gSavedSettings.getBOOL("QuickPrefsEditMode")) { return; } - // get the associated panel from the submitted userdata - LLUICtrl* panel = (LLUICtrl*)userdata; + // select the clicked control, identified by its name selectControl(panel->getName()); } -void FloaterQuickPrefs::onDoubleClickLabel(LLUICtrl* ctrl, void* userdata) +void FloaterQuickPrefs::onDoubleClickLabel(LLUICtrl* ctrl, LLPanel* panel) { // toggle edit mode BOOL edit_mode = !gSavedSettings.getBOOL("QuickPrefsEditMode"); @@ -1595,8 +1596,6 @@ void FloaterQuickPrefs::onDoubleClickLabel(LLUICtrl* ctrl, void* userdata) // select the double clicked control if we toggled edit on if (edit_mode) { - // get the associated widget from the submitted userdata - LLUICtrl* panel = (LLUICtrl*)userdata; selectControl(panel->getName()); } } @@ -1838,10 +1837,8 @@ void FloaterQuickPrefs::onAddNewClicked() selectControl(new_control_name); } -void FloaterQuickPrefs::onRemoveClicked(LLUICtrl* ctrl, void* userdata) +void FloaterQuickPrefs::onRemoveClicked(LLUICtrl* ctrl, LLPanel* panel) { - // get the associated panel from the submitted userdata - LLUICtrl* panel = (LLUICtrl*)userdata; // deselect the current entry selectControl(""); // first remove the control from the ordering list @@ -1852,10 +1849,8 @@ void FloaterQuickPrefs::onRemoveClicked(LLUICtrl* ctrl, void* userdata) setFocus(TRUE); } -void FloaterQuickPrefs::onAlphaChanged(LLUICtrl* ctrl, void* userdata) +void FloaterQuickPrefs::onAlphaChanged(LLUICtrl* ctrl, LLColorSwatchCtrl* color_swatch) { - // get the associated color swatch from the submitted userdata - LLColorSwatchCtrl* color_swatch = (LLColorSwatchCtrl*)userdata; // get the current color LLColor4 color = color_swatch->get(); // replace the alpha value of the color with the value in the alpha spinner diff --git a/indra/newview/quickprefs.h b/indra/newview/quickprefs.h index ce8f286b9d..7ddf96a550 100644 --- a/indra/newview/quickprefs.h +++ b/indra/newview/quickprefs.h @@ -45,6 +45,7 @@ class LLSlider; class LLSliderCtrl; class LLSpinCtrl; class LLTextBox; +class LLColorSwatchCtrl; #define PRESET_NAME_REGION_DEFAULT "__Regiondefault__" #define PRESET_NAME_DAY_CYCLE "__Day_Cycle__" @@ -287,9 +288,9 @@ protected: void selectControl(std::string controlName); // toggles edit mode - void onDoubleClickLabel(LLUICtrl* ctrl, void* userdata); // userdata is the associated panel + void onDoubleClickLabel(LLUICtrl* ctrl, LLPanel* panel); // selects a control in edit mode - void onClickLabel(LLUICtrl* ctrl, void* userdata); // userdata is the associated panel + void onClickLabel(LLUICtrl* ctrl, LLPanel* panel); // will save settings when leaving edit mode void onEditModeChanged(); @@ -297,8 +298,8 @@ protected: void onValuesChanged(); void onAddNewClicked(); - void onRemoveClicked(LLUICtrl* ctrl, void* userdata); // userdata is the associated panel - void onAlphaChanged(LLUICtrl* ctrl, void* userdata); // userdata is the associated color swatch + void onRemoveClicked(LLUICtrl* ctrl, LLPanel* panel); + void onAlphaChanged(LLUICtrl* ctrl, LLColorSwatchCtrl* color_swatch); void onMoveUpClicked(); void onMoveDownClicked(); diff --git a/indra/newview/rlvactions.h b/indra/newview/rlvactions.h index fb2e14f7aa..060dc1a9c3 100644 --- a/indra/newview/rlvactions.h +++ b/indra/newview/rlvactions.h @@ -18,6 +18,7 @@ #define RLV_ACTIONS_H #include "llchat.h" +#include "llviewerobject.h" #include "rlvdefines.h" // ============================================================================ diff --git a/indra/newview/rlvhandler.cpp b/indra/newview/rlvhandler.cpp index 0cb1b49067..205f3a5e12 100644 --- a/indra/newview/rlvhandler.cpp +++ b/indra/newview/rlvhandler.cpp @@ -1565,10 +1565,6 @@ ERlvCmdRet RlvHandler::processAddRemCommand(const RlvCommand& rlvCmd) ERlvCmdRet eRet = rlvCmd.processCommand(); if (RLV_RET_NO_PROCESSOR != eRet) { - m_OnBehaviour(eBhvr, eType); - if ( ((RLV_TYPE_ADD == eType) && (1 == m_Behaviours[eBhvr])) || ((RLV_TYPE_REMOVE == eType) && (0 == m_Behaviours[eBhvr])) ) - m_OnBehaviourToggle(eBhvr, eType); - return eRet; } diff --git a/indra/newview/skins/ansastorm/colors.xml b/indra/newview/skins/ansastorm/colors.xml index 41e1dde826..95e6325dee 100644 --- a/indra/newview/skins/ansastorm/colors.xml +++ b/indra/newview/skins/ansastorm/colors.xml @@ -76,6 +76,9 @@ + diff --git a/indra/newview/skins/ansastorm/themes/classic_brown/colors.xml b/indra/newview/skins/ansastorm/themes/classic_brown/colors.xml index b172c04153..7b343fc296 100644 --- a/indra/newview/skins/ansastorm/themes/classic_brown/colors.xml +++ b/indra/newview/skins/ansastorm/themes/classic_brown/colors.xml @@ -76,6 +76,9 @@ + diff --git a/indra/newview/skins/ansastorm/xui/de/panel_group_notify.xml b/indra/newview/skins/ansastorm/xui/de/panel_group_notify.xml deleted file mode 100644 index c95d11eb3a..0000000000 --- a/indra/newview/skins/ansastorm/xui/de/panel_group_notify.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - -