diff --git a/.hgtags b/.hgtags index 5685192b0c..42ecb1b6d9 100755 --- a/.hgtags +++ b/.hgtags @@ -566,3 +566,4 @@ cea1632c002c065985ebea15eeeb4aac90f50545 5.0.2-release b4d76b5590fdf8bab72c64442353753a527cbc44 5.0.5-release 3e5035dfd8af49bd4c0009f0a76ef46a15991a45 5.0.6-release abcab37e1b29414ab8c03af9ca2ab489d809788a 5.0.7-release +505a492f30bd925bb48e2e093ae77c3c2b4c740f 5.0.8-release diff --git a/doc/contributions.txt b/doc/contributions.txt index 2541acea87..3f89b9906e 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -1046,9 +1046,9 @@ Nicholaz Beresford VWR-2682 VWR-2684 Nick Rhodes -NickyD - MAINT-873 Nicky Dasmijn + MAINT-873 + MAINT-7541 VWR-29228 MAINT-1392 MAINT-873 diff --git a/indra/llcharacter/llmotioncontroller.cpp b/indra/llcharacter/llmotioncontroller.cpp index 184fbab57f..a44f16cdd6 100644 --- a/indra/llcharacter/llmotioncontroller.cpp +++ b/indra/llcharacter/llmotioncontroller.cpp @@ -140,7 +140,8 @@ LLMotionController::LLMotionController() mTimeStep(0.f), mTimeStepCount(0), mLastInterp(0.f), - mIsSelf(FALSE) + mIsSelf(FALSE), + mLastCountAfterPurge(0) { } @@ -239,10 +240,12 @@ void LLMotionController::purgeExcessMotions() } } - if (mLoadedMotions.size() > 2*MAX_MOTION_INSTANCES) + U32 loaded_count = mLoadedMotions.size(); + if (loaded_count > (2 * MAX_MOTION_INSTANCES) && loaded_count > mLastCountAfterPurge) { - LL_WARNS_ONCE("Animation") << "> " << 2*MAX_MOTION_INSTANCES << " Loaded Motions" << LL_ENDL; + LL_WARNS_ONCE("Animation") << loaded_count << " Loaded Motions. Amount of motions is over limit." << LL_ENDL; } + mLastCountAfterPurge = loaded_count; } //----------------------------------------------------------------------------- diff --git a/indra/llcharacter/llmotioncontroller.h b/indra/llcharacter/llmotioncontroller.h index d449c3649c..6cd4406d51 100644 --- a/indra/llcharacter/llmotioncontroller.h +++ b/indra/llcharacter/llmotioncontroller.h @@ -228,6 +228,8 @@ protected: F32 mLastInterp; U8 mJointSignature[2][LL_CHARACTER_MAX_ANIMATED_JOINTS]; +private: + U32 mLastCountAfterPurge; //for logging and debugging purposes }; //----------------------------------------------------------------------------- diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp index a8bedffd5b..6f962fa8b4 100644 --- a/indra/llcommon/llapp.cpp +++ b/indra/llcommon/llapp.cpp @@ -260,6 +260,70 @@ bool LLApp::parseCommandOptions(int argc, char** argv) return true; } +bool LLApp::parseCommandOptions(int argc, wchar_t** wargv) +{ + LLSD commands; + std::string name; + std::string value; + for(int ii = 1; ii < argc; ++ii) + { + if(wargv[ii][0] != '-') + { + LL_INFOS() << "Did not find option identifier while parsing token: " + << wargv[ii] << LL_ENDL; + return false; + } + int offset = 1; + if(wargv[ii][1] == '-') ++offset; + +#if LL_WINDOWS + name.assign(utf16str_to_utf8str(&wargv[ii][offset])); +#else + name.assign(wstring_to_utf8str(&wargv[ii][offset])); +#endif + if(((ii+1) >= argc) || (wargv[ii+1][0] == '-')) + { + // we found another option after this one or we have + // reached the end. simply record that this option was + // found and continue. + int flag = name.compare("logfile"); + if (0 == flag) + { + commands[name] = "log"; + } + else + { + commands[name] = true; + } + + continue; + } + ++ii; + +#if LL_WINDOWS + value.assign(utf16str_to_utf8str((wargv[ii]))); +#else + value.assign(wstring_to_utf8str((wargv[ii]))); +#endif + +#if LL_WINDOWS + //Windows changed command line parsing. Deal with it. + S32 slen = value.length() - 1; + S32 start = 0; + S32 end = slen; + if (wargv[ii][start]=='"')start++; + if (wargv[ii][end]=='"')end--; + if (start!=0 || end!=slen) + { + value = value.substr (start,end); + } +#endif + + commands[name] = value; + } + setOptionData(PRIORITY_COMMAND_LINE, commands); + return true; +} void LLApp::manageLiveFile(LLLiveFile* livefile) { @@ -361,7 +425,7 @@ void LLApp::setupErrorHandling(bool second_instance, EMiniDumpType minidump_type std::wstring wpipe_name; wpipe_name = mCrashReportPipeStr + wstringize(getPid()); - const std::wstring wdump_path(wstringize(mDumpPath)); + const std::wstring wdump_path(utf8str_to_utf16str(mDumpPath)); int retries = 30; for (; retries > 0; --retries) @@ -539,12 +603,9 @@ void LLApp::setMiniDumpDir(const std::string &path) if(mExceptionHandler == 0) return; #ifdef LL_WINDOWS - // Make sure to pass a proper unicode string to breapad. path is UTF8, not MBCS - // wchar_t buffer[MAX_MINDUMP_PATH_LENGTH]; - // mbstowcs(buffer, mDumpPath.c_str(), MAX_MINDUMP_PATH_LENGTH); - // mExceptionHandler->set_dump_path(std::wstring(buffer)); - mExceptionHandler->set_dump_path( utf8str_to_utf16str(mDumpPath) ); - // + std::wstring buffer(utf8str_to_utf16str(mDumpPath)); + if (buffer.size() > MAX_MINDUMP_PATH_LENGTH) buffer.resize(MAX_MINDUMP_PATH_LENGTH); + mExceptionHandler->set_dump_path(buffer); #elif LL_LINUX //google_breakpad::MinidumpDescriptor desc("/tmp"); //path works in debug fails in production inside breakpad lib so linux gets a little less stack reporting until it is patched. google_breakpad::MinidumpDescriptor desc(mDumpPath); //path works in debug fails in production inside breakpad lib so linux gets a little less stack reporting until it is patched. diff --git a/indra/llcommon/llapp.h b/indra/llcommon/llapp.h index c2d69f41cc..68baafa5a6 100644 --- a/indra/llcommon/llapp.h +++ b/indra/llcommon/llapp.h @@ -106,7 +106,7 @@ public: LLSD getOption(const std::string& name) const; /** - * @brief Parse command line options and insert them into + * @brief Parse ASCII command line options and insert them into * application command line options. * * The name inserted into the option will have leading option @@ -119,6 +119,20 @@ public: */ bool parseCommandOptions(int argc, char** argv); + /** + * @brief Parse Unicode command line options and insert them into + * application command line options. + * + * The name inserted into the option will have leading option + * identifiers (a minus or double minus) stripped. All options + * with values will be stored as a string, while all options + * without values will be stored as true. + * @param argc The argc passed into main(). + * @param wargv The wargv passed into main(). + * @return Returns true if the parse succeeded. + */ + bool parseCommandOptions(int argc, wchar_t** wargv); + /** * @brief Keep track of live files automatically. * diff --git a/indra/llcommon/llevents.cpp b/indra/llcommon/llevents.cpp index 8ac304c678..67e65c6127 100644 --- a/indra/llcommon/llevents.cpp +++ b/indra/llcommon/llevents.cpp @@ -317,6 +317,13 @@ LLBoundListener LLEventPump::listen_impl(const std::string& name, const LLEventL const NameList& after, const NameList& before) { + if (!mSignal) + { + LL_WARNS() << "Can't connect listener" << LL_ENDL; + // connect will fail, return dummy + return LLBoundListener(); + } + float nodePosition = 1.0; // if the supplied name is empty we are not interested in the ordering mechanism diff --git a/indra/llcommon/llinitparam.cpp b/indra/llcommon/llinitparam.cpp index 1d104cf55d..aa2f4eb289 100644 --- a/indra/llcommon/llinitparam.cpp +++ b/indra/llcommon/llinitparam.cpp @@ -193,12 +193,7 @@ namespace LLInitParam { if (!silent) { - std::string file_name = p.getCurrentFileName(); - if(!file_name.empty()) - { - file_name = "in file: " + file_name; - } - p.parserWarning(llformat("Failed to parse parameter \"%s\" %s", p.getCurrentElementName().c_str(), file_name.c_str())); + p.parserWarning(llformat("Failed to parse parameter \"%s\"", p.getCurrentElementName().c_str())); } return false; } diff --git a/indra/llcommon/llmetricperformancetester.cpp b/indra/llcommon/llmetricperformancetester.cpp index 16fc365da1..f8a93baf45 100644 --- a/indra/llcommon/llmetricperformancetester.cpp +++ b/indra/llcommon/llmetricperformancetester.cpp @@ -132,8 +132,8 @@ void LLMetricPerformanceTesterBasic::doAnalysisMetrics(std::string baseline, std } // Open baseline and current target, exit if one is inexistent - std::ifstream base_is(baseline.c_str()); - std::ifstream target_is(target.c_str()); + llifstream base_is(baseline.c_str()); + llifstream target_is(target.c_str()); if (!base_is.is_open() || !target_is.is_open()) { LL_WARNS() << "'-analyzeperformance' error : baseline or current target file inexistent" << LL_ENDL; @@ -151,7 +151,7 @@ void LLMetricPerformanceTesterBasic::doAnalysisMetrics(std::string baseline, std target_is.close(); //output comparision - std::ofstream os(output.c_str()); + llofstream os(output.c_str()); os << "Label, Metric, Base(B), Target(T), Diff(T-B), Percentage(100*T/B)\n"; for(LLMetricPerformanceTesterBasic::name_tester_map_t::iterator iter = LLMetricPerformanceTesterBasic::sTesterMap.begin() ; @@ -212,7 +212,7 @@ void LLMetricPerformanceTesterBasic::addMetric(std::string str) } /*virtual*/ -void LLMetricPerformanceTesterBasic::analyzePerformance(std::ofstream* os, LLSD* base, LLSD* current) +void LLMetricPerformanceTesterBasic::analyzePerformance(llofstream* os, LLSD* base, LLSD* current) { resetCurrentCount() ; @@ -254,14 +254,14 @@ void LLMetricPerformanceTesterBasic::analyzePerformance(std::ofstream* os, LLSD* } /*virtual*/ -void LLMetricPerformanceTesterBasic::compareTestResults(std::ofstream* os, std::string metric_string, S32 v_base, S32 v_current) +void LLMetricPerformanceTesterBasic::compareTestResults(llofstream* os, std::string metric_string, S32 v_base, S32 v_current) { *os << llformat(" ,%s, %d, %d, %d, %.4f\n", metric_string.c_str(), v_base, v_current, v_current - v_base, (v_base != 0) ? 100.f * v_current / v_base : 0) ; } /*virtual*/ -void LLMetricPerformanceTesterBasic::compareTestResults(std::ofstream* os, std::string metric_string, F32 v_base, F32 v_current) +void LLMetricPerformanceTesterBasic::compareTestResults(llofstream* os, std::string metric_string, F32 v_base, F32 v_current) { *os << llformat(" ,%s, %.4f, %.4f, %.4f, %.4f\n", metric_string.c_str(), v_base, v_current, v_current - v_base, (fabs(v_base) > 0.0001f) ? 100.f * v_current / v_base : 0.f ) ; @@ -293,7 +293,7 @@ LLMetricPerformanceTesterWithSession::~LLMetricPerformanceTesterWithSession() } /*virtual*/ -void LLMetricPerformanceTesterWithSession::analyzePerformance(std::ofstream* os, LLSD* base, LLSD* current) +void LLMetricPerformanceTesterWithSession::analyzePerformance(llofstream* os, LLSD* base, LLSD* current) { // Load the base session resetCurrentCount() ; diff --git a/indra/llcommon/llmetricperformancetester.h b/indra/llcommon/llmetricperformancetester.h index e6b46be1cf..2e99ed979d 100644 --- a/indra/llcommon/llmetricperformancetester.h +++ b/indra/llcommon/llmetricperformancetester.h @@ -60,7 +60,7 @@ public: * By default, compares the test results against the baseline one by one, item by item, * in the increasing order of the LLSD record counter, starting from the first one. */ - virtual void analyzePerformance(std::ofstream* os, LLSD* base, LLSD* current) ; + virtual void analyzePerformance(llofstream* os, LLSD* base, LLSD* current) ; static void doAnalysisMetrics(std::string baseline, std::string target, std::string output) ; @@ -93,8 +93,8 @@ protected: * @param[in] v_base - Base value of the metric. * @param[in] v_current - Current value of the metric. */ - virtual void compareTestResults(std::ofstream* os, std::string metric_string, S32 v_base, S32 v_current) ; - virtual void compareTestResults(std::ofstream* os, std::string metric_string, F32 v_base, F32 v_current) ; + virtual void compareTestResults(llofstream* os, std::string metric_string, S32 v_base, S32 v_current) ; + virtual void compareTestResults(llofstream* os, std::string metric_string, F32 v_base, F32 v_current) ; /** * @brief Reset internal record count. Count starts with 1. @@ -181,7 +181,7 @@ public: * This will be loading the base and current sessions and compare them using the virtual * abstract methods loadTestSession() and compareTestSessions() */ - virtual void analyzePerformance(std::ofstream* os, LLSD* base, LLSD* current) ; + virtual void analyzePerformance(llofstream* os, LLSD* base, LLSD* current) ; protected: /** @@ -205,7 +205,7 @@ protected: * @brief Compare the base session and the target session. Assumes base and current sessions have been loaded. * @param[out] os - The comparison result as a standard stream */ - virtual void compareTestSessions(std::ofstream* os) = 0; + virtual void compareTestSessions(llofstream* os) = 0; LLTestSession* mBaseSessionp; LLTestSession* mCurrentSessionp; diff --git a/indra/llcommon/llsys.h b/indra/llcommon/llsys.h index 658489acc4..20e41a6ee9 100644 --- a/indra/llcommon/llsys.h +++ b/indra/llcommon/llsys.h @@ -37,13 +37,14 @@ // #include "llsd.h" +#include "llsingleton.h" #include #include -class LL_COMMON_API LLOSInfo +class LL_COMMON_API LLOSInfo : public LLSingleton { + LLSINGLETON(LLOSInfo); public: - LLOSInfo(); void stream(std::ostream& s) const; const std::string& getOSString() const; diff --git a/indra/llcrashlogger/llcrashlock.cpp b/indra/llcrashlogger/llcrashlock.cpp index 7dde1fcd69..77abfbcf0f 100644 --- a/indra/llcrashlogger/llcrashlock.cpp +++ b/indra/llcrashlogger/llcrashlock.cpp @@ -188,12 +188,22 @@ LLSD LLCrashLock::getProcessList() //static bool LLCrashLock::fileExists(std::string filename) { - return boost::filesystem::exists(filename.c_str()); +#ifdef LL_WINDOWS // or BOOST_WINDOWS_API + boost::filesystem::path file_path(utf8str_to_utf16str(filename)); +#else + boost::filesystem::path file_path(filename); +#endif + return boost::filesystem::exists(file_path); } void LLCrashLock::cleanupProcess(std::string proc_dir) { - boost::filesystem::remove_all(proc_dir); +#ifdef LL_WINDOWS // or BOOST_WINDOWS_API + boost::filesystem::path dir_path(utf8str_to_utf16str(proc_dir)); +#else + boost::filesystem::path dir_path(proc_dir); +#endif + boost::filesystem::remove_all(dir_path); } bool LLCrashLock::putProcessList(const LLSD& proc_sd) diff --git a/indra/llcrashlogger/llcrashlogger.cpp b/indra/llcrashlogger/llcrashlogger.cpp index afccb7bbb6..9a26afd031 100644 --- a/indra/llcrashlogger/llcrashlogger.cpp +++ b/indra/llcrashlogger/llcrashlogger.cpp @@ -172,17 +172,8 @@ std::string getStartupStateFromLog(std::string& sllog) bool LLCrashLogger::readFromXML(LLSD& dest, const std::string& filename ) { - std::string db_file_name = gDirUtilp->getExpandedFilename(LL_PATH_DUMP,filename); - // Properly handle unicode path on Windows. Maybe could use a llifstream instead of ifdef? - // std::ifstream log_file(db_file_name.c_str()); - -#ifdef LL_WINDOWS - std::ifstream log_file( utf8str_to_utf16str( db_file_name ).c_str()); -#else - std::ifstream log_file(db_file_name.c_str()); -#endif - - // + std::string db_file_name = gDirUtilp->getExpandedFilename(LL_PATH_DUMP,filename); + llifstream log_file(db_file_name.c_str()); // Look for it in the given file if (log_file.is_open()) @@ -212,7 +203,7 @@ bool LLCrashLogger::readMinidump(std::string minidump_path) { size_t length=0; - std::ifstream minidump_stream(minidump_path.c_str(), std::ios_base::in | std::ios_base::binary); + llifstream minidump_stream(minidump_path.c_str(), std::ios_base::in | std::ios_base::binary); if(minidump_stream.is_open()) { minidump_stream.seekg(0, std::ios::end); @@ -321,7 +312,7 @@ void LLCrashLogger::gatherFiles() //if (!file.empty()) //{ // LL_DEBUGS("CRASHREPORT") << "trying to read " << itr->first << ": " << file << LL_ENDL; - // std::ifstream f(file.c_str()); + // llifstream f(file.c_str()); // if(f.is_open()) // { // std::stringstream s; @@ -377,7 +368,7 @@ void LLCrashLogger::gatherFiles() if ( ( iter->length() > 30 ) && (iter->rfind(".dmp") == (iter->length()-4) ) ) { std::string fullname = pathname + *iter; - std::ifstream fdat( fullname.c_str(), std::ifstream::binary); + llifstream fdat(fullname.c_str(), std::ifstream::binary); if (fdat) { char buf[5]; @@ -581,12 +572,7 @@ bool LLCrashLogger::sendCrashLog(std::string dump_dir) updateApplication("Sending reports..."); -#ifdef LL_WINDOWS - std::ofstream out_file( utf8str_to_utf16str(report_file).c_str() ); -#else - std::ofstream out_file(report_file.c_str()); -#endif - + llofstream out_file(report_file.c_str()); LLSDSerialize::toPrettyXML(post_data, out_file); out_file.flush(); out_file.close(); diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index cc3e5312c4..f16dc8b164 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -1453,7 +1453,7 @@ void LLImageRaw::copyScaled( LLImageRaw* src ) bool LLImageRaw::scale( S32 new_width, S32 new_height, bool scale_image_data ) { S32 components = getComponents(); - if (! ((1 == components) || (3 == components) || (4 == components) )) + if (components != 1 && components != 3 && components != 4) { LL_WARNS() << "Invalid getComponents value (" << components << ")" << LL_ENDL; return false; @@ -1529,6 +1529,55 @@ bool LLImageRaw::scale( S32 new_width, S32 new_height, bool scale_image_data ) return true ; } +LLPointer LLImageRaw::scaled(S32 new_width, S32 new_height) +{ + LLPointer result; + + S32 components = getComponents(); + if (components != 1 && components != 3 && components != 4) + { + LL_WARNS() << "Invalid getComponents value (" << components << ")" << LL_ENDL; + return result; + } + + if (isBufferInvalid()) + { + LL_WARNS() << "Invalid image buffer" << LL_ENDL; + return result; + } + + S32 old_width = getWidth(); + S32 old_height = getHeight(); + + if ((old_width == new_width) && (old_height == new_height)) + { + result = new LLImageRaw(old_width, old_height, components); + if (!result) + { + LL_WARNS() << "Failed to allocate new image" << LL_ENDL; + return result; + } + memcpy(result->getData(), getData(), getDataSize()); + } + else + { + S32 new_data_size = new_width * new_height * components; + + if (new_data_size > 0) + { + result = new LLImageRaw(new_width, new_height, components); + if (!result) + { + LL_WARNS() << "Failed to allocate new image" << LL_ENDL; + return result; + } + bilinear_scale(getData(), old_width, old_height, components, old_width*components, result->getData(), new_width, new_height, components, new_width*components); + } + } + + return result; +} + void LLImageRaw::copyLineScaled( U8* in, U8* out, S32 in_pixel_len, S32 out_pixel_len, S32 in_pixel_step, S32 out_pixel_step ) { const S32 components = getComponents(); @@ -1802,10 +1851,13 @@ static std::string find_file(std::string &name, S8 *codec) #endif EImageCodec LLImageBase::getCodecFromExtension(const std::string& exten) { - for (int i=0; i<(int)(NUM_FILE_EXTENSIONS); i++) + if (!exten.empty()) { - if (exten == file_extensions[i].exten) - return file_extensions[i].codec; + for (int i = 0; i < (int)(NUM_FILE_EXTENSIONS); i++) + { + if (exten == file_extensions[i].exten) + return file_extensions[i].codec; + } } return IMG_CODEC_INVALID; } diff --git a/indra/llimage/llimage.h b/indra/llimage/llimage.h index e86dd8a6ea..43729d737d 100644 --- a/indra/llimage/llimage.h +++ b/indra/llimage/llimage.h @@ -222,7 +222,8 @@ public: void expandToPowerOfTwo(S32 max_dim = MAX_IMAGE_SIZE, bool scale_image = true); void contractToPowerOfTwo(S32 max_dim = MAX_IMAGE_SIZE, bool scale_image = true); void biasedScaleToPowerOfTwo(S32 max_dim = MAX_IMAGE_SIZE); - bool scale( S32 new_width, S32 new_height, bool scale_image = true ); + bool scale(S32 new_width, S32 new_height, bool scale_image = true); + LLPointer scaled(S32 new_width, S32 new_height); // Fill the buffer with a constant color void fill( const LLColor4U& color ); diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index b00b28cf51..72558696b8 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -5381,19 +5381,31 @@ void LLVolumeFace::cacheOptimize() S32 num_verts = mNumVertices; S32 size = ((num_verts*sizeof(LLVector2)) + 0xF) & ~0xF; LLVector4a* pos = (LLVector4a*) ll_aligned_malloc<64>(sizeof(LLVector4a)*2*num_verts+size); + if (pos == NULL) + { + LL_ERRS("LLVOLUME") << "Allocation of positions vector[" << sizeof(LLVector4a) * 2 * num_verts + size << "] failed. " << LL_ENDL; + } LLVector4a* norm = pos + num_verts; LLVector2* tc = (LLVector2*) (norm + num_verts); LLVector4a* wght = NULL; if (mWeights) { - wght = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*num_verts); + wght = (LLVector4a*)ll_aligned_malloc_16(sizeof(LLVector4a)*num_verts); + if (wght == NULL) + { + LL_ERRS("LLVOLUME") << "Allocation of weights[" << sizeof(LLVector4a) * num_verts << "] failed" << LL_ENDL; + } } LLVector4a* binorm = NULL; if (mTangents) { binorm = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*num_verts); + if (binorm == NULL) + { + LL_ERRS("LLVOLUME") << "Allocation of binormals[" << sizeof(LLVector4a)*num_verts << "] failed" << LL_ENDL; + } } //allocate mapping of old indices to new indices diff --git a/indra/llmath/nd/ndoctreelog.cpp b/indra/llmath/nd/ndoctreelog.cpp index e26d9977d9..f6cb512916 100644 --- a/indra/llmath/nd/ndoctreelog.cpp +++ b/indra/llmath/nd/ndoctreelog.cpp @@ -22,10 +22,9 @@ * $/LicenseInfo$ */ -#include #include "../llmath.h" #include "ndoctreelog.h" - +#include "llfile.h" namespace nd { @@ -34,7 +33,7 @@ namespace nd namespace debug { U32 gOctreeDebug; - std::ofstream *pLogStream; + llofstream *pLogStream; std::string mOctreeLogFilename; void setOctreeLogFilename( std::string const &aFilename ) @@ -55,7 +54,7 @@ namespace nd { if( !pLogStream && mOctreeLogFilename.size() ) { - pLogStream = new std::ofstream(); + pLogStream = new llofstream(); pLogStream->open( mOctreeLogFilename.c_str(), std::ios::out ); if( pLogStream->is_open() ) { diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 8132db0c36..6f3acf1332 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -65,7 +65,7 @@ static const std::string HEADLESS_VENDOR_STRING("Linden Lab"); static const std::string HEADLESS_RENDERER_STRING("Headless"); static const std::string HEADLESS_VERSION_STRING("1.0"); -std::ofstream gFailLog; +llofstream gFailLog; #if GL_ARB_debug_output diff --git a/indra/llrender/llgl.h b/indra/llrender/llgl.h index 75e5fe86ec..aa98b3f6bc 100644 --- a/indra/llrender/llgl.h +++ b/indra/llrender/llgl.h @@ -47,7 +47,7 @@ extern BOOL gDebugGL; extern BOOL gDebugSession; -extern std::ofstream gFailLog; +extern llofstream gFailLog; #define LL_GL_ERRS LL_ERRS("RenderState") diff --git a/indra/llui/llfolderviewmodel.h b/indra/llui/llfolderviewmodel.h index f838d2f736..4a41c3a53d 100644 --- a/indra/llui/llfolderviewmodel.h +++ b/indra/llui/llfolderviewmodel.h @@ -28,22 +28,6 @@ #include "llfontgl.h" // just for StyleFlags enum #include "llfolderview.h" -// Reintegrate search by uuid/creator/descripting from Zi Ree after CHUI Merge -// Interface to query extended object attributes, -class FSFolderViewModelItem -{ -public: - virtual std::string getSearchableCreator( void ) const - { return ""; } - virtual std::string getSearchableDescription( void ) const - { return ""; } - virtual std::string getSearchableUUID( void ) const - { return ""; } - virtual std::string getSearchableAll( void ) const - { return ""; } -}; -// - // These are grouping of inventory types. // Order matters when sorting system folders to the top. enum EInventorySortGroup @@ -149,7 +133,7 @@ public: // This is an abstract base class that users of the folderview classes // would use to bridge the folder view with the underlying data -class LLFolderViewModelItem : public LLRefCount, public LLTrace::MemTrackable, public FSFolderViewModelItem +class LLFolderViewModelItem : public LLRefCount, public LLTrace::MemTrackable { public: LLFolderViewModelItem() @@ -163,6 +147,11 @@ public: virtual const std::string& getDisplayName() const = 0; virtual const std::string& getSearchableName() const = 0; + virtual std::string getSearchableDescription() const = 0; + virtual std::string getSearchableCreatorName()const = 0; + virtual std::string getSearchableUUIDString() const = 0; + virtual std::string getSearchableAll() const = 0; // Zi's extended inventory search + virtual LLPointer getIcon() const = 0; virtual LLPointer getIconOpen() const { return getIcon(); } virtual LLPointer getIconOverlay() const { return NULL; } diff --git a/indra/llui/llscrollcontainer.cpp b/indra/llui/llscrollcontainer.cpp index f70eebc594..6135cc56ad 100644 --- a/indra/llui/llscrollcontainer.cpp +++ b/indra/llui/llscrollcontainer.cpp @@ -72,6 +72,7 @@ LLScrollContainer::Params::Params() hide_scrollbar("hide_scrollbar"), min_auto_scroll_rate("min_auto_scroll_rate", 100), max_auto_scroll_rate("max_auto_scroll_rate", 1000), + max_auto_scroll_zone("max_auto_scroll_zone", 16), reserve_scroll_corner("reserve_scroll_corner", false), size("size", -1) {} @@ -88,6 +89,7 @@ LLScrollContainer::LLScrollContainer(const LLScrollContainer::Params& p) mReserveScrollCorner(p.reserve_scroll_corner), mMinAutoScrollRate(p.min_auto_scroll_rate), mMaxAutoScrollRate(p.max_auto_scroll_rate), + mMaxAutoScrollZone(p.max_auto_scroll_zone), mScrolledView(NULL), mSize(p.size) { @@ -290,7 +292,21 @@ BOOL LLScrollContainer::handleDragAndDrop(S32 x, S32 y, MASK mask, return TRUE; } +bool LLScrollContainer::canAutoScroll(S32 x, S32 y) +{ + if (mAutoScrolling) + { + return true; // already scrolling + } + return autoScroll(x, y, false); +} + bool LLScrollContainer::autoScroll(S32 x, S32 y) +{ + return autoScroll(x, y, true); +} + +bool LLScrollContainer::autoScroll(S32 x, S32 y, bool do_scroll) { static LLUICachedControl scrollbar_size_control ("UIScrollbarSize", 0); S32 scrollbar_size = (mSize == -1 ? scrollbar_size_control : mSize); @@ -302,6 +318,8 @@ bool LLScrollContainer::autoScroll(S32 x, S32 y) screenRectToLocal(getRootView()->getLocalRect(), &screen_local_extents); LLRect inner_rect_local( 0, mInnerRect.getHeight(), mInnerRect.getWidth(), 0 ); + // Note: Will also include scrollers as scroll zones, so opposite + // scroll zones might have different size due to visible scrollers if( mScrollbar[HORIZONTAL]->getVisible() ) { inner_rect_local.mBottom += scrollbar_size; @@ -316,8 +334,8 @@ bool LLScrollContainer::autoScroll(S32 x, S32 y) S32 auto_scroll_speed = ll_round(mAutoScrollRate * LLFrameTimer::getFrameDeltaTimeF32()); // autoscroll region should take up no more than one third of visible scroller area - S32 auto_scroll_region_width = llmin(inner_rect_local.getWidth() / 3, 10); - S32 auto_scroll_region_height = llmin(inner_rect_local.getHeight() / 3, 10); + S32 auto_scroll_region_width = llmin(inner_rect_local.getWidth() / 3, (S32)mMaxAutoScrollZone); + S32 auto_scroll_region_height = llmin(inner_rect_local.getHeight() / 3, (S32)mMaxAutoScrollZone); if( mScrollbar[HORIZONTAL]->getVisible() ) { @@ -325,8 +343,11 @@ bool LLScrollContainer::autoScroll(S32 x, S32 y) left_scroll_rect.mRight = inner_rect_local.mLeft + auto_scroll_region_width; if( left_scroll_rect.pointInRect( x, y ) && (mScrollbar[HORIZONTAL]->getDocPos() > 0) ) { - mScrollbar[HORIZONTAL]->setDocPos( mScrollbar[HORIZONTAL]->getDocPos() - auto_scroll_speed ); - mAutoScrolling = TRUE; + if (do_scroll) + { + mScrollbar[HORIZONTAL]->setDocPos(mScrollbar[HORIZONTAL]->getDocPos() - auto_scroll_speed); + mAutoScrolling = TRUE; + } scrolling = true; } @@ -334,8 +355,11 @@ bool LLScrollContainer::autoScroll(S32 x, S32 y) right_scroll_rect.mLeft = inner_rect_local.mRight - auto_scroll_region_width; if( right_scroll_rect.pointInRect( x, y ) && (mScrollbar[HORIZONTAL]->getDocPos() < mScrollbar[HORIZONTAL]->getDocPosMax()) ) { - mScrollbar[HORIZONTAL]->setDocPos( mScrollbar[HORIZONTAL]->getDocPos() + auto_scroll_speed ); - mAutoScrolling = TRUE; + if (do_scroll) + { + mScrollbar[HORIZONTAL]->setDocPos(mScrollbar[HORIZONTAL]->getDocPos() + auto_scroll_speed); + mAutoScrolling = TRUE; + } scrolling = true; } } @@ -345,8 +369,11 @@ bool LLScrollContainer::autoScroll(S32 x, S32 y) bottom_scroll_rect.mTop = inner_rect_local.mBottom + auto_scroll_region_height; if( bottom_scroll_rect.pointInRect( x, y ) && (mScrollbar[VERTICAL]->getDocPos() < mScrollbar[VERTICAL]->getDocPosMax()) ) { - mScrollbar[VERTICAL]->setDocPos( mScrollbar[VERTICAL]->getDocPos() + auto_scroll_speed ); - mAutoScrolling = TRUE; + if (do_scroll) + { + mScrollbar[VERTICAL]->setDocPos(mScrollbar[VERTICAL]->getDocPos() + auto_scroll_speed); + mAutoScrolling = TRUE; + } scrolling = true; } @@ -354,8 +381,11 @@ bool LLScrollContainer::autoScroll(S32 x, S32 y) top_scroll_rect.mBottom = inner_rect_local.mTop - auto_scroll_region_height; if( top_scroll_rect.pointInRect( x, y ) && (mScrollbar[VERTICAL]->getDocPos() > 0) ) { - mScrollbar[VERTICAL]->setDocPos( mScrollbar[VERTICAL]->getDocPos() - auto_scroll_speed ); - mAutoScrolling = TRUE; + if (do_scroll) + { + mScrollbar[VERTICAL]->setDocPos(mScrollbar[VERTICAL]->getDocPos() - auto_scroll_speed); + mAutoScrolling = TRUE; + } scrolling = true; } } diff --git a/indra/llui/llscrollcontainer.h b/indra/llui/llscrollcontainer.h index 96224830f2..9c380b28ab 100644 --- a/indra/llui/llscrollcontainer.h +++ b/indra/llui/llscrollcontainer.h @@ -67,6 +67,7 @@ public: hide_scrollbar; Optional min_auto_scroll_rate, max_auto_scroll_rate; + Optional max_auto_scroll_zone; Optional bg_color; Optional scroll_callback; Optional size; @@ -117,7 +118,8 @@ public: virtual void draw(); virtual bool addChild(LLView* view, S32 tab_group = 0); - + + bool canAutoScroll(S32 x, S32 y); bool autoScroll(S32 x, S32 y); S32 getSize() const { return mSize; } @@ -131,6 +133,7 @@ private: virtual void scrollHorizontal( S32 new_pos ); virtual void scrollVertical( S32 new_pos ); void updateScroll(); + bool autoScroll(S32 x, S32 y, bool do_scroll); void calcVisibleSize( S32 *visible_width, S32 *visible_height, BOOL* show_h_scrollbar, BOOL* show_v_scrollbar ) const; LLScrollbar* mScrollbar[ORIENTATION_COUNT]; @@ -144,6 +147,7 @@ private: F32 mAutoScrollRate; F32 mMinAutoScrollRate; F32 mMaxAutoScrollRate; + U32 mMaxAutoScrollZone; bool mHideScrollbar; }; diff --git a/indra/llui/llxuiparser.cpp b/indra/llui/llxuiparser.cpp index 99a0869ce3..138ba8bf02 100644 --- a/indra/llui/llxuiparser.cpp +++ b/indra/llui/llxuiparser.cpp @@ -58,10 +58,6 @@ static LLInitParam::Parser::parser_inspect_func_map_t sSimpleXUIInspectFuncs; const char* NO_VALUE_MARKER = "no_value"; -#ifdef LL_WINDOWS -const S32 LINE_NUMBER_HERE = 0; -#endif - struct MaxOccursValues : public LLInitParam::TypeValuesHelper { static void declareValues() @@ -1313,22 +1309,14 @@ bool LLXUIParser::writeSDValue(Parser& parser, const void* val_ptr, name_stack_t void LLXUIParser::parserWarning(const std::string& message) { -#ifdef LL_WINDOWS - // use Visual Studio friendly formatting of output message for easy access to originating xml - LL_INFOS() << llformat("%s(%d):\t%s", mCurFileName.c_str(), mCurReadNode->getLineNumber(), message.c_str()) << LL_ENDL; -#else - Parser::parserWarning(message); -#endif + std::string warning_msg = llformat("%s:\t%s(%d)", message.c_str(), mCurFileName.c_str(), mCurReadNode->getLineNumber()); + Parser::parserWarning(warning_msg); } void LLXUIParser::parserError(const std::string& message) { -#ifdef LL_WINDOWS - // use Visual Studio friendly formatting of output message for easy access to originating xml - LL_INFOS() << llformat("%s(%d):\t%s", mCurFileName.c_str(), mCurReadNode->getLineNumber(), message.c_str()) << LL_ENDL; -#else - Parser::parserError(message); -#endif + std::string error_msg = llformat("%s:\t%s(%d)", message.c_str(), mCurFileName.c_str(), mCurReadNode->getLineNumber()); + Parser::parserError(error_msg); } @@ -1641,22 +1629,14 @@ bool LLSimpleXUIParser::processText() void LLSimpleXUIParser::parserWarning(const std::string& message) { -#ifdef LL_WINDOWS - // use Visual Studio friendly formatting of output message for easy access to originating xml - LL_INFOS() << llformat("%s(%d):\t%s", mCurFileName.c_str(), LINE_NUMBER_HERE, message.c_str()) << LL_ENDL; -#else - Parser::parserWarning(message); -#endif + std::string warning_msg = llformat("%s:\t%s", message.c_str(), mCurFileName.c_str()); + Parser::parserWarning(warning_msg); } void LLSimpleXUIParser::parserError(const std::string& message) { -#ifdef LL_WINDOWS - // use Visual Studio friendly formatting of output message for easy access to originating xml - LL_INFOS() << llformat("%s(%d):\t%s", mCurFileName.c_str(), LINE_NUMBER_HERE, message.c_str()) << LL_ENDL; -#else - Parser::parserError(message); -#endif + std::string error_msg = llformat("%s:\t%s", message.c_str(), mCurFileName.c_str()); + Parser::parserError(error_msg); } bool LLSimpleXUIParser::readFlag(Parser& parser, void* val_ptr) diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt index 51e67ba4d0..bb09d45b57 100644 --- a/indra/newview/VIEWER_VERSION.txt +++ b/indra/newview/VIEWER_VERSION.txt @@ -1 +1 @@ -5.0.8 +5.0.9 diff --git a/indra/newview/app_settings/graphic_preset_controls.xml b/indra/newview/app_settings/graphic_preset_controls.xml index 5583270fd2..706561c911 100644 --- a/indra/newview/app_settings/graphic_preset_controls.xml +++ b/indra/newview/app_settings/graphic_preset_controls.xml @@ -6,12 +6,12 @@ CameraFocalLength CameraFocusTransitionTime CameraFNumber + FramePerSecondLimit FSLimitFramerate FSRenderDoFUnderwater FSRenderVignette FSSimpleAvatarShadows FullScreen - MaxFPS RenderAnisotropic RenderAttachedLights RenderAttachedParticles diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 24844f180c..bb9daf727b 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -2305,6 +2305,17 @@ Value 0 + FramePerSecondLimit + + Comment + Controls upper limit of frames per second + Persist + 1 + Type + U32 + Value + 120 + BackgroundYieldTime Comment @@ -6585,11 +6596,11 @@ Type String Value - http://search.secondlife.com/viewer/[CATEGORY]/?q=[QUERY]&p=[AUTH_TOKEN]&r=[MATURITY]&lang=[LANGUAGE]&sid=[SESSION_ID] + https://search.[GRID]/viewer/[CATEGORY]/?q=[QUERY]&p=[AUTH_TOKEN]&r=[MATURITY]&lang=[LANGUAGE]&sid=[SESSION_ID] Backup 0 HighResSnapshot @@ -14514,7 +14525,7 @@ Change of this parameter will affect the layout of buttons in notification toast SyncMaterialSettings Comment - SyncMaterialSettings - DO NOT USE AND KEEP IT SET TO 0: Use FSSyncronizeTextureMaps instead! + SyncMaterialSettings Persist 1 Type @@ -17781,17 +17792,6 @@ Change of this parameter will affect the layout of buttons in notification toast Backup 0 - MaxFPS - - Comment - Yield some time to the local host if we reach a threshold framerate. - Persist - 1 - Type - F32 - Value - 60.0 - ForcePeriodicRenderingTime Comment @@ -22783,7 +22783,7 @@ Change of this parameter will affect the layout of buttons in notification toast FSSyncronizeTextureMaps Comment - Align texture maps (texture, bumpy, shiny) across the faces of a prim + Deprecated - Leave this at ZERO and use SyncMaterialSettings instead. Persist 1 Type @@ -23250,7 +23250,7 @@ Change of this parameter will affect the layout of buttons in notification toast FSLimitFramerate Comment - Enable framerate limitation defined by MaxFPS + Enable framerate limitation defined by FramePerSecondLimit Persist 1 Type diff --git a/indra/newview/app_settings/settings_text.xml b/indra/newview/app_settings/settings_text.xml index 6b50b6ee55..393ec2e00e 100644 --- a/indra/newview/app_settings/settings_text.xml +++ b/indra/newview/app_settings/settings_text.xml @@ -377,22 +377,22 @@ 0 - MaxFPS + FramePerSecondLimit Comment Yield some time to the local host if we reach a threshold framerate. Persist 1 Type - F32 + U32 Value - 45.0 + 45 FSLimitFramerate Comment - Enable framerate limitation defined by MaxFPS + Enable framerate limitation defined by FramePerSecondLimit Persist 1 Type diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl index c6475b10cb..d8e341fde2 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl @@ -199,8 +199,10 @@ void main() // Fix weird water glow on edge of land due to broken alpha value //frag_data[0] = vec4(color.rgb, color); // diffuse + //frag_data[1] = vec4(0); // speccolor, spec + //frag_data[2] = vec4(encode_normal(screenspacewavef.xyz*0.5+0.5), 0.05, 0);// normalxy, 0, 0 frag_data[0] = vec4(color.rgb, color.a); // diffuse + frag_data[1] = vec4(0.5, 0.5, 0.5, 0.75); // speccolor, spec + frag_data[2] = vec4(encode_normal(screenspacewavef.xyz), 0.05, 0);// normalxy, 0, 0 // - frag_data[1] = vec4(0); // speccolor, spec - frag_data[2] = vec4(encode_normal(screenspacewavef.xyz*0.5+0.5), 0.05, 0);// normalxy, 0, 0 } diff --git a/indra/newview/fspanellogin.cpp b/indra/newview/fspanellogin.cpp index b32b2025b5..fa128c7d4a 100644 --- a/indra/newview/fspanellogin.cpp +++ b/indra/newview/fspanellogin.cpp @@ -843,7 +843,7 @@ void FSPanelLogin::loadLoginPage() params["grid"] = LLGridManager::getInstance()->getGridId(); // add OS info - params["os"] = LLAppViewer::instance()->getOSInfo().getOSStringSimple(); + params["os"] = LLOSInfo::instance().getOSStringSimple(); // sourceid params["sourceid"] = gSavedSettings.getString("sourceid"); diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index 684129ec1c..8005ab3665 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -360,11 +360,6 @@ CreateShortCut "$INSTDIR\$INSTSHORTCUT.lnk" \ CreateShortCut "$INSTDIR\Uninstall $INSTSHORTCUT.lnk" \ '"$INSTDIR\uninst.exe"' '' -# Create *.bat file to specify lang params on first run from installer - see MAINT-5259 -FileOpen $9 "$INSTDIR\autorun.bat" w -FileWrite $9 'start "$INSTDIR\$INSTEXE" "$INSTDIR\$INSTEXE" $SHORTCUT_LANG_PARAM$\r$\n' -FileClose $9 - # Write registry WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\The Phoenix Firestorm Project\$INSTPROG" "" "$INSTDIR" WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\The Phoenix Firestorm Project\$INSTPROG" "Version" "${VERSION_LONG}" @@ -796,7 +791,7 @@ label_ask_launch: label_launch: # Assumes SetOutPath $INSTDIR - Exec '"$WINDIR\explorer.exe" "$INSTDIR\autorun.bat"' + Exec '"$WINDIR\explorer.exe" "$INSTDIR\$INSTSHORTCUT.lnk"' label_no_launch: Pop $R0 # diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 6351264390..e108d427f3 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1383,6 +1383,8 @@ static void removeDuplicateWearableItemsByAssetID(LLInventoryModel::item_array_t //========================================================================= +const std::string LLAppearanceMgr::sExpectedTextureName = "OutfitPreview"; + const LLUUID LLAppearanceMgr::getCOF() const { return gInventory.findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT); @@ -3648,9 +3650,26 @@ void update_base_outfit_after_ordering() BOOST_FOREACH(LLViewerInventoryItem* outfit_item, outfit_item_array) { LLViewerInventoryItem* linked_item = outfit_item->getLinkedItem(); - if (linked_item != NULL && linked_item->getActualType() == LLAssetType::AT_TEXTURE) + if (linked_item != NULL) { - app_mgr.setOutfitImage(linked_item->getLinkedUUID()); + if (linked_item->getActualType() == LLAssetType::AT_TEXTURE) + { + app_mgr.setOutfitImage(linked_item->getLinkedUUID()); + if (linked_item->getName() == LLAppearanceMgr::sExpectedTextureName) + { + // Images with "appropriate" name take priority + break; + } + } + } + else if (outfit_item->getActualType() == LLAssetType::AT_TEXTURE) + { + app_mgr.setOutfitImage(outfit_item->getUUID()); + if (outfit_item->getName() == LLAppearanceMgr::sExpectedTextureName) + { + // Images with "appropriate" name take priority + break; + } } } diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 6f34e5b5c8..95b323f8e2 100644 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -316,6 +316,9 @@ public: BOOL getIsInCOF(const LLUUID& obj_id) const; // Is this in the COF and can the user delete it from the COF? BOOL getIsProtectedCOFItem(const LLUUID& obj_id) const; + + // Outfits will prioritize textures with such name to use for preview in gallery + static const std::string sExpectedTextureName; }; class LLUpdateAppearanceOnDestroy: public LLInventoryCallback diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index e611ec7244..14b95f2866 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -353,8 +353,6 @@ F32SecondsImplicit gFrameIntervalSeconds = 0.f; F32 gFPSClamped = 10.f; // Pretend we start at target rate. F32 gFrameDTClamped = 0.f; // Time between adjacent checks to network for packets U64MicrosecondsImplicit gStartTime = 0; // gStartTime is "private", used only to calculate gFrameTimeSeconds -U32 gFrameStalls = 0; -const F64 FRAME_STALL_THRESHOLD = 1.0; LLTimer gRenderStartTime; LLFrameTimer gForegroundTime; @@ -717,7 +715,7 @@ public: void run() { - std::ofstream os(mFile.c_str()); + llofstream os(mFile.c_str()); while (!LLAppViewer::instance()->isQuitting()) { @@ -783,6 +781,7 @@ LLAppViewer::LLAppViewer() mUpdater(new LLUpdaterService()), mSettingsLocationList(NULL), mIsFirstRun(false), + mMinMicroSecPerFrame(0.f), mSaveSettingsOnExit(true), // Backup Settings mPurgeTextures(false) // FIRE-13066 { @@ -823,7 +822,7 @@ LLAppViewer::LLAppViewer() // LLLoginInstance::instance().setUpdaterService(mUpdater.get()); - LLLoginInstance::instance().setPlatformInfo(gPlatform, getOSInfo().getOSVersionString()); + LLLoginInstance::instance().setPlatformInfo(gPlatform, LLOSInfo::instance().getOSVersionString(), LLOSInfo::instance().getOSStringSimple()); } LLAppViewer::~LLAppViewer() @@ -1168,7 +1167,6 @@ bool LLAppViewer::init() // Early out from user choice. return false; } - LL_INFOS("InitInfo") << "Hardware test initialization done." << LL_ENDL ; // Prepare for out-of-memory situations, during which we will crash on @@ -1453,6 +1451,9 @@ bool LLAppViewer::init() joystick->setNeedsReset(true); /*----------------------------------------------------------------------*/ + gSavedSettings.getControl("FramePerSecondLimit")->getSignal()->connect(boost::bind(&LLAppViewer::onChangeFrameLimit, this, _2)); + onChangeFrameLimit(gSavedSettings.getLLSD("FramePerSecondLimit")); + return true; } @@ -1549,13 +1550,9 @@ bool LLAppViewer::frame() LLSD newFrame; // MaxFPS Viewer-Chui merge error - //LLTimer frameTimer,idleTimer; - LLTimer frameTimer,idleTimer,periodicRenderingTimer; - // MaxFPS Viewer-Chui merge error - LLTimer debugTime; - - // MaxFPS Viewer-Chui merge error + LLTimer periodicRenderingTimer; BOOL restore_rendering_masks = FALSE; + // MaxFPS Viewer-Chui merge error //LLPrivateMemoryPoolTester::getInstance()->run(false) ; //LLPrivateMemoryPoolTester::getInstance()->run(true) ; @@ -1624,14 +1621,6 @@ bool LLAppViewer::frame() gViewerWindow->getWindow()->gatherInput(); } -#if 1 && !LL_RELEASE_FOR_DOWNLOAD - // once per second debug info - if (debugTime.getElapsedTimeF32() > 1.f) - { - debugTime.reset(); - } - -#endif //memory leaking simulation LLFloaterMemLeak* mem_leak_instance = LLFloaterReg::findTypedInstance("mem_leaking"); @@ -1693,14 +1682,35 @@ bool LLAppViewer::frame() { pingMainloopTimeout("Main:Display"); gGLActive = TRUE; + + static U64 last_call = 0; + // MaxFPS improvement + //if (!gTeleportDisplay) + static LLCachedControl fsLimitFramerate(gSavedSettings, "FSLimitFramerate"); + if (fsLimitFramerate && !gTeleportDisplay) + // + { + // Frame/draw throttling + U64 elapsed_time = LLTimer::getTotalTime() - last_call; + if (elapsed_time < mMinMicroSecPerFrame) + { + LL_RECORD_BLOCK_TIME(FTM_SLEEP); + // llclamp for when time function gets funky + U64 sleep_time = llclamp(mMinMicroSecPerFrame - elapsed_time, (U64)1, (U64)1e6); + micro_sleep(sleep_time, 0); + } + } + last_call = LLTimer::getTotalTime(); + display(); + pingMainloopTimeout("Main:Snapshot"); LLFloaterSnapshot::update(); // take snapshots LLFloaterOutfitSnapshot::update(); gGLActive = FALSE; } } - + pingMainloopTimeout("Main:Sleep"); pauseMainloopTimeout(); @@ -1730,7 +1740,8 @@ bool LLAppViewer::frame() || !gFocusMgr.getAppHasFocus()) { // Sleep if we're not rendering, or the window is minimized. - S32 milliseconds_to_sleep = llclamp(gSavedSettings.getS32("BackgroundYieldTime"), 0, 1000); + static LLCachedControl s_bacground_yeild_time(gSavedSettings, "BackgroundYieldTime", 40); + S32 milliseconds_to_sleep = llclamp((S32)s_bacground_yeild_time, 0, 1000); // don't sleep when BackgroundYieldTime set to 0, since this will still yield to other threads // of equal priority on Windows if (milliseconds_to_sleep > 0) @@ -1754,7 +1765,6 @@ bool LLAppViewer::frame() ms_sleep(500); } - idleTimer.reset(); S32 total_work_pending = 0; S32 total_io_pending = 0; { @@ -1762,7 +1772,7 @@ bool LLAppViewer::frame() S32 io_pending = 0; F32 max_time = llmin(gFrameIntervalSeconds.value() *10.f, 1.f); - work_pending += updateTextureThreads(max_time / 3.f); // 3 Threads in there that should share this amount of time, right? + work_pending += updateTextureThreads(max_time); { LL_RECORD_BLOCK_TIME(FTM_VFS); @@ -1807,40 +1817,6 @@ bool LLAppViewer::frame() } } - if ((LLStartUp::getStartupState() >= STATE_CLEANUP) && - (frameTimer.getElapsedTimeF64() > FRAME_STALL_THRESHOLD)) - { - gFrameStalls++; - } - - // MaxFPS Viewer-Chui merge error - // Limit FPS - //F32 max_fps = gSavedSettings.getF32("MaxFPS"); - static LLCachedControl max_fps(gSavedSettings, "MaxFPS"); - // Only limit FPS when we are actually rendering something. Otherwise - // logins, logouts and teleports take much longer to complete. - // FIRE-11804: Expose MaxFPS - //if (max_fps > F_APPROXIMATELY_ZERO && - static LLCachedControl fsLimitFramerate(gSavedSettings, "FSLimitFramerate"); - if (fsLimitFramerate && max_fps > F_APPROXIMATELY_ZERO && - // - LLStartUp::getStartupState() == STATE_STARTED && - !gTeleportDisplay && - !logoutRequestSent()) - { - // Sleep a while to limit frame rate. - F32 min_frame_time = 1.f / max_fps; - S32 milliseconds_to_sleep = llclamp((S32)((min_frame_time - frameTimer.getElapsedTimeF64()) * 1000.f), 0, 1000); - if (milliseconds_to_sleep > 0) - { - LL_RECORD_BLOCK_TIME(FTM_YIELD); - ms_sleep(milliseconds_to_sleep); - } - } - // MaxFPS Viewer-Chui merge error - - frameTimer.reset(); - resumeMainloopTimeout(); pingMainloopTimeout("Main:End"); @@ -3694,7 +3670,7 @@ void LLAppViewer::initUpdater() mUpdater->initialize(channel, version, gPlatform, - getOSInfo().getOSVersionString(), + LLOSInfo::instance().getOSVersionString(), unique_id, willing_to_test ); @@ -3791,10 +3767,13 @@ bool LLAppViewer::initWindow() #ifdef LL_DARWIN - //Satisfy both MAINT-3135 (OSX 10.6 and earlier) MAINT-3288 (OSX 10.7 and later) - if (getOSInfo().mMajorVer == 10 && getOSInfo().mMinorVer < 7) - if ( getOSInfo().mMinorVer == 6 && getOSInfo().mBuild < 8 ) - gViewerWindow->getWindow()->setOldResize(true); + //Satisfy both MAINT-3135 (OSX 10.6 and earlier) MAINT-3288 (OSX 10.7 and later) + LLOSInfo& os_info = LLOSInfo::instance(); + if (os_info.mMajorVer == 10 && os_info.mMinorVer < 7) + { + if ( os_info.mMinorVer == 6 && os_info.mBuild < 8 ) + gViewerWindow->getWindow()->setOldResize(true); + } #endif if (gSavedSettings.getBOOL("WindowMaximized")) @@ -4008,7 +3987,7 @@ LLSD LLAppViewer::getViewerInfo() const info["CPU"] = gSysCPU.getCPUString(); info["MEMORY_MB"] = LLSD::Integer(gSysMemory.getPhysicalMemoryKB().valueInUnits()); // Moved hack adjustment to Windows memory size into llsys.cpp - info["OS_VERSION"] = LLAppViewer::instance()->getOSInfo().getOSString(); + info["OS_VERSION"] = LLOSInfo::instance().getOSString(); info["GRAPHICS_CARD_VENDOR"] = (const char*)(glGetString(GL_VENDOR)); info["GRAPHICS_CARD"] = (const char*)(glGetString(GL_RENDERER)); @@ -4058,7 +4037,7 @@ LLSD LLAppViewer::getViewerInfo() const info["J2C_VERSION"] = LLImageJ2C::getEngineInfo(); bool want_fullname = true; - info["AUDIO_DRIVER_VERSION"] = gAudiop ? LLSD(gAudiop->getDriverName(want_fullname)) : LLSD(); + info["AUDIO_DRIVER_VERSION"] = gAudiop ? LLSD(gAudiop->getDriverName(want_fullname)) : "Undefined"; if(LLVoiceClient::getInstance()->voiceEnabled()) { LLVoiceVersionInfo version = LLVoiceClient::getInstance()->getVersion(); @@ -4267,6 +4246,70 @@ std::string LLAppViewer::getViewerInfoString() const return support.str(); } +std::string LLAppViewer::getShortViewerInfoString() const +{ + std::ostringstream support; + LLSD info(getViewerInfo()); + + support << LLTrans::getString("APP_NAME") << " " << info["VIEWER_VERSION_STR"].asString(); + support << " (" << info["CHANNEL"].asString() << ")"; + if (info.has("BUILD_CONFIG")) + { + support << "\n" << "Build Configuration " << info["BUILD_CONFIG"].asString(); + } + if (info.has("REGION")) + { + support << "\n\n" << "You are at " << ll_vector3_from_sd(info["POSITION_LOCAL"]) << " in " << info["REGION"].asString(); + support << " located at " << info["HOSTNAME"].asString() << " (" << info["HOSTIP"].asString() << ")"; + support << "\n" << "SLURL: " << info["SLURL"].asString(); + support << "\n" << "(Global coordinates " << ll_vector3_from_sd(info["POSITION"]) << ")"; + support << "\n" << info["SERVER_VERSION"].asString(); + } + + support << "\n\n" << "CPU: " << info["CPU"].asString(); + support << "\n" << "Memory: " << info["MEMORY_MB"].asString() << " MB"; + support << "\n" << "OS: " << info["OS_VERSION"].asString(); + support << "\n" << "Graphics Card: " << info["GRAPHICS_CARD"].asString() << " (" << info["GRAPHICS_CARD_VENDOR"].asString() << ")"; + + if (info.has("GRAPHICS_DRIVER_VERSION")) + { + support << "\n" << "Windows Graphics Driver Version: " << info["GRAPHICS_DRIVER_VERSION"].asString(); + } + + support << "\n" << "OpenGL Version: " << info["OPENGL_VERSION"].asString(); + + support << "\n\n" << "Window size:" << info["WINDOW_WIDTH"].asString() << "x" << info["WINDOW_HEIGHT"].asString(); + support << "\n" << "Language: " << LLUI::getLanguage(); + support << "\n" << "Font Size Adjustment: " << info["FONT_SIZE_ADJUSTMENT"].asString() << "pt"; + support << "\n" << "UI Scaling: " << info["UI_SCALE"].asString(); + support << "\n" << "Draw distance: " << info["DRAW_DISTANCE"].asString(); + support << "\n" << "Bandwidth: " << info["NET_BANDWITH"].asString() << "kbit/s"; + support << "\n" << "LOD factor: " << info["LOD_FACTOR"].asString(); + support << "\n" << "Render quality: " << info["RENDER_QUALITY"].asString() << " / 7"; + support << "\n" << "ALM: " << info["GPU_SHADERS"].asString(); + support << "\n" << "Texture memory: " << info["TEXTURE_MEMORY"].asString() << "MB"; + support << "\n" << "VFS (cache) creation time: " << info["VFS_TIME"].asString(); + + support << "\n\n" << "J2C Decoder: " << info["J2C_VERSION"].asString(); + support << "\n" << "Audio Driver: " << info["AUDIO_DRIVER_VERSION"].asString(); + support << "\n" << "LLCEFLib/CEF: " << info["LLCEFLIB_VERSION"].asString(); + support << "\n" << "LibVLC: " << info["LIBVLC_VERSION"].asString(); + support << "\n" << "Voice Server: " << info["VOICE_VERSION"].asString(); + + if (info.has("PACKETS_IN")) + { + support << "\n" << "Packets Lost: " << info["PACKETS_LOST"].asInteger() << "/" << info["PACKETS_IN"].asInteger(); + F32 packets_pct = info["PACKETS_PCT"].asReal(); + support << " (" << ll_round(packets_pct, 0.001f) << "%)"; + } + + LLSD substitution; + substitution["datetime"] = (S32)time(NULL); + support << "\n" << LLTrans::getString("AboutTime", substitution); + + return support.str(); +} + void LLAppViewer::cleanupSavedSettings() { gSavedSettings.setBOOL("MouseSun", FALSE); @@ -4364,7 +4407,7 @@ void LLAppViewer::writeSystemInfo() gDebugInfo["RAMInfo"]["Physical"] = (LLSD::Integer)(gSysMemory.getPhysicalMemoryKB().value()); gDebugInfo["RAMInfo"]["Allocated"] = (LLSD::Integer)(gMemoryAllocated.valueInUnits()); - gDebugInfo["OSInfo"] = getOSInfo().getOSStringSimple(); + gDebugInfo["OSInfo"] = LLOSInfo::instance().getOSStringSimple(); // The user is not logged on yet, but record the current grid choice login url // which may have been the intended grid. @@ -4406,8 +4449,8 @@ void LLAppViewer::writeSystemInfo() // query some system information LL_INFOS("SystemInfo") << "CPU info:\n" << gSysCPU << LL_ENDL; LL_INFOS("SystemInfo") << "Memory info:\n" << gSysMemory << LL_ENDL; - LL_INFOS("SystemInfo") << "OS: " << getOSInfo().getOSStringSimple() << LL_ENDL; - LL_INFOS("SystemInfo") << "OS info: " << getOSInfo() << LL_ENDL; + LL_INFOS("SystemInfo") << "OS: " << LLOSInfo::instance().getOSStringSimple() << LL_ENDL; + LL_INFOS("SystemInfo") << "OS info: " << LLOSInfo::instance() << LL_ENDL; // Breakpad merge. Only include SettingsFile if the user selected this in prefs. Path from Catznip // gDebugInfo["SettingsFilename"] = gSavedSettings.getString("ClientSettingsFile"); @@ -4444,7 +4487,7 @@ void getFileList() if ( ( iter->length() > 30 ) && (iter->rfind(".dmp") == (iter->length()-4) ) ) { std::string fullname = pathname + *iter; - std::ifstream fdat( fullname.c_str(), std::ifstream::binary); + llifstream fdat( fullname.c_str(), std::ifstream::binary); if (fdat) { char buf[5]; @@ -5161,6 +5204,7 @@ bool LLAppViewer::initCache() if (gSavedSettings.getBOOL("PurgeCacheOnStartup") || gSavedSettings.getBOOL("PurgeCacheOnNextStartup")) { + LL_INFOS("AppCache") << "Startup cache purge requested: " << (gSavedSettings.getBOOL("PurgeCacheOnStartup") ? "ALWAYS" : "ONCE") << LL_ENDL; gSavedSettings.setBOOL("PurgeCacheOnNextStartup", false); LL_INFOS("AppCache") << "Scheduling texture purge, based on PurgeCache* settings." << LL_ENDL; mPurgeCache = true; @@ -5188,7 +5232,7 @@ bool LLAppViewer::initCache() if (new_cache_location != cache_location) { // AO: Don't automatically purge old cache location, has unwanted side effects with shared caches, upgrades - //LL_WARNS() << new_cache_location << " is not the same as " << cache_location << ". PURGING." << LL_ENDL; + //LL_INFOS("AppCache") << "Cache location changed, cache needs purging" << LL_ENDL; //gDirUtilp->setCacheDir(gSavedSettings.getString("CacheLocation")); //purgeCache(); // purge old cache gSavedSettings.setString("CacheLocation", new_cache_location); @@ -5247,23 +5291,15 @@ bool LLAppViewer::initCache() // Init the texture cache // Allocate 80% of the cache size for textures const S32 MB = 1024 * 1024; - const S64 MIN_CACHE_SIZE = 64 * MB; + const S64 MIN_CACHE_SIZE = 256 * MB; const S64 MAX_CACHE_SIZE = 9984ll * MB; const S64 MAX_VFS_SIZE = 1024 * MB; // 1 GB S64 cache_size = (S64)(gSavedSettings.getU32("CacheSize")) * MB; cache_size = llclamp(cache_size, MIN_CACHE_SIZE, MAX_CACHE_SIZE); - S64 texture_cache_size = ((cache_size * 8) / 10); - S64 vfs_size = cache_size - texture_cache_size; - - if (vfs_size > MAX_VFS_SIZE) - { - // Give the texture cache more space, since the VFS can't be bigger than 1GB. - // This happens when the user's CacheSize setting is greater than 5GB. - vfs_size = MAX_VFS_SIZE; - texture_cache_size = cache_size - MAX_VFS_SIZE; - } + S64 vfs_size = llmin((S64)((cache_size * 2) / 10), MAX_VFS_SIZE); + S64 texture_cache_size = cache_size - vfs_size; S64 extra = LLAppViewer::getTextureCache()->initCache(LL_PATH_CACHE, texture_cache_size, texture_cache_mismatch); texture_cache_size -= extra; @@ -6489,6 +6525,19 @@ void LLAppViewer::disconnectViewer() LLUrlEntryParcel::setDisconnected(gDisconnected); } +bool LLAppViewer::onChangeFrameLimit(LLSD const & evt) +{ + if (evt.asInteger() > 0) + { + mMinMicroSecPerFrame = 1000000 / evt.asInteger(); + } + else + { + mMinMicroSecPerFrame = 0; + } + return false; +} + void LLAppViewer::forceErrorLLError() { LL_ERRS() << "This is a deliberate llerror" << LL_ENDL; diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index 5b6ce2c14e..9e64e3803d 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -98,11 +98,10 @@ public: void writeDebugInfo(bool isStatic=true); - const LLOSInfo& getOSInfo() const { return mSysOSInfo; } - void setServerReleaseNotesURL(const std::string& url) { mServerReleaseNotesURL = url; } LLSD getViewerInfo() const; std::string getViewerInfoString() const; + std::string getShortViewerInfoString() const; // Report true if under the control of a debugger. A null-op default. virtual bool beingDebugged() { return false; } @@ -265,6 +264,8 @@ private: void sendLogoutRequest(); void disconnectViewer(); + bool onChangeFrameLimit(LLSD const & evt); + // *FIX: the app viewer class should be some sort of singleton, no? // Perhaps its child class is the singleton and this should be an abstract base. static LLAppViewer* sInstance; @@ -284,8 +285,6 @@ private: //-TT The skin and theme we are using at startup. might want to make them static. std::string mCurrentSkin; std::string mCurrentSkinTheme; - - LLOSInfo mSysOSInfo; bool mReportedCrash; std::string mServerReleaseNotesURL; @@ -336,6 +335,8 @@ private: LLAppCoreHttp mAppCoreHttp; bool mIsFirstRun; + U64 mMinMicroSecPerFrame; // frame throttling + //--------------------------------------------- //*NOTE: Mani - legacy updater stuff // Still useable? @@ -401,7 +402,6 @@ extern F32SecondsImplicit gFrameTimeSeconds; // Loses msec precision after ~4 extern F32SecondsImplicit gFrameIntervalSeconds; // Elapsed time between current and previous gFrameTimeSeconds extern F32 gFPSClamped; // Frames per second, smoothed, weighted toward last frame extern F32 gFrameDTClamped; -extern U32 gFrameStalls; extern LLTimer gRenderStartTime; extern LLFrameTimer gForegroundTime; diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index f17628980b..b38e5243f6 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -781,10 +781,10 @@ void LLAppViewerWin32::initCrashReporting(bool reportFreeze) PROCESS_INFORMATION processInfo; std::wstring exe_wstr; - exe_wstr=wstringize(exe_path); + exe_wstr = utf8str_to_utf16str(exe_path); std::wstring arg_wstr; - arg_wstr=wstringize(arg_str); + arg_wstr = utf8str_to_utf16str(arg_str); LL_INFOS("CrashReport") << "Creating crash reporter process " << exe_path << " with params: " << arg_str << LL_ENDL; if(CreateProcess(exe_wstr.c_str(), diff --git a/indra/newview/llconversationmodel.h b/indra/newview/llconversationmodel.h index 640f1a4144..0cd9e624b2 100644 --- a/indra/newview/llconversationmodel.h +++ b/indra/newview/llconversationmodel.h @@ -72,6 +72,10 @@ public: virtual const std::string& getName() const { return mName; } virtual const std::string& getDisplayName() const { return mName; } virtual const std::string& getSearchableName() const { return mName; } + virtual std::string getSearchableDescription() const { return LLStringUtil::null; } + virtual std::string getSearchableCreatorName() const { return LLStringUtil::null; } + virtual std::string getSearchableUUIDString() const {return LLStringUtil::null;} + virtual std::string getSearchableAll() const { return LLStringUtil::null; } // Zi's extended inventory search virtual const LLUUID& getUUID() const { return mUUID; } virtual time_t getCreationDate() const { return 0; } virtual LLPointer getIcon() const { return NULL; } diff --git a/indra/newview/llestateinfomodel.cpp b/indra/newview/llestateinfomodel.cpp index e422581129..e56a67f8d1 100644 --- a/indra/newview/llestateinfomodel.cpp +++ b/indra/newview/llestateinfomodel.cpp @@ -116,7 +116,7 @@ void LLEstateInfoModel::notifyCommit() // tries to send estate info using a cap; returns true if it succeeded bool LLEstateInfoModel::commitEstateInfoCaps() { - std::string url = gAgent.getRegion()->getCapability("EstateChangeInfo"); + std::string url = gAgent.getRegionCapability("EstateChangeInfo"); if (url.empty()) { diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index e27335ddeb..6c69a0a8b6 100644 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -519,7 +519,7 @@ void LLFastTimerView::exportCharts(const std::string& base, const std::string& t { //read base log into memory S32 i = 0; - std::ifstream is(base.c_str()); + llifstream is(base.c_str()); while (!is.eof() && LLSDParser::PARSE_FAILURE != LLSDSerialize::fromXML(cur, is)) { base_data[i++] = cur; @@ -532,7 +532,7 @@ void LLFastTimerView::exportCharts(const std::string& base, const std::string& t { //read current log into memory S32 i = 0; - std::ifstream is(target.c_str()); + llifstream is(target.c_str()); while (!is.eof() && LLSDParser::PARSE_FAILURE != LLSDSerialize::fromXML(cur, is)) { cur_data[i++] = cur; @@ -877,8 +877,8 @@ LLSD LLFastTimerView::analyzePerformanceLogDefault(std::istream& is) void LLFastTimerView::doAnalysisDefault(std::string baseline, std::string target, std::string output) { // Open baseline and current target, exit if one is inexistent - std::ifstream base_is(baseline.c_str()); - std::ifstream target_is(target.c_str()); + llifstream base_is(baseline.c_str()); + llifstream target_is(target.c_str()); if (!base_is.is_open() || !target_is.is_open()) { LL_WARNS() << "'-analyzeperformance' error : baseline or current target file inexistent" << LL_ENDL; @@ -896,7 +896,7 @@ void LLFastTimerView::doAnalysisDefault(std::string baseline, std::string target target_is.close(); //output comparison - std::ofstream os(output.c_str()); + llofstream os(output.c_str()); LLSD::Real session_time = current["SessionTime"].asReal(); os << diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index 2f062d4b6d..b975af2112 100644 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -501,7 +501,7 @@ void LLFeatureManager::fetchFeatureTableCoro(std::string tableName) #if LL_WINDOWS - std::string os_string = LLAppViewer::instance()->getOSInfo().getOSStringSimple(); + std::string os_string = LLOSInfo::instance().getOSStringSimple(); std::string filename; if (os_string.find("Microsoft Windows XP") == 0) @@ -782,7 +782,7 @@ void LLFeatureManager::applyBaseMasks() } #if LL_DARWIN - const LLOSInfo& osInfo = LLAppViewer::instance()->getOSInfo(); + const LLOSInfo& osInfo = LLOSInfo::instance(); if (osInfo.mMajorVer == 10 && osInfo.mMinorVer < 7) { maskFeatures("OSX_10_6_8"); diff --git a/indra/newview/llflexibleobject.cpp b/indra/newview/llflexibleobject.cpp index b6e61f83b1..e075a311c2 100644 --- a/indra/newview/llflexibleobject.cpp +++ b/indra/newview/llflexibleobject.cpp @@ -43,9 +43,9 @@ #include "llworld.h" #include "llvoavatar.h" +static const F32 SEC_PER_FLEXI_FRAME = 1.f / 60.f; // 60 flexi updates per second /*static*/ F32 LLVolumeImplFlexible::sUpdateFactor = 1.0f; std::vector LLVolumeImplFlexible::sInstanceList; -std::vector LLVolumeImplFlexible::sUpdateDelay; static LLTrace::BlockTimerStatHandle FTM_FLEXIBLE_REBUILD("Rebuild"); static LLTrace::BlockTimerStatHandle FTM_DO_FLEXIBLE_UPDATE("Flexible Update"); @@ -56,7 +56,10 @@ static LLTrace::BlockTimerStatHandle FTM_DO_FLEXIBLE_UPDATE("Flexible Update"); // constructor //----------------------------------------------- LLVolumeImplFlexible::LLVolumeImplFlexible(LLViewerObject* vo, LLFlexibleObjectData* attributes) : - mVO(vo), mAttributes(attributes) + mVO(vo), + mAttributes(attributes), + mLastFrameNum(0), + mLastUpdatePeriod(0) { static U32 seed = 0; mID = seed++; @@ -64,7 +67,6 @@ LLVolumeImplFlexible::LLVolumeImplFlexible(LLViewerObject* vo, LLFlexibleObjectD mUpdated = FALSE; mInitializedRes = -1; mSimulateRes = 0; - mFrameNum = 0; mCollisionSphereRadius = 0.f; mRenderRes = -1; @@ -75,7 +77,6 @@ LLVolumeImplFlexible::LLVolumeImplFlexible(LLViewerObject* vo, LLFlexibleObjectD mInstanceIndex = sInstanceList.size(); sInstanceList.push_back(this); - sUpdateDelay.push_back(0); }//----------------------------------------------- LLVolumeImplFlexible::~LLVolumeImplFlexible() @@ -86,28 +87,28 @@ LLVolumeImplFlexible::~LLVolumeImplFlexible() { sInstanceList[mInstanceIndex] = sInstanceList[end_idx]; sInstanceList[mInstanceIndex]->mInstanceIndex = mInstanceIndex; - sUpdateDelay[mInstanceIndex] = sUpdateDelay[end_idx]; } sInstanceList.pop_back(); - sUpdateDelay.pop_back(); } //static void LLVolumeImplFlexible::updateClass() { - std::vector::iterator delay_iter = sUpdateDelay.begin(); + LL_RECORD_BLOCK_TIME(FTM_DO_FLEXIBLE_UPDATE); + U64 virtual_frame_num = LLTimer::getElapsedSeconds() / SEC_PER_FLEXI_FRAME; for (std::vector::iterator iter = sInstanceList.begin(); iter != sInstanceList.end(); ++iter) { - --(*delay_iter); - if (*delay_iter <= 0) + // Note: by now update period might have changed + if ((*iter)->mRenderRes == -1 + || (*iter)->mLastFrameNum + (*iter)->mLastUpdatePeriod <= virtual_frame_num + || (*iter)->mLastFrameNum > virtual_frame_num) //time issues, overflow { (*iter)->doIdleUpdate(); } - ++delay_iter; } } @@ -334,15 +335,12 @@ void LLVolumeImplFlexible::updateRenderRes() // updated every time step. In the future, perhaps there could be an // optimization similar to what Havok does for objects that are stationary. //--------------------------------------------------------------------------------- -static LLTrace::BlockTimerStatHandle FTM_FLEXIBLE_UPDATE("Update Flexies"); void LLVolumeImplFlexible::doIdleUpdate() { LLDrawable* drawablep = mVO->mDrawable; if (drawablep) { - //LL_RECORD_BLOCK_TIME(FTM_FLEXIBLE_UPDATE); - //ensure drawable is active drawablep->makeActive(); @@ -354,15 +352,20 @@ void LLVolumeImplFlexible::doIdleUpdate() { updateRenderRes(); gPipeline.markRebuild(drawablep, LLDrawable::REBUILD_POSITION, FALSE); - sUpdateDelay[mInstanceIndex] = 0; } else { F32 pixel_area = mVO->getPixelArea(); + // Note: Flexies afar will be rarely updated, closer ones will be updated more frequently. + // But frequency differences are extremely noticeable, so consider modifying update factor, + // or at least clamping value a bit more from both sides. U32 update_period = (U32) (llmax((S32) (LLViewerCamera::getInstance()->getScreenPixelArea()*0.01f/(pixel_area*(sUpdateFactor+1.f))),0)+1); // MAINT-1890 Clamp the update period to ensure that the update_period is no greater than 32 frames - update_period = llclamp(update_period, 0U, 32U); + update_period = llclamp(update_period, 1U, 32U); + + // We control how fast flexies update, buy splitting updates among frames + U64 virtual_frame_num = LLTimer::getElapsedSeconds() / SEC_PER_FLEXI_FRAME; if (visible) { @@ -370,42 +373,44 @@ void LLVolumeImplFlexible::doIdleUpdate() pixel_area > 256.f) { U32 id; - if (mVO->isRootEdit()) { id = mID; } else { - LLVOVolume* parent = (LLVOVolume*) mVO->getParent(); + LLVOVolume* parent = (LLVOVolume*)mVO->getParent(); id = parent->getVolumeInterfaceID(); } - if (mVO->isRootEdit()) - { - id = mID; + + // Throttle flexies and spread load by preventing flexies from updating in same frame + // Shows how many frames we need to wait before next update + U64 throttling_delay = (virtual_frame_num + id) % update_period; + + if ((throttling_delay == 0 && mLastFrameNum < virtual_frame_num) //one or more virtual frames per frame + || (mLastFrameNum + update_period < virtual_frame_num)) // missed virtual frame + { + // We need mLastFrameNum to compensate for 'unreliable time' and to filter 'duplicate' frames + // If happened too late, subtract throttling_delay (it is zero otherwise) + mLastFrameNum = virtual_frame_num - throttling_delay; + + // Store update period for updateClass() + // Note: Consider substituting update_period with mLastUpdatePeriod everywhere. + mLastUpdatePeriod = update_period; + + updateRenderRes(); + + gPipeline.markRebuild(drawablep, LLDrawable::REBUILD_POSITION, FALSE); + } + } } else { - LLVOVolume* parent = (LLVOVolume*) mVO->getParent(); - id = parent->getVolumeInterfaceID(); - } - - if ((LLDrawable::getCurrentFrame()+id)%update_period == 0) - { - sUpdateDelay[mInstanceIndex] = (S32) update_period-1; - - updateRenderRes(); - - gPipeline.markRebuild(drawablep, LLDrawable::REBUILD_POSITION, FALSE); + mLastFrameNum = virtual_frame_num; + mLastUpdatePeriod = update_period; } } - } - else - { - sUpdateDelay[mInstanceIndex] = (S32) update_period; - } -} } } diff --git a/indra/newview/llflexibleobject.h b/indra/newview/llflexibleobject.h index a00551df8e..9383ab03ae 100644 --- a/indra/newview/llflexibleobject.h +++ b/indra/newview/llflexibleobject.h @@ -72,7 +72,6 @@ class LLVolumeImplFlexible : public LLVolumeInterface { private: static std::vector sInstanceList; - static std::vector sUpdateDelay; S32 mInstanceIndex; public: @@ -133,7 +132,8 @@ private: S32 mInitializedRes; S32 mSimulateRes; S32 mRenderRes; - U32 mFrameNum; + U64 mLastFrameNum; + U32 mLastUpdatePeriod; LLVector3 mCollisionSpherePosition; F32 mCollisionSphereRadius; U32 mID; diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index 4624274559..fb674a8ecb 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -687,6 +687,18 @@ void LLFloaterAvatarPicker::find() std::string text = getChild("Edit")->getValue().asString(); + size_t separator_index = text.find_first_of(" ._"); + if (separator_index != text.npos) + { + std::string first = text.substr(0, separator_index); + std::string last = text.substr(separator_index+1, text.npos); + LLStringUtil::trim(last); + if("Resident" == last) + { + text = first; + } + } + mQueryID.generate(); std::string url; @@ -954,12 +966,13 @@ void LLFloaterAvatarPicker::processResponse(const LLUUID& query_id, const LLSD& if (search_results->isEmpty()) { - LLStringUtil::format_map_t map; - map["[TEXT]"] = getChild("Edit")->getValue().asString(); + std::string name = "'" + getChild("Edit")->getValue().asString() + "'"; LLSD item; item["id"] = LLUUID::null; item["columns"][0]["column"] = "name"; - item["columns"][0]["value"] = getString("not_found", map); + item["columns"][0]["value"] = name; + item["columns"][1]["column"] = "username"; + item["columns"][1]["value"] = getString("not_found_text"); search_results->addElement(item); search_results->setEnabled(false); getChildView("ok_btn")->setEnabled(false); diff --git a/indra/newview/llfloateravatarrendersettings.cpp b/indra/newview/llfloateravatarrendersettings.cpp index f5fd3595b1..c0e42e4efe 100644 --- a/indra/newview/llfloateravatarrendersettings.cpp +++ b/indra/newview/llfloateravatarrendersettings.cpp @@ -29,11 +29,13 @@ #include "llfloateravatarrendersettings.h" +#include "llagent.h" #include "llavatarnamecache.h" #include "llfloateravatarpicker.h" #include "llfiltereditor.h" #include "llfloaterreg.h" #include "llnamelistctrl.h" +#include "llnotificationsutil.h" #include "llmenugl.h" #include "lltrans.h" #include "llviewerobjectlist.h" @@ -270,6 +272,11 @@ void LLFloaterAvatarRenderSettings::onClickAdd(const LLSD& userdata) void LLFloaterAvatarRenderSettings::callbackAvatarPicked(const uuid_vec_t& ids, S32 visual_setting) { if (ids.empty()) return; + if(ids[0] == gAgentID) + { + LLNotificationsUtil::add("AddSelfRenderExceptions"); + return; + } setAvatarRenderSetting(ids[0], visual_setting); } diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 962e0df453..67efa61ee4 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -525,10 +525,7 @@ BOOL LLPanelLandGeneral::postBuild() // note: on region change this will not be re checked, should not matter on Agni as // 99% of the time all regions will return the same caps. In case of an erroneous setting // to enabled the floater will just throw an error when trying to get it's cap - // Crash fix - //std::string url = gAgent.getRegion()->getCapability("LandResources"); - std::string url = gAgent.getRegion() ? gAgent.getRegion()->getCapability("LandResources") : LLStringUtil::null; - // + std::string url = gAgent.getRegionCapability("LandResources"); if (!url.empty()) { if(mBtnScriptLimits) @@ -2375,17 +2372,8 @@ void LLPanelLandOptions::refreshSearch() && region && !(region->getRegionFlag(REGION_FLAGS_BLOCK_PARCEL_SEARCH)); - // There is a bug with this panel whereby the Show Directory bit can be - // slammed off by the Region based on an override. Since this data is cached - // locally the change will not reflect in the panel, which could cause confusion - // A workaround for this is to flip the bit off in the locally cached version - // when we detect a mismatch case. - if(!can_change && parcel->getParcelFlag(PF_SHOW_DIRECTORY)) - { - parcel->setParcelFlag(PF_SHOW_DIRECTORY, FALSE); - } BOOL show_directory = parcel->getParcelFlag(PF_SHOW_DIRECTORY); - mCheckShowDirectory ->set(show_directory); + mCheckShowDirectory->set(show_directory); // Set by string in case the order in UI doesn't match the order by index. LLParcel::ECategory cat = parcel->getCategory(); diff --git a/indra/newview/llfloatermodeluploadbase.cpp b/indra/newview/llfloatermodeluploadbase.cpp index 7cdfd56d9a..4427e913e3 100644 --- a/indra/newview/llfloatermodeluploadbase.cpp +++ b/indra/newview/llfloatermodeluploadbase.cpp @@ -41,7 +41,7 @@ LLFloaterModelUploadBase::LLFloaterModelUploadBase(const LLSD& key) void LLFloaterModelUploadBase::requestAgentUploadPermissions() { std::string capability = "MeshUploadFlag"; - std::string url = gAgent.getRegion()->getCapability(capability); + std::string url = gAgent.getRegionCapability(capability); if (!url.empty()) { diff --git a/indra/newview/llfloaterregiondebugconsole.cpp b/indra/newview/llfloaterregiondebugconsole.cpp index 271fb2f9a3..e817589622 100644 --- a/indra/newview/llfloaterregiondebugconsole.cpp +++ b/indra/newview/llfloaterregiondebugconsole.cpp @@ -116,11 +116,11 @@ BOOL LLFloaterRegionDebugConsole::postBuild() mOutput = getChild("region_debug_console_output"); - std::string url = gAgent.getRegion()->getCapability("SimConsoleAsync"); + std::string url = gAgent.getRegionCapability("SimConsoleAsync"); if (url.empty()) { // Fall back to see if the old API is supported. - url = gAgent.getRegion()->getCapability("SimConsole"); + url = gAgent.getRegionCapability("SimConsole"); if (url.empty()) { mOutput->appendText( @@ -139,11 +139,11 @@ void LLFloaterRegionDebugConsole::onInput(LLUICtrl* ctrl, const LLSD& param) LLLineEditor* input = static_cast(ctrl); std::string text = input->getText() + "\n"; - std::string url = gAgent.getRegion()->getCapability("SimConsoleAsync"); + std::string url = gAgent.getRegionCapability("SimConsoleAsync"); if (url.empty()) { // Fall back to the old API - url = gAgent.getRegion()->getCapability("SimConsole"); + url = gAgent.getRegionCapability("SimConsole"); if (url.empty()) { text += CONSOLE_UNAVAILABLE + PROMPT; diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 2199be2194..0b25fbdede 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -256,7 +256,7 @@ BOOL LLFloaterRegionInfo::postBuild() return TRUE; } - if(!gAgent.getRegion()->getCapability("RegionExperiences").empty()) + if(!gAgent.getRegionCapability("RegionExperiences").empty()) { panel = new LLPanelRegionExperiences; mInfoPanels.push_back(panel); @@ -926,10 +926,7 @@ bool LLPanelRegionGeneralInfo::onMessageCommit(const LLSD& notification, const L void LLFloaterRegionInfo::requestMeshRezInfo() { - // Crash fix - //std::string sim_console_url = gAgent.getRegion()->getCapability("SimConsoleAsync"); - std::string sim_console_url = gAgent.getRegion() ? gAgent.getRegion()->getCapability("SimConsoleAsync") : LLStringUtil::null; - // + std::string sim_console_url = gAgent.getRegionCapability("SimConsoleAsync"); if (!sim_console_url.empty()) { @@ -964,7 +961,7 @@ BOOL LLPanelRegionGeneralInfo::sendUpdate() // First try using a Cap. If that fails use the old method. LLSD body; - std::string url = gAgent.getRegion()->getCapability("DispatchRegionInfo"); + std::string url = gAgent.getRegionCapability("DispatchRegionInfo"); if (!url.empty()) { body["block_terraform"] = getChild("block_terraform_check")->getValue(); diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index 1ea072ee58..a8937ccacd 100644 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -449,8 +449,8 @@ void LLFloaterReporter::onClickSend(void *userdata) LLUploadDialog::modalUploadDialog(LLTrans::getString("uploading_abuse_report")); // *TODO don't upload image if checkbox isn't checked - std::string url = gAgent.getRegion()->getCapability("SendUserReport"); - std::string sshot_url = gAgent.getRegion()->getCapability("SendUserReportWithScreenshot"); + std::string url = gAgent.getRegionCapability("SendUserReport"); + std::string sshot_url = gAgent.getRegionCapability("SendUserReportWithScreenshot"); if(!url.empty() || !sshot_url.empty()) { self->sendReportViaCaps(url, sshot_url, self->gatherReport()); diff --git a/indra/newview/llfloatersidepanelcontainer.cpp b/indra/newview/llfloatersidepanelcontainer.cpp index b25428f5d6..53eaa8df43 100644 --- a/indra/newview/llfloatersidepanelcontainer.cpp +++ b/indra/newview/llfloatersidepanelcontainer.cpp @@ -78,7 +78,10 @@ void LLFloaterSidePanelContainer::closeFloater(bool app_quitting) { edit_wearable_ptr->onClose(); } - panel_appearance->showOutfitsInventoryPanel(); + if(!app_quitting) + { + panel_appearance->showOutfitsInventoryPanel(); + } } } } diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index ba1916d4ba..030e16f044 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -383,8 +383,8 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshotBase* floater) } else { - width_ctrl->setMaxValue(6016); - height_ctrl->setMaxValue(6016); + width_ctrl->setMaxValue(MAX_SNAPSHOT_IMAGE_SIZE); + height_ctrl->setMaxValue(MAX_SNAPSHOT_IMAGE_SIZE); } } diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index fc63493a62..49edfbf625 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -4436,8 +4436,7 @@ public: } //K now we want to accept the invitation - std::string url = gAgent.getRegion()->getCapability( - "ChatSessionRequest"); + std::string url = gAgent.getRegionCapability("ChatSessionRequest"); if ( url != "" ) { diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index e3d66205f7..eb7f03e030 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -228,6 +228,68 @@ const std::string& LLInvFVBridge::getDisplayName() const return mDisplayName; } +std::string LLInvFVBridge::getSearchableDescription() const +{ + const LLInventoryModel* model = getInventoryModel(); + if (model) + { + const LLInventoryItem *item = model->getItem(mUUID); + if(item) + { + std::string desc = item->getDescription(); + LLStringUtil::toUpper(desc); + return desc; + } + } + return LLStringUtil::null; +} + +std::string LLInvFVBridge::getSearchableCreatorName() const +{ + const LLInventoryModel* model = getInventoryModel(); + if (model) + { + const LLInventoryItem *item = model->getItem(mUUID); + if(item) + { + LLAvatarName av_name; + if (LLAvatarNameCache::get(item->getCreatorUUID(), &av_name)) + { + std::string username = av_name.getUserName(); + LLStringUtil::toUpper(username); + return username; + } + } + } + return LLStringUtil::null; +} + +std::string LLInvFVBridge::getSearchableUUIDString() const +{ + const LLInventoryModel* model = getInventoryModel(); + if (model) + { + const LLViewerInventoryItem *item = model->getItem(mUUID); + if(item /*&& (item->getIsFullPerm() || gAgent.isGodlikeWithoutAdminMenuFakery())*/) // Keep it FS-legacy style since we had it like this for ages + { + std::string uuid = item->getAssetUUID().asString(); + LLStringUtil::toUpper(uuid); + return uuid; + } + } + return LLStringUtil::null; +} + +// Zi's extended inventory search +std::string LLInvFVBridge::getSearchableAll() const +{ + return getSearchableName() + "+" + + getSearchableCreatorName() + "+" + + getSearchableDescription() + "+" + + getSearchableUUIDString(); +} +// + // Folders have full perms PermissionMask LLInvFVBridge::getPermissionMask() const { @@ -889,6 +951,12 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, // disabled_items.push_back(std::string("Properties")); //} // + + LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE); + if (active_panel && (active_panel->getName() != "All Items")) + { + items.push_back(std::string("Show in Main Panel")); + } } void LLInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags) @@ -1695,25 +1763,6 @@ void LLItemBridge::performAction(LLInventoryModel* model, std::string action) { gotoItem(); } - - // Find item in main inventory tab - if ("find_in_main" == action) - { - // Go to the item. Similar to gotoItem() but with normal items, not links. - LLInventoryObject *obj = getInventoryObject(); - - mInventoryPanel.get()->getParentByType()->selectFirstTab(); - if (obj) - { - LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(); - if (active_panel) - { - active_panel->setSelection(obj->getUUID(), TAKE_FOCUS_YES); - } - } - } - // - if ("open" == action || "open_original" == action) { openItem(); @@ -1751,6 +1800,11 @@ void LLItemBridge::performAction(LLInventoryModel* model, std::string action) gViewerWindow->getWindow()->copyTextToClipboard(utf8str_to_wstring(buffer)); return; } + else if ("show_in_main_panel" == action) + { + LLInventoryPanel::openInventoryPanelAndSetSelection(TRUE, mUUID, TRUE); + return; + } else if ("cut" == action) { cutToClipboard(); @@ -2017,13 +2071,19 @@ void LLItemBridge::buildDisplayName() const { mDisplayName.assign(LLStringUtil::null); } - + S32 old_length = mSearchableName.length(); + S32 new_length = mDisplayName.length() + getLabelSuffix().length(); + mSearchableName.assign(mDisplayName); mSearchableName.append(getLabelSuffix()); LLStringUtil::toUpper(mSearchableName); - //Name set, so trigger a sort - if(mParent) + if ((old_length > new_length) && getInventoryFilter()) + { + getInventoryFilter()->setModified(LLFolderViewFilter::FILTER_MORE_RESTRICTIVE); + } + //Name set, so trigger a sort + if(mParent) { mParent->requestSort(); } @@ -3361,6 +3421,11 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) return; } // + else if ("show_in_main_panel" == action) + { + LLInventoryPanel::openInventoryPanelAndSetSelection(TRUE, mUUID, TRUE); + return; + } else if ("cut" == action) { cutToClipboard(); @@ -6872,10 +6937,6 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) if ( (rlv_handler_t::isEnabled()) && (!gRlvAttachmentLocks.canDetach(item)) ) disabled_items.push_back(std::string("Detach From Yourself")); // [/RLVa:KB] - // Add "Find in Main" option to Worn Items - if (mInventoryPanel.get()->getName() == "Worn Items") - items.push_back(std::string("Find in Main")); // This should appear only in Worn Items tab - // } else if (!isItemInTrash() && !isLinkedObjectInTrash() && !isLinkedObjectMissing() && !isCOFFolder()) { @@ -7174,10 +7235,6 @@ void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags) if ( (rlv_handler_t::isEnabled()) && (!gRlvWearableLocks.canRemove(item)) ) disabled_items.push_back(std::string("Take Off")); // [/RLVa:KB] - // Add "Find in Main" option to Worn Items - if (mInventoryPanel.get()->getName() == "Worn Items") - items.push_back(std::string("Find in Main")); - // } else { @@ -7980,69 +8037,4 @@ LLInvFVBridge* LLWornInventoryBridgeBuilder::createBridge( return new_listener; } - -// Reintegrate search by uuid/creator/descripting from Zi Ree after CHUI Merge -std::string LLInvFVBridge::getSearchableCreator( void ) const -{ - LLInventoryItem *pItem( dynamic_cast< LLInventoryItem* >( getInventoryObject() ) ); - - std::string strCreator; - if(pItem) - { - LLAvatarName av_name; - if (LLAvatarNameCache::get(pItem->getCreatorUUID(), &av_name)) - { - strCreator = av_name.getUserName(); - LLStringUtil::toUpper( strCreator ); - } - } - - return strCreator; -} - -std::string LLInvFVBridge::getSearchableDescription( void ) const -{ - LLInventoryItem *pItem( dynamic_cast< LLInventoryItem* >( getInventoryObject() ) ); - - std::string strDescr; - - if(pItem) - { - if(!pItem->getDescription().empty() ) - { - strDescr = pItem->getDescription(); - LLStringUtil::toUpper( strDescr ); - } - } - - return strDescr; -} - -std::string LLInvFVBridge::getSearchableUUID( void ) const -{ - LLInventoryItem *pItem( dynamic_cast< LLInventoryItem* >( getInventoryObject() ) ); - - std::string strUUID; - if(pItem) - { - if(!pItem->getAssetUUID().isNull()) - { - strUUID = pItem->getAssetUUID().asString(); - LLStringUtil::toUpper( strUUID ); - } - - } - return strUUID; - -} - -std::string LLInvFVBridge::getSearchableAll( void ) const -{ - return getSearchableName() + "+" + - getSearchableCreator() + "+" + - getSearchableDescription() + "+" + - getSearchableUUID(); -} -// - // EOF diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index cb5064ac4c..a95969952e 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -94,6 +94,11 @@ public: virtual const std::string& getDisplayName() const; const std::string& getSearchableName() const { return mSearchableName; } + std::string getSearchableDescription() const; + std::string getSearchableCreatorName() const; + std::string getSearchableUUIDString() const; + std::string getSearchableAll() const; // Zi's extended inventory search + virtual PermissionMask getPermissionMask() const; virtual LLFolderType::EType getPreferredType() const; virtual time_t getCreationDate() const; @@ -206,14 +211,6 @@ protected: void purgeItem(LLInventoryModel *model, const LLUUID &uuid); void removeObject(LLInventoryModel *model, const LLUUID &uuid); virtual void buildDisplayName() const {} - - // Reintegrate search by uuid/creator/descripting from Zi Ree after CHUI Merge -public: - virtual std::string getSearchableCreator( void ) const; - virtual std::string getSearchableDescription( void ) const; - virtual std::string getSearchableUUID( void ) const; - virtual std::string getSearchableAll( void ) const; - // }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index ad49c5f9d3..154a3ef598 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -29,6 +29,7 @@ #include "llinventoryfilter.h" // viewer includes +#include "llagent.h" #include "llfolderviewmodel.h" #include "llfolderviewitem.h" #include "llinventorymodel.h" @@ -74,13 +75,14 @@ LLInventoryFilter::LLInventoryFilter(const Params& p) : mName(p.name), mFilterModified(FILTER_NONE), mEmptyLookupMessage("InventoryNoMatchingItems"), - mFilterSubStringTarget(SUBST_TARGET_NAME), // Extended Inventory Search mFilterOps(p.filter_ops), mBackupFilterOps(mFilterOps), mFilterSubString(p.substring), mCurrentGeneration(0), mFirstRequiredGeneration(0), - mFirstSuccessGeneration(0) + mFirstSuccessGeneration(0), + mSearchType(SEARCHTYPE_NAME), + mFilterCreatorType(FILTERCREATOR_ALL) { // Begin Multi-substring inventory search mSubStringMatchOffsets.clear(); @@ -89,31 +91,10 @@ LLInventoryFilter::LLInventoryFilter(const Params& p) // copy mFilterOps into mDefaultFilterOps markDefault(); + mUsername = gAgentUsername; + LLStringUtil::toUpper(mUsername); } -// Extended Inventory Search -void LLInventoryFilter::setFilterSubStringTarget(const std::string& targetName) -{ - if (targetName == "name") - mFilterSubStringTarget = SUBST_TARGET_NAME; - else if (targetName == "creator") - mFilterSubStringTarget = SUBST_TARGET_CREATOR; - else if (targetName == "description") - mFilterSubStringTarget = SUBST_TARGET_DESCRIPTION; - else if (targetName == "uuid") - mFilterSubStringTarget = SUBST_TARGET_UUID; - else if (targetName == "all") - mFilterSubStringTarget = SUBST_TARGET_ALL; - else - LL_WARNS("LLInventoryFilter") << "Unknown sub string target: " << targetName << LL_ENDL; -} - -LLInventoryFilter::EFilterSubstringTarget LLInventoryFilter::getFilterSubStringTarget() const -{ - return mFilterSubStringTarget; -} -// Extended Inventory Search - bool LLInventoryFilter::check(const LLFolderViewModelItem* item) { const LLFolderViewModelItemInventory* listener = dynamic_cast(item); @@ -126,30 +107,48 @@ bool LLInventoryFilter::check(const LLFolderViewModelItem* item) } // Multi-substring inventory search - //bool passed = (mFilterSubString.size() ? listener->getSearchableName().find(mFilterSubString) != std::string::npos : true); + //std::string desc = listener->getSearchableCreatorName(); + //switch(mSearchType) + //{ + // case SEARCHTYPE_CREATOR: + // desc = listener->getSearchableCreatorName(); + // break; + // case SEARCHTYPE_DESCRIPTION: + // desc = listener->getSearchableDescription(); + // break; + // case SEARCHTYPE_UUID: + // desc = listener->getSearchableUUIDString(); + // break; + // case SEARCHTYPE_NAME: + // default: + // desc = listener->getSearchableName(); + // break; + //} + + //bool passed = (mFilterSubString.size() ? desc.find(mFilterSubString) != std::string::npos : true); std::string::size_type string_offset = std::string::npos; if (mFilterSubStrings.size()) { std::string searchLabel; - switch (mFilterSubStringTarget) + switch (mSearchType) { - case SUBST_TARGET_NAME: + case SEARCHTYPE_NAME: searchLabel = listener->getSearchableName(); break; - case SUBST_TARGET_CREATOR: - searchLabel = listener->getSearchableCreator(); - break; - case SUBST_TARGET_DESCRIPTION: + case SEARCHTYPE_DESCRIPTION: searchLabel = listener->getSearchableDescription(); break; - case SUBST_TARGET_UUID: - searchLabel = listener->getSearchableUUID(); + case SEARCHTYPE_CREATOR: + searchLabel = listener->getSearchableCreatorName(); break; - case SUBST_TARGET_ALL: + case SEARCHTYPE_UUID: + searchLabel = listener->getSearchableUUIDString(); + break; + case SEARCHTYPE_ALL: searchLabel = listener->getSearchableAll(); break; default: - LL_WARNS("LLInventoryFilter") << "Unknown search substring target: " << mFilterSubStringTarget << LL_ENDL; + LL_WARNS("LLInventoryFilter") << "Unknown search substring target: " << mSearchType << LL_ENDL; searchLabel = listener->getSearchableName(); break; } @@ -184,6 +183,7 @@ bool LLInventoryFilter::check(const LLFolderViewModelItem* item) passed = passed && checkAgainstFilterType(listener); passed = passed && checkAgainstPermissions(listener); passed = passed && checkAgainstFilterLinks(listener); + passed = passed && checkAgainstCreator(listener); return passed; } @@ -332,6 +332,32 @@ bool LLInventoryFilter::checkAgainstFilterType(const LLFolderViewModelItemInvent } } + // + //if(filterTypes & FILTERTYPE_WORN) + //{ + // if (!get_is_item_worn(object_id)) + // { + // return FALSE; + // } + //} + //////////////////////////////////////////////////////////////////////////////// + // FILTERTYPE_WORN + // Pass if this item is worn (hiding COF and Outfits folders) + if (filterTypes & FILTERTYPE_WORN) + { + if (!object) + { + return FALSE; + } + const LLUUID& cat_id = object->getParentUUID(); + const LLViewerInventoryCategory* cat = gInventory.getCategory(cat_id); + return !LLAppearanceMgr::instance().getIsInCOF(object_id) // Not a link in COF + && (!cat || cat->getPreferredType() != LLFolderType::FT_OUTFIT) // Not a link in an outfit folder + && get_is_item_worn(object_id); + } + // + + //////////////////////////////////////////////////////////////////////////////// // FILTERTYPE_UUID // Pass if this item is the target UUID or if it links to the target UUID @@ -399,24 +425,6 @@ bool LLInventoryFilter::checkAgainstFilterType(const LLFolderViewModelItemInvent } // - // - //////////////////////////////////////////////////////////////////////////////// - // FILTERTYPE_WORN - // Pass if this item is worn (hiding COF and Outfits folders) - if (filterTypes & FILTERTYPE_WORN) - { - if (!object) - { - return FALSE; - } - const LLUUID& cat_id = object->getParentUUID(); - const LLViewerInventoryCategory* cat = gInventory.getCategory(cat_id); - return !LLAppearanceMgr::instance().getIsInCOF(object_id) // Not a link in COF - && (!cat || cat->getPreferredType() != LLFolderType::FT_OUTFIT) // Not a link in an outfit folder - && get_is_item_worn(object_id); - } - // - //////////////////////////////////////////////////////////////////////////////// // FILTERTYPE_EMPTYFOLDERS // Pass if this item is a folder and is not a system folder that should be hidden @@ -571,6 +579,24 @@ bool LLInventoryFilter::checkAgainstFilterLinks(const LLFolderViewModelItemInven return TRUE; } +bool LLInventoryFilter::checkAgainstCreator(const LLFolderViewModelItemInventory* listener) const +{ + if (!listener) return TRUE; + const BOOL is_folder = listener->getInventoryType() == LLInventoryType::IT_CATEGORY; + switch(mFilterCreatorType) + { + case FILTERCREATOR_SELF: + if(is_folder) return FALSE; + return (listener->getSearchableCreatorName() == mUsername); + case FILTERCREATOR_OTHERS: + if(is_folder) return FALSE; + return (listener->getSearchableCreatorName() != mUsername); + case FILTERCREATOR_ALL: + default: + return TRUE; + } +} + const std::string& LLInventoryFilter::getFilterSubString(BOOL trim) const { return mFilterSubString; @@ -578,7 +604,17 @@ const std::string& LLInventoryFilter::getFilterSubString(BOOL trim) const std::string::size_type LLInventoryFilter::getStringMatchOffset(LLFolderViewModelItem* item) const { - return mFilterSubString.size() ? item->getSearchableName().find(mFilterSubString) : std::string::npos; + // Zi's extended inventory search + //if (mSearchType == SEARCHTYPE_NAME) + if (mSearchType == SEARCHTYPE_NAME || mSearchType == SEARCHTYPE_ALL) + // + { + return mFilterSubString.size() ? item->getSearchableName().find(mFilterSubString) : std::string::npos; + } + else + { + return std::string::npos; + } } bool LLInventoryFilter::isDefault() const @@ -651,6 +687,24 @@ void LLInventoryFilter::updateFilterTypes(U64 types, U64& current_types) } } +void LLInventoryFilter::setSearchType(ESearchType type) +{ + if(mSearchType != type) + { + mSearchType = type; + setModified(); + } +} + +void LLInventoryFilter::setFilterCreator(EFilterCreatorType type) +{ + if(mFilterCreatorType != type) + { + mFilterCreatorType = type; + setModified(); + } +} + void LLInventoryFilter::setFilterObjectTypes(U64 types) { updateFilterTypes(types, mFilterOps.mFilterObjectTypes); @@ -674,6 +728,11 @@ void LLInventoryFilter::setFilterEmptySystemFolders() mFilterOps.mFilterTypes |= FILTERTYPE_EMPTYFOLDERS; } +void LLInventoryFilter::setFilterWorn() +{ + mFilterOps.mFilterTypes |= FILTERTYPE_WORN; +} + void LLInventoryFilter::setFilterMarketplaceActiveFolders() { mFilterOps.mFilterTypes |= FILTERTYPE_MARKETPLACE_ACTIVE; @@ -1041,21 +1100,6 @@ void LLInventoryFilter::setFindAllLinksMode(const std::string &search_name, cons setFilterLinks(FILTERLINK_ONLY_LINKS); } -// -void LLInventoryFilter::setFilterWorn(BOOL worn) -{ - setModified(); - if (worn) - { - mFilterOps.mFilterTypes |= FILTERTYPE_WORN; - } - else - { - mFilterOps.mFilterTypes &= ~FILTERTYPE_WORN; - } -} -// - // FIRE-19340: search inventory by transferable permission void LLInventoryFilter::setFilterTransferable(BOOL transferable) { @@ -1317,7 +1361,6 @@ LLInventoryFilter& LLInventoryFilter::operator=( const LLInventoryFilter& othe setFilterPermissions(other.getFilterPermissions()); setFilterSubString(other.getFilterSubString()); setDateRangeLastLogoff(other.isSinceLogoff()); - setFilterWorn(other.getFilterWorn()); // FIRE-19340: search inventory by transferable permission setFilterTransferable(other.getFilterTransferable()); return *this; diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h index f7c17a64ab..9313aa06d0 100644 --- a/indra/newview/llinventoryfilter.h +++ b/indra/newview/llinventoryfilter.h @@ -58,7 +58,7 @@ public: FILTERTYPE_MARKETPLACE_UNASSOCIATED = 0x1 << 8, // pass if folder is a marketplace non associated (no market ID) folder FILTERTYPE_MARKETPLACE_LISTING_FOLDER = 0x1 << 9, // pass iff folder is a listing folder FILTERTYPE_NO_MARKETPLACE_ITEMS = 0x1 << 10, // pass iff folder is not under the marketplace - FILTERTYPE_WORN = 0x1 << 11, // search by wearable type + FILTERTYPE_WORN = 0x1 << 11, // pass if item is worn FILTERTYPE_TRANSFERABLE = 0x1 << 12 // FIRE-19340: search inventory by transferable permission }; @@ -84,16 +84,21 @@ public: SO_FOLDERS_BY_WEIGHT = 0x1 << 3, // Force folder sort by weight, usually, amount of some elements in their descendents }; - // Extended Inventory Search - enum EFilterSubstringTarget + enum ESearchType { - SUBST_TARGET_NAME = 0, // Classic search for item name - SUBST_TARGET_CREATOR, // Search for creator name - SUBST_TARGET_DESCRIPTION, // Search for item description - SUBST_TARGET_UUID, // Search for asset UUID - SUBST_TARGET_ALL // Search in all fields at the same time + SEARCHTYPE_NAME, + SEARCHTYPE_DESCRIPTION, + SEARCHTYPE_CREATOR, + SEARCHTYPE_UUID, + SEARCHTYPE_ALL // Zi's extended inventory search + }; + + enum EFilterCreatorType + { + FILTERCREATOR_ALL, + FILTERCREATOR_SELF, + FILTERCREATOR_OTHERS }; - // Extended Inventory Search struct FilterOps { @@ -191,6 +196,7 @@ public: void setFilterUUID(const LLUUID &object_id); void setFilterWearableTypes(U64 types); void setFilterEmptySystemFolders(); + void setFilterWorn(); void removeFilterEmptySystemFolders(); // Optional hiding of empty system folders void setFilterMarketplaceActiveFolders(); void setFilterMarketplaceInactiveFolders(); @@ -198,6 +204,10 @@ public: void setFilterMarketplaceListingFolders(bool select_only_listing_folders); void setFilterNoMarketplaceFolder(); void updateFilterTypes(U64 types, U64& current_types); + void setSearchType(ESearchType type); + ESearchType getSearchType() { return mSearchType; } + void setFilterCreator(EFilterCreatorType type); + EFilterCreatorType getFilterCreator() { return mFilterCreatorType; } void setFilterSubString(const std::string& string); const std::string& getFilterSubString(BOOL trim = FALSE) const; @@ -231,9 +241,7 @@ public: void setFindAllLinksMode(const std::string &search_name, const LLUUID& search_id); // - void setFilterWorn(BOOL worn); BOOL getFilterWorn() const { return mFilterOps.mFilterTypes & FILTERTYPE_WORN; } - // // FIRE-19340: search inventory by transferable permission void setFilterTransferable(BOOL transferable); @@ -252,11 +260,6 @@ public: std::string::size_type getStringMatchOffset(LLFolderViewModelItem* item) const; std::string::size_type getFilterStringSize() const; - // Extended Inventory Search - void setFilterSubStringTarget(const std::string& targetName); - EFilterSubstringTarget getFilterSubStringTarget() const; - std::string getSearchableTarget(const LLFolderViewItem* item) const; - // Extended Inventory Search // +-------------------------------------------------------------------+ // + Presentation @@ -316,6 +319,7 @@ private: bool checkAgainstPermissions(const class LLFolderViewModelItemInventory* listener) const; bool checkAgainstPermissions(const LLInventoryItem* item) const; bool checkAgainstFilterLinks(const class LLFolderViewModelItemInventory* listener) const; + bool checkAgainstCreator(const class LLFolderViewModelItemInventory* listener) const; bool checkAgainstClipboard(const LLUUID& object_id) const; FilterOps mFilterOps; @@ -327,10 +331,10 @@ private: // Multi-substring inventory search std::vector mSubStringMatchOffsets; std::vector mFilterSubStrings; - EFilterSubstringTarget mFilterSubStringTarget; // Multi-substring inventory search std::string mFilterSubStringOrig; + std::string mUsername; const std::string mName; S32 mCurrentGeneration; @@ -345,6 +349,9 @@ private: std::string mFilterText; std::string mEmptyLookupMessage; + + ESearchType mSearchType; + EFilterCreatorType mFilterCreatorType; }; #endif diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 5035871afc..262eb148f6 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -2429,7 +2429,8 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root { // Undo delete item confirmation per-session annoyance //static bool sDisplayedAtSession = false; - + const LLUUID &marketplacelistings_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false); + bool marketplacelistings_item = false; LLAllDescendentsPassedFilter f; for (std::set::iterator it = selected_items.begin(); (it != selected_items.end()) && (f.allDescendentsPassedFilter()); ++it) { @@ -2437,9 +2438,15 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root { folder->applyFunctorRecursively(f); } + LLFolderViewModelItemInventory * viewModel = dynamic_cast((*it)->getViewModelItem()); + if (viewModel && gInventory.isObjectDescendentOf(viewModel->getUUID(), marketplacelistings_id)) + { + marketplacelistings_item = true; + break; + } } // Fall through to the generic confirmation if the user choose to ignore the specialized one - if ( (!f.allDescendentsPassedFilter()) && (!LLNotifications::instance().getIgnored("DeleteFilteredItems")) ) + if ( (!f.allDescendentsPassedFilter()) && !marketplacelistings_item && (!LLNotifications::instance().getIgnored("DeleteFilteredItems")) ) { LLNotificationsUtil::add("DeleteFilteredItems", LLSD(), LLSD(), boost::bind(&LLInventoryAction::onItemsRemovalConfirmation, _1, _2, root->getHandle())); } diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 78ac28c99d..cd730e2ca5 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -382,6 +382,11 @@ void LLInventoryPanel::setFilterTypes(U64 types, LLInventoryFilter::EFilterType getFilter().setFilterCategoryTypes(types); } +void LLInventoryPanel::setFilterWorn() +{ + getFilter().setFilterWorn(); +} + U32 LLInventoryPanel::getFilterObjectTypes() const { return getFilter().getFilterObjectTypes(); @@ -408,18 +413,6 @@ void LLInventoryPanel::setFilterSubString(const std::string& string) getFilter().setFilterSubString(string); } -// Extended Inventory Search -void LLInventoryPanel::setFilterSubStringTarget(const std::string& target) -{ - getFilter().setFilterSubStringTarget(target); -} - -LLInventoryFilter::EFilterSubstringTarget LLInventoryPanel::getFilterSubStringTarget() const -{ - return getFilter().getFilterSubStringTarget(); -} -// Extended Inventory Search - const std::string LLInventoryPanel::getFilterSubString() { return getFilter().getFilterSubString(); @@ -470,12 +463,15 @@ U64 LLInventoryPanel::getFilterLinks() } // Filter Links Menu -// -void LLInventoryPanel::setWorn(BOOL worn) +void LLInventoryPanel::setSearchType(LLInventoryFilter::ESearchType type) { - getFilter().setFilterWorn(worn); + getFilter().setSearchType(type); +} + +LLInventoryFilter::ESearchType LLInventoryPanel::getSearchType() +{ + return getFilter().getSearchType(); } -// // FIRE-19340: search inventory by transferable permission void LLInventoryPanel::setTransferable(BOOL transferable) @@ -1520,9 +1516,14 @@ LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open) } //static -void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const LLUUID& obj_id) +void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const LLUUID& obj_id, BOOL main_panel) { - LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(auto_open); + LLInventoryPanel *active_panel; + if (main_panel) + { + LLFloaterSidePanelContainer::getPanel("inventory")->selectAllItemsPanel(); + } + active_panel = LLInventoryPanel::getActiveInventoryPanel(auto_open); if (active_panel) { diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index cfe96864d7..522a387eea 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -173,23 +173,21 @@ public: LLInventoryFilter& getFilter(); const LLInventoryFilter& getFilter() const; void setFilterTypes(U64 filter, LLInventoryFilter::EFilterType = LLInventoryFilter::FILTERTYPE_OBJECT); + void setFilterWorn(); U32 getFilterObjectTypes() const; void setFilterPermMask(PermissionMask filter_perm_mask); U32 getFilterPermMask() const; void setFilterWearableTypes(U64 filter); void setFilterSubString(const std::string& string); const std::string getFilterSubString(); - // Extended Inventory Search - void setFilterSubStringTarget(const std::string& target); - LLInventoryFilter::EFilterSubstringTarget getFilterSubStringTarget() const; - // Extended Inventory Search void setSinceLogoff(BOOL sl); void setHoursAgo(U32 hours); void setDateSearchDirection(U32 direction); BOOL getSinceLogoff(); void setFilterLinks(U64 filter_links); U64 getFilterLinks(); // Filter Links Menu - void setWorn(BOOL worn); // + void setSearchType(LLInventoryFilter::ESearchType type); + LLInventoryFilter::ESearchType getSearchType(); void setTransferable(BOOL transferable); // FIRE-19340: search inventory by transferable permission void setShowFolderState(LLInventoryFilter::EFolderShow show); @@ -232,7 +230,7 @@ public: // "Auto_open" determines if we open an inventory panel if none are open. static LLInventoryPanel *getActiveInventoryPanel(BOOL auto_open = TRUE); - static void openInventoryPanelAndSetSelection(BOOL auto_open, const LLUUID& obj_id); + static void openInventoryPanelAndSetSelection(BOOL auto_open, const LLUUID& obj_id, BOOL main_panel = FALSE); void addItemID(const LLUUID& id, LLFolderViewItem* itemp); void removeItemID(const LLUUID& id); diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index bac5707047..95bb2d5d20 100644 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -59,12 +59,22 @@ #include "llupdaterservice.h" #include "llevents.h" #include "llappviewer.h" +#include "llsdserialize.h" #include #include const S32 LOGIN_MAX_RETRIES = 3; +// this can be removed once it is defined by the build for all forks +#ifndef ADDRESS_SIZE +#ifdef ND_BUILD64BIT_ARCH +# define ADDRESS_SIZE 64 +#else +# define ADDRESS_SIZE 32 +#endif +#endif + class LLLoginInstance::Disposable { public: virtual ~Disposable() {} @@ -495,10 +505,12 @@ LLLoginInstance::LLLoginInstance() : } void LLLoginInstance::setPlatformInfo(const std::string platform, - const std::string platform_version) + const std::string platform_version, + const std::string platform_name) { mPlatform = platform; mPlatformVersion = platform_version; + mPlatformVersionName = platform_name; } LLLoginInstance::~LLLoginInstance() @@ -567,7 +579,6 @@ void LLLoginInstance::constructAuthParams(LLPointer user_credentia requested_options.append("event_notifications"); requested_options.append("classified_categories"); requested_options.append("adult_compliant"); - //requested_options.append("inventory-targets"); requested_options.append("buddy-list"); requested_options.append("newuser-config"); requested_options.append("ui-config"); @@ -604,8 +615,7 @@ void LLLoginInstance::constructAuthParams(LLPointer user_credentia #endif // OPENSIM // // - // (re)initialize the request params with creds. - LLSD request_params = user_credential->getLoginParams(); + LLSD request_params; unsigned char hashed_unique_id_string[MD5HEX_STR_SIZE]; if ( ! llHashedUniqueID(hashed_unique_id_string) ) @@ -622,11 +632,26 @@ void LLLoginInstance::constructAuthParams(LLPointer user_credentia request_params["version"] = LLVersionInfo::getVersion(); request_params["channel"] = LLVersionInfo::getChannel(); request_params["platform"] = mPlatform; + request_params["address_size"] = ADDRESS_SIZE; request_params["platform_version"] = mPlatformVersion; + request_params["platform_string"] = mPlatformVersionName; request_params["id0"] = mSerialNumber; request_params["host_id"] = gSavedSettings.getString("HostID"); request_params["extended_errors"] = true; // request message_id and message_args + // log request_params _before_ adding the credentials + LL_DEBUGS("LLLogin") << "Login parameters: " << LLSDOStreamer(request_params) << LL_ENDL; + + // Copy the credentials into the request after logging the rest + LLSD credentials(user_credential->getLoginParams()); + for (LLSD::map_const_iterator it = credentials.beginMap(); + it != credentials.endMap(); + it++ + ) + { + request_params[it->first] = it->second; + } + // Specify desired timeout/retry options LLSD http_params; http_params["timeout"] = gSavedSettings.getF32("LoginSRVTimeout"); diff --git a/indra/newview/lllogininstance.h b/indra/newview/lllogininstance.h index 5fe99af00b..a073eec25a 100644 --- a/indra/newview/lllogininstance.h +++ b/indra/newview/lllogininstance.h @@ -70,7 +70,7 @@ public: void setSerialNumber(const std::string& sn) { mSerialNumber = sn; } void setLastExecEvent(int lee) { mLastExecEvent = lee; } void setLastExecDuration(S32 duration) { mLastExecDuration = duration; } - void setPlatformInfo(const std::string platform, const std::string platform_version); + void setPlatformInfo(const std::string platform, const std::string platform_version, const std::string platform_name); void setNotificationsInterface(LLNotificationsInterface* ni) { mNotifications = ni; } LLNotificationsInterface& getNotificationsInterface() const { return *mNotifications; } @@ -108,6 +108,7 @@ private: S32 mLastExecDuration; std::string mPlatform; std::string mPlatformVersion; + std::string mPlatformVersionName; UpdaterLauncherCallback mUpdaterLauncher; LLEventDispatcher mDispatcher; LLUpdaterService * mUpdaterService; diff --git a/indra/newview/llmachineid.cpp b/indra/newview/llmachineid.cpp index 6ca65f4ac0..b0ee8e7fcb 100644 --- a/indra/newview/llmachineid.cpp +++ b/indra/newview/llmachineid.cpp @@ -37,25 +37,28 @@ using namespace std; unsigned char static_unique_id[] = {0,0,0,0,0,0}; bool static has_static_unique_id = false; -#if LL_WINDOWS -class FSComInitialize -{ - HRESULT mHR; -public: - FSComInitialize() - { - mHR = CoInitializeEx( 0, COINIT_MULTITHREADED ); - if( FAILED( mHR ) ) - LL_DEBUGS( "AppInit" ) << "Failed to initialize COM library. Error code = 0x" << hex << mHR << LL_ENDL; - } +#if LL_WINDOWS - ~FSComInitialize() - { - if( SUCCEEDED( mHR ) ) - CoUninitialize(); - } +class LLComInitialize +{ + HRESULT mHR; +public: + LLComInitialize() + { + mHR = CoInitializeEx(0, COINIT_MULTITHREADED); + if (FAILED(mHR)) + LL_DEBUGS("AppInit") << "Failed to initialize COM library. Error code = 0x" << hex << mHR << LL_ENDL; + } + + ~LLComInitialize() + { + if (SUCCEEDED(mHR)) + CoUninitialize(); + } }; -#endif + +#endif //LL_WINDOWS + // get an unique machine id. // NOT THREAD SAFE - do before setting up threads. // MAC Address doesn't work for Windows 7 since the first returned hardware MAC address changes with each reboot, Go figure?? @@ -78,18 +81,7 @@ S32 LLMachineID::init() // Step 1: -------------------------------------------------- // Initialize COM. ------------------------------------------ - // Do not fail in case CoInitialize fails as it can be harmless - - //hres = CoInitializeEx(0, COINIT_MULTITHREADED); - //if (FAILED(hres)) - //{ - // LL_DEBUGS("AppInit") << "Failed to initialize COM library. Error code = 0x" << hex << hres << LL_ENDL; - // return 1; // Program has failed. - //} - - FSComInitialize comInit; - - // + LLComInitialize comInit; // Step 2: -------------------------------------------------- // Set general COM security levels -------------------------- @@ -114,7 +106,6 @@ S32 LLMachineID::init() if (FAILED(hres)) { LL_WARNS("AppInit") << "Failed to initialize security. Error code = 0x" << hex << hres << LL_ENDL; - // CoUninitialize(); Counitialize will be handled by RAII class return 1; // Program has failed. } @@ -132,7 +123,6 @@ S32 LLMachineID::init() if (FAILED(hres)) { LL_WARNS("AppInit") << "Failed to create IWbemLocator object." << " Err code = 0x" << hex << hres << LL_ENDL; - // CoUninitialize(); Counitialize will be handled by RAII class return 1; // Program has failed. } @@ -159,7 +149,6 @@ S32 LLMachineID::init() { LL_WARNS("AppInit") << "Could not connect. Error code = 0x" << hex << hres << LL_ENDL; pLoc->Release(); - // CoUninitialize(); Counitialize will be handled by RAII class return 1; // Program has failed. } @@ -185,7 +174,6 @@ S32 LLMachineID::init() LL_WARNS("AppInit") << "Could not set proxy blanket. Error code = 0x" << hex << hres << LL_ENDL; pSvc->Release(); pLoc->Release(); - // CoUninitialize(); Counitialize will be handled by RAII class return 1; // Program has failed. } @@ -206,7 +194,6 @@ S32 LLMachineID::init() LL_WARNS("AppInit") << "Query for operating system name failed." << " Error code = 0x" << hex << hres << LL_ENDL; pSvc->Release(); pLoc->Release(); - // CoUninitialize(); Counitialize will be handled by RAII class return 1; // Program has failed. } @@ -261,7 +248,6 @@ S32 LLMachineID::init() pLoc->Release(); if (pEnumerator) pEnumerator->Release(); - // CoUninitialize(); Counitialize will be handled by RAII class ret_code=0; #else unsigned char * staticPtr = (unsigned char *)(&static_unique_id[0]); diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 3dbc4f1581..5b6277e3e3 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -1982,7 +1982,7 @@ LLMeshUploadThread::LLMeshUploadThread(LLMeshUploadThread::instance_list& data, mOrigin = gAgent.getPositionAgent(); mHost = gAgent.getRegionHost(); - mWholeModelFeeCapability = gAgent.getRegion()->getCapability("NewFileAgentInventory"); + mWholeModelFeeCapability = gAgent.getRegionCapability("NewFileAgentInventory"); mOrigin += gAgent.getAtAxis() * scale.magVec(); @@ -2070,14 +2070,14 @@ void dump_llsd_to_file(const LLSD& content, std::string filename) { if (gSavedSettings.getBOOL("MeshUploadLogXML")) { - std::ofstream of(filename.c_str()); + llofstream of(filename.c_str()); LLSDSerialize::toPrettyXML(content,of); } } LLSD llsd_from_file(std::string filename) { - std::ifstream ifs(filename.c_str()); + llifstream ifs(filename.c_str()); LLSD result; LLSDSerialize::fromXML(result,ifs); return result; diff --git a/indra/newview/lloutfitgallery.cpp b/indra/newview/lloutfitgallery.cpp index 4fe1ce22c7..954b92b503 100644 --- a/indra/newview/lloutfitgallery.cpp +++ b/indra/newview/lloutfitgallery.cpp @@ -702,13 +702,24 @@ void LLOutfitGalleryItem::draw() const F32 alpha = getTransparencyType() == TT_ACTIVE ? 1.0f : getCurrentTransparency(); if (mTexturep) { - LLRect interior = border; - interior.stretch(-1); + if (mImageUpdatePending && mTexturep->getDiscardLevel() >= 0) + { + mImageUpdatePending = false; + if (mTexturep->getOriginalWidth() > MAX_OUTFIT_PHOTO_WIDTH || mTexturep->getOriginalHeight() > MAX_OUTFIT_PHOTO_HEIGHT) + { + setDefaultImage(); + } + } + else + { + LLRect interior = border; + interior.stretch(-1); - gl_draw_scaled_image(interior.mLeft - 1, interior.mBottom, interior.getWidth(), interior.getHeight(), mTexturep, UI_VERTEX_COLOR % alpha); + gl_draw_scaled_image(interior.mLeft - 1, interior.mBottom, interior.getWidth(), interior.getHeight(), mTexturep, UI_VERTEX_COLOR % alpha); - // Pump the priority - mTexturep->addTextureStats((F32)(interior.getWidth() * interior.getHeight())); + // Pump the priority + mTexturep->addTextureStats((F32)(interior.getWidth() * interior.getHeight())); + } } } @@ -774,12 +785,19 @@ BOOL LLOutfitGalleryItem::handleDoubleClick(S32 x, S32 y, MASK mask) return LLPanel::handleDoubleClick(x, y, mask); } -void LLOutfitGalleryItem::setImageAssetId(LLUUID image_asset_id) +bool LLOutfitGalleryItem::setImageAssetId(LLUUID image_asset_id) { - mImageAssetId = image_asset_id; - mTexturep = LLViewerTextureManager::getFetchedTexture(image_asset_id, FTT_DEFAULT, MIPMAP_YES, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); - getChildView("preview_outfit")->setVisible(FALSE); - mDefaultImage = false; + LLPointer texture = LLViewerTextureManager::getFetchedTexture(image_asset_id, FTT_DEFAULT, MIPMAP_YES, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); + if (texture && texture->getOriginalWidth() <= MAX_OUTFIT_PHOTO_WIDTH && texture->getOriginalHeight() <= MAX_OUTFIT_PHOTO_HEIGHT) + { + mImageAssetId = image_asset_id; + mTexturep = texture; + getChildView("preview_outfit")->setVisible(FALSE); + mDefaultImage = false; + mImageUpdatePending = (texture->getDiscardLevel() == -1); + return true; + } + return false; } LLUUID LLOutfitGalleryItem::getImageAssetId() @@ -793,6 +811,7 @@ void LLOutfitGalleryItem::setDefaultImage() mImageAssetId.setNull(); getChildView("preview_outfit")->setVisible(TRUE); mDefaultImage = true; + mImageUpdatePending = false; } LLContextMenu* LLOutfitGalleryContextMenu::createMenu() @@ -1037,13 +1056,28 @@ void LLOutfitGallery::refreshOutfit(const LLUUID& category_id) BOOST_FOREACH(LLViewerInventoryItem* outfit_item, outfit_item_array) { LLViewerInventoryItem* linked_item = outfit_item->getLinkedItem(); - if (linked_item != NULL && linked_item->getActualType() == LLAssetType::AT_TEXTURE) + LLUUID asset_id, inv_id; + std::string item_name; + if (linked_item != NULL) { - LLUUID asset_id = linked_item->getAssetUUID(); - mOutfitMap[category_id]->setImageAssetId(asset_id); - photo_loaded = true; - std::string linked_item_name = linked_item->getName(); - if (!mOutfitRenamePending.isNull() && mOutfitRenamePending.asString() == linked_item_name) + if (linked_item->getActualType() == LLAssetType::AT_TEXTURE) + { + asset_id = linked_item->getAssetUUID(); + inv_id = linked_item->getUUID(); + item_name = linked_item->getName(); + } + } + else if (outfit_item->getActualType() == LLAssetType::AT_TEXTURE) + { + asset_id = outfit_item->getAssetUUID(); + inv_id = outfit_item->getUUID(); + item_name = outfit_item->getName(); + } + if (asset_id.notNull()) + { + photo_loaded |= mOutfitMap[category_id]->setImageAssetId(asset_id); + // Rename links + if (!mOutfitRenamePending.isNull() && mOutfitRenamePending.asString() == item_name) { LLViewerInventoryCategory *outfit_cat = gInventory.getCategory(mOutfitRenamePending); LLStringUtil::format_map_t photo_string_args; @@ -1051,7 +1085,7 @@ void LLOutfitGallery::refreshOutfit(const LLUUID& category_id) std::string new_name = getString("outfit_photo_string", photo_string_args); LLSD updates; updates["name"] = new_name; - update_inventory_item(linked_item->getUUID(), updates, NULL); + update_inventory_item(inv_id, updates, NULL); mOutfitRenamePending.setNull(); LLFloater* inv_floater = LLFloaterReg::getInstance("inventory"); if (inv_floater) @@ -1064,7 +1098,11 @@ void LLOutfitGallery::refreshOutfit(const LLUUID& category_id) appearance_floater->setFocus(TRUE); } } - break; + if (item_name == LLAppearanceMgr::sExpectedTextureName) + { + // Images with "appropriate" name take priority + break; + } } if (!photo_loaded) { @@ -1079,6 +1117,7 @@ void LLOutfitGallery::refreshOutfit(const LLUUID& category_id) } } +// Refresh linked textures from "textures" uploads folder void LLOutfitGallery::refreshTextures(const LLUUID& category_id) { LLInventoryModel::cat_array_t cat_array; diff --git a/indra/newview/lloutfitgallery.h b/indra/newview/lloutfitgallery.h index 2566247072..b1ca850508 100644 --- a/indra/newview/lloutfitgallery.h +++ b/indra/newview/lloutfitgallery.h @@ -259,7 +259,7 @@ public: /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask); void setDefaultImage(); - void setImageAssetId(LLUUID asset_id); + bool setImageAssetId(LLUUID asset_id); LLUUID getImageAssetId(); void setOutfitName(std::string name); void setOutfitWorn(bool value); @@ -282,6 +282,7 @@ private: bool mSelected; bool mWorn; bool mDefaultImage; + bool mImageUpdatePending; bool mHidden; std::string mOutfitName; }; diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index 7cda427529..303a749bd0 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -144,6 +144,7 @@ BOOL LLPanelFace::postBuild() //childSetCommitCallback("TexScaleU",&LLPanelFace::onCommitTextureScaleX, this); //childSetCommitCallback("TexScaleV",&LLPanelFace::onCommitTextureScaleY, this); //childSetCommitCallback("TexRot",&LLPanelFace::onCommitTextureRot, this); + //childSetCommitCallback("rptctrl",&LLPanelFace::onCommitRepeatsPerMeter, this); childSetCommitCallback("checkbox planar align",&LLPanelFace::onCommitPlanarAlign, this); //childSetCommitCallback("TexOffsetU",LLPanelFace::onCommitTextureOffsetX, this); //childSetCommitCallback("TexOffsetV",LLPanelFace::onCommitTextureOffsetY, this); @@ -161,59 +162,92 @@ BOOL LLPanelFace::postBuild() childSetCommitCallback("glossiness",&LLPanelFace::onCommitMaterialGloss, this); childSetCommitCallback("environment",&LLPanelFace::onCommitMaterialEnv, this); childSetCommitCallback("maskcutoff",&LLPanelFace::onCommitMaterialMaskCutoff, this); - + // - childSetCommitCallback("checkbox maps sync", &LLPanelFace::onClickMapsSync, this); + childSetCommitCallback("checkbox_sync_settings", &LLPanelFace::onClickMapsSync, this); childSetAction("copytextures",&LLPanelFace::onClickCopy,this); childSetAction("pastetextures",&LLPanelFace::onClickPaste,this); mCtrlTexScaleU = getChild("TexScaleU"); - mCtrlTexScaleU->setCommitCallback(&LLPanelFace::onCommitTextureScaleX, this); - + if (mCtrlTexScaleU) + { + mCtrlTexScaleU->setCommitCallback(&LLPanelFace::onCommitTextureScaleX, this); + } mCtrlTexScaleV = getChild("TexScaleV"); - mCtrlTexScaleV->setCommitCallback(&LLPanelFace::onCommitTextureScaleY, this); - + if (mCtrlTexScaleV) + { + mCtrlTexScaleV->setCommitCallback(&LLPanelFace::onCommitTextureScaleY, this); + } mCtrlBumpyScaleU = getChild("bumpyScaleU"); - mCtrlBumpyScaleU->setCommitCallback(&LLPanelFace::onCommitMaterialBumpyScaleX, this); - + if (mCtrlBumpyScaleU) + { + mCtrlBumpyScaleU->setCommitCallback(&LLPanelFace::onCommitMaterialBumpyScaleX, this); + } mCtrlBumpyScaleV = getChild("bumpyScaleV"); - mCtrlBumpyScaleV->setCommitCallback(&LLPanelFace::onCommitMaterialBumpyScaleY, this); - + if (mCtrlBumpyScaleV) + { + mCtrlBumpyScaleV->setCommitCallback(&LLPanelFace::onCommitMaterialBumpyScaleY, this); + } mCtrlShinyScaleU = getChild("shinyScaleU"); - mCtrlShinyScaleU->setCommitCallback(&LLPanelFace::onCommitMaterialShinyScaleX, this); - + if (mCtrlShinyScaleU) + { + mCtrlShinyScaleU->setCommitCallback(&LLPanelFace::onCommitMaterialShinyScaleX, this); + } mCtrlShinyScaleV = getChild("shinyScaleV"); - mCtrlShinyScaleV->setCommitCallback(&LLPanelFace::onCommitMaterialShinyScaleY, this); - + if (mCtrlShinyScaleV) + { + mCtrlShinyScaleV->setCommitCallback(&LLPanelFace::onCommitMaterialShinyScaleY, this); + } mCtrlTexOffsetU = getChild("TexOffsetU"); - mCtrlTexOffsetU->setCommitCallback(&LLPanelFace::onCommitTextureOffsetX, this); - + if (mCtrlTexOffsetU) + { + mCtrlTexOffsetU->setCommitCallback(&LLPanelFace::onCommitTextureOffsetX, this); + } mCtrlTexOffsetV = getChild("TexOffsetV"); - mCtrlTexOffsetV->setCommitCallback(&LLPanelFace::onCommitTextureOffsetY, this); - + if (mCtrlTexOffsetV) + { + mCtrlTexOffsetV->setCommitCallback(&LLPanelFace::onCommitTextureOffsetY, this); + } mCtrlBumpyOffsetU = getChild("bumpyOffsetU"); - mCtrlBumpyOffsetU->setCommitCallback(&LLPanelFace::onCommitMaterialBumpyOffsetX, this); - + if (mCtrlBumpyOffsetU) + { + mCtrlBumpyOffsetU->setCommitCallback(&LLPanelFace::onCommitMaterialBumpyOffsetX, this); + } mCtrlBumpyOffsetV = getChild("bumpyOffsetV"); - mCtrlBumpyOffsetV->setCommitCallback(&LLPanelFace::onCommitMaterialBumpyOffsetY, this); - + if (mCtrlBumpyOffsetV) + { + mCtrlBumpyOffsetV->setCommitCallback(&LLPanelFace::onCommitMaterialBumpyOffsetY, this); + } mCtrlShinyOffsetU = getChild("shinyOffsetU"); - mCtrlShinyOffsetU->setCommitCallback(&LLPanelFace::onCommitMaterialShinyOffsetX, this); - + if (mCtrlShinyOffsetU) + { + mCtrlShinyOffsetU->setCommitCallback(&LLPanelFace::onCommitMaterialShinyOffsetX, this); + } mCtrlShinyOffsetV = getChild("shinyOffsetV"); - mCtrlShinyOffsetV->setCommitCallback(&LLPanelFace::onCommitMaterialShinyOffsetY, this); - + if (mCtrlShinyOffsetV) + { + mCtrlShinyOffsetV->setCommitCallback(&LLPanelFace::onCommitMaterialShinyOffsetY, this); + } mCtrlTexRot = getChild("TexRot"); - mCtrlTexRot->setCommitCallback(&LLPanelFace::onCommitTextureRot, this); - + if (mCtrlTexRot) + { + mCtrlTexRot->setCommitCallback(&LLPanelFace::onCommitTextureRot, this); + } mCtrlBumpyRot = getChild("bumpyRot"); - mCtrlBumpyRot->setCommitCallback(&LLPanelFace::onCommitMaterialBumpyRot, this); - + if (mCtrlBumpyRot) + { + mCtrlBumpyRot->setCommitCallback(&LLPanelFace::onCommitMaterialBumpyRot, this); + } mCtrlShinyRot = getChild("shinyRot"); - mCtrlShinyRot->setCommitCallback(&LLPanelFace::onCommitMaterialShinyRot, this); - + if (mCtrlShinyRot) + { + mCtrlShinyRot->setCommitCallback(&LLPanelFace::onCommitMaterialShinyRot, this); + } mCtrlRpt = getChild("rptctrl"); - mCtrlRpt->setCommitCallback(LLPanelFace::onCommitRepeatsPerMeter, this); + if (mCtrlRpt) + { + mCtrlRpt->setCommitCallback(LLPanelFace::onCommitRepeatsPerMeter, this); + } changePrecision(gSavedSettings.getS32("FSBuildToolDecimalPrecision")); // @@ -510,11 +544,11 @@ struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor { BOOL valid; F32 value; - //LLSpinCtrl* ctrlTexScaleS = mPanel->mCtrlTexScaleU; - //LLSpinCtrl* ctrlTexScaleT = mPanel->mCtrlTexScaleV; - //LLSpinCtrl* ctrlTexOffsetS = mPanel->mCtrlTexOffsetU; - //LLSpinCtrl* ctrlTexOffsetT = mPanel->mCtrlTexOffsetV; - //LLSpinCtrl* ctrlTexRotation = mPanel->mCtrlTexRot; + //LLSpinCtrl* ctrlTexScaleS = mPanel->getChild("TexScaleU"); + //LLSpinCtrl* ctrlTexScaleT = mPanel->getChild("TexScaleV"); + //LLSpinCtrl* ctrlTexOffsetS = mPanel->getChild("TexOffsetU"); + //LLSpinCtrl* ctrlTexOffsetT = mPanel->getChild("TexOffsetV"); + //LLSpinCtrl* ctrlTexRotation = mPanel->getChild("TexRot"); LLComboBox* comboTexGen = mPanel->getChild("combobox texgen"); llassert(comboTexGen); llassert(object); @@ -696,7 +730,7 @@ void LLPanelFace::sendTextureInfo() if ((bool)childGetValue("checkbox planar align").asBoolean()) { LLFace* last_face = NULL; - bool identical_face = false; + bool identical_face =false; LLSelectedTE::getFace(last_face, identical_face); LLPanelFaceSetAlignedTEFunctor setfunc(this, last_face); LLSelectMgr::getInstance()->getSelection()->applyToTEs(&setfunc); @@ -730,14 +764,14 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) getChildView("button align")->setEnabled(editable); // - BOOL enable_material_controls = (!gSavedSettings.getBOOL("FSSyncronizeTextureMaps")); + BOOL enable_material_controls = (!gSavedSettings.getBOOL("SyncMaterialSettings")); S32 selected_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount(); BOOL single_volume = ((LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME )) && (selected_count == 1)); getChildView("copytextures")->setEnabled(single_volume && editable); getChildView("pastetextures")->setEnabled(editable); // - + //LLComboBox* combobox_matmedia = getChild("combobox matmedia"); if (mComboMatMedia) { @@ -767,10 +801,8 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) } mRadioMatType->setEnabled(editable); - // Commented out because we already had this - //getChildView("checkbox_sync_settings")->setEnabled(editable); - //childSetValue("checkbox_sync_settings", gSavedSettings.getBOOL("SyncMaterialSettings")); - // + getChildView("checkbox_sync_settings")->setEnabled(editable); + childSetValue("checkbox_sync_settings", gSavedSettings.getBOOL("SyncMaterialSettings")); updateVisibility(); bool identical = true; // true because it is anded below @@ -1077,11 +1109,7 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) mCtrlBumpyScaleU->setTentative(LLSD(norm_scale_tentative)); // FIRE-11407 - Materials alignment - // FIRE-11911 - Synchronize materials doens't work with planar textures - // Disable the checkbox if planar textures are in use - getChildView("checkbox maps sync")->setEnabled(editable && (specmap_id.notNull() || normmap_id.notNull()) && !align_planar); - // FIRE-11911 - // + getChildView("checkbox_sync_settings")->setEnabled(editable && (specmap_id.notNull() || normmap_id.notNull()) && !align_planar); } { @@ -2233,12 +2261,6 @@ void LLPanelFace::onCommitTextureInfo( LLUICtrl* ctrl, void* userdata ) self->sendTextureInfo(); // vertical scale and repeats per meter depends on each other, so force set on changes self->updateUI(true); - // Materials alignment - if (gSavedSettings.getBOOL("FSSyncronizeTextureMaps")) - { - alignMaterialsProperties(self); - } - // } // static @@ -2839,7 +2861,10 @@ void LLPanelFace::onClickMapsSync(LLUICtrl* ctrl, void *userdata) LLPanelFace *self = (LLPanelFace*) userdata; llassert_always(self); self->getState(); - if (gSavedSettings.getBOOL("FSSyncronizeTextureMaps")) + // FIRE-21375 use LL setting name as part of the material sync changes (FIRE-21375) + // if (gSavedSettings.getBOOL("FSSyncronizeTextureMaps")) + if (gSavedSettings.getBOOL("SyncMaterialSettings")) + // { alignMaterialsProperties(self); } @@ -2942,7 +2967,11 @@ void LLPanelFace::onCommitFlip(const LLUICtrl* ctrl, const LLSD& user_data) { case MATTYPE_DIFFUSE: self->sendTextureInfo(); - if (gSavedSettings.getBOOL("FSSyncronizeTextureMaps")) +// FIRE-21375 use LL setting name as part of the material sync changes (FIRE-21375) +// if (gSavedSettings.getBOOL("FSSyncronizeTextureMaps")) + + if (gSavedSettings.getBOOL("SyncMaterialSettings")) +// { alignMaterialsProperties(self); } diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 8db62ab9de..9aab9aae5f 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -793,7 +793,7 @@ void LLPanelLogin::loadLoginPage() params["grid"] = LLGridManager::getInstance()->getGridId(); // add OS info - params["os"] = LLAppViewer::instance()->getOSInfo().getOSStringSimple(); + params["os"] = LLOSInfo::instance().getOSStringSimple(); // sourceid params["sourceid"] = gSavedSettings.getString("sourceid"); diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 8e1fd9e30c..cf38fc270f 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -30,6 +30,7 @@ #include "llagent.h" #include "llagentcamera.h" #include "llavataractions.h" +#include "llcheckboxctrl.h" #include "llcombobox.h" #include "lldndbutton.h" #include "lleconomy.h" @@ -94,6 +95,9 @@ public: BOOL getCheckSinceLogoff(); U32 getDateSearchDirection(); + void onCreatorSelfFilterCommit(); + void onCreatorOtherFilterCommit(); + static void onTimeAgo(LLUICtrl*, void *); static void onCloseBtn(void* user_data); static void selectAllTypes(void* user_data); @@ -105,6 +109,8 @@ private: LLPanelMainInventory* mPanelMainInventory; LLSpinCtrl* mSpinSinceDays; LLSpinCtrl* mSpinSinceHours; + LLCheckBoxCtrl* mCreatorSelf; + LLCheckBoxCtrl* mCreatorOthers; LLInventoryFilter* mFilter; }; @@ -115,11 +121,13 @@ private: LLPanelMainInventory::LLPanelMainInventory(const LLPanel::Params& p) : LLPanel(p), mActivePanel(NULL), + mWornItemsPanel(NULL), mSavedFolderState(NULL), mFilterText(""), mMenuGearDefault(NULL), mMenuAddHandle(), - mNeedUploadCost(true) + mNeedUploadCost(true), + mSearchTypeCombo(NULL) // Properly initialize this { // Menu Callbacks (non contex menus) mCommitCallbackRegistrar.add("Inventory.DoToSelected", boost::bind(&LLPanelMainInventory::doToSelected, this, _2)); @@ -138,8 +146,8 @@ LLPanelMainInventory::LLPanelMainInventory(const LLPanel::Params& p) // Filter Links Menu // Extended Inventory Search - mCommitCallbackRegistrar.add("Inventory.SearchTarget.Set", boost::bind(&LLPanelMainInventory::onSearchTargetChecked, this, _2)); - mEnableCallbackRegistrar.add("Inventory.SearchTarget.Check", boost::bind(&LLPanelMainInventory::isSearchTargetChecked, this, _2)); + mCommitCallbackRegistrar.add("Inventory.SearchType.Set", boost::bind(&LLPanelMainInventory::onSearchTypeChecked, this, _2)); + mEnableCallbackRegistrar.add("Inventory.SearchType.Check", boost::bind(&LLPanelMainInventory::isSearchTypeChecked, this, _2)); // Extended Inventory Search // Sort By menu handlers @@ -226,30 +234,38 @@ BOOL LLPanelMainInventory::postBuild() recent_items_panel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, recent_items_panel, _1, _2)); } - // Bring back worn items panel. - LLInventoryPanel* worn_items_panel = getChild("Worn Items"); - if (worn_items_panel) + LLInventoryPanel* mWornItemsPanel = getChild("Worn Items"); + if (mWornItemsPanel) { - worn_items_panel->setWorn(TRUE); - worn_items_panel->setSortOrder(gSavedSettings.getU32(LLInventoryPanel::DEFAULT_SORT_ORDER)); - worn_items_panel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); - LLInventoryFilter& worn_filter = worn_items_panel->getFilter(); - worn_filter.setFilterObjectTypes(0xffffffffffffffffULL & ~(0x1 << LLInventoryType::IT_GESTURE | 0x1 << LLInventoryType::IT_CATEGORY)); - worn_filter.markDefault(); + U32 filter_types = 0x0; + filter_types |= 0x1 << LLInventoryType::IT_WEARABLE; + filter_types |= 0x1 << LLInventoryType::IT_ATTACHMENT; + filter_types |= 0x1 << LLInventoryType::IT_OBJECT; + mWornItemsPanel->setFilterTypes(filter_types); + mWornItemsPanel->setFilterWorn(); + mWornItemsPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); + mWornItemsPanel->setFilterLinks(LLInventoryFilter::FILTERLINK_EXCLUDE_LINKS); + mWornItemsPanel->getFilter().markDefault(); + mWornItemsPanel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, mWornItemsPanel, _1, _2)); - // Do not go all crazy and recurse through the whole inventory - // worn_items_panel->openAllFolders(); - if( worn_items_panel->getRootFolder() ) + // Firestorm additions + mWornItemsPanel->setSortOrder(gSavedSettings.getU32(LLInventoryPanel::DEFAULT_SORT_ORDER)); + + if (mWornItemsPanel->getRootFolder()) { - worn_items_panel->getRootFolder()->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_NO); - worn_items_panel->getRootFolder()->arrangeAll(); + mWornItemsPanel->getRootFolder()->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_NO); + mWornItemsPanel->getRootFolder()->arrangeAll(); } - // - - worn_items_panel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, worn_items_panel, _1, _2)); + // + } + // Only if we actually have it! + //mSearchTypeCombo = getChild("search_type"); + mSearchTypeCombo = findChild("search_type"); + // + if(mSearchTypeCombo) + { + mSearchTypeCombo->setCommitCallback(boost::bind(&LLPanelMainInventory::onSelectSearchType, this)); } - // - // Now load the stored settings from disk, if available. std::string filterSaveName(gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, FILTERS_FILENAME)); LL_INFOS() << "LLPanelMainInventory::init: reading from " << filterSaveName << LL_ENDL; @@ -391,6 +407,16 @@ LLPanelMainInventory::~LLPanelMainInventory( void ) delete mSavedFolderState; } +LLInventoryPanel* LLPanelMainInventory::getAllItemsPanel() +{ + return getChild("All Items"); +} + +void LLPanelMainInventory::selectAllItemsPanel() +{ + mFilterTabs->selectFirstTab(); +} + void LLPanelMainInventory::startSearch() { // this forces focus to line editor portion of search editor @@ -481,6 +507,55 @@ void LLPanelMainInventory::resetFilters() setFilterTextFromFilter(); } +void LLPanelMainInventory::onSelectSearchType() +{ + std::string new_type = mSearchTypeCombo->getValue(); + if (new_type == "search_by_name") + { + getActivePanel()->setSearchType(LLInventoryFilter::SEARCHTYPE_NAME); + } + if (new_type == "search_by_creator") + { + getActivePanel()->setSearchType(LLInventoryFilter::SEARCHTYPE_CREATOR); + } + if (new_type == "search_by_description") + { + getActivePanel()->setSearchType(LLInventoryFilter::SEARCHTYPE_DESCRIPTION); + } + if (new_type == "search_by_UUID") + { + getActivePanel()->setSearchType(LLInventoryFilter::SEARCHTYPE_UUID); + } +} + +void LLPanelMainInventory::updateSearchTypeCombo() +{ + // Check if combo box is actually there + if (!mSearchTypeCombo) + { + return; + } + // + + LLInventoryFilter::ESearchType search_type = getActivePanel()->getSearchType(); + switch(search_type) + { + case LLInventoryFilter::SEARCHTYPE_CREATOR: + mSearchTypeCombo->setValue("search_by_creator"); + break; + case LLInventoryFilter::SEARCHTYPE_DESCRIPTION: + mSearchTypeCombo->setValue("search_by_description"); + break; + case LLInventoryFilter::SEARCHTYPE_UUID: + mSearchTypeCombo->setValue("search_by_UUID"); + break; + case LLInventoryFilter::SEARCHTYPE_NAME: + default: + mSearchTypeCombo->setValue("search_by_name"); + break; + } +} + // Sort By menu handlers void LLPanelMainInventory::setSortBy(const LLSD& userdata) { @@ -572,7 +647,10 @@ void LLPanelMainInventory::onClearSearch() { BOOL initially_active = FALSE; LLFloater *finder = getFinder(); + // Worn inventory panel + //if (mActivePanel && (getActivePanel() != mWornItemsPanel)) if (mActivePanel) + // { // FIRE-5160: Don't reset inventory filter when clearing search term //initially_active = mActivePanel->getFilter().isNotDefault(); @@ -803,6 +881,13 @@ void LLPanelMainInventory::onFilterSelected() return; } + // Worn inventory panel; We do this at init and only once for performance reasons! + //if (getActivePanel() == mWornItemsPanel) + //{ + // mActivePanel->openAllFolders(); + //} + // + updateSearchTypeCombo(); // Separate search for inventory tabs from Satomi Ahn (FIRE-913 & FIRE-6862) //setFilterSubString(mFilterSubString); if (!gSavedSettings.getBOOL("FSSplitInventorySearchOverTabs")) @@ -843,7 +928,7 @@ BOOL LLPanelMainInventory::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, { // Check to see if we are auto scrolling from the last frame // LLInventoryPanel* panel = (LLInventoryPanel*)this->getActivePanel(); -// BOOL needsToScroll = panel->getScrollableContainer()->autoScroll(x, y); +// BOOL needsToScroll = panel->getScrollableContainer()->canAutoScroll(x, y); // if(mFilterTabs) // { // if(needsToScroll) @@ -1036,6 +1121,11 @@ BOOL LLFloaterInventoryFinder::postBuild() mSpinSinceDays = getChild("spin_days_ago"); childSetCommitCallback("spin_days_ago", onTimeAgo, this); + mCreatorSelf = getChild("check_created_by_me"); + mCreatorOthers = getChild("check_created_by_others"); + mCreatorSelf->setCommitCallback(boost::bind(&LLFloaterInventoryFinder::onCreatorSelfFilterCommit, this)); + mCreatorOthers->setCommitCallback(boost::bind(&LLFloaterInventoryFinder::onCreatorOtherFilterCommit, this)); + childSetAction("Close", onCloseBtn, this); // FIRE-5160: Don't reset inventory filter when clearing search term @@ -1082,15 +1172,15 @@ void LLFloaterInventoryFinder::onTimeAgo(LLUICtrl *ctrl, void *user_data) // FIRE-5160: Don't reset inventory filter when clearing search term void LLFloaterInventoryFinder::onResetBtn() { + mFilter->resetDefault(); LLInventoryPanel* panel = mPanelMainInventory->getPanel(); - panel->getFilter().resetDefault(); if (panel->getName() == "All Items") { panel->setFilterTypes(0xffffffffffffffffULL); } - LLInventoryFilter &filter = panel->getFilter(); - mPanelMainInventory->updateFilterDropdown(&filter); + mPanelMainInventory->updateFilterDropdown(mFilter); + mFilter->setFilterCreator(LLInventoryFilter::FILTERCREATOR_ALL); updateElementsFromFilter(); } @@ -1114,6 +1204,10 @@ void LLFloaterInventoryFinder::updateElementsFromFilter() U32 hours = mFilter->getHoursAgo(); U32 date_search_direction = mFilter->getDateSearchDirection(); + LLInventoryFilter::EFilterCreatorType filter_creator = mFilter->getFilterCreator(); + bool show_created_by_me = ((filter_creator == LLInventoryFilter::FILTERCREATOR_ALL) || (filter_creator == LLInventoryFilter::FILTERCREATOR_SELF)); + bool show_created_by_others = ((filter_creator == LLInventoryFilter::FILTERCREATOR_ALL) || (filter_creator == LLInventoryFilter::FILTERCREATOR_OTHERS)); + // update the ui elements // Make floater title translatable // setTitle(mFilter->getName()); @@ -1135,6 +1229,10 @@ void LLFloaterInventoryFinder::updateElementsFromFilter() getChild("check_snapshot")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_SNAPSHOT)); getChild("check_transferable")->setValue(mFilter->getFilterTransferable()); // FIRE-19340: search inventory by transferable permission getChild("check_show_empty")->setValue(show_folders == LLInventoryFilter::SHOW_ALL_FOLDERS); + + getChild("check_created_by_me")->setValue(show_created_by_me); + getChild("check_created_by_others")->setValue(show_created_by_others); + getChild("check_since_logoff")->setValue(mFilter->isSinceLogoff()); mSpinSinceHours->set((F32)(hours % 24)); mSpinSinceDays->set((F32)(hours / 24)); @@ -1232,6 +1330,7 @@ void LLFloaterInventoryFinder::draw() mPanelMainInventory->getPanel()->setShowFolderState(getCheckShowEmpty() ? LLInventoryFilter::SHOW_ALL_FOLDERS : LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); mPanelMainInventory->getPanel()->setFilterTypes(filter); + if (getCheckSinceLogoff()) { mSpinSinceDays->set(0); @@ -1262,6 +1361,46 @@ void LLFloaterInventoryFinder::draw() LLPanel::draw(); } +void LLFloaterInventoryFinder::onCreatorSelfFilterCommit() +{ + bool show_creator_self = mCreatorSelf->getValue(); + bool show_creator_other = mCreatorOthers->getValue(); + + if(show_creator_self && show_creator_other) + { + mFilter->setFilterCreator(LLInventoryFilter::FILTERCREATOR_ALL); + } + else if(show_creator_self) + { + mFilter->setFilterCreator(LLInventoryFilter::FILTERCREATOR_SELF); + } + else if(!show_creator_self || !show_creator_other) + { + mFilter->setFilterCreator(LLInventoryFilter::FILTERCREATOR_OTHERS); + mCreatorOthers->set(TRUE); + } +} + +void LLFloaterInventoryFinder::onCreatorOtherFilterCommit() +{ + bool show_creator_self = mCreatorSelf->getValue(); + bool show_creator_other = mCreatorOthers->getValue(); + + if(show_creator_self && show_creator_other) + { + mFilter->setFilterCreator(LLInventoryFilter::FILTERCREATOR_ALL); + } + else if(show_creator_other) + { + mFilter->setFilterCreator(LLInventoryFilter::FILTERCREATOR_OTHERS); + } + else if(!show_creator_other || !show_creator_self) + { + mFilter->setFilterCreator(LLInventoryFilter::FILTERCREATOR_SELF); + mCreatorSelf->set(TRUE); + } +} + BOOL LLFloaterInventoryFinder::getCheckShowEmpty() { return getChild("check_show_empty")->getValue(); @@ -1775,43 +1914,59 @@ BOOL LLPanelMainInventory::isFilterLinksChecked(const LLSD& userdata) // Filter Links Menu // Extended Inventory Search -void LLPanelMainInventory::onSearchTargetChecked(const LLSD& userdata) +void LLPanelMainInventory::onSearchTypeChecked(const LLSD& userdata) { - getActivePanel()->setFilterSubStringTarget(userdata.asString()); + std::string new_type = userdata.asString(); + if (new_type == "search_by_name") + { + getActivePanel()->setSearchType(LLInventoryFilter::SEARCHTYPE_NAME); + } + if (new_type == "search_by_creator") + { + getActivePanel()->setSearchType(LLInventoryFilter::SEARCHTYPE_CREATOR); + } + if (new_type == "search_by_description") + { + getActivePanel()->setSearchType(LLInventoryFilter::SEARCHTYPE_DESCRIPTION); + } + if (new_type == "search_by_UUID") + { + getActivePanel()->setSearchType(LLInventoryFilter::SEARCHTYPE_UUID); + } + if (new_type == "search_by_all") + { + getActivePanel()->setSearchType(LLInventoryFilter::SEARCHTYPE_ALL); + } resetFilters(); } -LLInventoryFilter::EFilterSubstringTarget LLPanelMainInventory::getSearchTarget() const -{ - return getActivePanel()->getFilterSubStringTarget(); -} - -BOOL LLPanelMainInventory::isSearchTargetChecked(const LLSD& userdata) +BOOL LLPanelMainInventory::isSearchTypeChecked(const LLSD& userdata) { + LLInventoryFilter::ESearchType search_type = getActivePanel()->getSearchType(); const std::string command_name = userdata.asString(); - if (command_name == "name") + if (command_name == "search_by_name") { - return (getSearchTarget() == LLInventoryFilter::SUBST_TARGET_NAME); + return (search_type == LLInventoryFilter::SEARCHTYPE_NAME); } - if (command_name == "creator") + if (command_name == "search_by_creator") { - return (getSearchTarget() == LLInventoryFilter::SUBST_TARGET_CREATOR); + return (search_type == LLInventoryFilter::SEARCHTYPE_CREATOR); } - if (command_name == "description") + if (command_name == "search_by_description") { - return (getSearchTarget() == LLInventoryFilter::SUBST_TARGET_DESCRIPTION); + return (search_type == LLInventoryFilter::SEARCHTYPE_DESCRIPTION); } - if (command_name == "uuid") + if (command_name == "search_by_UUID") { - return (getSearchTarget() == LLInventoryFilter::SUBST_TARGET_UUID); + return (search_type == LLInventoryFilter::SEARCHTYPE_UUID); } - if (command_name == "all") + if (command_name == "search_by_all") { - return (getSearchTarget() == LLInventoryFilter::SUBST_TARGET_ALL); + return (search_type == LLInventoryFilter::SEARCHTYPE_ALL); } return FALSE; } diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h index 716aa9f0d6..c9df2840ee 100644 --- a/indra/newview/llpanelmaininventory.h +++ b/indra/newview/llpanelmaininventory.h @@ -35,6 +35,7 @@ #include "llfolderview.h" +class LLComboBox; class LLFolderViewItem; class LLInventoryPanel; class LLSaveFolderState; @@ -81,6 +82,8 @@ public: LLInventoryPanel* getPanel() { return mActivePanel; } LLInventoryPanel* getActivePanel() { return mActivePanel; } const LLInventoryPanel* getActivePanel() const { return mActivePanel; } + LLInventoryPanel* getAllItemsPanel(); + void selectAllItemsPanel(); // FIRE-19493: "Show Original" should open main inventory panel void showAllItemsPanel(); void resetFilters(); @@ -148,6 +151,8 @@ protected: void onExpandButtonClicked(); // Inventory Collapse and Expand Buttons void onFocusReceived(); + void onSelectSearchType(); + void updateSearchTypeCombo(); private: LLFloaterInventoryFinder* getFinder(); @@ -157,12 +162,14 @@ private: LLUICtrl* mCounterCtrl; LLHandle mFinderHandle; LLInventoryPanel* mActivePanel; + LLInventoryPanel* mWornItemsPanel; bool mResortActivePanel; LLSaveFolderState* mSavedFolderState; std::string mFilterText; std::string mFilterSubString; S32 mItemCount; std::string mItemCountString; + LLComboBox* mSearchTypeCombo; // Filter dropdown LLComboBox* mFilterComboBox; @@ -189,9 +196,8 @@ protected: // Filter Links Menu // Extended Inventory Search - BOOL isSearchTargetChecked(const LLSD& userdata); - void onSearchTargetChecked(const LLSD& userdata); - LLInventoryFilter::EFilterSubstringTarget getSearchTarget() const; + BOOL isSearchTypeChecked(const LLSD& userdata); + void onSearchTypeChecked(const LLSD& userdata); // Extended Inventory Search bool handleDragAndDropToTrash(BOOL drop, EDragAndDropType cargo_type, EAcceptance* accept); diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index 2aea95ffa1..3f109a4af3 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -2126,7 +2126,7 @@ void LLPanelObject::sendPosition(BOOL btn_down) if (mObject->isRootEdit()) { // only offset by parent's translation - mObject->resetChildrenPosition(LLVector3(-delta), TRUE) ; + mObject->resetChildrenPosition(LLVector3(-delta), TRUE, TRUE) ; } if(!btn_down) diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index 8669dce9bf..9b729a2e3c 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -115,6 +115,11 @@ public: virtual const std::string& getDisplayName() const; virtual const std::string& getSearchableName() const; + virtual std::string getSearchableDescription() const {return LLStringUtil::null;} + virtual std::string getSearchableCreatorName() const {return LLStringUtil::null;} + virtual std::string getSearchableUUIDString() const {return LLStringUtil::null;} + virtual std::string getSearchableAll() const { return LLStringUtil::null; } // Zi's extended inventory search + virtual PermissionMask getPermissionMask() const { return PERM_NONE; } /*virtual*/ LLFolderType::EType getPreferredType() const { return LLFolderType::FT_NONE; } virtual const LLUUID& getUUID() const { return mUUID; } diff --git a/indra/newview/llpanelwearing.cpp b/indra/newview/llpanelwearing.cpp index 719d24aaac..f44797a01d 100644 --- a/indra/newview/llpanelwearing.cpp +++ b/indra/newview/llpanelwearing.cpp @@ -484,7 +484,7 @@ bool LLPanelWearing::populateAttachmentsList(bool update) void LLPanelWearing::requestAttachmentDetails() { LLSD body; - std::string url = gAgent.getRegion()->getCapability("AttachmentResources"); + std::string url = gAgent.getRegionCapability("AttachmentResources"); if (!url.empty()) { LLCoros::instance().launch("LLPanelWearing::getAttachmentLimitsCoro", diff --git a/indra/newview/llpreview.cpp b/indra/newview/llpreview.cpp index e127e2a997..22e9a53288 100644 --- a/indra/newview/llpreview.cpp +++ b/indra/newview/llpreview.cpp @@ -73,7 +73,8 @@ LLPreview::LLPreview(const LLSD& key) mUserResized(FALSE), mCloseAfterSave(FALSE), mAssetStatus(PREVIEW_ASSET_UNLOADED), - mDirty(TRUE) + mDirty(TRUE), + mSaveDialogShown(FALSE) { mAuxItem = new LLInventoryItem; // don't necessarily steal focus on creation -- sometimes these guys pop up without user action diff --git a/indra/newview/llpreview.h b/indra/newview/llpreview.h index abdf57327e..869d46231b 100644 --- a/indra/newview/llpreview.h +++ b/indra/newview/llpreview.h @@ -124,7 +124,8 @@ protected: // for LLInventoryObserver virtual void changed(U32 mask); BOOL mDirty; - + BOOL mSaveDialogShown; + protected: LLUUID mItemUUID; diff --git a/indra/newview/llpreviewanim.cpp b/indra/newview/llpreviewanim.cpp index fb40af1302..12ac9e6fc5 100644 --- a/indra/newview/llpreviewanim.cpp +++ b/indra/newview/llpreviewanim.cpp @@ -148,6 +148,12 @@ void LLPreviewAnim::draw() } if(gAgentAvatarp->isMotionActive(this->mItemID) && !this->mDidStart) { + const LLInventoryItem *item = getItem(); + LLMotion* motion = gAgentAvatarp->findMotion(this->mItemID); + if (item && motion) + { + motion->setName(item->getName()); + } this->mDidStart = true; } } diff --git a/indra/newview/llpreviewgesture.cpp b/indra/newview/llpreviewgesture.cpp index ec629a8819..923f4bf067 100644 --- a/indra/newview/llpreviewgesture.cpp +++ b/indra/newview/llpreviewgesture.cpp @@ -234,9 +234,13 @@ BOOL LLPreviewGesture::canClose() } else { - // Bring up view-modal dialog: Save changes? Yes, No, Cancel - LLNotificationsUtil::add("SaveChanges", LLSD(), LLSD(), - boost::bind(&LLPreviewGesture::handleSaveChangesDialog, this, _1, _2) ); + if(!mSaveDialogShown) + { + mSaveDialogShown = TRUE; + // Bring up view-modal dialog: Save changes? Yes, No, Cancel + LLNotificationsUtil::add("SaveChanges", LLSD(), LLSD(), + boost::bind(&LLPreviewGesture::handleSaveChangesDialog, this, _1, _2) ); + } return FALSE; } } @@ -264,6 +268,7 @@ void LLPreviewGesture::onVisibilityChanged ( const LLSD& new_visibility ) bool LLPreviewGesture::handleSaveChangesDialog(const LLSD& notification, const LLSD& response) { + mSaveDialogShown = FALSE; S32 option = LLNotificationsUtil::getSelectedOption(notification, response); switch(option) { diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp index 9eaeb51cca..d89664e283 100644 --- a/indra/newview/llpreviewnotecard.cpp +++ b/indra/newview/llpreviewnotecard.cpp @@ -175,9 +175,12 @@ BOOL LLPreviewNotecard::canClose() } else { - // Bring up view-modal dialog: Save changes? Yes, No, Cancel - LLNotificationsUtil::add("SaveChanges", LLSD(), LLSD(), boost::bind(&LLPreviewNotecard::handleSaveChangesDialog,this, _1, _2)); - + if(!mSaveDialogShown) + { + mSaveDialogShown = TRUE; + // Bring up view-modal dialog: Save changes? Yes, No, Cancel + LLNotificationsUtil::add("SaveChanges", LLSD(), LLSD(), boost::bind(&LLPreviewNotecard::handleSaveChangesDialog,this, _1, _2)); + } return FALSE; } } @@ -679,6 +682,7 @@ void LLPreviewNotecard::onSaveComplete(const LLUUID& asset_uuid, void* user_data bool LLPreviewNotecard::handleSaveChangesDialog(const LLSD& notification, const LLSD& response) { + mSaveDialogShown = FALSE; S32 option = LLNotificationsUtil::getSelectedOption(notification, response); switch(option) { diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index b5230f8864..0ef611aae8 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -429,7 +429,8 @@ LLScriptEdCore::LLScriptEdCore( // mCompiling(false), // Compile indicators, recompile button mHasScriptData(FALSE), - mScriptRemoved(FALSE) + mScriptRemoved(FALSE), + mSaveDialogShown(FALSE) { setFollowsAll(); setBorderVisible(FALSE); @@ -1286,8 +1287,12 @@ BOOL LLScriptEdCore::canClose() } else { - // Bring up view-modal dialog: Save changes? Yes, No, Cancel - LLNotificationsUtil::add("SaveChanges", LLSD(), LLSD(), boost::bind(&LLScriptEdCore::handleSaveChangesDialog, this, _1, _2)); + if(!mSaveDialogShown) + { + mSaveDialogShown = TRUE; + // Bring up view-modal dialog: Save changes? Yes, No, Cancel + LLNotificationsUtil::add("SaveChanges", LLSD(), LLSD(), boost::bind(&LLScriptEdCore::handleSaveChangesDialog, this, _1, _2)); + } return FALSE; } } @@ -1301,6 +1306,7 @@ void LLScriptEdCore::setEnableEditing(bool enable) bool LLScriptEdCore::handleSaveChangesDialog(const LLSD& notification, const LLSD& response ) { + mSaveDialogShown = FALSE; S32 option = LLNotificationsUtil::getSelectedOption(notification, response); switch( option ) { @@ -1696,7 +1702,7 @@ void LLScriptEdCore::onBtnLoadFromFile( void* data ) std::string filename = file_picker.getFirstFile(); - std::ifstream fin(filename.c_str()); + llifstream fin(filename.c_str()); std::string line; std::string text; @@ -1734,7 +1740,7 @@ void LLScriptEdCore::onBtnSaveToFile( void* userdata ) { std::string filename = file_picker.getFirstFile(); std::string scriptText=self->mEditor->getText(); - std::ofstream fout(filename.c_str()); + llofstream fout(filename.c_str()); fout<<(scriptText); fout.close(); // FIRE-7514: Script in external editor needs to be saved twice diff --git a/indra/newview/llpreviewscript.h b/indra/newview/llpreviewscript.h index e7096b80a7..bed1c9a46a 100644 --- a/indra/newview/llpreviewscript.h +++ b/indra/newview/llpreviewscript.h @@ -208,6 +208,7 @@ private: LLLiveLSLFile* mLiveFile; LLUUID mAssociatedExperience; BOOL mScriptRemoved; + BOOL mSaveDialogShown; LLTextBox* mLineCol; // Advanced Script Editor //LLView* mSaveBtn; diff --git a/indra/newview/llproductinforequest.cpp b/indra/newview/llproductinforequest.cpp index b663df4aae..4abb673555 100644 --- a/indra/newview/llproductinforequest.cpp +++ b/indra/newview/llproductinforequest.cpp @@ -41,7 +41,7 @@ LLProductInfoRequestManager::LLProductInfoRequestManager(): void LLProductInfoRequestManager::initSingleton() { - std::string url = gAgent.getRegion()->getCapability("ProductInfoRequest"); + std::string url = gAgent.getRegionCapability("ProductInfoRequest"); if (!url.empty()) { LLCoros::instance().launch("LLProductInfoRequestManager::getLandDescriptionsCoro", diff --git a/indra/newview/llscenemonitor.cpp b/indra/newview/llscenemonitor.cpp index c9a2f94891..7261861e80 100644 --- a/indra/newview/llscenemonitor.cpp +++ b/indra/newview/llscenemonitor.cpp @@ -532,7 +532,7 @@ void LLSceneMonitor::dumpToFile(std::string file_name) LL_INFOS("SceneMonitor") << "Saving scene load stats to " << file_name << LL_ENDL; - std::ofstream os(file_name.c_str()); + llofstream os(file_name.c_str()); os << std::setprecision(10); diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 60ebc9dddf..5f683bcd8c 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -746,6 +746,19 @@ LLInventoryPanel *LLSidepanelInventory::getActivePanel() return NULL; } +void LLSidepanelInventory::selectAllItemsPanel() +{ + if (!getVisible()) + { + return; + } + if (mInventoryPanel->getVisible()) + { + mPanelMainInventory->selectAllItemsPanel(); + } + +} + BOOL LLSidepanelInventory::isMainInventoryPanelActive() const { return mInventoryPanel->getVisible(); diff --git a/indra/newview/llsidepanelinventory.h b/indra/newview/llsidepanelinventory.h index 363c1b1ebf..13362d2b2f 100644 --- a/indra/newview/llsidepanelinventory.h +++ b/indra/newview/llsidepanelinventory.h @@ -57,6 +57,7 @@ public: /*virtual*/ void onOpen(const LLSD& key); LLInventoryPanel* getActivePanel(); // Returns an active inventory panel, if any. + void selectAllItemsPanel(); LLInventoryPanel* getInboxPanel() const { return mInventoryPanelInbox.get(); } LLPanelMainInventory* getMainInventoryPanel() const { return mPanelMainInventory; } diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index ca773d8c1a..62e2658044 100644 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -824,7 +824,7 @@ void LLIMSpeakerMgr::toggleAllowTextChat(const LLUUID& speaker_id) LLPointer speakerp = findSpeaker(speaker_id); if (!speakerp) return; - std::string url = gAgent.getRegion()->getCapability("ChatSessionRequest"); + std::string url = gAgent.getRegionCapability("ChatSessionRequest"); LLSD data; data["method"] = "mute update"; data["session-id"] = getSessionID(); @@ -850,7 +850,7 @@ void LLIMSpeakerMgr::moderateVoiceParticipant(const LLUUID& avatar_id, bool unmu // do not send voice moderation changes for avatars not in voice channel if (!is_in_voice) return; - std::string url = gAgent.getRegion()->getCapability("ChatSessionRequest"); + std::string url = gAgent.getRegionCapability("ChatSessionRequest"); LLSD data; data["method"] = "mute update"; data["session-id"] = getSessionID(); @@ -930,7 +930,7 @@ void LLIMSpeakerMgr::processSessionUpdate(const LLSD& session_update) void LLIMSpeakerMgr::moderateVoiceSession(const LLUUID& session_id, bool disallow_voice) { - std::string url = gAgent.getRegion()->getCapability("ChatSessionRequest"); + std::string url = gAgent.getRegionCapability("ChatSessionRequest"); LLSD data; data["method"] = "session update"; data["session-id"] = session_id; diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 1a76f505ae..4d087e3198 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -588,7 +588,7 @@ bool idle_startup() const std::string delims (" "); std::string system; int begIdx, endIdx; - std::string osString = LLAppViewer::instance()->getOSInfo().getOSStringSimple(); + std::string osString = LLOSInfo::instance().getOSStringSimple(); begIdx = osString.find_first_not_of (delims); endIdx = osString.find_first_of (delims, begIdx); @@ -1213,7 +1213,8 @@ bool idle_startup() // Don't do anything. Wait for the login view to call the login_callback, // which will push us to the next state. - display_startup(); + + // display() function will be the one to run display_startup() // Sleep so we don't spin the CPU ms_sleep(1); return FALSE; diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index 4206261215..64dea2ba00 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -31,6 +31,7 @@ #include "llapr.h" #include "lldir.h" #include "llimage.h" +#include "llimagej2c.h" // for version control #include "lllfsthread.h" #include "llviewercontrol.h" @@ -938,6 +939,14 @@ BOOL LLTextureCache::isInLocal(const LLUUID& id) F32 LLTextureCache::sHeaderCacheVersion = 1.7f; U32 LLTextureCache::sCacheMaxEntries = 1024 * 1024; //~1 million textures. S64 LLTextureCache::sCacheMaxTexturesSize = 0; // no limit +std::string LLTextureCache::sHeaderCacheEncoderVersion = LLImageJ2C::getEngineInfo(); + +#if defined(ADDRESS_SIZE) +U32 LLTextureCache::sHeaderCacheAddressSize = ADDRESS_SIZE; +#else +U32 LLTextureCache::sHeaderCacheAddressSize = 32; +#endif + const char* entries_filename = "texture.entries"; const char* cache_filename = "texture.cache"; const char* old_textures_dirname = "textures"; @@ -1085,12 +1094,28 @@ void LLTextureCache::readEntriesHeader() } else //create an empty entries header. { - mHeaderEntriesInfo.mVersion = sHeaderCacheVersion ; - mHeaderEntriesInfo.mEntries = 0 ; + setEntriesHeader(); writeEntriesHeader() ; } } +void LLTextureCache::setEntriesHeader() +{ + if (sHeaderEncoderStringSize < sHeaderCacheEncoderVersion.size() + 1) + { + // For simplicity we use predefined size of header, so if version string + // doesn't fit, either getEngineInfo() returned malformed string or + // sHeaderEncoderStringSize need to be increased. + // Also take into accout that c_str() returns additional null character + LL_ERRS() << "Version string doesn't fit in header" << LL_ENDL; + } + + mHeaderEntriesInfo.mVersion = sHeaderCacheVersion; + mHeaderEntriesInfo.mAdressSize = sHeaderCacheAddressSize; + strcpy(mHeaderEntriesInfo.mEncoderVersion, sHeaderCacheEncoderVersion.c_str()); + mHeaderEntriesInfo.mEntries = 0; +} + void LLTextureCache::writeEntriesHeader() { llassert_always(mHeaderAPRFile == NULL); @@ -1444,10 +1469,13 @@ void LLTextureCache::readHeaderCache() readEntriesHeader(); - if (mHeaderEntriesInfo.mVersion != sHeaderCacheVersion) + if (mHeaderEntriesInfo.mVersion != sHeaderCacheVersion + || mHeaderEntriesInfo.mAdressSize != sHeaderCacheAddressSize + || strcmp(mHeaderEntriesInfo.mEncoderVersion, sHeaderCacheEncoderVersion.c_str()) != 0) { if (!mReadOnly) { + LL_INFOS() << "Texture Cache version mismatch, Purging." << LL_ENDL; purgeAllTextures(false); } } @@ -1612,13 +1640,17 @@ void LLTextureCache::purgeAllTextures(bool purge_directories) } } // Only delete folder if it actually exist - //if (purge_directories) - if (purge_directories && LLFile::isdir(mTexturesDirName)) - // + if (LLFile::isdir(mTexturesDirName)) + { + // + gDirUtilp->deleteFilesInDir(mTexturesDirName, mask); // headers, fast cache + if (purge_directories) { - gDirUtilp->deleteFilesInDir(mTexturesDirName, mask); LLFile::rmdir(mTexturesDirName); } + // Only delete folder if it actually exist + } + // } } mHeaderIDMap.clear(); @@ -1629,8 +1661,7 @@ void LLTextureCache::purgeAllTextures(bool purge_directories) mUpdatedEntryMap.clear(); // Info with 0 entries - mHeaderEntriesInfo.mVersion = sHeaderCacheVersion; - mHeaderEntriesInfo.mEntries = 0; + setEntriesHeader(); writeEntriesHeader(); LL_INFOS() << "The entire texture cache is cleared." << LL_ENDL ; @@ -1998,15 +2029,13 @@ bool LLTextureCache::writeToFastCache(S32 id, LLPointer raw, S32 dis if(w * h *c > 0) //valid { //make a duplicate to keep the original raw image untouched. - raw = raw->duplicate(); + raw = raw->scaled(w, h); if (raw->isBufferInvalid()) { LL_WARNS() << "Invalid image duplicate buffer" << LL_ENDL; return false; } - raw->scale(w, h) ; - discardlevel += i ; } } diff --git a/indra/newview/lltexturecache.h b/indra/newview/lltexturecache.h index cfb792b593..aa7f3031fc 100644 --- a/indra/newview/lltexturecache.h +++ b/indra/newview/lltexturecache.h @@ -46,10 +46,13 @@ class LLTextureCache : public LLWorkerThread private: // Entries + static const U32 sHeaderEncoderStringSize = 32; struct EntriesInfo { - EntriesInfo() : mVersion(0.f), mEntries(0) {} + EntriesInfo() : mVersion(0.f), mAdressSize(0), mEntries(0) { memset(mEncoderVersion, 0, sHeaderEncoderStringSize); } F32 mVersion; + U32 mAdressSize; + char mEncoderVersion[sHeaderEncoderStringSize]; U32 mEntries; }; struct Entry @@ -156,6 +159,7 @@ private: LLAPRFile* openHeaderEntriesFile(bool readonly, S32 offset); void closeHeaderEntriesFile(); void readEntriesHeader(); + void setEntriesHeader(); void writeEntriesHeader(); S32 openAndReadEntry(const LLUUID& id, Entry& entry, bool create); bool updateEntry(S32& idx, Entry& entry, S32 new_image_size, S32 new_body_size); @@ -226,6 +230,8 @@ private: // Statics static F32 sHeaderCacheVersion; + static U32 sHeaderCacheAddressSize; + static std::string sHeaderCacheEncoderVersion; static U32 sCacheMaxEntries; static S64 sCacheMaxTexturesSize; }; diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index ba6d701e62..f44c3da152 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -2580,7 +2580,7 @@ LLTextureFetch::LLTextureFetch(LLTextureCache* cache, LLImageDecodeThread* image mTextureInfoMainThread(false) { mMaxBandwidth = gSavedSettings.getF32("ThrottleBandwidthKBPS"); - mTextureInfo.setUpLogging(gSavedSettings.getBOOL("LogTextureDownloadsToViewerLog"), gSavedSettings.getBOOL("LogTextureDownloadsToSimulator"), U32Bytes(gSavedSettings.getU32("TextureLoggingThreshold"))); + mTextureInfo.setLogging(true); LLAppCoreHttp & app_core_http(LLAppViewer::instance()->getAppCoreHttp()); mHttpRequest = new LLCore::HttpRequest; diff --git a/indra/newview/lltextureinfo.cpp b/indra/newview/lltextureinfo.cpp index 473d8ce709..e79bb62a52 100644 --- a/indra/newview/lltextureinfo.cpp +++ b/indra/newview/lltextureinfo.cpp @@ -26,10 +26,19 @@ #include "llviewerprecompiledheaders.h" +#include "llagent.h" +#include "llmeshrepository.h" +#include "llsdutil.h" #include "lltextureinfo.h" +#include "lltexturecache.h" +#include "lltexturefetch.h" #include "lltexturestats.h" -#include "llviewercontrol.h" #include "lltrace.h" +#include "llviewercontrol.h" +#include "llviewerregion.h" +#include "llviewerstats.h" +#include "llvocache.h" +#include "llworld.h" static LLTrace::CountStatHandle sTextureDownloadsStarted("texture_downloads_started", "number of texture downloads initiated"); static LLTrace::CountStatHandle sTextureDownloadsCompleted("texture_downloads_completed", "number of texture downloads completed"); @@ -37,10 +46,8 @@ static LLTrace::CountStatHandle sTextureDataDownloaded("texture_data_ static LLTrace::CountStatHandle sTexureDownloadTime("texture_download_time", "amount of time spent fetching textures"); LLTextureInfo::LLTextureInfo(bool postponeStartRecoreder) : - mLogTextureDownloadsToViewerLog(false), - mLogTextureDownloadsToSimulator(false), - mTextureDownloadProtocol("NONE"), - mTextureLogThreshold(LLUnits::Kilobytes::fromValue(100)) + mLoggingEnabled(false), + mTextureDownloadProtocol("NONE") { if (!postponeStartRecoreder) { @@ -48,11 +55,9 @@ LLTextureInfo::LLTextureInfo(bool postponeStartRecoreder) : } } -void LLTextureInfo::setUpLogging(bool writeToViewerLog, bool sendToSim, U32Bytes textureLogThreshold) +void LLTextureInfo::setLogging(bool log_info) { - mLogTextureDownloadsToViewerLog = writeToViewerLog; - mLogTextureDownloadsToSimulator = sendToSim; - mTextureLogThreshold = U32Bytes(textureLogThreshold); + mLoggingEnabled = log_info; } LLTextureInfo::~LLTextureInfo() @@ -147,36 +152,80 @@ void LLTextureInfo::setRequestCompleteTimeAndLog(const LLUUID& id, U64Microsecon break; } - if (mLogTextureDownloadsToViewerLog) + if (mLoggingEnabled) { - LL_INFOS() << "texture=" << id - << " start=" << details.mStartTime - << " end=" << details.mCompleteTime - << " size=" << details.mSize - << " offset=" << details.mOffset - << " length=" << U32Milliseconds(details.mCompleteTime - details.mStartTime) - << " protocol=" << protocol - << LL_ENDL; - } + static LLCachedControl log_to_viewer_log(gSavedSettings, "LogTextureDownloadsToViewerLog", false); + static LLCachedControl log_to_simulator(gSavedSettings, "LogTextureDownloadsToSimulator", false); + static LLCachedControl texture_log_threshold(gSavedSettings, "TextureLoggingThreshold", 1); - if(mLogTextureDownloadsToSimulator) - { - add(sTextureDataDownloaded, details.mSize); - add(sTexureDownloadTime, details.mCompleteTime - details.mStartTime); - add(sTextureDownloadsCompleted, 1); - mTextureDownloadProtocol = protocol; - if (mRecording.getSum(sTextureDataDownloaded) >= mTextureLogThreshold) + if (log_to_viewer_log) { - LLSD texture_data; - std::stringstream startTime; - startTime << mCurrentStatsBundleStartTime; - texture_data["start_time"] = startTime.str(); - std::stringstream endTime; - endTime << completeTime; - texture_data["end_time"] = endTime.str(); - texture_data["averages"] = getAverages(); - send_texture_stats_to_sim(texture_data); - resetTextureStatistics(); + LL_INFOS() << "texture=" << id + << " start=" << details.mStartTime + << " end=" << details.mCompleteTime + << " size=" << details.mSize + << " offset=" << details.mOffset + << " length=" << U32Milliseconds(details.mCompleteTime - details.mStartTime) + << " protocol=" << protocol + << LL_ENDL; + } + + if(log_to_simulator) + { + add(sTextureDataDownloaded, details.mSize); + add(sTexureDownloadTime, details.mCompleteTime - details.mStartTime); + add(sTextureDownloadsCompleted, 1); + mTextureDownloadProtocol = protocol; + if (mRecording.getSum(sTextureDataDownloaded) >= U32Bytes(texture_log_threshold)) + { + LLSD texture_data; + std::stringstream startTime; + startTime << mCurrentStatsBundleStartTime; + texture_data["start_time"] = startTime.str(); + std::stringstream endTime; + endTime << completeTime; + texture_data["end_time"] = endTime.str(); + texture_data["averages"] = getAverages(); + + // Texture cache + LLSD texture_cache; + U32 cache_read = 0, cache_write = 0, res_wait = 0; + F64 cache_hit_rate = 0; + LLAppViewer::getTextureFetch()->getStateStats(&cache_read, &cache_write, &res_wait); + if (cache_read > 0 || cache_write > 0) + { + cache_hit_rate = cache_read / (cache_read + cache_write); + } + texture_cache["cache_read"] = LLSD::Integer(cache_read); + texture_cache["cache_write"] = LLSD::Integer(cache_write); + texture_cache["hit_rate"] = LLSD::Real(cache_hit_rate); + texture_cache["entries"] = LLSD::Integer(LLAppViewer::getTextureCache()->getEntries()); + texture_cache["space_max"] = ll_sd_from_U64((U64)LLAppViewer::getTextureCache()->getMaxUsage().value()); // bytes + texture_cache["space_used"] = ll_sd_from_U64((U64)LLAppViewer::getTextureCache()->getUsage().value()); // bytes + texture_data["texture_cache"] = texture_cache; + + // VO and mesh cache + LLSD object_cache; + object_cache["vo_entries_max"] = LLSD::Integer(LLVOCache::getInstance()->getCacheEntriesMax()); + object_cache["vo_entries_curent"] = LLSD::Integer(LLVOCache::getInstance()->getCacheEntries()); + object_cache["vo_active_entries"] = LLSD::Integer(LLWorld::getInstance()->getNumOfActiveCachedObjects()); + U64 region_hit_count = gAgent.getRegion() != NULL ? gAgent.getRegion()->getRegionCacheHitCount() : 0; + U64 region_miss_count = gAgent.getRegion() != NULL ? gAgent.getRegion()->getRegionCacheMissCount() : 0; + F64 region_vocache_hit_rate = 0; + if (region_hit_count > 0 || region_miss_count > 0) + { + region_vocache_hit_rate = region_hit_count / (region_hit_count + region_miss_count); + } + object_cache["vo_region_hitcount"] = ll_sd_from_U64(region_hit_count); + object_cache["vo_region_misscount"] = ll_sd_from_U64(region_miss_count); + object_cache["vo_region_hitrate"] = LLSD::Real(region_vocache_hit_rate); + object_cache["mesh_reads"] = LLSD::Integer(LLMeshRepository::sCacheReads); + object_cache["mesh_writes"] = LLSD::Integer(LLMeshRepository::sCacheWrites); + texture_data["object_cache"] = object_cache; + + send_texture_stats_to_sim(texture_data); + resetTextureStatistics(); + } } } diff --git a/indra/newview/lltextureinfo.h b/indra/newview/lltextureinfo.h index 03721bdd73..46378eb7f8 100644 --- a/indra/newview/lltextureinfo.h +++ b/indra/newview/lltextureinfo.h @@ -38,7 +38,7 @@ public: LLTextureInfo(bool postponeStartRecoreder = true); ~LLTextureInfo(); - void setUpLogging(bool writeToViewerLog, bool sendToSim, U32Bytes textureLogThreshold); + void setLogging(bool log_info); bool has(const LLUUID& id); void setRequestStartTime(const LLUUID& id, U64 startTime); void setRequestSize(const LLUUID& id, U32 size); @@ -61,12 +61,11 @@ private: std::map mTextures; LLSD mAverages; - bool mLogTextureDownloadsToViewerLog, - mLogTextureDownloadsToSimulator; + bool mLoggingEnabled; std::string mTextureDownloadProtocol; - U32Bytes mTextureLogThreshold; U64Microseconds mCurrentStatsBundleStartTime; LLTrace::Recording mRecording; + }; #endif // LL_LLTEXTUREINFO_H diff --git a/indra/newview/lltexturestats.cpp b/indra/newview/lltexturestats.cpp index 8ded148e17..b55b4d9ca4 100644 --- a/indra/newview/lltexturestats.cpp +++ b/indra/newview/lltexturestats.cpp @@ -30,6 +30,7 @@ #include "llagent.h" #include "lltexturefetch.h" #include "lltexturestats.h" +#include "llversioninfo.h" #include "llviewerregion.h" #include "llcorehttputil.h" @@ -45,6 +46,8 @@ void send_texture_stats_to_sim(const LLSD &texture_stats) LLUUID agent_id = gAgent.getID(); texture_stats_report["agent_id"] = agent_id; texture_stats_report["region_id"] = gAgent.getRegion()->getRegionID(); + texture_stats_report["viewer_channel"] = LLVersionInfo::getChannel(); + texture_stats_report["viewer_version"] = LLVersionInfo::getVersion(); texture_stats_report["stats_data"] = texture_stats; std::string texture_cap_url = gAgent.getRegion()->getCapability("TextureStats"); diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 77fc41467e..a992662851 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -526,7 +526,8 @@ void LLToolPie::walkToClickedLocation() mAutoPilotDestination->setColor(LLColor4U(170, 210, 190)); mAutoPilotDestination->setDuration(3.f); - handle_go_to(); + LLVector3d pos = LLToolPie::getInstance()->getPick().mPosGlobal; + gAgent.startAutoPilotGlobal(pos, std::string(), NULL, NULL, NULL, 0.f, 0.03f, FALSE); } // When we get object properties after left-clicking on an object diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 4c4c84370e..96dd8239ee 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -1780,67 +1780,64 @@ void purge_descendents_of(const LLUUID& id, LLPointer cb) LLPointer cat = gInventory.getCategory(id); if (cat.notNull()) { - if (LLClipboard::instance().hasContents() && LLClipboard::instance().isCutMode()) + if (LLClipboard::instance().hasContents()) { - // Something on the clipboard is in "cut mode" and needs to be preserved - LL_DEBUGS(LOG_INV) << "purge_descendents_of clipboard case " << cat->getName() - << " iterate and purge non hidden items" << LL_ENDL; - LLInventoryModel::cat_array_t* categories; - LLInventoryModel::item_array_t* items; - // Get the list of direct descendants in tha categoy passed as argument - gInventory.getDirectDescendentsOf(id, categories, items); - std::vector list_uuids; - // Make a unique list with all the UUIDs of the direct descendants (items and categories are not treated differently) - // Note: we need to do that shallow copy as purging things will invalidate the categories or items lists - for (LLInventoryModel::cat_array_t::const_iterator it = categories->begin(); it != categories->end(); ++it) + // Remove items from clipboard or it will remain active even if there is nothing to paste/copy + LLInventoryModel::cat_array_t categories; + LLInventoryModel::item_array_t items; + gInventory.collectDescendents(id, categories, items, TRUE); + + for (LLInventoryModel::cat_array_t::const_iterator it = categories.begin(); it != categories.end(); ++it) { - list_uuids.push_back((*it)->getUUID()); - } - for (LLInventoryModel::item_array_t::const_iterator it = items->begin(); it != items->end(); ++it) - { - list_uuids.push_back((*it)->getUUID()); - } - // Iterate through the list and only purge the UUIDs that are not on the clipboard - for (std::vector::const_iterator it = list_uuids.begin(); it != list_uuids.end(); ++it) - { - if (!LLClipboard::instance().isOnClipboard(*it)) + if (LLClipboard::instance().isOnClipboard((*it)->getUUID())) { - remove_inventory_object(*it, NULL); + // No sense in removing single items, partial 'paste' will result in confusion only + LLClipboard::instance().reset(); + break; + } + } + if (LLClipboard::instance().hasContents()) + { + for (LLInventoryModel::item_array_t::const_iterator it = items.begin(); it != items.end(); ++it) + { + if (LLClipboard::instance().isOnClipboard((*it)->getUUID())) + { + LLClipboard::instance().reset(); + break; + } } } } - else + + if (AISAPI::isAvailable()) { - if (AISAPI::isAvailable()) + if (cat->getVersion() == LLViewerInventoryCategory::VERSION_UNKNOWN) { - if (cat->getVersion() == LLViewerInventoryCategory::VERSION_UNKNOWN) - { - LL_WARNS() << "Purging not fetched folder: " << cat->getName() << LL_ENDL; - } - AISAPI::completion_t cr = (cb) ? boost::bind(&doInventoryCb, cb, _1) : AISAPI::completion_t(); - AISAPI::PurgeDescendents(id, cr); + LL_WARNS() << "Purging not fetched folder: " << cat->getName() << LL_ENDL; } - else // no cap + AISAPI::completion_t cr = (cb) ? boost::bind(&doInventoryCb, cb, _1) : AISAPI::completion_t(); + AISAPI::PurgeDescendents(id, cr); + } + else // no cap + { + // Fast purge + LL_DEBUGS(LOG_INV) << "purge_descendents_of fast case " << cat->getName() << LL_ENDL; + + // send it upstream + LLMessageSystem* msg = gMessageSystem; + msg->newMessage("PurgeInventoryDescendents"); + msg->nextBlock("AgentData"); + msg->addUUID("AgentID", gAgent.getID()); + msg->addUUID("SessionID", gAgent.getSessionID()); + msg->nextBlock("InventoryData"); + msg->addUUID("FolderID", id); + gAgent.sendReliableMessage(); + + // Update model immediately because there is no callback mechanism. + gInventory.onDescendentsPurgedFromServer(id); + if (cb) { - // Fast purge - LL_DEBUGS(LOG_INV) << "purge_descendents_of fast case " << cat->getName() << LL_ENDL; - - // send it upstream - LLMessageSystem* msg = gMessageSystem; - msg->newMessage("PurgeInventoryDescendents"); - msg->nextBlock("AgentData"); - msg->addUUID("AgentID", gAgent.getID()); - msg->addUUID("SessionID", gAgent.getSessionID()); - msg->nextBlock("InventoryData"); - msg->addUUID("FolderID", id); - gAgent.sendReliableMessage(); - - // Update model immediately because there is no callback mechanism. - gInventory.onDescendentsPurgedFromServer(id); - if (cb) - { - cb->fire(id); - } + cb->fire(id); } } } diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index f5d077c039..ffc3564b04 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -759,6 +759,7 @@ class LLAdvancedDumpInfoToConsole : public view_listener_t { bool handleEvent(const LLSD& userdata) { + gDebugView->mDebugConsolep->setVisible(TRUE); std::string info_type = userdata.asString(); if ("region" == info_type) { @@ -10081,7 +10082,7 @@ void handle_report_bug(const LLSD& param) LLStringUtil::format_map_t replace; // FIRE-14001: JIRA report is being cut off when using Help -> Report Bug - //replace["[ENVIRONMENT]"] = LLURI::escape(LLAppViewer::instance()->getViewerInfoString()); + //replace["[ENVIRONMENT]"] = LLURI::escape(LLAppViewer::instance()->getShortViewerInfoString()); LLSD sysinfo = FSData::getSystemInfo(); replace["[ENVIRONMENT]"] = LLURI::escape(sysinfo["Part1"].asString().substr(1) + sysinfo["Part2"].asString().substr(1)); // diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index bd7dafd9f5..3651925976 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -1100,7 +1100,7 @@ void upload_new_resource( // uploadInfo->setTransactionId(tid); - std::string url = gAgent.getRegion()->getCapability("NewFileAgentInventory"); + std::string url = gAgent.getRegionCapability("NewFileAgentInventory"); if ( !url.empty() ) { diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index ffe9832ca5..3b0a458ca9 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -4531,7 +4531,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) LLAvatarName av_name; if (LLAvatarNameCache::get(from_id, &av_name)) { - chat.mFromName = av_name.getDisplayName(); + chat.mFromName = av_name.getCompleteName(); } else { @@ -8857,14 +8857,10 @@ void process_teleport_failed(LLMessageSystem *msg, void**) // Get the message ID msg->getStringFast(_PREHASH_AlertInfo, _PREHASH_Message, message_id); big_reason = LLAgent::sTeleportErrorMessages[message_id]; - if ( big_reason.size() > 0 ) - { // Substitute verbose reason from the local map - args["REASON"] = big_reason; - } - else - { // Nothing found in the map - use what the server returned in the original message block + if ( big_reason.size() <= 0 ) + { + // Nothing found in the map - use what the server returned in the original message block msg->getStringFast(_PREHASH_Info, _PREHASH_Reason, big_reason); - args["REASON"] = big_reason; } LLSD llsd_block; @@ -8879,6 +8875,16 @@ void process_teleport_failed(LLMessageSystem *msg, void**) } else { + if(llsd_block.has("REGION_NAME")) + { + std::string region_name = llsd_block["REGION_NAME"].asString(); + if(!region_name.empty()) + { + LLStringUtil::format_map_t name_args; + name_args["[REGION_NAME]"] = region_name; + LLStringUtil::format(big_reason, name_args); + } + } // change notification name in this special case if (handle_teleport_access_blocked(llsd_block, message_id, args["REASON"])) { @@ -8890,7 +8896,7 @@ void process_teleport_failed(LLMessageSystem *msg, void**) } } } - + args["REASON"] = big_reason; } else { // Extra message payload not found - use what the simulator sent diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index a5efa82e9e..8271f12eeb 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -6321,7 +6321,7 @@ void LLViewerObject::resetChildrenRotationAndPosition(const std::vectorisSelected() && childp->mDrawable.notNull()) { if (childp->getPCode() != LL_PCODE_LEGACY_AVATAR) @@ -6360,14 +6361,16 @@ void LLViewerObject::resetChildrenPosition(const LLVector3& offset, BOOL simplif } else //avatar { - LLVector3 reset_pos = ((LLVOAvatar*)childp)->mDrawable->mXform.getPosition() + child_offset ; + if(!skip_avatar_child) + { + LLVector3 reset_pos = ((LLVOAvatar*)childp)->mDrawable->mXform.getPosition() + child_offset ; - ((LLVOAvatar*)childp)->mDrawable->mXform.setPosition(reset_pos); - ((LLVOAvatar*)childp)->mDrawable->getVObj()->setPosition(reset_pos); - - LLManip::rebuild(childp); - } - } + ((LLVOAvatar*)childp)->mDrawable->mXform.setPosition(reset_pos); + ((LLVOAvatar*)childp)->mDrawable->getVObj()->setPosition(reset_pos); + LLManip::rebuild(childp); + } + } + } } return ; diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index ba14df6bf8..51c6e06c11 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -589,7 +589,7 @@ public: public: //counter-translation - void resetChildrenPosition(const LLVector3& offset, BOOL simplified = FALSE) ; + void resetChildrenPosition(const LLVector3& offset, BOOL simplified = FALSE, BOOL skip_avatar_child = FALSE) ; //counter-rotation void resetChildrenRotationAndPosition(const std::vector& rotations, const std::vector& positions) ; diff --git a/indra/newview/llviewerparcelmedia.cpp b/indra/newview/llviewerparcelmedia.cpp index 7863b4e07b..3fecc67471 100644 --- a/indra/newview/llviewerparcelmedia.cpp +++ b/indra/newview/llviewerparcelmedia.cpp @@ -588,7 +588,7 @@ void LLViewerParcelMedia::processParcelMediaUpdate( LLMessageSystem *msg, void * // *TODO: I can not find any active code where this method is called... void LLViewerParcelMedia::sendMediaNavigateMessage(const std::string& url) { - std::string region_url = gAgent.getRegion()->getCapability("ParcelNavigateMedia"); + std::string region_url = gAgent.getRegionCapability("ParcelNavigateMedia"); if (!region_url.empty()) { // send navigate event to sim for link sharing diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 979c358ede..245655af13 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -546,6 +546,8 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, mLastVisitedEntry(NULL), mInvisibilityCheckHistory(-1), mPaused(FALSE), + mRegionCacheHitCount(0), + mRegionCacheMissCount(0), // Aurora Sim mWidth(region_width_meters), mWidthScaleFactor(region_width_meters / REGION_WIDTH_METERS) // FIRE-19563: Scaling for OpenSim VarRegions @@ -2627,6 +2629,7 @@ LLVOCacheEntry* LLViewerRegion::getCacheEntry(U32 local_id, bool valid) void LLViewerRegion::addCacheMiss(U32 id, LLViewerRegion::eCacheMissType miss_type) { + mRegionCacheMissCount++; #if 0 mCacheMissList.insert(CacheMissItem(id, miss_type)); #else @@ -2678,6 +2681,7 @@ bool LLViewerRegion::probeCache(U32 local_id, U32 crc, U32 flags, U8 &cache_miss if (entry->getCRC() == crc) { // Record a hit + mRegionCacheHitCount++; entry->recordHit(); cache_miss_type = CACHE_MISS_TYPE_NONE; entry->setUpdateFlags(flags); diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index 1dbf2b1855..86f97c569f 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -363,6 +363,8 @@ public: LLVOCacheEntry* getCacheEntryForOctree(U32 local_id); LLVOCacheEntry* getCacheEntry(U32 local_id, bool valid = true); bool probeCache(U32 local_id, U32 crc, U32 flags, U8 &cache_miss_type); + U64 getRegionCacheHitCount() { return mRegionCacheHitCount; } + U64 getRegionCacheMissCount() { return mRegionCacheMissCount; } void requestCacheMisses(); void addCacheMissFull(const U32 local_id); //update object cache if the object receives a full-update or terse update @@ -574,7 +576,9 @@ private: typedef std::list cache_miss_list_t; }; CacheMissItem::cache_miss_list_t mCacheMissList; - + U64 mRegionCacheHitCount; + U64 mRegionCacheMissCount; + caps_received_signal_t mCapabilitiesReceivedSignal; caps_received_signal_t mSimulatorFeaturesReceivedSignal; diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 9e90091af7..e0ffc7b9b5 100644 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -501,7 +501,7 @@ void send_stats() LLSD &system = body["system"]; system["ram"] = (S32) gSysMemory.getPhysicalMemoryKB().value(); - system["os"] = LLAppViewer::instance()->getOSInfo().getOSStringSimple(); + system["os"] = LLOSInfo::instance().getOSStringSimple(); system["cpu"] = gSysCPU.getCPUString(); unsigned char MACAddress[MAC_ADDRESS_BYTES]; LLUUID::getNodeID(MACAddress); @@ -599,9 +599,6 @@ void send_stats() misc["string_1"] = llformat("%d", window_size); misc["string_2"] = llformat("Texture Time: %.2f, Total Time: %.2f", gTextureTimer.getElapsedTimeF32(), gFrameTimeSeconds.value()); -// misc["int_1"] = LLSD::Integer(gSavedSettings.getU32("RenderQualityPerformance")); // Steve: 1.21 -// misc["int_2"] = LLSD::Integer(gFrameStalls); // Steve: 1.21 - F32 unbaked_time = LLVOAvatar::sUnbakedTime * 1000.f / gFrameTimeSeconds; misc["int_1"] = LLSD::Integer(unbaked_time); // Steve: 1.22 F32 grey_time = LLVOAvatar::sGreyTime * 1000.f / gFrameTimeSeconds; diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 9ce836ec23..c32b962856 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1471,8 +1471,7 @@ void LLViewerFetchedTexture::addToCreateTexture() { //make a duplicate in case somebody else is using this raw image - mRawImage = mRawImage->duplicate(); - mRawImage->scale(w >> i, h >> i) ; + mRawImage = mRawImage->scaled(w >> i, h >> i); } } } @@ -3058,8 +3057,7 @@ void LLViewerFetchedTexture::setCachedRawImage() { //make a duplicate in case somebody else is using this raw image - mRawImage = mRawImage->duplicate(); - mRawImage->scale(w >> i, h >> i) ; + mRawImage = mRawImage->scaled(w >> i, h >> i); } } mCachedRawImage = mRawImage; @@ -4111,7 +4109,7 @@ void LLTexturePipelineTester::updateStablizingTime() } //virtual -void LLTexturePipelineTester::compareTestSessions(std::ofstream* os) +void LLTexturePipelineTester::compareTestSessions(llofstream* os) { LLTexturePipelineTester::LLTextureTestSession* base_sessionp = dynamic_cast(mBaseSessionp); LLTexturePipelineTester::LLTextureTestSession* current_sessionp = dynamic_cast(mCurrentSessionp); diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 8de0f82233..20e9707b57 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -821,7 +821,7 @@ private: }; /*virtual*/ LLMetricPerformanceTesterWithSession::LLTestSession* loadTestSession(LLSD* log) ; - /*virtual*/ void compareTestSessions(std::ofstream* os) ; + /*virtual*/ void compareTestSessions(llofstream* os) ; }; #endif diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 8444728197..97d623644a 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -5504,6 +5504,15 @@ BOOL LLViewerWindow::mousePointOnLandGlobal(const S32 x, const S32 y, LLVector3d // Threaded filepickers void do_save_image(LLImageFormatted* image, const std::string& snapshot_dir, const std::string& base_name, const std::string& extension, boost::function callback) { + if (snapshot_dir.empty()) + { + if (callback) + { + callback(false); + } + return; + } + // Check if there is enough free space to save snapshot #ifdef LL_WINDOWS boost::filesystem::space_info b_space = boost::filesystem::space(utf8str_to_utf16str(snapshot_dir)); @@ -5632,6 +5641,11 @@ void LLViewerWindow::saveImageNumbered(LLImageFormatted *image, bool force_picke // LLViewerWindow::sSnapshotDir = gDirUtilp->getDirName(filepath); //} + //if(LLViewerWindow::sSnapshotDir.empty()) + //{ + // return FALSE; + //} + // Check if there is enough free space to save snapshot //#ifdef LL_WINDOWS // boost::filesystem::space_info b_space = boost::filesystem::space(utf8str_to_utf16str(sSnapshotDir)); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index ffacfbbdae..6dd71ac078 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3941,10 +3941,62 @@ void LLVOAvatar::updateDebugText() std::string output; if (motionp->getName().empty()) { + std::string name; + if (gAgent.isGodlikeWithoutAdminMenuFakery() || isSelf()) + { + name = motionp->getID().asString(); + LLVOAvatar::AnimSourceIterator anim_it = mAnimationSources.begin(); + for (; anim_it != mAnimationSources.end(); ++anim_it) + { + if (anim_it->second == motionp->getID()) + { + LLViewerObject* object = gObjectList.findObject(anim_it->first); + if (!object) + { + break; + } + if (object->isAvatar()) + { + if (mMotionController.mIsSelf) + { + // Searching inventory by asset id is really long + // so just mark as inventory + // Also item is likely to be named by LLPreviewAnim + name += "(inventory)"; + } + } + else + { + LLViewerInventoryItem* item = NULL; + if (!object->isInventoryDirty()) + { + item = object->getInventoryItemByAsset(motionp->getID()); + } + if (item) + { + name = item->getName(); + } + else if (object->isAttachment()) + { + name += "(" + getAttachmentItemName() + ")"; + } + else + { + // in-world object, name or content unknown + name += "(in-world)"; + } + } + break; + } + } + } + else + { + name = LLUUID::null.asString(); + } + output = llformat("%s - %d", - gAgent.isGodlikeWithoutAdminMenuFakery() ? - motionp->getID().asString().c_str() : - LLUUID::null.asString().c_str(), + name.c_str(), (U32)motionp->getPriority()); } else @@ -5849,10 +5901,6 @@ LLUUID LLVOAvatar::remapMotionID(const LLUUID& id) if (use_new_walk_run) result = ANIM_AGENT_FEMALE_RUN_NEW; } - else if (id == ANIM_AGENT_SIT) - { - result = ANIM_AGENT_SIT_FEMALE; - } } else { @@ -5884,7 +5932,7 @@ BOOL LLVOAvatar::startMotion(const LLUUID& id, F32 time_offset) LL_DEBUGS() << "motion requested " << id.asString() << " " << gAnimLibrary.animationName(id) << LL_ENDL; // Animation Overrider - //LLUUID remap_id = remapMotionID(id); + //LLUUID remap_id = remapMotionID(id, getSex()); LLUUID remap_id; if (isSelf()) { @@ -5944,7 +5992,7 @@ BOOL LLVOAvatar::stopMotion(const LLUUID& id, BOOL stop_immediate) remap_id = remapMotionID(id); } // Animation Overrider - + if (remap_id != id) { LL_DEBUGS() << "motion resultant " << remap_id.asString() << " " << gAnimLibrary.animationName(remap_id) << LL_ENDL; @@ -9252,7 +9300,7 @@ void dump_sequential_xml(const std::string outprefix, const LLSD& content) { std::string outfilename = get_sequential_numbered_file_name(outprefix,".xml"); std::string fullpath = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,outfilename); - std::ofstream ofs(fullpath.c_str(), std::ios_base::out); + llofstream ofs(fullpath.c_str(), std::ios_base::out); ofs << LLSDOStreamer(content, LLSDFormatter::OPTIONS_PRETTY); LL_DEBUGS("Avatar") << "results saved to: " << fullpath << LL_ENDL; } diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index d7ad69ff38..b6a508fb26 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -3323,7 +3323,7 @@ bool LLVOAvatarSelf::sendAppearanceMessage(LLMessageSystem *mesgsys) const //------------------------------------------------------------------------ void LLVOAvatarSelf::sendHoverHeight() const { - std::string url = gAgent.getRegion()->getCapability("AgentPreferences"); + std::string url = gAgent.getRegionCapability("AgentPreferences"); if (!url.empty()) { diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp index e135c3127a..cabf4e36cd 100644 --- a/indra/newview/llvocache.cpp +++ b/indra/newview/llvocache.cpp @@ -1100,11 +1100,21 @@ void LLVOCache::initCache(ELLPath location, U32 size, U32 cache_version) } mCacheSize = llclamp(size, MIN_ENTRIES_TO_PURGE, MAX_NUM_OBJECT_ENTRIES); mMetaInfo.mVersion = cache_version; + +#if defined(ADDRESS_SIZE) + U32 expected_address = ADDRESS_SIZE; +#else + U32 expected_address = 32; +#endif + mMetaInfo.mAddressSize = expected_address; + readCacheHeader(); - if(mMetaInfo.mVersion != cache_version) + if( mMetaInfo.mVersion != cache_version + || mMetaInfo.mAddressSize != expected_address) { mMetaInfo.mVersion = cache_version ; + mMetaInfo.mAddressSize = expected_address; if(mReadOnly) //disable cache { clearCacheInMemory(); diff --git a/indra/newview/llvocache.h b/indra/newview/llvocache.h index 7aabde1b2d..7d450c5231 100644 --- a/indra/newview/llvocache.h +++ b/indra/newview/llvocache.h @@ -237,9 +237,10 @@ private: struct HeaderMetaInfo { - HeaderMetaInfo() : mVersion(0){} + HeaderMetaInfo() : mVersion(0), mAddressSize(0) {} U32 mVersion; + U32 mAddressSize; }; struct header_entry_less @@ -267,6 +268,9 @@ public: void setReadOnly(bool read_only) {mReadOnly = read_only;} + U32 getCacheEntries() { return mNumEntries; } + U32 getCacheEntriesMax() { return mCacheSize; } + private: void setDirNames(ELLPath location); // determine the cache filename for the region from the region handle diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index d088271a3d..1d931a01d6 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -248,6 +248,7 @@ static bool sMuteListListener_listening = false; /////////////////////////////////////////////////////////////////////////////////////////////// static LLProcessPtr sGatewayPtr; +static LLEventStream sGatewayPump("VivoxDaemonPump", true); static bool isGatewayRunning() { @@ -258,6 +259,7 @@ static void killGateway() { if (sGatewayPtr) { + sGatewayPump.stopListening("VivoxDaemonPump"); sGatewayPtr->kill(); } } @@ -766,6 +768,19 @@ bool LLVivoxVoiceClient::endAndDisconnectSession() return true; } +bool LLVivoxVoiceClient::callbackEndDaemon(const LLSD& data) +{ + if (!LLAppViewer::isExiting()) + { + terminateAudioSession(false); + closeSocket(); + cleanUp(); + LLVoiceClient::getInstance()->setUserPTTState(false); + gAgent.setVoiceConnected(false); + } + sGatewayPump.stopListening("VivoxDaemonPump"); + return false; +} bool LLVivoxVoiceClient::startAndLaunchDaemon() { @@ -878,6 +893,9 @@ bool LLVivoxVoiceClient::startAndLaunchDaemon() # endif // VIVOX_HANDLE_ARGS } // + params.postend = sGatewayPump.getName(); + sGatewayPump.listen("VivoxDaemonPump", boost::bind(&LLVivoxVoiceClient::callbackEndDaemon, this, _1)); + sGatewayPtr = LLProcess::create(params); mDaemonHost = LLHost(gSavedSettings.getString("VivoxVoiceHost").c_str(), gSavedSettings.getU32("VivoxVoicePort")); @@ -974,15 +992,13 @@ bool LLVivoxVoiceClient::provisionVoiceAccount() llcoro::suspend(); } - LLViewerRegion *region = gAgent.getRegion(); - - while (!region->capabilitiesReceived()) + while (!gAgent.getRegion()->capabilitiesReceived()) { // *TODO* Pump a message for wake up. llcoro::suspend(); } - std::string url = region->getCapability("ProvisionVoiceAccountRequest"); + std::string url = gAgent.getRegionCapability("ProvisionVoiceAccountRequest"); LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h index 3683f25b41..5d1848786d 100644 --- a/indra/newview/llvoicevivox.h +++ b/indra/newview/llvoicevivox.h @@ -633,6 +633,7 @@ private: bool startAndConnectSession(); bool endAndDisconnectSession(); + bool callbackEndDaemon(const LLSD& data); bool startAndLaunchDaemon(); bool provisionVoiceAccount(); bool establishVoiceConnection(); diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp index 873ce456b4..9ac17ecc6a 100644 --- a/indra/newview/llweb.cpp +++ b/indra/newview/llweb.cpp @@ -192,7 +192,7 @@ std::string LLWeb::expandURLSubstitutions(const std::string &url, substitution["CHANNEL"] = LLVersionInfo::getChannel(); substitution["GRID"] = LLGridManager::getInstance()->getGridId(); substitution["GRID_LOWERCASE"] = utf8str_tolower(LLGridManager::getInstance()->getGridId()); - substitution["OS"] = LLAppViewer::instance()->getOSInfo().getOSStringSimple(); + substitution["OS"] = LLOSInfo::instance().getOSStringSimple(); substitution["SESSION_ID"] = gAgent.getSessionID(); substitution["FIRST_LOGIN"] = gAgent.isFirstLogin(); @@ -228,6 +228,22 @@ std::string LLWeb::expandURLSubstitutions(const std::string &url, substitution["SLURL_TYPE"] = "hop"; // #endif // + // find the grid + std::string current_grid = LLGridManager::getInstance()->getGridId(); + std::transform(current_grid.begin(), current_grid.end(), current_grid.begin(), ::tolower); + if (current_grid == "agni") + { + substitution["GRID"] = "secondlife.com"; + } + else if (current_grid == "damballah") + { + // Staging grid has its own naming scheme. + substitution["GRID"] = "secondlife-staging.com"; + } + else + { + substitution["GRID"] = llformat("%s.lindenlab.com", current_grid.c_str()); + } // expand all of the substitution strings and escape the url std::string expanded_url = url; LLStringUtil::format(expanded_url, substitution); diff --git a/indra/newview/llwlhandlers.cpp b/indra/newview/llwlhandlers.cpp index 87e8c3008e..ea65a0c6d9 100644 --- a/indra/newview/llwlhandlers.cpp +++ b/indra/newview/llwlhandlers.cpp @@ -74,7 +74,7 @@ void LLEnvironmentRequest::onRegionCapsReceived(const LLUUID& region_id) // static bool LLEnvironmentRequest::doRequest() { - std::string url = gAgent.getRegion()->getCapability("EnvironmentSettings"); + std::string url = gAgent.getRegionCapability("EnvironmentSettings"); if (url.empty()) { LL_INFOS("WindlightCaps") << "Skipping windlight setting request - we don't have this capability" << LL_ENDL; @@ -162,7 +162,7 @@ bool LLEnvironmentApply::initiateRequest(const LLSD& content) sLastUpdate = current; // Send update request. - std::string url = gAgent.getRegion()->getCapability("EnvironmentSettings"); + std::string url = gAgent.getRegionCapability("EnvironmentSettings"); if (url.empty()) { LL_WARNS("WindlightCaps") << "Applying windlight settings not supported" << LL_ENDL; diff --git a/indra/newview/skins/ansastorm/xui/en/panel_main_inventory.xml b/indra/newview/skins/ansastorm/xui/en/panel_main_inventory.xml index 753e0aeed0..c2ce27c058 100644 --- a/indra/newview/skins/ansastorm/xui/en/panel_main_inventory.xml +++ b/indra/newview/skins/ansastorm/xui/en/panel_main_inventory.xml @@ -327,52 +327,52 @@ name="inventory_search_by_name" label="By Name"> + function="Inventory.SearchType.Set" + parameter="search_by_name" /> + function="Inventory.SearchType.Check" + parameter="search_by_name" /> + function="Inventory.SearchType.Set" + parameter="search_by_creator" /> + function="Inventory.SearchType.Check" + parameter="search_by_creator" /> + function="Inventory.SearchType.Set" + parameter="search_by_description" /> + function="Inventory.SearchType.Check" + parameter="search_by_description" /> + function="Inventory.SearchType.Set" + parameter="search_by_UUID" /> + function="Inventory.SearchType.Check" + parameter="search_by_UUID" /> + function="Inventory.SearchType.Set" + parameter="search_by_all" /> + function="Inventory.SearchType.Check" + parameter="search_by_all" /> - - diff --git a/indra/newview/skins/default/xui/de/floater_avatar_picker.xml b/indra/newview/skins/default/xui/de/floater_avatar_picker.xml index 129c1450f8..3dc32c1079 100644 --- a/indra/newview/skins/default/xui/de/floater_avatar_picker.xml +++ b/indra/newview/skins/default/xui/de/floater_avatar_picker.xml @@ -3,6 +3,9 @@ „[TEXT]“ nicht gefunden + + Einwohner nicht gefunden + Keiner in der Nähe diff --git a/indra/newview/skins/default/xui/de/floater_inventory_view_finder.xml b/indra/newview/skins/default/xui/de/floater_inventory_view_finder.xml index eb2ad51f25..271164a255 100644 --- a/indra/newview/skins/default/xui/de/floater_inventory_view_finder.xml +++ b/indra/newview/skins/default/xui/de/floater_inventory_view_finder.xml @@ -16,6 +16,8 @@