diff --git a/.hgtags b/.hgtags index 04f3542d2c..eff9cc25d4 100755 --- a/.hgtags +++ b/.hgtags @@ -39,6 +39,7 @@ ab632018105ccfdf8a9e5ea1a8302badd58b686e Firestorm_5.0.1_Release 8888a131acad19c49fcff1ad2cf75c54c8a41bb8 Firestorm_6.0.1_Beta ba5e1592f3a79317a3ebac441ee5946a81b97fab Firestorm_6.0.2_Release 7b5a98fba31fa019bddb3ae900c6dd94604bc8be Firestorm_6.2.4_Release +381d04b870a59ef98cc442a5d4aeb6b38cfdbed7 Firestorm_6.3.2_Release bb38ff1a763738609e1b3cada6d15fa61e5e84b9 2.1.1-release 003dd9461bfa479049afcc34545ab3431b147c7c v2start 52d96ad3d39be29147c5b2181b3bb46af6164f0e alpha-3 @@ -595,3 +596,4 @@ ab2ec5c5423b277d23fd0511ce50c15123ff2e03 6.2.3-release 67297f9902857e357570c44722ad84de3aff974e 6.2.4-release 9777aec6dc4a30a24537297ac040861ce16b82ae 6.3.0-release ece699718f163921717bb95a6131e94af4c4138f 6.3.1-release +07f5d5bc9faebb45695853d40a9549773db816c0 6.3.2-release diff --git a/README_BUILD_FIRESTORM_LINUX.txt b/README_BUILD_FIRESTORM_LINUX.txt index 29d7a3220f..024a88e058 100755 --- a/README_BUILD_FIRESTORM_LINUX.txt +++ b/README_BUILD_FIRESTORM_LINUX.txt @@ -41,5 +41,3 @@ Logs: Output: Look for output in build-linux-x86_64/newview/Release - - diff --git a/README_BUILD_FIRESTORM_WINDOWS.txt b/README_BUILD_FIRESTORM_WINDOWS.txt index 9ff5e4fc1c..ae44a9e200 100755 --- a/README_BUILD_FIRESTORM_WINDOWS.txt +++ b/README_BUILD_FIRESTORM_WINDOWS.txt @@ -52,5 +52,3 @@ Logs: Output: Look for output in build-vc120-32/newview/Release for 32bit builds and build-vc120-64/newview/Release for 64bit - - \ No newline at end of file diff --git a/autobuild.xml b/autobuild.xml index 0658f33191..dc8e84ef7b 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -258,7 +258,7 @@ hash b760b4f3ab7794a897cf7f464d92e587 url - http://downloads.phoenixviewer.com/discord_rpc-3.4.0-windows-192510505.tar.bz2 + http://3p.firestormviewer.org/discord_rpc-3.4.0-windows-192510505.tar.bz2 name windows @@ -270,7 +270,7 @@ hash cefa1cdb50a85e36114ca89df66c0b5a url - http://downloads.phoenixviewer.com/discord_rpc-3.4.0-linux64-192540843.tar.bz2 + http://3p.firestormviewer.org/discord_rpc-3.4.0-linux64-192540843.tar.bz2 name linux64 @@ -282,7 +282,7 @@ hash 3bc297a0fa47094bb52d361f80186387 url - http://downloads.phoenixviewer.com/discord_rpc-3.4.0-darwin64-192522358.tar.bz2 + http://3p.firestormviewer.org/discord_rpc-3.4.0-darwin64-192522358.tar.bz2 name darwin64 @@ -1058,11 +1058,11 @@ archive hash - 0fcdc89c60271eda1fb37879b0c4a373 + d892f61440dd1888327d764b04158c88 hash_algorithm md5 url - file:///opt/firestorm/fmodstudio-2.00.03-darwin-192401637.tar.bz2 + file:///opt/firestorm/fmodstudio-2.00.05-darwin-192862021.tar.bz2 name darwin @@ -1072,11 +1072,11 @@ archive hash - 09f22b6a3ac41739073418bb6b8544d6 + 4bf66af7313c2a859bde553a563698e3 hash_algorithm md5 url - file:///opt/firestorm/fmodstudio-2.00.03-linux64-192401637.tar.bz2 + file:///opt/firestorm/fmodstudio-2.00.05-linux64-192862026.tar.bz2 name linux64 @@ -1086,11 +1086,11 @@ archive hash - a0d1821154e7ce5c418e3cdc2f26f3fc + c668bd6961489c9bd6f07f1203a9d6eb hash_algorithm md5 url - file:///c:/cygwin/opt/firestorm/fmodstudio-2.00.03-windows-192171947.tar.bz2 + file:///c:/cygwin/opt/firestorm/fmodstudio-2.00.05-windows-192861134.tar.bz2 name windows @@ -1100,18 +1100,18 @@ archive hash - b98d2da1ed02f8ba218de414a83d0edc + 2cf52c44f8943f69b91c950ae7ea356a hash_algorithm md5 url - file:///c:/cygwin/opt/firestorm/fmodstudio-2.00.03-windows64-192171948.tar.bz2 + file:///c:/cygwin/opt/firestorm/fmodstudio-2.00.05-windows64-192861136.tar.bz2 name windows64 version - 2.00.03 + 2.00.05 fmodex @@ -3512,9 +3512,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - aaf04f5ed1d28477781d976dc04871ee + c5ab9d9d7482e48cd76f4bf391900a8c url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/31904/266163/viewer_manager-2.0.524157-darwin64-524157.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/43369/385585/viewer_manager-2.0.531000-darwin64-531000.tar.bz2 name darwin64 @@ -3548,9 +3548,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 4604624f11b215b052f4a840f4da4bf8 + 6b10d7407686d9e12e63576256581e3e url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/31906/266177/viewer_manager-2.0.524157-windows-524157.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/43370/385592/viewer_manager-2.0.531000-windows-531000.tar.bz2 name windows @@ -3561,7 +3561,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors source_type hg version - 2.0.524157 + 2.0.531000 vlc-bin diff --git a/doc/contributions.txt b/doc/contributions.txt index 5df2bbc3b4..210bf54581 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -1456,6 +1456,7 @@ Tonya Souther STORM-1905 BUG-3875 BUG-3968 + OPEN-345 Torben Trautman TouchaHoney Perhaps TraductoresAnonimos Alter diff --git a/indra/cmake/Discord.cmake b/indra/cmake/Discord.cmake index b035123194..908f08612b 100644 --- a/indra/cmake/Discord.cmake +++ b/indra/cmake/Discord.cmake @@ -1,23 +1,17 @@ # -*- cmake -*- -if (DISCORD_API_KEY) - include(Prebuilt) - use_prebuilt_binary(discord-rpc) - set(DISCORD_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/discord-rpc) +include(Prebuilt) +use_prebuilt_binary(discord-rpc) +set(DISCORD_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/discord-rpc) - if (WINDOWS) - if (ADDRESS_SIZE EQUAL 32) - set(DISCORD_LIBRARY discord-rpc) - else () - set(DISCORD_LIBRARY discord-rpc_x64) - endif(ADDRESS_SIZE EQUAL 32) - elseif (LINUX) - set(DISCORD_LIBRARY discord-rpc) - elseif (DARWIN) - set(DISCORD_LIBRARY discord-rpc) - endif (WINDOWS) - - add_definitions( -DDISCORD_API_KEY=\"${DISCORD_API_KEY}\") - add_definitions( -DHAS_DISCORD ) - set(USE_DISCORD TRUE) -endif (DISCORD_API_KEY) +if (WINDOWS) +if (ADDRESS_SIZE EQUAL 32) + set(DISCORD_LIBRARY discord-rpc) +else () + set(DISCORD_LIBRARY discord-rpc_x64) +endif(ADDRESS_SIZE EQUAL 32) +elseif (LINUX) +set(DISCORD_LIBRARY discord-rpc) +elseif (DARWIN) +set(DISCORD_LIBRARY discord-rpc) +endif (WINDOWS) diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index ea98beedb6..68ce364e48 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -147,6 +147,9 @@ endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux") if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(DARWIN 1) + set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "") + message(STATUS "CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY = '${CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY}'") + string(REGEX MATCH "-mmacosx-version-min=([^ ]+)" scratch "$ENV{LL_BUILD}") set(CMAKE_OSX_DEPLOYMENT_TARGET "${CMAKE_MATCH_1}") message(STATUS "CMAKE_OSX_DEPLOYMENT_TARGET = '${CMAKE_OSX_DEPLOYMENT_TARGET}'") @@ -210,6 +213,9 @@ set(GRID agni CACHE STRING "Target Grid") set(FLICKR_API_KEY "daaabff93a967e0f37fa18863bb43b29") set(FLICKR_API_SECRET "846f0958020b553e") +# Discord client key. +set(DDISCORD_API_KEY "427641535253708801") + set(ENABLE_SIGNING OFF CACHE BOOL "Enable signing the viewer") set(SIGNING_IDENTITY "" CACHE STRING "Specifies the signing identity to use, if necessary.") diff --git a/indra/integration_tests/llui_libtest/llui_libtest.cpp b/indra/integration_tests/llui_libtest/llui_libtest.cpp index acf5816f48..d8209f0931 100644 --- a/indra/integration_tests/llui_libtest/llui_libtest.cpp +++ b/indra/integration_tests/llui_libtest/llui_libtest.cpp @@ -56,7 +56,7 @@ LLControlGroup gWarningSettings("Warnings"); // persists ignored dialogs/warning #include "llavatarname.h" // Stub for rlvGetAnonym -const std::string& rlvGetAnonym(const LLAvatarName& avName) +std::string rlvGetAnonym(const LLAvatarName& avName) { static std::string strAnonym = "A resident"; return strAnonym; diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h index 1a7a3fdb5a..be33d87749 100644 --- a/indra/llcommon/llfasttimer.h +++ b/indra/llcommon/llfasttimer.h @@ -205,14 +205,10 @@ private: friend BlockTimer timeThisBlock(BlockTimerStatHandle&); BlockTimer(BlockTimerStatHandle& timer); -#if !defined(MSC_VER) || MSC_VER < 1700 - // Visual Studio 2010 has a bug where capturing an object returned by value - // into a local reference requires access to the copy constructor at the call site. - // This appears to be fixed in 2012. -public: -#endif + // no-copy - BlockTimer(const BlockTimer& other) {}; + BlockTimer(const BlockTimer& other); + BlockTimer& operator=(const BlockTimer& other); private: U64 mStartTime; diff --git a/indra/llcommon/llmortician.cpp b/indra/llcommon/llmortician.cpp index 287f096eae..93c7d520f2 100644 --- a/indra/llcommon/llmortician.cpp +++ b/indra/llcommon/llmortician.cpp @@ -37,6 +37,42 @@ LLMortician::~LLMortician() sGraveyard.remove(this); } +U32 LLMortician::logClass(std::stringstream &str) +{ + U32 size = sGraveyard.size(); + str << "Mortician graveyard count: " << size; + str << " Zealous: " << (sDestroyImmediate ? "True" : "False"); + if (size == 0) + { + return size; + } + str << " Output:\n"; + std::list::iterator iter = sGraveyard.begin(); + std::list::iterator end = sGraveyard.end(); + while (iter!=end) + { + LLMortician* dead = *iter; + iter++; + // Be as detailed and safe as possible to figure out issues + str << "Pointer: " << dead; + if (dead) + { + try + { + str << " Is dead: " << (dead->isDead() ? "True" : "False"); + str << " Name: " << typeid(*dead).name(); + } + catch (...) + { + + } + } + str << "\n"; + } + str << "--------------------------------------------"; + return size; +} + void LLMortician::updateClass() { while (!sGraveyard.empty()) diff --git a/indra/llcommon/llmortician.h b/indra/llcommon/llmortician.h index 9517e2db5e..41cb49fab1 100644 --- a/indra/llcommon/llmortician.h +++ b/indra/llcommon/llmortician.h @@ -34,6 +34,8 @@ class LL_COMMON_API LLMortician { public: LLMortician() { mIsDead = FALSE; } + static U32 graveyardCount() { return sGraveyard.size(); }; + static U32 logClass(std::stringstream &str); static void updateClass(); virtual ~LLMortician(); void die(); diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index abad9eb7e1..33f03aed39 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -5293,22 +5293,15 @@ bool LLVolumeFace::cacheOptimize() // LLVCacheVertexData suddenly does point to unrelated vertices. It is an interesting fact that this is no problem for the // windows version. // - // To solve the issue with the pointer invalidation it would make sense to use a std::vector< U16 > for triangle indices, sort this - // using + // To solve the issue with the pointer invalidation it use a std::vector< U16 > for triangle indices, sort this using // std::sort( v.begin(), v.end(), [&triangle_data](U16 rhs, U16 lhs ){ return triangle_data[rhs].mScore > triangle_data[lhs].mScore; } // Then access all LLVCacheTriangleData> via triangle_data[ v[ idx ] ]. // - // This will help indeed with the destroyed triangles; but the result will still not be perfect and there are problems with alpha due to - // what looks like z order. - // - // It is peculiar that none of this happens when compiling with MSVC. - // Sadly for Linux it seems to be a decision between two evils - // - Disable cacheOptimize and have correct meshes but potentially a bit of less FPS. - // - Enable/fix cacheOptimize, potentially have a bit higher FPS but broken meshes. - // - // Having meshes correctly seems to be a bit of a lesser evil. Then do some wider testing on different systems to test for any other potential sideeffects. + // Unfortunately this is a bit of a messy interwoven change all of this method, alternative is to copy a Linux specific version. Which + // won't be that great either + // NB The change really should be safe for Winows too, in fact it is surprising Windows does not suffer fro the sae bug. Just cannot test + // the windows versions right now. -#ifndef LL_LINUX LLVCacheLRU cache; if (mNumVertices < 3) @@ -5343,6 +5336,13 @@ bool LLVolumeFace::cacheOptimize() triangle_data[tri_idx].mVertex[i%3] = &(vertex_data[idx]); } +// FIRE-23370/BUG-8801/MAIN-5060 +#ifdef LL_LINUX + std::vector< U32 > v; + for (U32 j = 0; j < triangle_data.size(); ++j) + v.push_back( j ); +#endif + /*F32 pre_acmr = 1.f; //measure cache misses from before rebuild { @@ -5374,14 +5374,28 @@ bool LLVolumeFace::cacheOptimize() } //sort triangle data by score +// FIRE-23370/BUG-8801/MAIN-5060 +#ifndef LL_LINUX std::sort(triangle_data.begin(), triangle_data.end()); - +#else + std::sort( v.begin(), v.end(), + [&triangle_data](U16 rhs, U16 lhs ) + { return triangle_data[rhs].mScore > triangle_data[lhs].mScore; } + ); +#endif + std::vector new_indices; LLVCacheTriangleData* tri; //prime pump by adding first triangle to cache; +// FIRE-23370/BUG-8801/MAIN-5060 +#ifndef LL_LINUX tri = &(triangle_data[0]); +#else + tri = &(triangle_data[v[0]]); +#endif + cache.addTriangle(tri); new_indices.push_back(tri->mVertex[0]->mIdx); new_indices.push_back(tri->mVertex[1]->mIdx); @@ -5398,11 +5412,21 @@ bool LLVolumeFace::cacheOptimize() breaks++; for (U32 j = 0; j < triangle_data.size(); ++j) { +// FIRE-23370/BUG-8801/MAIN-5060 +#ifndef LL_LINUX if (triangle_data[j].mActive) { tri = &(triangle_data[j]); break; } +#else + if (triangle_data[v[j]].mActive) + { + tri = &(triangle_data[v[j]]); + break; + } +#endif + } } @@ -5534,8 +5558,6 @@ bool LLVolumeFace::cacheOptimize() //std::string result = llformat("ACMR pre/post: %.3f/%.3f -- %d triangles %d breaks", pre_acmr, post_acmr, mNumIndices/3, breaks); //LL_INFOS() << result << LL_ENDL; -#endif // - return true; } diff --git a/indra/llui/lltransutil.cpp b/indra/llui/lltransutil.cpp index b1534bb5e4..5da722a72b 100644 --- a/indra/llui/lltransutil.cpp +++ b/indra/llui/lltransutil.cpp @@ -44,6 +44,7 @@ bool LLTransUtil::parseStrings(const std::string& xml_filename, const std::setdumpCurrentDirectories(LLError::LEVEL_WARN); LL_ERRS() << "Couldn't load string table " << xml_filename << ". Please reinstall viewer from https://secondlife.com/support/downloads/ and contact https://support.secondlife.com if issue persists after reinstall." << LL_ENDL; return false; } diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index 82f2a74830..25afe6eee5 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -929,7 +929,7 @@ std::string LLUrlEntryAgentUserName::getName(const LLAvatarName& avatar_name) // [RLVa:KB] - Checked: 2010-11-01 (RLVa-1.2.2a) | Added: RLVa-1.2.2a // Defined in rlvcommon.cpp - redirects to RlvStrings::getAnonym() since we can't really get to that class from here -extern const std::string& rlvGetAnonym(const LLAvatarName& avName); +extern std::string rlvGetAnonym(const LLAvatarName& avName); // // LLUrlEntryAgentRLVAnonymizedName Describes an RLV anonymized agent name Url, e.g., diff --git a/indra/llui/tests/llurlentry_stub.cpp b/indra/llui/tests/llurlentry_stub.cpp index 36aa316696..cdde80edd5 100755 --- a/indra/llui/tests/llurlentry_stub.cpp +++ b/indra/llui/tests/llurlentry_stub.cpp @@ -37,7 +37,7 @@ // [RLVa:KB] - Checked: 2010-11-12 (RLVa-1.2.2a) | Added: RLVa-1.2.2a // Stub for rlvGetAnonym -const std::string& rlvGetAnonym(const LLAvatarName& avName) +std::string rlvGetAnonym(const LLAvatarName& avName) { static std::string strAnonym = "A resident"; return strAnonym; diff --git a/indra/llvfs/lldir.cpp b/indra/llvfs/lldir.cpp index e90de09a6e..f302b67d35 100644 --- a/indra/llvfs/lldir.cpp +++ b/indra/llvfs/lldir.cpp @@ -1185,26 +1185,26 @@ bool LLDir::setSoundCacheDir(const std::string& path) } // -void LLDir::dumpCurrentDirectories() +void LLDir::dumpCurrentDirectories(LLError::ELevel level) { - LL_DEBUGS("AppInit","Directories") << "Current Directories:" << LL_ENDL; + LL_VLOGS(level, "AppInit","Directories") << "Current Directories:" << LL_ENDL; - LL_DEBUGS("AppInit","Directories") << " CurPath: " << getCurPath() << LL_ENDL; - LL_DEBUGS("AppInit","Directories") << " AppName: " << getAppName() << LL_ENDL; - LL_DEBUGS("AppInit","Directories") << " ExecutableFilename: " << getExecutableFilename() << LL_ENDL; - LL_DEBUGS("AppInit","Directories") << " ExecutableDir: " << getExecutableDir() << LL_ENDL; - LL_DEBUGS("AppInit","Directories") << " ExecutablePathAndName: " << getExecutablePathAndName() << LL_ENDL; - LL_DEBUGS("AppInit","Directories") << " WorkingDir: " << getWorkingDir() << LL_ENDL; - LL_DEBUGS("AppInit","Directories") << " AppRODataDir: " << getAppRODataDir() << LL_ENDL; - LL_DEBUGS("AppInit","Directories") << " OSUserDir: " << getOSUserDir() << LL_ENDL; - LL_DEBUGS("AppInit","Directories") << " OSUserAppDir: " << getOSUserAppDir() << LL_ENDL; - LL_DEBUGS("AppInit","Directories") << " LindenUserDir: " << getLindenUserDir() << LL_ENDL; - LL_DEBUGS("AppInit","Directories") << " TempDir: " << getTempDir() << LL_ENDL; - LL_DEBUGS("AppInit","Directories") << " CAFile: " << getCAFile() << LL_ENDL; - LL_DEBUGS("AppInit","Directories") << " SkinBaseDir: " << getSkinBaseDir() << LL_ENDL; - LL_DEBUGS("AppInit","Directories") << " SkinDir: " << getSkinDir() << LL_ENDL; + LL_VLOGS(level, "AppInit", "Directories") << " CurPath: " << getCurPath() << LL_ENDL; + LL_VLOGS(level, "AppInit", "Directories") << " AppName: " << getAppName() << LL_ENDL; + LL_VLOGS(level, "AppInit", "Directories") << " ExecutableFilename: " << getExecutableFilename() << LL_ENDL; + LL_VLOGS(level, "AppInit", "Directories") << " ExecutableDir: " << getExecutableDir() << LL_ENDL; + LL_VLOGS(level, "AppInit", "Directories") << " ExecutablePathAndName: " << getExecutablePathAndName() << LL_ENDL; + LL_VLOGS(level, "AppInit", "Directories") << " WorkingDir: " << getWorkingDir() << LL_ENDL; + LL_VLOGS(level, "AppInit", "Directories") << " AppRODataDir: " << getAppRODataDir() << LL_ENDL; + LL_VLOGS(level, "AppInit", "Directories") << " OSUserDir: " << getOSUserDir() << LL_ENDL; + LL_VLOGS(level, "AppInit", "Directories") << " OSUserAppDir: " << getOSUserAppDir() << LL_ENDL; + LL_VLOGS(level, "AppInit", "Directories") << " LindenUserDir: " << getLindenUserDir() << LL_ENDL; + LL_VLOGS(level, "AppInit", "Directories") << " TempDir: " << getTempDir() << LL_ENDL; + LL_VLOGS(level, "AppInit", "Directories") << " CAFile: " << getCAFile() << LL_ENDL; + LL_VLOGS(level, "AppInit", "Directories") << " SkinBaseDir: " << getSkinBaseDir() << LL_ENDL; + LL_VLOGS(level, "AppInit", "Directories") << " SkinDir: " << getSkinDir() << LL_ENDL; // [SL:KB] - Patch: Viewer-Skins | Checked: 2011-02-14 (Catznip-2.5) - LL_DEBUGS("AppInit","Directories") << " SkinThemeDir: " << getSkinThemeDir() << LL_ENDL; + LL_VLOGS(level, "AppInit", "Directories") << " SkinThemeDir: " << getSkinThemeDir() << LL_ENDL; // [/SL:KB] } diff --git a/indra/llvfs/lldir.h b/indra/llvfs/lldir.h index 37237f7f17..dda1f9082d 100644 --- a/indra/llvfs/lldir.h +++ b/indra/llvfs/lldir.h @@ -251,7 +251,7 @@ class LLDir virtual bool setSoundCacheDir(const std::string& path); // - virtual void dumpCurrentDirectories(); + virtual void dumpCurrentDirectories(LLError::ELevel level = LLError::LEVEL_DEBUG); // Utility routine std::string buildSLOSCacheDir() const; diff --git a/indra/llwindow/llappdelegate-objc.h b/indra/llwindow/llappdelegate-objc.h index b65aa14114..0b38647b4a 100644 --- a/indra/llwindow/llappdelegate-objc.h +++ b/indra/llwindow/llappdelegate-objc.h @@ -27,11 +27,6 @@ #import #import "llopenglview-objc.h" -// [Cinder] Override NSApplication to give us access to sendEvent -@interface LLNSApplication : NSApplication -@end -// [/Cinder] - @interface LLAppDelegate : NSObject { LLNSWindow *window; NSWindow *inputWindow; @@ -51,3 +46,6 @@ - (void) languageUpdated; - (bool) romanScript; @end + +@interface LLApplication : NSApplication +@end diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index 7956bf38c9..3a2430f6e3 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -519,17 +519,6 @@ attributedStringInfo getSegments(NSAttributedString *str) { [[self inputContext] handleEvent:theEvent]; } - - // OS X intentionally does not send us key-up information on cmd-key combinations. - // This behaviour is not a bug, and only applies to cmd-combinations (no others). - // Since SL assumes we receive those, we fake it here. - // Cinder Roxley's fix for FIRE-11648 - //if (mModifiers & NSCommandKeyMask && !mHasMarkedText) - //{ - // eventData.mKeyEvent = NativeKeyEventData::KEYUP; - // callKeyUp([theEvent keyCode], mModifiers); - //} - // } - (void)flagsChanged:(NSEvent *)theEvent @@ -837,7 +826,9 @@ attributedStringInfo getSegments(NSAttributedString *str) [super setMarkedText:aString selectedRange:selectedRange replacementRange:replacementRange]; if ([aString length] == 0) // this means Input Widow becomes empty { - [_window orderOut:_window]; // Close this to avoid empty Input Window + //[_window orderOut:_window]; // Close this to avoid empty Input Window + // Xcode 11 compile fix + [self.window orderOut:self.window]; // Close this to avoid empty Input Window } } @@ -861,7 +852,9 @@ attributedStringInfo getSegments(NSAttributedString *str) (mKeyPressed >= 0xF700 && mKeyPressed <= 0xF8FF)) { // this is case a) of above comment - [_window orderOut:_window]; // to avoid empty Input Window + // Xcode 11 compile fix + //[_window orderOut:_window]; // to avoid empty Input Window + [self.window orderOut:self.window]; // to avoid empty Input Window } } diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 9868718c27..5d0961c03d 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -77,7 +77,7 @@ BOOL check_for_card(const char* RENDERER, const char* bad_card) "\n" "If you own a supported card and continue to receive this message, try \n" "updating to the latest video card drivers. Otherwise contact the\n" - "Phoenix Viewer Support group in world, or visit www.phoenixviewer.com\n" + "Phoenix Viewer Support group in world, or visit www.firestormviewer.org\n" "for support.\n" "\n" "You can try to run Firestorm, but it will probably crash or run\n" diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 47f73f3fb2..584bda4f42 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1631,6 +1631,18 @@ configure_file( list(APPEND viewer_HEADER_FILES ${CMAKE_CURRENT_BINARY_DIR}/exoflickrkeys.h) # +# Discord rich presence + +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/fsdiscordkey.h.in + ${CMAKE_CURRENT_BINARY_DIR}/fsdiscordkey.h + @ONLY +) +list(APPEND viewer_HEADER_FILES ${CMAKE_CURRENT_BINARY_DIR}/fsdiscordkey.h) +LIST(APPEND viewer_HEADER_FILES fsfloaterdiscord.h fsdiscordconnect.h) +LIST(APPEND viewer_SOURCE_FILES fsfloaterdiscord.cpp fsdiscordconnect.cpp) +# + # Generate the version information header file. configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/fsversionvalues.h.in @@ -1687,13 +1699,6 @@ if (DARWIN) ) # [FS] -# Discord rich presence - if( USE_DISCORD ) - LIST(APPEND viewer_HEADER_FILES fsfloaterdiscord.h fsdiscordconnect.h) - LIST(APPEND viewer_SOURCE_FILES fsfloaterdiscord.cpp fsdiscordconnect.cpp) - endif() -# - find_library(AGL_LIBRARY AGL) find_library(APPKIT_LIBRARY AppKit) find_library(COCOA_LIBRARY Cocoa) @@ -1753,13 +1758,6 @@ if (LINUX) LIST(APPEND viewer_SOURCE_FILES desktopnotifierlinux.cpp growlmanager.cpp) # [FS] Growl support -# Discord rich presence - if( USE_DISCORD ) - LIST(APPEND viewer_HEADER_FILES fsfloaterdiscord.h fsdiscordconnect.h) - LIST(APPEND viewer_SOURCE_FILES fsfloaterdiscord.cpp fsdiscordconnect.cpp) - endif() -# - SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed") set(viewer_LIBRARIES @@ -1803,13 +1801,6 @@ if (WINDOWS) # [FS] ) -# Discord rich presence - if( USE_DISCORD ) - LIST(APPEND viewer_HEADER_FILES fsfloaterdiscord.h fsdiscordconnect.h) - LIST(APPEND viewer_SOURCE_FILES fsfloaterdiscord.cpp fsdiscordconnect.cpp) - endif() -# - # precompiled header configuration # llviewerprecompiledheaders.cpp generates # the .pch file. @@ -2452,9 +2443,7 @@ target_link_libraries(${VIEWER_BINARY_NAME} ${GROWL_LIBRARY} ) -if( USE_DISCORD ) - target_link_libraries(${VIEWER_BINARY_NAME} ${DISCORD_LIBRARY} ) -endif() +target_link_libraries(${VIEWER_BINARY_NAME} ${DISCORD_LIBRARY} ) if (BUGSPLAT_DB) target_link_libraries(${VIEWER_BINARY_NAME} @@ -2573,7 +2562,7 @@ if (DARWIN) set(MACOSX_BUNDLE_BUNDLE_VERSION "${VIEWER_SHORT_VERSION}${VIEWER_MACOSX_PHASE}${VIEWER_REVISION}") set(MACOSX_BUNDLE_COPYRIGHT "Copyright 2010-2019 The Phoenix Firestorm Project, Inc.") set(MACOSX_BUNDLE_NSMAIN_NIB_FILE "Firestorm.nib") - set(MACOSX_BUNDLE_NSPRINCIPAL_CLASS "LLNSApplication") + set(MACOSX_BUNDLE_NSPRINCIPAL_CLASS "LLApplication") # https://blog.kitware.com/upcoming-in-cmake-2-8-12-osx-rpath-support/ set(CMAKE_MACOSX_RPATH 1) diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt index 91e4a9f262..7849b73dc7 100644 --- a/indra/newview/VIEWER_VERSION.txt +++ b/indra/newview/VIEWER_VERSION.txt @@ -1 +1 @@ -6.3.2 +6.3.3 diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index fe20267d6a..3dcdc34e69 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -6733,7 +6733,7 @@ Type String Value - http://wiki.phoenixviewer.com/[TOPIC] + https://wiki.firestormviewer.org/[TOPIC] Backup 0 @@ -6746,7 +6746,7 @@ Type String Value - http://www.phoenixviewer.com/viewerfloater/howtofloater/index.html + https://wiki.firestormviewer.org/start#basic_functions Backup 0 @@ -18590,7 +18590,6 @@ Change of this parameter will affect the layout of buttons in notification toast script_floater world_map preferences - facebook flickr twitter diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index 92f6929fdc..2f9e2505de 100644 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -1238,7 +1238,7 @@ FSEnableDiscordIntegration Comment - If enabled, well allow Firestorm to connect to discord if open and share location data with. Default (false) + If enabled, will allow Firestorm to connect to discord if open and share location data with. Default (false) Persist 1 Type @@ -1268,5 +1268,16 @@ Value + FSShareNameToDiscord + + Comment + If enabled, will allow Firestorm to share avatar user and display name with discord. Default (false) + Persist + 1 + Type + Boolean + Value + 0 + diff --git a/indra/newview/fonts/fonts_liberation.xml b/indra/newview/fonts/fonts_liberation.xml index 4ea0da3c16..794d78cc25 100644 --- a/indra/newview/fonts/fonts_liberation.xml +++ b/indra/newview/fonts/fonts_liberation.xml @@ -15,8 +15,8 @@ nirmala.ttf tahoma.ttf Cambria.ttc - malgun.ttf - + malgun.ttf + ヒラギノ角ゴシック W3.ttc ヒラギノ角ゴ Pro W3.otf diff --git a/indra/newview/fsdiscordconnect.cpp b/indra/newview/fsdiscordconnect.cpp index d06d416b16..a4c8167ed4 100644 --- a/indra/newview/fsdiscordconnect.cpp +++ b/indra/newview/fsdiscordconnect.cpp @@ -48,9 +48,7 @@ #include "boost/algorithm/string/case_conv.hpp" -#ifndef DISCORD_API_KEY -#define DISCORD_API_KEY "" -#endif +#include "fsdiscordkey.h" boost::scoped_ptr FSDiscordConnect::sStateWatcher(new LLEventStream("DiscordConnectState")); boost::scoped_ptr FSDiscordConnect::sInfoWatcher(new LLEventStream("DiscordConnectInfo")); @@ -207,10 +205,11 @@ void FSDiscordConnect::updateRichPresence() DiscordRichPresence discordPresence; memset(&discordPresence, 0, sizeof(discordPresence)); discordPresence.state = region_name.c_str(); - LLAvatarName av_name; + std::string name; - if (RlvActions::canShowName(RlvActions::SNC_DEFAULT, gAgentID)) + if (RlvActions::canShowName(RlvActions::SNC_DEFAULT, gAgentID) && gSavedPerAccountSettings.getBOOL("FSShareNameToDiscord")) { + LLAvatarName av_name; if (LLAvatarNameCache::get(gAgentID, &av_name)) { name = av_name.getCompleteName(true, true); @@ -219,12 +218,9 @@ void FSDiscordConnect::updateRichPresence() { name = gAgentUsername; } + discordPresence.details = name.c_str(); } - else - { - name = RlvStrings::getAnonym(av_name); - } - discordPresence.details = name.c_str(); + discordPresence.startTimestamp = mConnectTime; discordPresence.largeImageKey = "secondlife_512"; @@ -233,7 +229,8 @@ void FSDiscordConnect::updateRichPresence() std::string appName = std::string("via " + APP_NAME); discordPresence.smallImageText = appName.c_str(); - discordPresence.partyId = gAgent.getRegion()->getRegionID().asString().c_str(); + std::string regionId = gAgent.getRegion()->getRegionID().asString(); + discordPresence.partyId = regionId.c_str(); discordPresence.partySize = gAgent.getRegion()->mMapAvatars.size(); discordPresence.partyMax = LLRegionInfoModel::instance().mAgentLimit; Discord_UpdatePresence(&discordPresence); diff --git a/indra/newview/fsdiscordkey.h.in b/indra/newview/fsdiscordkey.h.in new file mode 100644 index 0000000000..269745e453 --- /dev/null +++ b/indra/newview/fsdiscordkey.h.in @@ -0,0 +1,4 @@ +// THIS FILE IS AUTOGENERATED BY THE BUILD PROCESS +// You can either set the keys in Variables.cmake or at the autobuild command + +#define DISCORD_API_KEY "@DDISCORD_API_KEY@" \ No newline at end of file diff --git a/indra/newview/fsfloaterdiscord.cpp b/indra/newview/fsfloaterdiscord.cpp index 189b308095..406a44e2a2 100644 --- a/indra/newview/fsfloaterdiscord.cpp +++ b/indra/newview/fsfloaterdiscord.cpp @@ -29,16 +29,16 @@ #include "fsfloaterdiscord.h" +#include "fsdiscordconnect.h" #include "llagent.h" #include "llagentui.h" #include "llcheckboxctrl.h" #include "llcombobox.h" -#include "fsdiscordconnect.h" #include "llfloaterreg.h" -#include "lltrans.h" -#include "llviewerregion.h" -#include "llviewercontrol.h" #include "lltabcontainer.h" +#include "lltrans.h" +#include "llviewercontrol.h" +#include "llviewerregion.h" #include "boost/algorithm/string/case_conv.hpp" @@ -48,7 +48,7 @@ void FSFloaterDiscord::onVisibilityChange(BOOL visible) { - if(visible) + if (visible) { LLEventPumps::instance().obtain("DiscordConnectState").stopListening("FSDiscordAccountPanel"); LLEventPumps::instance().obtain("DiscordConnectState").listen("FSDiscordAccountPanel", boost::bind(&FSFloaterDiscord::onDiscordConnectStateChange, this, _1)); @@ -64,7 +64,7 @@ void FSFloaterDiscord::onVisibilityChange(BOOL visible) } //Connected - if(FSDiscordConnect::instance().isConnected()) + if (FSDiscordConnect::instance().isConnected()) { showConnectedLayout(); } @@ -86,14 +86,9 @@ void FSFloaterDiscord::onVisibilityChange(BOOL visible) } } -void FSFloaterDiscord::onAllow() -{ - gSavedPerAccountSettings.setBOOL("FSEnableDiscordIntegration", mAllowCheckbox->get()); -} - bool FSFloaterDiscord::onDiscordConnectStateChange(const LLSD& data) { - if(FSDiscordConnect::instance().isConnected()) + if (FSDiscordConnect::instance().isConnected()) { mAccountCaptionLabel->setText(getString("discord_connected")); showConnectedLayout(); @@ -111,7 +106,7 @@ bool FSFloaterDiscord::onDiscordConnectInfoChange() { LLSD info = FSDiscordConnect::instance().getInfo(); - if(info.has("name")) + if (info.has("name")) { mAccountNameLabel->setText(info["name"].asString()); } @@ -121,7 +116,7 @@ bool FSFloaterDiscord::onDiscordConnectInfoChange() void FSFloaterDiscord::showConnectButton() { - if(!mConnectButton->getVisible()) + if (!mConnectButton->getVisible()) { mConnectButton->setVisible(TRUE); mDisconnectButton->setVisible(FALSE); @@ -130,7 +125,7 @@ void FSFloaterDiscord::showConnectButton() void FSFloaterDiscord::hideConnectButton() { - if(mConnectButton->getVisible()) + if (mConnectButton->getVisible()) { mConnectButton->setVisible(FALSE); mDisconnectButton->setVisible(TRUE); @@ -140,7 +135,7 @@ void FSFloaterDiscord::hideConnectButton() void FSFloaterDiscord::showDisconnectedLayout() { mAccountCaptionLabel->setText(getString("discord_disconnected")); - mAccountNameLabel->setText(std::string("")); + mAccountNameLabel->setText(std::string()); showConnectButton(); } @@ -161,23 +156,16 @@ void FSFloaterDiscord::onDisconnect() } FSFloaterDiscord::FSFloaterDiscord(const LLSD& key) : LLFloater(key), -mStatusText(nullptr) + mStatusText(nullptr) { mCommitCallbackRegistrar.add("FSDiscord.Connect", boost::bind(&FSFloaterDiscord::onConnect, this)); mCommitCallbackRegistrar.add("FSDiscord.Disconnect", boost::bind(&FSFloaterDiscord::onDisconnect, this)); - mCommitCallbackRegistrar.add("FSDiscord.Allow", boost::bind(&FSFloaterDiscord::onAllow, this)); - mCommitCallbackRegistrar.add("FSDiscord.Combo", boost::bind(&FSFloaterDiscord::onCombo, this)); mCommitCallbackRegistrar.add("FSDiscord.Add", boost::bind(&FSFloaterDiscord::onAdd, this)); mCommitCallbackRegistrar.add("FSDiscord.Rem", boost::bind(&FSFloaterDiscord::onRemove, this)); setVisibleCallback(boost::bind(&FSFloaterDiscord::onVisibilityChange, this, _2)); } -void FSFloaterDiscord::onCombo() -{ - gSavedPerAccountSettings.setU32("FSMaxSharedMaturity", mMaturityCombo->getSelectedValue().asInteger()); -} - void FSFloaterDiscord::onAdd() { std::string name = mBlacklistEntry->getText(); @@ -257,12 +245,8 @@ BOOL FSFloaterDiscord::postBuild() mAccountNameLabel = getChild("account_name_label"); mDisconnectButton = getChild("disconnect_btn"); mConnectButton = getChild("connect_btn"); - mAllowCheckbox = getChild("startup_check"); - mMaturityCombo = getChild("maturity_desired_combobox"); mBlacklistedNames = getChild("blacklisted_names"); mBlacklistEntry = getChild("blacklist_entry"); - mAddBlacklist = getChild("blacklist_entry_add"); - mRemBlacklist = getChild("blacklist_entry_rem"); LLSD list = gSavedPerAccountSettings.getLLSD("FSBlacklistedRegionNames"); for (LLSD::array_const_iterator iter = list.beginArray(); @@ -272,10 +256,6 @@ BOOL FSFloaterDiscord::postBuild() mBlacklistedNames->addSimpleElement(iter->asString()); } - mMaturityCombo->selectByValue((LLSD::Integer)gSavedPerAccountSettings.getU32("FSMaxSharedMaturity")); - - mAllowCheckbox->set(gSavedPerAccountSettings.getBOOL("FSEnableDiscordIntegration")); - // Connection status widgets mStatusText = getChild("connection_status_text"); @@ -320,4 +300,3 @@ void FSFloaterDiscord::draw() } LLFloater::draw(); } - diff --git a/indra/newview/fsfloaterdiscord.h b/indra/newview/fsfloaterdiscord.h index f3c04cb2a9..7f5b92784b 100644 --- a/indra/newview/fsfloaterdiscord.h +++ b/indra/newview/fsfloaterdiscord.h @@ -28,12 +28,12 @@ #define FS_FSFLOATERDISCORD_H #include "llfloater.h" -#include "lltextbox.h" class LLCheckBoxCtrl; class LLComboBox; class LLScrollListCtrl; class LLLineEditor; +class LLTextBox; class FSFloaterDiscord : public LLFloater { @@ -48,10 +48,7 @@ private: bool onDiscordConnectStateChange(const LLSD& data); bool onDiscordConnectInfoChange(); void onConnect(); - void onUseAnotherAccount(); void onDisconnect(); - void onAllow(); - void onCombo(); void onAdd(); void onRemove(); @@ -60,19 +57,13 @@ private: void showDisconnectedLayout(); void showConnectedLayout(); - LLTextBox * mAccountCaptionLabel; - LLTextBox * mAccountNameLabel; - LLButton * mConnectButton; - LLButton * mDisconnectButton; - LLCheckBoxCtrl * mAllowCheckbox; - LLComboBox * mMaturityCombo; - LLScrollListCtrl * mBlacklistedNames; - LLLineEditor * mBlacklistEntry; - LLButton * mAddBlacklist; - LLButton * mRemBlacklist; - - LLTextBox* mStatusText; + LLTextBox* mAccountCaptionLabel; + LLTextBox* mAccountNameLabel; + LLButton* mConnectButton; + LLButton* mDisconnectButton; + LLScrollListCtrl* mBlacklistedNames; + LLLineEditor* mBlacklistEntry; + LLTextBox* mStatusText; }; #endif // FS_FSFLOATERDISCORD_H - diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index 2d93b9eb14..5831b97918 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -791,7 +791,9 @@ RMDir "$INSTDIR" IfFileExists "$INSTDIR" FOLDERFOUND NOFOLDER FOLDERFOUND: - MessageBox MB_OK $(DeleteProgramFilesMB) /SD IDOK IDOK NOFOLDER +# Silent uninstall always removes all files (/SD IDYES) + MessageBox MB_YESNO $(DeleteProgramFilesMB) /SD IDYES IDNO NOFOLDER + RMDir /r "$INSTDIR" NOFOLDER: diff --git a/indra/newview/installers/windows/lang_de.nsi b/indra/newview/installers/windows/lang_de.nsi index fc3ef0e834..8b4827ec09 100755 Binary files a/indra/newview/installers/windows/lang_de.nsi and b/indra/newview/installers/windows/lang_de.nsi differ diff --git a/indra/newview/installers/windows/lang_en-us.nsi b/indra/newview/installers/windows/lang_en-us.nsi index 83a6c68caa..d9fd222af7 100644 Binary files a/indra/newview/installers/windows/lang_en-us.nsi and b/indra/newview/installers/windows/lang_en-us.nsi differ diff --git a/indra/newview/linux_tools/client-readme.txt b/indra/newview/linux_tools/client-readme.txt index ac256239a8..71f0b65155 100644 --- a/indra/newview/linux_tools/client-readme.txt +++ b/indra/newview/linux_tools/client-readme.txt @@ -126,7 +126,7 @@ SOLUTION:- Usually this indicates that your graphics card does not meet * If your distribution does not make it easy, then you can download the required Linux drivers straight from your graphics card manufacturer: - - + - PROBLEM 2:- My whole system seems to hang when running Firestorm. SOLUTION:- This is typically a hardware/driver issue. The first thing to @@ -201,19 +201,19 @@ configuration options for advanced troubleshooters. We're pleased to have released Firestorm client's source code under an Open Source license compatible with the 'LGPL'. - + 8. GETTING MORE HELP AND REPORTING PROBLEMS -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- For general help and support with Firestorm: - + In-world discussion: Main support: Join one of our in-world support groups. - + There is also a 'Linux Client Users' group inside Second Life which is free to join. You can find it by pressing the 'Search' button at @@ -222,7 +222,7 @@ searching for 'Linux'. This group is useful for discussing Linux issues with fellow Linux client users who are online. The Firestorm Issue Tracker: - + This is the right place for finding known issues and reporting new bugs in all Firestorm releases if you find that the Troubleshooting section in this file hasn't helped. diff --git a/indra/newview/linux_tools/refresh_desktop_app_entry.sh b/indra/newview/linux_tools/refresh_desktop_app_entry.sh index aa7a08a1d7..c8f597d7de 100755 --- a/indra/newview/linux_tools/refresh_desktop_app_entry.sh +++ b/indra/newview/linux_tools/refresh_desktop_app_entry.sh @@ -13,7 +13,7 @@ function install_desktop_entry() local desktop_entry="\ [Desktop Entry]\n\ Name=Firestorm Viewer\n\ -Comment=Client for accessing 3D virtual words\n\ +Comment=Client for accessing 3D virtual worlds\n\ Exec=${installation_prefix}/firestorm\n\ Icon=${installation_prefix}/firestorm_icon.png\n\ Terminal=false\n\ diff --git a/indra/newview/linux_tools/wrapper.sh b/indra/newview/linux_tools/wrapper.sh index 6f924f50b3..0654a07b4e 100755 --- a/indra/newview/linux_tools/wrapper.sh +++ b/indra/newview/linux_tools/wrapper.sh @@ -183,7 +183,7 @@ most common problems when launching the Viewer (particularly loading shared libraries') may be solved by enabling 32-bit architecture and installing one or more 32-bit compatibility libraries. Consult the Firestorm wiki at -http://wiki.phoenixviewer.com/32-bit_viewer_in_64-bit_linux +http://wiki.firestormviewer.org/32-bit_viewer_in_64-bit_linux EOFMARKER fi fi diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 02d53365d0..e063d7734e 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -4416,6 +4416,23 @@ BOOL LLAgent::getHomePosGlobal( LLVector3d* pos_global ) return TRUE; } +bool LLAgent::isInHomeRegion() +{ + if(!mHaveHomePosition) + { + return false; + } + if (!getRegion()) + { + return false; + } + if (getRegion()->getHandle() != mHomeRegionHandle) + { + return false; + } + return true; +} + void LLAgent::clearVisualParams(void *data) { if (isAgentAvatarValid()) diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index f98a317b98..f58546bc88 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -237,6 +237,8 @@ public: void setStartPosition(U32 location_id); // Marks current location as start, sends information to servers void setHomePosRegion(const U64& region_handle, const LLVector3& pos_region); BOOL getHomePosGlobal(LLVector3d* pos_global); + bool isInHomeRegion(); + private: void setStartPositionSuccess(const LLSD &result); diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm index bac60eb084..2b3efec77b 100644 --- a/indra/newview/llappdelegate-objc.mm +++ b/indra/newview/llappdelegate-objc.mm @@ -37,21 +37,6 @@ #include "llappviewermacosx-for-objc.h" #include // Used for Text Input Services ("Safe" API - it's supported) -// [Cinder] We need to override sendEvent in NSApplication and force those -// Apple bastards to send us Command keyUp events! -@implementation LLNSApplication - -- (void)sendEvent:(NSEvent *)event { - // Fuck you, conventions! - if ([event type] == NSKeyUp && ([event modifierFlags] & NSCommandKeyMask)) - [[self keyWindow] sendEvent:event]; - else - [super sendEvent:event]; -} - -@end -// [Cinder] - @implementation LLAppDelegate @synthesize window; @@ -359,3 +344,16 @@ struct AttachmentInfo #endif // LL_BUGSPLAT @end + +@implementation LLApplication + +- (void)sendEvent:(NSEvent *)event +{ + [super sendEvent:event]; + if ([event type] == NSKeyUp && ([event modifierFlags] & NSCommandKeyMask)) + { + [[self keyWindow] sendEvent:event]; + } +} + +@end diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 26b286b291..d7513aa7a7 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -3443,6 +3443,7 @@ void LLAppViewer::initStrings() if (strings_path_full.empty() || !LLFile::isfile(strings_path_full)) { // initial check to make sure files are there failed + gDirUtilp->dumpCurrentDirectories(LLError::LEVEL_WARN); LL_ERRS() << "Viewer failed to find localization and UI files. Please reinstall viewer from https://secondlife.com/support/downloads/ and contact https://support.secondlife.com if issue persists after reinstall." << LL_ENDL; } LLTransUtil::parseStrings(strings_file, default_trans_args); @@ -3733,7 +3734,7 @@ LLSD LLAppViewer::getViewerInfo() const // https://releasenotes.secondlife.com/viewer/2.1.0.123456.html std::string url = LLTrans::getString("RELEASE_NOTES_BASE_URL"); // FIRE-13993: Leave out channel so we can use a URL like - // http://wiki.phoenixviewer.com/firestorm_change_log_x.y.z.rev + // http://wiki.firestormviewer.org/firestorm_change_log_x.y.z.rev //if (! LLStringUtil::endsWith(url, "/")) // url += "/"; //url += LLURI::escape(LLVersionInfo::getVersion()) + ".html"; @@ -5345,10 +5346,37 @@ void LLAppViewer::saveFinalSnapshot() std::string snap_filename = gDirUtilp->getLindenUserDir(); snap_filename += gDirUtilp->getDirDelimiter(); - snap_filename += SCREEN_LAST_FILENAME; + snap_filename += LLStartUp::getScreenLastFilename(); // use full pixel dimensions of viewer window (not post-scale dimensions) - gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, TRUE); + gViewerWindow->saveSnapshot(snap_filename, + gViewerWindow->getWindowWidthRaw(), + gViewerWindow->getWindowHeightRaw(), + FALSE, + TRUE, + LLSnapshotModel::SNAPSHOT_TYPE_COLOR, + LLSnapshotModel::SNAPSHOT_FORMAT_PNG); mSavedFinalSnapshot = TRUE; + + if (gAgent.isInHomeRegion()) + { + LLVector3d home; + if (gAgent.getHomePosGlobal(&home) && dist_vec(home, gAgent.getPositionGlobal()) < 10) + { + // We are at home position or close to it, see if we need to create home screenshot + // Notes: + // 1. It might be beneficial to also replace home if file is too old + // 2. This is far from best way/place to update screenshot since location might be not fully loaded, + // but we don't have many options + std::string snap_home = gDirUtilp->getLindenUserDir(); + snap_home += gDirUtilp->getDirDelimiter(); + snap_home += LLStartUp::getScreenHomeFilename(); + if (!gDirUtilp->fileExists(snap_home)) + { + // We are at home position yet no home image exist, fix it + LLFile::copy(snap_filename, snap_home); + } + } + } } } diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index cafec39309..948c28b3e6 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -385,12 +385,12 @@ void ll_nvapi_init(NvDRSSessionHandle hSession) #if DEBUGGING_SEH_FILTER # define WINMAIN DebuggingWinMain #else -# define WINMAIN WinMain +# define WINMAIN wWinMain #endif int APIENTRY WINMAIN(HINSTANCE hInstance, HINSTANCE hPrevInstance, - LPSTR lpCmdLine, + PWSTR pCmdLine, int nCmdShow) { const S32 MAX_HEAPS = 255; @@ -430,8 +430,8 @@ int APIENTRY WINMAIN(HINSTANCE hInstance, // *FIX: global gIconResource = MAKEINTRESOURCE(IDI_LL_ICON); - LLAppViewerWin32* viewer_app_ptr = new LLAppViewerWin32(lpCmdLine); - + LLAppViewerWin32* viewer_app_ptr = new LLAppViewerWin32(ll_convert_wide_to_string(pCmdLine).c_str()); + gOldTerminateHandler = std::set_terminate(exceptionTerminateHandler); viewer_app_ptr->setErrorHandler(LLAppViewer::handleViewerCrash); @@ -543,9 +543,9 @@ int APIENTRY WINMAIN(HINSTANCE hInstance, // in a method that uses object destructors. Go figure. // This winmain just calls the real winmain inside __try. // The __except calls our exception filter function. For debugging purposes. -int APIENTRY WinMain(HINSTANCE hInstance, +int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, - LPSTR lpCmdLine, + PWSTR lpCmdLine, int nCmdShow) { __try diff --git a/indra/newview/llcofwearables.cpp b/indra/newview/llcofwearables.cpp index 38a6ef6d7a..e7cb584232 100644 --- a/indra/newview/llcofwearables.cpp +++ b/indra/newview/llcofwearables.cpp @@ -522,13 +522,14 @@ void LLCOFWearables::populateAttachmentsAndBodypartsLists(const LLInventoryModel { mAttachments->sort(); mAttachments->notify(REARRANGE); //notifying the parent about the list's size change (cause items were added with rearrange=false) - setAttachmentsTitle(); } else { mAttachments->setNoItemsCommentText(LLTrans::getString("no_attachments")); } + setAttachmentsTitle(); + if (mBodyParts->size()) { mBodyParts->sort(); diff --git a/indra/newview/llcontrolavatar.cpp b/indra/newview/llcontrolavatar.cpp index 8e491903cc..c40246632d 100644 --- a/indra/newview/llcontrolavatar.cpp +++ b/indra/newview/llcontrolavatar.cpp @@ -327,10 +327,13 @@ LLControlAvatar *LLControlAvatar::createControlAvatar(LLVOVolume *obj) { LLControlAvatar *cav = (LLControlAvatar*)gObjectList.createObjectViewer(LL_PCODE_LEGACY_AVATAR, gAgent.getRegion(), CO_FLAG_CONTROL_AVATAR); - cav->mRootVolp = obj; + if (cav) + { + cav->mRootVolp = obj; - // Sync up position/rotation with object - cav->matchVolumeTransform(); + // Sync up position/rotation with object + cav->matchVolumeTransform(); + } return cav; } diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index e8e79ce93b..10cb5268a6 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -1745,6 +1745,12 @@ bool LLDrawPoolAvatar::getRiggedGeometry( face->setIndicesIndex(0); //rigged faces do not batch textures + + // if needed reset drawinfo as the face was set up for texture for batching + if (face->getTextureIndex() != 0xFF ) + face->setDrawInfo(nullptr); + // + face->setTextureIndex(255); if (buffer.isNull() || buffer->getTypeMask() != data_mask || !buffer->isWriteable()) diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 555674682d..9683c0e081 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -478,7 +478,10 @@ void LLFace::setTextureIndex(U8 index) } else { + // Restore old test, as the new one would also crash on empty texture list, which is exactly what the original test did avoid + //if (mDrawInfo && mDrawInfo->mTextureList.size() <= 1) if (mDrawInfo && !mDrawInfo->mTextureList.empty()) + // { LL_ERRS() << "Face with no texture index references indexed texture draw info." << LL_ENDL; } diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 4f220475bc..df5f727070 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -2332,9 +2332,6 @@ void LLPanelLandOptions::refresh() mCheckShowDirectory->setLabel(getString("DirectoryFee", map)); } } - - // Disable label text for show avi checkbox as well - getChild("allow_label5")->setColor(LLUIColorTable::instance().getColor(mSeeAvatarsCtrl->getEnabled() ? "LabelTextColor" : "LabelDisabledColor")); } S32 LLPanelLandOptions::getDirectoryFee() diff --git a/indra/newview/llfloatermyscripts.cpp b/indra/newview/llfloatermyscripts.cpp index fa2de21a8f..6f9a6c9066 100644 --- a/indra/newview/llfloatermyscripts.cpp +++ b/indra/newview/llfloatermyscripts.cpp @@ -41,6 +41,7 @@ const S32 SIZE_OF_ONE_KB = 1024; LLFloaterMyScripts::LLFloaterMyScripts(const LLSD& seed) : LLFloater(seed), mGotAttachmentMemoryUsed(false), + mAttachmentDetailsRequested(false), mAttachmentMemoryMax(0), mAttachmentMemoryUsed(0), mGotAttachmentURLsUsed(false), @@ -55,12 +56,24 @@ BOOL LLFloaterMyScripts::postBuild() std::string msg_waiting = LLTrans::getString("ScriptLimitsRequestWaiting"); getChild("loading_text")->setValue(LLSD(msg_waiting)); - return requestAttachmentDetails(); + mAttachmentDetailsRequested = requestAttachmentDetails(); + return TRUE; } -BOOL LLFloaterMyScripts::requestAttachmentDetails() +// virtual +void LLFloaterMyScripts::onOpen(const LLSD& key) { - if (!gAgent.getRegion()) return FALSE; + if (!mAttachmentDetailsRequested) + { + mAttachmentDetailsRequested = requestAttachmentDetails(); + } + + LLFloater::onOpen(key); +} + +bool LLFloaterMyScripts::requestAttachmentDetails() +{ + if (!gAgent.getRegion()) return false; LLSD body; std::string url = gAgent.getRegion()->getCapability("AttachmentResources"); @@ -68,11 +81,11 @@ BOOL LLFloaterMyScripts::requestAttachmentDetails() { LLCoros::instance().launch("LLFloaterMyScripts::getAttachmentLimitsCoro", boost::bind(&LLFloaterMyScripts::getAttachmentLimitsCoro, this, url)); - return TRUE; + return true; } else { - return FALSE; + return false; } } @@ -284,7 +297,7 @@ void LLFloaterMyScripts::onClickRefresh(void* userdata) btn->setEnabled(false); } instance->clearList(); - instance->requestAttachmentDetails(); + instance->mAttachmentDetailsRequested = instance->requestAttachmentDetails(); } else { diff --git a/indra/newview/llfloatermyscripts.h b/indra/newview/llfloatermyscripts.h index fe33ab90ae..3c053a0223 100644 --- a/indra/newview/llfloatermyscripts.h +++ b/indra/newview/llfloatermyscripts.h @@ -36,15 +36,17 @@ public: LLFloaterMyScripts(const LLSD& seed); BOOL postBuild(); + /*virtual*/ void onOpen(const LLSD& key); void setAttachmentDetails(LLSD content); void setAttachmentSummary(LLSD content); - BOOL requestAttachmentDetails(); + bool requestAttachmentDetails(); void clearList(); private: void getAttachmentLimitsCoro(std::string url); bool mGotAttachmentMemoryUsed; + bool mAttachmentDetailsRequested; S32 mAttachmentMemoryMax; S32 mAttachmentMemoryUsed; diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index e2a86e84f5..03261f9fa0 100644 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -38,7 +38,7 @@ #include "llcallbacklist.h" #include "llcheckboxctrl.h" #include "llfontgl.h" -#include "llimagebmp.h" +#include "llimagepng.h" #include "llimagej2c.h" #include "llinventory.h" #include "llnotificationsutil.h" @@ -89,7 +89,7 @@ #include "llcorehttputil.h" #include "llviewerassetupload.h" -const std::string SCREEN_PREV_FILENAME = "screen_report_last.bmp"; +const std::string SCREEN_PREV_FILENAME = "screen_report_last.png"; //========================================================================= //----------------------------------------------------------------------------- @@ -886,10 +886,10 @@ void LLFloaterReporter::takeScreenshot(bool use_prev_screenshot) if(!use_prev_screenshot) { std::string screenshot_filename(gDirUtilp->getLindenUserDir() + gDirUtilp->getDirDelimiter() + SCREEN_PREV_FILENAME); - LLPointer bmp_image = new LLImageBMP; - if(bmp_image->encode(mImageRaw, 0.0f)) + LLPointer png_image = new LLImagePNG; + if(png_image->encode(mImageRaw, 0.0f)) { - bmp_image->save(screenshot_filename); + png_image->save(screenshot_filename); } } else @@ -969,10 +969,10 @@ void LLFloaterReporter::takeNewSnapshot(bool refresh) { std::string screenshot_filename(gDirUtilp->getLindenUserDir() + gDirUtilp->getDirDelimiter() + SCREEN_PREV_FILENAME); mPrevImageRaw = new LLImageRaw; - LLPointer start_image_bmp = new LLImageBMP; - if(start_image_bmp->load(screenshot_filename)) + LLPointer start_image_png = new LLImagePNG; + if(start_image_png->load(screenshot_filename)) { - if (start_image_bmp->decode(mPrevImageRaw, 0.0f)) + if (start_image_png->decode(mPrevImageRaw, 0.0f)) { LLNotificationsUtil::add("LoadPreviousReportScreenshot", LLSD(), LLSD(), boost::bind(&LLFloaterReporter::onLoadScreenshotDialog,this, _1, _2)); return; diff --git a/indra/newview/llfloatersearch.cpp b/indra/newview/llfloatersearch.cpp index fb4385bea2..9c889b2706 100644 --- a/indra/newview/llfloatersearch.cpp +++ b/indra/newview/llfloatersearch.cpp @@ -136,6 +136,7 @@ void LLFloaterSearch::onOpen(const LLSD& key) // LLFloaterWebContent::onOpen(p); + mWebBrowser->setFocus(TRUE); search(p.search); } diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index 764b09dac5..c60ab8ca2a 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -1083,6 +1083,18 @@ void LLFloaterTools::onOpen(const LLSD& key) { mTab->selectTabByName(panel); } + + LLTool* tool = LLToolMgr::getInstance()->getCurrentTool(); + if (tool == LLToolCompInspect::getInstance() + || tool == LLToolDragAndDrop::getInstance()) + { + // Something called floater up while it was supressed (during drag n drop, inspect), + // so it won't be getting any layout or visibility updates, update once + // further updates will come from updateLayout() + LLCoordGL select_center_screen; + MASK mask = gKeyboard->currentMask(TRUE); + updatePopup(select_center_screen, mask); + } //gMenuBarView->setItemVisible("BuildTools", TRUE); } diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 6f3718c45f..f4644a7357 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -129,6 +129,7 @@ bool move_task_inventory_callback(const LLSD& notification, const LLSD& response bool confirm_attachment_rez(const LLSD& notification, const LLSD& response); void teleport_via_landmark(const LLUUID& asset_id); static BOOL can_move_to_outfit(LLInventoryItem* inv_item, BOOL move_is_into_current_outfit); +static bool can_move_to_my_outfits(LLInventoryModel* model, LLInventoryCategory* inv_cat, U32 wear_limit); static BOOL can_move_to_landmarks(LLInventoryItem* inv_item); // Function left unused from FIRE-7219 //static bool check_category(LLInventoryModel* model, @@ -2522,7 +2523,7 @@ public: // Can be destroyed (or moved to trash) BOOL LLFolderBridge::isItemRemovable() const { - if (!get_is_category_removable(getInventoryModel(), mUUID)) + if (!get_is_category_removable(getInventoryModel(), mUUID) || isMarketplaceListingsFolder()) { return FALSE; } @@ -2538,11 +2539,6 @@ BOOL LLFolderBridge::isItemRemovable() const return FALSE; } } - - if (isMarketplaceListingsFolder() && LLMarketplaceData::instance().getActivationState(mUUID)) - { - return FALSE; - } return TRUE; } @@ -2777,9 +2773,28 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, is_movable = FALSE; // tooltip? } + + U32 max_items_to_wear = gSavedSettings.getU32("WearFolderLimit"); if (is_movable && move_is_into_outfit) { - if((mUUID == my_outifts_id) || (getCategory() && getCategory()->getPreferredType() == LLFolderType::FT_NONE)) + if (mUUID == my_outifts_id) + { + if (source != LLToolDragAndDrop::SOURCE_AGENT || move_is_from_marketplacelistings) + { + tooltip_msg = LLTrans::getString("TooltipOutfitNotInInventory"); + is_movable = false; + } + else if (can_move_to_my_outfits(model, inv_cat, max_items_to_wear)) + { + is_movable = true; + } + else + { + tooltip_msg = LLTrans::getString("TooltipCantCreateOutfit"); + is_movable = false; + } + } + else if(getCategory() && getCategory()->getPreferredType() == LLFolderType::FT_NONE) { is_movable = ((inv_cat->getPreferredType() == LLFolderType::FT_NONE) || (inv_cat->getPreferredType() == LLFolderType::FT_OUTFIT)); } @@ -2824,7 +2839,6 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } } } - U32 max_items_to_wear = gSavedSettings.getU32("WearFolderLimit"); if (is_movable && move_is_into_current_outfit && descendent_items.size() > max_items_to_wear) @@ -2990,8 +3004,14 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } } + if (mUUID == my_outifts_id) + { + // Category can contains objects, + // create a new folder and populate it with links to original objects + dropToMyOutfits(inv_cat); + } // if target is current outfit folder we use link - if (move_is_into_current_outfit && + else if (move_is_into_current_outfit && (inv_cat->getPreferredType() == LLFolderType::FT_NONE || inv_cat->getPreferredType() == LLFolderType::FT_OUTFIT)) { @@ -4044,12 +4064,40 @@ void LLFolderBridge::perform_pasteFromClipboard() return; } } - if (move_is_into_current_outfit || move_is_into_outfit) + if (move_is_into_outfit) + { + if (!move_is_into_my_outfits && item && can_move_to_outfit(item, move_is_into_current_outfit)) + { + dropToOutfit(item, move_is_into_current_outfit); + } + else if (move_is_into_my_outfits && LLAssetType::AT_CATEGORY == obj->getType()) + { + LLInventoryCategory* cat = model->getCategory(item_id); + U32 max_items_to_wear = gSavedSettings.getU32("WearFolderLimit"); + if (cat && can_move_to_my_outfits(model, cat, max_items_to_wear)) + { + dropToMyOutfits(cat); + } + else + { + LLNotificationsUtil::add("MyOutfitsPasteFailed"); + } + } + else + { + LLNotificationsUtil::add("MyOutfitsPasteFailed"); + } + } + else if (move_is_into_current_outfit) { if (item && can_move_to_outfit(item, move_is_into_current_outfit)) { dropToOutfit(item, move_is_into_current_outfit); } + else + { + LLNotificationsUtil::add("MyOutfitsPasteFailed"); + } } else if (move_is_into_favorites) { @@ -5085,6 +5133,46 @@ static BOOL can_move_to_outfit(LLInventoryItem* inv_item, BOOL move_is_into_curr return TRUE; } +// Returns true if folder's content can be moved to Current Outfit or any outfit folder. +static bool can_move_to_my_outfits(LLInventoryModel* model, LLInventoryCategory* inv_cat, U32 wear_limit) +{ + LLInventoryModel::cat_array_t *cats; + LLInventoryModel::item_array_t *items; + model->getDirectDescendentsOf(inv_cat->getUUID(), cats, items); + + if (items->size() > wear_limit) + { + return false; + } + + if (items->size() == 0) + { + // Nothing to move(create) + return false; + } + + if (cats->size() > 0) + { + // We do not allow subfolders in outfits of "My Outfits" yet + return false; + } + + LLInventoryModel::item_array_t::iterator iter = items->begin(); + LLInventoryModel::item_array_t::iterator end = items->end(); + + while (iter != end) + { + LLViewerInventoryItem *item = *iter; + if (!can_move_to_outfit(item, false)) + { + return false; + } + iter++; + } + + return true; +} + // Returns TRUE if item is a landmark or a link to a landmark // and can be moved to Favorites or Landmarks folder. static BOOL can_move_to_landmarks(LLInventoryItem* inv_item) @@ -5153,6 +5241,56 @@ void LLFolderBridge::dropToOutfit(LLInventoryItem* inv_item, BOOL move_is_into_c } } +void LLFolderBridge::dropToMyOutfits(LLInventoryCategory* inv_cat) +{ + // make a folder in the My Outfits directory. + const LLUUID dest_id = getInventoryModel()->findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS); + + // Note: creation will take time, so passing folder id to callback is slightly unreliable, + // but so is collecting and passing descendants' ids + inventory_func_type func = boost::bind(&LLFolderBridge::outfitFolderCreatedCallback, this, inv_cat->getUUID(), _1); + gInventory.createNewCategory(dest_id, + LLFolderType::FT_OUTFIT, + inv_cat->getName(), + func); +} + +void LLFolderBridge::outfitFolderCreatedCallback(LLUUID cat_source_id, LLUUID cat_dest_id) +{ + LLInventoryModel::cat_array_t* categories; + LLInventoryModel::item_array_t* items; + getInventoryModel()->getDirectDescendentsOf(cat_source_id, categories, items); + + LLInventoryObject::const_object_list_t link_array; + + + LLInventoryModel::item_array_t::iterator iter = items->begin(); + LLInventoryModel::item_array_t::iterator end = items->end(); + while (iter!=end) + { + const LLViewerInventoryItem* item = (*iter); + // By this point everything is supposed to be filtered, + // but there was a delay to create folder so something could have changed + LLInventoryType::EType inv_type = item->getInventoryType(); + if ((inv_type == LLInventoryType::IT_WEARABLE) || + (inv_type == LLInventoryType::IT_GESTURE) || + (inv_type == LLInventoryType::IT_ATTACHMENT) || + (inv_type == LLInventoryType::IT_OBJECT) || + (inv_type == LLInventoryType::IT_SNAPSHOT) || + (inv_type == LLInventoryType::IT_TEXTURE)) + { + link_array.push_back(LLConstPointer(item)); + } + iter++; + } + + if (!link_array.empty()) + { + LLPointer cb = NULL; + link_inventory_array(cat_dest_id, link_array, cb); + } +} + // Callback for drop item if DAMA required... void LLFolderBridge::callback_dropItemIntoFolder(const LLSD& notification, const LLSD& response, LLInventoryItem* inv_item) { diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index 4c4ff633f6..36fc906635 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -383,6 +383,7 @@ protected: void dropToFavorites(LLInventoryItem* inv_item); void dropToOutfit(LLInventoryItem* inv_item, BOOL move_is_into_current_outfit); + void dropToMyOutfits(LLInventoryCategory* inv_cat); //-------------------------------------------------------------------- // Messy hacks for handling folder options @@ -392,6 +393,7 @@ public: static void staticFolderOptionsMenu(); protected: + void outfitFolderCreatedCallback(LLUUID cat_source_id, LLUUID cat_dest_id); void callback_pasteFromClipboard(const LLSD& notification, const LLSD& response); void perform_pasteFromClipboard(); void gatherMessage(std::string& message, S32 depth, LLError::ELevel log_level); diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index a9a10339ca..cb0325c1cc 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -2378,6 +2378,7 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures) instance_entry["material"] = LL_MCODE_WOOD; instance_entry["physics_shape_type"] = data.mModel[LLModel::LOD_PHYSICS].notNull() ? (U8)(LLViewerObject::PHYSICS_SHAPE_PRIM) : (U8)(LLViewerObject::PHYSICS_SHAPE_CONVEX_HULL); instance_entry["mesh"] = mesh_index[data.mBaseModel]; + instance_entry["mesh_name"] = instance.mLabel; instance_entry["face_list"] = LLSD::emptyArray(); diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index 172def4395..8d670f8c80 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -1546,7 +1546,7 @@ void LLPanelObject::activateMeshFields(LLViewerObject * objectp) childSetVisible("ObjectLODbehaviourLabel", true); // Setup the LL defaults - factor = 1.125f; // LL default for most people http://wiki.phoenixviewer.com/support:whirly_fizzle#lod_comparison + factor = 1.125f; // LL default for most people http://wiki.firestormviewer.org/support:whirly_fizzle#lod_comparison args["FACTOR"] = llformat("%.3f", factor); tb = getChild("LOD_swap_ll_default"); tb->setToolTip(getString("ll_lod_tooltip_msg",args)); diff --git a/indra/newview/llpreviewnotecard.h b/indra/newview/llpreviewnotecard.h index f83f3b65b6..6685bff41d 100644 --- a/indra/newview/llpreviewnotecard.h +++ b/indra/newview/llpreviewnotecard.h @@ -56,7 +56,7 @@ public: // llview void draw() override; // [SL:KB] - Patch: UI-FloaterSearchReplace | Checked: 2010-11-05 (Catznip-2.3.0a) | Added: Catznip-2.3.0a - virtual bool hasAccelerators() const; + virtual bool hasAccelerators() const override; // [/SL:KB] virtual BOOL handleKeyHere(KEY key, MASK mask) override; virtual void setEnabled( BOOL enabled ) override; diff --git a/indra/newview/llsky.cpp b/indra/newview/llsky.cpp index 3ef89ba920..5e2442798b 100644 --- a/indra/newview/llsky.cpp +++ b/indra/newview/llsky.cpp @@ -119,7 +119,7 @@ void LLSky::restoreGL() void LLSky::resetVertexBuffers() { - if (gSky.mVOSkyp.notNull()) + if (gSky.mVOSkyp.notNull() && gSky.mVOGroundp.notNull()) { gPipeline.resetVertexBuffers(gSky.mVOSkyp->mDrawable); gPipeline.resetVertexBuffers(gSky.mVOGroundp->mDrawable); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 69b35e905b..b2b18704bc 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -119,7 +119,7 @@ #include "llhudeffecttrail.h" #include "llhudmanager.h" #include "llbufferstream.h" // For SL Grid Status -#include "llimagebmp.h" +#include "llimage.h" #include "llinventorybridge.h" #include "llinventorymodel.h" #include "llinventorymodelbackgroundfetch.h" @@ -170,6 +170,7 @@ #include "llviewerparcelmgr.h" #include "llviewerregion.h" #include "llviewerstats.h" +#include "llviewerstatsrecorder.h" #include "llviewerthrottle.h" #include "llviewerwindow.h" #include "llvoavatar.h" @@ -255,8 +256,8 @@ bool gAgentMovementCompleted = false; S32 gMaxAgentGroups; -std::string SCREEN_HOME_FILENAME = "screen_home.bmp"; -std::string SCREEN_LAST_FILENAME = "screen_last.bmp"; +const std::string SCREEN_HOME_FILENAME = "screen_home%s.png"; +const std::string SCREEN_LAST_FILENAME = "screen_last%s.png"; LLPointer gStartTexture; @@ -605,6 +606,14 @@ bool idle_startup() // to work. gIdleCallbacks.callFunctions(); gViewerWindow->updateUI(); + + // There is a crash on updateClass, this is an attempt to get more information + if (LLMortician::graveyardCount()) + { + std::stringstream log_stream; + LLMortician::logClass(log_stream); + LL_INFOS() << log_stream.str() << LL_ENDL; + } LLMortician::updateClass(); const std::string delims (" "); @@ -1889,6 +1898,7 @@ bool idle_startup() // // Initialize classes w/graphics stuff. // + LLViewerStatsRecorder::instance(); // Since textures work in threads gTextureList.doPrefetchImages(); display_startup(); @@ -3479,6 +3489,37 @@ bool callback_choose_gender(const LLSD& notification, const LLSD& response) return false; } +std::string get_screen_filename(const std::string& pattern) +{ + // OpenSim support + //if (LLGridManager::getInstance()->isInProductionGrid()) + if (LLGridManager::getInstance()->isInSLMain()) + // + { + return llformat(pattern.c_str(), ""); + } + else + { + const std::string& grid_id_str = LLGridManager::getInstance()->getGridId(); + const std::string& grid_id_lower = utf8str_tolower(grid_id_str); + std::string grid = "." + grid_id_lower; + return llformat(pattern.c_str(), grid.c_str()); + } +} + +//static +std::string LLStartUp::getScreenLastFilename() +{ + return get_screen_filename(SCREEN_LAST_FILENAME); +} + +//static +std::string LLStartUp::getScreenHomeFilename() +{ + return get_screen_filename(SCREEN_HOME_FILENAME); +} + +//static void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name, const std::string& gender_name ) { @@ -3577,19 +3618,35 @@ void init_start_screen(S32 location_id) LL_DEBUGS("AppInit") << "Loading startup bitmap..." << LL_ENDL; + U8 image_codec = IMG_CODEC_PNG; std::string temp_str = gDirUtilp->getLindenUserDir() + gDirUtilp->getDirDelimiter(); if ((S32)START_LOCATION_ID_LAST == location_id) { - temp_str += SCREEN_LAST_FILENAME; + temp_str += LLStartUp::getScreenLastFilename(); } else { - temp_str += SCREEN_HOME_FILENAME; + std::string path = temp_str + LLStartUp::getScreenHomeFilename(); + + // OpenSim support + //if (!gDirUtilp->fileExists(path) && LLGridManager::getInstance()->isInProductionGrid()) + if (!gDirUtilp->fileExists(path) && LLGridManager::getInstance()->isInSLMain()) + // + { + // Fallback to old file, can be removed later + // Home image only sets when user changes home, so it will take time for users to switch to pngs + temp_str += "screen_home.bmp"; + image_codec = IMG_CODEC_BMP; + } + else + { + temp_str = path; + } } - LLPointer start_image_bmp = new LLImageBMP; - + LLPointer start_image_frmted = LLImageFormatted::createFromType(image_codec); + // Turn off start screen to get around the occasional readback // driver bug if(!gSavedSettings.getBOOL("UseStartScreen")) @@ -3597,18 +3654,18 @@ void init_start_screen(S32 location_id) LL_INFOS("AppInit") << "Bitmap load disabled" << LL_ENDL; return; } - else if(!start_image_bmp->load(temp_str) ) + else if(!start_image_frmted->load(temp_str) ) { LL_WARNS("AppInit") << "Bitmap load failed" << LL_ENDL; gStartTexture = NULL; } else { - gStartImageWidth = start_image_bmp->getWidth(); - gStartImageHeight = start_image_bmp->getHeight(); + gStartImageWidth = start_image_frmted->getWidth(); + gStartImageHeight = start_image_frmted->getHeight(); LLPointer raw = new LLImageRaw; - if (!start_image_bmp->decode(raw, 0.0f)) + if (!start_image_frmted->decode(raw, 0.0f)) { LL_WARNS("AppInit") << "Bitmap decode failed" << LL_ENDL; gStartTexture = NULL; diff --git a/indra/newview/llstartup.h b/indra/newview/llstartup.h index db5e4a4c6b..981adc00a1 100644 --- a/indra/newview/llstartup.h +++ b/indra/newview/llstartup.h @@ -41,10 +41,6 @@ bool idle_startup(); void release_start_screen(); bool login_alert_done(const LLSD& notification, const LLSD& response); -// constants, variables, & enumerations -extern std::string SCREEN_HOME_FILENAME; -extern std::string SCREEN_LAST_FILENAME; - // start location constants enum EStartLocation { @@ -105,6 +101,8 @@ public: static void setStartupState( EStartupState state ); static EStartupState getStartupState() { return gStartupState; }; static std::string getStartupStateString() { return startupStateToString(gStartupState); }; + static std::string getScreenLastFilename(); // screenshot taken on exit + static std::string getScreenHomeFilename(); // screenshot taken on setting Home static void multimediaInit(); // Initialize LLViewerMedia multimedia engine. diff --git a/indra/newview/llsurfacepatch.cpp b/indra/newview/llsurfacepatch.cpp index 910e0d9395..5503a918a6 100644 --- a/indra/newview/llsurfacepatch.cpp +++ b/indra/newview/llsurfacepatch.cpp @@ -204,7 +204,7 @@ LLVector2 LLSurfacePatch::getTexCoords(const U32 x, const U32 y) const void LLSurfacePatch::eval(const U32 x, const U32 y, const U32 stride, LLVector3 *vertex, LLVector3 *normal, LLVector2 *tex0, LLVector2 *tex1) { - if (!mSurfacep || !mSurfacep->getRegion() || !mSurfacep->getGridsPerEdge()) + if (!mSurfacep || !mSurfacep->getRegion() || !mSurfacep->getGridsPerEdge() || !mVObjp) { return; // failsafe } diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 4fd9e02d2a..ed5a6f00c7 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -2430,7 +2430,11 @@ S32 LLTextureFetchWorker::callbackHttpGet(LLCore::HttpResponse * response, mLoaded = TRUE; setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority); - LLViewerStatsRecorder::instance().log(0.2f); + if (LLViewerStatsRecorder::instanceExists()) + { + // Do not create this instance inside thread + LLViewerStatsRecorder::instance().log(0.2f); + } return data_size ; } diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index f9d390d311..f9f5006162 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -143,6 +143,12 @@ BOOL LLToolPie::handleMouseDown(S32 x, S32 y, MASK mask) // !transparent_object check will be covered by transparent_object == visible_object. mPick = transparent_pick; } + // FIRE-29031; Handle transparent being nullptr (due to RLVa?). visible_object cannot be invalid here or the if above had been entered + else if( !transp_object) + { + mPick = visible_pick; + } + // else { // Select between two non-null picks diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 2a1ce19885..ccabb69dda 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -42,7 +42,7 @@ #include "llfeaturemanager.h" //#include "llfirstuse.h" #include "llhudmanager.h" -#include "llimagebmp.h" +#include "llimagepng.h" #include "llmemory.h" #include "llselectmgr.h" #include "llsky.h" @@ -1740,17 +1740,17 @@ void render_disconnected_background() LL_INFOS() << "Loading last bitmap..." << LL_ENDL; std::string temp_str; - temp_str = gDirUtilp->getLindenUserDir() + gDirUtilp->getDirDelimiter() + SCREEN_LAST_FILENAME; + temp_str = gDirUtilp->getLindenUserDir() + gDirUtilp->getDirDelimiter() + LLStartUp::getScreenLastFilename(); - LLPointer image_bmp = new LLImageBMP; - if( !image_bmp->load(temp_str) ) + LLPointer image_png = new LLImagePNG; + if( !image_png->load(temp_str) ) { //LL_INFOS() << "Bitmap load failed" << LL_ENDL; return; } LLPointer raw = new LLImageRaw; - if (!image_bmp->decode(raw, 0.0f)) + if (!image_png->decode(raw, 0.0f)) { LL_INFOS() << "Bitmap decode failed" << LL_ENDL; gDisconnectedImagep = NULL; @@ -1758,7 +1758,7 @@ void render_disconnected_background() } U8 *rawp = raw->getData(); - S32 npixels = (S32)image_bmp->getWidth()*(S32)image_bmp->getHeight(); + S32 npixels = (S32)image_png->getWidth()*(S32)image_png->getHeight(); for (S32 i = 0; i < npixels; i++) { S32 sum = 0; diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index f7893941c1..5a2dcb9ed8 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -181,9 +181,7 @@ #include "fsfloateravatarrendersettings.h" #include "fsfloatercontacts.h" #include "fsfloatercontactsetconfiguration.h" -#ifdef HAS_DISCORD #include "fsfloaterdiscord.h" -#endif #include "fsfloaterexport.h" #include "fsfloaterblocklist.h" #include "fsfloatergroup.h" @@ -468,9 +466,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("fs_blocklist", "floater_fs_blocklist.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("fs_add_contact", "floater_fs_contact_add.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("fs_contact_set_config", "floater_fs_contact_set_configuration.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); -#ifdef HAS_DISCORD LLFloaterReg::add("fs_discord", "floater_fs_discord.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); -#endif LLFloaterReg::add("fs_group", "floater_fs_group.xml",&LLFloaterReg::build); LLFloaterReg::add("fs_group_titles", "floater_fs_group_titles.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("fs_export", "floater_fs_export.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 8cf6dcaf28..aa701516f4 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -6322,8 +6322,8 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem) // save the home location image to disk std::string snap_filename = gDirUtilp->getLindenUserDir(); snap_filename += gDirUtilp->getDirDelimiter(); - snap_filename += SCREEN_HOME_FILENAME; - gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, FALSE); + snap_filename += LLStartUp::getScreenHomeFilename(); + gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, FALSE, LLSnapshotModel::SNAPSHOT_TYPE_COLOR, LLSnapshotModel::SNAPSHOT_FORMAT_PNG); } if (notificationID == "RegionRestartMinutes" || @@ -6384,14 +6384,14 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem) // save the home location image to disk std::string snap_filename = gDirUtilp->getLindenUserDir(); snap_filename += gDirUtilp->getDirDelimiter(); - snap_filename += SCREEN_HOME_FILENAME; - if (gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, FALSE)) + snap_filename += LLStartUp::getScreenHomeFilename(); + if (gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, FALSE, LLSnapshotModel::SNAPSHOT_TYPE_COLOR, LLSnapshotModel::SNAPSHOT_FORMAT_PNG)) { - LL_INFOS() << SCREEN_HOME_FILENAME << " saved successfully." << LL_ENDL; + LL_INFOS() << LLStartUp::getScreenHomeFilename() << " saved successfully." << LL_ENDL; } else { - LL_WARNS() << SCREEN_HOME_FILENAME << " could not be saved." << LL_ENDL; + LL_WARNS() << LLStartUp::getScreenHomeFilename() << " could not be saved." << LL_ENDL; } } // @@ -6441,8 +6441,8 @@ static void process_special_alert_messages(const std::string & message) // save the home location image to disk std::string snap_filename = gDirUtilp->getLindenUserDir(); snap_filename += gDirUtilp->getDirDelimiter(); - snap_filename += SCREEN_HOME_FILENAME; - gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, FALSE); + snap_filename += LLStartUp::getScreenHomeFilename(); + gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, FALSE, LLSnapshotModel::SNAPSHOT_TYPE_COLOR, LLSnapshotModel::SNAPSHOT_FORMAT_PNG); } } diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 7c4e2d062f..2def1d5c0a 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -1500,7 +1500,11 @@ BOOL LLViewerObjectList::killObject(LLViewerObject *objectp) if (objectp) { - objectp->markDead(); // does the right thing if object already dead + // We are going to cleanup a lot of smart pointers to this object, they might be last, + // and object being NULLed while inside it's own function won't be pretty + // so create a pointer to make sure object will stay alive untill markDead() finishes + LLPointer sp(objectp); + sp->markDead(); // does the right thing if object already dead return TRUE; } diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 355912cf07..3ba42117f7 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -3864,9 +3864,9 @@ void LLViewerMediaTexture::removeFace(U32 channel, LLFace* facep) } } - if(te && te->getID().notNull()) //should have a texture + if(te && te->getID().notNull()) //should have a texture but none found { - LL_ERRS() << "mTextureList texture reference number is corrupted." << LL_ENDL; + LL_ERRS() << "mTextureList texture reference number is corrupted. Texture id: " << te->getID() << " List size: " << (U32)mTextureList.size() << LL_ENDL; } } diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 50ca36205c..7816ffe9ba 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -128,7 +128,7 @@ #include "llhudmanager.h" #include "llhudobject.h" #include "llhudview.h" -#include "llimagebmp.h" +#include "llimage.h" #include "llimagej2c.h" #include "llimageworker.h" #include "llkeyboard.h" @@ -5640,32 +5640,46 @@ void LLViewerWindow::movieSize(S32 new_width, S32 new_height) } -BOOL LLViewerWindow::saveSnapshot(const std::string& filepath, S32 image_width, S32 image_height, BOOL show_ui, BOOL do_rebuild, LLSnapshotModel::ESnapshotLayerType type) +BOOL LLViewerWindow::saveSnapshot(const std::string& filepath, S32 image_width, S32 image_height, BOOL show_ui, BOOL do_rebuild, LLSnapshotModel::ESnapshotLayerType type, LLSnapshotModel::ESnapshotFormat format) { - LL_INFOS() << "Saving snapshot to: " << filepath << LL_ENDL; + LL_INFOS() << "Saving snapshot to: " << filepath << LL_ENDL; - LLPointer raw = new LLImageRaw; - BOOL success = rawSnapshot(raw, image_width, image_height, TRUE, FALSE, show_ui, do_rebuild); + LLPointer raw = new LLImageRaw; + BOOL success = rawSnapshot(raw, image_width, image_height, TRUE, FALSE, show_ui, do_rebuild); - if (success) - { - LLPointer bmp_image = new LLImageBMP; - success = bmp_image->encode(raw, 0.0f); - if( success ) - { - success = bmp_image->save(filepath); - } - else - { - LL_WARNS() << "Unable to encode bmp snapshot" << LL_ENDL; - } - } - else - { - LL_WARNS() << "Unable to capture raw snapshot" << LL_ENDL; - } + if (success) + { + U8 image_codec = IMG_CODEC_BMP; + switch (format) + { + case LLSnapshotModel::SNAPSHOT_FORMAT_PNG: + image_codec = IMG_CODEC_PNG; + break; + case LLSnapshotModel::SNAPSHOT_FORMAT_JPEG: + image_codec = IMG_CODEC_JPEG; + break; + default: + image_codec = IMG_CODEC_BMP; + break; + } - return success; + LLPointer formated_image = LLImageFormatted::createFromType(image_codec); + success = formated_image->encode(raw, 0.0f); + if (success) + { + success = formated_image->save(filepath); + } + else + { + LL_WARNS() << "Unable to encode snapshot of format " << format << LL_ENDL; + } + } + else + { + LL_WARNS() << "Unable to capture raw snapshot" << LL_ENDL; + } + + return success; } diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index b87f8dacfc..76c26fa21e 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -348,7 +348,7 @@ public: // snapshot functionality. // perhaps some of this should move to llfloatershapshot? -MG - BOOL saveSnapshot(const std::string& filename, S32 image_width, S32 image_height, BOOL show_ui = TRUE, BOOL do_rebuild = FALSE, LLSnapshotModel::ESnapshotLayerType type = LLSnapshotModel::SNAPSHOT_TYPE_COLOR); + BOOL saveSnapshot(const std::string& filename, S32 image_width, S32 image_height, BOOL show_ui = TRUE, BOOL do_rebuild = FALSE, LLSnapshotModel::ESnapshotLayerType type = LLSnapshotModel::SNAPSHOT_TYPE_COLOR, LLSnapshotModel::ESnapshotFormat format = LLSnapshotModel::SNAPSHOT_FORMAT_BMP); BOOL rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_height, BOOL keep_window_aspect = TRUE, BOOL is_texture = FALSE, BOOL show_ui = TRUE, BOOL do_rebuild = FALSE, LLSnapshotModel::ESnapshotLayerType type = LLSnapshotModel::SNAPSHOT_TYPE_COLOR, S32 max_size = MAX_SNAPSHOT_IMAGE_SIZE); BOOL thumbnailSnapshot(LLImageRaw *raw, S32 preview_width, S32 preview_height, BOOL show_ui, BOOL do_rebuild, LLSnapshotModel::ESnapshotLayerType type); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 27c5c1c39d..78acc61b19 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -130,9 +130,7 @@ #include "llsidepanelappearance.h" #include "fsavatarrenderpersistence.h" -#ifdef HAS_DISCORD #include "fsdiscordconnect.h" // tapping a place that happens on landing in world to start up discord -#endif extern F32 SPEED_ADJUST_MAX; extern F32 SPEED_ADJUST_MAX_SEC; @@ -724,6 +722,7 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mMeshTexturesDirty = FALSE; mHeadp = NULL; + // set up animation variables mSpeed = 0.f; setAnimationData("Speed", &mSpeed); @@ -786,8 +785,8 @@ std::string LLVOAvatar::avString() const } else { - std::string viz_string = LLVOAvatar::rezStatusToString(getRezzedStatus()); - return " Avatar '" + getFullname() + "' " + viz_string + " "; + std::string viz_string = LLVOAvatar::rezStatusToString(getRezzedStatus()); + return " Avatar '" + getFullname() + "' " + viz_string + " "; } } @@ -1408,7 +1407,7 @@ void LLVOAvatar::calculateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) if (dist_vec(zero_pos, mPelvisp->getWorldPosition())<0.001) { // Don't use pelvis until av initialized - pos.load3(getRenderPosition().mV); + pos.load3(getRenderPosition().mV); } else { @@ -1422,16 +1421,16 @@ void LLVOAvatar::calculateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) //displayed, can give inaccurate boxes due to joints stuck at (0,0,0). if ((box_detail>=1) && !isControlAvatar()) { - for (polymesh_map_t::iterator i = mPolyMeshes.begin(); i != mPolyMeshes.end(); ++i) - { - LLPolyMesh* mesh = i->second; - for (S32 joint_num = 0; joint_num < mesh->mJointRenderData.size(); joint_num++) - { - LLVector4a trans; - trans.load3( mesh->mJointRenderData[joint_num]->mWorldMatrix->getTranslation().mV); - update_min_max(newMin, newMax, trans); - } - } + for (polymesh_map_t::iterator i = mPolyMeshes.begin(); i != mPolyMeshes.end(); ++i) + { + LLPolyMesh* mesh = i->second; + for (S32 joint_num = 0; joint_num < mesh->mJointRenderData.size(); joint_num++) + { + LLVector4a trans; + trans.load3( mesh->mJointRenderData[joint_num]->mWorldMatrix->getTranslation().mV); + update_min_max(newMin, newMax, trans); + } + } } @@ -1448,25 +1447,25 @@ void LLVOAvatar::calculateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) { float max_attachment_span = get_default_max_prim_scale() * 5.0f; - for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); - iter != mAttachmentPoints.end(); - ++iter) - { - LLViewerJointAttachment* attachment = iter->second; + for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); + iter != mAttachmentPoints.end(); + ++iter) + { + LLViewerJointAttachment* attachment = iter->second; - // Possible crash fix - //if (attachment->getValid()) - if (attachment && attachment->getValid()) - // - { - for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin(); - attachment_iter != attachment->mAttachedObjects.end(); - ++attachment_iter) - { + // Possible crash fix + //if (attachment->getValid()) + if (attachment && attachment->getValid()) + // + { + for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin(); + attachment_iter != attachment->mAttachedObjects.end(); + ++attachment_iter) + { // Don't we need to look at children of attached_object as well? - const LLViewerObject* attached_object = (*attachment_iter); - if (attached_object && !attached_object->isHUDAttachment()) - { + const LLViewerObject* attached_object = (*attachment_iter); + if (attached_object && !attached_object->isHUDAttachment()) + { const LLVOVolume *vol = dynamic_cast(attached_object); if (vol && vol->isAnimatedObject()) { @@ -1488,33 +1487,33 @@ void LLVOAvatar::calculateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) { continue; } - LLDrawable* drawable = attached_object->mDrawable; - if (drawable && !drawable->isState(LLDrawable::RIGGED)) - { - LLSpatialBridge* bridge = drawable->getSpatialBridge(); - if (bridge) - { - const LLVector4a* ext = bridge->getSpatialExtents(); - LLVector4a distance; - distance.setSub(ext[1], ext[0]); - LLVector4a max_span(max_attachment_span); + LLDrawable* drawable = attached_object->mDrawable; + if (drawable && !drawable->isState(LLDrawable::RIGGED)) + { + LLSpatialBridge* bridge = drawable->getSpatialBridge(); + if (bridge) + { + const LLVector4a* ext = bridge->getSpatialExtents(); + LLVector4a distance; + distance.setSub(ext[1], ext[0]); + LLVector4a max_span(max_attachment_span); - S32 lt = distance.lessThan(max_span).getGatheredBits() & 0x7; + S32 lt = distance.lessThan(max_span).getGatheredBits() & 0x7; - // Only add the prim to spatial extents calculations if it isn't a megaprim. - // max_attachment_span calculated at the start of the function - // (currently 5 times our max prim size) - if (lt == 0x7) - { - update_min_max(newMin,newMax,ext[0]); - update_min_max(newMin,newMax,ext[1]); - } - } - } - } - } - } - } + // Only add the prim to spatial extents calculations if it isn't a megaprim. + // max_attachment_span calculated at the start of the function + // (currently 5 times our max prim size) + if (lt == 0x7) + { + update_min_max(newMin,newMax,ext[0]); + update_min_max(newMin,newMax,ext[1]); + } + } + } + } + } + } + } } // Stretch bounding box by rigged mesh joint boxes @@ -2052,7 +2051,7 @@ void LLVOAvatar::buildCharacter() // Currently disabled for control avatars (animated objects), enabled for all others. if (mEnableDefaultMotions) { - startDefaultMotions(); + startDefaultMotions(); } //------------------------------------------------------------------------- @@ -2169,8 +2168,8 @@ void LLVOAvatar::resetSkeleton(bool reset_animations) // Reset tweakable params to preserved state if (mLastProcessedAppearance) { - bool slam_params = true; - applyParsedAppearanceMessage(*mLastProcessedAppearance, slam_params); + bool slam_params = true; + applyParsedAppearanceMessage(*mLastProcessedAppearance, slam_params); } updateVisualParams(); @@ -2228,15 +2227,15 @@ void LLVOAvatar::releaseMeshData() LLFace* facep = mDrawable->getFace(0); if (facep) { - facep->setSize(0, 0); - for(S32 i = mNumInitFaces ; i < mDrawable->getNumFaces(); i++) - { - facep = mDrawable->getFace(i); + facep->setSize(0, 0); + for(S32 i = mNumInitFaces ; i < mDrawable->getNumFaces(); i++) + { + facep = mDrawable->getFace(i); if (facep) { - facep->setSize(0, 0); - } - } + facep->setSize(0, 0); + } + } } } @@ -2936,13 +2935,13 @@ void LLVOAvatar::idleUpdateMisc(bool detailed_update) if (mDrawable.notNull()) { - mDrawable->movePartition(); - - //force a move if sitting on an active object - if (getParent() && ((LLViewerObject*) getParent())->mDrawable->isActive()) - { - gPipeline.markMoved(mDrawable, TRUE); - } + mDrawable->movePartition(); + + //force a move if sitting on an active object + if (getParent() && ((LLViewerObject*) getParent())->mDrawable->isActive()) + { + gPipeline.markMoved(mDrawable, TRUE); + } } } @@ -3082,10 +3081,9 @@ void LLVOAvatar::idleUpdateLoadingEffect() // Animation Overrider AOEngine::instance().onLoginComplete(); -#ifdef HAS_DISCORD + // tapping a place that happens on landing in world to start up discord FSDiscordConnect::instance().checkConnectionToDiscord(gSavedPerAccountSettings.getBOOL("FSEnableDiscordIntegration")); -#endif } else { @@ -4118,74 +4116,74 @@ bool LLVOAvatar::isRlvSilhouette() void LLVOAvatar::updateAppearanceMessageDebugText() { - S32 central_bake_version = -1; - if (getRegion()) - { - central_bake_version = getRegion()->getCentralBakeVersion(); - } - bool all_baked_downloaded = allBakedTexturesCompletelyDownloaded(); - bool all_local_downloaded = allLocalTexturesCompletelyDownloaded(); - std::string debug_line = llformat("%s%s - mLocal: %d, mEdit: %d, mUSB: %d, CBV: %d", - isSelf() ? (all_local_downloaded ? "L" : "l") : "-", - all_baked_downloaded ? "B" : "b", - mUseLocalAppearance, mIsEditingAppearance, - // [Legacy Bake] - //1, central_bake_version); - mUseServerBakes, central_bake_version); - // [Legacy Bake] - std::string origin_string = bakedTextureOriginInfo(); - debug_line += " [" + origin_string + "]"; - S32 curr_cof_version = LLAppearanceMgr::instance().getCOFVersion(); - S32 last_request_cof_version = mLastUpdateRequestCOFVersion; - S32 last_received_cof_version = mLastUpdateReceivedCOFVersion; - if (isSelf()) - { - debug_line += llformat(" - cof: %d req: %d rcv:%d", - curr_cof_version, last_request_cof_version, last_received_cof_version); - // Use LLCachedControl - //if (gSavedSettings.getBOOL("DebugForceAppearanceRequestFailure")) - static LLCachedControl debug_force_appearance_request_failure(gSavedSettings, "DebugForceAppearanceRequestFailure"); - if (debug_force_appearance_request_failure) - // + S32 central_bake_version = -1; + if (getRegion()) + { + central_bake_version = getRegion()->getCentralBakeVersion(); + } + bool all_baked_downloaded = allBakedTexturesCompletelyDownloaded(); + bool all_local_downloaded = allLocalTexturesCompletelyDownloaded(); + std::string debug_line = llformat("%s%s - mLocal: %d, mEdit: %d, mUSB: %d, CBV: %d", + isSelf() ? (all_local_downloaded ? "L" : "l") : "-", + all_baked_downloaded ? "B" : "b", + mUseLocalAppearance, mIsEditingAppearance, + // [Legacy Bake] + //1, central_bake_version); + mUseServerBakes, central_bake_version); + // [Legacy Bake] + std::string origin_string = bakedTextureOriginInfo(); + debug_line += " [" + origin_string + "]"; + S32 curr_cof_version = LLAppearanceMgr::instance().getCOFVersion(); + S32 last_request_cof_version = mLastUpdateRequestCOFVersion; + S32 last_received_cof_version = mLastUpdateReceivedCOFVersion; + if (isSelf()) + { + debug_line += llformat(" - cof: %d req: %d rcv:%d", + curr_cof_version, last_request_cof_version, last_received_cof_version); + // Use LLCachedControl + //if (gSavedSettings.getBOOL("DebugForceAppearanceRequestFailure")) + static LLCachedControl debug_force_appearance_request_failure(gSavedSettings, "DebugForceAppearanceRequestFailure"); + if (debug_force_appearance_request_failure) + // + { + debug_line += " FORCING ERRS"; + } + } + else + { + debug_line += llformat(" - cof rcv:%d", last_received_cof_version); + } + debug_line += llformat(" bsz-z: %.3f", mBodySize[2]); + if (mAvatarOffset[2] != 0.0f) { - debug_line += " FORCING ERRS"; + debug_line += llformat("avofs-z: %.3f", mAvatarOffset[2]); } - } - else - { - debug_line += llformat(" - cof rcv:%d", last_received_cof_version); - } - debug_line += llformat(" bsz-z: %.3f", mBodySize[2]); - if (mAvatarOffset[2] != 0.0f) - { - debug_line += llformat("avofs-z: %.3f", mAvatarOffset[2]); - } - bool hover_enabled = getRegion() && getRegion()->avatarHoverHeightEnabled(); - debug_line += hover_enabled ? " H" : " h"; - const LLVector3& hover_offset = getHoverOffset(); - if (hover_offset[2] != 0.0) - { - debug_line += llformat(" hov_z: %.3f", hover_offset[2]); + bool hover_enabled = getRegion() && getRegion()->avatarHoverHeightEnabled(); + debug_line += hover_enabled ? " H" : " h"; + const LLVector3& hover_offset = getHoverOffset(); + if (hover_offset[2] != 0.0) + { + debug_line += llformat(" hov_z: %.3f", hover_offset[2]); debug_line += llformat(" %s", (isSitting() ? "S" : "T")); - debug_line += llformat("%s", (isMotionActive(ANIM_AGENT_SIT_GROUND_CONSTRAINED) ? "G" : "-")); - } + debug_line += llformat("%s", (isMotionActive(ANIM_AGENT_SIT_GROUND_CONSTRAINED) ? "G" : "-")); + } - LLVector3 ankle_right_pos_agent = mFootRightp->getWorldPosition(); - LLVector3 normal; - LLVector3 ankle_right_ground_agent = ankle_right_pos_agent; - resolveHeightAgent(ankle_right_pos_agent, ankle_right_ground_agent, normal); - F32 rightElev = llmax(-0.2f, ankle_right_pos_agent.mV[VZ] - ankle_right_ground_agent.mV[VZ]); - debug_line += llformat(" relev %.3f", rightElev); + LLVector3 ankle_right_pos_agent = mFootRightp->getWorldPosition(); + LLVector3 normal; + LLVector3 ankle_right_ground_agent = ankle_right_pos_agent; + resolveHeightAgent(ankle_right_pos_agent, ankle_right_ground_agent, normal); + F32 rightElev = llmax(-0.2f, ankle_right_pos_agent.mV[VZ] - ankle_right_ground_agent.mV[VZ]); + debug_line += llformat(" relev %.3f", rightElev); - LLVector3 root_pos = mRoot->getPosition(); - LLVector3 pelvis_pos = mPelvisp->getPosition(); - debug_line += llformat(" rp %.3f pp %.3f", root_pos[2], pelvis_pos[2]); + LLVector3 root_pos = mRoot->getPosition(); + LLVector3 pelvis_pos = mPelvisp->getPosition(); + debug_line += llformat(" rp %.3f pp %.3f", root_pos[2], pelvis_pos[2]); S32 is_visible = (S32) isVisible(); S32 is_m_visible = (S32) mVisible; debug_line += llformat(" v %d/%d", is_visible, is_m_visible); - addDebugText(debug_line); + addDebugText(debug_line); } LLViewerInventoryItem* getObjectInventoryItem(LLViewerObject *vobj, LLUUID asset_id) @@ -4197,7 +4195,7 @@ LLViewerInventoryItem* getObjectInventoryItem(LLViewerObject *vobj, LLUUID asset if (vobj->getInventorySerial()<=0) { vobj->requestInventory(); - } + } item = vobj->getInventoryItemByAsset(asset_id); } return item; @@ -4215,23 +4213,23 @@ LLViewerInventoryItem* recursiveGetObjectInventoryItem(LLViewerObject *vobj, LLU LLViewerObject *childp = *it; item = getObjectInventoryItem(childp, asset_id); if (item) - { + { break; } } - } + } return item; } void LLVOAvatar::updateAnimationDebugText() { - for (LLMotionController::motion_list_t::iterator iter = mMotionController.getActiveMotions().begin(); - iter != mMotionController.getActiveMotions().end(); ++iter) - { - LLMotion* motionp = *iter; - if (motionp->getMinPixelArea() < getPixelArea()) - { - std::string output; + for (LLMotionController::motion_list_t::iterator iter = mMotionController.getActiveMotions().begin(); + iter != mMotionController.getActiveMotions().end(); ++iter) + { + LLMotion* motionp = *iter; + if (motionp->getMinPixelArea() < getPixelArea()) + { + std::string output; std::string motion_name = motionp->getName(); if (motion_name.empty()) { @@ -4248,73 +4246,73 @@ void LLVOAvatar::updateAnimationDebugText() } } if (motion_name.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", - name.c_str(), - (U32)motionp->getPriority()); - } - else - { - output = llformat("%s - %d", + { + 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", + name.c_str(), + (U32)motionp->getPriority()); + } + else + { + output = llformat("%s - %d", motion_name.c_str(), - (U32)motionp->getPriority()); - } - addDebugText(output); - } - } + (U32)motionp->getPriority()); + } + addDebugText(output); + } + } } void LLVOAvatar::updateDebugText() @@ -4355,7 +4353,7 @@ void LLVOAvatar::updateDebugText() { setDebugText(mDebugText); } - mDebugText.clear(); + mDebugText.clear(); } //------------------------------------------------------------------------ @@ -4369,7 +4367,7 @@ void LLVOAvatar::updateFootstepSounds() { return; } - + //------------------------------------------------------------------------- // Find the ground under each foot, these are used for a variety // of things that follow @@ -4394,7 +4392,7 @@ void LLVOAvatar::updateFootstepSounds() if (!mInAir) { if ((leftElev < 0.0f) || (rightElev < 0.0f)) - { + { ankle_left_pos_agent = mFootLeftp->getWorldPosition(); ankle_right_pos_agent = mFootRightp->getWorldPosition(); leftElev = ankle_left_pos_agent.mV[VZ] - ankle_left_ground_agent.mV[VZ]; @@ -4423,10 +4421,10 @@ void LLVOAvatar::updateFootstepSounds() // did right foot hit the ground? if ( onGroundRight && !mWasOnGroundRight ) - { + { foot_pos_agent = ankle_right_pos_agent; playSound = TRUE; - } + } mWasOnGroundLeft = onGroundLeft; mWasOnGroundRight = onGroundRight; @@ -4511,6 +4509,7 @@ void LLVOAvatar::computeUpdatePeriod() } } + //------------------------------------------------------------------------ // updateOrientation() // Factored out from updateCharacter() @@ -4521,157 +4520,157 @@ void LLVOAvatar::computeUpdatePeriod() //------------------------------------------------------------------------ void LLVOAvatar::updateOrientation(LLAgent& agent, F32 speed, F32 delta_time) { - LLQuaternion iQ; - LLVector3 upDir( 0.0f, 0.0f, 1.0f ); - - // Compute a forward direction vector derived from the primitive rotation - // and the velocity vector. When walking or jumping, don't let body deviate - // more than 90 from the view, if necessary, flip the velocity vector. - - LLVector3 primDir; - if (isSelf()) - { - primDir = agent.getAtAxis() - projected_vec(agent.getAtAxis(), agent.getReferenceUpVector()); - primDir.normalize(); - } - else - { - primDir = getRotation().getMatrix3().getFwdRow(); - } - LLVector3 velDir = getVelocity(); - velDir.normalize(); - // Disable avatar turning towards camera when walking backwards - //if ( mSignaledAnimations.find(ANIM_AGENT_WALK) != mSignaledAnimations.end()) - static LLCachedControl walk_backwards(gSavedSettings, "FSDisableTurningAroundWhenWalkingBackwards"); - if (walk_backwards && mSignaledAnimations.find(ANIM_AGENT_WALK) != mSignaledAnimations.end()) - // - { - F32 vpD = velDir * primDir; - if (vpD < -0.5f) - { - velDir *= -1.0f; - } - } - LLVector3 fwdDir = lerp(primDir, velDir, clamp_rescale(speed, 0.5f, 2.0f, 0.0f, 1.0f)); - if (isSelf() && gAgentCamera.cameraMouselook()) - { - // make sure fwdDir stays in same general direction as primdir - if (gAgent.getFlying()) - { - fwdDir = LLViewerCamera::getInstance()->getAtAxis(); - } - else - { - LLVector3 at_axis = LLViewerCamera::getInstance()->getAtAxis(); - LLVector3 up_vector = gAgent.getReferenceUpVector(); - at_axis -= up_vector * (at_axis * up_vector); - at_axis.normalize(); + LLQuaternion iQ; + LLVector3 upDir( 0.0f, 0.0f, 1.0f ); - F32 dot = fwdDir * at_axis; - if (dot < 0.f) - { - fwdDir -= 2.f * at_axis * dot; - fwdDir.normalize(); - } - } - } + // Compute a forward direction vector derived from the primitive rotation + // and the velocity vector. When walking or jumping, don't let body deviate + // more than 90 from the view, if necessary, flip the velocity vector. - LLQuaternion root_rotation = mRoot->getWorldMatrix().quaternion(); - F32 root_roll, root_pitch, root_yaw; - root_rotation.getEulerAngles(&root_roll, &root_pitch, &root_yaw); + LLVector3 primDir; + if (isSelf()) + { + primDir = agent.getAtAxis() - projected_vec(agent.getAtAxis(), agent.getReferenceUpVector()); + primDir.normalize(); + } + else + { + primDir = getRotation().getMatrix3().getFwdRow(); + } + LLVector3 velDir = getVelocity(); + velDir.normalize(); + // Disable avatar turning towards camera when walking backwards + //if ( mSignaledAnimations.find(ANIM_AGENT_WALK) != mSignaledAnimations.end()) + static LLCachedControl walk_backwards(gSavedSettings, "FSDisableTurningAroundWhenWalkingBackwards"); + if (walk_backwards && mSignaledAnimations.find(ANIM_AGENT_WALK) != mSignaledAnimations.end()) + // + { + F32 vpD = velDir * primDir; + if (vpD < -0.5f) + { + velDir *= -1.0f; + } + } + LLVector3 fwdDir = lerp(primDir, velDir, clamp_rescale(speed, 0.5f, 2.0f, 0.0f, 1.0f)); + if (isSelf() && gAgentCamera.cameraMouselook()) + { + // make sure fwdDir stays in same general direction as primdir + if (gAgent.getFlying()) + { + fwdDir = LLViewerCamera::getInstance()->getAtAxis(); + } + else + { + LLVector3 at_axis = LLViewerCamera::getInstance()->getAtAxis(); + LLVector3 up_vector = gAgent.getReferenceUpVector(); + at_axis -= up_vector * (at_axis * up_vector); + at_axis.normalize(); + + F32 dot = fwdDir * at_axis; + if (dot < 0.f) + { + fwdDir -= 2.f * at_axis * dot; + fwdDir.normalize(); + } + } + } - // When moving very slow, the pelvis is allowed to deviate from the + LLQuaternion root_rotation = mRoot->getWorldMatrix().quaternion(); + F32 root_roll, root_pitch, root_yaw; + root_rotation.getEulerAngles(&root_roll, &root_pitch, &root_yaw); + + // When moving very slow, the pelvis is allowed to deviate from the // forward direction to allow it to hold its position while the torso - // and head turn. Once in motion, it must conform however. - BOOL self_in_mouselook = isSelf() && gAgentCamera.cameraMouselook(); + // and head turn. Once in motion, it must conform however. + BOOL self_in_mouselook = isSelf() && gAgentCamera.cameraMouselook(); - LLVector3 pelvisDir( mRoot->getWorldMatrix().getFwdRow4().mV ); + LLVector3 pelvisDir( mRoot->getWorldMatrix().getFwdRow4().mV ); - static LLCachedControl s_pelvis_rot_threshold_slow(gSavedSettings, "AvatarRotateThresholdSlow", 60.0); - static LLCachedControl s_pelvis_rot_threshold_fast(gSavedSettings, "AvatarRotateThresholdFast", 2.0); + static LLCachedControl s_pelvis_rot_threshold_slow(gSavedSettings, "AvatarRotateThresholdSlow", 60.0); + static LLCachedControl s_pelvis_rot_threshold_fast(gSavedSettings, "AvatarRotateThresholdFast", 2.0); - F32 pelvis_rot_threshold = clamp_rescale(speed, 0.1f, 1.0f, s_pelvis_rot_threshold_slow, s_pelvis_rot_threshold_fast); + F32 pelvis_rot_threshold = clamp_rescale(speed, 0.1f, 1.0f, s_pelvis_rot_threshold_slow, s_pelvis_rot_threshold_fast); - if (self_in_mouselook) - { - pelvis_rot_threshold *= MOUSELOOK_PELVIS_FOLLOW_FACTOR; - } - pelvis_rot_threshold *= DEG_TO_RAD; + if (self_in_mouselook) + { + pelvis_rot_threshold *= MOUSELOOK_PELVIS_FOLLOW_FACTOR; + } + pelvis_rot_threshold *= DEG_TO_RAD; - F32 angle = angle_between( pelvisDir, fwdDir ); + F32 angle = angle_between( pelvisDir, fwdDir ); - // The avatar's root is allowed to have a yaw that deviates widely - // from the forward direction, but if roll or pitch are off even - // a little bit we need to correct the rotation. - if(root_roll < 1.f * DEG_TO_RAD - && root_pitch < 5.f * DEG_TO_RAD) - { - // smaller correction vector means pelvis follows prim direction more closely - if (!mTurning && angle > pelvis_rot_threshold*0.75f) - { - mTurning = TRUE; - } + // The avatar's root is allowed to have a yaw that deviates widely + // from the forward direction, but if roll or pitch are off even + // a little bit we need to correct the rotation. + if(root_roll < 1.f * DEG_TO_RAD + && root_pitch < 5.f * DEG_TO_RAD) + { + // smaller correction vector means pelvis follows prim direction more closely + if (!mTurning && angle > pelvis_rot_threshold*0.75f) + { + mTurning = TRUE; + } - // use tighter threshold when turning - if (mTurning) - { - pelvis_rot_threshold *= 0.4f; - } + // use tighter threshold when turning + if (mTurning) + { + pelvis_rot_threshold *= 0.4f; + } - // am I done turning? - if (angle < pelvis_rot_threshold) - { - mTurning = FALSE; - } + // am I done turning? + if (angle < pelvis_rot_threshold) + { + mTurning = FALSE; + } - LLVector3 correction_vector = (pelvisDir - fwdDir) * clamp_rescale(angle, pelvis_rot_threshold*0.75f, pelvis_rot_threshold, 1.0f, 0.0f); - fwdDir += correction_vector; - } - else - { - mTurning = FALSE; - } + LLVector3 correction_vector = (pelvisDir - fwdDir) * clamp_rescale(angle, pelvis_rot_threshold*0.75f, pelvis_rot_threshold, 1.0f, 0.0f); + fwdDir += correction_vector; + } + else + { + mTurning = FALSE; + } - // Now compute the full world space rotation for the whole body (wQv) - LLVector3 leftDir = upDir % fwdDir; - leftDir.normalize(); - fwdDir = leftDir % upDir; - LLQuaternion wQv( fwdDir, leftDir, upDir ); + // Now compute the full world space rotation for the whole body (wQv) + LLVector3 leftDir = upDir % fwdDir; + leftDir.normalize(); + fwdDir = leftDir % upDir; + LLQuaternion wQv( fwdDir, leftDir, upDir ); - if (isSelf() && mTurning) - { - if ((fwdDir % pelvisDir) * upDir > 0.f) - { - gAgent.setControlFlags(AGENT_CONTROL_TURN_RIGHT); - } - else - { - gAgent.setControlFlags(AGENT_CONTROL_TURN_LEFT); - } - } + if (isSelf() && mTurning) + { + if ((fwdDir % pelvisDir) * upDir > 0.f) + { + gAgent.setControlFlags(AGENT_CONTROL_TURN_RIGHT); + } + else + { + gAgent.setControlFlags(AGENT_CONTROL_TURN_LEFT); + } + } - // Set the root rotation, but do so incrementally so that it - // lags in time by some fixed amount. - //F32 u = LLSmoothInterpolation::getInterpolant(PELVIS_LAG); - F32 pelvis_lag_time = 0.f; - if (self_in_mouselook) - { - pelvis_lag_time = PELVIS_LAG_MOUSELOOK; - } - else if (mInAir) - { - pelvis_lag_time = PELVIS_LAG_FLYING; - // increase pelvis lag time when moving slowly - pelvis_lag_time *= clamp_rescale(mSpeedAccum, 0.f, 15.f, 3.f, 1.f); - } - else - { - pelvis_lag_time = PELVIS_LAG_WALKING; - } + // Set the root rotation, but do so incrementally so that it + // lags in time by some fixed amount. + //F32 u = LLSmoothInterpolation::getInterpolant(PELVIS_LAG); + F32 pelvis_lag_time = 0.f; + if (self_in_mouselook) + { + pelvis_lag_time = PELVIS_LAG_MOUSELOOK; + } + else if (mInAir) + { + pelvis_lag_time = PELVIS_LAG_FLYING; + // increase pelvis lag time when moving slowly + pelvis_lag_time *= clamp_rescale(mSpeedAccum, 0.f, 15.f, 3.f, 1.f); + } + else + { + pelvis_lag_time = PELVIS_LAG_WALKING; + } F32 u = llclamp((delta_time / pelvis_lag_time), 0.0f, 1.0f); - mRoot->setWorldRotation( slerp(u, mRoot->getWorldRotation(), wQv) ); + mRoot->setWorldRotation( slerp(u, mRoot->getWorldRotation(), wQv) ); } //------------------------------------------------------------------------ @@ -4745,7 +4744,7 @@ void LLVOAvatar::updateRootPositionAndRotation(LLAgent& agent, F32 speed, bool w mRoot->setWorldPosition( getPositionAgent() ); // first frame mRoot->setWorldRotation( getRotation() ); } - + //-------------------------------------------------------------------- // dont' let dT get larger than 1/5th of a second //-------------------------------------------------------------------- @@ -4996,7 +4995,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) mRoot->updateWorldMatrixChildren(); // System avatar mesh vertices need to be reskinned. - mNeedsSkin = TRUE; + mNeedsSkin = TRUE; return TRUE; } @@ -5517,14 +5516,14 @@ U32 LLVOAvatar::renderTransparent(BOOL first_pass) first_pass = FALSE; } if (isTextureVisible(TEX_HAIR_BAKED)) - { - LLViewerJoint* hair_mesh = getViewerJoint(MESH_ID_HAIR); - if (hair_mesh) - { - num_indices += hair_mesh->render(mAdjustedPixelArea, first_pass, mIsDummy); - } - first_pass = FALSE; - } + { + LLViewerJoint* hair_mesh = getViewerJoint(MESH_ID_HAIR); + if (hair_mesh) + { + num_indices += hair_mesh->render(mAdjustedPixelArea, first_pass, mIsDummy); + } + first_pass = FALSE; + } if (LLPipeline::sImpostorRender) { gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); @@ -5632,41 +5631,41 @@ U32 LLVOAvatar::renderImpostor(LLColor4U color, S32 diffuse_channel) gGL.flush(); } { - LLGLEnable test(GL_ALPHA_TEST); - gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.f); + LLGLEnable test(GL_ALPHA_TEST); + gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.f); - gGL.color4ubv(color.mV); - gGL.getTexUnit(diffuse_channel)->bind(&mImpostor); - // Remove QUADS rendering mode - //gGL.begin(LLRender::QUADS); - //gGL.texCoord2f(0,0); - //gGL.vertex3fv((pos+left-up).mV); - //gGL.texCoord2f(1,0); - //gGL.vertex3fv((pos-left-up).mV); - //gGL.texCoord2f(1,1); - //gGL.vertex3fv((pos-left+up).mV); - //gGL.texCoord2f(0,1); - //gGL.vertex3fv((pos+left+up).mV); - //gGL.end(); - gGL.begin(LLRender::TRIANGLES); - { - gGL.texCoord2f(0.f, 0.f); - gGL.vertex3fv((pos + left - up).mV); - gGL.texCoord2f(1.f, 0.f); - gGL.vertex3fv((pos - left - up).mV); - gGL.texCoord2f(1.f, 1.f); - gGL.vertex3fv((pos - left + up).mV); + gGL.color4ubv(color.mV); + gGL.getTexUnit(diffuse_channel)->bind(&mImpostor); + // Remove QUADS rendering mode + //gGL.begin(LLRender::QUADS); + //gGL.texCoord2f(0,0); + //gGL.vertex3fv((pos+left-up).mV); + //gGL.texCoord2f(1,0); + //gGL.vertex3fv((pos-left-up).mV); + //gGL.texCoord2f(1,1); + //gGL.vertex3fv((pos-left+up).mV); + //gGL.texCoord2f(0,1); + //gGL.vertex3fv((pos+left+up).mV); + //gGL.end(); + gGL.begin(LLRender::TRIANGLES); + { + gGL.texCoord2f(0.f, 0.f); + gGL.vertex3fv((pos + left - up).mV); + gGL.texCoord2f(1.f, 0.f); + gGL.vertex3fv((pos - left - up).mV); + gGL.texCoord2f(1.f, 1.f); + gGL.vertex3fv((pos - left + up).mV); - gGL.texCoord2f(0.f, 0.f); - gGL.vertex3fv((pos + left - up).mV); - gGL.texCoord2f(1.f, 1.f); - gGL.vertex3fv((pos - left + up).mV); - gGL.texCoord2f(0.f, 1.f); - gGL.vertex3fv((pos + left + up).mV); - } - gGL.end(); - // - gGL.flush(); + gGL.texCoord2f(0.f, 0.f); + gGL.vertex3fv((pos + left - up).mV); + gGL.texCoord2f(1.f, 1.f); + gGL.vertex3fv((pos - left + up).mV); + gGL.texCoord2f(0.f, 1.f); + gGL.vertex3fv((pos + left + up).mV); + } + gGL.end(); + // + gGL.flush(); } return 6; @@ -6192,8 +6191,8 @@ void LLVOAvatar::processAnimationStateChanges() stopMotion(ANIM_AGENT_WALK_ADJUST); if (mEnableDefaultMotions) { - startMotion(ANIM_AGENT_FLY_ADJUST); - } + startMotion(ANIM_AGENT_FLY_ADJUST); + } } else { @@ -6205,7 +6204,7 @@ void LLVOAvatar::processAnimationStateChanges() { if (mEnableDefaultMotions) { - startMotion(ANIM_AGENT_TARGET); + startMotion(ANIM_AGENT_TARGET); } stopMotion(ANIM_AGENT_BODY_NOISE); } @@ -6214,8 +6213,8 @@ void LLVOAvatar::processAnimationStateChanges() stopMotion(ANIM_AGENT_TARGET); if (mEnableDefaultMotions) { - startMotion(ANIM_AGENT_BODY_NOISE); - } + startMotion(ANIM_AGENT_BODY_NOISE); + } } // clear all current animations @@ -6455,6 +6454,11 @@ BOOL LLVOAvatar::startMotion(const LLUUID& id, F32 time_offset) else { gAgent.sendAnimationRequest(remap_id, ANIM_REQUEST_START); + + // since we did an override, there is no need to do anything else, + // specifically not the startMotion() part at the bottom of this function + // See FIRE-29020 + return true; } } else @@ -6496,6 +6500,11 @@ BOOL LLVOAvatar::stopMotion(const LLUUID& id, BOOL stop_immediate) else { gAgent.sendAnimationRequest(remap_id, ANIM_REQUEST_STOP); + + // since we did an override, there is no need to do anything else, + // specifically not the stopMotion() part at the bottom of this function + // See FIRE-29020 + return true; } } else @@ -6579,7 +6588,7 @@ LLJoint *LLVOAvatar::getJoint( const JointKey &name ) LLJoint* jointp = NULL; - if( iter == mJointMap.end() || iter->second == NULL ) + if (iter == mJointMap.end() || iter->second == NULL) { //search for joint and cache found joint in lookup table jointp = mRoot->findJoint( name.mName ); mJointMap[ name.mKey ] = jointp; @@ -6648,10 +6657,10 @@ bool LLVOAvatar::getRiggedMeshID(LLViewerObject* pVO, LLUUID& mesh_id) if (pSkinData && pSkinData->mJointNames.size() > JOINT_COUNT_REQUIRED_FOR_FULLRIG // full rig && pSkinData->mAlternateBindMatrix.size() > 0 ) - { - mesh_id = pSkinData->mMeshID; - return true; - } + { + mesh_id = pSkinData->mMeshID; + return true; + } } } return false; @@ -6660,14 +6669,14 @@ bool LLVOAvatar::getRiggedMeshID(LLViewerObject* pVO, LLUUID& mesh_id) bool LLVOAvatar::jointIsRiggedTo(const LLJoint *joint) const { if (joint) - { + { const LLJointRiggingInfoTab& tab = mJointRiggingInfoTab; S32 joint_num = joint->getJointNum(); if (joint_num < tab.size() && tab[joint_num].isRiggedTo()) - { - return true; + { + return true; + } } - } return false; } @@ -6676,25 +6685,25 @@ void LLVOAvatar::clearAttachmentOverrides() LLScopedContextString str("clearAttachmentOverrides " + getFullname()); for (S32 i=0; iclearAttachmentPosOverrides(); pJoint->clearAttachmentScaleOverrides(); } - } + } if (mPelvisFixups.count()>0) { mPelvisFixups.clear(); LLJoint* pJointPelvis = getJoint("mPelvis"); if (pJointPelvis) - { + { pJointPelvis->setPosition( LLVector3( 0.0f, 0.0f, 0.0f) ); } postPelvisSetRecalc(); - } + } mActiveOverrideMeshes.clear(); onActiveOverrideMeshesChanged(); @@ -6715,7 +6724,7 @@ void LLVOAvatar::rebuildAttachmentOverrides() // Handle the case that we're resetting the skeleton of an animated object. LLControlAvatar *control_av = dynamic_cast(this); if (control_av) - { + { LLVOVolume *volp = control_av->mRootVolp; if (volp) { @@ -6852,9 +6861,9 @@ void LLVOAvatar::updateAttachmentOverrides() if (scale_overrides_by_joint[joint_num] != joint->m_attachmentScaleOverrides) { mismatched = true; - } } } + } if (pelvis_fixups != mPelvisFixups) { mismatched = true; @@ -6873,10 +6882,10 @@ void LLVOAvatar::updateAttachmentOverrides() void LLVOAvatar::addAttachmentOverridesForObject(LLViewerObject *vo, std::set* meshes_seen, bool recursive) { if (vo->getAvatar() != this && vo->getAvatarAncestor() != this) - { + { LL_WARNS("Avatar") << "called with invalid avatar" << LL_ENDL; return; - } + } LLScopedContextString str("addAttachmentOverridesForObject " + getFullname()); @@ -6886,14 +6895,14 @@ void LLVOAvatar::addAttachmentOverridesForObject(LLViewerObject *vo, std::setgetChildren(); - for (LLViewerObject::const_child_list_t::const_iterator it = children.begin(); - it != children.end(); ++it) - { - LLViewerObject *childp = *it; + LLViewerObject::const_child_list_t& children = vo->getChildren(); + for (LLViewerObject::const_child_list_t::const_iterator it = children.begin(); + it != children.end(); ++it) + { + LLViewerObject *childp = *it; addAttachmentOverridesForObject(childp, meshes_seen, true); } - } + } LLVOVolume *vobj = dynamic_cast(vo); bool pelvisGotSet = false; @@ -7165,7 +7174,7 @@ void LLVOAvatar::removeAttachmentOverridesForObject(const LLUUID& mesh_id) const std::string av_string = avString(); for (S32 joint_num = 0; joint_num < LL_CHARACTER_MAX_ANIMATED_JOINTS; joint_num++) - { + { LLJoint *pJoint = getJoint(joint_num); if ( pJoint ) { @@ -8037,26 +8046,27 @@ BOOL LLVOAvatar::detachObject(LLViewerObject *viewer_object) if (attachment && attachment->isObjectAttached(viewer_object)) // { - updateVisualComplexity(); + updateVisualComplexity(); bool is_animated_object = viewer_object->isAnimatedObject(); cleanupAttachedMesh(viewer_object); + attachment->removeObject(viewer_object); if (!is_animated_object) { updateAttachmentOverrides(); } viewer_object->refreshBakeTexture(); - + LLViewerObject::const_child_list_t& child_list = viewer_object->getChildren(); for (LLViewerObject::child_list_t::const_iterator iter1 = child_list.begin(); iter1 != child_list.end(); ++iter1) { LLViewerObject* objectp = *iter1; if (objectp) - { + { objectp->refreshBakeTexture(); } - } + } updateMeshVisibility(); @@ -8209,7 +8219,7 @@ void LLVOAvatar::getOffObject() if (mEnableDefaultMotions) { - startMotion(ANIM_AGENT_BODY_NOISE); + startMotion(ANIM_AGENT_BODY_NOISE); } if (isSelf()) @@ -8741,8 +8751,8 @@ bool LLVOAvatar::isTooComplex() const // yes, this leaves them vulnerable to griefing objects... their choice too_complex = ( max_render_cost > 0 && (mVisualComplexity > max_render_cost - || (max_attachment_area > 0.0f && mAttachmentSurfaceArea > max_attachment_area) - )); + || (max_attachment_area > 0.0f && mAttachmentSurfaceArea > max_attachment_area) + )); } return too_complex; @@ -11182,136 +11192,136 @@ void LLVOAvatar::accountRenderComplexityForObject( // { if (attached_object && !attached_object->isHUDAttachment()) - { + { mAttachmentVisibleTriangleCount += attached_object->recursiveGetTriangleCount(); mAttachmentEstTriangleCount += attached_object->recursiveGetEstTrianglesMax(); mAttachmentSurfaceArea += attached_object->recursiveGetScaledSurfaceArea(); - textures.clear(); - const LLDrawable* drawable = attached_object->mDrawable; - if (drawable) - { - const LLVOVolume* volume = drawable->getVOVolume(); - if (volume) - { - F32 attachment_total_cost = 0; - F32 attachment_volume_cost = 0; - F32 attachment_texture_cost = 0; - F32 attachment_children_cost = 0; + textures.clear(); + const LLDrawable* drawable = attached_object->mDrawable; + if (drawable) + { + const LLVOVolume* volume = drawable->getVOVolume(); + if (volume) + { + F32 attachment_total_cost = 0; + F32 attachment_volume_cost = 0; + F32 attachment_texture_cost = 0; + F32 attachment_children_cost = 0; const F32 animated_object_attachment_surcharge = 1000; if (attached_object->isAnimatedObject()) { attachment_volume_cost += animated_object_attachment_surcharge; } - attachment_volume_cost += volume->getRenderCost(textures); + attachment_volume_cost += volume->getRenderCost(textures); - const_child_list_t children = volume->getChildren(); - for (const_child_list_t::const_iterator child_iter = children.begin(); - child_iter != children.end(); - ++child_iter) - { - LLViewerObject* child_obj = *child_iter; - LLVOVolume *child = dynamic_cast( child_obj ); - if (child) - { - attachment_children_cost += child->getRenderCost(textures); - } - } + const_child_list_t children = volume->getChildren(); + for (const_child_list_t::const_iterator child_iter = children.begin(); + child_iter != children.end(); + ++child_iter) + { + LLViewerObject* child_obj = *child_iter; + LLVOVolume *child = dynamic_cast( child_obj ); + if (child) + { + attachment_children_cost += child->getRenderCost(textures); + } + } - for (LLVOVolume::texture_cost_t::iterator volume_texture = textures.begin(); - volume_texture != textures.end(); - ++volume_texture) - { - // add the cost of each individual texture in the linkset - attachment_texture_cost += volume_texture->second; - } - attachment_total_cost = attachment_volume_cost + attachment_texture_cost + attachment_children_cost; - LL_DEBUGS("ARCdetail") << "Attachment costs " << attached_object->getAttachmentItemID() - << " total: " << attachment_total_cost - << ", volume: " << attachment_volume_cost - << ", textures: " << attachment_texture_cost - << ", " << volume->numChildren() - << " children: " << attachment_children_cost - << LL_ENDL; - // Limit attachment complexity to avoid signed integer flipping of the wearer's ACI - cost += (U32)llclamp(attachment_total_cost, MIN_ATTACHMENT_COMPLEXITY, max_attachment_complexity); + for (LLVOVolume::texture_cost_t::iterator volume_texture = textures.begin(); + volume_texture != textures.end(); + ++volume_texture) + { + // add the cost of each individual texture in the linkset + attachment_texture_cost += volume_texture->second; + } + attachment_total_cost = attachment_volume_cost + attachment_texture_cost + attachment_children_cost; + LL_DEBUGS("ARCdetail") << "Attachment costs " << attached_object->getAttachmentItemID() + << " total: " << attachment_total_cost + << ", volume: " << attachment_volume_cost + << ", textures: " << attachment_texture_cost + << ", " << volume->numChildren() + << " children: " << attachment_children_cost + << LL_ENDL; + // Limit attachment complexity to avoid signed integer flipping of the wearer's ACI + cost += (U32)llclamp(attachment_total_cost, MIN_ATTACHMENT_COMPLEXITY, max_attachment_complexity); - // Show per-item complexity in COF - if (isSelf()) + // Show per-item complexity in COF + if (isSelf()) + { + if (!attached_object->isTempAttachment()) + { + item_complexity.insert(std::make_pair(attached_object->getAttachmentItemID(), (U32)attachment_total_cost)); + } + else + { + temp_item_complexity.insert(std::make_pair(attached_object->getID(), (U32)attachment_total_cost)); + } + } + // + } + } + } + if (isSelf() + && attached_object + && attached_object->isHUDAttachment() + && !attached_object->isTempAttachment() + && attached_object->mDrawable) { - if (!attached_object->isTempAttachment()) - { - item_complexity.insert(std::make_pair(attached_object->getAttachmentItemID(), (U32)attachment_total_cost)); - } - else - { - temp_item_complexity.insert(std::make_pair(attached_object->getID(), (U32)attachment_total_cost)); - } - } - // - } - } - } - if (isSelf() - && attached_object - && attached_object->isHUDAttachment() - && !attached_object->isTempAttachment() - && attached_object->mDrawable) - { - textures.clear(); + textures.clear(); mAttachmentSurfaceArea += attached_object->recursiveGetScaledSurfaceArea(); - const LLVOVolume* volume = attached_object->mDrawable->getVOVolume(); - if (volume) - { - LLHUDComplexity hud_object_complexity; - hud_object_complexity.objectName = attached_object->getAttachmentItemName(); - hud_object_complexity.objectId = attached_object->getAttachmentItemID(); - std::string joint_name; - gAgentAvatarp->getAttachedPointName(attached_object->getAttachmentItemID(), joint_name); - hud_object_complexity.jointName = joint_name; - // get cost and individual textures - hud_object_complexity.objectsCost += volume->getRenderCost(textures); - hud_object_complexity.objectsCount++; - - LLViewerObject::const_child_list_t& child_list = attached_object->getChildren(); - for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); - iter != child_list.end(); ++iter) - { - LLViewerObject* childp = *iter; - const LLVOVolume* chld_volume = dynamic_cast(childp); - if (chld_volume) - { - // get cost and individual textures - hud_object_complexity.objectsCost += chld_volume->getRenderCost(textures); - hud_object_complexity.objectsCount++; - } - } - - hud_object_complexity.texturesCount += textures.size(); - - for (LLVOVolume::texture_cost_t::iterator volume_texture = textures.begin(); - volume_texture != textures.end(); - ++volume_texture) - { - // add the cost of each individual texture (ignores duplicates) - hud_object_complexity.texturesCost += volume_texture->second; - LLViewerFetchedTexture *tex = LLViewerTextureManager::getFetchedTexture(volume_texture->first); - if (tex) - { - // Note: Texture memory might be incorect since texture might be still loading. - hud_object_complexity.texturesMemoryTotal += tex->getTextureMemory(); - if (tex->getOriginalHeight() * tex->getOriginalWidth() >= HUD_OVERSIZED_TEXTURE_DATA_SIZE) + const LLVOVolume* volume = attached_object->mDrawable->getVOVolume(); + if (volume) { - hud_object_complexity.largeTexturesCount++; + LLHUDComplexity hud_object_complexity; + hud_object_complexity.objectName = attached_object->getAttachmentItemName(); + hud_object_complexity.objectId = attached_object->getAttachmentItemID(); + std::string joint_name; + gAgentAvatarp->getAttachedPointName(attached_object->getAttachmentItemID(), joint_name); + hud_object_complexity.jointName = joint_name; + // get cost and individual textures + hud_object_complexity.objectsCost += volume->getRenderCost(textures); + hud_object_complexity.objectsCount++; + + LLViewerObject::const_child_list_t& child_list = attached_object->getChildren(); + for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); + iter != child_list.end(); ++iter) + { + LLViewerObject* childp = *iter; + const LLVOVolume* chld_volume = dynamic_cast(childp); + if (chld_volume) + { + // get cost and individual textures + hud_object_complexity.objectsCost += chld_volume->getRenderCost(textures); + hud_object_complexity.objectsCount++; + } + } + + hud_object_complexity.texturesCount += textures.size(); + + for (LLVOVolume::texture_cost_t::iterator volume_texture = textures.begin(); + volume_texture != textures.end(); + ++volume_texture) + { + // add the cost of each individual texture (ignores duplicates) + hud_object_complexity.texturesCost += volume_texture->second; + LLViewerFetchedTexture *tex = LLViewerTextureManager::getFetchedTexture(volume_texture->first); + if (tex) + { + // Note: Texture memory might be incorect since texture might be still loading. + hud_object_complexity.texturesMemoryTotal += tex->getTextureMemory(); + if (tex->getOriginalHeight() * tex->getOriginalWidth() >= HUD_OVERSIZED_TEXTURE_DATA_SIZE) + { + hud_object_complexity.largeTexturesCount++; + } + } + } + hud_complexity_list.push_back(hud_object_complexity); } } - } - hud_complexity_list.push_back(hud_object_complexity); - } - } } // Calculations for mVisualComplexity value @@ -11526,6 +11536,11 @@ void LLVOAvatar::calcMutedAVColor() new_color = LLColor4::grey4; change_msg = " blocked: color is grey4"; } + else if (!isTooComplex()) + { + new_color = LLColor4::white; + change_msg = " simple imposter "; + } // else if ( mMutedAVColor == LLColor4::white || mMutedAVColor == LLColor4::grey3 || mMutedAVColor == LLColor4::grey4 ) // [RLVa:KB] - Checked: RLVa-2.2 (@setcam_avdist) else if ( mMutedAVColor == LLColor4::white || mMutedAVColor == LLColor4::grey3 || mMutedAVColor == LLColor4::grey4 || mMutedAVColor == LLColor4::silhouette) diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index c15cab4183..a3c9511b95 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -1370,10 +1370,10 @@ void LLWorld::updateWaterObjects() } } - for (std::list::iterator iter = mHoleWaterObjects.begin(); + for (std::list >::iterator iter = mHoleWaterObjects.begin(); iter != mHoleWaterObjects.end(); ++ iter) { - LLVOWater* waterp = *iter; + LLVOWater* waterp = (*iter).get(); gObjectList.killObject(waterp); } mHoleWaterObjects.clear(); diff --git a/indra/newview/llworld.h b/indra/newview/llworld.h index aff8e4aa45..c1848ec863 100644 --- a/indra/newview/llworld.h +++ b/indra/newview/llworld.h @@ -312,7 +312,7 @@ private: // Data for "Fake" objects // - std::list mHoleWaterObjects; + std::list > mHoleWaterObjects; LLPointer mEdgeWaterObjects[8]; LLPointer mDefaultWaterTexturep; diff --git a/indra/newview/rlvcommon.cpp b/indra/newview/rlvcommon.cpp index d8fb85a7d5..9eaea8d394 100644 --- a/indra/newview/rlvcommon.cpp +++ b/indra/newview/rlvcommon.cpp @@ -344,8 +344,11 @@ void RlvStrings::saveToFile(const std::string& strFilePath) } // Checked: 2009-11-11 (RLVa-1.1.0a) | Modified: RLVa-1.1.0a -const std::string& RlvStrings::getAnonym(const std::string& strName) +std::string RlvStrings::getAnonym(const std::string& strName) { + if (!rlv_handler_t::isEnabled()) + return strName; + const char* pszName = strName.c_str(); U32 nHash = 0; // Test with 11,264 SL names showed a 3.33% - 3.82% occurance for each so we *should* get a very even spread @@ -906,7 +909,7 @@ BOOL rlvEnableSharedWearEnabler(void* pParam) */ // Checked: 2010-11-01 (RLVa-1.2.2a) | Added: RLVa-1.2.2a -const std::string& rlvGetAnonym(const LLAvatarName& avName) +std::string rlvGetAnonym(const LLAvatarName& avName) { return RlvStrings::getAnonym(avName); } diff --git a/indra/newview/rlvcommon.h b/indra/newview/rlvcommon.h index c224fcbf6c..50dc08283f 100644 --- a/indra/newview/rlvcommon.h +++ b/indra/newview/rlvcommon.h @@ -145,8 +145,8 @@ public: static void loadFromFile(const std::string& strFilePath, bool fDefault); static void saveToFile(const std::string& strFilePath); - static const std::string& getAnonym(const LLAvatarName& avName); // @shownames - static const std::string& getAnonym(const std::string& strName); // @shownames + static std::string getAnonym(const LLAvatarName& avName); // @shownames + static std::string getAnonym(const std::string& strName); // @shownames static const std::string& getString(const std::string& strStringName); static const char* getStringFromReturnCode(ERlvCmdRet eRet); static const std::string& getStringMapPath() { return m_StringMapPath; } @@ -307,7 +307,7 @@ template struct RlvPredValuesEqual // // Checked: 2010-10-31 (RLVa-1.2.2a) | Added: RLVa-1.2.2a -inline const std::string& RlvStrings::getAnonym(const LLAvatarName& avName) +inline std::string RlvStrings::getAnonym(const LLAvatarName& avName) { return getAnonym(avName.getLegacyName()); } diff --git a/indra/newview/skins/default/xui/da/panel_preferences_setup.xml b/indra/newview/skins/default/xui/da/panel_preferences_setup.xml index 808723dfce..e1b845d02d 100644 --- a/indra/newview/skins/default/xui/da/panel_preferences_setup.xml +++ b/indra/newview/skins/default/xui/da/panel_preferences_setup.xml @@ -3,7 +3,7 @@ - Maksimum båndbredde ([http://wiki.phoenixviewer.com/fs_speedtest need a suggestion?]): + Maksimum båndbredde ([http://wiki.firestormviewer.org/fs_speedtest need a suggestion?]): @@ -14,7 +14,7 @@ - Cache størrelse ([http://wiki.phoenixviewer.com/cache need a suggestion?]): + Cache størrelse ([http://wiki.firestormviewer.org/cache need a suggestion?]): Cache placering: diff --git a/indra/newview/skins/default/xui/de/floater_about_land.xml b/indra/newview/skins/default/xui/de/floater_about_land.xml index a148e4d48a..e4c798a5cc 100644 --- a/indra/newview/skins/default/xui/de/floater_about_land.xml +++ b/indra/newview/skins/default/xui/de/floater_about_land.xml @@ -28,7 +28,7 @@ Restzeit - Permanent + Immer @@ -353,18 +353,18 @@ Nur große Parzellen können in der Suche aufgeführt werden. Bauen: - - + + Objekteintritt: - - + + Skripts ausführen: - - + + diff --git a/indra/newview/skins/default/xui/de/floater_avatar_textures.xml b/indra/newview/skins/default/xui/de/floater_avatar_textures.xml index 01e2e442a9..cb0f874176 100644 --- a/indra/newview/skins/default/xui/de/floater_avatar_textures.xml +++ b/indra/newview/skins/default/xui/de/floater_avatar_textures.xml @@ -18,13 +18,16 @@ Texturen + + + @@ -33,6 +36,7 @@ Texturen + @@ -41,9 +45,21 @@ Texturen - + + + + + + + + + + + + + diff --git a/indra/newview/skins/default/xui/de/floater_ban_duration.xml b/indra/newview/skins/default/xui/de/floater_ban_duration.xml index 2c24b55a11..19e55f5527 100644 --- a/indra/newview/skins/default/xui/de/floater_ban_duration.xml +++ b/indra/newview/skins/default/xui/de/floater_ban_duration.xml @@ -1,15 +1,19 @@ - + Verbannungsdauer: - - + + Immer + + + Temporär + Stunden. - + + + + + - - + + Share name of regions with following content rating to Discord: + control_name="FSMaxSharedMaturity" + follows="left|top" + height="23" + layout="topleft" + name="maturity_desired_combobox" + width="200"> - - + + layout="topleft" + length="1" + follows="top|left" + font="SansSerif" + height="26" + word_wrap="true" + left="10" + right="-10" + name="dont_names_label" + top_pad="5" + type="string"> Don't share region names to Discord if they are listed below: + follows="top|left|right" + height="215" + layout="topleft" + left="10" + multi_select="true" + name="blacklisted_names" + sort_column="0" + sort_ascending="true" + width="250" /> - - + + - - Loading... - + + Loading... + diff --git a/indra/newview/skins/default/xui/en/floater_media_browser.xml b/indra/newview/skins/default/xui/en/floater_media_browser.xml index aab7699fb5..d5d704d010 100644 --- a/indra/newview/skins/default/xui/en/floater_media_browser.xml +++ b/indra/newview/skins/default/xui/en/floater_media_browser.xml @@ -202,7 +202,7 @@ The web browser plugin seems to be taking a while to open. If the plugin never loads, please visit: -http://wiki.phoenixviewer.com/fs_media +http://wiki.firestormviewer.org/fs_media for possible steps to resolve this issue. diff --git a/indra/newview/skins/default/xui/en/floater_web_content.xml b/indra/newview/skins/default/xui/en/floater_web_content.xml index a193db62ad..36e1004826 100644 --- a/indra/newview/skins/default/xui/en/floater_web_content.xml +++ b/indra/newview/skins/default/xui/en/floater_web_content.xml @@ -202,11 +202,11 @@ The web browser plugin seems to be taking a while to open. If the plugin never loads, please visit: -http://wiki.phoenixviewer.com/fs_search_issues +http://wiki.firestormviewer.org/fs_search_issues and -http://wiki.phoenixviewer.com/fs_media +http://wiki.firestormviewer.org/fs_media for possible steps to resolve this issue. diff --git a/indra/newview/skins/default/xui/en/menu_login.xml b/indra/newview/skins/default/xui/en/menu_login.xml index 24111598aa..6994cd0c8f 100644 --- a/indra/newview/skins/default/xui/en/menu_login.xml +++ b/indra/newview/skins/default/xui/en/menu_login.xml @@ -63,7 +63,7 @@ + parameter="WebLaunchExternalTarget,http://wiki.firestormviewer.org/doku.php?id=start" /> + parameter="WebLaunchExternalTarget,http://wiki.firestormviewer.org/firestorm_troubleshooting" /> - http://wiki.phoenixviewer.com/firestorm_change_log_ + http://wiki.firestormviewer.org/firestorm_change_log_ Loading... diff --git a/indra/newview/skins/default/xui/es/floater_about_land.xml b/indra/newview/skins/default/xui/es/floater_about_land.xml index eadd2d72f8..636969e8fc 100644 --- a/indra/newview/skins/default/xui/es/floater_about_land.xml +++ b/indra/newview/skins/default/xui/es/floater_about_land.xml @@ -9,6 +9,12 @@ "Parcel_R_Dark" + + [HOURS] hrs. + + + hr. + [MINUTES] minutos @@ -21,6 +27,9 @@ restantes + + Siempre + @@ -341,18 +350,18 @@ Sólo las parcelas más grandes pueden listarse en la búsqueda. Crear objetos: - - + + Dejar objetos: - - + + Ejecutar scripts: - - + + @@ -485,9 +494,12 @@ los medios: - Residentes con el acceso prohibido ([COUNT]/[MAX]) + Prohibido ([COUNT], max [MAX]) - + + + +