diff options
693 files changed, 21786 insertions, 12549 deletions
@@ -33,6 +33,7 @@ indra/newview/app_settings/static_*.db2 indra/newview/browser_profile indra/newview/character indra/newview/fmod.dll +indra/newview/fmod.log indra/newview/mozilla-theme indra/newview/mozilla-universal-darwin.tgz indra/newview/res/ll_icon.* @@ -458,6 +458,11 @@ a314f1c94374ab1f6633dd2983f7090a68663eb2 3.5.2-beta4 9b1b6f33aa5394b27bb652b31b5cb81ef6060370 3.5.2-release a277b841729f2a62ba1e34acacc964bc13c1ad6f 3.5.3-release fb1630153bac5552046ea914af3f14deabc1def8 3.6.0-materials-beta1 -69429d81ae4dd321eda2607901ef0a0fde71b54c 3.6.0-release -69429d81ae4dd321eda2607901ef0a0fde71b54c 3.6.0-release 0a56f33ad6aa112032b14a41dad759ad377bdde9 3.6.0-release +75cf8e855ae1af6895a35da475314c2b5acf1850 3.6.1-release +f6741d5fe8d632651424484df0fe0cb4a01e9fbe 3.6.2-release +fe4f7c5e9fd27e09d03deb1cc9ab3e5093f6309e 3.6.3-release +83357f31d8dbf048a8bfdc323f363bf4d588aca1 CHOP-951-a +91ed595b716f14f07409595b734fda891a59379e 3.6.4-release +bf6d453046011a11de2643fac610cc5258650f82 3.6.5-release +ae457ece77001767ae9613148c495e7b98cc0f4a 3.6.7-release diff --git a/BuildParams b/BuildParams index 84d30f651b..9752e5298d 100755 --- a/BuildParams +++ b/BuildParams @@ -23,9 +23,13 @@ codeticket_since = 3.3.0-release # Override build system default toolchain # Note that this will only affect automated builds. +Linux.distcc_version = Linux.gcc_version = /usr/bin/gcc-4.6 Linux.cxx_version = /usr/bin/g++-4.6 +# Setup default sourceid so Windows can pick up the TeamCity override +sourceid = "" + ################################################################ #### Examples of how to set the viewer_channel #### # @@ -131,17 +135,6 @@ viewer-materials.build_debug_release_separately = true viewer-materials.build_CYGWIN_Debug = false viewer-materials.build_viewer_update_version_manager = false -# viewer-chui -# -# ======================================== - -viewer-chui.viewer_channel = "Project Viewer - CHUI" -viewer-chui.login_channel = "Project Viewer - CHUI" -viewer-chui.viewer_grid = agni -viewer-chui.build_debug_release_separately = true -viewer-chui.build_CYGWIN_Debug = false -viewer-chui.build_viewer_update_version_manager = false - # ================================================================= # asset delivery 2010 projects # ================================================================= diff --git a/NORSPEC-207.patch b/NORSPEC-207.patch deleted file mode 100644 index a1c1447bda..0000000000 --- a/NORSPEC-207.patch +++ /dev/null @@ -1,164 +0,0 @@ -diff -r fe4bab01522e indra/llprimitive/llrendermaterialtable.cpp ---- a/indra/llprimitive/llrendermaterialtable.cpp Wed May 15 17:57:21 2013 +0000 -+++ b/indra/llprimitive/llrendermaterialtable.cpp Wed May 22 14:23:04 2013 -0700 -@@ -184,6 +184,44 @@ - } - } - -+// 'v' is an integer value for 100ths of radians (don't ask...) -+// -+void LLRenderMaterialEntry::LLRenderMaterial::setSpecularMapRotation(S32 v) const -+{ -+ // Store the fact that we're using the new rotation rep -+ // -+ m_flags |= kNewSpecularMapRotation; -+ -+ // Store 'sign bit' in our m_flags -+ // -+ m_flags &= ~kSpecularMapRotationNegative; -+ m_flags |= (specularMapRotation < 0) ? kSpecularMapRotationNegative : 0; -+ -+ specularRotation = abs(specularRotation); -+ specularRotation = llmin(specularRotation, MAX_MATERIAL_MAP_ROTATION); -+ -+ m_specularRotation = (U16)(abs(specularMapRotation)); -+} -+ -+// 'v' is an integer value for 100ths of radians (don't ask...) -+// -+void LLRenderMaterialEntry::LLRenderMaterial::setNormalMapRotation(S32 v) const -+{ -+ -+ // Store the fact that we're using the new rep for this material -+ // -+ m_flags |= kNewNormalMapRotation; -+ -+ // Store 'sign bit' in our m_flags -+ // -+ m_flags &= ~kNormalMapRotationNegative; -+ m_flags |= (normalMapRotation < 0) ? kNormalMapRotationNegative : 0; -+ -+ normalRotation = abs(normalRotation); -+ normalRotation = llmin(normalRotation, MAX_MATERIAL_MAP_ROTATION); -+ -+ m_normalRotation = (U16)(abs(normalMapRotation)); -+} - - void LLRenderMaterialEntry::LLRenderMaterial::asLLSD( LLSD& dest ) const - { -@@ -193,20 +231,45 @@ - dest["NormOffsetY"] = (S32)m_normalOffsetY; - dest["NormRepeatX"] = m_normalRepeatX; - dest["NormRepeatY"] = m_normalRepeatY; -- dest["NormRotation"] = (S32)m_normalRotation; -+ -+ S32 value = (S32)m_normalMapRotation; -+ -+ // If we don't have the flag for new rotations set, -+ // then we need to convert it now -+ if (!(m_flags & kNewNormalMapRotation)) -+ { -+ F32 old_radians = ((F32)m_normalMapRotation / 10000.0f) -+ S32 new_val = (S32)(old_radians * 100.0f); -+ setNormalMapRotation(new_Val); -+ } -+ -+ dest["NormRotation"] = (m_flags & kNormalMapRotationNegative) ? -(S32)m_normalRotation : (S32)m_normalRotation; - - dest["SpecOffsetX"] = (S32)m_specularOffsetX; - dest["SpecOffsetY"] = (S32)m_specularOffsetY; - dest["SpecRepeatX"] = m_specularRepeatX; - dest["SpecRepeatY"] = m_specularRepeatY; -- dest["SpecRotation"] = (S32)m_specularRotation; -+ -+ -+ value = (S32)m_specularRotation; -+ -+ // If we don't have the flag for new rotations set, -+ // then we need to convert it now -+ if (!(m_flags & kNewSpecularMapRotation)) -+ { -+ F32 old_radians = ((F32)m_specularMapRotation / 10000.0f) -+ S32 new_val = (S32)(old_radians * 100.0f); -+ setSpecularMapRotation(new_Val); -+ } -+ -+ dest["SpecRotation"] = (m_flags & kSpecularMapRotationNegative) ? -(S32)m_specularRotation : (S32)m_specularRotation; - - dest["SpecMap"] = m_specularMap; - dest["SpecColor"] = m_specularLightColor.getValue(); - dest["SpecExp"] = (S32)m_specularLightExponent; - dest["EnvIntensity"] = (S32)m_environmentIntensity; - dest["AlphaMaskCutoff"] = (S32)m_alphaMaskCutoff; -- dest["DiffuseAlphaMode"] = (S32)m_diffuseAlphaMode; -+ dest["DiffuseAlphaMode"] = (S32)(m_diffuseAlphaMode & 0xF); - - } - -@@ -217,7 +280,10 @@ - m_normalOffsetY = (U16)materialDefinition["NormOffsetY"].asInteger(); - m_normalRepeatX = materialDefinition["NormRepeatX"].asInteger(); - m_normalRepeatY = materialDefinition["NormRepeatY"].asInteger(); -- m_normalRotation = (U16)materialDefinition["NormRotation"].asInteger(); -+ -+ S32 normalRotation = materialDefinition["NormRotation"].asInteger(); -+ -+ setNormalMapRotation(normalRotation); - - m_specularMap = materialDefinition["SpecMap"].asUUID(); - -@@ -225,7 +291,10 @@ - m_specularOffsetY = (U16)materialDefinition["SpecOffsetY"].asInteger(); - m_specularRepeatX = materialDefinition["SpecRepeatX"].asInteger(); - m_specularRepeatY = materialDefinition["SpecRepeatY"].asInteger(); -- m_specularRotation = (U16)materialDefinition["SpecRotation"].asInteger(); -+ -+ S32 specularRotation = materialDefinition["SpecRotation"].asInteger(); -+ -+ setSpecularMapRotation(specularRotation); - - m_specularLightColor.setValue( materialDefinition["SpecColor"] ); - m_specularLightExponent = (U8)materialDefinition["SpecExp"].asInteger(); -diff -r fe4bab01522e indra/llprimitive/llrendermaterialtable.h ---- a/indra/llprimitive/llrendermaterialtable.h Wed May 15 17:57:21 2013 +0000 -+++ b/indra/llprimitive/llrendermaterialtable.h Wed May 22 14:23:04 2013 -0700 -@@ -89,11 +89,17 @@ - - void computeID(); - -+ - struct LLRenderMaterial - { - void asLLSD( LLSD& dest ) const; - void setFromLLSD( const LLSD& materialDefinition ); - -+ void setNormalMapRotation(S32 v); -+ void setSpecularMapRotation(S32 v); -+ -+ const S32 MAX_MATERIAL_MAP_ROTATION = 62800; -+ - // 36 bytes - LLUUID m_normalMap; - LLUUID m_specularMap; -@@ -119,7 +125,20 @@ - U8 m_specularLightExponent; - U8 m_environmentIntensity; - U8 m_alphaMaskCutoff; -- U8 m_diffuseAlphaMode; -+ U8 m_diffuseAlphaMode : 4; -+ U8 m_flags : 4; -+ }; -+ -+ // Flags stored in LLRenderMaterial::m_flags to differentiate 'old' rotation format -+ // which doesn't handle negative or large rotations correctly from new format. -+ // All ancient materials will have these flags unset as the values for diffuseAlphaMode -+ // from which the bits were stolen never used more than the bottom 2 bits. -+ // -+ enum RenderMaterialFlags { -+ kNewNormalMapRotation = 0x1, -+ kNewSpecularMapRotation = 0x2, -+ kNormalMapRotationNegative = 0x4, -+ kSpecularMapRotationNegative = 0x8 - }; - - friend struct eastl::hash<LLRenderMaterial>; diff --git a/autobuild.xml b/autobuild.xml index 628d3f6883..b1478a46b2 100755 --- a/autobuild.xml +++ b/autobuild.xml @@ -522,9 +522,9 @@ <key>archive</key> <map> <key>hash</key> - <string>91752db72202807cffb33c1ec3fd90fc</string> + <string>91752db72202807cffb33c1ec3fd90fc</string> <key>url</key> - <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/276321/arch/CYGWIN/installer/fmodex-4.44-windows-20130521.tar.bz2</string> + <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-fmodex-private/rev/276321/arch/CYGWIN/installer/fmodex-4.44-windows-20130521.tar.bz2</string> </map> <key>name</key> <string>windows</string> @@ -761,9 +761,9 @@ <map> <key>archive</key> <map> - <key>hash</key> - <string>aff5566e04003de0383941981198e04e</string> - <key>url</key> + <key>hash</key> + <string>aff5566e04003de0383941981198e04e</string> + <key>url</key> <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-google-breakpad/rev/273073/arch/Darwin/installer/google_breakpad-0.0.0-rev1099-darwin-20130329.tar.bz2</string> </map> <key>name</key> @@ -773,9 +773,9 @@ <map> <key>archive</key> <map> - <key>hash</key> - <string>52257e5eb166a0b69c9c0c38f6e1920e</string> - <key>url</key> + <key>hash</key> + <string>52257e5eb166a0b69c9c0c38f6e1920e</string> + <key>url</key> <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-google-breakpad/rev/273079/arch/Linux/installer/google_breakpad-0.0.0-rev1099-linux-20130329.tar.bz2</string> </map> <key>name</key> @@ -786,7 +786,7 @@ <key>archive</key> <map> <key>hash</key> - <string>d812a6dfcabe6528198a3191068dac09</string> + <string>d812a6dfcabe6528198a3191068dac09</string> <key>url</key> <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-google-breakpad/rev/273073/arch/CYGWIN/installer/google_breakpad-0.0.0-rev1099-windows-20130329.tar.bz2</string> </map> @@ -879,42 +879,6 @@ </map> </map> </map> - <key>gperftools</key> - <map> - <key>license</key> - <string>bsd</string> - <key>license_file</key> - <string>LICENSES/gperftools.txt</string> - <key>name</key> - <string>gperftools</string> - <key>platforms</key> - <map> - <key>linux</key> - <map> - <key>archive</key> - <map> - <key>hash</key> - <string>8aedfdcf670348c18a9991ae1b384a61</string> - <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-google-perftools/rev/262672/arch/Linux/installer/gperftools-2.0-linux-20120727.tar.bz2</string> - </map> - <key>name</key> - <string>linux</string> - </map> - <key>windows</key> - <map> - <key>archive</key> - <map> - <key>hash</key> - <string>f62841804acb91e1309603a84f3f0ce8</string> - <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-google-perftools/rev/262672/arch/CYGWIN/installer/gperftools-2.0-windows-20120727.tar.bz2</string> - </map> - <key>name</key> - <string>windows</string> - </map> - </map> - </map> <key>gstreamer</key> <map> <key>license</key> @@ -1844,9 +1808,9 @@ <key>archive</key> <map> <key>hash</key> - <string>24e735ae005f3ce7a21a09cc02cece17</string> + <string>2994f1e028fb200c454c12b5f7ca9108</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-slvoice/rev/231678/arch/Darwin/installer/slvoice-3.2.0002.10426-darwin-20110601.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-slvoice/rev/270464/arch/Darwin/installer/slvoice-4.5.0009.17865-darwin-20130215.tar.bz2</string> </map> <key>name</key> <string>darwin</string> @@ -1856,9 +1820,9 @@ <key>archive</key> <map> <key>hash</key> - <string>8a0bc982367d6fdc20a28b391cd40566</string> + <string>957773fff7148ffaca42b1ea4a18d192</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-slvoice/rev/231678/arch/Linux/installer/slvoice-3.2.0002.10426-linux-20110601.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-slvoice/rev/270512/arch/Linux/installer/slvoice-4.5.0009.17865-linux-20130216.tar.bz2</string> </map> <key>name</key> <string>linux</string> @@ -1868,9 +1832,9 @@ <key>archive</key> <map> <key>hash</key> - <string>1e821cc7d25eabad013b7f3db260dd6b</string> + <string>24710eda136bfd42d6333e5609c2c74f</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-slvoice/rev/231678/arch/CYGWIN/installer/slvoice-3.2.0002.10426-windows-20110601.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-slvoice/rev/270464/arch/CYGWIN/installer/slvoice-4.5.0009.17865-windows-20130214.tar.bz2</string> </map> <key>name</key> <string>windows</string> @@ -2567,7 +2531,7 @@ <string>"Visual Studio 10"</string> <string>-DUNATTENDED:BOOL=ON</string> <string>-DUSE_KDU=FALSE</string> - </array> + </array> </map> <key>name</key> <string>DebugOS</string> @@ -2655,7 +2619,7 @@ <string>-DUNATTENDED:BOOL=ON</string> <string>-DINSTALL_PROPRIETARY=FALSE</string> <string>-DUSE_KDU=FALSE</string> - </array> + </array> </map> <key>name</key> <string>RelWithDebInfoOS</string> @@ -2674,7 +2638,6 @@ <array> <string>/build</string> <string>"/cfg=Release|Win32"</string> - <string>"/CL_ADD=/m:1"</string> </array> </map> <key>configure</key> @@ -2742,7 +2705,7 @@ <string>-DUNATTENDED:BOOL=ON</string> <string>-DINSTALL_PROPRIETARY=FALSE</string> <string>-DUSE_KDU=FALSE</string> - </array> + </array> </map> <key>name</key> <string>ReleaseOS</string> diff --git a/doc/contributions.txt b/doc/contributions.txt index 6d0dde609e..4ce074506b 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -175,7 +175,11 @@ Ansariel Hiller STORM-1685 STORM-1713 STORM-1899 + MAINT-2368 + STORM-1931 Aralara Rajal +Arare Chantilly + CHUIBUG-191 Ardy Lay STORM-859 VWR-19499 @@ -301,6 +305,8 @@ Ciaran Laval Cinder Roxley BUG-2326 STORM-1703 + STORM-1948 + STORM-1952 Clara Young Coaldust Numbers VWR-1095 @@ -312,6 +318,7 @@ Cron Stardust VWR-10579 VWR-25120 STORM-1075 + STORM-1919 Cypren Christenson STORM-417 Dante Tucker @@ -404,6 +411,7 @@ Ganymedes Costagravas Geenz Spad STORM-1823 STORM-1900 + STORM-1905 NORSPEC-229 Gene Frostbite GeneJ Composer @@ -479,6 +487,7 @@ Hiro Sommambulist Hitomi Tiponi STORM-1741 STORM-1862 + BUG-1067 Holger Gilruth Horatio Freund Hoze Menges @@ -501,7 +510,9 @@ Ima Mechanique STORM-1708 STORM-1831 STORM-1832 + STORM-1855 VWR-10791 + VWR-20553 VWR-19213 VWR-23739 VWR-24766 @@ -649,12 +660,16 @@ Jonathan Yap STORM-1793 STORM-1810 STORM-1877 + STORM-1892 + STORM-1894 STORM-1860 STORM-1852 STORM-1870 STORM-1872 STORM-1858 STORM-1862 + STORM-1918 + STORM-1953 OPEN-161 Kadah Coba STORM-1060 @@ -671,6 +686,8 @@ Kagehi Kohn Kaimen Takahe Katharine Berry STORM-1900 + STORM-1940 + STORM-1941 Keklily Longfall Ken Lavender Ken March @@ -693,6 +710,7 @@ Kitty Barnett STORM-800 STORM-1001 STORM-1175 + STORM-1905 VWR-24217 STORM-1804 Kolor Fall @@ -702,6 +720,7 @@ Kunnis Basiat VWR-82 VWR-102 Lance Corrimal + STORM-1910 VWR-25269 Latif Khalifa VWR-5370 @@ -756,9 +775,11 @@ Marianne McCann Marine Kelley CHUIBUG-134 STORM-281 + STORM-1910 MartinRJ Fayray STORM-1844 STORM-1845 + STORM-1911 STORM-1934 Matthew Anthony Matthew Dowd @@ -910,6 +931,11 @@ Nicky Dasmijn MAINT-873 SUN-72 BUG-2432 + STORM-1935 + STORM-1936 + BUG-3605 + CHUIBUG-197 + STORM-1937 Nicky Perian OPEN-1 STORM-1087 @@ -1052,6 +1078,7 @@ Satanello Miami Satomi Ahn STORM-501 STORM-229 + VWR-20553 VWR-24502 Scrim Pinion Scrippy Scofield @@ -1221,6 +1248,8 @@ Tofu Buzzard STORM-1684 STORM-1819 Tony Kembia +Tonya Souther + STORM-1905 Torben Trautman TouchaHoney Perhaps TraductoresAnonimos Alter diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 472f271fa8..87484f4ae3 100755 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -131,6 +131,17 @@ if (LINUX) # Let's actually get a numerical version of gxx's version STRING(REGEX REPLACE ".* ([0-9])\\.([0-9])\\.([0-9]).*" "\\1\\2\\3" CXX_VERSION_NUMBER ${CXX_VERSION}) + # Hacks to work around gcc 4.1 TC build pool machines which can't process pragma warning disables + # This is pure rubbish; I wish there was another way. + # + if(${CXX_VERSION_NUMBER} LESS 420) + set(CMAKE_CXX_FLAGS "-Wno-deprecated -Wno-uninitialized -Wno-unused-variable -Wno-unused-function ${CMAKE_CXX_FLAGS}") + endif (${CXX_VERSION_NUMBER} LESS 420) + + if(${CXX_VERSION_NUMBER} GREATER 459) + set(CMAKE_CXX_FLAGS "-Wno-deprecated -Wno-unused-but-set-variable -Wno-unused-variable ${CMAKE_CXX_FLAGS}") + endif (${CXX_VERSION_NUMBER} GREATER 459) + # gcc 4.3 and above don't like the LL boost and also # cause warnings due to our use of deprecated headers if(${CXX_VERSION_NUMBER} GREATER 429) diff --git a/indra/cmake/BuildVersion.cmake b/indra/cmake/BuildVersion.cmake index b9ec8f5266..af2063ce6d 100755 --- a/indra/cmake/BuildVersion.cmake +++ b/indra/cmake/BuildVersion.cmake @@ -18,7 +18,7 @@ if (NOT DEFINED VIEWER_SHORT_VERSION) # will be true in indra/, false in indra/n find_program(MERCURIAL hg) if (DEFINED MERCURIAL) execute_process( - COMMAND ${MERCURIAL} log -r tip --template "{p1rev}" + COMMAND ${MERCURIAL} log -r tip --template "{rev}" OUTPUT_VARIABLE VIEWER_VERSION_REVISION OUTPUT_STRIP_TRAILING_WHITESPACE ) diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index 29ab4b1710..44c2d3ac27 100755 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -20,6 +20,7 @@ if(WINDOWS) set(vivox_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}") set(vivox_files SLVoice.exe + ca-bundle.crt libsndfile-1.dll vivoxplatform.dll vivoxsdk.dll @@ -195,6 +196,7 @@ elseif(DARWIN) set(vivox_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}") set(vivox_files SLVoice + ca-bundle.crt libsndfile.dylib libvivoxoal.dylib libortp.dylib @@ -241,6 +243,7 @@ elseif(LINUX) libvivoxplatform.so libvivoxsdk.so SLVoice + # ca-bundle.crt #No cert for linux. It is actually still 3.2SDK. ) # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables # or ARCH_PREBUILT_DIRS @@ -267,6 +270,7 @@ elseif(LINUX) libdb-5.1.so libexpat.so libexpat.so.1 + libfreetype.so.6 libGLOD.so libgmock_main.so libgmock.so.0 diff --git a/indra/cmake/FreeType.cmake b/indra/cmake/FreeType.cmake index baa61d73c8..c9a90a9a8d 100755 --- a/indra/cmake/FreeType.cmake +++ b/indra/cmake/FreeType.cmake @@ -7,7 +7,7 @@ if (STANDALONE) pkg_check_modules(FREETYPE REQUIRED freetype2) else (STANDALONE) use_prebuilt_binary(freetype) - set(FREETYPE_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include) + set(FREETYPE_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include) set(FREETYPE_LIBRARIES freetype) endif (STANDALONE) diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake index 9bb3077797..9bb3077797 100755..100644 --- a/indra/cmake/LLAddBuildTest.cmake +++ b/indra/cmake/LLAddBuildTest.cmake diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index 7c310ba9c3..22d0a7f0fe 100755 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -134,15 +134,20 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") OUTPUT_VARIABLE XCODE_VERSION ) # To support a different SDK update these Xcode settings: + if (XCODE_VERSION GREATER 4.5) + set(CMAKE_OSX_DEPLOYMENT_TARGET 10.8) + set(CMAKE_OSX_SYSROOT macosx10.8) + else (XCODE_VERSION GREATER 4.5) if (XCODE_VERSION GREATER 4.2) set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6) + set(CMAKE_OSX_SYSROOT macosx10.7) else (XCODE_VERSION GREATER 4.2) - set(CMAKE_OSX_DEPLOYMENT_TARGET 10.5) + set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6) + set(CMAKE_OSX_SYSROOT macosx10.7) endif (XCODE_VERSION GREATER 4.2) + endif (XCODE_VERSION GREATER 4.5) - set(CMAKE_OSX_SYSROOT macosx10.6) set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvmgcc42") - set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT dwarf-with-dsym) # NOTE: To attempt an i386/PPC Universal build, add this on the configure line: diff --git a/indra/edit-me-to-trigger-new-build.txt b/indra/edit-me-to-trigger-new-build.txt index e003ed7788..774e8c0676 100755 --- a/indra/edit-me-to-trigger-new-build.txt +++ b/indra/edit-me-to-trigger-new-build.txt @@ -3,3 +3,4 @@ Wed Nov 7 00:25:19 UTC 2012 + diff --git a/indra/integration_tests/llui_libtest/CMakeLists.txt b/indra/integration_tests/llui_libtest/CMakeLists.txt index e83b4e8cd7..34e34c7e47 100755 --- a/indra/integration_tests/llui_libtest/CMakeLists.txt +++ b/indra/integration_tests/llui_libtest/CMakeLists.txt @@ -60,7 +60,8 @@ add_executable(llui_libtest ${llui_libtest_SOURCE_FILES}) # Link with OS-specific libraries for LLWindow dependency if (DARWIN) find_library(COCOA_LIBRARY Cocoa) - set(OS_LIBRARIES ${COCOA_LIBRARY}) + find_library(IOKIT_LIBRARY IOKit) + set(OS_LIBRARIES ${COCOA_LIBRARY} ${IOKIT_LIBRARY}) elseif (WINDOWS) #ll_stack_trace needs this now... list(APPEND WINDOWS_LIBRARIES dbghelp) diff --git a/indra/lib/python/indra/util/llmanifest.py b/indra/lib/python/indra/util/llmanifest.py index 9cb830a2db..54049b5545 100755 --- a/indra/lib/python/indra/util/llmanifest.py +++ b/indra/lib/python/indra/util/llmanifest.py @@ -392,11 +392,21 @@ class LLManifest(object): raise ManifestError, "Should be something at path " + path self.created_paths.append(path) - def put_in_file(self, contents, dst): + def put_in_file(self, contents, dst, src=None): # write contents as dst - f = open(self.dst_path_of(dst), "wb") - f.write(contents) - f.close() + dst_path = self.dst_path_of(dst) + f = open(dst_path, "wb") + try: + f.write(contents) + finally: + f.close() + + # Why would we create a file in the destination tree if not to include + # it in the installer? The default src=None (plus the fact that the + # src param is last) is to preserve backwards compatibility. + if src: + self.file_list.append([src, dst_path]) + return dst_path def replace_in(self, src, dst=None, searchdict={}): if dst == None: diff --git a/indra/llcharacter/lleditingmotion.cpp b/indra/llcharacter/lleditingmotion.cpp index 0d0b85ba60..4e8c3268c5 100755 --- a/indra/llcharacter/lleditingmotion.cpp +++ b/indra/llcharacter/lleditingmotion.cpp @@ -258,3 +258,4 @@ void LLEditingMotion::onDeactivate() // End + diff --git a/indra/llcharacter/llheadrotmotion.cpp b/indra/llcharacter/llheadrotmotion.cpp index 15a58a8389..2b1aa194a9 100755 --- a/indra/llcharacter/llheadrotmotion.cpp +++ b/indra/llcharacter/llheadrotmotion.cpp @@ -530,3 +530,4 @@ void LLEyeMotion::onDeactivate() } // End + diff --git a/indra/llcharacter/llkeyframemotion.cpp b/indra/llcharacter/llkeyframemotion.cpp index c6f45bffa2..07ef52228e 100755 --- a/indra/llcharacter/llkeyframemotion.cpp +++ b/indra/llcharacter/llkeyframemotion.cpp @@ -672,7 +672,8 @@ BOOL LLKeyframeMotion::onActivate() //----------------------------------------------------------------------------- BOOL LLKeyframeMotion::onUpdate(F32 time, U8* joint_mask) { - llassert(time >= 0.f); + // llassert(time >= 0.f); // This will fire + time = llmax(0.f, time); if (mJointMotionList->mLoop) { @@ -2304,3 +2305,4 @@ LLKeyframeMotion::JointConstraint::~JointConstraint() } // End + diff --git a/indra/llcharacter/llkeyframewalkmotion.cpp b/indra/llcharacter/llkeyframewalkmotion.cpp index d52eb89a5c..69f064b615 100755 --- a/indra/llcharacter/llkeyframewalkmotion.cpp +++ b/indra/llcharacter/llkeyframewalkmotion.cpp @@ -390,3 +390,4 @@ BOOL LLFlyAdjustMotion::onUpdate(F32 time, U8* joint_mask) return TRUE; } + diff --git a/indra/llcharacter/llmotion.cpp b/indra/llcharacter/llmotion.cpp index 2551f125d0..a07f9f4d2e 100755 --- a/indra/llcharacter/llmotion.cpp +++ b/indra/llcharacter/llmotion.cpp @@ -169,3 +169,4 @@ BOOL LLMotion::canDeprecate() } // End + diff --git a/indra/llcharacter/lltargetingmotion.cpp b/indra/llcharacter/lltargetingmotion.cpp index 489aef923c..fa5f06328e 100755 --- a/indra/llcharacter/lltargetingmotion.cpp +++ b/indra/llcharacter/lltargetingmotion.cpp @@ -169,3 +169,4 @@ void LLTargetingMotion::onDeactivate() // End + diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index 3a4a8facc2..8eb0c6249d 100755 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -122,6 +122,7 @@ set(llcommon_HEADER_FILES linden_common.h linked_lists.h llaccountingcost.h + llalignedarray.h llallocator.h llallocator_heap_profile.h llagentconstants.h @@ -237,6 +238,7 @@ set(llcommon_HEADER_FILES llstrider.h llstring.h llstringtable.h + llstaticstringtable.h llsys.h llthread.h llthreadsafequeue.h diff --git a/indra/llcommon/llalignedarray.h b/indra/llcommon/llalignedarray.h new file mode 100644 index 0000000000..ed8fd31205 --- /dev/null +++ b/indra/llcommon/llalignedarray.h @@ -0,0 +1,139 @@ +/** + * @file llalignedarray.h + * @brief A static array which obeys alignment restrictions and mimics std::vector accessors. + * + * $LicenseInfo:firstyear=2002&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLALIGNEDARRAY_H +#define LL_LLALIGNEDARRAY_H + +#include "llmemory.h" + +template <class T, U32 alignment> +class LLAlignedArray +{ +public: + T* mArray; + U32 mElementCount; + U32 mCapacity; + + LLAlignedArray(); + ~LLAlignedArray(); + + void push_back(const T& elem); + U32 size() const { return mElementCount; } + void resize(U32 size); + T* append(S32 N); + T& operator[](int idx); + const T& operator[](int idx) const; +}; + +template <class T, U32 alignment> +LLAlignedArray<T, alignment>::LLAlignedArray() +{ + llassert(alignment >= 16); + mArray = NULL; + mElementCount = 0; + mCapacity = 0; +} + +template <class T, U32 alignment> +LLAlignedArray<T, alignment>::~LLAlignedArray() +{ + ll_aligned_free(mArray); + mArray = NULL; + mElementCount = 0; + mCapacity = 0; +} + +template <class T, U32 alignment> +void LLAlignedArray<T, alignment>::push_back(const T& elem) +{ + T* old_buf = NULL; + if (mCapacity <= mElementCount) + { + mCapacity++; + mCapacity *= 2; + T* new_buf = (T*) ll_aligned_malloc(mCapacity*sizeof(T), alignment); + if (mArray) + { + ll_memcpy_nonaliased_aligned_16((char*)new_buf, (char*)mArray, sizeof(T)*mElementCount); + } + old_buf = mArray; + mArray = new_buf; + } + + mArray[mElementCount++] = elem; + + //delete old array here to prevent error on a.push_back(a[0]) + ll_aligned_free(old_buf); +} + +template <class T, U32 alignment> +void LLAlignedArray<T, alignment>::resize(U32 size) +{ + if (mCapacity < size) + { + mCapacity = size+mCapacity*2; + T* new_buf = mCapacity > 0 ? (T*) ll_aligned_malloc(mCapacity*sizeof(T), alignment) : NULL; + if (mArray) + { + ll_memcpy_nonaliased_aligned_16((char*) new_buf, (char*) mArray, sizeof(T)*mElementCount); + ll_aligned_free(mArray); + } + + /*for (U32 i = mElementCount; i < mCapacity; ++i) + { + new(new_buf+i) T(); + }*/ + mArray = new_buf; + } + + mElementCount = size; +} + + +template <class T, U32 alignment> +T& LLAlignedArray<T, alignment>::operator[](int idx) +{ + llassert(idx < mElementCount); + return mArray[idx]; +} + +template <class T, U32 alignment> +const T& LLAlignedArray<T, alignment>::operator[](int idx) const +{ + llassert(idx < mElementCount); + return mArray[idx]; +} + +template <class T, U32 alignment> +T* LLAlignedArray<T, alignment>::append(S32 N) +{ + U32 sz = size(); + resize(sz+N); + return &((*this)[sz]); +} + +#endif + diff --git a/indra/llcommon/llapr.cpp b/indra/llcommon/llapr.cpp index a0802c6adf..b7815b0e35 100755 --- a/indra/llcommon/llapr.cpp +++ b/indra/llcommon/llapr.cpp @@ -226,7 +226,7 @@ void LLVolatileAPRPool::clearVolatileAPRPool() llassert_always(mNumActiveRef > 0) ; } - llassert(mNumTotalRef < (FULL_VOLATILE_APR_POOL << 2)) ; + llassert(mNumTotalRef <= (FULL_VOLATILE_APR_POOL << 2)) ; } BOOL LLVolatileAPRPool::isFull() diff --git a/indra/llcommon/llapr.h b/indra/llcommon/llapr.h index 752574c65d..1fe7d98472 100755 --- a/indra/llcommon/llapr.h +++ b/indra/llcommon/llapr.h @@ -164,14 +164,20 @@ public: ~LLAtomic32<Type>() {}; operator const Type() { apr_uint32_t data = apr_atomic_read32(&mData); return Type(data); } + + Type CurrentValue() const { apr_uint32_t data = apr_atomic_read32(const_cast< volatile apr_uint32_t* >(&mData)); return Type(data); } + Type operator =(const Type& x) { apr_atomic_set32(&mData, apr_uint32_t(x)); return Type(mData); } void operator -=(Type x) { apr_atomic_sub32(&mData, apr_uint32_t(x)); } void operator +=(Type x) { apr_atomic_add32(&mData, apr_uint32_t(x)); } Type operator ++(int) { return apr_atomic_inc32(&mData); } // Type++ Type operator --(int) { return apr_atomic_dec32(&mData); } // approximately --Type (0 if final is 0, non-zero otherwise) + + Type operator ++() { return apr_atomic_inc32(&mData); } // Type++ + Type operator --() { return apr_atomic_dec32(&mData); } // approximately --Type (0 if final is 0, non-zero otherwise) private: - apr_uint32_t mData; + volatile apr_uint32_t mData; }; typedef LLAtomic32<U32> LLAtomicU32; diff --git a/indra/llcommon/llcommon.cpp b/indra/llcommon/llcommon.cpp index 8be9e4f4de..b938b0e65a 100755 --- a/indra/llcommon/llcommon.cpp +++ b/indra/llcommon/llcommon.cpp @@ -44,6 +44,7 @@ void LLCommon::initClass() } LLTimer::initClass(); LLThreadSafeRefCount::initThreadSafeRefCount(); + assert_main_thread(); // Make sure we record the main thread // LLWorkerThread::initClass(); // LLFrameCallbackManager::initClass(); } diff --git a/indra/llcommon/llcriticaldamp.cpp b/indra/llcommon/llcriticaldamp.cpp index 87d79b1ee0..49aac9ce75 100755 --- a/indra/llcommon/llcriticaldamp.cpp +++ b/indra/llcommon/llcriticaldamp.cpp @@ -87,3 +87,4 @@ F32 LLCriticalDamp::getInterpolant(const F32 time_constant, BOOL use_cache) return interpolant; } + diff --git a/indra/llcommon/lleventapi.h b/indra/llcommon/lleventapi.h index 1a37d780b6..5991fe8fd5 100755 --- a/indra/llcommon/lleventapi.h +++ b/indra/llcommon/lleventapi.h @@ -47,6 +47,7 @@ class LL_COMMON_API LLEventAPI: public LLDispatchListener, typedef LLInstanceTracker<LLEventAPI, std::string> ibase; public: + /** * @param name LLEventPump name on which this LLEventAPI will listen. This * also serves as the LLInstanceTracker instance key. diff --git a/indra/llcommon/lleventtimer.h b/indra/llcommon/lleventtimer.h index 7f42623d01..dc918121e1 100755 --- a/indra/llcommon/lleventtimer.h +++ b/indra/llcommon/lleventtimer.h @@ -36,6 +36,7 @@ class LL_COMMON_API LLEventTimer : public LLInstanceTracker<LLEventTimer> { public: + LLEventTimer(F32 period); // period is the amount of time between each call to tick() in seconds LLEventTimer(const LLDate& time); virtual ~LLEventTimer(); diff --git a/indra/llcommon/llfasttimer.cpp b/indra/llcommon/llfasttimer.cpp index 024fdd1b4d..01b6e60d2b 100755 --- a/indra/llcommon/llfasttimer.cpp +++ b/indra/llcommon/llfasttimer.cpp @@ -107,17 +107,13 @@ class NamedTimerFactory : public LLSingleton<NamedTimerFactory> { public: NamedTimerFactory() - : mTimerRoot(NULL) - {} - - /*virtual */ void initSingleton() + : mTimerRoot(new LLFastTimer::NamedTimer("root")) { - mTimerRoot = new LLFastTimer::NamedTimer("root"); mRootFrameState.setNamedTimer(mTimerRoot); mTimerRoot->setFrameState(&mRootFrameState); mTimerRoot->mParent = mTimerRoot; mTimerRoot->setCollapsed(false); - mRootFrameState.mParent = &mRootFrameState; + mRootFrameState.mParent = &mRootFrameState; } ~NamedTimerFactory() diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h index 81c4b78775..a99a1d88af 100755 --- a/indra/llcommon/llfasttimer.h +++ b/indra/llcommon/llfasttimer.h @@ -139,10 +139,11 @@ public: // used to statically declare a new named timer class LL_COMMON_API DeclareTimer - : public LLInstanceTracker<DeclareTimer> + : public LLInstanceTracker< DeclareTimer > { friend class LLFastTimer; public: + DeclareTimer(const std::string& name, bool open); DeclareTimer(const std::string& name); diff --git a/indra/llcommon/llfoldertype.h b/indra/llcommon/llfoldertype.h index a0c847914f..a0c847914f 100755..100644 --- a/indra/llcommon/llfoldertype.h +++ b/indra/llcommon/llfoldertype.h diff --git a/indra/llcommon/llinitparam.h b/indra/llcommon/llinitparam.h index ae836645b9..03ab0fb67f 100755 --- a/indra/llcommon/llinitparam.h +++ b/indra/llcommon/llinitparam.h @@ -1952,7 +1952,7 @@ namespace LLInitParam class Mandatory : public TypedParam<T, NAME_VALUE_LOOKUP, false> { typedef TypedParam<T, NAME_VALUE_LOOKUP, false> super_t; - typedef Mandatory<T, NAME_VALUE_LOOKUP> self_t; + typedef Mandatory<T, NAME_VALUE_LOOKUP> self_t; typedef typename super_t::value_t value_t; typedef typename super_t::default_value_t default_value_t; diff --git a/indra/llcommon/llinstancetracker.cpp b/indra/llcommon/llinstancetracker.cpp index 5dc3ea5d7b..64a313b5ff 100755 --- a/indra/llcommon/llinstancetracker.cpp +++ b/indra/llcommon/llinstancetracker.cpp @@ -32,18 +32,3 @@ // external library headers // other Linden headers -//static -void * & LLInstanceTrackerBase::getInstances(std::type_info const & info) -{ - typedef std::map<std::string, void *> InstancesMap; - static InstancesMap instances; - - // std::map::insert() is just what we want here. You attempt to insert a - // (key, value) pair. If the specified key doesn't yet exist, it inserts - // the pair and returns a std::pair of (iterator, true). If the specified - // key DOES exist, insert() simply returns (iterator, false). One lookup - // handles both cases. - return instances.insert(InstancesMap::value_type(info.name(), - InstancesMap::mapped_type())) - .first->second; -} diff --git a/indra/llcommon/llinstancetracker.h b/indra/llcommon/llinstancetracker.h index 1eab270e3c..55187d8325 100755 --- a/indra/llcommon/llinstancetracker.h +++ b/indra/llcommon/llinstancetracker.h @@ -46,21 +46,7 @@ class LL_COMMON_API LLInstanceTrackerBase { protected: - /// Get a process-unique void* pointer slot for the specified type_info - static void * & getInstances(std::type_info const & info); - /// Find or create a STATICDATA instance for the specified TRACKED class. - /// STATICDATA must be default-constructible. - template<typename STATICDATA, class TRACKED> - static STATICDATA& getStatic() - { - void *& instances = getInstances(typeid(TRACKED)); - if (! instances) - { - instances = new STATICDATA; - } - return *static_cast<STATICDATA*>(instances); - } /// It's not essential to derive your STATICDATA (for use with /// getStatic()) from StaticBase; it's just that both known @@ -74,6 +60,8 @@ protected: }; }; +LL_COMMON_API void assert_main_thread(); + /// This mix-in class adds support for tracking all instances of the specified class parameter T /// The (optional) key associates a value of type KEY with a given instance of T, for quick lookup /// If KEY is not provided, then instances are stored in a simple set @@ -81,14 +69,18 @@ protected: template<typename T, typename KEY = T*> class LLInstanceTracker : public LLInstanceTrackerBase { - typedef LLInstanceTracker<T, KEY> MyT; + typedef LLInstanceTracker<T, KEY> self_t; typedef typename std::map<KEY, T*> InstanceMap; struct StaticData: public StaticBase { InstanceMap sMap; }; - static StaticData& getStatic() { return LLInstanceTrackerBase::getStatic<StaticData, MyT>(); } - static InstanceMap& getMap_() { return getStatic().sMap; } + static StaticData& getStatic() { static StaticData sData; return sData;} + static InstanceMap& getMap_() + { + // assert_main_thread(); fwiw this class is not thread safe, and it used by multiple threads. Bad things happen. + return getStatic().sMap; + } public: class instance_iter : public boost::iterator_facade<instance_iter, T, boost::forward_traversal_tag> @@ -220,7 +212,11 @@ private: } void remove_() { - getMap_().erase(mInstanceKey); + typename InstanceMap::iterator iter = getMap_().find(mInstanceKey); + if (iter != getMap_().end()) + { + getMap_().erase(iter); + } } private: @@ -232,13 +228,13 @@ private: template<typename T> class LLInstanceTracker<T, T*> : public LLInstanceTrackerBase { - typedef LLInstanceTracker<T, T*> MyT; + typedef LLInstanceTracker<T, T*> self_t; typedef typename std::set<T*> InstanceSet; struct StaticData: public StaticBase { InstanceSet sSet; }; - static StaticData& getStatic() { return LLInstanceTrackerBase::getStatic<StaticData, MyT>(); } + static StaticData& getStatic() { static StaticData sData; return sData; } static InstanceSet& getSet_() { return getStatic().sSet; } public: diff --git a/indra/llcommon/llleap.h b/indra/llcommon/llleap.h index 1a1ad23d39..e33f25e530 100755 --- a/indra/llcommon/llleap.h +++ b/indra/llcommon/llleap.h @@ -32,6 +32,7 @@ class LL_COMMON_API LLLeap: public LLInstanceTracker<LLLeap> { public: + /** * Pass a brief string description, mostly for logging purposes. The desc * need not be unique, but obviously the clearer we can make it, the diff --git a/indra/llcommon/lllslconstants.h b/indra/llcommon/lllslconstants.h index 9f32598e61..926ce32d75 100755 --- a/indra/llcommon/lllslconstants.h +++ b/indra/llcommon/lllslconstants.h @@ -67,6 +67,19 @@ const S32 LSL_PRIM_TEXGEN = 22; const S32 LSL_PRIM_POINT_LIGHT = 23; const S32 LSL_PRIM_CAST_SHADOWS = 24; const S32 LSL_PRIM_GLOW = 25; +const S32 LSL_PRIM_TEXT = 26; +const S32 LSL_PRIM_NAME = 27; +const S32 LSL_PRIM_DESC = 28; +const S32 LSL_PRIM_ROT_LOCAL = 29; +const S32 LSL_PRIM_PHYSICS_SHAPE_TYPE = 30; +const S32 LSL_PRIM_OMEGA = 32; +const S32 LSL_PRIM_POS_LOCAL = 33; +const S32 LSL_PRIM_LINK_TARGET = 34; +const S32 LSL_PRIM_SLICE = 35; + +const S32 LSL_PRIM_PHYSICS_SHAPE_PRIM = 0; +const S32 LSL_PRIM_PHYSICS_SHAPE_NONE = 1; +const S32 LSL_PRIM_PHYSICS_SHAPE_CONVEX = 2; const S32 LSL_PRIM_TYPE_BOX = 0; const S32 LSL_PRIM_TYPE_CYLINDER= 1; @@ -179,6 +192,22 @@ const S32 OBJECT_VELOCITY = 5; const S32 OBJECT_OWNER = 6; const S32 OBJECT_GROUP = 7; const S32 OBJECT_CREATOR = 8; +const S32 OBJECT_RUNNING_SCRIPT_COUNT = 9; +const S32 OBJECT_TOTAL_SCRIPT_COUNT = 10; +const S32 OBJECT_SCRIPT_MEMORY = 11; +const S32 OBJECT_SCRIPT_TIME = 12; +const S32 OBJECT_PRIM_EQUIVALENCE = 13; +const S32 OBJECT_SERVER_COST = 14; +const S32 OBJECT_STREAMING_COST = 15; +const S32 OBJECT_PHYSICS_COST = 16; +const S32 OBJECT_CHARACTER_TIME = 17; +const S32 OBJECT_ROOT = 18; +const S32 OBJECT_ATTACHED_POINT = 19; +const S32 OBJECT_PATHFINDING_TYPE = 20; +const S32 OBJECT_PHYSICS = 21; +const S32 OBJECT_PHANTOM = 22; +const S32 OBJECT_TEMP_ON_REZ = 23; +const S32 OBJECT_RENDER_WEIGHT = 24; // llTextBox() magic token string - yes this is a hack. sue me. char const* const TEXTBOX_MAGIC_TOKEN = "!!llTextBox!!"; diff --git a/indra/llcommon/llmemory.h b/indra/llcommon/llmemory.h index e725bdd9fa..61e30f11cc 100755 --- a/indra/llcommon/llmemory.h +++ b/indra/llcommon/llmemory.h @@ -36,19 +36,68 @@ class LLMutex ; #define LL_CHECK_MEMORY #endif +LL_COMMON_API void ll_assert_aligned_func(uintptr_t ptr,U32 alignment); + +#ifdef SHOW_ASSERT +#define ll_assert_aligned(ptr,alignment) ll_assert_aligned_func(reinterpret_cast<uintptr_t>(ptr),((U32)alignment)) +#else +#define ll_assert_aligned(ptr,alignment) +#endif + +#include <xmmintrin.h> + +template <typename T> T* LL_NEXT_ALIGNED_ADDRESS(T* address) +{ + return reinterpret_cast<T*>( + (reinterpret_cast<uintptr_t>(address) + 0xF) & ~0xF); +} + +template <typename T> T* LL_NEXT_ALIGNED_ADDRESS_64(T* address) +{ + return reinterpret_cast<T*>( + (reinterpret_cast<uintptr_t>(address) + 0x3F) & ~0x3F); +} + +#if LL_LINUX || LL_DARWIN + +#define LL_ALIGN_PREFIX(x) +#define LL_ALIGN_POSTFIX(x) __attribute__((aligned(x))) + +#elif LL_WINDOWS + +#define LL_ALIGN_PREFIX(x) __declspec(align(x)) +#define LL_ALIGN_POSTFIX(x) + +#else +#error "LL_ALIGN_PREFIX and LL_ALIGN_POSTFIX undefined" +#endif + +#define LL_ALIGN_16(var) LL_ALIGN_PREFIX(16) var LL_ALIGN_POSTFIX(16) + inline void* ll_aligned_malloc( size_t size, int align ) { +#if defined(LL_WINDOWS) + return _aligned_malloc(size, align); +#else void* mem = malloc( size + (align - 1) + sizeof(void*) ); char* aligned = ((char*)mem) + sizeof(void*); aligned += align - ((uintptr_t)aligned & (align - 1)); ((void**)aligned)[-1] = mem; return aligned; +#endif } inline void ll_aligned_free( void* ptr ) { - free( ((void**)ptr)[-1] ); +#if defined(LL_WINDOWS) + _aligned_free(ptr); +#else + if (ptr) + { + free( ((void**)ptr)[-1] ); + } +#endif } #if !LL_USE_TCMALLOC @@ -133,6 +182,78 @@ inline void ll_aligned_free_32(void *p) #endif } + +// Copy words 16-byte blocks from src to dst. Source and destination MUST NOT OVERLAP. +// Source and dest must be 16-byte aligned and size must be multiple of 16. +// +inline void ll_memcpy_nonaliased_aligned_16(char* __restrict dst, const char* __restrict src, size_t bytes) +{ + assert(src != NULL); + assert(dst != NULL); + assert(bytes > 0); + assert((bytes % sizeof(F32))== 0); + ll_assert_aligned(src,16); + ll_assert_aligned(dst,16); + assert((src < dst) ? ((src + bytes) < dst) : ((dst + bytes) < src)); + assert(bytes%16==0); + + char* end = dst + bytes; + + if (bytes > 64) + { + + // Find start of 64b aligned area within block + // + void* begin_64 = LL_NEXT_ALIGNED_ADDRESS_64(dst); + + //at least 64 bytes before the end of the destination, switch to 16 byte copies + void* end_64 = end-64; + + // Prefetch the head of the 64b area now + // + _mm_prefetch((char*)begin_64, _MM_HINT_NTA); + _mm_prefetch((char*)begin_64 + 64, _MM_HINT_NTA); + _mm_prefetch((char*)begin_64 + 128, _MM_HINT_NTA); + _mm_prefetch((char*)begin_64 + 192, _MM_HINT_NTA); + + // Copy 16b chunks until we're 64b aligned + // + while (dst < begin_64) + { + + _mm_store_ps((F32*)dst, _mm_load_ps((F32*)src)); + dst += 16; + src += 16; + } + + // Copy 64b chunks up to your tail + // + // might be good to shmoo the 512b prefetch offset + // (characterize performance for various values) + // + while (dst < end_64) + { + _mm_prefetch((char*)src + 512, _MM_HINT_NTA); + _mm_prefetch((char*)dst + 512, _MM_HINT_NTA); + _mm_store_ps((F32*)dst, _mm_load_ps((F32*)src)); + _mm_store_ps((F32*)(dst + 16), _mm_load_ps((F32*)(src + 16))); + _mm_store_ps((F32*)(dst + 32), _mm_load_ps((F32*)(src + 32))); + _mm_store_ps((F32*)(dst + 48), _mm_load_ps((F32*)(src + 48))); + dst += 64; + src += 64; + } + } + + // Copy remainder 16b tail chunks (or ALL 16b chunks for sub-64b copies) + // + while (dst < end) + { + _mm_store_ps((F32*)dst, _mm_load_ps((F32*)src)); + dst += 16; + src += 16; + } +} + #ifndef __DEBUG_PRIVATE_MEM__ #define __DEBUG_PRIVATE_MEM__ 0 #endif @@ -541,13 +662,7 @@ void LLPrivateMemoryPoolTester::operator delete[](void* addr) // LLSingleton moved to llsingleton.h -LL_COMMON_API void ll_assert_aligned_func(uintptr_t ptr,U32 alignment); -#ifdef SHOW_ASSERT -#define ll_assert_aligned(ptr,alignment) ll_assert_aligned_func(reinterpret_cast<uintptr_t>(ptr),((U32)alignment)) -#else -#define ll_assert_aligned(ptr,alignment) -#endif #endif diff --git a/indra/llcommon/llsingleton.cpp b/indra/llcommon/llsingleton.cpp index eb8e2c9456..9b49e52377 100755 --- a/indra/llcommon/llsingleton.cpp +++ b/indra/llcommon/llsingleton.cpp @@ -28,5 +28,4 @@ #include "llsingleton.h" -std::map<std::string, void *> * LLSingletonRegistry::sSingletonMap = NULL; diff --git a/indra/llcommon/llsingleton.h b/indra/llcommon/llsingleton.h index 49d99f2cd0..40002313f1 100755 --- a/indra/llcommon/llsingleton.h +++ b/indra/llcommon/llsingleton.h @@ -30,38 +30,6 @@ #include <typeinfo> #include <boost/noncopyable.hpp> -/// @brief A global registry of all singletons to prevent duplicate allocations -/// across shared library boundaries -class LL_COMMON_API LLSingletonRegistry { - private: - typedef std::map<std::string, void *> TypeMap; - static TypeMap * sSingletonMap; - - static void checkInit() - { - if(sSingletonMap == NULL) - { - sSingletonMap = new TypeMap(); - } - } - - public: - template<typename T> static void * & get() - { - std::string name(typeid(T).name()); - - checkInit(); - - // the first entry of the pair returned by insert will be either the existing - // iterator matching our key, or the newly inserted NULL initialized entry - // see "Insert element" in http://www.sgi.com/tech/stl/UniqueAssociativeContainer.html - TypeMap::iterator result = - sSingletonMap->insert(std::make_pair(name, (void*)NULL)).first; - - return result->second; - } -}; - // LLSingleton implements the getInstance() method part of the Singleton // pattern. It can't make the derived class constructors protected, though, so // you have to do that yourself. @@ -101,20 +69,23 @@ private: } EInitState; // stores pointer to singleton instance - // and tracks initialization state of singleton - struct SingletonInstanceData + struct SingletonLifetimeManager { - EInitState mInitState; - DERIVED_TYPE* mSingletonInstance; - - SingletonInstanceData() - : mSingletonInstance(NULL), - mInitState(UNINITIALIZED) - {} - - ~SingletonInstanceData() + SingletonLifetimeManager() + { + construct(); + } + + static void construct() { - if (mInitState != DELETED) + sData.mInitState = CONSTRUCTING; + sData.mInstance = new DERIVED_TYPE(); + sData.mInitState = INITIALIZING; + } + + ~SingletonLifetimeManager() + { + if (sData.mInitState != DELETED) { deleteSingleton(); } @@ -124,9 +95,8 @@ private: public: virtual ~LLSingleton() { - SingletonInstanceData& data = getData(); - data.mSingletonInstance = NULL; - data.mInitState = DELETED; + sData.mInstance = NULL; + sData.mInitState = DELETED; } /** @@ -151,50 +121,46 @@ public: */ static void deleteSingleton() { - delete getData().mSingletonInstance; - getData().mSingletonInstance = NULL; - getData().mInitState = DELETED; + delete sData.mInstance; + sData.mInstance = NULL; + sData.mInitState = DELETED; } - static SingletonInstanceData& getData() - { - // this is static to cache the lookup results - static void * & registry = LLSingletonRegistry::get<DERIVED_TYPE>(); - - // *TODO - look into making this threadsafe - if(NULL == registry) - { - static SingletonInstanceData data; - registry = &data; - } - - return *static_cast<SingletonInstanceData *>(registry); - } static DERIVED_TYPE* getInstance() { - SingletonInstanceData& data = getData(); + static SingletonLifetimeManager sLifeTimeMgr; - if (data.mInitState == CONSTRUCTING) + switch (sData.mInitState) { + case UNINITIALIZED: + // should never be uninitialized at this point + llassert(false); + return NULL; + case CONSTRUCTING: llerrs << "Tried to access singleton " << typeid(DERIVED_TYPE).name() << " from singleton constructor!" << llendl; - } - - if (data.mInitState == DELETED) - { + return NULL; + case INITIALIZING: + // go ahead and flag ourselves as initialized so we can be reentrant during initialization + sData.mInitState = INITIALIZED; + sData.mInstance->initSingleton(); + return sData.mInstance; + case INITIALIZED: + return sData.mInstance; + case DELETED: llwarns << "Trying to access deleted singleton " << typeid(DERIVED_TYPE).name() << " creating new instance" << llendl; + SingletonLifetimeManager::construct(); + sData.mInitState = INITIALIZED; + sData.mInstance->initSingleton(); + return sData.mInstance; } - - if (!data.mSingletonInstance) - { - data.mInitState = CONSTRUCTING; - data.mSingletonInstance = new DERIVED_TYPE(); - data.mInitState = INITIALIZING; - data.mSingletonInstance->initSingleton(); - data.mInitState = INITIALIZED; - } - - return data.mSingletonInstance; + + return NULL; + } + + static DERIVED_TYPE* getIfExists() + { + return sData.mInstance; } // Reference version of getInstance() @@ -208,18 +174,29 @@ public: // Use this to avoid accessing singletons before the can safely be constructed static bool instanceExists() { - return getData().mInitState == INITIALIZED; + return sData.mInitState == INITIALIZED; } // Has this singleton already been deleted? // Use this to avoid accessing singletons from a static object's destructor static bool destroyed() { - return getData().mInitState == DELETED; + return sData.mInitState == DELETED; } private: + virtual void initSingleton() {} + + struct SingletonData + { + EInitState mInitState; + DERIVED_TYPE* mInstance; + }; + static SingletonData sData; }; +template<typename T> +typename LLSingleton<T>::SingletonData LLSingleton<T>::sData; + #endif diff --git a/indra/llcommon/llstaticstringtable.h b/indra/llcommon/llstaticstringtable.h new file mode 100644 index 0000000000..d7e0e8a08d --- /dev/null +++ b/indra/llcommon/llstaticstringtable.h @@ -0,0 +1,82 @@ +/** + * @file llstringtable.h + * @brief The LLStringTable class provides a _fast_ method for finding + * unique copies of strings. + * + * $LicenseInfo:firstyear=2001&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_STATIC_STRING_TABLE_H +#define LL_STATIC_STRING_TABLE_H + +#include "lldefs.h" +#include <boost/unordered_map.hpp> +#include "llstl.h" + +class LLStaticHashedString +{ +public: + + LLStaticHashedString(const std::string& s) + { + string_hash = makehash(s); + string = s; + } + + const std::string& String() const { return string; } + size_t Hash() const { return string_hash; } + + bool operator==(const LLStaticHashedString& b) const { return Hash() == b.Hash(); } + +protected: + + size_t makehash(const std::string& s) + { + size_t len = s.size(); + const char* c = s.c_str(); + size_t hashval = 0; + for (size_t i=0; i<len; i++) + { + hashval = ((hashval<<5) + hashval) + *c++; + } + return hashval; + } + + std::string string; + size_t string_hash; +}; + +struct LLStaticStringHasher +{ + enum { bucket_size = 8 }; + size_t operator()(const LLStaticHashedString& key_value) const { return key_value.Hash(); } + bool operator()(const LLStaticHashedString& left, const LLStaticHashedString& right) const { return left.Hash() < right.Hash(); } +}; + +template< typename MappedObject > +class LL_COMMON_API LLStaticStringTable + : public boost::unordered_map< LLStaticHashedString, MappedObject, LLStaticStringHasher > +{ +}; + +#endif + diff --git a/indra/llcommon/llstringtable.h b/indra/llcommon/llstringtable.h index 59d7372ed4..ff09e71677 100755 --- a/indra/llcommon/llstringtable.h +++ b/indra/llcommon/llstringtable.h @@ -42,14 +42,6 @@ //# define STRING_TABLE_HASH_MAP 1 #endif -#if STRING_TABLE_HASH_MAP -# if LL_WINDOWS -# include <hash_map> -# else -# include <ext/hash_map> -# endif -#endif - const U32 MAX_STRINGS_LENGTH = 256; class LL_COMMON_API LLStringTableEntry diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp index 57a6de9060..0730b2ed8b 100755 --- a/indra/llcommon/llsys.cpp +++ b/indra/llcommon/llsys.cpp @@ -67,12 +67,18 @@ using namespace llsd; # include <sys/sysctl.h> # include <sys/utsname.h> # include <stdint.h> -# include <Carbon/Carbon.h> +# include <CoreServices/CoreServices.h> # include <stdexcept> # include <mach/host_info.h> # include <mach/mach_host.h> # include <mach/task.h> # include <mach/task_info.h> + +// disable warnings about Gestalt calls being deprecated +// until Apple get's on the ball and provides an alternative +// +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + #elif LL_LINUX # include <errno.h> # include <sys/utsname.h> @@ -1502,3 +1508,10 @@ BOOL gzip_file(const std::string& srcfile, const std::string& dstfile) if (dst != NULL) gzclose(dst); return retval; } + +#if LL_DARWIN +// disable warnings about Gestalt calls being deprecated +// until Apple get's on the ball and provides an alternative +// +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif diff --git a/indra/llcommon/llthread.cpp b/indra/llcommon/llthread.cpp index 1d56a52c32..60adeeaeb7 100755 --- a/indra/llcommon/llthread.cpp +++ b/indra/llcommon/llthread.cpp @@ -67,7 +67,8 @@ LL_COMMON_API void assert_main_thread() static U32 s_thread_id = LLThread::currentID(); if (LLThread::currentID() != s_thread_id) { - llerrs << "Illegal execution outside main thread." << llendl; + llwarns << "Illegal execution from thread id " << (S32) LLThread::currentID() + << " outside main thread " << (S32) s_thread_id << llendl; } } @@ -495,15 +496,7 @@ LLThreadSafeRefCount::LLThreadSafeRefCount() : LLThreadSafeRefCount::LLThreadSafeRefCount(const LLThreadSafeRefCount& src) { - if (sMutex) - { - sMutex->lock(); - } mRef = 0; - if (sMutex) - { - sMutex->unlock(); - } } LLThreadSafeRefCount::~LLThreadSafeRefCount() diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h index 0fb89c5613..f51d985b5f 100755 --- a/indra/llcommon/llthread.h +++ b/indra/llcommon/llthread.h @@ -242,49 +242,39 @@ public: LLThreadSafeRefCount(const LLThreadSafeRefCount&); LLThreadSafeRefCount& operator=(const LLThreadSafeRefCount& ref) { - if (sMutex) - { - sMutex->lock(); - } mRef = 0; - if (sMutex) - { - sMutex->unlock(); - } return *this; } - - void ref() { - if (sMutex) sMutex->lock(); mRef++; - if (sMutex) sMutex->unlock(); } - S32 unref() + void unref() { llassert(mRef >= 1); - if (sMutex) sMutex->lock(); - S32 res = --mRef; - if (sMutex) sMutex->unlock(); - if (0 == res) - { - delete this; - return 0; + if ((--mRef) == 0) // See note in llapr.h on atomic decrement operator return value. + { + // If we hit zero, the caller should be the only smart pointer owning the object and we can delete it. + // It is technically possible for a vanilla pointer to mess this up, or another thread to + // jump in, find this object, create another smart pointer and end up dangling, but if + // the code is that bad and not thread-safe, it's trouble already. + delete this; } - return res; - } + } + S32 getNumRefs() const { - return mRef; + const S32 currentVal = mRef.CurrentValue(); + return currentVal; } private: - S32 mRef; + LLAtomic32< S32 > mRef; }; + /** * intrusive pointer support for LLThreadSafeRefCount * this allows you to use boost::intrusive_ptr with any LLThreadSafeRefCount-derived type @@ -315,4 +305,6 @@ public: //============================================================================ +extern LL_COMMON_API void assert_main_thread(); + #endif // LL_LLTHREAD_H diff --git a/indra/llcommon/llversionviewer.h b/indra/llcommon/llversionviewer.h new file mode 100644 index 0000000000..6a5ff314e4 --- /dev/null +++ b/indra/llcommon/llversionviewer.h @@ -0,0 +1,41 @@ +/** + * @file llversionviewer.h + * @brief + * + * $LicenseInfo:firstyear=2002&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLVERSIONVIEWER_H +#define LL_LLVERSIONVIEWER_H + +const S32 LL_VERSION_MAJOR = 3; +const S32 LL_VERSION_MINOR = 4; +const S32 LL_VERSION_PATCH = 6; +const S32 LL_VERSION_BUILD = 0; + +const char * const LL_CHANNEL = "Second Life Developer"; + +#if LL_DARWIN +const char * const LL_VERSION_BUNDLE_ID = "com.secondlife.indra.viewer"; +#endif + +#endif diff --git a/indra/llcommon/tests/llprocess_test.cpp b/indra/llcommon/tests/llprocess_test.cpp index f188865eb0..3e68ef068e 100755 --- a/indra/llcommon/tests/llprocess_test.cpp +++ b/indra/llcommon/tests/llprocess_test.cpp @@ -608,9 +608,6 @@ namespace tut void object::test<5>() { set_test_name("exit(2)"); -#if LL_WINDOWS - skip("MAINT-2302: This frequently (though not always) fails on Windows."); -#endif PythonProcessLauncher py(get_test_name(), "import sys\n" "sys.exit(2)\n"); @@ -622,10 +619,7 @@ namespace tut template<> template<> void object::test<6>() { - set_test_name("syntax_error:"); -#if LL_WINDOWS - skip("MAINT-2302: This frequently (though not always) fails on Windows."); -#endif + set_test_name("syntax_error"); PythonProcessLauncher py(get_test_name(), "syntax_error:\n"); py.mParams.files.add(LLProcess::FileParam()); // inherit stdin @@ -647,9 +641,6 @@ namespace tut void object::test<7>() { set_test_name("explicit kill()"); -#if LL_WINDOWS - skip("MAINT-2302: This frequently (though not always) fails on Windows."); -#endif PythonProcessLauncher py(get_test_name(), "from __future__ import with_statement\n" "import sys, time\n" @@ -694,9 +685,6 @@ namespace tut void object::test<8>() { set_test_name("implicit kill()"); -#if LL_WINDOWS - skip("MAINT-2302: This frequently (though not always) fails on Windows."); -#endif NamedTempFile out("out", "not started"); LLProcess::handle phandle(0); { diff --git a/indra/llcorehttp/_httpinternal.h b/indra/llcorehttp/_httpinternal.h index 14f744a9f1..008e4fd95c 100755 --- a/indra/llcorehttp/_httpinternal.h +++ b/indra/llcorehttp/_httpinternal.h @@ -146,9 +146,6 @@ const int HTTP_SERVICE_LOOP_SLEEP_NORMAL_MS = 2; // Block allocation size (a tuning parameter) is found // in bufferarray.h. -// Compatibility controls -const bool HTTP_ENABLE_LINKSYS_WRT54G_V5_DNS_FIX = true; - } // end namespace LLCore #endif // _LLCORE_HTTP_INTERNAL_H_ diff --git a/indra/llcorehttp/_httpoprequest.cpp b/indra/llcorehttp/_httpoprequest.cpp index 51a8eaf998..207ed8e1e4 100755 --- a/indra/llcorehttp/_httpoprequest.cpp +++ b/indra/llcorehttp/_httpoprequest.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2012&license=viewerlgpl$ * Second Life Viewer Source Code - * Copyright (C) 2012, Linden Research, Inc. + * Copyright (C) 2012-2013, Linden Research, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -186,9 +186,11 @@ void HttpOpRequest::stageFromActive(HttpService * service) if (mReplyLength) { // If non-zero, we received and processed a Content-Range - // header with the response. Verify that what it says - // is consistent with the received data. - if (mReplyLength != mReplyBody->size()) + // header with the response. If there is received data + // (and there may not be due to protocol violations, + // HEAD requests, etc., see BUG-2295) Verify that what it + // says is consistent with the received data. + if (mReplyBody && mReplyBody->size() && mReplyLength != mReplyBody->size()) { // Not as expected, fail the request mStatus = HttpStatus(HttpStatus::LLCORE, HE_INV_CONTENT_RANGE_HDR); @@ -339,7 +341,6 @@ void HttpOpRequest::setupCommon(HttpRequest::policy_t policy_id, } } - // Sets all libcurl options and data for a request. // // Used both for initial requests and to 'reload' for @@ -381,41 +382,15 @@ HttpStatus HttpOpRequest::prepareRequest(HttpService * service) // Get policy options HttpPolicyGlobal & policy(service->getPolicy().getGlobalOptions()); - mCurlHandle = curl_easy_init(); - curl_easy_setopt(mCurlHandle, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); - curl_easy_setopt(mCurlHandle, CURLOPT_NOSIGNAL, 1); - curl_easy_setopt(mCurlHandle, CURLOPT_NOPROGRESS, 1); - curl_easy_setopt(mCurlHandle, CURLOPT_URL, mReqURL.c_str()); - curl_easy_setopt(mCurlHandle, CURLOPT_PRIVATE, this); - curl_easy_setopt(mCurlHandle, CURLOPT_ENCODING, ""); + mCurlHandle = LLCurl::createStandardCurlHandle(); - if (HTTP_ENABLE_LINKSYS_WRT54G_V5_DNS_FIX) - { - // The Linksys WRT54G V5 router has an issue with frequent - // DNS lookups from LAN machines. If they happen too often, - // like for every HTTP request, the router gets annoyed after - // about 700 or so requests and starts issuing TCP RSTs to - // new connections. Reuse the DNS lookups for even a few - // seconds and no RSTs. - curl_easy_setopt(mCurlHandle, CURLOPT_DNS_CACHE_TIMEOUT, 15); - } - else - { - // *TODO: Revisit this old DNS timeout setting - may no longer be valid - // I don't think this is valid anymore, the Multi shared DNS - // cache is working well. For the case of naked easy handles, - // consider using a shared DNS object. - curl_easy_setopt(mCurlHandle, CURLOPT_DNS_CACHE_TIMEOUT, 0); - } - curl_easy_setopt(mCurlHandle, CURLOPT_AUTOREFERER, 1); - curl_easy_setopt(mCurlHandle, CURLOPT_FOLLOWLOCATION, 1); - curl_easy_setopt(mCurlHandle, CURLOPT_MAXREDIRS, HTTP_REDIRECTS_DEFAULT); curl_easy_setopt(mCurlHandle, CURLOPT_WRITEFUNCTION, writeCallback); - curl_easy_setopt(mCurlHandle, CURLOPT_WRITEDATA, this); - curl_easy_setopt(mCurlHandle, CURLOPT_READFUNCTION, readCallback); + curl_easy_setopt(mCurlHandle, CURLOPT_READFUNCTION, readCallback); curl_easy_setopt(mCurlHandle, CURLOPT_READDATA, this); - curl_easy_setopt(mCurlHandle, CURLOPT_SSL_VERIFYPEER, 1); - curl_easy_setopt(mCurlHandle, CURLOPT_SSL_VERIFYHOST, 0); + curl_easy_setopt(mCurlHandle, CURLOPT_WRITEDATA, this); + curl_easy_setopt(mCurlHandle, CURLOPT_URL, mReqURL.c_str()); + curl_easy_setopt(mCurlHandle, CURLOPT_PRIVATE, this); + curl_easy_setopt(mCurlHandle, CURLOPT_MAXREDIRS, HTTP_REDIRECTS_DEFAULT); const std::string * opt_value(NULL); long opt_long(0L); @@ -694,7 +669,7 @@ int HttpOpRequest::debugCallback(CURL * handle, curl_infotype info, char * buffe std::string safe_line; std::string tag; bool logit(false); - len = (std::min)(len, size_t(256)); // Keep things reasonable in all cases + const size_t log_len((std::min)(len, size_t(256))); // Keep things reasonable in all cases switch (info) { @@ -702,7 +677,7 @@ int HttpOpRequest::debugCallback(CURL * handle, curl_infotype info, char * buffe if (op->mTracing >= HTTP_TRACE_CURL_HEADERS) { tag = "TEXT"; - escape_libcurl_debug_data(buffer, len, true, safe_line); + escape_libcurl_debug_data(buffer, log_len, true, safe_line); logit = true; } break; @@ -711,7 +686,7 @@ int HttpOpRequest::debugCallback(CURL * handle, curl_infotype info, char * buffe if (op->mTracing >= HTTP_TRACE_CURL_HEADERS) { tag = "HEADERIN"; - escape_libcurl_debug_data(buffer, len, true, safe_line); + escape_libcurl_debug_data(buffer, log_len, true, safe_line); logit = true; } break; @@ -720,7 +695,7 @@ int HttpOpRequest::debugCallback(CURL * handle, curl_infotype info, char * buffe if (op->mTracing >= HTTP_TRACE_CURL_HEADERS) { tag = "HEADEROUT"; - escape_libcurl_debug_data(buffer, 2 * len, true, safe_line); // Goes out as one line + escape_libcurl_debug_data(buffer, log_len, true, safe_line); // Goes out as one line unlike header_in logit = true; } break; @@ -732,7 +707,7 @@ int HttpOpRequest::debugCallback(CURL * handle, curl_infotype info, char * buffe logit = true; if (op->mTracing >= HTTP_TRACE_CURL_BODIES) { - escape_libcurl_debug_data(buffer, len, false, safe_line); + escape_libcurl_debug_data(buffer, log_len, false, safe_line); } else { @@ -750,7 +725,7 @@ int HttpOpRequest::debugCallback(CURL * handle, curl_infotype info, char * buffe logit = true; if (op->mTracing >= HTTP_TRACE_CURL_BODIES) { - escape_libcurl_debug_data(buffer, len, false, safe_line); + escape_libcurl_debug_data(buffer, log_len, false, safe_line); } else { diff --git a/indra/llcorehttp/_httpoprequest.h b/indra/llcorehttp/_httpoprequest.h index 7b65d17783..74a349b0bf 100755 --- a/indra/llcorehttp/_httpoprequest.h +++ b/indra/llcorehttp/_httpoprequest.h @@ -60,7 +60,6 @@ class HttpOptions; /// the information needed to make a working request which can /// then be enqueued to a request queue. /// - class HttpOpRequest : public HttpOperation { public: diff --git a/indra/llcorehttp/_httppolicy.cpp b/indra/llcorehttp/_httppolicy.cpp index 76c1e22431..014bd37e2e 100755 --- a/indra/llcorehttp/_httppolicy.cpp +++ b/indra/llcorehttp/_httppolicy.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2012&license=viewerlgpl$ * Second Life Viewer Source Code - * Copyright (C) 2012, Linden Research, Inc. + * Copyright (C) 2012-2013, Linden Research, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -319,33 +319,13 @@ bool HttpPolicy::cancel(HttpHandle handle) bool HttpPolicy::stageAfterCompletion(HttpOpRequest * op) { - static const HttpStatus cant_connect(HttpStatus::EXT_CURL_EASY, CURLE_COULDNT_CONNECT); - static const HttpStatus cant_res_proxy(HttpStatus::EXT_CURL_EASY, CURLE_COULDNT_RESOLVE_PROXY); - static const HttpStatus cant_res_host(HttpStatus::EXT_CURL_EASY, CURLE_COULDNT_RESOLVE_HOST); - static const HttpStatus send_error(HttpStatus::EXT_CURL_EASY, CURLE_SEND_ERROR); - static const HttpStatus recv_error(HttpStatus::EXT_CURL_EASY, CURLE_RECV_ERROR); - static const HttpStatus upload_failed(HttpStatus::EXT_CURL_EASY, CURLE_UPLOAD_FAILED); - static const HttpStatus op_timedout(HttpStatus::EXT_CURL_EASY, CURLE_OPERATION_TIMEDOUT); - static const HttpStatus post_error(HttpStatus::EXT_CURL_EASY, CURLE_HTTP_POST_ERROR); - // Retry or finalize if (! op->mStatus) { - // If this failed, we might want to retry. Have to inspect - // the status a little more deeply for those reasons worth retrying... - if (op->mPolicyRetries < op->mPolicyRetryLimit && - ((op->mStatus.isHttpStatus() && op->mStatus.mType >= 499 && op->mStatus.mType <= 599) || - cant_connect == op->mStatus || - cant_res_proxy == op->mStatus || - cant_res_host == op->mStatus || - send_error == op->mStatus || - recv_error == op->mStatus || - upload_failed == op->mStatus || - op_timedout == op->mStatus || - post_error == op->mStatus)) + // If this failed, we might want to retry. + if (op->mPolicyRetries < op->mPolicyRetryLimit && op->mStatus.isRetryable()) { - // Okay, worth a retry. We include 499 in this test as - // it's the old 'who knows?' error from many grid services... + // Okay, worth a retry. retryOp(op); return true; // still active/ready } diff --git a/indra/llcorehttp/httpcommon.cpp b/indra/llcorehttp/httpcommon.cpp index f2fcbf77a3..0738760763 100755 --- a/indra/llcorehttp/httpcommon.cpp +++ b/indra/llcorehttp/httpcommon.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2012&license=viewerlgpl$ * Second Life Viewer Source Code - * Copyright (C) 2012, Linden Research, Inc. + * Copyright (C) 2012-2013, Linden Research, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -116,6 +116,7 @@ std::string HttpStatus::toString() const { 415, "Unsupported Media Type" }, { 416, "Requested range not satisfiable" }, { 417, "Expectation Failed" }, + { 499, "Linden Catch-All" }, { 500, "Internal Server Error" }, { 501, "Not Implemented" }, { 502, "Bad Gateway" }, @@ -174,6 +175,37 @@ std::string HttpStatus::toString() const } return std::string("Unknown error"); } + + +// Pass true on statuses that might actually be cleared by a +// retry. Library failures, calling problems, etc. aren't +// going to be fixed by squirting bits all over the Net. +bool HttpStatus::isRetryable() const +{ + static const HttpStatus cant_connect(HttpStatus::EXT_CURL_EASY, CURLE_COULDNT_CONNECT); + static const HttpStatus cant_res_proxy(HttpStatus::EXT_CURL_EASY, CURLE_COULDNT_RESOLVE_PROXY); + static const HttpStatus cant_res_host(HttpStatus::EXT_CURL_EASY, CURLE_COULDNT_RESOLVE_HOST); + static const HttpStatus send_error(HttpStatus::EXT_CURL_EASY, CURLE_SEND_ERROR); + static const HttpStatus recv_error(HttpStatus::EXT_CURL_EASY, CURLE_RECV_ERROR); + static const HttpStatus upload_failed(HttpStatus::EXT_CURL_EASY, CURLE_UPLOAD_FAILED); + static const HttpStatus op_timedout(HttpStatus::EXT_CURL_EASY, CURLE_OPERATION_TIMEDOUT); + static const HttpStatus post_error(HttpStatus::EXT_CURL_EASY, CURLE_HTTP_POST_ERROR); + static const HttpStatus partial_file(HttpStatus::EXT_CURL_EASY, CURLE_PARTIAL_FILE); + static const HttpStatus inv_cont_range(HttpStatus::LLCORE, HE_INV_CONTENT_RANGE_HDR); + + return ((isHttpStatus() && mType >= 499 && mType <= 599) || // Include special 499 in retryables + *this == cant_connect || // Connection reset/endpoint problems + *this == cant_res_proxy || // DNS problems + *this == cant_res_host || // DNS problems + *this == send_error || // General socket problems + *this == recv_error || // General socket problems + *this == upload_failed || // Transport problem + *this == op_timedout || // Timer expired + *this == post_error || // Transport problem + *this == partial_file || // Data inconsistency in response + *this == inv_cont_range); // Short data read disagrees with content-range +} + } // end namespace LLCore diff --git a/indra/llcorehttp/httpcommon.h b/indra/llcorehttp/httpcommon.h index c0d4ec5aad..41fb5164cf 100755 --- a/indra/llcorehttp/httpcommon.h +++ b/indra/llcorehttp/httpcommon.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2012&license=viewerlgpl$ * Second Life Viewer Source Code - * Copyright (C) 2012, Linden Research, Inc. + * Copyright (C) 2012-2013, Linden Research, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -303,6 +303,12 @@ struct HttpStatus { return mType >= type_enum_t(100) && mType <= type_enum_t(999); } + + /// Returns true if the status is one that will be retried + /// internally. Provided for external consumption for cases + /// where that logic needs to be replicated. Only applies + /// to failed statuses, successful statuses will return false. + bool isRetryable() const; }; // end struct HttpStatus diff --git a/indra/llcorehttp/httpresponse.h b/indra/llcorehttp/httpresponse.h index 4a481db6ac..f19b521fbf 100755 --- a/indra/llcorehttp/httpresponse.h +++ b/indra/llcorehttp/httpresponse.h @@ -48,8 +48,9 @@ class HttpHeaders; /// individual pieces of the response. /// /// Typical usage will have the caller interrogate the object -/// and return from the handler callback. Instances are refcounted -/// and callers can bump the count and retain the object as needed. +/// during the handler callback and then simply returning. +/// But instances are refcounted and and callers can add a +/// reference and hold onto the object after the callback. /// /// Threading: Not intrinsically thread-safe. /// @@ -119,6 +120,10 @@ public: /// caller is going to have to make assumptions on receipt of /// a 206 status. The @full value may also be zero in cases of /// parsing problems or a wild-carded length response. + /// + /// These values will not necessarily agree with the data in + /// the body itself (if present). The BufferArray object + /// is authoritative for actual data length. void getRange(unsigned int * offset, unsigned int * length, unsigned int * full) const { *offset = mReplyOffset; diff --git a/indra/llcorehttp/tests/test_httprequest.hpp b/indra/llcorehttp/tests/test_httprequest.hpp index e5488cf941..900a699887 100755 --- a/indra/llcorehttp/tests/test_httprequest.hpp +++ b/indra/llcorehttp/tests/test_httprequest.hpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2012&license=viewerlgpl$ * Second Life Viewer Source Code - * Copyright (C) 2012, Linden Research, Inc. + * Copyright (C) 2012-2013, Linden Research, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -45,6 +45,15 @@ using namespace LLCoreInt; +// spin/sleep waiting times for client/server exchange tests +// +// These are now fairly generous to try to get around timeout +// ('reasonable time') failures during execution on a heavily- +// loaded system where the unit test is in competition with +// other programs. +static const int LOOP_SLEEP_INTERVAL(10000); +static const int LOOP_COUNT_SHORT(500); // 5-second dwell time +static const int LOOP_COUNT_LONG(3000); // 30-second dwell time namespace { @@ -294,11 +303,11 @@ void HttpRequestTestObjectType::test<3>() // Run the notification pump. int count(0); - int limit(20); + int limit(LOOP_COUNT_SHORT); while (count++ < limit && mHandlerCalls < 1) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Request executed in reasonable time", count < limit); ensure("One handler invocation for request", mHandlerCalls == 1); @@ -309,21 +318,21 @@ void HttpRequestTestObjectType::test<3>() // Run the notification pump again count = 0; - limit = 100; + limit = LOOP_COUNT_LONG; while (count++ < limit && mHandlerCalls < 2) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Second request executed in reasonable time", count < limit); ensure("Second handler invocation", mHandlerCalls == 2); // See that we actually shutdown the thread count = 0; - limit = 10; + limit = LOOP_COUNT_SHORT; while (count++ < limit && ! HttpService::isStopped()) { - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Thread actually stopped running", HttpService::isStopped()); @@ -392,12 +401,12 @@ void HttpRequestTestObjectType::test<4>() // Run the notification pump. int count(0); - int limit(20); + int limit(LOOP_COUNT_LONG); while (count++ < limit && mHandlerCalls < 2) { req1->update(1000000); req2->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Request executed in reasonable time", count < limit); ensure("One handler invocation for request", mHandlerCalls == 2); @@ -409,22 +418,22 @@ void HttpRequestTestObjectType::test<4>() // Run the notification pump again count = 0; - limit = 100; + limit = LOOP_COUNT_LONG; while (count++ < limit && mHandlerCalls < 3) { req1->update(1000000); req2->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Second request executed in reasonable time", count < limit); ensure("Second handler invocation", mHandlerCalls == 3); // See that we actually shutdown the thread count = 0; - limit = 10; + limit = LOOP_COUNT_SHORT; while (count++ < limit && ! HttpService::isStopped()) { - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Thread actually stopped running", HttpService::isStopped()); @@ -493,11 +502,11 @@ void HttpRequestTestObjectType::test<5>() // Run the notification pump. int count(0); - int limit(10); + int limit(LOOP_COUNT_SHORT); while (count++ < limit && mHandlerCalls < 1) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("NoOp notification received", mHandlerCalls == 1); @@ -569,11 +578,11 @@ void HttpRequestTestObjectType::test<6>() // Run the notification pump. int count(0); - int limit(10); + int limit(LOOP_COUNT_SHORT); while (count++ < limit && mHandlerCalls < 1) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("No notifications received", mHandlerCalls == 0); @@ -650,11 +659,11 @@ void HttpRequestTestObjectType::test<7>() // Run the notification pump. int count(0); - int limit(50); // With one retry, should fail quickish + int limit(LOOP_COUNT_LONG); while (count++ < limit && mHandlerCalls < 1) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Request executed in reasonable time", count < limit); ensure("One handler invocation for request", mHandlerCalls == 1); @@ -666,21 +675,21 @@ void HttpRequestTestObjectType::test<7>() // Run the notification pump again count = 0; - limit = 100; + limit = LOOP_COUNT_LONG; while (count++ < limit && mHandlerCalls < 2) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Second request executed in reasonable time", count < limit); ensure("Second handler invocation", mHandlerCalls == 2); // See that we actually shutdown the thread count = 0; - limit = 10; + limit = LOOP_COUNT_SHORT; while (count++ < limit && ! HttpService::isStopped()) { - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Thread actually stopped running", HttpService::isStopped()); @@ -766,11 +775,11 @@ void HttpRequestTestObjectType::test<8>() // Run the notification pump. int count(0); - int limit(10); + int limit(LOOP_COUNT_LONG); while (count++ < limit && mHandlerCalls < 1) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Request executed in reasonable time", count < limit); ensure("One handler invocation for request", mHandlerCalls == 1); @@ -782,21 +791,21 @@ void HttpRequestTestObjectType::test<8>() // Run the notification pump again count = 0; - limit = 10; + limit = LOOP_COUNT_LONG; while (count++ < limit && mHandlerCalls < 2) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Second request executed in reasonable time", count < limit); ensure("Second handler invocation", mHandlerCalls == 2); // See that we actually shutdown the thread count = 0; - limit = 10; + limit = LOOP_COUNT_SHORT; while (count++ < limit && ! HttpService::isStopped()) { - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Thread actually stopped running", HttpService::isStopped()); @@ -876,11 +885,11 @@ void HttpRequestTestObjectType::test<9>() // Run the notification pump. int count(0); - int limit(10); + int limit(LOOP_COUNT_LONG); while (count++ < limit && mHandlerCalls < 1) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Request executed in reasonable time", count < limit); ensure("One handler invocation for request", mHandlerCalls == 1); @@ -892,21 +901,21 @@ void HttpRequestTestObjectType::test<9>() // Run the notification pump again count = 0; - limit = 10; + limit = LOOP_COUNT_LONG; while (count++ < limit && mHandlerCalls < 2) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Second request executed in reasonable time", count < limit); ensure("Second handler invocation", mHandlerCalls == 2); // See that we actually shutdown the thread count = 0; - limit = 10; + limit = LOOP_COUNT_SHORT; while (count++ < limit && ! HttpService::isStopped()) { - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Thread actually stopped running", HttpService::isStopped()); @@ -988,11 +997,11 @@ void HttpRequestTestObjectType::test<10>() // Run the notification pump. int count(0); - int limit(10); + int limit(LOOP_COUNT_LONG); while (count++ < limit && mHandlerCalls < 1) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Request executed in reasonable time", count < limit); ensure("One handler invocation for request", mHandlerCalls == 1); @@ -1004,21 +1013,21 @@ void HttpRequestTestObjectType::test<10>() // Run the notification pump again count = 0; - limit = 10; + limit = LOOP_COUNT_LONG; while (count++ < limit && mHandlerCalls < 2) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Second request executed in reasonable time", count < limit); ensure("Second handler invocation", mHandlerCalls == 2); // See that we actually shutdown the thread count = 0; - limit = 10; + limit = LOOP_COUNT_SHORT; while (count++ < limit && ! HttpService::isStopped()) { - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Thread actually stopped running", HttpService::isStopped()); @@ -1106,11 +1115,11 @@ void HttpRequestTestObjectType::test<11>() // Run the notification pump. int count(0); - int limit(10); + int limit(LOOP_COUNT_LONG); while (count++ < limit && mHandlerCalls < 1) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Request executed in reasonable time", count < limit); ensure("One handler invocation for request", mHandlerCalls == 1); @@ -1122,21 +1131,21 @@ void HttpRequestTestObjectType::test<11>() // Run the notification pump again count = 0; - limit = 10; + limit = LOOP_COUNT_LONG; while (count++ < limit && mHandlerCalls < 2) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Second request executed in reasonable time", count < limit); ensure("Second handler invocation", mHandlerCalls == 2); // See that we actually shutdown the thread count = 0; - limit = 10; + limit = LOOP_COUNT_SHORT; while (count++ < limit && ! HttpService::isStopped()) { - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Thread actually stopped running", HttpService::isStopped()); @@ -1226,11 +1235,11 @@ void HttpRequestTestObjectType::test<12>() // Run the notification pump. int count(0); - int limit(10); + int limit(LOOP_COUNT_LONG); while (count++ < limit && mHandlerCalls < 1) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Request executed in reasonable time", count < limit); ensure("One handler invocation for request", mHandlerCalls == 1); @@ -1242,21 +1251,21 @@ void HttpRequestTestObjectType::test<12>() // Run the notification pump again count = 0; - limit = 10; + limit = LOOP_COUNT_LONG; while (count++ < limit && mHandlerCalls < 2) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Second request executed in reasonable time", count < limit); ensure("Second handler invocation", mHandlerCalls == 2); // See that we actually shutdown the thread count = 0; - limit = 10; + limit = LOOP_COUNT_SHORT; while (count++ < limit && ! HttpService::isStopped()) { - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Thread actually stopped running", HttpService::isStopped()); @@ -1339,8 +1348,8 @@ void HttpRequestTestObjectType::test<13>() HttpHandle handle = req->requestGetByteRange(HttpRequest::DEFAULT_POLICY_ID, 0U, url_base, - 0, - 0, + 0, + 0, opts, NULL, &handler); @@ -1352,11 +1361,11 @@ void HttpRequestTestObjectType::test<13>() // Run the notification pump. int count(0); - int limit(10); + int limit(LOOP_COUNT_LONG); while (count++ < limit && mHandlerCalls < 1) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Request executed in reasonable time", count < limit); ensure("One handler invocation for request", mHandlerCalls == 1); @@ -1369,21 +1378,21 @@ void HttpRequestTestObjectType::test<13>() // Run the notification pump again count = 0; - limit = 10; + limit = LOOP_COUNT_LONG; while (count++ < limit && mHandlerCalls < 2) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Second request executed in reasonable time", count < limit); ensure("Second handler invocation", mHandlerCalls == 2); // See that we actually shutdown the thread count = 0; - limit = 10; + limit = LOOP_COUNT_SHORT; while (count++ < limit && ! HttpService::isStopped()) { - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Thread actually stopped running", HttpService::isStopped()); @@ -1471,11 +1480,11 @@ void HttpRequestTestObjectType::test<14>() // Run the notification pump. int count(0); - int limit(50); // With one retry, should fail quickish + int limit(LOOP_COUNT_LONG); while (count++ < limit && mHandlerCalls < 1) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Request executed in reasonable time", count < limit); ensure("One handler invocation for request", mHandlerCalls == 1); @@ -1487,21 +1496,21 @@ void HttpRequestTestObjectType::test<14>() // Run the notification pump again count = 0; - limit = 100; + limit = LOOP_COUNT_LONG; while (count++ < limit && mHandlerCalls < 2) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Second request executed in reasonable time", count < limit); ensure("Second handler invocation", mHandlerCalls == 2); // See that we actually shutdown the thread count = 0; - limit = 10; + limit = LOOP_COUNT_SHORT; while (count++ < limit && ! HttpService::isStopped()) { - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Thread actually stopped running", HttpService::isStopped()); @@ -1594,11 +1603,11 @@ void HttpRequestTestObjectType::test<15>() // Run the notification pump. int count(0); - int limit(10); + int limit(LOOP_COUNT_LONG); while (count++ < limit && mHandlerCalls < 1) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Request executed in reasonable time", count < limit); ensure("One handler invocation for request", mHandlerCalls == 1); @@ -1611,21 +1620,21 @@ void HttpRequestTestObjectType::test<15>() // Run the notification pump again count = 0; - limit = 10; + limit = LOOP_COUNT_LONG; while (count++ < limit && mHandlerCalls < 2) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Second request executed in reasonable time", count < limit); ensure("Second handler invocation", mHandlerCalls == 2); // See that we actually shutdown the thread count = 0; - limit = 10; + limit = LOOP_COUNT_SHORT; while (count++ < limit && ! HttpService::isStopped()) { - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Thread actually stopped running", HttpService::isStopped()); @@ -1724,11 +1733,11 @@ void HttpRequestTestObjectType::test<16>() // Run the notification pump. int count(0); - int limit(10); + int limit(LOOP_COUNT_LONG); while (count++ < limit && mHandlerCalls < 1) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Request executed in reasonable time", count < limit); ensure("One handler invocation for request", mHandlerCalls == 1); @@ -1764,11 +1773,11 @@ void HttpRequestTestObjectType::test<16>() // Run the notification pump. count = 0; - limit = 10; + limit = LOOP_COUNT_LONG; while (count++ < limit && mHandlerCalls < 2) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Request executed in reasonable time", count < limit); ensure("One handler invocation for request", mHandlerCalls == 2); @@ -1783,21 +1792,21 @@ void HttpRequestTestObjectType::test<16>() // Run the notification pump again count = 0; - limit = 10; + limit = LOOP_COUNT_LONG; while (count++ < limit && mHandlerCalls < 3) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Second request executed in reasonable time", count < limit); ensure("Second handler invocation", mHandlerCalls == 3); // See that we actually shutdown the thread count = 0; - limit = 10; + limit = LOOP_COUNT_SHORT; while (count++ < limit && ! HttpService::isStopped()) { - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Thread actually stopped running", HttpService::isStopped()); @@ -1919,11 +1928,11 @@ void HttpRequestTestObjectType::test<17>() // Run the notification pump. int count(0); - int limit(10); + int limit(LOOP_COUNT_LONG); while (count++ < limit && mHandlerCalls < 1) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Request executed in reasonable time", count < limit); ensure("One handler invocation for request", mHandlerCalls == 1); @@ -1938,21 +1947,21 @@ void HttpRequestTestObjectType::test<17>() // Run the notification pump again count = 0; - limit = 10; + limit = LOOP_COUNT_LONG; while (count++ < limit && mHandlerCalls < 2) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Second request executed in reasonable time", count < limit); ensure("Second handler invocation", mHandlerCalls == 2); // See that we actually shutdown the thread count = 0; - limit = 10; + limit = LOOP_COUNT_SHORT; while (count++ < limit && ! HttpService::isStopped()) { - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Thread actually stopped running", HttpService::isStopped()); @@ -2079,11 +2088,11 @@ void HttpRequestTestObjectType::test<18>() // Run the notification pump. int count(0); - int limit(10); + int limit(LOOP_COUNT_LONG); while (count++ < limit && mHandlerCalls < 1) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Request executed in reasonable time", count < limit); ensure("One handler invocation for request", mHandlerCalls == 1); @@ -2098,21 +2107,21 @@ void HttpRequestTestObjectType::test<18>() // Run the notification pump again count = 0; - limit = 10; + limit = LOOP_COUNT_LONG; while (count++ < limit && mHandlerCalls < 2) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Second request executed in reasonable time", count < limit); ensure("Second handler invocation", mHandlerCalls == 2); // See that we actually shutdown the thread count = 0; - limit = 10; + limit = LOOP_COUNT_SHORT; while (count++ < limit && ! HttpService::isStopped()) { - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Thread actually stopped running", HttpService::isStopped()); @@ -2237,11 +2246,11 @@ void HttpRequestTestObjectType::test<19>() // Run the notification pump. int count(0); - int limit(10); + int limit(LOOP_COUNT_LONG); while (count++ < limit && mHandlerCalls < 1) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Request executed in reasonable time", count < limit); ensure("One handler invocation for request", mHandlerCalls == 1); @@ -2255,21 +2264,21 @@ void HttpRequestTestObjectType::test<19>() // Run the notification pump again count = 0; - limit = 10; + limit = LOOP_COUNT_LONG; while (count++ < limit && mHandlerCalls < 2) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Second request executed in reasonable time", count < limit); ensure("Second handler invocation", mHandlerCalls == 2); // See that we actually shutdown the thread count = 0; - limit = 10; + limit = LOOP_COUNT_SHORT; while (count++ < limit && ! HttpService::isStopped()) { - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Thread actually stopped running", HttpService::isStopped()); @@ -2401,11 +2410,11 @@ void HttpRequestTestObjectType::test<20>() // Run the notification pump. int count(0); - int limit(10); + int limit(LOOP_COUNT_LONG); while (count++ < limit && mHandlerCalls < 1) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Request executed in reasonable time", count < limit); ensure("One handler invocation for request", mHandlerCalls == 1); @@ -2420,21 +2429,21 @@ void HttpRequestTestObjectType::test<20>() // Run the notification pump again count = 0; - limit = 10; + limit = LOOP_COUNT_LONG; while (count++ < limit && mHandlerCalls < 2) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Second request executed in reasonable time", count < limit); ensure("Second handler invocation", mHandlerCalls == 2); // See that we actually shutdown the thread count = 0; - limit = 10; + limit = LOOP_COUNT_SHORT; while (count++ < limit && ! HttpService::isStopped()) { - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Thread actually stopped running", HttpService::isStopped()); @@ -2569,11 +2578,11 @@ void HttpRequestTestObjectType::test<21>() // Run the notification pump. int count(0); - int limit(10); + int limit(LOOP_COUNT_LONG); while (count++ < limit && mHandlerCalls < 1) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Request executed in reasonable time", count < limit); ensure("One handler invocation for request", mHandlerCalls == 1); @@ -2588,21 +2597,21 @@ void HttpRequestTestObjectType::test<21>() // Run the notification pump again count = 0; - limit = 10; + limit = LOOP_COUNT_LONG; while (count++ < limit && mHandlerCalls < 2) { req->update(1000000); - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Second request executed in reasonable time", count < limit); ensure("Second handler invocation", mHandlerCalls == 2); // See that we actually shutdown the thread count = 0; - limit = 10; + limit = LOOP_COUNT_SHORT; while (count++ < limit && ! HttpService::isStopped()) { - usleep(100000); + usleep(LOOP_SLEEP_INTERVAL); } ensure("Thread actually stopped running", HttpService::isStopped()); @@ -2650,6 +2659,200 @@ void HttpRequestTestObjectType::test<21>() } } +// BUG-2295 Tests - Content-Range header received but no body +template <> template <> +void HttpRequestTestObjectType::test<22>() +{ + ScopedCurlInit ready; + + std::string url_base(get_base_url()); + // std::cerr << "Base: " << url_base << std::endl; + + set_test_name("BUG-2295"); + + // Handler can be stack-allocated *if* there are no dangling + // references to it after completion of this method. + // Create before memory record as the string copy will bump numbers. + TestHandler2 handler(this, "handler"); + + // record the total amount of dynamically allocated memory + mMemTotal = GetMemTotal(); + mHandlerCalls = 0; + + HttpOptions * options = NULL; + HttpRequest * req = NULL; + + try + { + // options set + options = new HttpOptions(); + options->setRetries(1); // Partial_File is retryable and can timeout in here + + // Get singletons created + HttpRequest::createService(); + + // Start threading early so that thread memory is invariant + // over the test. + HttpRequest::startThread(); + + // create a new ref counted object with an implicit reference + req = new HttpRequest(); + ensure("Memory allocated on construction", mMemTotal < GetMemTotal()); + + // ====================================== + // Issue bug2295 GETs that will get a 206 + // ====================================== + mStatus = HttpStatus(206); + static const int test_count(3); + for (int i(0); i < test_count; ++i) + { + char buffer[128]; + sprintf(buffer, "/bug2295/%d/", i); + HttpHandle handle = req->requestGetByteRange(HttpRequest::DEFAULT_POLICY_ID, + 0U, + url_base + buffer, + 0, + 25, + options, + NULL, + &handler); + ensure("Valid handle returned for ranged request", handle != LLCORE_HTTP_HANDLE_INVALID); + } + + // Run the notification pump. + int count(0); + int limit(LOOP_COUNT_LONG); + while (count++ < limit && mHandlerCalls < test_count) + { + req->update(1000000); + usleep(LOOP_SLEEP_INTERVAL); + } + ensure("Request executed in reasonable time - ms1", count < limit); + ensure("One handler invocation for each request - ms1", mHandlerCalls == test_count); + + // ====================================== + // Issue bug2295 GETs that will get a libcurl 18 (PARTIAL_FILE) + // ====================================== + mHandlerCalls = 0; + mStatus = HttpStatus(HttpStatus::EXT_CURL_EASY, CURLE_PARTIAL_FILE); + static const int test2_count(1); + for (int i(0); i < test2_count; ++i) + { + char buffer[128]; + sprintf(buffer, "/bug2295/00000012/%d/", i); + HttpHandle handle = req->requestGetByteRange(HttpRequest::DEFAULT_POLICY_ID, + 0U, + url_base + buffer, + 0, + 25, + options, + NULL, + &handler); + ensure("Valid handle returned for ranged request", handle != LLCORE_HTTP_HANDLE_INVALID); + } + + // Run the notification pump. + count = 0; + limit = LOOP_COUNT_LONG; + while (count++ < limit && mHandlerCalls < test2_count) + { + req->update(1000000); + usleep(LOOP_SLEEP_INTERVAL); + } + ensure("Request executed in reasonable time - ms2", count < limit); + ensure("One handler invocation for each request - ms2", mHandlerCalls == test2_count); + + // ====================================== + // Issue bug2295 GETs that will get an llcorehttp HE_INV_CONTENT_RANGE_HDR status + // ====================================== + mHandlerCalls = 0; + mStatus = HttpStatus(HttpStatus::LLCORE, HE_INV_CONTENT_RANGE_HDR); + static const int test3_count(1); + for (int i(0); i < test3_count; ++i) + { + char buffer[128]; + sprintf(buffer, "/bug2295/inv_cont_range/%d/", i); + HttpHandle handle = req->requestGetByteRange(HttpRequest::DEFAULT_POLICY_ID, + 0U, + url_base + buffer, + 0, + 25, + options, + NULL, + &handler); + ensure("Valid handle returned for ranged request", handle != LLCORE_HTTP_HANDLE_INVALID); + } + + // Run the notification pump. + count = 0; + limit = LOOP_COUNT_LONG; + while (count++ < limit && mHandlerCalls < test3_count) + { + req->update(1000000); + usleep(LOOP_SLEEP_INTERVAL); + } + ensure("Request executed in reasonable time - ms3", count < limit); + ensure("One handler invocation for each request - ms3", mHandlerCalls == test3_count); + + // ====================================== + // Okay, request a shutdown of the servicing thread + // ====================================== + mStatus = HttpStatus(); + mHandlerCalls = 0; + HttpHandle handle = req->requestStopThread(&handler); + ensure("Valid handle returned for second request", handle != LLCORE_HTTP_HANDLE_INVALID); + + // Run the notification pump again + count = 0; + limit = LOOP_COUNT_LONG; + while (count++ < limit && mHandlerCalls < 1) + { + req->update(1000000); + usleep(LOOP_SLEEP_INTERVAL); + } + ensure("Shutdown request executed in reasonable time", count < limit); + ensure("Shutdown handler invocation", mHandlerCalls == 1); + + // See that we actually shutdown the thread + count = 0; + limit = LOOP_COUNT_SHORT; + while (count++ < limit && ! HttpService::isStopped()) + { + usleep(LOOP_SLEEP_INTERVAL); + } + ensure("Thread actually stopped running", HttpService::isStopped()); + + // release options + if (options) + { + options->release(); + options = NULL; + } + + // release the request object + delete req; + req = NULL; + + // Shut down service + HttpRequest::destroyService(); + +#if defined(WIN32) + // Can only do this memory test on Windows. On other platforms, + // the LL logging system holds on to memory and produces what looks + // like memory leaks... + + // printf("Old mem: %d, New mem: %d\n", mMemTotal, GetMemTotal()); + ensure("Memory usage back to that at entry", mMemTotal == GetMemTotal()); +#endif + } + catch (...) + { + stop_thread(req); + delete req; + HttpRequest::destroyService(); + throw; + } +} } // end namespace tut diff --git a/indra/llcorehttp/tests/test_httpstatus.hpp b/indra/llcorehttp/tests/test_httpstatus.hpp index 887315befc..b5538528c5 100755 --- a/indra/llcorehttp/tests/test_httpstatus.hpp +++ b/indra/llcorehttp/tests/test_httpstatus.hpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2012&license=viewerlgpl$ * Second Life Viewer Source Code - * Copyright (C) 2012, Linden Research, Inc. + * Copyright (C) 2012-2013, Linden Research, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -91,9 +91,6 @@ template <> template <> void HttpStatusTestObjectType::test<2>() { set_test_name("HttpStatus memory structure"); -#if LL_WINDOWS - skip("MAINT-2302: This frequently (though not always) fails on Windows."); -#endif // Require that an HttpStatus object can be trivially // returned as a function return value in registers. @@ -106,10 +103,7 @@ void HttpStatusTestObjectType::test<2>() template <> template <> void HttpStatusTestObjectType::test<3>() { - set_test_name("HttpStatus valid error string conversion"); -#if LL_WINDOWS - skip("MAINT-2302: This frequently (though not always) fails on Windows."); -#endif + set_test_name("HttpStatus valid status string conversion"); HttpStatus status; status.mType = HttpStatus::EXT_CURL_EASY; @@ -141,10 +135,7 @@ void HttpStatusTestObjectType::test<3>() template <> template <> void HttpStatusTestObjectType::test<4>() { - set_test_name("HttpStatus invalid error string conversion"); -#if LL_WINDOWS - skip("MAINT-2302: This frequently (though not always) fails on Windows."); -#endif + set_test_name("HttpStatus invalid status string conversion"); HttpStatus status; status.mType = HttpStatus::EXT_CURL_EASY; @@ -170,9 +161,6 @@ template <> template <> void HttpStatusTestObjectType::test<5>() { set_test_name("HttpStatus equality/inequality testing"); -#if LL_WINDOWS - skip("MAINT-2302: This frequently (though not always) fails on Windows."); -#endif // Make certain equality/inequality tests do not pass // through the bool conversion. Distinct successful @@ -193,9 +181,6 @@ template <> template <> void HttpStatusTestObjectType::test<6>() { set_test_name("HttpStatus basic HTTP status encoding"); -#if LL_WINDOWS - skip("MAINT-2302: This frequently (though not always) fails on Windows."); -#endif HttpStatus status; status.mType = 200; @@ -242,10 +227,7 @@ void HttpStatusTestObjectType::test<6>() template <> template <> void HttpStatusTestObjectType::test<7>() { - set_test_name("HttpStatus HTTP error text strings"); -#if LL_WINDOWS - skip("MAINT-2302: This frequently (though not always) fails on Windows."); -#endif + set_test_name("HttpStatus HTTP status text strings"); HttpStatus status(100, HE_REPLY_ERROR); std::string msg(status.toString()); diff --git a/indra/llcorehttp/tests/test_llcorehttp_peer.py b/indra/llcorehttp/tests/test_llcorehttp_peer.py index 75a3c39ef2..3c3af8dc75 100755 --- a/indra/llcorehttp/tests/test_llcorehttp_peer.py +++ b/indra/llcorehttp/tests/test_llcorehttp_peer.py @@ -9,7 +9,7 @@ $LicenseInfo:firstyear=2008&license=viewerlgpl$ Second Life Viewer Source Code -Copyright (C) 2012, Linden Research, Inc. +Copyright (C) 2012-2013, Linden Research, Inc. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -35,6 +35,10 @@ import time import select import getopt from threading import Thread +try: + from cStringIO import StringIO +except ImportError: + from StringIO import StringIO from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler from SocketServer import ThreadingMixIn @@ -47,7 +51,30 @@ from testrunner import freeport, run, debug, VERBOSE class TestHTTPRequestHandler(BaseHTTPRequestHandler): """This subclass of BaseHTTPRequestHandler is to receive and echo LLSD-flavored messages sent by the C++ LLHTTPClient. + + Target URLs are fairly free-form and are assembled by + concatinating fragments. Currently defined fragments + are: + - '/reflect/' Request headers are bounced back to caller + after prefixing with 'X-Reflect-' + - '/fail/' Body of request can contain LLSD with + 'reason' string and 'status' integer + which will become response header. + - '/bug2295/' 206 response, no data in body: + -- '/bug2295/0/' "Content-Range: bytes 0-75/2983" + -- '/bug2295/1/' "Content-Range: bytes 0-75/*" + -- '/bug2295/2/' "Content-Range: bytes 0-75/2983", + "Content-Length: 0" + -- '/bug2295/00000018/0/' Generates PARTIAL_FILE (18) error in libcurl. + "Content-Range: bytes 0-75/2983", + "Content-Length: 76" + -- '/bug2295/inv_cont_range/0/' Generates HE_INVALID_CONTENT_RANGE error in llcorehttp. + + Some combinations make no sense, there's no effort to protect + you from that. """ + ignore_exceptions = (Exception,) + def read(self): # The following logic is adapted from the library module # SimpleXMLRPCServer.py. @@ -87,42 +114,36 @@ class TestHTTPRequestHandler(BaseHTTPRequestHandler): def do_GET(self, withdata=True): # Of course, don't attempt to read data. - self.answer(dict(reply="success", status=200, - reason="Your GET operation worked")) + try: + self.answer(dict(reply="success", status=200, + reason="Your GET operation worked")) + except self.ignore_exceptions, e: + print >> sys.stderr, "Exception during GET (ignoring): %s" % str(e) def do_POST(self): # Read the provided POST data. # self.answer(self.read()) - self.answer(dict(reply="success", status=200, - reason=self.read())) + try: + self.answer(dict(reply="success", status=200, + reason=self.read())) + except self.ignore_exceptions, e: + print >> sys.stderr, "Exception during POST (ignoring): %s" % str(e) def do_PUT(self): # Read the provided PUT data. # self.answer(self.read()) - self.answer(dict(reply="success", status=200, - reason=self.read())) + try: + self.answer(dict(reply="success", status=200, + reason=self.read())) + except self.ignore_exceptions, e: + print >> sys.stderr, "Exception during PUT (ignoring): %s" % str(e) def answer(self, data, withdata=True): debug("%s.answer(%s): self.path = %r", self.__class__.__name__, data, self.path) if "/sleep/" in self.path: time.sleep(30) - if "fail" not in self.path: - data = data.copy() # we're going to modify - # Ensure there's a "reply" key in data, even if there wasn't before - data["reply"] = data.get("reply", llsd.LLSD("success")) - response = llsd.format_xml(data) - debug("success: %s", response) - self.send_response(200) - if "/reflect/" in self.path: - self.reflect_headers() - self.send_header("Content-type", "application/llsd+xml") - self.send_header("Content-Length", str(len(response))) - self.send_header("X-LL-Special", "Mememememe"); - self.end_headers() - if withdata: - self.wfile.write(response) - else: # fail requested + if "fail" in self.path: status = data.get("status", 500) # self.responses maps an int status to a (short, long) pair of # strings. We want the longer string. That's why we pass a string @@ -138,6 +159,57 @@ class TestHTTPRequestHandler(BaseHTTPRequestHandler): if "/reflect/" in self.path: self.reflect_headers() self.end_headers() + elif "/bug2295/" in self.path: + # Test for https://jira.secondlife.com/browse/BUG-2295 + # + # Client can receive a header indicating data should + # appear in the body without actually getting the body. + # Library needs to defend against this case. + # + body = None + if "/bug2295/0/" in self.path: + self.send_response(206) + self.send_header("Content-Range", "bytes 0-75/2983") + elif "/bug2295/1/" in self.path: + self.send_response(206) + self.send_header("Content-Range", "bytes 0-75/*") + elif "/bug2295/2/" in self.path: + self.send_response(206) + self.send_header("Content-Range", "bytes 0-75/2983") + self.send_header("Content-Length", "0") + elif "/bug2295/00000012/0/" in self.path: + self.send_response(206) + self.send_header("Content-Range", "bytes 0-75/2983") + self.send_header("Content-Length", "76") + elif "/bug2295/inv_cont_range/0/" in self.path: + self.send_response(206) + self.send_header("Content-Range", "bytes 0-75/2983") + body = "Some text, but not enough." + else: + # Unknown request + self.send_response(400) + if "/reflect/" in self.path: + self.reflect_headers() + self.send_header("Content-type", "text/plain") + self.end_headers() + if body: + self.wfile.write(body) + else: + # Normal response path + data = data.copy() # we're going to modify + # Ensure there's a "reply" key in data, even if there wasn't before + data["reply"] = data.get("reply", llsd.LLSD("success")) + response = llsd.format_xml(data) + debug("success: %s", response) + self.send_response(200) + if "/reflect/" in self.path: + self.reflect_headers() + self.send_header("Content-type", "application/llsd+xml") + self.send_header("Content-Length", str(len(response))) + self.send_header("X-LL-Special", "Mememememe"); + self.end_headers() + if withdata: + self.wfile.write(response) def reflect_headers(self): for name in self.headers.keys(): @@ -162,6 +234,17 @@ class Server(ThreadingMixIn, HTTPServer): # operation of freeport() absolutely depends on it being off. allow_reuse_address = False + # Override of BaseServer.handle_error(). Not too interested + # in errors and the default handler emits a scary traceback + # to stderr which annoys some. Disable this override to get + # default behavior which *shouldn't* cause the program to return + # a failure status. + def handle_error(self, request, client_address): + print '-'*40 + print 'Ignoring exception during processing of request from', + print client_address + print '-'*40 + if __name__ == "__main__": do_valgrind = False path_search = False @@ -188,3 +271,4 @@ if __name__ == "__main__": args = ["valgrind", "--log-file=./valgrind.log"] + args path_search = True sys.exit(run(server=Thread(name="httpd", target=httpd.serve_forever), use_path=path_search, *args)) + diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 1c25256e95..c8a05e1fae 100755 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -689,8 +689,17 @@ void LLImageRaw::fill( const LLColor4U& color ) } } +LLPointer<LLImageRaw> LLImageRaw::duplicate() +{ + if(getNumRefs() < 2) + { + return this; //nobody else refences to this image, no need to duplicate. + } - + //make a duplicate + LLPointer<LLImageRaw> dup = new LLImageRaw(getData(), getWidth(), getHeight(), getComponents()); + return dup; +} // Src and dst can be any size. Src and dst can each have 3 or 4 components. void LLImageRaw::copy(LLImageRaw* src) diff --git a/indra/llimage/llimage.h b/indra/llimage/llimage.h index 4fc40ecff7..2277afc585 100755 --- a/indra/llimage/llimage.h +++ b/indra/llimage/llimage.h @@ -30,6 +30,7 @@ #include "lluuid.h" #include "llstring.h" #include "llthread.h" +#include "llpointer.h" const S32 MIN_IMAGE_MIP = 2; // 4x4, only used for expand/contract power of 2 const S32 MAX_IMAGE_MIP = 11; // 2048x2048 @@ -214,6 +215,9 @@ public: // Copy operations + //duplicate this raw image if refCount > 1. + LLPointer<LLImageRaw> duplicate(); + // Src and dst can be any size. Src and dst can each have 3 or 4 components. void copy( LLImageRaw* src ); diff --git a/indra/llmath/llcamera.cpp b/indra/llmath/llcamera.cpp index 22ba26f99b..33cf185196 100755 --- a/indra/llmath/llcamera.cpp +++ b/indra/llmath/llcamera.cpp @@ -42,6 +42,11 @@ LLCamera::LLCamera() : mPlaneCount(6), mFrustumCornerDist(0.f) { + for (U32 i = 0; i < PLANE_MASK_NUM; i++) + { + mPlaneMask[i] = PLANE_MASK_NONE; + } + calculateFrustumPlanes(); } @@ -52,6 +57,11 @@ LLCamera::LLCamera(F32 vertical_fov_rads, F32 aspect_ratio, S32 view_height_in_p mPlaneCount(6), mFrustumCornerDist(0.f) { + for (U32 i = 0; i < PLANE_MASK_NUM; i++) + { + mPlaneMask[i] = PLANE_MASK_NONE; + } + mAspect = llclamp(aspect_ratio, MIN_ASPECT_RATIO, MAX_ASPECT_RATIO); mNearPlane = llclamp(near_plane, MIN_NEAR_PLANE, MAX_NEAR_PLANE); if(far_plane < 0) far_plane = DEFAULT_FAR_PLANE; @@ -87,14 +97,14 @@ F32 LLCamera::getMaxView() const void LLCamera::setUserClipPlane(LLPlane& plane) { - mPlaneCount = 7; - mAgentPlanes[6] = plane; - mPlaneMask[6] = plane.calcPlaneMask(); + mPlaneCount = AGENT_PLANE_USER_CLIP_NUM; + mAgentPlanes[AGENT_PLANE_USER_CLIP] = plane; + mPlaneMask[AGENT_PLANE_USER_CLIP] = plane.calcPlaneMask(); } void LLCamera::disableUserClipPlane() { - mPlaneCount = 6; + mPlaneCount = AGENT_PLANE_NO_USER_CLIP_NUM; } void LLCamera::setView(F32 vertical_fov_rads) @@ -161,31 +171,33 @@ size_t LLCamera::readFrustumFromBuffer(const char *buffer) // ---------------- test methods ---------------- -S32 LLCamera::AABBInFrustum(const LLVector4a ¢er, const LLVector4a& radius) +static const LLVector4a sFrustumScaler[] = { - static const LLVector4a scaler[] = { - LLVector4a(-1,-1,-1), - LLVector4a( 1,-1,-1), - LLVector4a(-1, 1,-1), - LLVector4a( 1, 1,-1), - LLVector4a(-1,-1, 1), - LLVector4a( 1,-1, 1), - LLVector4a(-1, 1, 1), - LLVector4a( 1, 1, 1) - }; + LLVector4a(-1,-1,-1), + LLVector4a( 1,-1,-1), + LLVector4a(-1, 1,-1), + LLVector4a( 1, 1,-1), + LLVector4a(-1,-1, 1), + LLVector4a( 1,-1, 1), + LLVector4a(-1, 1, 1), + LLVector4a( 1, 1, 1) // 8 entries +}; +S32 LLCamera::AABBInFrustum(const LLVector4a ¢er, const LLVector4a& radius) +{ U8 mask = 0; bool result = false; LLVector4a rscale, maxp, minp; LLSimdScalar d; - for (U32 i = 0; i < mPlaneCount; i++) + U32 max_planes = llmin(mPlaneCount, (U32) AGENT_PLANE_USER_CLIP_NUM); // mAgentPlanes[] size is 7 + for (U32 i = 0; i < max_planes; i++) { mask = mPlaneMask[i]; - if (mask != 0xff) + if (mask < PLANE_MASK_NUM) { const LLPlane& p(mAgentPlanes[i]); p.getAt<3>(d); - rscale.setMul(radius, scaler[mask]); + rscale.setMul(radius, sFrustumScaler[mask]); minp.setSub(center, rscale); d = -d; if (p.dot3(minp).getF32() > d) @@ -207,29 +219,19 @@ S32 LLCamera::AABBInFrustum(const LLVector4a ¢er, const LLVector4a& radius) S32 LLCamera::AABBInFrustumNoFarClip(const LLVector4a& center, const LLVector4a& radius) { - static const LLVector4a scaler[] = { - LLVector4a(-1,-1,-1), - LLVector4a( 1,-1,-1), - LLVector4a(-1, 1,-1), - LLVector4a( 1, 1,-1), - LLVector4a(-1,-1, 1), - LLVector4a( 1,-1, 1), - LLVector4a(-1, 1, 1), - LLVector4a( 1, 1, 1) - }; - U8 mask = 0; bool result = false; LLVector4a rscale, maxp, minp; LLSimdScalar d; - for (U32 i = 0; i < mPlaneCount; i++) + U32 max_planes = llmin(mPlaneCount, (U32) AGENT_PLANE_USER_CLIP_NUM); // mAgentPlanes[] size is 7 + for (U32 i = 0; i < max_planes; i++) { mask = mPlaneMask[i]; - if ((i != 5) && (mask != 0xff)) + if ((i != 5) && (mask < PLANE_MASK_NUM)) { const LLPlane& p(mAgentPlanes[i]); p.getAt<3>(d); - rscale.setMul(radius, scaler[mask]); + rscale.setMul(radius, sFrustumScaler[mask]); minp.setSub(center, rscale); d = -d; if (p.dot3(minp).getF32() > d) @@ -369,7 +371,7 @@ int LLCamera::sphereInFrustum(const LLVector3 &sphere_center, const F32 radius) bool res = false; for (int i = 0; i < 6; i++) { - if (mPlaneMask[i] != 0xff) + if (mPlaneMask[i] != PLANE_MASK_NONE) { float d = mAgentPlanes[i].dist(sphere_center); @@ -541,14 +543,14 @@ void LLCamera::ignoreAgentFrustumPlane(S32 idx) return; } - mPlaneMask[idx] = 0xff; + mPlaneMask[idx] = PLANE_MASK_NONE; mAgentPlanes[idx].clear(); } void LLCamera::calcAgentFrustumPlanes(LLVector3* frust) { - for (int i = 0; i < 8; i++) + for (int i = 0; i < AGENT_FRUSTRUM_NUM; i++) { mAgentFrustum[i] = frust[i]; } @@ -560,22 +562,22 @@ void LLCamera::calcAgentFrustumPlanes(LLVector3* frust) //order of planes is important, keep most likely to fail in the front of the list //near - frust[0], frust[1], frust[2] - mAgentPlanes[2] = planeFromPoints(frust[0], frust[1], frust[2]); + mAgentPlanes[AGENT_PLANE_NEAR] = planeFromPoints(frust[0], frust[1], frust[2]); //far - mAgentPlanes[5] = planeFromPoints(frust[5], frust[4], frust[6]); + mAgentPlanes[AGENT_PLANE_FAR] = planeFromPoints(frust[5], frust[4], frust[6]); //left - mAgentPlanes[0] = planeFromPoints(frust[4], frust[0], frust[7]); + mAgentPlanes[AGENT_PLANE_LEFT] = planeFromPoints(frust[4], frust[0], frust[7]); //right - mAgentPlanes[1] = planeFromPoints(frust[1], frust[5], frust[6]); + mAgentPlanes[AGENT_PLANE_RIGHT] = planeFromPoints(frust[1], frust[5], frust[6]); //top - mAgentPlanes[4] = planeFromPoints(frust[3], frust[2], frust[6]); + mAgentPlanes[AGENT_PLANE_TOP] = planeFromPoints(frust[3], frust[2], frust[6]); //bottom - mAgentPlanes[3] = planeFromPoints(frust[1], frust[0], frust[4]); + mAgentPlanes[AGENT_PLANE_BOTTOM] = planeFromPoints(frust[1], frust[0], frust[4]); //cache plane octant facing mask for use in AABBInFrustum for (U32 i = 0; i < mPlaneCount; i++) @@ -635,7 +637,7 @@ void LLCamera::calculateWorldFrustumPlanes() LLVector3 center = mOrigin - mXAxis*mNearPlane; mWorldPlanePos = center; LLVector3 pnorm; - for (int p=0; p<4; p++) + for (int p = 0; p < PLANE_NUM; p++) { mLocalPlanes[p].getVector3(pnorm); LLVector3 norm = rotateToAbsolute(pnorm); diff --git a/indra/llmath/llcamera.h b/indra/llmath/llcamera.h index 0b591be622..1283cfb16b 100755 --- a/indra/llmath/llcamera.h +++ b/indra/llmath/llcamera.h @@ -76,26 +76,39 @@ public: PLANE_RIGHT = 1, PLANE_BOTTOM = 2, PLANE_TOP = 3, - PLANE_NUM = 4 + PLANE_NUM = 4, + PLANE_MASK_NONE = 0xff // Disable this plane }; enum { PLANE_LEFT_MASK = (1<<PLANE_LEFT), PLANE_RIGHT_MASK = (1<<PLANE_RIGHT), PLANE_BOTTOM_MASK = (1<<PLANE_BOTTOM), PLANE_TOP_MASK = (1<<PLANE_TOP), - PLANE_ALL_MASK = 0xf + PLANE_ALL_MASK = 0xf, }; enum - { + { // Indexes to mAgentPlanes[] and mPlaneMask[] AGENT_PLANE_LEFT = 0, - AGENT_PLANE_RIGHT, - AGENT_PLANE_NEAR, - AGENT_PLANE_BOTTOM, - AGENT_PLANE_TOP, - AGENT_PLANE_FAR, + AGENT_PLANE_RIGHT = 1, + AGENT_PLANE_NEAR = 2, + AGENT_PLANE_BOTTOM = 3, + AGENT_PLANE_TOP = 4, + AGENT_PLANE_FAR = 5, + AGENT_PLANE_USER_CLIP = 6 + }; + enum + { // Sizes for mAgentPlanes[]. 7th entry is special case for user clip + AGENT_PLANE_NO_USER_CLIP_NUM = 6, + AGENT_PLANE_USER_CLIP_NUM = 7, + PLANE_MASK_NUM = 8 // 7 actually used, 8 is for alignment }; + enum + { + AGENT_FRUSTRUM_NUM = 8 + }; + enum { HORIZ_PLANE_LEFT = 0, HORIZ_PLANE_RIGHT = 1, @@ -108,15 +121,15 @@ public: }; private: - LL_ALIGN_16(LLPlane mAgentPlanes[7]); //frustum planes in agent space a la gluUnproject (I'm a bastard, I know) - DaveP - U8 mPlaneMask[8]; // 8 for alignment + LL_ALIGN_16(LLPlane mAgentPlanes[AGENT_PLANE_USER_CLIP_NUM]); //frustum planes in agent space a la gluUnproject (I'm a bastard, I know) - DaveP + U8 mPlaneMask[PLANE_MASK_NUM]; // 8 for alignment F32 mView; // angle between top and bottom frustum planes in radians. F32 mAspect; // width/height S32 mViewHeightInPixels; // for ViewHeightInPixels() only F32 mNearPlane; F32 mFarPlane; - LL_ALIGN_16(LLPlane mLocalPlanes[4]); + LL_ALIGN_16(LLPlane mLocalPlanes[PLANE_NUM]); F32 mFixedDistance; // Always return this distance, unless < 0 LLVector3 mFrustCenter; // center of frustum and radius squared for ultra-quick exclusion test F32 mFrustRadiusSquared; @@ -128,7 +141,7 @@ private: LLVector3 mWorldPlanePos; // Position of World Planes (may be offset from camera) public: - LLVector3 mAgentFrustum[8]; //8 corners of 6-plane frustum + LLVector3 mAgentFrustum[AGENT_FRUSTRUM_NUM]; //8 corners of 6-plane frustum F32 mFrustumCornerDist; //distance to corner of frustum against far clip plane LLPlane& getAgentPlane(U32 idx) { return mAgentPlanes[idx]; } diff --git a/indra/llmath/llmatrix4a.h b/indra/llmath/llmatrix4a.h index c4cefdb4fa..d141298f69 100755 --- a/indra/llmath/llmatrix4a.h +++ b/indra/llmath/llmatrix4a.h @@ -107,15 +107,14 @@ public: inline void rotate(const LLVector4a& v, LLVector4a& res) { + LLVector4a y,z; + res = _mm_shuffle_ps(v, v, _MM_SHUFFLE(0, 0, 0, 0)); - res.mul(mMatrix[0]); - - LLVector4a y; y = _mm_shuffle_ps(v, v, _MM_SHUFFLE(1, 1, 1, 1)); - y.mul(mMatrix[1]); - - LLVector4a z; z = _mm_shuffle_ps(v, v, _MM_SHUFFLE(2, 2, 2, 2)); + + res.mul(mMatrix[0]); + y.mul(mMatrix[1]); z.mul(mMatrix[2]); res.add(y); diff --git a/indra/llmath/llsimdmath.h b/indra/llmath/llsimdmath.h index 01458521ec..cebd2ace7d 100755 --- a/indra/llmath/llsimdmath.h +++ b/indra/llmath/llsimdmath.h @@ -39,34 +39,6 @@ #include <stdint.h> #endif -template <typename T> T* LL_NEXT_ALIGNED_ADDRESS(T* address) -{ - return reinterpret_cast<T*>( - (reinterpret_cast<uintptr_t>(address) + 0xF) & ~0xF); -} - -template <typename T> T* LL_NEXT_ALIGNED_ADDRESS_64(T* address) -{ - return reinterpret_cast<T*>( - (reinterpret_cast<uintptr_t>(address) + 0x3F) & ~0x3F); -} - -#if LL_LINUX || LL_DARWIN - -#define LL_ALIGN_PREFIX(x) -#define LL_ALIGN_POSTFIX(x) __attribute__((aligned(x))) - -#elif LL_WINDOWS - -#define LL_ALIGN_PREFIX(x) __declspec(align(x)) -#define LL_ALIGN_POSTFIX(x) - -#else -#error "LL_ALIGN_PREFIX and LL_ALIGN_POSTFIX undefined" -#endif - -#define LL_ALIGN_16(var) LL_ALIGN_PREFIX(16) var LL_ALIGN_POSTFIX(16) - #include <xmmintrin.h> #include <emmintrin.h> diff --git a/indra/llmath/llvector4a.cpp b/indra/llmath/llvector4a.cpp index 6edeb0fefe..570fa41a43 100755 --- a/indra/llmath/llvector4a.cpp +++ b/indra/llmath/llvector4a.cpp @@ -41,55 +41,7 @@ extern const LLVector4a LL_V4A_EPSILON = reinterpret_cast<const LLVector4a&> ( F /*static */void LLVector4a::memcpyNonAliased16(F32* __restrict dst, const F32* __restrict src, size_t bytes) { - assert(src != NULL); - assert(dst != NULL); - assert(bytes > 0); - assert((bytes % sizeof(F32))== 0); - ll_assert_aligned(src,16); - ll_assert_aligned(dst,16); - assert(bytes%16==0); - - F32* end = dst + (bytes / sizeof(F32) ); - - if (bytes > 64) - { - F32* begin_64 = LL_NEXT_ALIGNED_ADDRESS_64(dst); - - //at least 64 (16*4) bytes before the end of the destination, switch to 16 byte copies - F32* end_64 = end-16; - - _mm_prefetch((char*)begin_64, _MM_HINT_NTA); - _mm_prefetch((char*)begin_64 + 64, _MM_HINT_NTA); - _mm_prefetch((char*)begin_64 + 128, _MM_HINT_NTA); - _mm_prefetch((char*)begin_64 + 192, _MM_HINT_NTA); - - while (dst < begin_64) - { - copy4a(dst, src); - dst += 4; - src += 4; - } - - while (dst < end_64) - { - _mm_prefetch((char*)src + 512, _MM_HINT_NTA); - _mm_prefetch((char*)dst + 512, _MM_HINT_NTA); - copy4a(dst, src); - copy4a(dst+4, src+4); - copy4a(dst+8, src+8); - copy4a(dst+12, src+12); - - dst += 16; - src += 16; - } - } - - while (dst < end) - { - copy4a(dst, src); - dst += 4; - src += 4; - } + ll_memcpy_nonaliased_aligned_16((char*)dst, (char*)src, bytes); } void LLVector4a::setRotated( const LLRotation& rot, const LLVector4a& vec ) diff --git a/indra/llmath/llvector4a.inl b/indra/llmath/llvector4a.inl index 7c52ffef21..69d3d01efe 100755 --- a/indra/llmath/llvector4a.inl +++ b/indra/llmath/llvector4a.inl @@ -409,6 +409,26 @@ inline void LLVector4a::normalize3fast() mQ = _mm_mul_ps( mQ, approxRsqrt ); } +inline void LLVector4a::normalize3fast_checked(LLVector4a* d) +{ + if (!isFinite3()) + { + *this = d ? *d : LLVector4a(0,1,0,1); + return; + } + + LLVector4a lenSqrd; lenSqrd.setAllDot3( *this, *this ); + + if (lenSqrd.getF32ptr()[0] <= FLT_EPSILON) + { + *this = d ? *d : LLVector4a(0,1,0,1); + return; + } + + const LLQuad approxRsqrt = _mm_rsqrt_ps(lenSqrd.mQ); + mQ = _mm_mul_ps( mQ, approxRsqrt ); +} + // Return true if this vector is normalized with respect to x,y,z up to tolerance inline LLBool32 LLVector4a::isNormalized3( F32 tolerance ) const { @@ -460,16 +480,13 @@ inline void LLVector4a::setMax(const LLVector4a& lhs, const LLVector4a& rhs) mQ = _mm_max_ps(lhs.mQ, rhs.mQ); } -// Set this to (c * lhs) + rhs * ( 1 - c) +// Set this to lhs + (rhs-lhs)*c inline void LLVector4a::setLerp(const LLVector4a& lhs, const LLVector4a& rhs, F32 c) { - LLVector4a a = lhs; - a.mul(c); - - LLVector4a b = rhs; - b.mul(1.f-c); - - setAdd(a, b); + LLVector4a t; + t.setSub(rhs,lhs); + t.mul(c); + setAdd(lhs, t); } inline LLBool32 LLVector4a::isFinite3() const diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index c4e1f0c84c..2b865b4a8e 100755 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -136,6 +136,82 @@ BOOL LLLineSegmentBoxIntersect(const F32* start, const F32* end, const F32* cent return true; } +// Finds tangent vec based on three vertices with texture coordinates. +// Fills in dummy values if the triangle has degenerate texture coordinates. +void calc_tangent_from_triangle( + LLVector4a& normal, + LLVector4a& tangent_out, + const LLVector4a& v1, + const LLVector2& w1, + const LLVector4a& v2, + const LLVector2& w2, + const LLVector4a& v3, + const LLVector2& w3) +{ + const F32* v1ptr = v1.getF32ptr(); + const F32* v2ptr = v2.getF32ptr(); + const F32* v3ptr = v3.getF32ptr(); + + float x1 = v2ptr[0] - v1ptr[0]; + float x2 = v3ptr[0] - v1ptr[0]; + float y1 = v2ptr[1] - v1ptr[1]; + float y2 = v3ptr[1] - v1ptr[1]; + float z1 = v2ptr[2] - v1ptr[2]; + float z2 = v3ptr[2] - v1ptr[2]; + + float s1 = w2.mV[0] - w1.mV[0]; + float s2 = w3.mV[0] - w1.mV[0]; + float t1 = w2.mV[1] - w1.mV[1]; + float t2 = w3.mV[1] - w1.mV[1]; + + F32 rd = s1*t2-s2*t1; + + float r = ((rd*rd) > FLT_EPSILON) ? 1.0F / rd : 1024.f; //some made up large ratio for division by zero + + llassert(llfinite(r)); + llassert(!llisnan(r)); + + LLVector4a sdir( + (t2 * x1 - t1 * x2) * r, + (t2 * y1 - t1 * y2) * r, + (t2 * z1 - t1 * z2) * r); + + LLVector4a tdir( + (s1 * x2 - s2 * x1) * r, + (s1 * y2 - s2 * y1) * r, + (s1 * z2 - s2 * z1) * r); + + LLVector4a n = normal; + LLVector4a t = sdir; + + LLVector4a ncrosst; + ncrosst.setCross3(n,t); + + // Gram-Schmidt orthogonalize + n.mul(n.dot3(t).getF32()); + + LLVector4a tsubn; + tsubn.setSub(t,n); + + if (tsubn.dot3(tsubn).getF32() > F_APPROXIMATELY_ZERO) + { + tsubn.normalize3fast_checked(); + + // Calculate handedness + F32 handedness = ncrosst.dot3(tdir).getF32() < 0.f ? -1.f : 1.f; + + tsubn.getF32ptr()[3] = handedness; + + tangent_out = tsubn; + } + else + { + // degenerate, make up a value + // + tangent_out.set(0,0,1,1); + } + +} // intersect test between triangle vert0, vert1, vert2 and a ray from orig in direction dir. @@ -474,7 +550,7 @@ void LLProfile::genNGon(const LLProfileParams& params, S32 sides, F32 offset, F3 const F32 tableScale[] = { 1, 1, 1, 0.5f, 0.707107f, 0.53f, 0.525f, 0.5f }; F32 scale = 0.5f; F32 t, t_step, t_first, t_fraction, ang, ang_step; - LLVector3 pt1,pt2; + LLVector4a pt1,pt2; F32 begin = params.getBegin(); F32 end = params.getEnd(); @@ -497,20 +573,21 @@ void LLProfile::genNGon(const LLProfileParams& params, S32 sides, F32 offset, F3 // Starting t and ang values for the first face t = t_first; ang = 2.0f*F_PI*(t*ang_scale + offset); - pt1.setVec(cos(ang)*scale,sin(ang)*scale, t); + pt1.set(cos(ang)*scale,sin(ang)*scale, t); // Increment to the next point. // pt2 is the end point on the fractional face t += t_step; ang += ang_step; - pt2.setVec(cos(ang)*scale,sin(ang)*scale,t); + pt2.set(cos(ang)*scale,sin(ang)*scale,t); t_fraction = (begin - t_first)*sides; // Only use if it's not almost exactly on an edge. if (t_fraction < 0.9999f) { - LLVector3 new_pt = lerp(pt1, pt2, t_fraction); + LLVector4a new_pt; + new_pt.setLerp(pt1, pt2, t_fraction); mProfile.push_back(new_pt); } @@ -518,12 +595,17 @@ void LLProfile::genNGon(const LLProfileParams& params, S32 sides, F32 offset, F3 while (t < end) { // Iterate through all the integer steps of t. - pt1.setVec(cos(ang)*scale,sin(ang)*scale,t); + pt1.set(cos(ang)*scale,sin(ang)*scale,t); if (mProfile.size() > 0) { - LLVector3 p = mProfile[mProfile.size()-1]; + LLVector4a p = mProfile[mProfile.size()-1]; for (S32 i = 0; i < split && mProfile.size() > 0; i++) { - mProfile.push_back(p+(pt1-p) * 1.0f/(float)(split+1) * (float)(i+1)); + //mProfile.push_back(p+(pt1-p) * 1.0f/(float)(split+1) * (float)(i+1)); + LLVector4a new_pt; + new_pt.setSub(pt1, p); + new_pt.mul(1.0f/(float)(split+1) * (float)(i+1)); + new_pt.add(p); + mProfile.push_back(new_pt); } } mProfile.push_back(pt1); @@ -536,18 +618,25 @@ void LLProfile::genNGon(const LLProfileParams& params, S32 sides, F32 offset, F3 // pt1 is the first point on the fractional face // pt2 is the end point on the fractional face - pt2.setVec(cos(ang)*scale,sin(ang)*scale,t); + pt2.set(cos(ang)*scale,sin(ang)*scale,t); // Find the fraction that we need to add to the end point. t_fraction = (end - (t - t_step))*sides; if (t_fraction > 0.0001f) { - LLVector3 new_pt = lerp(pt1, pt2, t_fraction); + LLVector4a new_pt; + new_pt.setLerp(pt1, pt2, t_fraction); if (mProfile.size() > 0) { - LLVector3 p = mProfile[mProfile.size()-1]; + LLVector4a p = mProfile[mProfile.size()-1]; for (S32 i = 0; i < split && mProfile.size() > 0; i++) { - mProfile.push_back(p+(new_pt-p) * 1.0f/(float)(split+1) * (float)(i+1)); + //mProfile.push_back(p+(new_pt-p) * 1.0f/(float)(split+1) * (float)(i+1)); + + LLVector4a pt1; + pt1.setSub(new_pt, p); + pt1.mul(1.0f/(float)(split+1) * (float)(i+1)); + pt1.add(p); + mProfile.push_back(pt1); } } mProfile.push_back(new_pt); @@ -568,7 +657,7 @@ void LLProfile::genNGon(const LLProfileParams& params, S32 sides, F32 offset, F3 if (params.getHollow() <= 0) { // put center point if not hollow. - mProfile.push_back(LLVector3(0,0,0)); + mProfile.push_back(LLVector4a(0,0,0)); } } else @@ -581,103 +670,6 @@ void LLProfile::genNGon(const LLProfileParams& params, S32 sides, F32 offset, F3 mTotal = mProfile.size(); } -void LLProfile::genNormals(const LLProfileParams& params) -{ - S32 count = mProfile.size(); - - S32 outer_count; - if (mTotalOut) - { - outer_count = mTotalOut; - } - else - { - outer_count = mTotal / 2; - } - - mEdgeNormals.resize(count * 2); - mEdgeCenters.resize(count * 2); - mNormals.resize(count); - - LLVector2 pt0,pt1; - - BOOL hollow = (params.getHollow() > 0); - - S32 i0, i1, i2, i3, i4; - - // Parametrically generate normal - for (i2 = 0; i2 < count; i2++) - { - mNormals[i2].mV[0] = mProfile[i2].mV[0]; - mNormals[i2].mV[1] = mProfile[i2].mV[1]; - if (hollow && (i2 >= outer_count)) - { - mNormals[i2] *= -1.f; - } - if (mNormals[i2].magVec() < 0.001) - { - // Special case for point at center, get adjacent points. - i1 = (i2 - 1) >= 0 ? i2 - 1 : count - 1; - i0 = (i1 - 1) >= 0 ? i1 - 1 : count - 1; - i3 = (i2 + 1) < count ? i2 + 1 : 0; - i4 = (i3 + 1) < count ? i3 + 1 : 0; - - pt0.setVec(mProfile[i1].mV[VX] + mProfile[i1].mV[VX] - mProfile[i0].mV[VX], - mProfile[i1].mV[VY] + mProfile[i1].mV[VY] - mProfile[i0].mV[VY]); - pt1.setVec(mProfile[i3].mV[VX] + mProfile[i3].mV[VX] - mProfile[i4].mV[VX], - mProfile[i3].mV[VY] + mProfile[i3].mV[VY] - mProfile[i4].mV[VY]); - - mNormals[i2] = pt0 + pt1; - mNormals[i2] *= 0.5f; - } - mNormals[i2].normVec(); - } - - S32 num_normal_sets = isConcave() ? 2 : 1; - for (S32 normal_set = 0; normal_set < num_normal_sets; normal_set++) - { - S32 point_num; - for (point_num = 0; point_num < mTotal; point_num++) - { - LLVector3 point_1 = mProfile[point_num]; - point_1.mV[VZ] = 0.f; - - LLVector3 point_2; - - if (isConcave() && normal_set == 0 && point_num == (mTotal - 1) / 2) - { - point_2 = mProfile[mTotal - 1]; - } - else if (isConcave() && normal_set == 1 && point_num == mTotal - 1) - { - point_2 = mProfile[(mTotal - 1) / 2]; - } - else - { - LLVector3 delta_pos; - S32 neighbor_point = (point_num + 1) % mTotal; - while(delta_pos.magVecSquared() < 0.01f * 0.01f) - { - point_2 = mProfile[neighbor_point]; - delta_pos = point_2 - point_1; - neighbor_point = (neighbor_point + 1) % mTotal; - if (neighbor_point == point_num) - { - break; - } - } - } - - point_2.mV[VZ] = 0.f; - LLVector3 face_normal = (point_2 - point_1) % LLVector3::z_axis; - face_normal.normVec(); - mEdgeNormals[normal_set * count + point_num] = face_normal; - mEdgeCenters[normal_set * count + point_num] = lerp(point_1, point_2, 0.5f); - } - } -} - - // Hollow is percent of the original bounding box, not of this particular // profile's geometry. Thus, a swept triangle needs lower hollow values than // a swept square. @@ -693,12 +685,13 @@ LLProfile::Face* LLProfile::addHole(const LLProfileParams& params, BOOL flat, F3 Face *face = addFace(mTotalOut, mTotal-mTotalOut,0,LL_FACE_INNER_SIDE, flat); - std::vector<LLVector3> pt; + static LLAlignedArray<LLVector4a,64> pt; pt.resize(mTotal) ; for (S32 i=mTotalOut;i<mTotal;i++) { - pt[i] = mProfile[i] * box_hollow; + pt[i] = mProfile[i]; + pt[i].mul(box_hollow); } S32 j=mTotal-1; @@ -844,8 +837,8 @@ BOOL LLProfile::generate(const LLProfileParams& params, BOOL path_open,F32 detai detail = MIN_LOD; } - mProfile.clear(); - mFaces.clear(); + mProfile.resize(0); + mFaces.resize(0); // Generate the face data S32 i; @@ -877,10 +870,13 @@ BOOL LLProfile::generate(const LLProfileParams& params, BOOL path_open,F32 detai addFace((face_num++) * (split +1), split+2, 1, LL_FACE_OUTER_SIDE_0 << i, TRUE); } + LLVector4a scale(1,1,4,1); + for (i = 0; i <(S32) mProfile.size(); i++) { // Scale by 4 to generate proper tex coords. - mProfile[i].mV[2] *= 4.f; + mProfile[i].mul(scale); + llassert(mProfile[i].isFinite3()); } if (hollow) @@ -913,10 +909,12 @@ BOOL LLProfile::generate(const LLProfileParams& params, BOOL path_open,F32 detai case LL_PCODE_PROFILE_EQUALTRI: { genNGon(params, 3,0, 0, 1, split); + LLVector4a scale(1,1,3,1); for (i = 0; i <(S32) mProfile.size(); i++) { // Scale by 3 to generate proper tex coords. - mProfile[i].mV[2] *= 3.f; + mProfile[i].mul(scale); + llassert(mProfile[i].isFinite3()); } if (path_open) @@ -1095,8 +1093,6 @@ BOOL LLProfile::generate(const LLProfileParams& params, BOOL path_open,F32 detai } } - //genNormals(params); - return TRUE; } @@ -1379,25 +1375,29 @@ void LLPath::genNGon(const LLPathParams& params, S32 sides, F32 startOff, F32 en // the path begins at the correct cut. F32 step= 1.0f / sides; F32 t = params.getBegin(); - pt = vector_append(mPath, 1); + pt = mPath.append(1); ang = 2.0f*F_PI*revolutions * t; s = sin(ang)*lerp(radius_start, radius_end, t); c = cos(ang)*lerp(radius_start, radius_end, t); - pt->mPos.setVec(0 + lerp(0,params.getShear().mV[0],s) + pt->mPos.set(0 + lerp(0,params.getShear().mV[0],s) + lerp(-skew ,skew, t) * 0.5f, c + lerp(0,params.getShear().mV[1],s), s); - pt->mScale.mV[VX] = hole_x * lerp(taper_x_begin, taper_x_end, t); - pt->mScale.mV[VY] = hole_y * lerp(taper_y_begin, taper_y_end, t); + pt->mScale.set(hole_x * lerp(taper_x_begin, taper_x_end, t), + hole_y * lerp(taper_y_begin, taper_y_end, t), + 0,1); pt->mTexT = t; // Twist rotates the path along the x,y plane (I think) - DJS 04/05/02 twist.setQuat (lerp(twist_begin,twist_end,t) * 2.f * F_PI - F_PI,0,0,1); // Rotate the point around the circle's center. qang.setQuat (ang,path_axis); - pt->mRot = twist * qang; + + LLMatrix3 rot(twist * qang); + + pt->mRot.loadu(rot); t+=step; @@ -1408,50 +1408,54 @@ void LLPath::genNGon(const LLPathParams& params, S32 sides, F32 startOff, F32 en // Run through the non-cut dependent points. while (t < params.getEnd()) { - pt = vector_append(mPath, 1); + pt = mPath.append(1); ang = 2.0f*F_PI*revolutions * t; c = cos(ang)*lerp(radius_start, radius_end, t); s = sin(ang)*lerp(radius_start, radius_end, t); - pt->mPos.setVec(0 + lerp(0,params.getShear().mV[0],s) + pt->mPos.set(0 + lerp(0,params.getShear().mV[0],s) + lerp(-skew ,skew, t) * 0.5f, c + lerp(0,params.getShear().mV[1],s), s); - pt->mScale.mV[VX] = hole_x * lerp(taper_x_begin, taper_x_end, t); - pt->mScale.mV[VY] = hole_y * lerp(taper_y_begin, taper_y_end, t); + pt->mScale.set(hole_x * lerp(taper_x_begin, taper_x_end, t), + hole_y * lerp(taper_y_begin, taper_y_end, t), + 0,1); pt->mTexT = t; // Twist rotates the path along the x,y plane (I think) - DJS 04/05/02 twist.setQuat (lerp(twist_begin,twist_end,t) * 2.f * F_PI - F_PI,0,0,1); // Rotate the point around the circle's center. qang.setQuat (ang,path_axis); - pt->mRot = twist * qang; + LLMatrix3 tmp(twist*qang); + pt->mRot.loadu(tmp); t+=step; } // Make one final pass for the end cut. t = params.getEnd(); - pt = vector_append(mPath, 1); + pt = mPath.append(1); ang = 2.0f*F_PI*revolutions * t; c = cos(ang)*lerp(radius_start, radius_end, t); s = sin(ang)*lerp(radius_start, radius_end, t); - pt->mPos.setVec(0 + lerp(0,params.getShear().mV[0],s) + pt->mPos.set(0 + lerp(0,params.getShear().mV[0],s) + lerp(-skew ,skew, t) * 0.5f, c + lerp(0,params.getShear().mV[1],s), s); - pt->mScale.mV[VX] = hole_x * lerp(taper_x_begin, taper_x_end, t); - pt->mScale.mV[VY] = hole_y * lerp(taper_y_begin, taper_y_end, t); + pt->mScale.set(hole_x * lerp(taper_x_begin, taper_x_end, t), + hole_y * lerp(taper_y_begin, taper_y_end, t), + 0,1); pt->mTexT = t; // Twist rotates the path along the x,y plane (I think) - DJS 04/05/02 twist.setQuat (lerp(twist_begin,twist_end,t) * 2.f * F_PI - F_PI,0,0,1); // Rotate the point around the circle's center. qang.setQuat (ang,path_axis); - pt->mRot = twist * qang; + LLMatrix3 tmp(twist*qang); + pt->mRot.loadu(tmp); mTotal = mPath.size(); } @@ -1549,7 +1553,7 @@ BOOL LLPath::generate(const LLPathParams& params, F32 detail, S32 split, mDirty = FALSE; S32 np = 2; // hardcode for line - mPath.clear(); + mPath.resize(0); mOpen = TRUE; // Is this 0xf0 mask really necessary? DK 03/02/05 @@ -1575,12 +1579,16 @@ BOOL LLPath::generate(const LLPathParams& params, F32 detail, S32 split, for (S32 i=0;i<np;i++) { F32 t = lerp(params.getBegin(),params.getEnd(),(F32)i * mStep); - mPath[i].mPos.setVec(lerp(0,params.getShear().mV[0],t), + mPath[i].mPos.set(lerp(0,params.getShear().mV[0],t), lerp(0,params.getShear().mV[1],t), t - 0.5f); - mPath[i].mRot.setQuat(lerp(F_PI * params.getTwistBegin(),F_PI * params.getTwist(),t),0,0,1); - mPath[i].mScale.mV[0] = lerp(start_scale.mV[0],end_scale.mV[0],t); - mPath[i].mScale.mV[1] = lerp(start_scale.mV[1],end_scale.mV[1],t); + LLQuaternion quat; + quat.setQuat(lerp(F_PI * params.getTwistBegin(),F_PI * params.getTwist(),t),0,0,1); + LLMatrix3 tmp(quat); + mPath[i].mRot.loadu(tmp); + mPath[i].mScale.set(lerp(start_scale.mV[0],end_scale.mV[0],t), + lerp(start_scale.mV[1],end_scale.mV[1],t), + 0,1); mPath[i].mTexT = t; } } @@ -1617,7 +1625,7 @@ BOOL LLPath::generate(const LLPathParams& params, F32 detail, S32 split, F32 toggle = 0.5f; for (S32 i=0;i<(S32)mPath.size();i++) { - mPath[i].mPos.mV[0] = toggle; + mPath[i].mPos.getF32ptr()[0] = toggle; if (toggle == 0.5f) toggle = -0.5f; else @@ -1638,14 +1646,16 @@ BOOL LLPath::generate(const LLPathParams& params, F32 detail, S32 split, for (S32 i=0;i<np;i++) { F32 t = (F32)i * mStep; - mPath[i].mPos.setVec(0, + mPath[i].mPos.set(0, lerp(0, -sin(F_PI*params.getTwist()*t)*0.5f,t), lerp(-0.5, cos(F_PI*params.getTwist()*t)*0.5f,t)); - mPath[i].mScale.mV[0] = lerp(1,params.getScale().mV[0],t); - mPath[i].mScale.mV[1] = lerp(1,params.getScale().mV[1],t); + mPath[i].mScale.set(lerp(1,params.getScale().mV[0],t), + lerp(1,params.getScale().mV[1],t), 0,1); mPath[i].mTexT = t; - - mPath[i].mRot.setQuat(F_PI * params.getTwist() * t,1,0,0); + LLQuaternion quat; + quat.setQuat(F_PI * params.getTwist() * t,1,0,0); + LLMatrix3 tmp(quat); + mPath[i].mRot.loadu(tmp); } break; @@ -1669,11 +1679,15 @@ BOOL LLDynamicPath::generate(const LLPathParams& params, F32 detail, S32 split, // Path hasn't been generated yet. // Some algorithms later assume at least TWO path points. resizePath(2); + LLQuaternion quat; + quat.setQuat(0,0,0); + LLMatrix3 tmp(quat); + for (U32 i = 0; i < 2; i++) { - mPath[i].mPos.setVec(0, 0, 0); - mPath[i].mRot.setQuat(0, 0, 0); - mPath[i].mScale.setVec(1, 1); + mPath[i].mPos.set(0, 0, 0); + mPath[i].mRot.loadu(tmp); + mPath[i].mScale.set(1, 1, 0, 1); mPath[i].mTexT = 0; } } @@ -2106,6 +2120,7 @@ LLVolume::~LLVolume() BOOL LLVolume::generate() { + LL_CHECK_MEMORY llassert_always(mProfilep); //Added 10.03.05 Dave Parks @@ -2142,20 +2157,6 @@ BOOL LLVolume::generate() mLODScaleBias.setVec(0.6f, 0.6f, 0.6f); } - //******************************************************************** - //debug info, to be removed - if((U32)(mPathp->mPath.size() * mProfilep->mProfile.size()) > (1u << 20)) - { - llinfos << "sizeS: " << mPathp->mPath.size() << " sizeT: " << mProfilep->mProfile.size() << llendl ; - llinfos << "path_detail : " << path_detail << " split: " << split << " profile_detail: " << profile_detail << llendl ; - llinfos << mParams << llendl ; - llinfos << "more info to check if mProfilep is deleted or not." << llendl ; - llinfos << mProfilep->mNormals.size() << " : " << mProfilep->mFaces.size() << " : " << mProfilep->mEdgeNormals.size() << " : " << mProfilep->mEdgeCenters.size() << llendl ; - - llerrs << "LLVolume corrupted!" << llendl ; - } - //******************************************************************** - BOOL regenPath = mPathp->generate(mParams.getPathParams(), path_detail, split); BOOL regenProf = mProfilep->generate(mParams.getProfileParams(), mPathp->isOpen(),profile_detail, split); @@ -2164,21 +2165,6 @@ BOOL LLVolume::generate() S32 sizeS = mPathp->mPath.size(); S32 sizeT = mProfilep->mProfile.size(); - //******************************************************************** - //debug info, to be removed - if((U32)(sizeS * sizeT) > (1u << 20)) - { - llinfos << "regenPath: " << (S32)regenPath << " regenProf: " << (S32)regenProf << llendl ; - llinfos << "sizeS: " << sizeS << " sizeT: " << sizeT << llendl ; - llinfos << "path_detail : " << path_detail << " split: " << split << " profile_detail: " << profile_detail << llendl ; - llinfos << mParams << llendl ; - llinfos << "more info to check if mProfilep is deleted or not." << llendl ; - llinfos << mProfilep->mNormals.size() << " : " << mProfilep->mFaces.size() << " : " << mProfilep->mEdgeNormals.size() << " : " << mProfilep->mEdgeCenters.size() << llendl ; - - llerrs << "LLVolume corrupted!" << llendl ; - } - //******************************************************************** - sNumMeshPoints -= mMesh.size(); mMesh.resize(sizeT * sizeS); sNumMeshPoints += mMesh.size(); @@ -2186,22 +2172,39 @@ BOOL LLVolume::generate() //generate vertex positions // Run along the path. + LLVector4a* dst = mMesh.mArray; + for (S32 s = 0; s < sizeS; ++s) { - LLVector2 scale = mPathp->mPath[s].mScale; - LLQuaternion rot = mPathp->mPath[s].mRot; + F32* scale = mPathp->mPath[s].mScale.getF32ptr(); + + F32 sc [] = + { scale[0], 0, 0, 0, + 0, scale[1], 0, 0, + 0, 0, scale[2], 0, + 0, 0, 0, 1 }; + + LLMatrix4 rot((F32*) mPathp->mPath[s].mRot.mMatrix); + LLMatrix4 scale_mat(sc); + + scale_mat *= rot; + + LLMatrix4a rot_mat; + rot_mat.loadu(scale_mat); + + LLVector4a* profile = mProfilep->mProfile.mArray; + LLVector4a* end_profile = profile+sizeT; + LLVector4a offset = mPathp->mPath[s].mPos; + + LLVector4a tmp; // Run along the profile. - for (S32 t = 0; t < sizeT; ++t) + while (profile < end_profile) { - S32 m = s*sizeT + t; - Point& pt = mMesh[m]; - - pt.mPos.mV[0] = mProfilep->mProfile[t].mV[0] * scale.mV[0]; - pt.mPos.mV[1] = mProfilep->mProfile[t].mV[1] * scale.mV[1]; - pt.mPos.mV[2] = 0.0f; - pt.mPos = pt.mPos * rot; - pt.mPos += mPathp->mPath[s].mPos; + rot_mat.rotate(*profile++, tmp); + dst->setAdd(tmp,offset); + llassert(dst->isFinite3()); + ++dst; } } @@ -2211,9 +2214,11 @@ BOOL LLVolume::generate() LLFaceID id = iter->mFaceID; mFaceMask |= id; } - + LL_CHECK_MEMORY return TRUE; } + + LL_CHECK_MEMORY return FALSE; } @@ -2792,13 +2797,15 @@ void LLVolume::createVolumeFaces() } -inline LLVector3 sculpt_rgb_to_vector(U8 r, U8 g, U8 b) +inline LLVector4a sculpt_rgb_to_vector(U8 r, U8 g, U8 b) { // maps RGB values to vector values [0..255] -> [-0.5..0.5] - LLVector3 value; - value.mV[VX] = r / 255.f - 0.5f; - value.mV[VY] = g / 255.f - 0.5f; - value.mV[VZ] = b / 255.f - 0.5f; + LLVector4a value; + LLVector4a sub(0.5f, 0.5f, 0.5f); + + value.set(r,g,b); + value.mul(1.f/255.f); + value.sub(sub); return value; } @@ -2819,21 +2826,21 @@ inline U32 sculpt_st_to_index(S32 s, S32 t, S32 size_s, S32 size_t, U16 sculpt_w } -inline LLVector3 sculpt_index_to_vector(U32 index, const U8* sculpt_data) +inline LLVector4a sculpt_index_to_vector(U32 index, const U8* sculpt_data) { - LLVector3 v = sculpt_rgb_to_vector(sculpt_data[index], sculpt_data[index+1], sculpt_data[index+2]); + LLVector4a v = sculpt_rgb_to_vector(sculpt_data[index], sculpt_data[index+1], sculpt_data[index+2]); return v; } -inline LLVector3 sculpt_st_to_vector(S32 s, S32 t, S32 size_s, S32 size_t, U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, const U8* sculpt_data) +inline LLVector4a sculpt_st_to_vector(S32 s, S32 t, S32 size_s, S32 size_t, U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, const U8* sculpt_data) { U32 index = sculpt_st_to_index(s, t, size_s, size_t, sculpt_width, sculpt_height, sculpt_components); return sculpt_index_to_vector(index, sculpt_data); } -inline LLVector3 sculpt_xy_to_vector(U32 x, U32 y, U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, const U8* sculpt_data) +inline LLVector4a sculpt_xy_to_vector(U32 x, U32 y, U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, const U8* sculpt_data) { U32 index = sculpt_xy_to_index(x, y, sculpt_width, sculpt_height, sculpt_components); @@ -2855,15 +2862,26 @@ F32 LLVolume::sculptGetSurfaceArea() for (S32 t = 0; t < sizeT-1; t++) { // get four corners of quad - LLVector3 p1 = mMesh[(s )*sizeT + (t )].mPos; - LLVector3 p2 = mMesh[(s+1)*sizeT + (t )].mPos; - LLVector3 p3 = mMesh[(s )*sizeT + (t+1)].mPos; - LLVector3 p4 = mMesh[(s+1)*sizeT + (t+1)].mPos; + LLVector4a& p1 = mMesh[(s )*sizeT + (t )]; + LLVector4a& p2 = mMesh[(s+1)*sizeT + (t )]; + LLVector4a& p3 = mMesh[(s )*sizeT + (t+1)]; + LLVector4a& p4 = mMesh[(s+1)*sizeT + (t+1)]; // compute the area of the quad by taking the length of the cross product of the two triangles - LLVector3 cross1 = (p1 - p2) % (p1 - p3); - LLVector3 cross2 = (p4 - p2) % (p4 - p3); - area += (cross1.magVec() + cross2.magVec()) / 2.f; + LLVector4a v0,v1,v2,v3; + v0.setSub(p1,p2); + v1.setSub(p1,p3); + v2.setSub(p4,p2); + v3.setSub(p4,p3); + + LLVector4a cross1, cross2; + cross1.setCross3(v0,v1); + cross2.setCross3(v2,v3); + + //LLVector3 cross1 = (p1 - p2) % (p1 - p3); + //LLVector3 cross2 = (p4 - p2) % (p4 - p3); + + area += (cross1.getLength3() + cross2.getLength3()).getF32() / 2.f; } } @@ -2884,7 +2902,7 @@ void LLVolume::sculptGeneratePlaceholder() for (S32 t = 0; t < sizeT; t++) { S32 i = t + line; - Point& pt = mMesh[i]; + LLVector4a& pt = mMesh[i]; F32 u = (F32)s/(sizeS-1); @@ -2892,9 +2910,13 @@ void LLVolume::sculptGeneratePlaceholder() const F32 RADIUS = (F32) 0.3; - pt.mPos.mV[0] = (F32)(sin(F_PI * v) * cos(2.0 * F_PI * u) * RADIUS); - pt.mPos.mV[1] = (F32)(sin(F_PI * v) * sin(2.0 * F_PI * u) * RADIUS); - pt.mPos.mV[2] = (F32)(cos(F_PI * v) * RADIUS); + F32* p = pt.getF32ptr(); + + p[0] = (F32)(sin(F_PI * v) * cos(2.0 * F_PI * u) * RADIUS); + p[1] = (F32)(sin(F_PI * v) * sin(2.0 * F_PI * u) * RADIUS); + p[2] = (F32)(cos(F_PI * v) * RADIUS); + + llassert(pt.isFinite3()); } line += sizeT; @@ -2919,7 +2941,7 @@ void LLVolume::sculptGenerateMapVertices(U16 sculpt_width, U16 sculpt_height, S8 for (S32 t = 0; t < sizeT; t++) { S32 i = t + line; - Point& pt = mMesh[i]; + LLVector4a& pt = mMesh[i]; S32 reversed_t = t; @@ -2976,12 +2998,15 @@ void LLVolume::sculptGenerateMapVertices(U16 sculpt_width, U16 sculpt_height, S8 } } - pt.mPos = sculpt_xy_to_vector(x, y, sculpt_width, sculpt_height, sculpt_components, sculpt_data); + pt = sculpt_xy_to_vector(x, y, sculpt_width, sculpt_height, sculpt_components, sculpt_data); if (sculpt_mirror) { - pt.mPos.mV[VX] *= -1.f; + LLVector4a scale(-1.f,1,1,1); + pt.mul(scale); } + + llassert(pt.isFinite3()); } line += sizeT; @@ -3562,627 +3587,6 @@ bool LLVolumeParams::validate(U8 prof_curve, F32 prof_begin, F32 prof_end, F32 h return true; } -S32 *LLVolume::getTriangleIndices(U32 &num_indices) const -{ - S32 expected_num_triangle_indices = getNumTriangleIndices(); - if (expected_num_triangle_indices > MAX_VOLUME_TRIANGLE_INDICES) - { - // we don't allow LLVolumes with this many vertices - llwarns << "Couldn't allocate triangle indices" << llendl; - num_indices = 0; - return NULL; - } - - S32* index = new S32[expected_num_triangle_indices]; - S32 count = 0; - - // Let's do this totally diffently, as we don't care about faces... - // Counter-clockwise triangles are forward facing... - - BOOL open = getProfile().isOpen(); - BOOL hollow = (mParams.getProfileParams().getHollow() > 0); - BOOL path_open = getPath().isOpen(); - S32 size_s, size_s_out, size_t; - S32 s, t, i; - size_s = getProfile().getTotal(); - size_s_out = getProfile().getTotalOut(); - size_t = getPath().mPath.size(); - - // NOTE -- if the construction of the triangles below ever changes - // then getNumTriangleIndices() method may also have to be updated. - - if (open) /* Flawfinder: ignore */ - { - if (hollow) - { - // Open hollow -- much like the closed solid, except we - // we need to stitch up the gap between s=0 and s=size_s-1 - - for (t = 0; t < size_t - 1; t++) - { - // The outer face, first cut, and inner face - for (s = 0; s < size_s - 1; s++) - { - i = s + t*size_s; - index[count++] = i; // x,y - index[count++] = i + 1; // x+1,y - index[count++] = i + size_s; // x,y+1 - - index[count++] = i + size_s; // x,y+1 - index[count++] = i + 1; // x+1,y - index[count++] = i + size_s + 1; // x+1,y+1 - } - - // The other cut face - index[count++] = s + t*size_s; // x,y - index[count++] = 0 + t*size_s; // x+1,y - index[count++] = s + (t+1)*size_s; // x,y+1 - - index[count++] = s + (t+1)*size_s; // x,y+1 - index[count++] = 0 + t*size_s; // x+1,y - index[count++] = 0 + (t+1)*size_s; // x+1,y+1 - } - - // Do the top and bottom caps, if necessary - if (path_open) - { - // Top cap - S32 pt1 = 0; - S32 pt2 = size_s-1; - S32 i = (size_t - 1)*size_s; - - while (pt2 - pt1 > 1) - { - // Use the profile points instead of the mesh, since you want - // the un-transformed profile distances. - LLVector3 p1 = getProfile().mProfile[pt1]; - LLVector3 p2 = getProfile().mProfile[pt2]; - LLVector3 pa = getProfile().mProfile[pt1+1]; - LLVector3 pb = getProfile().mProfile[pt2-1]; - - p1.mV[VZ] = 0.f; - p2.mV[VZ] = 0.f; - pa.mV[VZ] = 0.f; - pb.mV[VZ] = 0.f; - - // Use area of triangle to determine backfacing - F32 area_1a2, area_1ba, area_21b, area_2ab; - area_1a2 = (p1.mV[0]*pa.mV[1] - pa.mV[0]*p1.mV[1]) + - (pa.mV[0]*p2.mV[1] - p2.mV[0]*pa.mV[1]) + - (p2.mV[0]*p1.mV[1] - p1.mV[0]*p2.mV[1]); - - area_1ba = (p1.mV[0]*pb.mV[1] - pb.mV[0]*p1.mV[1]) + - (pb.mV[0]*pa.mV[1] - pa.mV[0]*pb.mV[1]) + - (pa.mV[0]*p1.mV[1] - p1.mV[0]*pa.mV[1]); - - area_21b = (p2.mV[0]*p1.mV[1] - p1.mV[0]*p2.mV[1]) + - (p1.mV[0]*pb.mV[1] - pb.mV[0]*p1.mV[1]) + - (pb.mV[0]*p2.mV[1] - p2.mV[0]*pb.mV[1]); - - area_2ab = (p2.mV[0]*pa.mV[1] - pa.mV[0]*p2.mV[1]) + - (pa.mV[0]*pb.mV[1] - pb.mV[0]*pa.mV[1]) + - (pb.mV[0]*p2.mV[1] - p2.mV[0]*pb.mV[1]); - - BOOL use_tri1a2 = TRUE; - BOOL tri_1a2 = TRUE; - BOOL tri_21b = TRUE; - - if (area_1a2 < 0) - { - tri_1a2 = FALSE; - } - if (area_2ab < 0) - { - // Can't use, because it contains point b - tri_1a2 = FALSE; - } - if (area_21b < 0) - { - tri_21b = FALSE; - } - if (area_1ba < 0) - { - // Can't use, because it contains point b - tri_21b = FALSE; - } - - if (!tri_1a2) - { - use_tri1a2 = FALSE; - } - else if (!tri_21b) - { - use_tri1a2 = TRUE; - } - else - { - LLVector3 d1 = p1 - pa; - LLVector3 d2 = p2 - pb; - - if (d1.magVecSquared() < d2.magVecSquared()) - { - use_tri1a2 = TRUE; - } - else - { - use_tri1a2 = FALSE; - } - } - - if (use_tri1a2) - { - index[count++] = pt1 + i; - index[count++] = pt1 + 1 + i; - index[count++] = pt2 + i; - pt1++; - } - else - { - index[count++] = pt1 + i; - index[count++] = pt2 - 1 + i; - index[count++] = pt2 + i; - pt2--; - } - } - - // Bottom cap - pt1 = 0; - pt2 = size_s-1; - while (pt2 - pt1 > 1) - { - // Use the profile points instead of the mesh, since you want - // the un-transformed profile distances. - LLVector3 p1 = getProfile().mProfile[pt1]; - LLVector3 p2 = getProfile().mProfile[pt2]; - LLVector3 pa = getProfile().mProfile[pt1+1]; - LLVector3 pb = getProfile().mProfile[pt2-1]; - - p1.mV[VZ] = 0.f; - p2.mV[VZ] = 0.f; - pa.mV[VZ] = 0.f; - pb.mV[VZ] = 0.f; - - // Use area of triangle to determine backfacing - F32 area_1a2, area_1ba, area_21b, area_2ab; - area_1a2 = (p1.mV[0]*pa.mV[1] - pa.mV[0]*p1.mV[1]) + - (pa.mV[0]*p2.mV[1] - p2.mV[0]*pa.mV[1]) + - (p2.mV[0]*p1.mV[1] - p1.mV[0]*p2.mV[1]); - - area_1ba = (p1.mV[0]*pb.mV[1] - pb.mV[0]*p1.mV[1]) + - (pb.mV[0]*pa.mV[1] - pa.mV[0]*pb.mV[1]) + - (pa.mV[0]*p1.mV[1] - p1.mV[0]*pa.mV[1]); - - area_21b = (p2.mV[0]*p1.mV[1] - p1.mV[0]*p2.mV[1]) + - (p1.mV[0]*pb.mV[1] - pb.mV[0]*p1.mV[1]) + - (pb.mV[0]*p2.mV[1] - p2.mV[0]*pb.mV[1]); - - area_2ab = (p2.mV[0]*pa.mV[1] - pa.mV[0]*p2.mV[1]) + - (pa.mV[0]*pb.mV[1] - pb.mV[0]*pa.mV[1]) + - (pb.mV[0]*p2.mV[1] - p2.mV[0]*pb.mV[1]); - - BOOL use_tri1a2 = TRUE; - BOOL tri_1a2 = TRUE; - BOOL tri_21b = TRUE; - - if (area_1a2 < 0) - { - tri_1a2 = FALSE; - } - if (area_2ab < 0) - { - // Can't use, because it contains point b - tri_1a2 = FALSE; - } - if (area_21b < 0) - { - tri_21b = FALSE; - } - if (area_1ba < 0) - { - // Can't use, because it contains point b - tri_21b = FALSE; - } - - if (!tri_1a2) - { - use_tri1a2 = FALSE; - } - else if (!tri_21b) - { - use_tri1a2 = TRUE; - } - else - { - LLVector3 d1 = p1 - pa; - LLVector3 d2 = p2 - pb; - - if (d1.magVecSquared() < d2.magVecSquared()) - { - use_tri1a2 = TRUE; - } - else - { - use_tri1a2 = FALSE; - } - } - - if (use_tri1a2) - { - index[count++] = pt1; - index[count++] = pt2; - index[count++] = pt1 + 1; - pt1++; - } - else - { - index[count++] = pt1; - index[count++] = pt2; - index[count++] = pt2 - 1; - pt2--; - } - } - } - } - else - { - // Open solid - - for (t = 0; t < size_t - 1; t++) - { - // Outer face + 1 cut face - for (s = 0; s < size_s - 1; s++) - { - i = s + t*size_s; - - index[count++] = i; // x,y - index[count++] = i + 1; // x+1,y - index[count++] = i + size_s; // x,y+1 - - index[count++] = i + size_s; // x,y+1 - index[count++] = i + 1; // x+1,y - index[count++] = i + size_s + 1; // x+1,y+1 - } - - // The other cut face - index[count++] = (size_s - 1) + (t*size_s); // x,y - index[count++] = 0 + t*size_s; // x+1,y - index[count++] = (size_s - 1) + (t+1)*size_s; // x,y+1 - - index[count++] = (size_s - 1) + (t+1)*size_s; // x,y+1 - index[count++] = 0 + (t*size_s); // x+1,y - index[count++] = 0 + (t+1)*size_s; // x+1,y+1 - } - - // Do the top and bottom caps, if necessary - if (path_open) - { - for (s = 0; s < size_s - 2; s++) - { - index[count++] = s+1; - index[count++] = s; - index[count++] = size_s - 1; - } - - // We've got a top cap - S32 offset = (size_t - 1)*size_s; - for (s = 0; s < size_s - 2; s++) - { - // Inverted ordering from bottom cap. - index[count++] = offset + size_s - 1; - index[count++] = offset + s; - index[count++] = offset + s + 1; - } - } - } - } - else if (hollow) - { - // Closed hollow - // Outer face - - for (t = 0; t < size_t - 1; t++) - { - for (s = 0; s < size_s_out - 1; s++) - { - i = s + t*size_s; - - index[count++] = i; // x,y - index[count++] = i + 1; // x+1,y - index[count++] = i + size_s; // x,y+1 - - index[count++] = i + size_s; // x,y+1 - index[count++] = i + 1; // x+1,y - index[count++] = i + 1 + size_s; // x+1,y+1 - } - } - - // Inner face - // Invert facing from outer face - for (t = 0; t < size_t - 1; t++) - { - for (s = size_s_out; s < size_s - 1; s++) - { - i = s + t*size_s; - - index[count++] = i; // x,y - index[count++] = i + 1; // x+1,y - index[count++] = i + size_s; // x,y+1 - - index[count++] = i + size_s; // x,y+1 - index[count++] = i + 1; // x+1,y - index[count++] = i + 1 + size_s; // x+1,y+1 - } - } - - // Do the top and bottom caps, if necessary - if (path_open) - { - // Top cap - S32 pt1 = 0; - S32 pt2 = size_s-1; - S32 i = (size_t - 1)*size_s; - - while (pt2 - pt1 > 1) - { - // Use the profile points instead of the mesh, since you want - // the un-transformed profile distances. - LLVector3 p1 = getProfile().mProfile[pt1]; - LLVector3 p2 = getProfile().mProfile[pt2]; - LLVector3 pa = getProfile().mProfile[pt1+1]; - LLVector3 pb = getProfile().mProfile[pt2-1]; - - p1.mV[VZ] = 0.f; - p2.mV[VZ] = 0.f; - pa.mV[VZ] = 0.f; - pb.mV[VZ] = 0.f; - - // Use area of triangle to determine backfacing - F32 area_1a2, area_1ba, area_21b, area_2ab; - area_1a2 = (p1.mV[0]*pa.mV[1] - pa.mV[0]*p1.mV[1]) + - (pa.mV[0]*p2.mV[1] - p2.mV[0]*pa.mV[1]) + - (p2.mV[0]*p1.mV[1] - p1.mV[0]*p2.mV[1]); - - area_1ba = (p1.mV[0]*pb.mV[1] - pb.mV[0]*p1.mV[1]) + - (pb.mV[0]*pa.mV[1] - pa.mV[0]*pb.mV[1]) + - (pa.mV[0]*p1.mV[1] - p1.mV[0]*pa.mV[1]); - - area_21b = (p2.mV[0]*p1.mV[1] - p1.mV[0]*p2.mV[1]) + - (p1.mV[0]*pb.mV[1] - pb.mV[0]*p1.mV[1]) + - (pb.mV[0]*p2.mV[1] - p2.mV[0]*pb.mV[1]); - - area_2ab = (p2.mV[0]*pa.mV[1] - pa.mV[0]*p2.mV[1]) + - (pa.mV[0]*pb.mV[1] - pb.mV[0]*pa.mV[1]) + - (pb.mV[0]*p2.mV[1] - p2.mV[0]*pb.mV[1]); - - BOOL use_tri1a2 = TRUE; - BOOL tri_1a2 = TRUE; - BOOL tri_21b = TRUE; - - if (area_1a2 < 0) - { - tri_1a2 = FALSE; - } - if (area_2ab < 0) - { - // Can't use, because it contains point b - tri_1a2 = FALSE; - } - if (area_21b < 0) - { - tri_21b = FALSE; - } - if (area_1ba < 0) - { - // Can't use, because it contains point b - tri_21b = FALSE; - } - - if (!tri_1a2) - { - use_tri1a2 = FALSE; - } - else if (!tri_21b) - { - use_tri1a2 = TRUE; - } - else - { - LLVector3 d1 = p1 - pa; - LLVector3 d2 = p2 - pb; - - if (d1.magVecSquared() < d2.magVecSquared()) - { - use_tri1a2 = TRUE; - } - else - { - use_tri1a2 = FALSE; - } - } - - if (use_tri1a2) - { - index[count++] = pt1 + i; - index[count++] = pt1 + 1 + i; - index[count++] = pt2 + i; - pt1++; - } - else - { - index[count++] = pt1 + i; - index[count++] = pt2 - 1 + i; - index[count++] = pt2 + i; - pt2--; - } - } - - // Bottom cap - pt1 = 0; - pt2 = size_s-1; - while (pt2 - pt1 > 1) - { - // Use the profile points instead of the mesh, since you want - // the un-transformed profile distances. - LLVector3 p1 = getProfile().mProfile[pt1]; - LLVector3 p2 = getProfile().mProfile[pt2]; - LLVector3 pa = getProfile().mProfile[pt1+1]; - LLVector3 pb = getProfile().mProfile[pt2-1]; - - p1.mV[VZ] = 0.f; - p2.mV[VZ] = 0.f; - pa.mV[VZ] = 0.f; - pb.mV[VZ] = 0.f; - - // Use area of triangle to determine backfacing - F32 area_1a2, area_1ba, area_21b, area_2ab; - area_1a2 = (p1.mV[0]*pa.mV[1] - pa.mV[0]*p1.mV[1]) + - (pa.mV[0]*p2.mV[1] - p2.mV[0]*pa.mV[1]) + - (p2.mV[0]*p1.mV[1] - p1.mV[0]*p2.mV[1]); - - area_1ba = (p1.mV[0]*pb.mV[1] - pb.mV[0]*p1.mV[1]) + - (pb.mV[0]*pa.mV[1] - pa.mV[0]*pb.mV[1]) + - (pa.mV[0]*p1.mV[1] - p1.mV[0]*pa.mV[1]); - - area_21b = (p2.mV[0]*p1.mV[1] - p1.mV[0]*p2.mV[1]) + - (p1.mV[0]*pb.mV[1] - pb.mV[0]*p1.mV[1]) + - (pb.mV[0]*p2.mV[1] - p2.mV[0]*pb.mV[1]); - - area_2ab = (p2.mV[0]*pa.mV[1] - pa.mV[0]*p2.mV[1]) + - (pa.mV[0]*pb.mV[1] - pb.mV[0]*pa.mV[1]) + - (pb.mV[0]*p2.mV[1] - p2.mV[0]*pb.mV[1]); - - BOOL use_tri1a2 = TRUE; - BOOL tri_1a2 = TRUE; - BOOL tri_21b = TRUE; - - if (area_1a2 < 0) - { - tri_1a2 = FALSE; - } - if (area_2ab < 0) - { - // Can't use, because it contains point b - tri_1a2 = FALSE; - } - if (area_21b < 0) - { - tri_21b = FALSE; - } - if (area_1ba < 0) - { - // Can't use, because it contains point b - tri_21b = FALSE; - } - - if (!tri_1a2) - { - use_tri1a2 = FALSE; - } - else if (!tri_21b) - { - use_tri1a2 = TRUE; - } - else - { - LLVector3 d1 = p1 - pa; - LLVector3 d2 = p2 - pb; - - if (d1.magVecSquared() < d2.magVecSquared()) - { - use_tri1a2 = TRUE; - } - else - { - use_tri1a2 = FALSE; - } - } - - if (use_tri1a2) - { - index[count++] = pt1; - index[count++] = pt2; - index[count++] = pt1 + 1; - pt1++; - } - else - { - index[count++] = pt1; - index[count++] = pt2; - index[count++] = pt2 - 1; - pt2--; - } - } - } - } - else - { - // Closed solid. Easy case. - for (t = 0; t < size_t - 1; t++) - { - for (s = 0; s < size_s - 1; s++) - { - // Should wrap properly, but for now... - i = s + t*size_s; - - index[count++] = i; // x,y - index[count++] = i + 1; // x+1,y - index[count++] = i + size_s; // x,y+1 - - index[count++] = i + size_s; // x,y+1 - index[count++] = i + 1; // x+1,y - index[count++] = i + size_s + 1; // x+1,y+1 - } - } - - // Do the top and bottom caps, if necessary - if (path_open) - { - // bottom cap - for (s = 1; s < size_s - 2; s++) - { - index[count++] = s+1; - index[count++] = s; - index[count++] = 0; - } - - // top cap - S32 offset = (size_t - 1)*size_s; - for (s = 1; s < size_s - 2; s++) - { - // Inverted ordering from bottom cap. - index[count++] = offset; - index[count++] = offset + s; - index[count++] = offset + s + 1; - } - } - } - -#ifdef LL_DEBUG - // assert that we computed the correct number of indices - if (count != expected_num_triangle_indices ) - { - llerrs << "bad index count prediciton:" - << " expected=" << expected_num_triangle_indices - << " actual=" << count << llendl; - } -#endif - -#if 0 - // verify that each index does not point beyond the size of the mesh - S32 num_vertices = mMesh.size(); - for (i = 0; i < count; i+=3) - { - llinfos << index[i] << ":" << index[i+1] << ":" << index[i+2] << llendl; - llassert(index[i] < num_vertices); - llassert(index[i+1] < num_vertices); - llassert(index[i+2] < num_vertices); - } -#endif - - num_indices = count; - return index; -} - void LLVolume::getLoDTriangleCounts(const LLVolumeParams& params, S32* counts) { //attempt to approximate the number of triangles that will result from generating a volume LoD set for the //supplied LLVolumeParams -- inaccurate, but a close enough approximation for determining streaming cost @@ -4200,63 +3604,6 @@ void LLVolume::getLoDTriangleCounts(const LLVolumeParams& params, S32* counts) } } -S32 LLVolume::getNumTriangleIndices() const -{ - BOOL profile_open = getProfile().isOpen(); - BOOL hollow = (mParams.getProfileParams().getHollow() > 0); - BOOL path_open = getPath().isOpen(); - - S32 size_s, size_s_out, size_t; - size_s = getProfile().getTotal(); - size_s_out = getProfile().getTotalOut(); - size_t = getPath().mPath.size(); - - S32 count = 0; - if (profile_open) /* Flawfinder: ignore */ - { - if (hollow) - { - // Open hollow -- much like the closed solid, except we - // we need to stitch up the gap between s=0 and s=size_s-1 - count = (size_t - 1) * (((size_s -1) * 6) + 6); - } - else - { - count = (size_t - 1) * (((size_s -1) * 6) + 6); - } - } - else if (hollow) - { - // Closed hollow - // Outer face - count = (size_t - 1) * (size_s_out - 1) * 6; - - // Inner face - count += (size_t - 1) * ((size_s - 1) - size_s_out) * 6; - } - else - { - // Closed solid. Easy case. - count = (size_t - 1) * (size_s - 1) * 6; - } - - if (path_open) - { - S32 cap_triangle_count = size_s - 3; - if ( profile_open - || hollow ) - { - cap_triangle_count = size_s - 2; - } - if ( cap_triangle_count > 0 ) - { - // top and bottom caps - count += cap_triangle_count * 2 * 3; - } - } - return count; -} - S32 LLVolume::getNumTriangles(S32* vcount) const { @@ -5192,6 +4539,7 @@ LLVolumeFace::LLVolumeFace() : mNumS(0), mNumT(0), mNumVertices(0), + mNumAllocatedVertices(0), mNumIndices(0), mPositions(NULL), mNormals(NULL), @@ -5199,7 +4547,8 @@ LLVolumeFace::LLVolumeFace() : mTexCoords(NULL), mIndices(NULL), mWeights(NULL), - mOctree(NULL) + mOctree(NULL), + mOptimized(FALSE) { mExtents = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*3); mExtents[0].splat(-0.5f); @@ -5215,6 +4564,7 @@ LLVolumeFace::LLVolumeFace(const LLVolumeFace& src) mNumS(0), mNumT(0), mNumVertices(0), + mNumAllocatedVertices(0), mNumIndices(0), mPositions(NULL), mNormals(NULL), @@ -5252,8 +4602,6 @@ LLVolumeFace& LLVolumeFace::operator=(const LLVolumeFace& src) freeData(); - LLVector4a::memcpyNonAliased16((F32*) mExtents, (F32*) src.mExtents, 3*sizeof(LLVector4a)); - resizeVertices(src.mNumVertices); resizeIndices(src.mNumIndices); @@ -5263,18 +4611,16 @@ LLVolumeFace& LLVolumeFace::operator=(const LLVolumeFace& src) S32 tc_size = (mNumVertices*sizeof(LLVector2)+0xF) & ~0xF; LLVector4a::memcpyNonAliased16((F32*) mPositions, (F32*) src.mPositions, vert_size); + + if (src.mNormals) + { LLVector4a::memcpyNonAliased16((F32*) mNormals, (F32*) src.mNormals, vert_size); + } if(src.mTexCoords) { LLVector4a::memcpyNonAliased16((F32*) mTexCoords, (F32*) src.mTexCoords, tc_size); } - else - { - ll_aligned_free_16(mTexCoords) ; - mTexCoords = NULL ; - } - if (src.mTangents) { @@ -5306,6 +4652,8 @@ LLVolumeFace& LLVolumeFace::operator=(const LLVolumeFace& src) LLVector4a::memcpyNonAliased16((F32*) mIndices, (F32*) src.mIndices, idx_size); } + mOptimized = src.mOptimized; + //delete return *this; } @@ -5320,12 +4668,13 @@ LLVolumeFace::~LLVolumeFace() void LLVolumeFace::freeData() { - ll_aligned_free_16(mPositions); + ll_aligned_free(mPositions); mPositions = NULL; - ll_aligned_free_16( mNormals); + + //normals and texture coordinates are part of the same buffer as mPositions, do not free them separately mNormals = NULL; - ll_aligned_free_16(mTexCoords); mTexCoords = NULL; + ll_aligned_free_16(mIndices); mIndices = NULL; ll_aligned_free_16(mTangents); @@ -5343,52 +4692,23 @@ BOOL LLVolumeFace::create(LLVolume* volume, BOOL partial_build) delete mOctree; mOctree = NULL; + LL_CHECK_MEMORY BOOL ret = FALSE ; if (mTypeMask & CAP_MASK) { ret = createCap(volume, partial_build); + LL_CHECK_MEMORY } else if ((mTypeMask & END_MASK) || (mTypeMask & SIDE_MASK)) { ret = createSide(volume, partial_build); + LL_CHECK_MEMORY } else { llerrs << "Unknown/uninitialized face type!" << llendl; } - //update the range of the texture coordinates - if(ret) - { - mTexCoordExtents[0].setVec(1.f, 1.f) ; - mTexCoordExtents[1].setVec(0.f, 0.f) ; - - for(U32 i = 0 ; i < mNumVertices ; i++) - { - if(mTexCoordExtents[0].mV[0] > mTexCoords[i].mV[0]) - { - mTexCoordExtents[0].mV[0] = mTexCoords[i].mV[0] ; - } - if(mTexCoordExtents[1].mV[0] < mTexCoords[i].mV[0]) - { - mTexCoordExtents[1].mV[0] = mTexCoords[i].mV[0] ; - } - - if(mTexCoordExtents[0].mV[1] > mTexCoords[i].mV[1]) - { - mTexCoordExtents[0].mV[1] = mTexCoords[i].mV[1] ; - } - if(mTexCoordExtents[1].mV[1] < mTexCoords[i].mV[1]) - { - mTexCoordExtents[1].mV[1] = mTexCoords[i].mV[1] ; - } - } - mTexCoordExtents[0].mV[0] = llmax(0.f, mTexCoordExtents[0].mV[0]) ; - mTexCoordExtents[0].mV[1] = llmax(0.f, mTexCoordExtents[0].mV[1]) ; - mTexCoordExtents[1].mV[0] = llmin(1.f, mTexCoordExtents[1].mV[0]) ; - mTexCoordExtents[1].mV[1] = llmin(1.f, mTexCoordExtents[1].mV[1]) ; - } - return ret ; } @@ -5504,22 +4824,29 @@ void LLVolumeFace::optimize(F32 angle_cutoff) } } - llassert(new_face.mNumIndices == mNumIndices); - llassert(new_face.mNumVertices <= mNumVertices); if (angle_cutoff > 1.f && !mNormals) { - ll_aligned_free_16(new_face.mNormals); + // Now alloc'd with positions + //ll_aligned_free_16(new_face.mNormals); new_face.mNormals = NULL; } if (!mTexCoords) { - ll_aligned_free_16(new_face.mTexCoords); + // Now alloc'd with positions + //ll_aligned_free_16(new_face.mTexCoords); new_face.mTexCoords = NULL; } - swapData(new_face); + // Only swap data if we've actually optimized the mesh + // + if (new_face.mNumVertices <= mNumVertices) + { + llassert(new_face.mNumIndices == mNumIndices); + swapData(new_face); + } + } class LLVCacheTriangleData; @@ -5529,14 +4856,14 @@ class LLVCacheVertexData public: S32 mIdx; S32 mCacheTag; - F32 mScore; + F64 mScore; U32 mActiveTriangles; std::vector<LLVCacheTriangleData*> mTriangles; LLVCacheVertexData() { mCacheTag = -1; - mScore = 0.f; + mScore = 0.0; mActiveTriangles = 0; mIdx = -1; } @@ -5546,13 +4873,13 @@ class LLVCacheTriangleData { public: bool mActive; - F32 mScore; + F64 mScore; LLVCacheVertexData* mVertex[3]; LLVCacheTriangleData() { mActive = true; - mScore = 0.f; + mScore = 0.0; mVertex[0] = mVertex[1] = mVertex[2] = NULL; } @@ -5563,7 +4890,7 @@ public: { if (mVertex[i]) { - llassert_always(mVertex[i]->mActiveTriangles > 0); + llassert(mVertex[i]->mActiveTriangles > 0); mVertex[i]->mActiveTriangles--; } } @@ -5575,20 +4902,20 @@ public: } }; -const F32 FindVertexScore_CacheDecayPower = 1.5f; -const F32 FindVertexScore_LastTriScore = 0.75f; -const F32 FindVertexScore_ValenceBoostScale = 2.0f; -const F32 FindVertexScore_ValenceBoostPower = 0.5f; +const F64 FindVertexScore_CacheDecayPower = 1.5; +const F64 FindVertexScore_LastTriScore = 0.75; +const F64 FindVertexScore_ValenceBoostScale = 2.0; +const F64 FindVertexScore_ValenceBoostPower = 0.5; const U32 MaxSizeVertexCache = 32; +const F64 FindVertexScore_Scaler = 1.0/(MaxSizeVertexCache-3); -F32 find_vertex_score(LLVCacheVertexData& data) +F64 find_vertex_score(LLVCacheVertexData& data) { - if (data.mActiveTriangles == 0) - { //no triangle references this vertex - return -1.f; - } + F64 score = -1.0; - F32 score = 0.f; + if (data.mActiveTriangles >= 0) + { + score = 0.0; S32 cache_idx = data.mCacheTag; @@ -5604,15 +4931,15 @@ F32 find_vertex_score(LLVCacheVertexData& data) } else { //more points for being higher in the cache - F32 scaler = 1.f/(MaxSizeVertexCache-3); - score = 1.f-((cache_idx-3)*scaler); - score = powf(score, FindVertexScore_CacheDecayPower); + score = 1.0-((cache_idx-3)*FindVertexScore_Scaler); + score = pow(score, FindVertexScore_CacheDecayPower); } } //bonus points for having low valence - F32 valence_boost = powf((F32)data.mActiveTriangles, -FindVertexScore_ValenceBoostPower); + F64 valence_boost = pow((F64)data.mActiveTriangles, -FindVertexScore_ValenceBoostPower); score += FindVertexScore_ValenceBoostScale * valence_boost; + } return score; } @@ -5719,32 +5046,44 @@ public: void updateScores() { - for (U32 i = MaxSizeVertexCache; i < MaxSizeVertexCache+3; ++i) - { //trailing 3 vertices aren't actually in the cache for scoring purposes - if (mCache[i]) + LLVCacheVertexData** data_iter = mCache+MaxSizeVertexCache; + LLVCacheVertexData** end_data = mCache+MaxSizeVertexCache+3; + + while(data_iter != end_data) + { + LLVCacheVertexData* data = *data_iter++; + //trailing 3 vertices aren't actually in the cache for scoring purposes + if (data) { - mCache[i]->mCacheTag = -1; + data->mCacheTag = -1; } } - for (U32 i = 0; i < MaxSizeVertexCache; ++i) + data_iter = mCache; + end_data = mCache+MaxSizeVertexCache; + + while (data_iter != end_data) { //update scores of vertices in cache - if (mCache[i]) + LLVCacheVertexData* data = *data_iter++; + if (data) { - mCache[i]->mScore = find_vertex_score(*(mCache[i])); - llassert_always(mCache[i]->mCacheTag == i); + data->mScore = find_vertex_score(*data); } } mBestTriangle = NULL; //update triangle scores - for (U32 i = 0; i < MaxSizeVertexCache+3; ++i) + data_iter = mCache; + end_data = mCache+MaxSizeVertexCache+3; + + while (data_iter != end_data) { - if (mCache[i]) + LLVCacheVertexData* data = *data_iter++; + if (data) { - for (U32 j = 0; j < mCache[i]->mTriangles.size(); ++j) + for (std::vector<LLVCacheTriangleData*>::iterator iter = data->mTriangles.begin(), end_iter = data->mTriangles.end(); iter != end_iter; ++iter) { - LLVCacheTriangleData* tri = mCache[i]->mTriangles[j]; + LLVCacheTriangleData* tri = *iter; if (tri->mActive) { tri->mScore = tri->mVertex[0]->mScore; @@ -5761,13 +5100,17 @@ public: } //knock trailing 3 vertices off the cache - for (U32 i = MaxSizeVertexCache; i < MaxSizeVertexCache+3; ++i) + data_iter = mCache+MaxSizeVertexCache; + end_data = mCache+MaxSizeVertexCache+3; + while (data_iter != end_data) { - if (mCache[i]) + LLVCacheVertexData* data = *data_iter; + if (data) { - llassert_always(mCache[i]->mCacheTag == -1); - mCache[i] = NULL; + llassert(data->mCacheTag == -1); + *data_iter = NULL; } + ++data_iter; } } }; @@ -5777,6 +5120,9 @@ void LLVolumeFace::cacheOptimize() { //optimize for vertex cache according to Forsyth method: // http://home.comcast.net/~tom_forsyth/papers/fast_vert_cache_opt.html + llassert(!mOptimized); + mOptimized = TRUE; + LLVCacheLRU cache; if (mNumVertices < 3) @@ -5822,12 +5168,14 @@ void LLVolumeFace::cacheOptimize() for (U32 i = 0; i < mNumVertices; i++) { //initialize score values (no cache -- might try a fifo cache here) - vertex_data[i].mScore = find_vertex_score(vertex_data[i]); - vertex_data[i].mActiveTriangles = vertex_data[i].mTriangles.size(); + LLVCacheVertexData& data = vertex_data[i]; - for (U32 j = 0; j < vertex_data[i].mTriangles.size(); ++j) + data.mScore = find_vertex_score(data); + data.mActiveTriangles = data.mTriangles.size(); + + for (U32 j = 0; j < data.mActiveTriangles; ++j) { - vertex_data[i].mTriangles[j]->mScore += vertex_data[i].mScore; + data.mTriangles[j]->mScore += data.mScore; } } @@ -5897,10 +5245,10 @@ void LLVolumeFace::cacheOptimize() //allocate space for new buffer S32 num_verts = mNumVertices; - LLVector4a* pos = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*num_verts); - LLVector4a* norm = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*num_verts); S32 size = ((num_verts*sizeof(LLVector2)) + 0xF) & ~0xF; - LLVector2* tc = (LLVector2*) ll_aligned_malloc_16(size); + LLVector4a* pos = (LLVector4a*) ll_aligned_malloc(sizeof(LLVector4a)*2*num_verts+size, 64); + LLVector4a* norm = pos + num_verts; + LLVector2* tc = (LLVector2*) (norm + num_verts); LLVector4a* wght = NULL; if (mWeights) @@ -5948,9 +5296,8 @@ void LLVolumeFace::cacheOptimize() mIndices[i] = new_idx[mIndices[i]]; } - ll_aligned_free_16(mPositions); - ll_aligned_free_16(mNormals); - ll_aligned_free_16(mTexCoords); + ll_aligned_free(mPositions); + // DO NOT free mNormals and mTexCoords as they are part of mPositions buffer ll_aligned_free_16(mWeights); ll_aligned_free_16(mTangents); @@ -6072,8 +5419,10 @@ void LerpPlanarVertex(LLVolumeFace::VertexData& v0, BOOL LLVolumeFace::createUnCutCubeCap(LLVolume* volume, BOOL partial_build) { - const std::vector<LLVolume::Point>& mesh = volume->getMesh(); - const std::vector<LLVector3>& profile = volume->getProfile().mProfile; + LL_CHECK_MEMORY + + const LLAlignedArray<LLVector4a,64>& mesh = volume->getMesh(); + const LLAlignedArray<LLVector4a,64>& profile = volume->getProfile().mProfile; S32 max_s = volume->getProfile().getTotal(); S32 max_t = volume->getPath().mPath.size(); @@ -6098,9 +5447,9 @@ BOOL LLVolumeFace::createUnCutCubeCap(LLVolume* volume, BOOL partial_build) VertexData baseVert; for(S32 t = 0; t < 4; t++) { - corners[t].getPosition().load3( mesh[offset + (grid_size*t)].mPos.mV); - corners[t].mTexCoord.mV[0] = profile[grid_size*t].mV[0]+0.5f; - corners[t].mTexCoord.mV[1] = 0.5f - profile[grid_size*t].mV[1]; + corners[t].getPosition().load4a(mesh[offset + (grid_size*t)].getF32ptr()); + corners[t].mTexCoord.mV[0] = profile[grid_size*t][0]+0.5f; + corners[t].mTexCoord.mV[1] = 0.5f - profile[grid_size*t][1]; } { @@ -6199,6 +5548,7 @@ BOOL LLVolumeFace::createUnCutCubeCap(LLVolume* volume, BOOL partial_build) } } + LL_CHECK_MEMORY return TRUE; } @@ -6217,8 +5567,8 @@ BOOL LLVolumeFace::createCap(LLVolume* volume, BOOL partial_build) S32 num_vertices = 0, num_indices = 0; - const std::vector<LLVolume::Point>& mesh = volume->getMesh(); - const std::vector<LLVector3>& profile = volume->getProfile().mProfile; + const LLAlignedArray<LLVector4a,64>& mesh = volume->getMesh(); + const LLAlignedArray<LLVector4a,64>& profile = volume->getProfile().mProfile; // All types of caps have the same number of vertices and indices num_vertices = profile.size(); @@ -6236,13 +5586,14 @@ BOOL LLVolumeFace::createCap(LLVolume* volume, BOOL partial_build) else { resizeVertices(num_vertices); - if (!partial_build) { resizeIndices(num_indices); } } + LL_CHECK_MEMORY; + S32 max_s = volume->getProfile().getTotal(); S32 max_t = volume->getPath().mPath.size(); @@ -6272,52 +5623,91 @@ BOOL LLVolumeFace::createCap(LLVolume* volume, BOOL partial_build) LLVector4a* norm = (LLVector4a*) mNormals; // Copy the vertices into the array - for (S32 i = 0; i < num_vertices; i++) + + const LLVector4a* src = mesh.mArray+offset; + const LLVector4a* end = src+num_vertices; + + min = *src; + max = min; + + + const LLVector4a* p = profile.mArray; + + if (mTypeMask & TOP_MASK) { - if (mTypeMask & TOP_MASK) + min_uv.set((*p)[0]+0.5f, + (*p)[1]+0.5f); + + max_uv = min_uv; + + while(src < end) { - tc[i].mV[0] = profile[i].mV[0]+0.5f; - tc[i].mV[1] = profile[i].mV[1]+0.5f; + tc->mV[0] = (*p)[0]+0.5f; + tc->mV[1] = (*p)[1]+0.5f; + + llassert(src->isFinite3()); + update_min_max(min,max,*src); + update_min_max(min_uv, max_uv, *tc); + + *pos = *src; + + llassert(pos->isFinite3()); + + ++p; + ++tc; + ++src; + ++pos; + } } else { + + min_uv.set((*p)[0]+0.5f, + 0.5f - (*p)[1]); + max_uv = min_uv; + + while(src < end) + { // Mirror for underside. - tc[i].mV[0] = profile[i].mV[0]+0.5f; - tc[i].mV[1] = 0.5f - profile[i].mV[1]; - } + tc->mV[0] = (*p)[0]+0.5f; + tc->mV[1] = 0.5f - (*p)[1]; + + llassert(src->isFinite3()); + update_min_max(min,max,*src); + update_min_max(min_uv, max_uv, *tc); - pos[i].load3(mesh[i + offset].mPos.mV); + *pos = *src; - if (i == 0) - { - max = pos[i]; - min = max; - min_uv = max_uv = tc[i]; - } - else - { - update_min_max(min,max,pos[i]); - update_min_max(min_uv, max_uv, tc[i]); + llassert(pos->isFinite3()); + + ++p; + ++tc; + ++src; + ++pos; } } + LL_CHECK_MEMORY + mCenter->setAdd(min, max); mCenter->mul(0.5f); cuv = (min_uv + max_uv)*0.5f; + VertexData vd; vd.setPosition(*mCenter); vd.mTexCoord = cuv; if (!(mTypeMask & HOLLOW_MASK) && !(mTypeMask & OPEN_MASK)) { - pos[num_vertices] = *mCenter; - tc[num_vertices] = cuv; - + *pos++ = *mCenter; + *tc++ = cuv; num_vertices++; } + LL_CHECK_MEMORY + if (partial_build) { return TRUE; @@ -6336,33 +5726,38 @@ BOOL LLVolumeFace::createCap(LLVolume* volume, BOOL partial_build) { // Use the profile points instead of the mesh, since you want // the un-transformed profile distances. - LLVector3 p1 = profile[pt1]; - LLVector3 p2 = profile[pt2]; - LLVector3 pa = profile[pt1+1]; - LLVector3 pb = profile[pt2-1]; + const LLVector4a& p1 = profile[pt1]; + const LLVector4a& p2 = profile[pt2]; + const LLVector4a& pa = profile[pt1+1]; + const LLVector4a& pb = profile[pt2-1]; + + const F32* p1V = p1.getF32ptr(); + const F32* p2V = p2.getF32ptr(); + const F32* paV = pa.getF32ptr(); + const F32* pbV = pb.getF32ptr(); - p1.mV[VZ] = 0.f; - p2.mV[VZ] = 0.f; - pa.mV[VZ] = 0.f; - pb.mV[VZ] = 0.f; + //p1.mV[VZ] = 0.f; + //p2.mV[VZ] = 0.f; + //pa.mV[VZ] = 0.f; + //pb.mV[VZ] = 0.f; // Use area of triangle to determine backfacing F32 area_1a2, area_1ba, area_21b, area_2ab; - area_1a2 = (p1.mV[0]*pa.mV[1] - pa.mV[0]*p1.mV[1]) + - (pa.mV[0]*p2.mV[1] - p2.mV[0]*pa.mV[1]) + - (p2.mV[0]*p1.mV[1] - p1.mV[0]*p2.mV[1]); + area_1a2 = (p1V[0]*paV[1] - paV[0]*p1V[1]) + + (paV[0]*p2V[1] - p2V[0]*paV[1]) + + (p2V[0]*p1V[1] - p1V[0]*p2V[1]); - area_1ba = (p1.mV[0]*pb.mV[1] - pb.mV[0]*p1.mV[1]) + - (pb.mV[0]*pa.mV[1] - pa.mV[0]*pb.mV[1]) + - (pa.mV[0]*p1.mV[1] - p1.mV[0]*pa.mV[1]); + area_1ba = (p1V[0]*pbV[1] - pbV[0]*p1V[1]) + + (pbV[0]*paV[1] - paV[0]*pbV[1]) + + (paV[0]*p1V[1] - p1V[0]*paV[1]); - area_21b = (p2.mV[0]*p1.mV[1] - p1.mV[0]*p2.mV[1]) + - (p1.mV[0]*pb.mV[1] - pb.mV[0]*p1.mV[1]) + - (pb.mV[0]*p2.mV[1] - p2.mV[0]*pb.mV[1]); + area_21b = (p2V[0]*p1V[1] - p1V[0]*p2V[1]) + + (p1V[0]*pbV[1] - pbV[0]*p1V[1]) + + (pbV[0]*p2V[1] - p2V[0]*pbV[1]); - area_2ab = (p2.mV[0]*pa.mV[1] - pa.mV[0]*p2.mV[1]) + - (pa.mV[0]*pb.mV[1] - pb.mV[0]*pa.mV[1]) + - (pb.mV[0]*p2.mV[1] - p2.mV[0]*pb.mV[1]); + area_2ab = (p2V[0]*paV[1] - paV[0]*p2V[1]) + + (paV[0]*pbV[1] - pbV[0]*paV[1]) + + (pbV[0]*p2V[1] - p2V[0]*pbV[1]); BOOL use_tri1a2 = TRUE; BOOL tri_1a2 = TRUE; @@ -6397,10 +5792,13 @@ BOOL LLVolumeFace::createCap(LLVolume* volume, BOOL partial_build) } else { - LLVector3 d1 = p1 - pa; - LLVector3 d2 = p2 - pb; + LLVector4a d1; + d1.setSub(p1, pa); + + LLVector4a d2; + d2.setSub(p2, pb); - if (d1.magVecSquared() < d2.magVecSquared()) + if (d1.dot3(d1) < d2.dot3(d2)) { use_tri1a2 = TRUE; } @@ -6439,33 +5837,33 @@ BOOL LLVolumeFace::createCap(LLVolume* volume, BOOL partial_build) { // Use the profile points instead of the mesh, since you want // the un-transformed profile distances. - LLVector3 p1 = profile[pt1]; - LLVector3 p2 = profile[pt2]; - LLVector3 pa = profile[pt1+1]; - LLVector3 pb = profile[pt2-1]; + const LLVector4a& p1 = profile[pt1]; + const LLVector4a& p2 = profile[pt2]; + const LLVector4a& pa = profile[pt1+1]; + const LLVector4a& pb = profile[pt2-1]; - p1.mV[VZ] = 0.f; - p2.mV[VZ] = 0.f; - pa.mV[VZ] = 0.f; - pb.mV[VZ] = 0.f; + const F32* p1V = p1.getF32ptr(); + const F32* p2V = p2.getF32ptr(); + const F32* paV = pa.getF32ptr(); + const F32* pbV = pb.getF32ptr(); // Use area of triangle to determine backfacing F32 area_1a2, area_1ba, area_21b, area_2ab; - area_1a2 = (p1.mV[0]*pa.mV[1] - pa.mV[0]*p1.mV[1]) + - (pa.mV[0]*p2.mV[1] - p2.mV[0]*pa.mV[1]) + - (p2.mV[0]*p1.mV[1] - p1.mV[0]*p2.mV[1]); + area_1a2 = (p1V[0]*paV[1] - paV[0]*p1V[1]) + + (paV[0]*p2V[1] - p2V[0]*paV[1]) + + (p2V[0]*p1V[1] - p1V[0]*p2V[1]); - area_1ba = (p1.mV[0]*pb.mV[1] - pb.mV[0]*p1.mV[1]) + - (pb.mV[0]*pa.mV[1] - pa.mV[0]*pb.mV[1]) + - (pa.mV[0]*p1.mV[1] - p1.mV[0]*pa.mV[1]); + area_1ba = (p1V[0]*pbV[1] - pbV[0]*p1V[1]) + + (pbV[0]*paV[1] - paV[0]*pbV[1]) + + (paV[0]*p1V[1] - p1V[0]*paV[1]); - area_21b = (p2.mV[0]*p1.mV[1] - p1.mV[0]*p2.mV[1]) + - (p1.mV[0]*pb.mV[1] - pb.mV[0]*p1.mV[1]) + - (pb.mV[0]*p2.mV[1] - p2.mV[0]*pb.mV[1]); + area_21b = (p2V[0]*p1V[1] - p1V[0]*p2V[1]) + + (p1V[0]*pbV[1] - pbV[0]*p1V[1]) + + (pbV[0]*p2V[1] - p2V[0]*pbV[1]); - area_2ab = (p2.mV[0]*pa.mV[1] - pa.mV[0]*p2.mV[1]) + - (pa.mV[0]*pb.mV[1] - pb.mV[0]*pa.mV[1]) + - (pb.mV[0]*p2.mV[1] - p2.mV[0]*pb.mV[1]); + area_2ab = (p2V[0]*paV[1] - paV[0]*p2V[1]) + + (paV[0]*pbV[1] - pbV[0]*paV[1]) + + (pbV[0]*p2V[1] - p2V[0]*pbV[1]); BOOL use_tri1a2 = TRUE; BOOL tri_1a2 = TRUE; @@ -6500,10 +5898,12 @@ BOOL LLVolumeFace::createCap(LLVolume* volume, BOOL partial_build) } else { - LLVector3 d1 = p1 - pa; - LLVector3 d2 = p2 - pb; + LLVector4a d1; + d1.setSub(p1,pa); + LLVector4a d2; + d2.setSub(p2,pb); - if (d1.magVecSquared() < d2.magVecSquared()) + if (d1.dot3(d1) < d2.dot3(d2)) { use_tri1a2 = TRUE; } @@ -6554,6 +5954,8 @@ BOOL LLVolumeFace::createCap(LLVolume* volume, BOOL partial_build) } LLVector4a d0,d1; + LL_CHECK_MEMORY + d0.setSub(mPositions[mIndices[1]], mPositions[mIndices[0]]); d1.setSub(mPositions[mIndices[2]], mPositions[mIndices[0]]); @@ -6622,24 +6024,22 @@ void LLVolumeFace::createTangents() void LLVolumeFace::resizeVertices(S32 num_verts) { - ll_aligned_free_16(mPositions); - ll_aligned_free_16(mNormals); + ll_aligned_free(mPositions); + //DO NOT free mNormals and mTexCoords as they are part of mPositions buffer ll_aligned_free_16(mTangents); - ll_aligned_free_16(mTexCoords); mTangents = NULL; if (num_verts) { - mPositions = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*num_verts); - ll_assert_aligned(mPositions, 16); - mNormals = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*num_verts); - ll_assert_aligned(mNormals, 16); - //pad texture coordinate block end to allow for QWORD reads S32 size = ((num_verts*sizeof(LLVector2)) + 0xF) & ~0xF; - mTexCoords = (LLVector2*) ll_aligned_malloc_16(size); - ll_assert_aligned(mTexCoords, 16); + + mPositions = (LLVector4a*) ll_aligned_malloc(sizeof(LLVector4a)*2*num_verts+size, 64); + mNormals = mPositions+num_verts; + mTexCoords = (LLVector2*) (mNormals+num_verts); + + ll_assert_aligned(mPositions, 64); } else { @@ -6649,6 +6049,7 @@ void LLVolumeFace::resizeVertices(S32 num_verts) } mNumVertices = num_verts; + mNumAllocatedVertices = num_verts; } void LLVolumeFace::pushVertex(const LLVolumeFace::VertexData& cv) @@ -6659,27 +6060,42 @@ void LLVolumeFace::pushVertex(const LLVolumeFace::VertexData& cv) void LLVolumeFace::pushVertex(const LLVector4a& pos, const LLVector4a& norm, const LLVector2& tc) { S32 new_verts = mNumVertices+1; - S32 new_size = new_verts*16; - S32 old_size = mNumVertices*16; + + if (new_verts > mNumAllocatedVertices) + { + //double buffer size on expansion + new_verts *= 2; + + S32 new_tc_size = ((new_verts*8)+0xF) & ~0xF; + S32 old_tc_size = ((mNumVertices*8)+0xF) & ~0xF; + + S32 old_vsize = mNumVertices*16; + + S32 new_size = new_verts*16*2+new_tc_size; + + LLVector4a* old_buf = mPositions; + + mPositions = (LLVector4a*) ll_aligned_malloc(new_size, 64); + mNormals = mPositions+new_verts; + mTexCoords = (LLVector2*) (mNormals+new_verts); //positions - mPositions = (LLVector4a*) ll_aligned_realloc_16(mPositions, new_size, old_size); - ll_assert_aligned(mPositions,16); + LLVector4a::memcpyNonAliased16((F32*) mPositions, (F32*) old_buf, old_vsize); //normals - mNormals = (LLVector4a*) ll_aligned_realloc_16(mNormals, new_size, old_size); - ll_assert_aligned(mNormals,16); + LLVector4a::memcpyNonAliased16((F32*) mNormals, (F32*) (old_buf+mNumVertices), old_vsize); //tex coords - new_size = ((new_verts*8)+0xF) & ~0xF; - old_size = ((mNumVertices*8)+0xF) & ~0xF; - mTexCoords = (LLVector2*) ll_aligned_realloc_16(mTexCoords, new_size, old_size); - ll_assert_aligned(mTexCoords,16); - + LLVector4a::memcpyNonAliased16((F32*) mTexCoords, (F32*) (old_buf+mNumVertices*2), old_tc_size); //just clear tangents ll_aligned_free_16(mTangents); mTangents = NULL; + ll_aligned_free(old_buf); + + mNumAllocatedVertices = new_verts; + + } mPositions[mNumVertices] = pos; mNormals[mNumVertices] = norm; @@ -6768,13 +6184,23 @@ void LLVolumeFace::appendFace(const LLVolumeFace& face, LLMatrix4& mat_in, LLMat llerrs << "Cannot append empty face." << llendl; } + U32 old_vsize = mNumVertices*16; + U32 new_vsize = new_count * 16; + U32 old_tcsize = (mNumVertices*sizeof(LLVector2)+0xF) & ~0xF; + U32 new_tcsize = (new_count*sizeof(LLVector2)+0xF) & ~0xF; + U32 new_size = new_vsize * 2 + new_tcsize; + //allocate new buffer space - mPositions = (LLVector4a*) ll_aligned_realloc_16(mPositions, new_count*sizeof(LLVector4a), mNumVertices*sizeof(LLVector4a)); - ll_assert_aligned(mPositions, 16); - mNormals = (LLVector4a*) ll_aligned_realloc_16(mNormals, new_count*sizeof(LLVector4a), mNumVertices*sizeof(LLVector4a)); - ll_assert_aligned(mNormals, 16); - mTexCoords = (LLVector2*) ll_aligned_realloc_16(mTexCoords, (new_count*sizeof(LLVector2)+0xF) & ~0xF, (mNumVertices*sizeof(LLVector2)+0xF) & ~0xF); - ll_assert_aligned(mTexCoords, 16); + LLVector4a* old_buf = mPositions; + mPositions = (LLVector4a*) ll_aligned_malloc(new_size, 64); + mNormals = mPositions + new_count; + mTexCoords = (LLVector2*) (mNormals+new_count); + + mNumAllocatedVertices = new_count; + + LLVector4a::memcpyNonAliased16((F32*) mPositions, (F32*) old_buf, old_vsize); + LLVector4a::memcpyNonAliased16((F32*) mNormals, (F32*) (old_buf+mNumVertices), old_vsize); + LLVector4a::memcpyNonAliased16((F32*) mTexCoords, (F32*) (old_buf+mNumVertices*2), old_tcsize); mNumVertices = new_count; @@ -6834,6 +6260,7 @@ void LLVolumeFace::appendFace(const LLVolumeFace& face, LLMatrix4& mat_in, LLMat BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build) { + LL_CHECK_MEMORY BOOL flat = mTypeMask & FLAT_MASK; U8 sculpt_type = volume->getParams().getSculptType(); @@ -6844,9 +6271,9 @@ BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build) S32 num_vertices, num_indices; - const std::vector<LLVolume::Point>& mesh = volume->getMesh(); - const std::vector<LLVector3>& profile = volume->getProfile().mProfile; - const std::vector<LLPath::PathPt>& path_data = volume->getPath().mPath; + const LLAlignedArray<LLVector4a,64>& mesh = volume->getMesh(); + const LLAlignedArray<LLVector4a,64>& profile = volume->getProfile().mProfile; + const LLAlignedArray<LLPath::PathPt,64>& path_data = volume->getPath().mPath; S32 max_s = volume->getProfile().getTotal(); @@ -6867,15 +6294,19 @@ BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build) } } + LL_CHECK_MEMORY + LLVector4a* pos = (LLVector4a*) mPositions; - LLVector4a* norm = (LLVector4a*) mNormals; LLVector2* tc = (LLVector2*) mTexCoords; - S32 begin_stex = llfloor( profile[mBeginS].mV[2] ); + F32 begin_stex = floorf(profile[mBeginS][2]); S32 num_s = ((mTypeMask & INNER_MASK) && (mTypeMask & FLAT_MASK) && mNumS > 2) ? mNumS/2 : mNumS; S32 cur_vertex = 0; + S32 end_t = mBeginT+mNumT; + bool test = (mTypeMask & INNER_MASK) && (mTypeMask & FLAT_MASK) && mNumS > 2; + // Copy the vertices into the array - for (t = mBeginT; t < mBeginT + mNumT; t++) + for (t = mBeginT; t < end_t; t++) { tt = path_data[t].mTexT; for (s = 0; s < num_s; s++) @@ -6896,11 +6327,11 @@ BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build) // Get s value for tex-coord. if (!flat) { - ss = profile[mBeginS + s].mV[2]; + ss = profile[mBeginS + s][2]; } else { - ss = profile[mBeginS + s].mV[2] - begin_stex; + ss = profile[mBeginS + s][2] - begin_stex; } } @@ -6920,19 +6351,15 @@ BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build) i = mBeginS + s + max_s*t; } - pos[cur_vertex].load3(mesh[i].mPos.mV); - tc[cur_vertex] = LLVector2(ss,tt); + mesh[i].store4a((F32*)(pos+cur_vertex)); + tc[cur_vertex].set(ss,tt); - norm[cur_vertex].clear(); cur_vertex++; - if ((mTypeMask & INNER_MASK) && (mTypeMask & FLAT_MASK) && mNumS > 2 && s > 0) + if (test && s > 0) { - pos[cur_vertex].load3(mesh[i].mPos.mV); - tc[cur_vertex] = LLVector2(ss,tt); - - norm[cur_vertex].clear(); - + mesh[i].store4a((F32*)(pos+cur_vertex)); + tc[cur_vertex].set(ss,tt); cur_vertex++; } } @@ -6949,27 +6376,63 @@ BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build) } i = mBeginS + s + max_s*t; - ss = profile[mBeginS + s].mV[2] - begin_stex; - pos[cur_vertex].load3(mesh[i].mPos.mV); - tc[cur_vertex] = LLVector2(ss,tt); - norm[cur_vertex].clear(); + ss = profile[mBeginS + s][2] - begin_stex; + + mesh[i].store4a((F32*)(pos+cur_vertex)); + tc[cur_vertex].set(ss,tt); cur_vertex++; } - } + } + LL_CHECK_MEMORY - //get bounding box for this side - LLVector4a& face_min = mExtents[0]; - LLVector4a& face_max = mExtents[1]; mCenter->clear(); - face_min = face_max = pos[0]; + LLVector4a* cur_pos = pos; + LLVector4a* end_pos = pos + mNumVertices; - for (U32 i = 1; i < mNumVertices; ++i) + //get bounding box for this side + LLVector4a face_min; + LLVector4a face_max; + + face_min = face_max = *cur_pos++; + + while (cur_pos < end_pos) { - update_min_max(face_min, face_max, pos[i]); + update_min_max(face_min, face_max, *cur_pos++); + } + + mExtents[0] = face_min; + mExtents[1] = face_max; + + U32 tc_count = mNumVertices; + if (tc_count%2 == 1) + { //odd number of texture coordinates, duplicate last entry to padded end of array + tc_count++; + mTexCoords[mNumVertices] = mTexCoords[mNumVertices-1]; } + LLVector4a* cur_tc = (LLVector4a*) mTexCoords; + LLVector4a* end_tc = (LLVector4a*) (mTexCoords+tc_count); + + LLVector4a tc_min; + LLVector4a tc_max; + + tc_min = tc_max = *cur_tc++; + + while (cur_tc < end_tc) + { + update_min_max(tc_min, tc_max, *cur_tc++); + } + + F32* minp = tc_min.getF32ptr(); + F32* maxp = tc_max.getF32ptr(); + + mTexCoordExtents[0].mV[0] = llmin(minp[0], minp[2]); + mTexCoordExtents[0].mV[1] = llmin(minp[1], minp[3]); + mTexCoordExtents[1].mV[0] = llmax(maxp[0], maxp[2]); + mTexCoordExtents[1].mV[1] = llmax(maxp[1], maxp[3]); + mCenter->setAdd(face_min, face_max); mCenter->mul(0.5f); @@ -7034,47 +6497,119 @@ BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build) } } + LL_CHECK_MEMORY + //clear normals - for (U32 i = 0; i < mNumVertices; i++) + F32* dst = (F32*) mNormals; + F32* end = (F32*) (mNormals+mNumVertices); + LLVector4a zero = LLVector4a::getZero(); + + while (dst < end) { - mNormals[i].clear(); + zero.store4a(dst); + dst += 4; } + LL_CHECK_MEMORY + //generate normals - for (U32 i = 0; i < mNumIndices/3; i++) //for each triangle + U32 count = mNumIndices/3; + + LLVector4a* norm = mNormals; + + static LLAlignedArray<LLVector4a, 64> triangle_normals; + triangle_normals.resize(count); + LLVector4a* output = triangle_normals.mArray; + LLVector4a* end_output = output+count; + + U16* idx = mIndices; + + while (output < end_output) { - const U16* idx = &(mIndices[i*3]); + LLVector4a b,v1,v2; + b.load4a((F32*) (pos+idx[0])); + v1.load4a((F32*) (pos+idx[1])); + v2.load4a((F32*) (pos+idx[2])); + + //calculate triangle normal + LLVector4a a; + a.setSub(b, v1); + b.sub(v2); + - LLVector4a* v[] = - { pos+idx[0], pos+idx[1], pos+idx[2] }; + LLQuad& vector1 = *((LLQuad*) &v1); + LLQuad& vector2 = *((LLQuad*) &v2); - LLVector4a* n[] = - { norm+idx[0], norm+idx[1], norm+idx[2] }; + LLQuad& amQ = *((LLQuad*) &a); + LLQuad& bmQ = *((LLQuad*) &b); + + //v1.setCross3(t,v0); + //setCross3(const LLVector4a& a, const LLVector4a& b) + // Vectors are stored in memory in w, z, y, x order from high to low + // Set vector1 = { a[W], a[X], a[Z], a[Y] } + vector1 = _mm_shuffle_ps( amQ, amQ, _MM_SHUFFLE( 3, 0, 2, 1 )); + // Set vector2 = { b[W], b[Y], b[X], b[Z] } + vector2 = _mm_shuffle_ps( bmQ, bmQ, _MM_SHUFFLE( 3, 1, 0, 2 )); + // mQ = { a[W]*b[W], a[X]*b[Y], a[Z]*b[X], a[Y]*b[Z] } + vector2 = _mm_mul_ps( vector1, vector2 ); + // vector3 = { a[W], a[Y], a[X], a[Z] } + amQ = _mm_shuffle_ps( amQ, amQ, _MM_SHUFFLE( 3, 1, 0, 2 )); + // vector4 = { b[W], b[X], b[Z], b[Y] } + bmQ = _mm_shuffle_ps( bmQ, bmQ, _MM_SHUFFLE( 3, 0, 2, 1 )); + // mQ = { 0, a[X]*b[Y] - a[Y]*b[X], a[Z]*b[X] - a[X]*b[Z], a[Y]*b[Z] - a[Z]*b[Y] } + vector1 = _mm_sub_ps( vector2, _mm_mul_ps( amQ, bmQ )); + + llassert(v1.isFinite3()); + + v1.store4a((F32*) output); - //calculate triangle normal - LLVector4a a, b, c; - a.setSub(*v[0], *v[1]); - b.setSub(*v[0], *v[2]); - c.setCross3(a,b); + output++; + idx += 3; + } + + idx = mIndices; - n[0]->add(c); - n[1]->add(c); - n[2]->add(c); + LLVector4a* src = triangle_normals.mArray; + + for (U32 i = 0; i < count; i++) //for each triangle + { + LLVector4a c; + c.load4a((F32*) (src++)); + + LLVector4a* n0p = norm+idx[0]; + LLVector4a* n1p = norm+idx[1]; + LLVector4a* n2p = norm+idx[2]; - llassert(llfinite(c.getF32ptr()[0])); - llassert(llfinite(c.getF32ptr()[1])); - llassert(llfinite(c.getF32ptr()[2])); + idx += 3; - llassert(!llisnan(c.getF32ptr()[0])); - llassert(!llisnan(c.getF32ptr()[1])); - llassert(!llisnan(c.getF32ptr()[2])); + LLVector4a n0,n1,n2; + n0.load4a((F32*) n0p); + n1.load4a((F32*) n1p); + n2.load4a((F32*) n2p); + + n0.add(c); + n1.add(c); + n2.add(c); + + llassert(c.isFinite3()); //even out quad contributions - n[i%2+1]->add(c); + switch (i%2+1) + { + case 0: n0.add(c); break; + case 1: n1.add(c); break; + case 2: n2.add(c); break; + }; + + n0.store4a((F32*) n0p); + n1.store4a((F32*) n1p); + n2.store4a((F32*) n2p); } + LL_CHECK_MEMORY + // adjust normals based on wrapping and stitching LLVector4a top; @@ -7206,6 +6741,8 @@ BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build) } + LL_CHECK_MEMORY + return TRUE; } @@ -7277,9 +6814,6 @@ void CalculateTangentArray(U32 vertexCount, const LLVector4a *vertex, const LLVe const LLVector4a& t = tan1[a]; - llassert(tan1[a].getLength3().getF32() >= 0.f); - llassert(tan2[a].getLength3().getF32() >= 0.f); - LLVector4a ncrosst; ncrosst.setCross3(n,t); @@ -7299,16 +6833,6 @@ void CalculateTangentArray(U32 vertexCount, const LLVector4a *vertex, const LLVe tsubn.getF32ptr()[3] = handedness; tangent[a] = tsubn; - - /* - These are going off on invalid input and hindering other debugging. - llassert(llfinite(tangent[a].getF32ptr()[0])); - llassert(llfinite(tangent[a].getF32ptr()[1])); - llassert(llfinite(tangent[a].getF32ptr()[2])); - - llassert(!llisnan(tangent[a].getF32ptr()[0])); - llassert(!llisnan(tangent[a].getF32ptr()[1])); - llassert(!llisnan(tangent[a].getF32ptr()[2]));*/ } else { //degenerate, make up a value diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h index 164b8d6652..975227ea58 100755 --- a/indra/llmath/llvolume.h +++ b/indra/llmath/llvolume.h @@ -37,7 +37,6 @@ class LLPath; template <class T> class LLOctreeNode; -class LLVector4a; class LLVolumeFace; class LLVolume; class LLVolumeTriangle; @@ -50,12 +49,15 @@ class LLVolumeTriangle; #include "v3math.h" #include "v3dmath.h" #include "v4math.h" +#include "llvector4a.h" +#include "llmatrix4a.h" #include "llquaternion.h" #include "llstrider.h" #include "v4coloru.h" #include "llrefcount.h" #include "llpointer.h" #include "llfile.h" +#include "llalignedarray.h" //============================================================================ @@ -708,16 +710,16 @@ public: LLFaceID mFaceID; }; - std::vector<LLVector3> mProfile; - std::vector<LLVector2> mNormals; + LLAlignedArray<LLVector4a, 64> mProfile; + //LLAlignedArray<LLVector4a, 64> mNormals; std::vector<Face> mFaces; - std::vector<LLVector3> mEdgeNormals; - std::vector<LLVector3> mEdgeCenters; + + //LLAlignedArray<LLVector4a, 64> mEdgeNormals; + //LLAlignedArray<LLVector4a, 64> mEdgeCenters; friend std::ostream& operator<<(std::ostream &s, const LLProfile &profile); protected: - void genNormals(const LLProfileParams& params); static S32 getNumNGonPoints(const LLProfileParams& params, S32 sides, F32 offset=0.0f, F32 bevel = 0.0f, F32 ang_scale = 1.f, S32 split = 0); void genNGon(const LLProfileParams& params, S32 sides, F32 offset=0.0f, F32 bevel = 0.0f, F32 ang_scale = 1.f, S32 split = 0); @@ -741,13 +743,29 @@ protected: class LLPath { public: - struct PathPt + class PathPt { - LLVector3 mPos; - LLVector2 mScale; - LLQuaternion mRot; + public: + LLMatrix4a mRot; + LLVector4a mPos; + + LLVector4a mScale; F32 mTexT; - PathPt() { mPos.setVec(0,0,0); mTexT = 0; mScale.setVec(0,0); mRot.loadIdentity(); } + F32 pad[3]; //for alignment + PathPt() + { + mPos.clear(); + mTexT = 0; + mScale.clear(); + mRot.setRows(LLVector4a(1,0,0,0), + LLVector4a(0,1,0,0), + LLVector4a(0,0,1,0)); + + //distinguished data in the pad for debugging + pad[0] = 3.14159f; + pad[1] = -3.14159f; + pad[2] = 0.585f; + } }; public: @@ -779,7 +797,7 @@ public: friend std::ostream& operator<<(std::ostream &s, const LLPath &path); public: - std::vector<PathPt> mPath; + LLAlignedArray<PathPt, 64> mPath; protected: BOOL mOpen; @@ -912,6 +930,7 @@ public: LLVector2 mTexCoordExtents[2]; //minimum and maximum of texture coordinates of the face. S32 mNumVertices; + S32 mNumAllocatedVertices; S32 mNumIndices; LLVector4a* mPositions; @@ -933,6 +952,9 @@ public: LLOctreeNode<LLVolumeTriangle>* mOctree; + //whether or not face has been cache optimized + BOOL mOptimized; + private: BOOL createUnCutCubeCap(LLVolume* volume, BOOL partial_build = FALSE); BOOL createCap(LLVolume* volume, BOOL partial_build = FALSE); @@ -947,11 +969,7 @@ protected: ~LLVolume(); // use unref public: - struct Point - { - LLVector3 mPos; - }; - + struct FaceParams { LLFaceID mFaceID; @@ -974,8 +992,8 @@ public: const LLProfile& getProfile() const { return *mProfilep; } LLPath& getPath() const { return *mPathp; } void resizePath(S32 length); - const std::vector<Point>& getMesh() const { return mMesh; } - const LLVector3& getMeshPt(const U32 i) const { return mMesh[i].mPos; } + const LLAlignedArray<LLVector4a,64>& getMesh() const { return mMesh; } + const LLVector4a& getMeshPt(const U32 i) const { return mMesh[i]; } void setDirty() { mPathp->setDirty(); mProfilep->setDirty(); } @@ -990,10 +1008,7 @@ public: S32 getSculptLevel() const { return mSculptLevel; } void setSculptLevel(S32 level) { mSculptLevel = level; } - S32 *getTriangleIndices(U32 &num_indices) const; - - // returns number of triangle indeces required for path/profile mesh - S32 getNumTriangleIndices() const; + static void getLoDTriangleCounts(const LLVolumeParams& params, S32* counts); S32 getNumTriangles(S32* vcount = NULL) const; @@ -1059,7 +1074,8 @@ public: LLVolumeParams mParams; LLPath *mPathp; LLProfile *mProfilep; - std::vector<Point> mMesh; + LLAlignedArray<LLVector4a,64> mMesh; + BOOL mGenerateSingleFace; typedef std::vector<LLVolumeFace> face_list_t; diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp index 47041a2880..081f070866 100755 --- a/indra/llmessage/llcurl.cpp +++ b/indra/llmessage/llcurl.cpp @@ -72,7 +72,8 @@ static const U32 EASY_HANDLE_POOL_SIZE = 5; static const S32 MULTI_PERFORM_CALL_REPEAT = 5; -static const S32 CURL_REQUEST_TIMEOUT = 30; // seconds per operation +static const S32 CURL_REQUEST_TIMEOUT = 120; // seconds per operation +static const S32 CURL_CONNECT_TIMEOUT = 30; //seconds to wait for a connection static const S32 MAX_ACTIVE_REQUEST_COUNT = 100; // DEBUG // @@ -91,6 +92,7 @@ S32 LLCurl::sTotalHandles = 0 ; bool LLCurl::sNotQuitting = true; F32 LLCurl::sCurlRequestTimeOut = 120.f; //seonds S32 LLCurl::sMaxHandles = 256; //max number of handles, (multi handles and easy handles combined). +CURL* LLCurl::sCurlTemplateStandardHandle = NULL; void check_curl_code(CURLcode code) { @@ -517,6 +519,7 @@ void LLCurl::Easy::prepRequest(const std::string& url, //don't verify host name so urls with scrubbed host names will work (improves DNS performance) setopt(CURLOPT_SSL_VERIFYHOST, 0); setopt(CURLOPT_TIMEOUT, llmax(time_out, CURL_REQUEST_TIMEOUT)); + setopt(CURLOPT_CONNECTTIMEOUT, CURL_CONNECT_TIMEOUT); setoptString(CURLOPT_URL, url); @@ -1813,10 +1816,10 @@ CURL* LLCurl::newEasyHandle() } sTotalHandles++; - CURL* ret = curl_easy_init() ; + CURL* ret = createStandardCurlHandle(); if(!ret) { - llwarns << "curl_easy_init failed." << llendl ; + llwarns << "failed to create curl handle." << llendl ; } return ret ; @@ -1846,3 +1849,47 @@ void LLCurlFF::check_multi_code(CURLMcode code) { check_curl_multi_code(code); } + + +// Static +CURL* LLCurl::createStandardCurlHandle() +{ + if (sCurlTemplateStandardHandle == NULL) + { // Late creation of the template curl handle + sCurlTemplateStandardHandle = curl_easy_init(); + if (sCurlTemplateStandardHandle == NULL) + { + llwarns << "curl error calling curl_easy_init()" << llendl; + } + else + { + CURLcode result = curl_easy_setopt(sCurlTemplateStandardHandle, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); + check_curl_code(result); + result = curl_easy_setopt(sCurlTemplateStandardHandle, CURLOPT_NOSIGNAL, 1); + check_curl_code(result); + result = curl_easy_setopt(sCurlTemplateStandardHandle, CURLOPT_NOPROGRESS, 1); + check_curl_code(result); + result = curl_easy_setopt(sCurlTemplateStandardHandle, CURLOPT_ENCODING, ""); + check_curl_code(result); + result = curl_easy_setopt(sCurlTemplateStandardHandle, CURLOPT_AUTOREFERER, 1); + check_curl_code(result); + result = curl_easy_setopt(sCurlTemplateStandardHandle, CURLOPT_FOLLOWLOCATION, 1); + check_curl_code(result); + result = curl_easy_setopt(sCurlTemplateStandardHandle, CURLOPT_SSL_VERIFYPEER, 1); + check_curl_code(result); + result = curl_easy_setopt(sCurlTemplateStandardHandle, CURLOPT_SSL_VERIFYHOST, 0); + check_curl_code(result); + + // The Linksys WRT54G V5 router has an issue with frequent + // DNS lookups from LAN machines. If they happen too often, + // like for every HTTP request, the router gets annoyed after + // about 700 or so requests and starts issuing TCP RSTs to + // new connections. Reuse the DNS lookups for even a few + // seconds and no RSTs. + result = curl_easy_setopt(sCurlTemplateStandardHandle, CURLOPT_DNS_CACHE_TIMEOUT, 15); + check_curl_code(result); + } + } + + return curl_easy_duphandle(sCurlTemplateStandardHandle); +} diff --git a/indra/llmessage/llcurl.h b/indra/llmessage/llcurl.h index 7bcf61e233..90b3f2815d 100755 --- a/indra/llmessage/llcurl.h +++ b/indra/llmessage/llcurl.h @@ -45,7 +45,7 @@ #include "llqueuedthread.h" #include "llframetimer.h" #include "llpointer.h" - +#include "llsingleton.h" class LLMutex; class LLCurlThread; @@ -188,6 +188,8 @@ public: static CURL* newEasyHandle() ; static void deleteEasyHandle(CURL* handle) ; + static CURL* createStandardCurlHandle(); + private: static std::string sCAPath; static std::string sCAFile; @@ -197,6 +199,7 @@ private: static LLMutex* sHandleMutexp ; static S32 sTotalHandles ; static S32 sMaxHandles; + static CURL* sCurlTemplateStandardHandle; public: static bool sNotQuitting; static F32 sCurlRequestTimeOut; diff --git a/indra/llmessage/llpartdata.cpp b/indra/llmessage/llpartdata.cpp index 26cafa025f..41a0310ce0 100755 --- a/indra/llmessage/llpartdata.cpp +++ b/indra/llmessage/llpartdata.cpp @@ -37,53 +37,46 @@ -const S32 PS_PART_DATA_BLOCK_SIZE = 4 + 2 + 4 + 4 + 2 + 2; // 18 -const S32 PS_DATA_BLOCK_SIZE = 68 + PS_PART_DATA_BLOCK_SIZE; // 68 + 18 = 86 +const S32 PS_PART_DATA_GLOW_SIZE = 2; +const S32 PS_PART_DATA_BLEND_SIZE = 2; +const S32 PS_LEGACY_PART_DATA_BLOCK_SIZE = 4 + 2 + 4 + 4 + 2 + 2; //18 +const S32 PS_SYS_DATA_BLOCK_SIZE = 68; +const S32 PS_MAX_DATA_BLOCK_SIZE = PS_SYS_DATA_BLOCK_SIZE+ + PS_LEGACY_PART_DATA_BLOCK_SIZE + + PS_PART_DATA_BLEND_SIZE + + PS_PART_DATA_GLOW_SIZE+ + 8; //two S32 size fields + +const S32 PS_LEGACY_DATA_BLOCK_SIZE = PS_SYS_DATA_BLOCK_SIZE + PS_LEGACY_PART_DATA_BLOCK_SIZE; + + +const U32 PART_DATA_MASK = LLPartData::LL_PART_DATA_GLOW | LLPartData::LL_PART_DATA_BLEND; + const F32 MAX_PART_SCALE = 4.f; -BOOL LLPartData::pack(LLDataPacker &dp) +bool LLPartData::hasGlow() const { - LLColor4U coloru; - dp.packU32(mFlags, "pdflags"); - dp.packFixed(mMaxAge, "pdmaxage", FALSE, 8, 8); - coloru.setVec(mStartColor); - dp.packColor4U(coloru, "pdstartcolor"); - coloru.setVec(mEndColor); - dp.packColor4U(coloru, "pdendcolor"); - dp.packFixed(mStartScale.mV[0], "pdstartscalex", FALSE, 3, 5); - dp.packFixed(mStartScale.mV[1], "pdstartscaley", FALSE, 3, 5); - dp.packFixed(mEndScale.mV[0], "pdendscalex", FALSE, 3, 5); - dp.packFixed(mEndScale.mV[1], "pdendscaley", FALSE, 3, 5); - return TRUE; + return mStartGlow > 0.f || mEndGlow > 0.f; } -LLSD LLPartData::asLLSD() const +bool LLPartData::hasBlendFunc() const { - LLSD sd = LLSD(); - sd["pdflags"] = ll_sd_from_U32(mFlags); - sd["pdmaxage"] = mMaxAge; - sd["pdstartcolor"] = ll_sd_from_color4(mStartColor); - sd["pdendcolor"] = ll_sd_from_color4(mEndColor); - sd["pdstartscale"] = ll_sd_from_vector2(mStartScale); - sd["pdendscale"] = ll_sd_from_vector2(mEndScale); - return sd; + return mBlendFuncSource != LLPartData::LL_PART_BF_SOURCE_ALPHA || mBlendFuncDest != LLPartData::LL_PART_BF_ONE_MINUS_SOURCE_ALPHA; } -bool LLPartData::fromLLSD(LLSD& sd) +S32 LLPartData::getSize() const { - mFlags = ll_U32_from_sd(sd["pdflags"]); - mMaxAge = (F32)sd["pdmaxage"].asReal(); - mStartColor = ll_color4_from_sd(sd["pdstartcolor"]); - mEndColor = ll_color4_from_sd(sd["pdendcolor"]); - mStartScale = ll_vector2_from_sd(sd["pdstartscale"]); - mEndScale = ll_vector2_from_sd(sd["pdendscale"]); - return true; + S32 size = PS_LEGACY_PART_DATA_BLOCK_SIZE; + if (hasGlow()) size += PS_PART_DATA_GLOW_SIZE; + if (hasBlendFunc()) size += PS_PART_DATA_BLEND_SIZE; + + return size; } -BOOL LLPartData::unpack(LLDataPacker &dp) +BOOL LLPartData::unpackLegacy(LLDataPacker &dp) { LLColor4U coloru; @@ -98,9 +91,70 @@ BOOL LLPartData::unpack(LLDataPacker &dp) dp.unpackFixed(mStartScale.mV[1], "pdstartscaley", FALSE, 3, 5); dp.unpackFixed(mEndScale.mV[0], "pdendscalex", FALSE, 3, 5); dp.unpackFixed(mEndScale.mV[1], "pdendscaley", FALSE, 3, 5); + + mStartGlow = 0.f; + mEndGlow = 0.f; + mBlendFuncSource = LLPartData::LL_PART_BF_SOURCE_ALPHA; + mBlendFuncDest = LLPartData::LL_PART_BF_ONE_MINUS_SOURCE_ALPHA; + return TRUE; } +BOOL LLPartData::unpack(LLDataPacker &dp) +{ + S32 size = 0; + dp.unpackS32(size, "partsize"); + + unpackLegacy(dp); + size -= PS_LEGACY_PART_DATA_BLOCK_SIZE; + + if (mFlags & LL_PART_DATA_GLOW) + { + if (size < PS_PART_DATA_GLOW_SIZE) return FALSE; + + U8 tmp_glow = 0; + dp.unpackU8(tmp_glow,"pdstartglow"); + mStartGlow = tmp_glow / 255.f; + dp.unpackU8(tmp_glow,"pdendglow"); + mEndGlow = tmp_glow / 255.f; + + size -= PS_PART_DATA_GLOW_SIZE; + } + else + { + mStartGlow = 0.f; + mEndGlow = 0.f; + } + + if (mFlags & LL_PART_DATA_BLEND) + { + if (size < PS_PART_DATA_BLEND_SIZE) return FALSE; + dp.unpackU8(mBlendFuncSource,"pdblendsource"); + dp.unpackU8(mBlendFuncDest,"pdblenddest"); + size -= PS_PART_DATA_BLEND_SIZE; + } + else + { + mBlendFuncSource = LLPartData::LL_PART_BF_SOURCE_ALPHA; + mBlendFuncDest = LLPartData::LL_PART_BF_ONE_MINUS_SOURCE_ALPHA; + } + + if (size > 0) + { //leftover bytes, unrecognized parameters + U8 feh = 0; + while (size > 0) + { //read remaining bytes in block + dp.unpackU8(feh, "whippang"); + size--; + } + + //this particle system won't display properly, better to not show anything + return FALSE; + } + + + return TRUE; +} void LLPartData::setFlags(const U32 flags) { @@ -148,6 +202,18 @@ void LLPartData::setEndAlpha(const F32 alpha) mEndColor.mV[3] = alpha; } +// static +bool LLPartData::validBlendFunc(S32 func) +{ + if (func >= 0 + && func < LL_PART_BF_COUNT + && func != UNSUPPORTED_DEST_ALPHA + && func != UNSUPPORTED_ONE_MINUS_DEST_ALPHA) + { + return true; + } + return false; +} LLPartSysData::LLPartSysData() { @@ -160,6 +226,10 @@ LLPartSysData::LLPartSysData() mPartData.mStartScale = LLVector2(1.f, 1.f); mPartData.mEndScale = LLVector2(1.f, 1.f); mPartData.mMaxAge = 10.0; + mPartData.mBlendFuncSource = LLPartData::LL_PART_BF_SOURCE_ALPHA; + mPartData.mBlendFuncDest = LLPartData::LL_PART_BF_ONE_MINUS_SOURCE_ALPHA; + mPartData.mStartGlow = 0.f; + mPartData.mEndGlow = 0.f; mMaxAge = 0.0; mStartAge = 0.0; @@ -175,38 +245,7 @@ LLPartSysData::LLPartSysData() mNumParticles = 0; } - -BOOL LLPartSysData::pack(LLDataPacker &dp) -{ - dp.packU32(mCRC, "pscrc"); - dp.packU32(mFlags, "psflags"); - dp.packU8(mPattern, "pspattern"); - dp.packFixed(mMaxAge, "psmaxage", FALSE, 8, 8); - dp.packFixed(mStartAge, "psstartage", FALSE, 8, 8); - dp.packFixed(mInnerAngle, "psinnerangle", FALSE, 3, 5); - dp.packFixed(mOuterAngle, "psouterangle", FALSE, 3, 5); - dp.packFixed(mBurstRate, "psburstrate", FALSE, 8, 8); - dp.packFixed(mBurstRadius, "psburstradius", FALSE, 8, 8); - dp.packFixed(mBurstSpeedMin, "psburstspeedmin", FALSE, 8, 8); - dp.packFixed(mBurstSpeedMax, "psburstspeedmax", FALSE, 8, 8); - dp.packU8(mBurstPartCount, "psburstpartcount"); - - dp.packFixed(mAngularVelocity.mV[0], "psangvelx", TRUE, 8, 7); - dp.packFixed(mAngularVelocity.mV[1], "psangvely", TRUE, 8, 7); - dp.packFixed(mAngularVelocity.mV[2], "psangvelz", TRUE, 8, 7); - - dp.packFixed(mPartAccel.mV[0], "psaccelx", TRUE, 8, 7); - dp.packFixed(mPartAccel.mV[1], "psaccely", TRUE, 8, 7); - dp.packFixed(mPartAccel.mV[2], "psaccelz", TRUE, 8, 7); - - dp.packUUID(mPartImageID, "psuuid"); - dp.packUUID(mTargetUUID, "pstargetuuid"); - mPartData.pack(dp); - return TRUE; -} - - -BOOL LLPartSysData::unpack(LLDataPacker &dp) +BOOL LLPartSysData::unpackSystem(LLDataPacker &dp) { dp.unpackU32(mCRC, "pscrc"); dp.unpackU32(mFlags, "psflags"); @@ -232,10 +271,48 @@ BOOL LLPartSysData::unpack(LLDataPacker &dp) dp.unpackUUID(mPartImageID, "psuuid"); dp.unpackUUID(mTargetUUID, "pstargetuuid"); - mPartData.unpack(dp); return TRUE; } +BOOL LLPartSysData::unpackLegacy(LLDataPacker &dp) +{ + unpackSystem(dp); + mPartData.unpackLegacy(dp); + + return TRUE; +} + +BOOL LLPartSysData::unpack(LLDataPacker &dp) +{ + // syssize is currently unused. Adding now when modifying the 'version to make extensible in the future + S32 size = 0; + dp.unpackS32(size, "syssize"); + + if (size != PS_SYS_DATA_BLOCK_SIZE) + { //unexpected size, this viewer doesn't know how to parse this particle system + + //skip to LLPartData block + U8 feh = 0; + + for (U32 i = 0; i < size; ++i) + { + dp.unpackU8(feh, "whippang"); + } + + dp.unpackS32(size, "partsize"); + //skip LLPartData block + for (U32 i = 0; i < size; ++i) + { + dp.unpackU8(feh, "whippang"); + } + return FALSE; + } + + unpackSystem(dp); + + return mPartData.unpack(dp); +} + std::ostream& operator<<(std::ostream& s, const LLPartSysData &data) { s << "Flags: " << std::hex << data.mFlags; @@ -253,7 +330,7 @@ std::ostream& operator<<(std::ostream& s, const LLPartSysData &data) BOOL LLPartSysData::isNullPS(const S32 block_num) { - U8 ps_data_block[PS_DATA_BLOCK_SIZE]; + U8 ps_data_block[PS_MAX_DATA_BLOCK_SIZE]; U32 crc; S32 size; @@ -264,14 +341,28 @@ BOOL LLPartSysData::isNullPS(const S32 block_num) { return TRUE; } - else if (size != PS_DATA_BLOCK_SIZE) + + if (size > PS_MAX_DATA_BLOCK_SIZE) { - llwarns << "PSBlock is wrong size for particle system data - got " << size << ", expecting " << PS_DATA_BLOCK_SIZE << llendl; + //size is too big, newer particle version unsupported return TRUE; } - gMessageSystem->getBinaryData("ObjectData", "PSBlock", ps_data_block, PS_DATA_BLOCK_SIZE, block_num, PS_DATA_BLOCK_SIZE); - LLDataPackerBinaryBuffer dp(ps_data_block, PS_DATA_BLOCK_SIZE); + gMessageSystem->getBinaryData("ObjectData", "PSBlock", ps_data_block, size, block_num, PS_MAX_DATA_BLOCK_SIZE); + + LLDataPackerBinaryBuffer dp(ps_data_block, size); + if (size > PS_LEGACY_DATA_BLOCK_SIZE) + { + // non legacy systems pack a size before the CRC + S32 tmp = 0; + dp.unpackS32(tmp, "syssize"); + + if (tmp > PS_SYS_DATA_BLOCK_SIZE) + { //unknown system data block size, don't know how to parse it, treat as NULL + return TRUE; + } + } + dp.unpackU32(crc, "crc"); if (crc == 0) @@ -281,50 +372,37 @@ BOOL LLPartSysData::isNullPS(const S32 block_num) return FALSE; } - -//static -BOOL LLPartSysData::packNull() -{ - U8 ps_data_block[PS_DATA_BLOCK_SIZE]; - gMessageSystem->addBinaryData("PSBlock", ps_data_block, 0); - return TRUE; -} - - -BOOL LLPartSysData::packBlock() -{ - U8 ps_data_block[PS_DATA_BLOCK_SIZE]; - - LLDataPackerBinaryBuffer dp(ps_data_block, PS_DATA_BLOCK_SIZE); - pack(dp); - - // Add to message - gMessageSystem->addBinaryData("PSBlock", ps_data_block, PS_DATA_BLOCK_SIZE); - - return TRUE; -} - - BOOL LLPartSysData::unpackBlock(const S32 block_num) { - U8 ps_data_block[PS_DATA_BLOCK_SIZE]; + U8 ps_data_block[PS_MAX_DATA_BLOCK_SIZE]; // Check size of block S32 size = gMessageSystem->getSize("ObjectData", block_num, "PSBlock"); - if (size != PS_DATA_BLOCK_SIZE) + if (size > PS_MAX_DATA_BLOCK_SIZE) { - llwarns << "PSBlock is wrong size for particle system data - got " << size << ", expecting " << PS_DATA_BLOCK_SIZE << llendl; + // Larger packets are newer and unsupported return FALSE; } // Get from message - gMessageSystem->getBinaryData("ObjectData", "PSBlock", ps_data_block, PS_DATA_BLOCK_SIZE, block_num, PS_DATA_BLOCK_SIZE); + gMessageSystem->getBinaryData("ObjectData", "PSBlock", ps_data_block, size, block_num, PS_MAX_DATA_BLOCK_SIZE); - LLDataPackerBinaryBuffer dp(ps_data_block, PS_DATA_BLOCK_SIZE); - unpack(dp); + LLDataPackerBinaryBuffer dp(ps_data_block, size); - return TRUE; + if (size == PS_LEGACY_DATA_BLOCK_SIZE) + { + return unpackLegacy(dp); + } + else + { + return unpack(dp); + } +} + +bool LLPartSysData::isLegacyCompatible() const +{ + return !mPartData.hasGlow() && !mPartData.hasBlendFunc(); } void LLPartSysData::clampSourceParticleRate() diff --git a/indra/llmessage/llpartdata.h b/indra/llmessage/llpartdata.h index a4ef058b30..ed5c1a6ac7 100755 --- a/indra/llmessage/llpartdata.h +++ b/indra/llmessage/llpartdata.h @@ -70,7 +70,12 @@ enum LLPSScriptFlags LLPS_SRC_TARGET_UUID, LLPS_SRC_OMEGA, LLPS_SRC_ANGLE_BEGIN, - LLPS_SRC_ANGLE_END + LLPS_SRC_ANGLE_END, + + LLPS_PART_BLEND_FUNC_SOURCE, + LLPS_PART_BLEND_FUNC_DEST, + LLPS_PART_START_GLOW, + LLPS_PART_END_GLOW }; @@ -83,11 +88,13 @@ public: mParameter(0.f) { } + BOOL unpackLegacy(LLDataPacker &dp); BOOL unpack(LLDataPacker &dp); + BOOL pack(LLDataPacker &dp); - LLSD asLLSD() const; - operator LLSD() const {return asLLSD(); } - bool fromLLSD(LLSD& sd); + + bool hasGlow() const; + bool hasBlendFunc() const; // Masks for the different particle flags enum @@ -102,17 +109,39 @@ public: LL_PART_TARGET_LINEAR_MASK = 0x80, // Particle uses a direct linear interpolation LL_PART_EMISSIVE_MASK = 0x100, // Particle is "emissive", instead of being lit LL_PART_BEAM_MASK = 0x200, // Particle is a "beam" connecting source and target + LL_PART_RIBBON_MASK = 0x400, // Particles are joined together into one continuous triangle strip // Not implemented yet! //LL_PART_RANDOM_ACCEL_MASK = 0x100, // Particles have random acceleration //LL_PART_RANDOM_VEL_MASK = 0x200, // Particles have random velocity shifts" //LL_PART_TRAIL_MASK = 0x400, // Particles have historical "trails" + //sYSTEM SET FLAGS + LL_PART_DATA_GLOW = 0x10000, + LL_PART_DATA_BLEND = 0x20000, + // Viewer side use only! LL_PART_HUD = 0x40000000, LL_PART_DEAD_MASK = 0x80000000, }; + enum + { + LL_PART_BF_ONE = 0, + LL_PART_BF_ZERO = 1, + LL_PART_BF_DEST_COLOR = 2, + LL_PART_BF_SOURCE_COLOR = 3, + LL_PART_BF_ONE_MINUS_DEST_COLOR = 4, + LL_PART_BF_ONE_MINUS_SOURCE_COLOR = 5, + UNSUPPORTED_DEST_ALPHA = 6, + LL_PART_BF_SOURCE_ALPHA = 7, + UNSUPPORTED_ONE_MINUS_DEST_ALPHA = 8, + LL_PART_BF_ONE_MINUS_SOURCE_ALPHA = 9, + LL_PART_BF_COUNT = 10 + }; + + static bool validBlendFunc(S32 func); + void setFlags(const U32 flags); void setMaxAge(const F32 max_age); void setStartScale(const F32 xs, F32 ys); @@ -126,6 +155,9 @@ public: friend class LLPartSysData; friend class LLViewerPartSourceScript; +private: + S32 getSize() const; + // These are public because I'm really lazy... public: U32 mFlags; // Particle state/interpolators in effect @@ -137,6 +169,12 @@ public: LLVector3 mPosOffset; // Offset from source if using FOLLOW_SOURCE F32 mParameter; // A single floating point parameter + + F32 mStartGlow; + F32 mEndGlow; + + U8 mBlendFuncSource; + U8 mBlendFuncDest; }; @@ -146,15 +184,13 @@ public: LLPartSysData(); BOOL unpack(LLDataPacker &dp); - BOOL pack(LLDataPacker &dp); - - + BOOL unpackLegacy(LLDataPacker &dp); BOOL unpackBlock(const S32 block_num); - BOOL packBlock(); - - static BOOL packNull(); + static BOOL isNullPS(const S32 block_num); // Returns FALSE if this is a "NULL" particle system (i.e. no system) + bool isLegacyCompatible() const; + // Different masks for effects on the source enum { @@ -187,7 +223,12 @@ public: void clampSourceParticleRate(); friend std::ostream& operator<<(std::ostream& s, const LLPartSysData &data); // Stream a + + S32 getdataBlockSize() const; +private: + BOOL unpackSystem(LLDataPacker &dp); + public: // Public because I'm lazy.... diff --git a/indra/llmessage/lltransfermanager.cpp b/indra/llmessage/lltransfermanager.cpp index 034680caf8..38b743fb75 100755 --- a/indra/llmessage/lltransfermanager.cpp +++ b/indra/llmessage/lltransfermanager.cpp @@ -606,16 +606,21 @@ void LLTransferManager::processTransferAbort(LLMessageSystem *msgp, void **) void LLTransferManager::reliablePacketCallback(void **user_data, S32 result) { LLUUID *transfer_idp = (LLUUID *)user_data; - if (result) + if (result && + transfer_idp != NULL) { - llwarns << "Aborting reliable transfer " << *transfer_idp << " due to failed reliable resends!" << llendl; LLTransferSource *tsp = gTransferManager.findTransferSource(*transfer_idp); if (tsp) { + llwarns << "Aborting reliable transfer " << *transfer_idp << " due to failed reliable resends!" << llendl; LLTransferSourceChannel *tscp = tsp->mChannelp; tsp->abortTransfer(); tscp->deleteTransfer(tsp); } + else + { + llwarns << "Aborting reliable transfer " << *transfer_idp << " but can't find the LLTransferSource object" << llendl; + } } delete transfer_idp; } @@ -892,22 +897,26 @@ LLTransferSource *LLTransferSourceChannel::findTransferSource(const LLUUID &tran } -BOOL LLTransferSourceChannel::deleteTransfer(LLTransferSource *tsp) +void LLTransferSourceChannel::deleteTransfer(LLTransferSource *tsp) { - - LLPriQueueMap<LLTransferSource *>::pqm_iter iter; - for (iter = mTransferSources.mMap.begin(); iter != mTransferSources.mMap.end(); iter++) + if (tsp) { - if (iter->second == tsp) + LLPriQueueMap<LLTransferSource *>::pqm_iter iter; + for (iter = mTransferSources.mMap.begin(); iter != mTransferSources.mMap.end(); iter++) { - delete tsp; - mTransferSources.mMap.erase(iter); - return TRUE; + if (iter->second == tsp) + { + delete tsp; + mTransferSources.mMap.erase(iter); + return; + } } - } - llerrs << "Unable to find transfer source to delete!" << llendl; - return FALSE; + llwarns << "Unable to find transfer source id " + << tsp->getID() + << " to delete!" + << llendl; + } } @@ -1008,21 +1017,26 @@ LLTransferTarget *LLTransferTargetChannel::findTransferTarget(const LLUUID &tran } -BOOL LLTransferTargetChannel::deleteTransfer(LLTransferTarget *ttp) +void LLTransferTargetChannel::deleteTransfer(LLTransferTarget *ttp) { - tt_iter iter; - for (iter = mTransferTargets.begin(); iter != mTransferTargets.end(); iter++) + if (ttp) { - if (*iter == ttp) + tt_iter iter; + for (iter = mTransferTargets.begin(); iter != mTransferTargets.end(); iter++) { - delete ttp; - mTransferTargets.erase(iter); - return TRUE; + if (*iter == ttp) + { + delete ttp; + mTransferTargets.erase(iter); + return; + } } - } - llerrs << "Unable to find transfer target to delete!" << llendl; - return FALSE; + llwarns << "Unable to find transfer target id " + << ttp->getID() + << " to delete!" + << llendl; + } } diff --git a/indra/llmessage/lltransfermanager.h b/indra/llmessage/lltransfermanager.h index 252e05d1d1..6aad153c24 100755 --- a/indra/llmessage/lltransfermanager.h +++ b/indra/llmessage/lltransfermanager.h @@ -199,7 +199,7 @@ public: void addTransferSource(LLTransferSource *sourcep); LLTransferSource *findTransferSource(const LLUUID &transfer_id); - BOOL deleteTransfer(LLTransferSource *tsp); + void deleteTransfer(LLTransferSource *tsp); void setThrottleID(const S32 throttle_id) { mThrottleID = throttle_id; } @@ -232,7 +232,7 @@ public: const F32 priority); LLTransferTarget *findTransferTarget(const LLUUID &transfer_id); - BOOL deleteTransfer(LLTransferTarget *ttp); + void deleteTransfer(LLTransferTarget *ttp); LLTransferChannelType getChannelType() const { return mChannelType; } diff --git a/indra/llmessage/tests/llpartdata_test.cpp b/indra/llmessage/tests/llpartdata_test.cpp index 9123bd06c7..de81e0bbb2 100755 --- a/indra/llmessage/tests/llpartdata_test.cpp +++ b/indra/llmessage/tests/llpartdata_test.cpp @@ -38,10 +38,34 @@ namespace tut { + + //bunch of sniffed data that *should* be a valid particle system + static U8 msg[] = { + 0x44, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x01, 0x00, 0x80, 0x00, 0x80, + 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x5e, 0x12, 0x0b, 0xa1, 0x58, 0x05, 0xdc, 0x57, 0x66, + 0xb7, 0xf5, 0xac, 0x4b, 0xd1, 0x8f, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x02, 0x05, 0x02, 0x00, 0x00, 0x0a, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x20, 0x20, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x7e, 0xc6, 0x81, 0xdc, 0x7e, 0xc6, 0x81, 0xdc, 0x77, 0xcf, 0xef, 0xd4, 0xce, 0x64, 0x1a, 0x7e, + 0x26, 0x87, 0x55, 0x7f, 0xdd, 0x65, 0x22, 0x7f, 0xdd, 0x65, 0x22, 0x7f, 0x77, 0xcf, 0x98, 0xa3, 0xab, + 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd1, 0xf2, + 0xf1, 0x65, 0x32, 0x1b, 0xef, 0x18, 0x70, 0x66, 0xba, 0x30, 0xa0, 0x11, 0xaa, 0x2f, 0xb0, 0xab, 0xd0, + 0x30, 0x7d, 0xbd, 0x01, 0x00, 0xf8, 0x0d, 0xb8, 0x30, 0x01, 0x00, 0x00, 0x00, 0xce, 0xc6, 0x81, 0xdc, + 0xce, 0xc6, 0x81, 0xdc, 0xc7, 0xcf, 0xef, 0xd4, 0x75, 0x65, 0x1a, 0x7f, 0x62, 0x6f, 0x55, 0x7f, 0x6d, + 0x65, 0x22, 0x7f, 0x6d, 0x65, 0x22, 0x7f, 0xc7, 0xcf, 0x98, 0xa3, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, + 0xab, 0xab, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xf2, 0xf1, 0x62, 0x12, 0x1b, 0xef, + 0x18, 0x7e, 0xbd, 0x01, 0x00, 0x16, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x7c, 0xac, 0x28, 0x03, 0x80, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x48, + 0xe0, 0xb9, 0x30, 0x03, 0xe1, 0xb9, 0x30, 0xbb, 0x00, 0x00, 0x00, 0x48, 0xe0, 0xb9, 0x30, 0x36, 0xd9, + 0x81, 0xdc, 0x36, 0xd9, 0x81, 0xdc, 0x3f, 0xd0, 0xef, 0xd4, 0xa5, 0x7a, 0x72, 0x7f, 0x26, 0x30, 0x55, + 0x7f, 0x95, 0x7a, 0x22, 0x7f, 0x95, 0x7a, 0x22, 0x7f, 0x3f, 0xd0, 0x98, 0xa3, 0xab, 0xab, 0xab, 0xab, + 0xab, 0xab, 0xab, 0xab, 0x00, 0x00, 0x00, 0x00, 0x00 }; struct partdata_test { }; + typedef test_group<partdata_test> partdata_test_t; typedef partdata_test_t::object partdata_test_object_t; tut::partdata_test_t tut_partdata_test("LLPartData"); @@ -49,168 +73,82 @@ namespace tut template<> template<> void partdata_test_object_t::test<1>() { - LLPartData llpdata,llpdata1; - U8 pkbuf[128]; - - llpdata.setFlags(LLPartData::LL_PART_INTERP_COLOR_MASK | LLPartData::LL_PART_INTERP_SCALE_MASK | - LLPartData::LL_PART_BOUNCE_MASK | LLPartData::LL_PART_WIND_MASK | LLPartData::LL_PART_FOLLOW_SRC_MASK | - LLPartData::LL_PART_FOLLOW_VELOCITY_MASK | LLPartData::LL_PART_TARGET_POS_MASK | LLPartData::LL_PART_TARGET_LINEAR_MASK | - LLPartData::LL_PART_EMISSIVE_MASK | LLPartData::LL_PART_BEAM_MASK | LLPartData::LL_PART_DEAD_MASK); - - llpdata.setMaxAge(29.3f); - - LLVector3 llvec1(1.0f, .5f, .25f); - llpdata.setStartColor(llvec1); - llpdata.setStartAlpha(.7f); - - LLVector3 llvec2(.2f, .3f, 1.0f); - llpdata.setEndColor(llvec2); - llpdata.setEndAlpha(1.0f); + LLPartSysData llpsysdata; + LLDataPackerBinaryBuffer dp1(msg, sizeof(msg)); - llpdata.setStartScale(3.23f, 4.0f); - llpdata.setEndScale(2.4678f, 1.0f); + ensure("LLPartSysData::unpack failed.", llpsysdata.unpack(dp1)); - LLDataPackerBinaryBuffer dp((U8*)pkbuf, 128); - llpdata.pack(dp); - S32 cur_size = dp.getCurrentSize(); - - LLDataPackerBinaryBuffer dp1((U8*)pkbuf, cur_size); - llpdata1.unpack(dp1); - - ensure("1.mFlags values are different after unpacking", llpdata1.mFlags == llpdata.mFlags); - ensure_approximately_equals("2.mMaxAge values are different after unpacking", llpdata1.mMaxAge, llpdata.mMaxAge, 8); - - ensure_approximately_equals("3.mStartColor[0] values are different after unpacking", llpdata1.mStartColor.mV[0], llpdata.mStartColor.mV[0], 8); - ensure_approximately_equals("4.mStartColor[1] values are different after unpacking", llpdata1.mStartColor.mV[1], llpdata.mStartColor.mV[1], 8); - ensure_approximately_equals("5.mStartColor[2] values are different after unpacking", llpdata1.mStartColor.mV[2], llpdata.mStartColor.mV[2], 8); - ensure_approximately_equals("6.mStartColor[3] values are different after unpacking", llpdata1.mStartColor.mV[3], llpdata.mStartColor.mV[3], 8); - - ensure_approximately_equals("7.mEndColor[0] values are different after unpacking", llpdata1.mEndColor.mV[0], llpdata.mEndColor.mV[0], 8); - ensure_approximately_equals("8.mEndColor[1] values are different after unpacking", llpdata1.mEndColor.mV[1], llpdata.mEndColor.mV[1], 8); - ensure_approximately_equals("9.mEndColor[2] values are different after unpacking", llpdata1.mEndColor.mV[2], llpdata.mEndColor.mV[2], 8); - ensure_approximately_equals("10.mEndColor[2] values are different after unpacking", llpdata1.mEndColor.mV[3], llpdata.mEndColor.mV[3], 8); - - ensure_approximately_equals("11.mStartScale[0] values are different after unpacking", llpdata1.mStartScale.mV[0], llpdata.mStartScale.mV[0], 5); - ensure_approximately_equals("12.mStartScale[1] values are different after unpacking", llpdata1.mStartScale.mV[1], llpdata.mStartScale.mV[1], 5); - - ensure_approximately_equals("13.mEndScale[0] values are different after unpacking", llpdata1.mEndScale.mV[0], llpdata.mEndScale.mV[0], 5); - ensure_approximately_equals("14.mEndScale[1] values are different after unpacking", llpdata1.mEndScale.mV[1], llpdata.mEndScale.mV[1], 5); - } - - - template<> template<> - void partdata_test_object_t::test<2>() - { - LLPartData llpdata,llpdata1; - - llpdata.setFlags(LLPartData::LL_PART_INTERP_COLOR_MASK | LLPartData::LL_PART_INTERP_SCALE_MASK | - LLPartData::LL_PART_BOUNCE_MASK | LLPartData::LL_PART_WIND_MASK | LLPartData::LL_PART_FOLLOW_SRC_MASK | - LLPartData::LL_PART_FOLLOW_VELOCITY_MASK | LLPartData::LL_PART_TARGET_POS_MASK | LLPartData::LL_PART_TARGET_LINEAR_MASK | - LLPartData::LL_PART_EMISSIVE_MASK | LLPartData::LL_PART_BEAM_MASK | LLPartData::LL_PART_DEAD_MASK); - - llpdata.setMaxAge(29.3f); - - LLVector3 llvec1(1.0f, .5f, .25f); - llpdata.setStartColor(llvec1); - llpdata.setStartAlpha(.7f); - - LLVector3 llvec2(.2f, .3f, 1.0f); - llpdata.setEndColor(llvec2); - llpdata.setEndAlpha(1.0f); - - llpdata.setStartScale(3.23f, 4.0f); - llpdata.setEndScale(2.4678f, 1.0f); - - LLSD llsd = llpdata.asLLSD(); - - llpdata1.fromLLSD(llsd); - - ensure("1.mFlags values are different after unpacking", llpdata1.mFlags == llpdata.mFlags); - ensure_approximately_equals("2.mMaxAge values are different after unpacking", llpdata1.mMaxAge, llpdata.mMaxAge, 8); - - ensure_approximately_equals("3.mStartColor[0] values are different after unpacking", llpdata1.mStartColor.mV[0], llpdata.mStartColor.mV[0], 8); - ensure_approximately_equals("4.mStartColor[1] values are different after unpacking", llpdata1.mStartColor.mV[1], llpdata.mStartColor.mV[1], 8); - ensure_approximately_equals("5.mStartColor[2] values are different after unpacking", llpdata1.mStartColor.mV[2], llpdata.mStartColor.mV[2], 8); - ensure_approximately_equals("6.mStartColor[3] values are different after unpacking", llpdata1.mStartColor.mV[3], llpdata.mStartColor.mV[3], 8); - - ensure_approximately_equals("7.mEndColor[0] values are different after unpacking", llpdata1.mEndColor.mV[0], llpdata.mEndColor.mV[0], 8); - ensure_approximately_equals("8.mEndColor[1] values are different after unpacking", llpdata1.mEndColor.mV[1], llpdata.mEndColor.mV[1], 8); - ensure_approximately_equals("9.mEndColor[2] values are different after unpacking", llpdata1.mEndColor.mV[2], llpdata.mEndColor.mV[2], 8); - ensure_approximately_equals("10.mEndColor[2] values are different after unpacking", llpdata1.mEndColor.mV[3], llpdata.mEndColor.mV[3], 8); - - ensure_approximately_equals("11.mStartScale[0] values are different after unpacking", llpdata1.mStartScale.mV[0], llpdata.mStartScale.mV[0], 5); - ensure_approximately_equals("12.mStartScale[1] values are different after unpacking", llpdata1.mStartScale.mV[1], llpdata.mStartScale.mV[1], 5); - - ensure_approximately_equals("13.mEndScale[0] values are different after unpacking", llpdata1.mEndScale.mV[0], llpdata.mEndScale.mV[0], 5); - ensure_approximately_equals("14.mEndScale[1] values are different after unpacking", llpdata1.mEndScale.mV[1], llpdata.mEndScale.mV[1], 5); - } - - -//*********llpartsysdata*********** - - template<> template<> - void partdata_test_object_t::test<3>() - { - LLPartSysData llpsysdata, llpsysdata1; - U8 pkbuf[256]; - llpsysdata.setBurstSpeedMin(33.33f); - ensure("1.mBurstSpeedMin coudnt be set", 33.33f == llpsysdata.mBurstSpeedMin); - - llpsysdata.setBurstSpeedMax(44.44f); - ensure("2.mBurstSpeedMax coudnt be set", 44.44f == llpsysdata.mBurstSpeedMax); - - llpsysdata.setBurstRadius(45.55f); - ensure("3.mBurstRadius coudnt be set", 45.55f == llpsysdata.mBurstRadius); - - LLVector3 llvec(44.44f, 111.11f, -40.4f); - llpsysdata.setPartAccel(llvec); - - llpsysdata.mCRC = 0xFFFFFFFF; - llpsysdata.mFlags = 0x20; - - llpsysdata.mPattern = LLPartSysData::LL_PART_SRC_PATTERN_ANGLE_CONE_EMPTY; - - llpsysdata.mMaxAge = 99.99f; - llpsysdata.mStartAge = 18.5f; - llpsysdata.mInnerAngle = 4.234f; - llpsysdata.mOuterAngle = 7.123f; - llpsysdata.mBurstRate = 245.53f; - llpsysdata.mBurstPartCount = 0xFF; - llpsysdata.mAngularVelocity = llvec; - - llpsysdata.mPartImageID.generate(); - llpsysdata.mTargetUUID.generate(); + //mCRC 1 unsigned int + ensure("mCRC different after unpacking", llpsysdata.mCRC == (U32) 1); + //mFlags 0 unsigned int + ensure ("mFlags different after unpacking", llpsysdata.mFlags == (U32) 0); + //mPattern 1 '' unsigned char + ensure ("mPattern different after unpacking", llpsysdata.mPattern == (U8) 1); + //mInnerAngle 0.00000000 float + ensure_approximately_equals("mInnerAngle different after unpacking", llpsysdata.mInnerAngle, 0.f, 8); + //mOuterAngle 0.00000000 float + ensure_approximately_equals("mOuterAngle different after unpacking", llpsysdata.mOuterAngle, 0.f, 8); + //mAngularVelocity 0,0,0 + ensure_approximately_equals("mAngularVelocity.mV[0] different after unpacking", llpsysdata.mAngularVelocity.mV[0], 0.f, 8); + ensure_approximately_equals("mAngularVelocity.mV[0] different after unpacking", llpsysdata.mAngularVelocity.mV[1], 0.f, 8); + ensure_approximately_equals("mAngularVelocity.mV[0] different after unpacking", llpsysdata.mAngularVelocity.mV[2], 0.f, 8); + //mBurstRate 0.097656250 float + ensure_approximately_equals("mBurstRate different after unpacking", llpsysdata.mBurstRate, 0.097656250f, 8); + //mBurstPartCount 1 '' unsigned char + ensure("mBurstPartCount different after unpacking", llpsysdata.mBurstPartCount == (U8) 1); + //mBurstRadius 0.00000000 float + ensure_approximately_equals("mBurstRadius different after unpacking", llpsysdata.mBurstRadius, 0.f, 8); + //mBurstSpeedMin 1.0000000 float + ensure_approximately_equals("mBurstSpeedMin different after unpacking", llpsysdata.mBurstSpeedMin, 1.f, 8); + //mBurstSpeedMax 1.0000000 float + ensure_approximately_equals("mBurstSpeedMax different after unpacking", llpsysdata.mBurstSpeedMax, 1.f, 8); + //mMaxAge 0.00000000 float + ensure_approximately_equals("mMaxAge different after unpacking", llpsysdata.mMaxAge, 0.f, 8); + //mStartAge 0.00000000 float + ensure_approximately_equals("mStartAge different after unpacking", llpsysdata.mStartAge, 0.f, 8); + //mPartAccel <0,0,0> + ensure_approximately_equals("mPartAccel.mV[0] different after unpacking", llpsysdata.mPartAccel.mV[0], 0.f, 7); + ensure_approximately_equals("mPartAccel.mV[1] different after unpacking", llpsysdata.mPartAccel.mV[1], 0.f, 7); + ensure_approximately_equals("mPartAccel.mV[2] different after unpacking", llpsysdata.mPartAccel.mV[2], 0.f, 7); + + //mPartData + LLPartData& data = llpsysdata.mPartData; + + //mFlags 132354 unsigned int + ensure ("mPartData.mFlags different after unpacking", data.mFlags == (U32) 132354); + //mMaxAge 10.000000 float + ensure_approximately_equals("mPartData.mMaxAge different after unpacking", data.mMaxAge, 10.f, 8); + //mStartColor <1,1,1,1> + ensure_approximately_equals("mPartData.mStartColor.mV[0] different after unpacking", data.mStartColor.mV[0], 1.f, 8); + ensure_approximately_equals("mPartData.mStartColor.mV[1] different after unpacking", data.mStartColor.mV[1], 1.f, 8); + ensure_approximately_equals("mPartData.mStartColor.mV[2] different after unpacking", data.mStartColor.mV[2], 1.f, 8); + ensure_approximately_equals("mPartData.mStartColor.mV[3] different after unpacking", data.mStartColor.mV[3], 1.f, 8); + //mEndColor <1,1,0,0> + ensure_approximately_equals("mPartData.mEndColor.mV[0] different after unpacking", data.mEndColor.mV[0], 1.f, 8); + ensure_approximately_equals("mPartData.mEndColor.mV[1] different after unpacking", data.mEndColor.mV[1], 1.f, 8); + ensure_approximately_equals("mPartData.mEndColor.mV[2] different after unpacking", data.mEndColor.mV[2], 0.f, 8); + ensure_approximately_equals("mPartData.mEndColor.mV[3] different after unpacking", data.mEndColor.mV[3], 0.f, 8); + //mStartScale <1,1> + ensure_approximately_equals("mPartData.mStartScale.mV[0] different after unpacking", data.mStartScale.mV[0], 1.f, 8); + ensure_approximately_equals("mPartData.mStartScale.mV[1] different after unpacking", data.mStartScale.mV[1], 1.f, 8); + //mEndScale <0,0> + ensure_approximately_equals("mPartData.mEndScale.mV[0] different after unpacking", data.mEndScale.mV[0], 0.f, 8); + ensure_approximately_equals("mPartData.mEndScale.mV[1] different after unpacking", data.mEndScale.mV[1], 0.f, 8); + //mPosOffset <0,0,0> + ensure_approximately_equals("mPartData.mPosOffset.mV[0] different after unpacking", data.mPosOffset.mV[0], 0.f, 8); + ensure_approximately_equals("mPartData.mPosOffset.mV[1] different after unpacking", data.mPosOffset.mV[1], 0.f, 8); + ensure_approximately_equals("mPartData.mPosOffset.mV[2] different after unpacking", data.mPosOffset.mV[2], 0.f, 8); + //mParameter 0.00000000 float + ensure_approximately_equals("mPartData.mParameter different after unpacking", data.mParameter, 0.f, 8); - LLDataPackerBinaryBuffer dp((U8*)pkbuf, 256); - llpsysdata.pack(dp); - S32 cur_size = dp.getCurrentSize(); - LLDataPackerBinaryBuffer dp1((U8*)pkbuf, cur_size); - llpsysdata1.unpack(dp1); - - ensure("1.mCRC's not equal", llpsysdata.mCRC == llpsysdata1.mCRC); - ensure("2.mFlags's not equal", llpsysdata.mFlags == llpsysdata1.mFlags); - ensure("3.mPattern's not equal", llpsysdata.mPattern == llpsysdata1.mPattern); - ensure_approximately_equals("4.mMaxAge's not equal", llpsysdata.mMaxAge , llpsysdata1.mMaxAge, 8); - ensure_approximately_equals("5.mStartAge's not equal", llpsysdata.mStartAge, llpsysdata1.mStartAge, 8); - ensure_approximately_equals("6.mOuterAngle's not equal", llpsysdata.mOuterAngle, llpsysdata1.mOuterAngle, 5); - ensure_approximately_equals("7.mInnerAngles's not equal", llpsysdata.mInnerAngle, llpsysdata1.mInnerAngle, 5); - ensure_approximately_equals("8.mBurstRate's not equal", llpsysdata.mBurstRate, llpsysdata1.mBurstRate, 8); - ensure("9.mBurstPartCount's not equal", llpsysdata.mBurstPartCount == llpsysdata1.mBurstPartCount); - - ensure_approximately_equals("10.mBurstSpeedMin's not equal", llpsysdata.mBurstSpeedMin, llpsysdata1.mBurstSpeedMin, 8); - ensure_approximately_equals("11.mBurstSpeedMax's not equal", llpsysdata.mBurstSpeedMax, llpsysdata1.mBurstSpeedMax, 8); - - ensure_approximately_equals("12.mAngularVelocity's not equal", llpsysdata.mAngularVelocity.mV[0], llpsysdata1.mAngularVelocity.mV[0], 7); - ensure_approximately_equals("13.mAngularVelocity's not equal", llpsysdata.mAngularVelocity.mV[1], llpsysdata1.mAngularVelocity.mV[1], 7); - ensure_approximately_equals("14.mAngularVelocity's not equal", llpsysdata.mAngularVelocity.mV[2], llpsysdata1.mAngularVelocity.mV[2], 7); - - ensure_approximately_equals("15.mPartAccel's not equal", llpsysdata.mPartAccel.mV[0], llpsysdata1.mPartAccel.mV[0], 7); - ensure_approximately_equals("16.mPartAccel's not equal", llpsysdata.mPartAccel.mV[1], llpsysdata1.mPartAccel.mV[1], 7); - ensure_approximately_equals("17.mPartAccel's not equal", llpsysdata.mPartAccel.mV[2], llpsysdata1.mPartAccel.mV[2], 7); - - ensure("18.mPartImageID's not equal", llpsysdata.mPartImageID == llpsysdata1.mPartImageID); - ensure("19.mTargetUUID's not equal", llpsysdata.mTargetUUID == llpsysdata1.mTargetUUID); - ensure_approximately_equals("20.mBurstRadius's not equal", llpsysdata.mBurstRadius, llpsysdata1.mBurstRadius, 8); + //mStartGlow 0.00000000 float + ensure_approximately_equals("mPartData.mStartGlow different after unpacking", data.mStartGlow, 0.f, 8); + //mEndGlow 0.00000000 float + ensure_approximately_equals("mPartData.mEndGlow different after unpacking", data.mEndGlow, 0.f, 8); + //mBlendFuncSource 2 '' unsigned char + ensure("mPartData.mBlendFuncSource different after unpacking", data.mBlendFuncSource == (U8) 2); + //mBlendFuncDest 1 '' unsigned char + ensure("mPartData.mBlendFuncDest different after unpacking", data.mBlendFuncDest == (U8) 1); } } diff --git a/indra/llplugin/slplugin/CMakeLists.txt b/indra/llplugin/slplugin/CMakeLists.txt index 03412d95d5..6e7fefeb21 100755 --- a/indra/llplugin/slplugin/CMakeLists.txt +++ b/indra/llplugin/slplugin/CMakeLists.txt @@ -50,10 +50,17 @@ add_executable(SLPlugin ${SLPlugin_SOURCE_FILES} ) +if (WINDOWS) +set_target_properties(SLPlugin + PROPERTIES + LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMTD\"" + ) +else () set_target_properties(SLPlugin PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/slplugin_info.plist ) +endif () target_link_libraries(SLPlugin ${LLPLUGIN_LIBRARIES} diff --git a/indra/llplugin/slplugin/slplugin-objc.mm b/indra/llplugin/slplugin/slplugin-objc.mm index a434739350..a5ab1d95c8 100755 --- a/indra/llplugin/slplugin/slplugin-objc.mm +++ b/indra/llplugin/slplugin/slplugin-objc.mm @@ -115,7 +115,7 @@ void LLCocoaPlugin::setupGroup() } -void LLCocoaPlugin::updateWindows() //SPATTERS give this a better name. +void LLCocoaPlugin::updateWindows() { // NSArray* window_list = [NSApp orderedWindows]; // NSWindow* current_window = [window_list objectAtIndex:0]; diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp index 28ed051c55..34e0483a83 100755 --- a/indra/llprimitive/llmodel.cpp +++ b/indra/llprimitive/llmodel.cpp @@ -166,6 +166,7 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector<LLVolumeFace>& fa if ( !get_dom_sources(inputs, pos_offset, tc_offset, norm_offset, idx_stride, pos_source, tc_source, norm_source) || !pos_source ) { + llwarns << "Could not find dom sources for basic geo data; invalid model." << llendl; return LLModel::BAD_ELEMENT; } @@ -186,27 +187,78 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector<LLVolumeFace>& fa LLVolumeFace::VertexMapData::PointMap point_map; - for (U32 i = 0; i < idx.getCount(); i += idx_stride) + U32 index_count = idx.getCount(); + U32 vertex_count = pos_source ? v.getCount() : 0; + U32 tc_count = tc_source ? tc.getCount() : 0; + U32 norm_count = norm_source ? n.getCount() : 0; + + for (U32 i = 0; i < index_count; i += idx_stride) { LLVolumeFace::VertexData cv; if (pos_source) { + // guard against model data specifiying out of range indices or verts + // + if (((i + pos_offset) > index_count) + || ((idx[i+pos_offset]*3+2) > vertex_count)) + { + llwarns << "Out of range index data; invalid model." << llendl; + return LLModel::BAD_ELEMENT; + } + cv.setPosition(LLVector4a(v[idx[i+pos_offset]*3+0], v[idx[i+pos_offset]*3+1], v[idx[i+pos_offset]*3+2])); + + if (!cv.getPosition().isFinite3()) + { + llwarns << "Nan positional data, invalid model." << llendl; + return LLModel::BAD_ELEMENT; + } } if (tc_source) { + // guard against model data specifiying out of range indices or tcs + // + + if (((i + tc_offset) > index_count) + || ((idx[i+tc_offset]*2+1) > tc_count)) + { + llwarns << "Out of range TC indices." << llendl; + return LLModel::BAD_ELEMENT; + } + cv.mTexCoord.setVec(tc[idx[i+tc_offset]*2+0], tc[idx[i+tc_offset]*2+1]); + + if (!cv.mTexCoord.isFinite()) + { + llwarns << "Found NaN while loading tex coords from DAE-Model, invalid model." << llendl; + return LLModel::BAD_ELEMENT; + } } if (norm_source) { + // guard against model data specifiying out of range indices or norms + // + if (((i + norm_offset) > index_count) + || ((idx[i+norm_offset]*3+2) > norm_count)) + { + llwarns << "Found out of range norm indices, invalid model." << llendl; + return LLModel::BAD_ELEMENT; + } + cv.setNormal(LLVector4a(n[idx[i+norm_offset]*3+0], n[idx[i+norm_offset]*3+1], n[idx[i+norm_offset]*3+2])); + + if (!cv.getNormal().isFinite3()) + { + llwarns << "Found NaN while loading normals from DAE-Model, invalid model." << llendl; + return LLModel::BAD_ELEMENT; + } } BOOL found = FALSE; @@ -261,13 +313,13 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector<LLVolumeFace>& fa LLVolumeFace& new_face = *face_list.rbegin(); if (!norm_source) { - ll_aligned_free_16(new_face.mNormals); + //ll_aligned_free_16(new_face.mNormals); new_face.mNormals = NULL; } if (!tc_source) { - ll_aligned_free_16(new_face.mTexCoords); + //ll_aligned_free_16(new_face.mTexCoords); new_face.mTexCoords = NULL; } @@ -292,13 +344,13 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector<LLVolumeFace>& fa LLVolumeFace& new_face = *face_list.rbegin(); if (!norm_source) { - ll_aligned_free_16(new_face.mNormals); + //ll_aligned_free_16(new_face.mNormals); new_face.mNormals = NULL; } if (!tc_source) { - ll_aligned_free_16(new_face.mTexCoords); + //ll_aligned_free_16(new_face.mTexCoords); new_face.mTexCoords = NULL; } } @@ -333,6 +385,7 @@ LLModel::EModelStatus load_face_from_dom_polylist(std::vector<LLVolumeFace>& fac if (!get_dom_sources(inputs, pos_offset, tc_offset, norm_offset, idx_stride, pos_source, tc_source, norm_source)) { + llwarns << "Could not get DOM sources for basic geo data, invalid model." << llendl; return LLModel::BAD_ELEMENT; } @@ -364,6 +417,11 @@ LLModel::EModelStatus load_face_from_dom_polylist(std::vector<LLVolumeFace>& fac LLVolumeFace::VertexMapData::PointMap point_map; + U32 index_count = idx.getCount(); + U32 vertex_count = pos_source ? v.getCount() : 0; + U32 tc_count = tc_source ? tc.getCount() : 0; + U32 norm_count = norm_source ? n.getCount() : 0; + U32 cur_idx = 0; for (U32 i = 0; i < vcount.getCount(); ++i) { //for each polygon @@ -376,22 +434,68 @@ LLModel::EModelStatus load_face_from_dom_polylist(std::vector<LLVolumeFace>& fac if (pos_source) { + // guard against model data specifiying out of range indices or verts + // + if (((cur_idx + pos_offset) > index_count) + || ((idx[cur_idx+pos_offset]*3+2) > vertex_count)) + { + llwarns << "Out of range position indices, invalid model." << llendl; + return LLModel::BAD_ELEMENT; + } + cv.getPosition().set(v[idx[cur_idx+pos_offset]*3+0], v[idx[cur_idx+pos_offset]*3+1], v[idx[cur_idx+pos_offset]*3+2]); + + if (!cv.getPosition().isFinite3()) + { + llwarns << "Found NaN while loading positions from DAE-Model, invalid model." << llendl; + return LLModel::BAD_ELEMENT; + } + } if (tc_source) { + // guard against model data specifiying out of range indices or tcs + // + if (((cur_idx + tc_offset) > index_count) + || ((idx[cur_idx+tc_offset]*2+1) > tc_count)) + { + llwarns << "Out of range TC indices, invalid model." << llendl; + return LLModel::BAD_ELEMENT; + } + cv.mTexCoord.setVec(tc[idx[cur_idx+tc_offset]*2+0], tc[idx[cur_idx+tc_offset]*2+1]); + + if (!cv.mTexCoord.isFinite()) + { + llwarns << "Found NaN while loading tex coords from DAE-Model, invalid model." << llendl; + return LLModel::BAD_ELEMENT; + } } if (norm_source) { + // guard against model data specifiying out of range indices or norms + // + if (((cur_idx + norm_offset) > index_count) + || ((idx[cur_idx+norm_offset]*3+2) > norm_count)) + { + llwarns << "Out of range norm indices, invalid model." << llendl; + return LLModel::BAD_ELEMENT; + } + cv.getNormal().set(n[idx[cur_idx+norm_offset]*3+0], n[idx[cur_idx+norm_offset]*3+1], n[idx[cur_idx+norm_offset]*3+2]); + + if (!cv.getNormal().isFinite3()) + { + llwarns << "Found NaN while loading normals from DAE-Model, invalid model." << llendl; + return LLModel::BAD_ELEMENT; + } } cur_idx += idx_stride; @@ -480,13 +584,13 @@ LLModel::EModelStatus load_face_from_dom_polylist(std::vector<LLVolumeFace>& fac LLVolumeFace& new_face = *face_list.rbegin(); if (!norm_source) { - ll_aligned_free_16(new_face.mNormals); + //ll_aligned_free_16(new_face.mNormals); new_face.mNormals = NULL; } if (!tc_source) { - ll_aligned_free_16(new_face.mTexCoords); + //ll_aligned_free_16(new_face.mTexCoords); new_face.mTexCoords = NULL; } @@ -514,13 +618,13 @@ LLModel::EModelStatus load_face_from_dom_polylist(std::vector<LLVolumeFace>& fac LLVolumeFace& new_face = *face_list.rbegin(); if (!norm_source) { - ll_aligned_free_16(new_face.mNormals); + //ll_aligned_free_16(new_face.mNormals); new_face.mNormals = NULL; } if (!tc_source) { - ll_aligned_free_16(new_face.mTexCoords); + //ll_aligned_free_16(new_face.mTexCoords); new_face.mTexCoords = NULL; } } @@ -558,6 +662,7 @@ LLModel::EModelStatus load_face_from_dom_polygons(std::vector<LLVolumeFace>& fac domVertices* vertices = (domVertices*) elem.cast(); if (!vertices) { + llwarns << "Could not find vertex source, invalid model." << llendl; return LLModel::BAD_ELEMENT; } domInputLocal_Array& v_inp = vertices->getInput_array(); @@ -571,6 +676,7 @@ LLModel::EModelStatus load_face_from_dom_polygons(std::vector<LLVolumeFace>& fac domSource* src = (domSource*) elem.cast(); if (!src) { + llwarns << "Could not find DOM source, invalid model." << llendl; return LLModel::BAD_ELEMENT; } v = &(src->getFloat_array()->getValue()); @@ -586,6 +692,7 @@ LLModel::EModelStatus load_face_from_dom_polygons(std::vector<LLVolumeFace>& fac domSource* src = (domSource*) elem.cast(); if (!src) { + llwarns << "Could not find DOM source, invalid model." << llendl; return LLModel::BAD_ELEMENT; } n = &(src->getFloat_array()->getValue()); @@ -598,6 +705,7 @@ LLModel::EModelStatus load_face_from_dom_polygons(std::vector<LLVolumeFace>& fac domSource* src = (domSource*) elem.cast(); if (!src) { + llwarns << "Could not find DOM source, invalid model." << llendl; return LLModel::BAD_ELEMENT; } t = &(src->getFloat_array()->getValue()); @@ -628,25 +736,59 @@ LLModel::EModelStatus load_face_from_dom_polygons(std::vector<LLVolumeFace>& fac if (v) { U32 v_idx = idx[j*stride+v_offset]*3; + v_idx = llclamp(v_idx, (U32) 0, (U32) v->getCount()); vert.getPosition().set(v->get(v_idx), v->get(v_idx+1), v->get(v_idx+2)); + + if (!vert.getPosition().isFinite3()) + { + llwarns << "Found NaN while loading position data from DAE-Model, invalid model." << llendl; + return LLModel::BAD_ELEMENT; + } } - if (n) + //bounds check n and t lookups because some FBX to DAE converters + //use negative indices and empty arrays to indicate data does not exist + //for a particular channel + if (n && n->getCount() > 0) { U32 n_idx = idx[j*stride+n_offset]*3; + n_idx = llclamp(n_idx, (U32) 0, (U32) n->getCount()); vert.getNormal().set(n->get(n_idx), n->get(n_idx+1), n->get(n_idx+2)); + + if (!vert.getNormal().isFinite3()) + { + llwarns << "Found NaN while loading normals from DAE-Model, invalid model." << llendl; + return LLModel::BAD_ELEMENT; + } + } + else + { + vert.getNormal().clear(); } + - if (t) + if (t && t->getCount() > 0) { U32 t_idx = idx[j*stride+t_offset]*2; + t_idx = llclamp(t_idx, (U32) 0, (U32) t->getCount()); vert.mTexCoord.setVec(t->get(t_idx), t->get(t_idx+1)); + + if (!vert.mTexCoord.isFinite()) + { + llwarns << "Found NaN while loading tex coords from DAE-Model, invalid model." << llendl; + return LLModel::BAD_ELEMENT; + } } + else + { + vert.mTexCoord.clear(); + } + verts.push_back(vert); } @@ -714,13 +856,13 @@ LLModel::EModelStatus load_face_from_dom_polygons(std::vector<LLVolumeFace>& fac LLVolumeFace& new_face = *face_list.rbegin(); if (!n) { - ll_aligned_free_16(new_face.mNormals); + //ll_aligned_free_16(new_face.mNormals); new_face.mNormals = NULL; } if (!t) { - ll_aligned_free_16(new_face.mTexCoords); + //ll_aligned_free_16(new_face.mTexCoords); new_face.mTexCoords = NULL; } } @@ -994,6 +1136,43 @@ void LLModel::getNormalizedScaleTranslation(LLVector3& scale_out, LLVector3& tra translation_out = mNormalizedTranslation; } +LLVector3 LLModel::getTransformedCenter(const LLMatrix4& mat) +{ + LLVector3 ret; + + if (!mVolumeFaces.empty()) + { + LLMatrix4a m; + m.loadu(mat); + + LLVector4a minv,maxv; + + LLVector4a t; + m.affineTransform(mVolumeFaces[0].mPositions[0], t); + minv = maxv = t; + + for (S32 i = 0; i < mVolumeFaces.size(); ++i) + { + LLVolumeFace& face = mVolumeFaces[i]; + + for (U32 j = 0; j < face.mNumVertices; ++j) + { + m.affineTransform(face.mPositions[j],t); + update_min_max(minv, maxv, t); + } + } + + minv.add(maxv); + minv.mul(0.5f); + + ret.set(minv.getF32ptr()); + } + + return ret; +} + + + void LLModel::setNumVolumeFaces(S32 count) { mVolumeFaces.resize(count); @@ -1020,7 +1199,7 @@ void LLModel::setVolumeFaceData( } else { - ll_aligned_free_16(face.mNormals); + //ll_aligned_free_16(face.mNormals); face.mNormals = NULL; } @@ -1031,7 +1210,7 @@ void LLModel::setVolumeFaceData( } else { - ll_aligned_free_16(face.mTexCoords); + //ll_aligned_free_16(face.mTexCoords); face.mTexCoords = NULL; } @@ -1230,7 +1409,7 @@ void LLModel::generateNormals(F32 angle_cutoff) } else { - ll_aligned_free_16(new_face.mTexCoords); + //ll_aligned_free_16(new_face.mTexCoords); new_face.mTexCoords = NULL; } diff --git a/indra/llprimitive/llmodel.h b/indra/llprimitive/llmodel.h index 1cf528fd9f..aaafc55258 100755 --- a/indra/llprimitive/llmodel.h +++ b/indra/llprimitive/llmodel.h @@ -173,13 +173,15 @@ public: void optimizeVolumeFaces(); void offsetMesh( const LLVector3& pivotPoint ); void getNormalizedScaleTranslation(LLVector3& scale_out, LLVector3& translation_out); - + LLVector3 getTransformedCenter(const LLMatrix4& mat); + //reorder face list based on mMaterialList in this and reference so //order matches that of reference (material ordering touchup) bool matchMaterialOrder(LLModel* ref, int& refFaceCnt, int& modelFaceCnt ); bool isMaterialListSubset( LLModel* ref ); bool needToAddFaces( LLModel* ref, int& refFaceCnt, int& modelFaceCnt ); + std::vector<std::string> mMaterialList; //data used for skin weights diff --git a/indra/llprimitive/lltextureentry.cpp b/indra/llprimitive/lltextureentry.cpp index 597f078490..0db75a0e82 100755 --- a/indra/llprimitive/lltextureentry.cpp +++ b/indra/llprimitive/lltextureentry.cpp @@ -545,7 +545,7 @@ S32 LLTextureEntry::setMaterialID(const LLMaterialID& pMaterialID) { mMaterialUpdatePending = true; mMaterialID = pMaterialID; - return TEM_CHANGE_NONE; + return TEM_CHANGE_TEXTURE; } mMaterialUpdatePending = false; diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 088ba95b75..acfb3c085a 100755 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -59,6 +59,7 @@ BOOL gDebugGL = FALSE; BOOL gClothRipple = FALSE; BOOL gHeadlessClient = FALSE; BOOL gGLActive = FALSE; +BOOL gGLDebugLoggingEnabled = TRUE; static const std::string HEADLESS_VENDOR_STRING("Linden Lab"); static const std::string HEADLESS_RENDERER_STRING("Headless"); @@ -80,6 +81,8 @@ void APIENTRY gl_debug_callback(GLenum source, const GLchar* message, GLvoid* userParam) { + if (gGLDebugLoggingEnabled) + { if (severity == GL_DEBUG_SEVERITY_HIGH_ARB) { llwarns << "----- GL ERROR --------" << llendl; @@ -98,6 +101,7 @@ void APIENTRY gl_debug_callback(GLenum source, llerrs << "Halting on GL Error" << llendl; } } +} #endif void parse_glsl_version(S32& major, S32& minor); @@ -258,6 +262,7 @@ PFNGLBEGINTRANSFORMFEEDBACKPROC glBeginTransformFeedback = NULL; PFNGLENDTRANSFORMFEEDBACKPROC glEndTransformFeedback = NULL; PFNGLTRANSFORMFEEDBACKVARYINGSPROC glTransformFeedbackVaryings = NULL; PFNGLBINDBUFFERRANGEPROC glBindBufferRange = NULL; +PFNGLBINDBUFFERBASEPROC glBindBufferBase = NULL; //GL_ARB_debug_output PFNGLDEBUGMESSAGECONTROLARBPROC glDebugMessageControlARB = NULL; @@ -647,7 +652,8 @@ bool LLGLManager::initGL() } #if LL_DARWIN else if ((mGLRenderer.find("9400M") != std::string::npos) - || (mGLRenderer.find("9600M") != std::string::npos)) + || (mGLRenderer.find("9600M") != std::string::npos) + || (mGLRenderer.find("9800M") != std::string::npos)) { mIsMobileGF = TRUE; } @@ -1154,7 +1160,8 @@ void LLGLManager::initExtensions() // Misc glGetIntegerv(GL_MAX_ELEMENTS_VERTICES, (GLint*) &mGLMaxVertexRange); glGetIntegerv(GL_MAX_ELEMENTS_INDICES, (GLint*) &mGLMaxIndexRange); - + glGetIntegerv(GL_MAX_TEXTURE_SIZE, (GLint*) &mGLMaxTextureSize); + #if (LL_WINDOWS || LL_LINUX || LL_SOLARIS) && !LL_MESA_HEADLESS LL_DEBUGS("RenderInit") << "GL Probe: Getting symbols" << LL_ENDL; if (mHasVertexBufferObject) @@ -1245,6 +1252,7 @@ void LLGLManager::initExtensions() glEndTransformFeedback = (PFNGLENDTRANSFORMFEEDBACKPROC) GLH_EXT_GET_PROC_ADDRESS("glEndTransformFeedback"); glTransformFeedbackVaryings = (PFNGLTRANSFORMFEEDBACKVARYINGSPROC) GLH_EXT_GET_PROC_ADDRESS("glTransformFeedbackVaryings"); glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC) GLH_EXT_GET_PROC_ADDRESS("glBindBufferRange"); + glBindBufferBase = (PFNGLBINDBUFFERBASEPROC) GLH_EXT_GET_PROC_ADDRESS("glBindBufferBase"); } if (mHasDebugOutput) { @@ -1499,7 +1507,7 @@ void do_assert_glerror() void assert_glerror() { - if (!gGLActive) +/* if (!gGLActive) { //llwarns << "GL used while not active!" << llendl; @@ -1508,8 +1516,13 @@ void assert_glerror() //ll_fail("GL used while not active"); } } +*/ - if (gDebugGL) + if (!gDebugGL) + { + //funny looking if for branch prediction -- gDebugGL is almost always false and assert_glerror is called often + } + else { do_assert_glerror(); } diff --git a/indra/llrender/llgl.h b/indra/llrender/llgl.h index 60597fd090..75e5fe86ec 100755 --- a/indra/llrender/llgl.h +++ b/indra/llrender/llgl.h @@ -155,6 +155,7 @@ public: S32 mVRAM; // VRAM in MB S32 mGLMaxVertexRange; S32 mGLMaxIndexRange; + S32 mGLMaxTextureSize; void getPixelFormat(); // Get the best pixel format diff --git a/indra/llrender/llglheaders.h b/indra/llrender/llglheaders.h index dace572953..5a80a8faa4 100755 --- a/indra/llrender/llglheaders.h +++ b/indra/llrender/llglheaders.h @@ -543,6 +543,7 @@ extern PFNGLBEGINTRANSFORMFEEDBACKPROC glBeginTransformFeedback; extern PFNGLENDTRANSFORMFEEDBACKPROC glEndTransformFeedback; extern PFNGLTRANSFORMFEEDBACKVARYINGSPROC glTransformFeedbackVaryings; extern PFNGLBINDBUFFERRANGEPROC glBindBufferRange; +extern PFNGLBINDBUFFERBASEPROC glBindBufferBase; #elif LL_WINDOWS @@ -787,6 +788,7 @@ extern PFNGLBEGINTRANSFORMFEEDBACKPROC glBeginTransformFeedback; extern PFNGLENDTRANSFORMFEEDBACKPROC glEndTransformFeedback; extern PFNGLTRANSFORMFEEDBACKVARYINGSPROC glTransformFeedbackVaryings; extern PFNGLBINDBUFFERRANGEPROC glBindBufferRange; +extern PFNGLBINDBUFFERBASEPROC glBindBufferBase; //GL_ARB_debug_output extern PFNGLDEBUGMESSAGECONTROLARBPROC glDebugMessageControlARB; @@ -1009,12 +1011,7 @@ extern void glGetBufferPointervARB (GLenum, GLenum, GLvoid* *); } #endif -#if __MAC_OS_X_VERSION_MAX_ALLOWED <= 1070 #include <OpenGL/gl.h> -#else -#include <AGL/gl.h> -#endif - #endif // LL_MESA / LL_WINDOWS / LL_DARWIN diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index 62191b4c1a..35620bb656 100755 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -149,6 +149,9 @@ void LLGLSLShader::clearStats() mTimeElapsed = 0; mSamplesDrawn = 0; mDrawCalls = 0; + mTextureStateFetched = false; + mTextureMagFilter.clear(); + mTextureMinFilter.clear(); } void LLGLSLShader::dumpStats() @@ -161,6 +164,16 @@ void LLGLSLShader::dumpStats() { llinfos << mShaderFiles[i].first << llendl; } + for (U32 i = 0; i < mTexture.size(); ++i) + { + GLint idx = mTexture[i]; + + if (idx >= 0) + { + GLint uniform_idx = getUniformLocation(i); + llinfos << mUniformNameMap[uniform_idx] << " - " << std::hex << mTextureMagFilter[i] << "/" << mTextureMinFilter[i] << std::dec << llendl; + } + } llinfos << "=============================================" << llendl; F32 ms = mTimeElapsed/1000000.f; @@ -211,6 +224,39 @@ void LLGLSLShader::placeProfileQuery() glGenQueriesARB(1, &mTimerQuery); } + if (!mTextureStateFetched) + { + mTextureStateFetched = true; + mTextureMagFilter.resize(mTexture.size()); + mTextureMinFilter.resize(mTexture.size()); + + U32 cur_active = gGL.getCurrentTexUnitIndex(); + + for (U32 i = 0; i < mTexture.size(); ++i) + { + GLint idx = mTexture[i]; + + if (idx >= 0) + { + gGL.getTexUnit(idx)->activate(); + + U32 mag = 0xFFFFFFFF; + U32 min = 0xFFFFFFFF; + + U32 type = LLTexUnit::getInternalType(gGL.getTexUnit(idx)->getCurrType()); + + glGetTexParameteriv(type, GL_TEXTURE_MAG_FILTER, (GLint*) &mag); + glGetTexParameteriv(type, GL_TEXTURE_MIN_FILTER, (GLint*) &min); + + mTextureMagFilter[i] = mag; + mTextureMinFilter[i] = min; + } + } + + gGL.getTexUnit(cur_active)->activate(); + } + + glBeginQueryARB(GL_SAMPLES_PASSED, 1); glBeginQueryARB(GL_TIME_ELAPSED, mTimerQuery); #endif @@ -309,8 +355,8 @@ void LLGLSLShader::unload() stop_glerror(); } -BOOL LLGLSLShader::createShader(vector<string> * attributes, - vector<string> * uniforms, +BOOL LLGLSLShader::createShader(std::vector<LLStaticHashedString> * attributes, + std::vector<LLStaticHashedString> * uniforms, U32 varying_count, const char** varyings) { @@ -329,6 +375,11 @@ BOOL LLGLSLShader::createShader(vector<string> * attributes, // Create program mProgramObject = glCreateProgramObjectARB(); +#if LL_DARWIN + // work-around missing mix(vec3,vec3,bvec3) + mDefines["OLD_SELECT"] = "1"; +#endif + //compile new source vector< pair<string,GLenum> >::iterator fileIter = mShaderFiles.begin(); for ( ; fileIter != mShaderFiles.end(); fileIter++ ) @@ -392,7 +443,8 @@ BOOL LLGLSLShader::createShader(vector<string> * attributes, for (S32 i = 0; i < channel_count; i++) { - uniform1i(llformat("tex%d", i), i); + LLStaticHashedString uniName(llformat("tex%d", i)); + uniform1i(uniName, i); } S32 cur_tex = channel_count; //adjust any texture channels that might have been overwritten @@ -449,7 +501,7 @@ void LLGLSLShader::attachObjects(GLhandleARB* objects, S32 count) } } -BOOL LLGLSLShader::mapAttributes(const vector<string> * attributes) +BOOL LLGLSLShader::mapAttributes(const std::vector<LLStaticHashedString> * attributes) { //before linking, make sure reserved attributes always have consistent locations for (U32 i = 0; i < LLShaderMgr::instance()->mReservedAttribs.size(); i++) @@ -486,7 +538,7 @@ BOOL LLGLSLShader::mapAttributes(const vector<string> * attributes) { for (U32 i = 0; i < numAttributes; i++) { - const char* name = (*attributes)[i].c_str(); + const char* name = (*attributes)[i].String().c_str(); S32 index = glGetAttribLocationARB(mProgramObject, name); if (index != -1) { @@ -502,7 +554,7 @@ BOOL LLGLSLShader::mapAttributes(const vector<string> * attributes) return FALSE; } -void LLGLSLShader::mapUniform(GLint index, const vector<string> * uniforms) +void LLGLSLShader::mapUniform(GLint index, const vector<LLStaticHashedString> * uniforms) { if (index == -1) { @@ -572,7 +624,10 @@ void LLGLSLShader::mapUniform(GLint index, const vector<string> * uniforms) is_array[0] = 0; } - mUniformMap[name] = location; + LLStaticHashedString hashedName(name); + mUniformNameMap[location] = name; + mUniformMap[hashedName] = location; + LL_DEBUGS("ShaderLoading") << "Uniform " << name << " is at location " << location << LL_ENDL; //find the index of this uniform @@ -593,7 +648,7 @@ void LLGLSLShader::mapUniform(GLint index, const vector<string> * uniforms) for (U32 i = 0; i < uniforms->size(); i++) { if ( (mUniform[i+LLShaderMgr::instance()->mReservedUniforms.size()] == -1) - && ((*uniforms)[i] == name)) + && ((*uniforms)[i].String() == name)) { //found it mUniform[i+LLShaderMgr::instance()->mReservedUniforms.size()] = location; @@ -627,7 +682,7 @@ GLint LLGLSLShader::mapUniformTextureChannel(GLint location, GLenum type) return -1; } -BOOL LLGLSLShader::mapUniforms(const vector<string> * uniforms) +BOOL LLGLSLShader::mapUniforms(const vector<LLStaticHashedString> * uniforms) { BOOL res = TRUE; @@ -635,6 +690,7 @@ BOOL LLGLSLShader::mapUniforms(const vector<string> * uniforms) mActiveTextureChannels = 0; mUniform.clear(); mUniformMap.clear(); + mUniformNameMap.clear(); mTexture.clear(); mValue.clear(); //initialize arrays @@ -1088,18 +1144,18 @@ void LLGLSLShader::uniformMatrix4fv(U32 index, U32 count, GLboolean transpose, c } } -GLint LLGLSLShader::getUniformLocation(const string& uniform) +GLint LLGLSLShader::getUniformLocation(const LLStaticHashedString& uniform) { GLint ret = -1; if (mProgramObject > 0) { - std::map<string, GLint>::iterator iter = mUniformMap.find(uniform); + LLStaticStringTable<GLint>::iterator iter = mUniformMap.find(uniform); if (iter != mUniformMap.end()) { if (gDebugGL) { stop_glerror(); - if (iter->second != glGetUniformLocationARB(mProgramObject, uniform.c_str())) + if (iter->second != glGetUniformLocationARB(mProgramObject, uniform.String().c_str())) { llerrs << "Uniform does not match." << llendl; } @@ -1136,7 +1192,7 @@ GLint LLGLSLShader::getAttribLocation(U32 attrib) } } -void LLGLSLShader::uniform1i(const string& uniform, GLint v) +void LLGLSLShader::uniform1i(const LLStaticHashedString& uniform, GLint v) { GLint location = getUniformLocation(uniform); @@ -1152,72 +1208,73 @@ void LLGLSLShader::uniform1i(const string& uniform, GLint v) } } -void LLGLSLShader::uniform1f(const string& uniform, GLfloat v) +void LLGLSLShader::uniform2i(const LLStaticHashedString& uniform, GLint i, GLint j) { GLint location = getUniformLocation(uniform); if (location >= 0) { std::map<GLint, LLVector4>::iterator iter = mValue.find(location); - LLVector4 vec(v,0.f,0.f,0.f); + LLVector4 vec(i,j,0.f,0.f); if (iter == mValue.end() || shouldChange(iter->second,vec)) { - glUniform1fARB(location, v); + glUniform2iARB(location, i, j); mValue[location] = vec; } } } -void LLGLSLShader::uniform2f(const string& uniform, GLfloat x, GLfloat y) + +void LLGLSLShader::uniform1f(const LLStaticHashedString& uniform, GLfloat v) { GLint location = getUniformLocation(uniform); if (location >= 0) { std::map<GLint, LLVector4>::iterator iter = mValue.find(location); - LLVector4 vec(x,y,0.f,0.f); + LLVector4 vec(v,0.f,0.f,0.f); if (iter == mValue.end() || shouldChange(iter->second,vec)) { - glUniform2fARB(location, x,y); + glUniform1fARB(location, v); mValue[location] = vec; } } - } -void LLGLSLShader::uniform3f(const string& uniform, GLfloat x, GLfloat y, GLfloat z) +void LLGLSLShader::uniform2f(const LLStaticHashedString& uniform, GLfloat x, GLfloat y) { GLint location = getUniformLocation(uniform); if (location >= 0) { std::map<GLint, LLVector4>::iterator iter = mValue.find(location); - LLVector4 vec(x,y,z,0.f); + LLVector4 vec(x,y,0.f,0.f); if (iter == mValue.end() || shouldChange(iter->second,vec)) { - glUniform3fARB(location, x,y,z); + glUniform2fARB(location, x,y); mValue[location] = vec; } } + } -void LLGLSLShader::uniform4f(const string& uniform, GLfloat x, GLfloat y, GLfloat z, GLfloat w) +void LLGLSLShader::uniform3f(const LLStaticHashedString& uniform, GLfloat x, GLfloat y, GLfloat z) { GLint location = getUniformLocation(uniform); - + if (location >= 0) { std::map<GLint, LLVector4>::iterator iter = mValue.find(location); - LLVector4 vec(x,y,z,w); + LLVector4 vec(x,y,z,0.f); if (iter == mValue.end() || shouldChange(iter->second,vec)) { - glUniform4fARB(location, x,y,z,w); + glUniform3fARB(location, x,y,z); mValue[location] = vec; } } } -void LLGLSLShader::uniform1fv(const string& uniform, U32 count, const GLfloat* v) +void LLGLSLShader::uniform1fv(const LLStaticHashedString& uniform, U32 count, const GLfloat* v) { GLint location = getUniformLocation(uniform); @@ -1233,7 +1290,7 @@ void LLGLSLShader::uniform1fv(const string& uniform, U32 count, const GLfloat* v } } -void LLGLSLShader::uniform2fv(const string& uniform, U32 count, const GLfloat* v) +void LLGLSLShader::uniform2fv(const LLStaticHashedString& uniform, U32 count, const GLfloat* v) { GLint location = getUniformLocation(uniform); @@ -1249,7 +1306,7 @@ void LLGLSLShader::uniform2fv(const string& uniform, U32 count, const GLfloat* v } } -void LLGLSLShader::uniform3fv(const string& uniform, U32 count, const GLfloat* v) +void LLGLSLShader::uniform3fv(const LLStaticHashedString& uniform, U32 count, const GLfloat* v) { GLint location = getUniformLocation(uniform); @@ -1265,7 +1322,7 @@ void LLGLSLShader::uniform3fv(const string& uniform, U32 count, const GLfloat* v } } -void LLGLSLShader::uniform4fv(const string& uniform, U32 count, const GLfloat* v) +void LLGLSLShader::uniform4fv(const LLStaticHashedString& uniform, U32 count, const GLfloat* v) { GLint location = getUniformLocation(uniform); @@ -1283,27 +1340,7 @@ void LLGLSLShader::uniform4fv(const string& uniform, U32 count, const GLfloat* v } } -void LLGLSLShader::uniformMatrix2fv(const string& uniform, U32 count, GLboolean transpose, const GLfloat* v) -{ - GLint location = getUniformLocation(uniform); - - if (location >= 0) - { - glUniformMatrix2fvARB(location, count, transpose, v); - } -} - -void LLGLSLShader::uniformMatrix3fv(const string& uniform, U32 count, GLboolean transpose, const GLfloat* v) -{ - GLint location = getUniformLocation(uniform); - - if (location >= 0) - { - glUniformMatrix3fvARB(location, count, transpose, v); - } -} - -void LLGLSLShader::uniformMatrix4fv(const string& uniform, U32 count, GLboolean transpose, const GLfloat* v) +void LLGLSLShader::uniformMatrix4fv(const LLStaticHashedString& uniform, U32 count, GLboolean transpose, const GLfloat* v) { GLint location = getUniformLocation(uniform); diff --git a/indra/llrender/llglslshader.h b/indra/llrender/llglslshader.h index 3c775cde27..7b2f5f04c2 100755 --- a/indra/llrender/llglslshader.h +++ b/indra/llrender/llglslshader.h @@ -29,6 +29,7 @@ #include "llgl.h" #include "llrender.h" +#include "llstaticstringtable.h" class LLShaderFeatures { @@ -90,16 +91,16 @@ public: void placeProfileQuery(); void readProfileQuery(U32 count, U32 mode); - BOOL createShader(std::vector<std::string> * attributes, - std::vector<std::string> * uniforms, + BOOL createShader(std::vector<LLStaticHashedString> * attributes, + std::vector<LLStaticHashedString> * uniforms, U32 varying_count = 0, const char** varyings = NULL); BOOL attachObject(std::string object); void attachObject(GLhandleARB object); void attachObjects(GLhandleARB* objects = NULL, S32 count = 0); - BOOL mapAttributes(const std::vector<std::string> * attributes); - BOOL mapUniforms(const std::vector<std::string> * uniforms); - void mapUniform(GLint index, const std::vector<std::string> * uniforms); + BOOL mapAttributes(const std::vector<LLStaticHashedString> * attributes); + BOOL mapUniforms(const std::vector<LLStaticHashedString> *); + void mapUniform(GLint index, const std::vector<LLStaticHashedString> *); void uniform1i(U32 index, GLint i); void uniform1f(U32 index, GLfloat v); void uniform2f(U32 index, GLfloat x, GLfloat y); @@ -110,29 +111,27 @@ public: void uniform2fv(U32 index, U32 count, const GLfloat* v); void uniform3fv(U32 index, U32 count, const GLfloat* v); void uniform4fv(U32 index, U32 count, const GLfloat* v); - void uniform1i(const std::string& uniform, GLint i); - void uniform1f(const std::string& uniform, GLfloat v); - void uniform2f(const std::string& uniform, GLfloat x, GLfloat y); - void uniform3f(const std::string& uniform, GLfloat x, GLfloat y, GLfloat z); - void uniform4f(const std::string& uniform, GLfloat x, GLfloat y, GLfloat z, GLfloat w); - void uniform1iv(const std::string& uniform, U32 count, const GLint* i); - void uniform1fv(const std::string& uniform, U32 count, const GLfloat* v); - void uniform2fv(const std::string& uniform, U32 count, const GLfloat* v); - void uniform3fv(const std::string& uniform, U32 count, const GLfloat* v); - void uniform4fv(const std::string& uniform, U32 count, const GLfloat* v); + void uniform2i(const LLStaticHashedString& uniform, GLint i, GLint j); void uniformMatrix2fv(U32 index, U32 count, GLboolean transpose, const GLfloat *v); void uniformMatrix3fv(U32 index, U32 count, GLboolean transpose, const GLfloat *v); void uniformMatrix4fv(U32 index, U32 count, GLboolean transpose, const GLfloat *v); - void uniformMatrix2fv(const std::string& uniform, U32 count, GLboolean transpose, const GLfloat *v); - void uniformMatrix3fv(const std::string& uniform, U32 count, GLboolean transpose, const GLfloat *v); - void uniformMatrix4fv(const std::string& uniform, U32 count, GLboolean transpose, const GLfloat *v); + void uniform1i(const LLStaticHashedString& uniform, GLint i); + void uniform1f(const LLStaticHashedString& uniform, GLfloat v); + void uniform2f(const LLStaticHashedString& uniform, GLfloat x, GLfloat y); + void uniform3f(const LLStaticHashedString& uniform, GLfloat x, GLfloat y, GLfloat z); + void uniform1fv(const LLStaticHashedString& uniform, U32 count, const GLfloat* v); + void uniform2fv(const LLStaticHashedString& uniform, U32 count, const GLfloat* v); + void uniform3fv(const LLStaticHashedString& uniform, U32 count, const GLfloat* v); + void uniform4fv(const LLStaticHashedString& uniform, U32 count, const GLfloat* v); + void uniformMatrix4fv(const LLStaticHashedString& uniform, U32 count, GLboolean transpose, const GLfloat *v); void setMinimumAlpha(F32 minimum); void vertexAttrib4f(U32 index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); void vertexAttrib4fv(U32 index, GLfloat* v); - GLint getUniformLocation(const std::string& uniform); + //GLint getUniformLocation(const std::string& uniform); + GLint getUniformLocation(const LLStaticHashedString& uniform); GLint getUniformLocation(U32 index); GLint getAttribLocation(U32 attrib); @@ -169,7 +168,8 @@ public: std::vector<GLint> mAttribute; //lookup table of attribute enum to attribute channel U32 mAttributeMask; //mask of which reserved attributes are set (lines up with LLVertexBuffer::getTypeMask()) std::vector<GLint> mUniform; //lookup table of uniform enum to uniform location - std::map<std::string, GLint> mUniformMap; //lookup map of uniform name to uniform location + LLStaticStringTable<GLint> mUniformMap; //lookup map of uniform name to uniform location + std::map<GLint, std::string> mUniformNameMap; //lookup map of uniform location to uniform name std::map<GLint, LLVector4> mValue; //lookup map of uniform location to last known value std::vector<GLint> mTexture; S32 mTotalUniformSize; @@ -192,6 +192,11 @@ public: static U64 sTotalSamplesDrawn; U32 mDrawCalls; static U32 sTotalDrawCalls; + + bool mTextureStateFetched; + std::vector<U32> mTextureMagFilter; + std::vector<U32> mTextureMinFilter; + }; //UI shader (declared here so llui_libtest will link properly) diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 38764eba23..6a37d31415 100644..100755 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -715,9 +715,9 @@ void LLImageGL::setImage(const U8* data_in, BOOL data_hasmips) mMipLevels = wpo2(llmax(w, h)); - //use legacy mipmap generation mode + //use legacy mipmap generation mode (note: making this condional can cause rendering issues) glTexParameteri(mTarget, GL_GENERATE_MIPMAP, GL_TRUE); - + LLImageGL::setManualImage(mTarget, 0, mFormatInternal, w, h, mFormatPrimary, mFormatType, @@ -1089,6 +1089,16 @@ void LLImageGL::generateTextures(LLTexUnit::eTextureType type, U32 format, S32 n LLFastTimer t(FTM_GENERATE_TEXTURES); bool empty = true; + if (LLRender::sGLCoreProfile) + { + switch (format) + { + case GL_LUMINANCE8: format = GL_RGB8; break; + case GL_LUMINANCE8_ALPHA8: + case GL_ALPHA8: format = GL_RGBA8; break; + } + } + dead_texturelist_t::iterator iter = sDeadTextureList[type].find(format); if (iter != sDeadTextureList[type].end()) diff --git a/indra/llrender/llpostprocess.cpp b/indra/llrender/llpostprocess.cpp index c0045c8044..4c36185b08 100755 --- a/indra/llrender/llpostprocess.cpp +++ b/indra/llrender/llpostprocess.cpp @@ -31,6 +31,21 @@ #include "llsdserialize.h" #include "llrender.h" +static LLStaticHashedString sRenderTexture("RenderTexture"); +static LLStaticHashedString sBrightness("brightness"); +static LLStaticHashedString sContrast("contrast"); +static LLStaticHashedString sContrastBase("contrastBase"); +static LLStaticHashedString sSaturation("saturation"); +static LLStaticHashedString sLumWeights("lumWeights"); +static LLStaticHashedString sNoiseTexture("NoiseTexture"); +static LLStaticHashedString sBrightMult("brightMult"); +static LLStaticHashedString sNoiseStrength("noiseStrength"); +static LLStaticHashedString sExtractLow("extractLow"); +static LLStaticHashedString sExtractHigh("extractHigh"); +static LLStaticHashedString sBloomStrength("bloomStrength"); +static LLStaticHashedString sTexelSize("texelSize"); +static LLStaticHashedString sBlurDirection("blurDirection"); +static LLStaticHashedString sBlurWidth("blurWidth"); LLPostProcess * gPostProcess = NULL; @@ -258,12 +273,12 @@ void LLPostProcess::applyColorFilterShader(void) void LLPostProcess::createColorFilterShader(void) { /// Define uniform names - colorFilterUniforms["RenderTexture"] = 0; - colorFilterUniforms["brightness"] = 0; - colorFilterUniforms["contrast"] = 0; - colorFilterUniforms["contrastBase"] = 0; - colorFilterUniforms["saturation"] = 0; - colorFilterUniforms["lumWeights"] = 0; + colorFilterUniforms[sRenderTexture] = 0; + colorFilterUniforms[sBrightness] = 0; + colorFilterUniforms[sContrast] = 0; + colorFilterUniforms[sContrastBase] = 0; + colorFilterUniforms[sSaturation] = 0; + colorFilterUniforms[sLumWeights] = 0; } void LLPostProcess::applyNightVisionShader(void) @@ -307,11 +322,11 @@ void LLPostProcess::applyNightVisionShader(void) void LLPostProcess::createNightVisionShader(void) { /// Define uniform names - nightVisionUniforms["RenderTexture"] = 0; - nightVisionUniforms["NoiseTexture"] = 0; - nightVisionUniforms["brightMult"] = 0; - nightVisionUniforms["noiseStrength"] = 0; - nightVisionUniforms["lumWeights"] = 0; + nightVisionUniforms[sRenderTexture] = 0; + nightVisionUniforms[sNoiseTexture] = 0; + nightVisionUniforms[sBrightMult] = 0; + nightVisionUniforms[sNoiseStrength] = 0; + nightVisionUniforms[sLumWeights] = 0; createNoiseTexture(mNoiseTexture); } @@ -326,25 +341,25 @@ void LLPostProcess::createBloomShader(void) createTexture(mTempBloomTexture, unsigned(screenW * 0.5), unsigned(screenH * 0.5)); /// Create Bloom Extract Shader - bloomExtractUniforms["RenderTexture"] = 0; - bloomExtractUniforms["extractLow"] = 0; - bloomExtractUniforms["extractHigh"] = 0; - bloomExtractUniforms["lumWeights"] = 0; + bloomExtractUniforms[sRenderTexture] = 0; + bloomExtractUniforms[sExtractLow] = 0; + bloomExtractUniforms[sExtractHigh] = 0; + bloomExtractUniforms[sLumWeights] = 0; /// Create Bloom Blur Shader - bloomBlurUniforms["RenderTexture"] = 0; - bloomBlurUniforms["bloomStrength"] = 0; - bloomBlurUniforms["texelSize"] = 0; - bloomBlurUniforms["blurDirection"] = 0; - bloomBlurUniforms["blurWidth"] = 0; + bloomBlurUniforms[sRenderTexture] = 0; + bloomBlurUniforms[sBloomStrength] = 0; + bloomBlurUniforms[sTexelSize] = 0; + bloomBlurUniforms[sBlurDirection] = 0; + bloomBlurUniforms[sBlurWidth] = 0; } void LLPostProcess::getShaderUniforms(glslUniforms & uniforms, GLhandleARB & prog) { /// Find uniform locations and insert into map - std::map<const char *, GLuint>::iterator i; + glslUniforms::iterator i; for (i = uniforms.begin(); i != uniforms.end(); ++i){ - i->second = glGetUniformLocationARB(prog, i->first); + i->second = glGetUniformLocationARB(prog, i->first.String().c_str()); } } diff --git a/indra/llrender/llpostprocess.h b/indra/llrender/llpostprocess.h index e19de44c60..ce17b6693d 100755 --- a/indra/llrender/llpostprocess.h +++ b/indra/llrender/llpostprocess.h @@ -31,6 +31,7 @@ #include <fstream> #include "llgl.h" #include "llglheaders.h" +#include "llstaticstringtable.h" class LLPostProcess { @@ -44,7 +45,7 @@ public: } QuadType; /// GLSL Shader Encapsulation Struct - typedef std::map<const char *, GLuint> glslUniforms; + typedef LLStaticStringTable<GLuint> glslUniforms; struct PostProcessTweaks : public LLSD { inline PostProcessTweaks() : LLSD(LLSD::emptyMap()) diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index c60eb8d9d9..0ac30b4d63 100755 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -225,26 +225,15 @@ void LLTexUnit::disable(void) bool LLTexUnit::bind(LLTexture* texture, bool for_rendering, bool forceBind) { stop_glerror(); - if (mIndex < 0) return false; - + if (mIndex >= 0) + { gGL.flush(); LLImageGL* gl_tex = NULL ; - if (texture == NULL || !(gl_tex = texture->getGLTexture())) + if (texture != NULL && (gl_tex = texture->getGLTexture())) { - llwarns << "NULL LLTexUnit::bind texture" << llendl; - return false; - } - - if (!gl_tex->getTexName()) //if texture does not exist + if (gl_tex->getTexName()) //if texture exists { - //if deleted, will re-generate it immediately - texture->forceImmediateUpdate() ; - - gl_tex->forceUpdateBindStats() ; - return texture->bindDefaultImage(mIndex); - } - //in audit, replace the selected texture by the default one. if ((mCurrTexture != gl_tex->getTexName()) || forceBind) { @@ -265,6 +254,27 @@ bool LLTexUnit::bind(LLTexture* texture, bool for_rendering, bool forceBind) setTextureFilteringOption(gl_tex->mFilterOption); } } + } + else + { + //if deleted, will re-generate it immediately + texture->forceImmediateUpdate() ; + + gl_tex->forceUpdateBindStats() ; + return texture->bindDefaultImage(mIndex); + } + } + else + { + llwarns << "NULL LLTexUnit::bind texture" << llendl; + return false; + } + } + else + { // mIndex < 0 + return false; + } + return true; } @@ -1058,6 +1068,16 @@ LLRender::~LLRender() void LLRender::init() { + if (sGLCoreProfile && !LLVertexBuffer::sUseVAO) + { //bind a dummy vertex array object so we're core profile compliant +#ifdef GL_ARB_vertex_array_object + U32 ret; + glGenVertexArrays(1, &ret); + glBindVertexArray(ret); +#endif + } + + llassert_always(mBuffer.isNull()) ; stop_glerror(); mBuffer = new LLVertexBuffer(immediate_mask, 0); @@ -1849,13 +1869,15 @@ void LLRender::flush() sUIVerts += mCount; } - if (gDebugGL) - { + //store mCount in a local variable to avoid re-entrance (drawArrays may call flush) + U32 count = mCount; + if (mMode == LLRender::QUADS && !sGLCoreProfile) { if (mCount%4 != 0) { - llerrs << "Incomplete quad rendered." << llendl; + count -= (mCount % 4); + llwarns << "Incomplete quad requested." << llendl; } } @@ -1863,7 +1885,8 @@ void LLRender::flush() { if (mCount%3 != 0) { - llerrs << "Incomplete triangle rendered." << llendl; + count -= (mCount % 3); + llwarns << "Incomplete triangle requested." << llendl; } } @@ -1871,13 +1894,11 @@ void LLRender::flush() { if (mCount%2 != 0) { - llerrs << "Incomplete line rendered." << llendl; - } + count -= (mCount % 2); + llwarns << "Incomplete line requested." << llendl; } } - //store mCount in a local variable to avoid re-entrance (drawArrays may call flush) - U32 count = mCount; mCount = 0; if (mBuffer->useVBOs() && !mBuffer->isLocked()) @@ -2280,6 +2301,22 @@ void LLRender::diffuseColor4ubv(const U8* c) } } +void LLRender::diffuseColor4ub(U8 r, U8 g, U8 b, U8 a) +{ + LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr; + llassert(!LLGLSLShader::sNoFixedFunction || shader != NULL); + + if (shader) + { + shader->uniform4f(LLShaderMgr::DIFFUSE_COLOR, r/255.f, g/255.f, b/255.f, a/255.f); + } + else + { + glColor4ub(r,g,b,a); + } +} + + void LLRender::debugTexUnits(void) { LL_INFOS("TextureUnit") << "Active TexUnit: " << mCurrTextureUnitIndex << LL_ENDL; diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h index 98222939e7..42b02a8159 100755 --- a/indra/llrender/llrender.h +++ b/indra/llrender/llrender.h @@ -396,6 +396,7 @@ public: void diffuseColor4f(F32 r, F32 g, F32 b, F32 a); void diffuseColor4fv(const F32* c); void diffuseColor4ubv(const U8* c); + void diffuseColor4ub(U8 r, U8 g, U8 b, U8 a); void vertexBatchPreTransformed(LLVector3* verts, S32 vert_count); void vertexBatchPreTransformed(LLVector3* verts, LLVector2* uvs, S32 vert_count); diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp index 5fb4fc8e52..353e61105a 100755 --- a/indra/llrender/llrendertarget.cpp +++ b/indra/llrender/llrendertarget.cpp @@ -53,11 +53,19 @@ void check_framebuffer_status() bool LLRenderTarget::sUseFBO = false; U32 LLRenderTarget::sCurFBO = 0; + +extern S32 gGLViewport[4]; + +U32 LLRenderTarget::sCurResX = 0; +U32 LLRenderTarget::sCurResY = 0; + LLRenderTarget::LLRenderTarget() : mResX(0), mResY(0), mFBO(0), mPreviousFBO(0), + mPreviousResX(0), + mPreviousResY(0), mDepth(0), mStencil(0), mUseDepth(false), @@ -71,7 +79,7 @@ LLRenderTarget::~LLRenderTarget() release(); } -void LLRenderTarget::resize(U32 resx, U32 resy, U32 color_fmt) +void LLRenderTarget::resize(U32 resx, U32 resy) { //for accounting, get the number of pixels added/subtracted S32 pix_diff = (resx*resy)-(mResX*mResY); @@ -79,10 +87,12 @@ void LLRenderTarget::resize(U32 resx, U32 resy, U32 color_fmt) mResX = resx; mResY = resy; + llassert(mInternalFormat.size() == mTex.size()); + for (U32 i = 0; i < mTex.size(); ++i) { //resize color attachments gGL.getTexUnit(0)->bindManual(mUsage, mTex[i]); - LLImageGL::setManualImage(LLTexUnit::getInternalType(mUsage), 0, color_fmt, mResX, mResY, GL_RGBA, GL_UNSIGNED_BYTE, NULL, false); + LLImageGL::setManualImage(LLTexUnit::getInternalType(mUsage), 0, mInternalFormat[i], mResX, mResY, GL_RGBA, GL_UNSIGNED_BYTE, NULL, false); sBytesAllocated += pix_diff*4; } @@ -109,8 +119,8 @@ void LLRenderTarget::resize(U32 resx, U32 resy, U32 color_fmt) bool LLRenderTarget::allocate(U32 resx, U32 resy, U32 color_fmt, bool depth, bool stencil, LLTexUnit::eTextureType usage, bool use_fbo, S32 samples) { - resx = llmin(resx, (U32) 4096); - resy = llmin(resy, (U32) 4096); + resx = llmin(resx, (U32) gGLManager.mGLMaxTextureSize); + resy = llmin(resy, (U32) gGLManager.mGLMaxTextureSize); stop_glerror(); release(); @@ -244,12 +254,15 @@ bool LLRenderTarget::addColorAttachment(U32 color_fmt) mTex.push_back(tex); mInternalFormat.push_back(color_fmt); +#if !LL_DARWIN if (gDebugGL) { //bind and unbind to validate target bindTarget(); flush(); } - +#endif + + return true; } @@ -390,13 +403,12 @@ void LLRenderTarget::bindTarget() { if (mFBO) { - mPreviousFBO = sCurFBO; - stop_glerror(); + mPreviousFBO = sCurFBO; glBindFramebuffer(GL_FRAMEBUFFER, mFBO); sCurFBO = mFBO; - + stop_glerror(); if (gGLManager.mHasDrawBuffers) { //setup multiple render targets @@ -418,7 +430,12 @@ void LLRenderTarget::bindTarget() stop_glerror(); } + mPreviousResX = sCurResX; + mPreviousResY = sCurResY; glViewport(0, 0, mResX, mResY); + sCurResX = mResX; + sCurResY = mResY; + sBoundTarget = this; } @@ -458,6 +475,12 @@ U32 LLRenderTarget::getTexture(U32 attachment) const return mTex[attachment]; } +U32 LLRenderTarget::getNumTextures() const +{ + return mTex.size(); +} + + void LLRenderTarget::bindTexture(U32 index, S32 channel) { gGL.getTexUnit(channel)->bindManual(mUsage, getTexture(index)); @@ -489,6 +512,20 @@ void LLRenderTarget::flush(bool fetch_depth) stop_glerror(); glBindFramebuffer(GL_FRAMEBUFFER, mPreviousFBO); sCurFBO = mPreviousFBO; + + if (mPreviousFBO) + { + glViewport(0, 0, mPreviousResX, mPreviousResY); + sCurResX = mPreviousResX; + sCurResY = mPreviousResY; + } + else + { + glViewport(gGLViewport[0],gGLViewport[1],gGLViewport[2],gGLViewport[3]); + sCurResX = gGLViewport[2]; + sCurResY = gGLViewport[3]; + } + stop_glerror(); } } @@ -546,8 +583,10 @@ void LLRenderTarget::copyContentsToFramebuffer(LLRenderTarget& source, S32 srcX0 { if (!source.mFBO) { - llerrs << "Cannot copy framebuffer contents for non FBO render targets." << llendl; + llwarns << "Cannot copy framebuffer contents for non FBO render targets." << llendl; + return; } + { GLboolean write_depth = mask & GL_DEPTH_BUFFER_BIT ? TRUE : FALSE; diff --git a/indra/llrender/llrendertarget.h b/indra/llrender/llrendertarget.h index 765a727b5b..6dc84d978d 100755 --- a/indra/llrender/llrendertarget.h +++ b/indra/llrender/llrendertarget.h @@ -63,6 +63,9 @@ public: static bool sUseFBO; static U32 sBytesAllocated; static U32 sCurFBO; + static U32 sCurResX; + static U32 sCurResY; + LLRenderTarget(); ~LLRenderTarget(); @@ -76,7 +79,7 @@ public: // CAUTION: if the GL runs out of memory attempting to resize, this render target will be undefined // DO NOT use for screen space buffers or for scratch space for an image that might be uploaded // DO use for render targets that resize often and aren't likely to ruin someone's day if they break - void resize(U32 resx, U32 resy, U32 color_fmt); + void resize(U32 resx, U32 resy); //add color buffer attachment //limit of 4 color attachments per render target @@ -112,6 +115,7 @@ public: LLTexUnit::eTextureType getUsage(void) const { return mUsage; } U32 getTexture(U32 attachment = 0) const; + U32 getNumTextures() const; U32 getDepth(void) const { return mDepth; } bool hasStencil() const { return mStencil; } @@ -146,6 +150,9 @@ protected: std::vector<U32> mInternalFormat; U32 mFBO; U32 mPreviousFBO; + U32 mPreviousResX; + U32 mPreviousResY; + U32 mDepth; bool mStencil; bool mUseDepth; diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index fea4ee2819..d230574752 100755 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -993,7 +993,9 @@ void LLShaderMgr::initAttribsAndUniforms() mReservedUniforms.push_back("texture_matrix1"); mReservedUniforms.push_back("texture_matrix2"); mReservedUniforms.push_back("texture_matrix3"); - llassert(mReservedUniforms.size() == LLShaderMgr::TEXTURE_MATRIX3+1); + mReservedUniforms.push_back("object_plane_s"); + mReservedUniforms.push_back("object_plane_t"); + llassert(mReservedUniforms.size() == LLShaderMgr::OBJECT_PLANE_T+1); mReservedUniforms.push_back("viewport"); @@ -1135,13 +1137,54 @@ void LLShaderMgr::initAttribsAndUniforms() mReservedUniforms.push_back("lightMap"); mReservedUniforms.push_back("bloomMap"); mReservedUniforms.push_back("projectionMap"); - + mReservedUniforms.push_back("norm_mat"); + mReservedUniforms.push_back("global_gamma"); mReservedUniforms.push_back("texture_gamma"); mReservedUniforms.push_back("specular_color"); mReservedUniforms.push_back("env_intensity"); + mReservedUniforms.push_back("matrixPalette"); + + mReservedUniforms.push_back("screenTex"); + mReservedUniforms.push_back("screenDepth"); + mReservedUniforms.push_back("refTex"); + mReservedUniforms.push_back("eyeVec"); + mReservedUniforms.push_back("time"); + mReservedUniforms.push_back("d1"); + mReservedUniforms.push_back("d2"); + mReservedUniforms.push_back("lightDir"); + mReservedUniforms.push_back("specular"); + mReservedUniforms.push_back("lightExp"); + mReservedUniforms.push_back("waterFogColor"); + mReservedUniforms.push_back("waterFogDensity"); + mReservedUniforms.push_back("waterFogKS"); + mReservedUniforms.push_back("refScale"); + mReservedUniforms.push_back("waterHeight"); + mReservedUniforms.push_back("waterPlane"); + mReservedUniforms.push_back("normScale"); + mReservedUniforms.push_back("fresnelScale"); + mReservedUniforms.push_back("fresnelOffset"); + mReservedUniforms.push_back("blurMultiplier"); + mReservedUniforms.push_back("sunAngle"); + mReservedUniforms.push_back("scaledAngle"); + mReservedUniforms.push_back("sunAngle2"); + + mReservedUniforms.push_back("camPosLocal"); + + mReservedUniforms.push_back("gWindDir"); + mReservedUniforms.push_back("gSinWaveParams"); + mReservedUniforms.push_back("gGravity"); + + mReservedUniforms.push_back("detail_0"); + mReservedUniforms.push_back("detail_1"); + mReservedUniforms.push_back("detail_2"); + mReservedUniforms.push_back("detail_3"); + mReservedUniforms.push_back("alpha_ramp"); + + mReservedUniforms.push_back("origin"); + mReservedUniforms.push_back("display_gamma"); llassert(mReservedUniforms.size() == END_RESERVED_UNIFORMS); std::set<std::string> dupe_check; diff --git a/indra/llrender/llshadermgr.h b/indra/llrender/llshadermgr.h index c049e935b8..51c27fc8b6 100755 --- a/indra/llrender/llshadermgr.h +++ b/indra/llrender/llshadermgr.h @@ -47,6 +47,8 @@ public: TEXTURE_MATRIX1, TEXTURE_MATRIX2, TEXTURE_MATRIX3, + OBJECT_PLANE_S, + OBJECT_PLANE_T, VIEWPORT, LIGHT_POSITION, LIGHT_DIRECTION, @@ -165,13 +167,54 @@ public: DEFERRED_LIGHT, DEFERRED_BLOOM, DEFERRED_PROJECTION, - + DEFERRED_NORM_MATRIX, + GLOBAL_GAMMA, TEXTURE_GAMMA, SPECULAR_COLOR, ENVIRONMENT_INTENSITY, + AVATAR_MATRIX, + + WATER_SCREENTEX, + WATER_SCREENDEPTH, + WATER_REFTEX, + WATER_EYEVEC, + WATER_TIME, + WATER_WAVE_DIR1, + WATER_WAVE_DIR2, + WATER_LIGHT_DIR, + WATER_SPECULAR, + WATER_SPECULAR_EXP, + WATER_FOGCOLOR, + WATER_FOGDENSITY, + WATER_FOGKS, + WATER_REFSCALE, + WATER_WATERHEIGHT, + WATER_WATERPLANE, + WATER_NORM_SCALE, + WATER_FRESNEL_SCALE, + WATER_FRESNEL_OFFSET, + WATER_BLUR_MULTIPLIER, + WATER_SUN_ANGLE, + WATER_SCALED_ANGLE, + WATER_SUN_ANGLE2, + + WL_CAMPOSLOCAL, + + AVATAR_WIND, + AVATAR_SINWAVE, + AVATAR_GRAVITY, + + TERRAIN_DETAIL0, + TERRAIN_DETAIL1, + TERRAIN_DETAIL2, + TERRAIN_DETAIL3, + TERRAIN_ALPHARAMP, + + SHINY_ORIGIN, +DISPLAY_GAMMA, END_RESERVED_UNIFORMS } eGLSLReservedUniforms; diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 01541026b1..f168b3af14 100755 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -85,6 +85,7 @@ const U32 LL_VBO_POOL_SEED_COUNT = vbo_block_index(LL_VBO_POOL_MAX_SEED_SIZE); //static LLVBOPool LLVertexBuffer::sStreamVBOPool(GL_STREAM_DRAW_ARB, GL_ARRAY_BUFFER_ARB); LLVBOPool LLVertexBuffer::sDynamicVBOPool(GL_DYNAMIC_DRAW_ARB, GL_ARRAY_BUFFER_ARB); +LLVBOPool LLVertexBuffer::sDynamicCopyVBOPool(GL_DYNAMIC_COPY_ARB, GL_ARRAY_BUFFER_ARB); LLVBOPool LLVertexBuffer::sStreamIBOPool(GL_STREAM_DRAW_ARB, GL_ELEMENT_ARRAY_BUFFER_ARB); LLVBOPool LLVertexBuffer::sDynamicIBOPool(GL_DYNAMIC_DRAW_ARB, GL_ELEMENT_ARRAY_BUFFER_ARB); @@ -199,7 +200,10 @@ volatile U8* LLVBOPool::allocate(U32& name, U32 size, bool for_seed) if (LLVertexBuffer::sDisableVBOMapping || mUsage != GL_DYNAMIC_DRAW_ARB) { glBufferDataARB(mType, size, 0, mUsage); - ret = (U8*) ll_aligned_malloc_16(size); + if (mUsage != GL_DYNAMIC_COPY_ARB) + { //data will be provided by application + ret = (U8*) ll_aligned_malloc(size, 64); + } } else { //always use a true hint of static draw when allocating non-client-backed buffers @@ -252,7 +256,7 @@ void LLVBOPool::release(U32 name, volatile U8* buffer, U32 size) llassert(vbo_block_size(size) == size); deleteBuffer(name); - ll_aligned_free_16((U8*) buffer); + ll_aligned_free((U8*) buffer); if (mType == GL_ARRAY_BUFFER_ARB) { @@ -306,7 +310,7 @@ void LLVBOPool::cleanup() if (r.mClientData) { - ll_aligned_free_16((void*) r.mClientData); + ll_aligned_free((void*) r.mClientData); } l.pop_front(); @@ -412,6 +416,7 @@ void LLVertexBuffer::seedPools() { sStreamVBOPool.seedPool(); sDynamicVBOPool.seedPool(); + sDynamicCopyVBOPool.seedPool(); sStreamIBOPool.seedPool(); sDynamicIBOPool.seedPool(); } @@ -910,6 +915,7 @@ void LLVertexBuffer::cleanupClass() sDynamicIBOPool.cleanup(); sStreamVBOPool.cleanup(); sDynamicVBOPool.cleanup(); + sDynamicCopyVBOPool.cleanup(); if(sPrivatePoolp) { @@ -946,6 +952,8 @@ S32 LLVertexBuffer::determineUsage(S32 usage) if (ret_usage && ret_usage != GL_STREAM_DRAW_ARB) { //only stream_draw and dynamic_draw are supported when using VBOs, dynamic draw is the default + if (ret_usage != GL_DYNAMIC_COPY_ARB) + { if (sDisableVBOMapping) { //always use stream draw if VBO mapping is disabled ret_usage = GL_STREAM_DRAW_ARB; @@ -955,6 +963,7 @@ S32 LLVertexBuffer::determineUsage(S32 usage) ret_usage = GL_DYNAMIC_DRAW_ARB; } } + } return ret_usage; } @@ -1102,10 +1111,15 @@ void LLVertexBuffer::genBuffer(U32 size) { mMappedData = sStreamVBOPool.allocate(mGLBuffer, mSize); } - else + else if (mUsage == GL_DYNAMIC_DRAW_ARB) { mMappedData = sDynamicVBOPool.allocate(mGLBuffer, mSize); } + else + { + mMappedData = sDynamicCopyVBOPool.allocate(mGLBuffer, mSize); + } + sGLCount++; } @@ -2144,21 +2158,14 @@ bool LLVertexBuffer::bindGLBuffer(bool force_bind) if (useVBOs() && (force_bind || (mGLBuffer && (mGLBuffer != sGLRenderBuffer || !sVBOActive)))) { - LLFastTimer t(FTM_BIND_GL_BUFFER); - /*if (sMapped) - { - llerrs << "VBO bound while another VBO mapped!" << llendl; - }*/ + //LLFastTimer t(FTM_BIND_GL_BUFFER); <-- this timer is showing up as a hotspot (irony) + glBindBufferARB(GL_ARRAY_BUFFER_ARB, mGLBuffer); sGLRenderBuffer = mGLBuffer; sBindCount++; sVBOActive = true; - if (mGLArray) - { - llassert(sGLRenderArray == mGLArray); - //mCachedRenderBuffer = mGLBuffer; - } + llassert(!mGLArray || sGLRenderArray == mGLArray); ret = true; } @@ -2239,7 +2246,38 @@ void LLVertexBuffer::setBuffer(U32 data_mask) if ((data_mask & required_mask) != required_mask) { - llwarns << "Shader consumption mismatches data provision." << llendl; + + U32 unsatisfied_mask = (required_mask & ~data_mask); + U32 i = 0; + + while (i < TYPE_MAX) + { + U32 unsatisfied_flag = unsatisfied_mask & (1 << i); + switch (unsatisfied_flag) + { + case MAP_VERTEX: llinfos << "Missing vert pos" << llendl; break; + case MAP_NORMAL: llinfos << "Missing normals" << llendl; break; + case MAP_TEXCOORD0: llinfos << "Missing TC 0" << llendl; break; + case MAP_TEXCOORD1: llinfos << "Missing TC 1" << llendl; break; + case MAP_TEXCOORD2: llinfos << "Missing TC 2" << llendl; break; + case MAP_TEXCOORD3: llinfos << "Missing TC 3" << llendl; break; + case MAP_COLOR: llinfos << "Missing vert color" << llendl; break; + case MAP_EMISSIVE: llinfos << "Missing emissive" << llendl; break; + case MAP_TANGENT: llinfos << "Missing tangent" << llendl; break; + case MAP_WEIGHT: llinfos << "Missing weight" << llendl; break; + case MAP_WEIGHT4: llinfos << "Missing weightx4" << llendl; break; + case MAP_CLOTHWEIGHT: llinfos << "Missing clothweight" << llendl; break; + case MAP_TEXTURE_INDEX: llinfos << "Missing tex index" << llendl; break; + default: llinfos << "Missing who effin knows: " << unsatisfied_flag << llendl; + } + } + + if (unsatisfied_mask & (1 << TYPE_INDEX)) + { + llinfos << "Missing indices" << llendl; + } + + llerrs << "Shader consumption mismatches data provision." << llendl; } } } @@ -2409,7 +2447,8 @@ void LLVertexBuffer::setupVertexBuffer(U32 data_mask) if (data_mask & MAP_COLOR) { S32 loc = TYPE_COLOR; - void* ptr = (void*)(base + mOffsets[TYPE_COLOR]); + //bind emissive instead of color pointer if emissive is present + void* ptr = (data_mask & MAP_EMISSIVE) ? (void*)(base + mOffsets[TYPE_EMISSIVE]) : (void*)(base + mOffsets[TYPE_COLOR]); glVertexAttribPointerARB(loc, 4, GL_UNSIGNED_BYTE, GL_TRUE, LLVertexBuffer::sTypeSize[TYPE_COLOR], ptr); } if (data_mask & MAP_EMISSIVE) @@ -2417,6 +2456,12 @@ void LLVertexBuffer::setupVertexBuffer(U32 data_mask) S32 loc = TYPE_EMISSIVE; void* ptr = (void*)(base + mOffsets[TYPE_EMISSIVE]); glVertexAttribPointerARB(loc, 4, GL_UNSIGNED_BYTE, GL_TRUE, LLVertexBuffer::sTypeSize[TYPE_EMISSIVE], ptr); + + if (!(data_mask & MAP_COLOR)) + { //map emissive to color channel when color is not also being bound to avoid unnecessary shader swaps + loc = TYPE_COLOR; + glVertexAttribPointerARB(loc, 4, GL_UNSIGNED_BYTE, GL_TRUE, LLVertexBuffer::sTypeSize[TYPE_EMISSIVE], ptr); + } } if (data_mask & MAP_WEIGHT) { @@ -2502,8 +2547,7 @@ void LLVertexBuffer::setupVertexBuffer(U32 data_mask) LLVertexBuffer::MappedRegion::MappedRegion(S32 type, S32 index, S32 count) : mType(type), mIndex(index), mCount(count) { - llassert(mType == LLVertexBuffer::TYPE_INDEX || - mType < LLVertexBuffer::TYPE_TEXTURE_INDEX); + mEnd = mIndex+mCount; } diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h index 04806c1d8c..de58207c23 100755 --- a/indra/llrender/llvertexbuffer.h +++ b/indra/llrender/llvertexbuffer.h @@ -107,6 +107,7 @@ public: S32 mType; S32 mIndex; S32 mCount; + S32 mEnd; MappedRegion(S32 type, S32 index, S32 count); }; @@ -125,9 +126,10 @@ public: static LLVBOPool sStreamVBOPool; static LLVBOPool sDynamicVBOPool; + static LLVBOPool sDynamicCopyVBOPool; static LLVBOPool sStreamIBOPool; static LLVBOPool sDynamicIBOPool; - + static std::list<U32> sAvailableVAOName; static U32 sCurVAOName; diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index a8149a9a1d..44f2c1efe9 100755 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -644,7 +644,7 @@ void LLButton::draw() // Cancel sticking of color, if the button is pressed, // or when a flashing of the previously selected button is ended if (mFlashingTimer - && ((selected && !mFlashingTimer->isFlashingInProgress()) || pressed)) + && ((selected && !mFlashingTimer->isFlashingInProgress() && !mForceFlashing) || pressed)) { mFlashing = false; } @@ -971,8 +971,9 @@ void LLButton::setToggleState(BOOL b) } } -void LLButton::setFlashing(bool b) +void LLButton::setFlashing(bool b, bool force_flashing/* = false */) { + mForceFlashing = force_flashing; if (mFlashingTimer) { mFlashing = b; diff --git a/indra/llui/llbutton.h b/indra/llui/llbutton.h index 060db59a8a..7b4719866d 100755 --- a/indra/llui/llbutton.h +++ b/indra/llui/llbutton.h @@ -201,7 +201,7 @@ public: void setToggleState(BOOL b); void setHighlight(bool b); - void setFlashing( bool b ); + void setFlashing( bool b, bool force_flashing = false ); BOOL getFlashing() const { return mFlashing; } LLFlashTimer* getFlashTimer() {return mFlashingTimer;} @@ -378,7 +378,7 @@ protected: LLFrameTimer mFrameTimer; LLFlashTimer * mFlashingTimer; - + bool mForceFlashing; // Stick flashing color even if button is pressed bool mHandleRightMouse; }; diff --git a/indra/llui/llchatentry.cpp b/indra/llui/llchatentry.cpp index 6a1b48a08a..c04b70eb64 100755 --- a/indra/llui/llchatentry.cpp +++ b/indra/llui/llchatentry.cpp @@ -62,9 +62,9 @@ void LLChatEntry::draw() { if(mIsExpandable) { + reflow(); expandText(); } - LLTextEditor::draw(); } @@ -158,19 +158,21 @@ void LLChatEntry::onValueChange(S32 start, S32 end) resetLabel(); } -bool LLChatEntry::useLabel() +bool LLChatEntry::useLabel() const { return !getLength() && !mLabel.empty(); } void LLChatEntry::onFocusReceived() { - + LLUICtrl::onFocusReceived(); + updateAllowingLanguageInput(); } void LLChatEntry::onFocusLost() { - + LLTextEditor::focusLostHelper(); + LLUICtrl::onFocusLost(); } BOOL LLChatEntry::handleSpecialKey(const KEY key, const MASK mask) diff --git a/indra/llui/llchatentry.h b/indra/llui/llchatentry.h index 49c8d21450..e67f39b21b 100755 --- a/indra/llui/llchatentry.h +++ b/indra/llui/llchatentry.h @@ -56,14 +56,14 @@ protected: LLChatEntry(const Params& p); /*virtual*/ void beforeValueChange(); /*virtual*/ void onValueChange(S32 start, S32 end); - /*virtual*/ bool useLabel(); + /*virtual*/ bool useLabel() const; public: virtual void draw(); virtual void onCommit(); - /*virtual*/ void onFocusReceived(); - /*virtual*/ void onFocusLost(); + /*virtual*/ void onFocusReceived(); + /*virtual*/ void onFocusLost(); void enableSingleLineMode(bool single_line_mode); boost::signals2::connection setTextExpandedCallback(const commit_signal_t::slot_type& cb); diff --git a/indra/llui/llconsole.cpp b/indra/llui/llconsole.cpp index c216d593a2..fdfaf284de 100755 --- a/indra/llui/llconsole.cpp +++ b/indra/llui/llconsole.cpp @@ -243,7 +243,6 @@ void LLConsole::draw() void LLConsole::Paragraph::makeParagraphColorSegments (const LLColor4 &color) { LLSD paragraph_color_segments; - paragraph_color_segments[0]["text"] =wstring_to_utf8str(mParagraphText); LLSD color_sd = color.getValue(); paragraph_color_segments[0]["color"]=color_sd; diff --git a/indra/llui/llconsole.h b/indra/llui/llconsole.h index f32f1dd74c..5ff05698b0 100755 --- a/indra/llui/llconsole.h +++ b/indra/llui/llconsole.h @@ -37,6 +37,7 @@ class LLSD; class LLConsole : public LLFixedBuffer, public LLUICtrl, public LLInstanceTracker<LLConsole> { public: + typedef enum e_font_size { MONOSPACE = -1, diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 09e27a264a..273ceb4038 100755 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -507,22 +507,11 @@ LLFloater::~LLFloater() { LLFloaterReg::removeInstance(mInstanceName, mKey); -// delete mNotificationContext; -// mNotificationContext = NULL; - - //// am I not hosted by another floater? - //if (mHostHandle.isDead()) - //{ - // LLFloaterView* parent = (LLFloaterView*) getParent(); - - // if( parent ) - // { - // parent->removeChild( this ); - // } - //} - - // Just in case we might still have focus here, release it. - releaseFocus(); + if( gFocusMgr.childHasKeyboardFocus(this)) + { + // Just in case we might still have focus here, release it. + releaseFocus(); + } // This is important so that floaters with persistent rects (i.e., those // created with rect control rather than an LLRect) are restored in their @@ -1486,6 +1475,7 @@ void LLFloater::moveResizeHandlesToFront() } } +/*virtual*/ BOOL LLFloater::isFrontmost() { LLFloaterView* floater_view = getParentByType<LLFloaterView>(); @@ -1504,7 +1494,7 @@ void LLFloater::addDependentFloater(LLFloater* floaterp, BOOL reposition) floaterp->setRect(gFloaterView->findNeighboringPosition(this, floaterp)); floaterp->setSnapTarget(getHandle()); } - gFloaterView->adjustToFitScreen(floaterp, FALSE); + gFloaterView->adjustToFitScreen(floaterp, FALSE, TRUE); if (floaterp->isFrontmost()) { // make sure to bring self and sibling floaters to front @@ -2735,7 +2725,7 @@ void LLFloaterView::refresh() const S32 FLOATER_MIN_VISIBLE_PIXELS = 16; -void LLFloaterView::adjustToFitScreen(LLFloater* floater, BOOL allow_partial_outside) +void LLFloaterView::adjustToFitScreen(LLFloater* floater, BOOL allow_partial_outside, BOOL snap_in_toolbars/* = false*/) { if (floater->getParent() != this) { @@ -2788,7 +2778,7 @@ void LLFloaterView::adjustToFitScreen(LLFloater* floater, BOOL allow_partial_out } // move window fully onscreen - if (floater->translateIntoRect( getSnapRect(), allow_partial_outside ? FLOATER_MIN_VISIBLE_PIXELS : S32_MAX )) + if (floater->translateIntoRect( snap_in_toolbars ? getSnapRect() : gFloaterView->getRect(), allow_partial_outside ? FLOATER_MIN_VISIBLE_PIXELS : S32_MAX )) { floater->clearSnapTarget(); } @@ -3258,6 +3248,11 @@ bool LLFloater::isShown() const return ! isMinimized() && isInVisibleChain(); } +bool LLFloater::isDetachedAndNotMinimized() +{ + return !getHost() && !isMinimized(); +} + /* static */ bool LLFloater::isShown(const LLFloater* floater) { diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 4dba1e645f..59448530d9 100755 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -112,6 +112,8 @@ struct LLCoordFloater : LLCoord<LL_COORD_FLOATER> bool operator!=(const LLCoordFloater& other) const { return !(*this == other); } void setFloater(LLFloater& floater); + + }; class LLFloater : public LLPanel, public LLInstanceTracker<LLFloater> @@ -121,6 +123,7 @@ class LLFloater : public LLPanel, public LLInstanceTracker<LLFloater> friend class LLMultiFloater; public: + struct KeyCompare { // static bool compare(const LLSD& a, const LLSD& b); @@ -238,6 +241,7 @@ public: void center(); LLMultiFloater* getHost(); + bool isDetachedAndNotMinimized(); void applyTitle(); std::string getCurrentTitle() const; @@ -261,7 +265,7 @@ public: static bool isVisible(const LLFloater* floater); static bool isMinimized(const LLFloater* floater); BOOL isFirstLook() { return mFirstLook; } // EXT-2653: This function is necessary to prevent overlapping for secondary showed toasts - BOOL isFrontmost(); + virtual BOOL isFrontmost(); BOOL isDependent() { return !mDependeeHandle.isDead(); } void setCanMinimize(BOOL can_minimize); void setCanClose(BOOL can_close); @@ -528,7 +532,7 @@ public: LLRect findNeighboringPosition( LLFloater* reference_floater, LLFloater* neighbor ); // Given a child of gFloaterView, make sure this view can fit entirely onscreen. - void adjustToFitScreen(LLFloater* floater, BOOL allow_partial_outside); + void adjustToFitScreen(LLFloater* floater, BOOL allow_partial_outside, BOOL snap_in_toolbars = false); void setMinimizePositionVerticalOffset(S32 offset) { mMinimizePositionVOffset = offset; } void getMinimizePosition( S32 *left, S32 *bottom); diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp index 1cdddf0d5b..b1b75776a7 100755 --- a/indra/llui/llfloaterreg.cpp +++ b/indra/llui/llfloaterreg.cpp @@ -356,8 +356,8 @@ std::string LLFloaterReg::declareRectControl(const std::string& name) { std::string controlname = getRectControlName(name); LLFloater::getControlGroup()->declareRect(controlname, LLRect(), - llformat("Window Size for %s", name.c_str()), - TRUE); + llformat("Window Size for %s", name.c_str()), + LLControlVariable::PERSIST_NONDFT); return controlname; } @@ -367,7 +367,7 @@ std::string LLFloaterReg::declarePosXControl(const std::string& name) LLFloater::getControlGroup()->declareF32(controlname, 10.f, llformat("Window X Position for %s", name.c_str()), - TRUE); + LLControlVariable::PERSIST_NONDFT); return controlname; } @@ -377,7 +377,7 @@ std::string LLFloaterReg::declarePosYControl(const std::string& name) LLFloater::getControlGroup()->declareF32(controlname, 10.f, llformat("Window Y Position for %s", name.c_str()), - TRUE); + LLControlVariable::PERSIST_NONDFT); return controlname; } @@ -404,7 +404,7 @@ std::string LLFloaterReg::declareVisibilityControl(const std::string& name) std::string controlname = getVisibilityControlName(name); LLFloater::getControlGroup()->declareBOOL(controlname, FALSE, llformat("Window Visibility for %s", name.c_str()), - TRUE); + LLControlVariable::PERSIST_NONDFT); return controlname; } @@ -414,7 +414,7 @@ std::string LLFloaterReg::declareDockStateControl(const std::string& name) std::string controlname = getDockStateControlName(name); LLFloater::getControlGroup()->declareBOOL(controlname, TRUE, llformat("Window Docking state for %s", name.c_str()), - TRUE); + LLControlVariable::PERSIST_NONDFT); return controlname; } diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 8aa1eb7cd5..cf449217f5 100755 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -323,9 +323,11 @@ static LLFastTimer::DeclareTimer FTM_FILTER("Filter Folder View"); void LLFolderView::filter( LLFolderViewFilter& filter ) { + // Entry point of inventory filtering (CHUI-849) LLFastTimer t2(FTM_FILTER); - filter.setFilterCount(llclamp(LLUI::sSettingGroups["config"]->getS32("FilterItemsPerFrame"), 1, 5000)); + filter.resetTime(llclamp(LLUI::sSettingGroups["config"]->getS32(mParentPanel->getVisible() ? "FilterItemsMaxTimePerFrameVisible" : "FilterItemsMaxTimePerFrameUnvisible"), 1, 100)); + // Note: we filter the model, not the view getViewModelItem()->filter(filter); } @@ -661,7 +663,7 @@ void LLFolderView::draw() // get preferable text height... S32 pixel_height = mStatusTextBox->getTextPixelHeight(); - bool height_changed = local_rect.getHeight() != pixel_height; + bool height_changed = (local_rect.getHeight() < pixel_height); if (height_changed) { // ... if it does not match current height, lets rearrange current view. @@ -1601,15 +1603,17 @@ void LLFolderView::update() { mNeedsAutoSelect = TRUE; } - // filter to determine visibility before arranging + + // Filter to determine visibility before arranging filter(getFolderViewModel()->getFilter()); - // Clear the modified setting on the filter only if the filter count is non-zero after running the filter process - // Note: if the filter count is zero, then the filter most likely halted before completing the entire set of items - if (getFolderViewModel()->getFilter().isModified() && (getFolderViewModel()->getFilter().getFilterCount() > 0)) + + // Clear the modified setting on the filter only if the filter finished after running the filter process + // Note: if the filter count has timed out, that means the filter halted before completing the entire set of items + if (getFolderViewModel()->getFilter().isModified() && (!getFolderViewModel()->getFilter().isTimedOut())) { getFolderViewModel()->getFilter().clearModified(); } - + // automatically show matching items, and select first one if we had a selection if (mNeedsAutoSelect) { @@ -1649,11 +1653,13 @@ void LLFolderView::update() BOOL is_visible = isInVisibleChain(); - //Puts folders/items in proper positions - if ( is_visible ) + // Puts folders/items in proper positions + // arrange() takes the model filter flag into account and call sort() if necessary (CHUI-849) + // It also handles the open/close folder animation + if (is_visible) { sanitizeSelection(); - if( needsArrange() ) + if (needsArrange()) { S32 height = 0; S32 width = 0; diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index fdb4108afb..6c147ccc12 100755..100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -274,6 +274,7 @@ void LLFolderViewItem::refresh() } mLabelWidthDirty = true; + // Dirty the filter flag of the model from the view (CHUI-849) vmi.dirtyFilter(); } @@ -943,11 +944,17 @@ void LLFolderViewFolder::addToFolder(LLFolderViewFolder* folder) static LLFastTimer::DeclareTimer FTM_ARRANGE("Arrange"); -// Finds width and height of this object and its children. Also -// makes sure that this view and its children are the right size. +// Make everything right and in the right place ready for drawing (CHUI-849) +// * Sort everything correctly if necessary +// * Turn widgets visible/invisible according to their model filtering state +// * Takes animation state into account for opening/closing of folders (this makes widgets visible/invisible) +// * Reposition visible widgets so that they line up correctly with no gap +// * Compute the width and height of the current folder and its children +// * Makes sure that this view and its children are the right size S32 LLFolderViewFolder::arrange( S32* width, S32* height ) { - // sort before laying out contents + // Sort before laying out contents + // Note that we sort from the root (CHUI-849) getRoot()->getFolderViewModel()->sort(this); LLFastTimer t2(FTM_ARRANGE); @@ -1613,16 +1620,13 @@ void LLFolderViewFolder::addFolder(LLFolderViewFolder* folder) } void LLFolderViewFolder::requestArrange() -{ - if ( mLastArrangeGeneration != -1) - { - mLastArrangeGeneration = -1; - // flag all items up to root - if (mParentFolder) - { - mParentFolder->requestArrange(); - } - } +{ + mLastArrangeGeneration = -1; + // flag all items up to root + if (mParentFolder) + { + mParentFolder->requestArrange(); + } } void LLFolderViewFolder::toggleOpen() diff --git a/indra/llui/llfolderviewitem.h b/indra/llui/llfolderviewitem.h index ca31931e19..a9b0201236 100755..100644 --- a/indra/llui/llfolderviewitem.h +++ b/indra/llui/llfolderviewitem.h @@ -316,7 +316,6 @@ protected: F32 mAutoOpenCountdown; S32 mLastArrangeGeneration; S32 mLastCalculatedWidth; - S32 mMostFilteredDescendantGeneration; bool mNeedsSort; public: diff --git a/indra/llui/llfolderviewmodel.cpp b/indra/llui/llfolderviewmodel.cpp index 3593804554..3363dc5316 100755 --- a/indra/llui/llfolderviewmodel.cpp +++ b/indra/llui/llfolderviewmodel.cpp @@ -48,7 +48,7 @@ std::string LLFolderViewModelCommon::getStatusText() void LLFolderViewModelCommon::filter() { - getFilter().setFilterCount(llclamp(LLUI::sSettingGroups["config"]->getS32("FilterItemsPerFrame"), 1, 5000)); + getFilter().resetTime(llclamp(LLUI::sSettingGroups["config"]->getS32("FilterItemsMaxTimePerFrameVisible"), 1, 100)); mFolderView->getViewModelItem()->filter(getFilter()); } diff --git a/indra/llui/llfolderviewmodel.h b/indra/llui/llfolderviewmodel.h index 1b61212c0e..b1bcc8bbb4 100755 --- a/indra/llui/llfolderviewmodel.h +++ b/indra/llui/llfolderviewmodel.h @@ -87,12 +87,11 @@ public: virtual void setModified(EFilterModified behavior = FILTER_RESTART) = 0; // +-------------------------------------------------------------------+ - // + Count + // + Time // +-------------------------------------------------------------------+ - virtual void setFilterCount(S32 count) = 0; - virtual S32 getFilterCount() const = 0; - virtual void decrementFilterCount() = 0; - + virtual void resetTime(S32 timeout) = 0; + virtual bool isTimedOut() = 0; + // +-------------------------------------------------------------------+ // + Default // +-------------------------------------------------------------------+ @@ -308,26 +307,28 @@ public: virtual bool potentiallyVisible() { return passedFilter() // we've passed the filter - || getLastFilterGeneration() < mRootViewModel.getFilter().getFirstSuccessGeneration() // or we don't know yet + || (getLastFilterGeneration() < mRootViewModel.getFilter().getFirstSuccessGeneration()) // or we don't know yet || descendantsPassedFilter(); } virtual bool passedFilter(S32 filter_generation = -1) { - if (filter_generation < 0) + if (filter_generation < 0) + { filter_generation = mRootViewModel.getFilter().getFirstSuccessGeneration(); - - bool passed_folder_filter = mPassedFolderFilter && mLastFolderFilterGeneration >= filter_generation; - bool passed_filter = mPassedFilter && mLastFilterGeneration >= filter_generation; - return passed_folder_filter - && (descendantsPassedFilter(filter_generation) - || passed_filter); + } + bool passed_folder_filter = mPassedFolderFilter && (mLastFolderFilterGeneration >= filter_generation); + bool passed_filter = mPassedFilter && (mLastFilterGeneration >= filter_generation); + return passed_folder_filter && (passed_filter || descendantsPassedFilter(filter_generation)); } virtual bool descendantsPassedFilter(S32 filter_generation = -1) { - if (filter_generation < 0) filter_generation = mRootViewModel.getFilter().getFirstSuccessGeneration(); - return mMostFilteredDescendantGeneration >= filter_generation; + if (filter_generation < 0) + { + filter_generation = mRootViewModel.getFilter().getFirstSuccessGeneration(); + } + return mMostFilteredDescendantGeneration >= filter_generation; } diff --git a/indra/llui/llkeywords.cpp b/indra/llui/llkeywords.cpp index 315cf45f43..93e8c084e9 100755 --- a/indra/llui/llkeywords.cpp +++ b/indra/llui/llkeywords.cpp @@ -586,7 +586,6 @@ void LLKeywords::findSegments(std::vector<LLTextSegmentPtr>* seg_list, const LLW const llwchar* base = wtext.c_str(); const llwchar* cur = base; - while( *cur ) { if( *cur == '\n' || cur == base ) diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index e33ac1d5c2..c89c0203b4 100755 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -214,8 +214,15 @@ LLLayoutStack::Params::Params() open_time_constant("open_time_constant", 0.02f), close_time_constant("close_time_constant", 0.03f), resize_bar_overlap("resize_bar_overlap", 1), - border_size("border_size", LLCachedControl<S32>(*LLUI::sSettingGroups["config"], "UIResizeBarHeight", 0)) -{} + border_size("border_size", LLCachedControl<S32>(*LLUI::sSettingGroups["config"], "UIResizeBarHeight", 0)), + show_drag_handle("show_drag_handle", false), + drag_handle_first_indent("drag_handle_first_indent", 0), + drag_handle_second_indent("drag_handle_second_indent", 0), + drag_handle_thickness("drag_handle_thickness", 5), + drag_handle_shift("drag_handle_shift", 2) +{ + addSynonym(border_size, "drag_handle_gap"); +} LLLayoutStack::LLLayoutStack(const LLLayoutStack::Params& p) : LLView(p), @@ -227,8 +234,14 @@ LLLayoutStack::LLLayoutStack(const LLLayoutStack::Params& p) mClip(p.clip), mOpenTimeConstant(p.open_time_constant), mCloseTimeConstant(p.close_time_constant), - mResizeBarOverlap(p.resize_bar_overlap) -{} + mResizeBarOverlap(p.resize_bar_overlap), + mShowDragHandle(p.show_drag_handle), + mDragHandleFirstIndent(p.drag_handle_first_indent), + mDragHandleSecondIndent(p.drag_handle_second_indent), + mDragHandleThickness(p.drag_handle_thickness), + mDragHandleShift(p.drag_handle_shift) +{ +} LLLayoutStack::~LLLayoutStack() { @@ -262,6 +275,26 @@ void LLLayoutStack::draw() drawChild(panelp, 0, 0, !clip_rect.isEmpty()); } } + + const LLView::child_list_t * child_listp = getChildList(); + BOOST_FOREACH(LLView * childp, * child_listp) + { + LLResizeBar * resize_barp = dynamic_cast<LLResizeBar*>(childp); + if (resize_barp && resize_barp->isShowDragHandle() && resize_barp->getVisible() && resize_barp->getRect().isValid()) + { + LLRect screen_rect = resize_barp->calcScreenRect(); + if (LLUI::getRootView()->getLocalRect().overlaps(screen_rect) && LLUI::sDirtyRect.overlaps(screen_rect)) + { + LLUI::pushMatrix(); + { + const LLRect& rb_rect(resize_barp->getRect()); + LLUI::translate(rb_rect.mLeft, rb_rect.mBottom); + resize_barp->draw(); + } + LLUI::popMatrix(); + } + } + } } void LLLayoutStack::removeChild(LLView* view) @@ -390,7 +423,6 @@ void LLLayoutStack::updateLayout() BOOST_FOREACH(LLLayoutPanel* panelp, mPanels) { F32 panel_dim = llmax(panelp->getExpandedMinDim(), panelp->mTargetDim); - F32 panel_visible_dim = panelp->getVisibleDim(); LLRect panel_rect; if (mOrientation == HORIZONTAL) @@ -407,27 +439,61 @@ void LLLayoutStack::updateLayout() getRect().getWidth(), llround(panel_dim)); } - panelp->setIgnoreReshape(true); - panelp->setShape(panel_rect); - panelp->setIgnoreReshape(false); LLRect resize_bar_rect(panel_rect); - + LLResizeBar * resize_barp = panelp->getResizeBar(); + bool show_drag_handle = resize_barp->isShowDragHandle(); F32 panel_spacing = (F32)mPanelSpacing * panelp->getVisibleAmount(); + F32 panel_visible_dim = panelp->getVisibleDim(); + S32 panel_spacing_round = (S32)(llround(panel_spacing)); + if (mOrientation == HORIZONTAL) { - resize_bar_rect.mLeft = panel_rect.mRight - mResizeBarOverlap; - resize_bar_rect.mRight = panel_rect.mRight + (S32)(llround(panel_spacing)) + mResizeBarOverlap; - cur_pos += panel_visible_dim + panel_spacing; + + if (show_drag_handle && panel_spacing_round > mDragHandleThickness) + { + resize_bar_rect.mLeft = panel_rect.mRight + mDragHandleShift; + resize_bar_rect.mRight = resize_bar_rect.mLeft + mDragHandleThickness; + } + else + { + resize_bar_rect.mLeft = panel_rect.mRight - mResizeBarOverlap; + resize_bar_rect.mRight = panel_rect.mRight + panel_spacing_round + mResizeBarOverlap; + } + + if (show_drag_handle) + { + resize_bar_rect.mBottom += mDragHandleSecondIndent; + resize_bar_rect.mTop -= mDragHandleFirstIndent; + } + } else //VERTICAL { - resize_bar_rect.mTop = panel_rect.mBottom + mResizeBarOverlap; - resize_bar_rect.mBottom = panel_rect.mBottom - (S32)(llround(panel_spacing)) - mResizeBarOverlap; - cur_pos -= panel_visible_dim + panel_spacing; + + if (show_drag_handle && panel_spacing_round > mDragHandleThickness) + { + resize_bar_rect.mTop = panel_rect.mBottom - mDragHandleShift; + resize_bar_rect.mBottom = resize_bar_rect.mTop - mDragHandleThickness; + } + else + { + resize_bar_rect.mTop = panel_rect.mBottom + mResizeBarOverlap; + resize_bar_rect.mBottom = panel_rect.mBottom - panel_spacing_round - mResizeBarOverlap; + } + + if (show_drag_handle) + { + resize_bar_rect.mLeft += mDragHandleFirstIndent; + resize_bar_rect.mRight -= mDragHandleSecondIndent; + } } + + panelp->setIgnoreReshape(true); + panelp->setShape(panel_rect); + panelp->setIgnoreReshape(false); panelp->mResizeBar->setShape(resize_bar_rect); } @@ -475,14 +541,13 @@ void LLLayoutStack::createResizeBar(LLLayoutPanel* panelp) { if (lp->mResizeBar == NULL) { - LLResizeBar::Side side = (mOrientation == HORIZONTAL) ? LLResizeBar::RIGHT : LLResizeBar::BOTTOM; - LLResizeBar::Params resize_params; resize_params.name("resize"); resize_params.resizing_view(lp); resize_params.min_size(lp->getRelevantMinDim()); - resize_params.side(side); + resize_params.side((mOrientation == HORIZONTAL) ? LLResizeBar::RIGHT : LLResizeBar::BOTTOM); resize_params.snapping_enabled(false); + resize_params.show_drag_handle(mShowDragHandle); LLResizeBar* resize_bar = LLUICtrlFactory::create<LLResizeBar>(resize_params); lp->mResizeBar = resize_bar; LLView::addChild(resize_bar, 0); @@ -864,3 +929,4 @@ void LLLayoutStack::updateResizeBarLimits() previous_visible_panelp = visible_panelp; } } + diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h index 02c664f1a0..add43fa741 100755 --- a/indra/llui/lllayoutstack.h +++ b/indra/llui/lllayoutstack.h @@ -38,6 +38,7 @@ class LLLayoutPanel; class LLLayoutStack : public LLView, public LLInstanceTracker<LLLayoutStack> { public: + typedef enum e_layout_orientation { HORIZONTAL, @@ -62,6 +63,11 @@ public: Optional<F32> open_time_constant, close_time_constant; Optional<S32> resize_bar_overlap; + Optional<bool> show_drag_handle; + Optional<S32> drag_handle_first_indent; + Optional<S32> drag_handle_second_indent; + Optional<S32> drag_handle_thickness; + Optional<S32> drag_handle_shift; Params(); }; @@ -126,6 +132,11 @@ private: F32 mCloseTimeConstant; bool mNeedsLayout; S32 mResizeBarOverlap; + bool mShowDragHandle; + S32 mDragHandleFirstIndent; + S32 mDragHandleSecondIndent; + S32 mDragHandleThickness; + S32 mDragHandleShift; }; // end class LLLayoutStack diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index f7bf39c897..f854e1785d 100755 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -3146,6 +3146,13 @@ void LLMenuGL::showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y) const S32 CURSOR_HEIGHT = 22; // Approximate "normal" cursor size const S32 CURSOR_WIDTH = 12; + if (menu->getChildList()->empty()) + { + return; + } + + menu->setVisible( TRUE ); + //Do not show menu if all menu items are disabled BOOL item_enabled = false; for (LLView::child_list_t::const_iterator itor = menu->getChildList()->begin(); @@ -3156,8 +3163,9 @@ void LLMenuGL::showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y) item_enabled = item_enabled || menu_item->getEnabled(); } - if(menu->getChildList()->empty() || !item_enabled) + if(!item_enabled) { + menu->setVisible( FALSE ); return; } @@ -3173,8 +3181,6 @@ void LLMenuGL::showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y) menu->mFirstVisibleItem = NULL; } - menu->setVisible( TRUE ); - // Fix menu rect if needed. menu->needsArrange(); menu->arrangeAndClear(); diff --git a/indra/llui/llmodaldialog.h b/indra/llui/llmodaldialog.h index 4e09d11d77..f81273b96a 100755 --- a/indra/llui/llmodaldialog.h +++ b/indra/llui/llmodaldialog.h @@ -40,7 +40,7 @@ class LLModalDialog : public LLFloater { public: LLModalDialog( const LLSD& key, BOOL modal = true ); - /*virtual*/ ~LLModalDialog(); + virtual ~LLModalDialog(); /*virtual*/ BOOL postBuild(); diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index 1789f003b9..3186c5460a 100755 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -214,7 +214,7 @@ LLNotificationForm::LLNotificationForm(const std::string& name, const LLNotifica } else { - LLUI::sSettingGroups["ignores"]->declareBOOL(name, show_notification, "Show notification with this name", TRUE); + LLUI::sSettingGroups["ignores"]->declareBOOL(name, show_notification, "Show notification with this name", LLControlVariable::PERSIST_NONDFT); mIgnoreSetting = LLUI::sSettingGroups["ignores"]->getControl(name); } } @@ -1125,7 +1125,7 @@ LLNotificationChannel::LLNotificationChannel(const Params& p) mName(p.name.isProvided() ? p.name : LLUUID::generateNewID().asString()) { BOOST_FOREACH(const std::string& source, p.sources) -{ + { connectToChannel(source); } } @@ -1209,6 +1209,10 @@ LLNotifications::LLNotifications() LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Notification.Show", boost::bind(&LLNotifications::addFromCallback, this, _2)); } +void LLNotifications::clear() +{ + mDefaultChannels.clear(); +} // The expiration channel gets all notifications that are cancelled bool LLNotifications::expirationFilter(LLNotificationPtr pNotification) diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index 87573c2a56..3b620084ee 100755 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -138,6 +138,7 @@ typedef LLFunctorRegistration<LLNotificationResponder> LLNotificationFunctorRegi class LLNotificationContext : public LLInstanceTracker<LLNotificationContext, LLUUID> { public: + LLNotificationContext() : LLInstanceTracker<LLNotificationContext, LLUUID>(LLUUID::generateNewID()) { } @@ -873,6 +874,13 @@ class LLNotifications : friend class LLSingleton<LLNotifications>; public: + + // Needed to clear up RefCounted things prior to actual destruction + // as the singleton nature of the class makes them do "bad things" + // on at least Mac, if not all 3 platforms + // + void clear(); + // load all notification descriptions from file // calling more than once will overwrite existing templates // but never delete a template diff --git a/indra/llui/llresizebar.cpp b/indra/llui/llresizebar.cpp index 15e56cbfe5..e67b22c977 100755 --- a/indra/llui/llresizebar.cpp +++ b/indra/llui/llresizebar.cpp @@ -28,14 +28,53 @@ #include "llresizebar.h" +#include "lllocalcliprect.h" #include "llmath.h" #include "llui.h" #include "llmenugl.h" #include "llfocusmgr.h" #include "llwindow.h" +class LLImagePanel : public LLPanel +{ +public: + struct Params : public LLInitParam::Block<Params, LLPanel::Params> + { + Optional<bool> horizontal; + Params() : horizontal("horizontal", false) {} + }; + LLImagePanel(const Params& p) : LLPanel(p), mHorizontal(p.horizontal) {} + virtual ~LLImagePanel() {} + + void draw() + { + const LLRect& parent_rect = getParent()->getRect(); + const LLRect& rect = getRect(); + LLRect clip_rect( -rect.mLeft, parent_rect.getHeight() - rect.mBottom - 2 + , parent_rect.getWidth() - rect.mLeft - (mHorizontal ? 2 : 0), -rect.mBottom); + LLLocalClipRect clip(clip_rect); + LLPanel::draw(); + } + +private: + bool mHorizontal; +}; + +static LLDefaultChildRegistry::Register<LLImagePanel> t1("resize_bar_image_panel"); + +LLResizeBar::Params::Params() +: max_size("max_size", S32_MAX), + snapping_enabled("snapping_enabled", true), + resizing_view("resizing_view"), + side("side"), + allow_double_click_snapping("allow_double_click_snapping", true), + show_drag_handle("show_drag_handle", false) +{ + name = "resize_bar"; +} + LLResizeBar::LLResizeBar(const LLResizeBar::Params& p) -: LLView(p), +: LLPanel(p), mDragLastScreenX( 0 ), mDragLastScreenY( 0 ), mLastMouseScreenX( 0 ), @@ -46,7 +85,9 @@ LLResizeBar::LLResizeBar(const LLResizeBar::Params& p) mSnappingEnabled(p.snapping_enabled), mAllowDoubleClickSnapping(p.allow_double_click_snapping), mResizingView(p.resizing_view), - mResizeListener(NULL) + mResizeListener(NULL), + mShowDragHandle(p.show_drag_handle), + mImagePanel(NULL) { setFollowsNone(); // set up some generically good follow code. @@ -75,8 +116,37 @@ LLResizeBar::LLResizeBar(const LLResizeBar::Params& p) default: break; } + + if (mShowDragHandle) + { + LLViewBorder::Params border_params; + border_params.border_thickness = 1; + border_params.highlight_light_color = LLUIColorTable::instance().getColor("ResizebarBorderLight"); + border_params.shadow_dark_color = LLUIColorTable::instance().getColor("ResizebarBorderDark"); + + addBorder(border_params); + setBorderVisible(TRUE); + + LLImagePanel::Params image_panel; + mDragHandleImage = LLUI::getUIImage(LLResizeBar::RIGHT == mSide ? "Vertical Drag Handle" : "Horizontal Drag Handle"); + image_panel.bg_alpha_image = mDragHandleImage; + image_panel.background_visible = true; + image_panel.horizontal = (LLResizeBar::BOTTOM == mSide); + mImagePanel = LLUICtrlFactory::create<LLImagePanel>(image_panel); + setImagePanel(mImagePanel); + } } +BOOL LLResizeBar::postBuild() +{ + if (mShowDragHandle) + { + setBackgroundVisible(TRUE); + setTransparentColor(LLUIColorTable::instance().getColor("ResizebarBody")); + } + + return LLPanel::postBuild(); +} BOOL LLResizeBar::handleMouseDown(S32 x, S32 y, MASK mask) { @@ -342,3 +412,39 @@ BOOL LLResizeBar::handleDoubleClick(S32 x, S32 y, MASK mask) return TRUE; } +void LLResizeBar::setImagePanel(LLPanel * panelp) +{ + const LLView::child_list_t * children = getChildList(); + if (getChildCount() == 2) + { + LLPanel * image_panelp = dynamic_cast<LLPanel*>(children->back()); + if (image_panelp) + { + removeChild(image_panelp); + delete image_panelp; + } + } + + addChild(panelp); + sendChildToBack(panelp); +} + +LLPanel * LLResizeBar::getImagePanel() const +{ + return getChildCount() > 0 ? (LLPanel *)getChildList()->back() : NULL; +} + +void LLResizeBar::draw() +{ + if (mShowDragHandle) + { + S32 image_width = mDragHandleImage->getTextureWidth(); + S32 image_height = mDragHandleImage->getTextureHeight(); + const LLRect& panel_rect = getRect(); + S32 image_left = (panel_rect.getWidth() - image_width) / 2 - 1; + S32 image_bottom = (panel_rect.getHeight() - image_height) / 2; + mImagePanel->setRect(LLRect(image_left, image_bottom + image_height, image_left + image_width, image_bottom)); + } + + LLPanel::draw(); +} diff --git a/indra/llui/llresizebar.h b/indra/llui/llresizebar.h index 8190a95a71..bcf8ea0b40 100755 --- a/indra/llui/llresizebar.h +++ b/indra/llui/llresizebar.h @@ -27,15 +27,14 @@ #ifndef LL_RESIZEBAR_H #define LL_RESIZEBAR_H -#include "llview.h" -#include "llcoord.h" +#include "llpanel.h" -class LLResizeBar : public LLView +class LLResizeBar : public LLPanel { public: enum Side { LEFT, TOP, RIGHT, BOTTOM }; - struct Params : public LLInitParam::Block<Params, LLView::Params> + struct Params : public LLInitParam::Block<Params, LLPanel::Params> { Mandatory<LLView*> resizing_view; Mandatory<Side> side; @@ -44,24 +43,19 @@ public: Optional<S32> max_size; Optional<bool> snapping_enabled; Optional<bool> allow_double_click_snapping; + Optional<bool> show_drag_handle; - Params() - : max_size("max_size", S32_MAX), - snapping_enabled("snapping_enabled", true), - resizing_view("resizing_view"), - side("side"), - allow_double_click_snapping("allow_double_click_snapping", true) - { - name = "resize_bar"; - } + Params(); }; protected: LLResizeBar(const LLResizeBar::Params& p); friend class LLUICtrlFactory; + + /*virtual*/ BOOL postBuild(); public: -// virtual void draw(); No appearance + virtual void draw(); virtual BOOL handleHover(S32 x, S32 y, MASK mask); virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); @@ -72,20 +66,26 @@ public: void setAllowDoubleClickSnapping(BOOL allow) { mAllowDoubleClickSnapping = allow; } bool canResize() { return getEnabled() && mMaxSize > mMinSize; } void setResizeListener(boost::function<void(void*)> listener) {mResizeListener = listener;} + BOOL isShowDragHandle() const { return mShowDragHandle; } + void setImagePanel(LLPanel * panelp); + LLPanel * getImagePanel() const; private: - S32 mDragLastScreenX; - S32 mDragLastScreenY; - S32 mLastMouseScreenX; - S32 mLastMouseScreenY; - LLCoordGL mLastMouseDir; - S32 mMinSize; - S32 mMaxSize; - const Side mSide; - BOOL mSnappingEnabled; - BOOL mAllowDoubleClickSnapping; - LLView* mResizingView; - boost::function<void(void*)> mResizeListener; + S32 mDragLastScreenX; + S32 mDragLastScreenY; + S32 mLastMouseScreenX; + S32 mLastMouseScreenY; + LLCoordGL mLastMouseDir; + S32 mMinSize; + S32 mMaxSize; + const Side mSide; + BOOL mSnappingEnabled; + BOOL mAllowDoubleClickSnapping; + BOOL mShowDragHandle; + LLView* mResizingView; + boost::function<void(void*)> mResizeListener; + LLPointer<LLUIImage> mDragHandleImage; + LLPanel * mImagePanel; }; #endif // LL_RESIZEBAR_H diff --git a/indra/llui/llscrolllistcolumn.cpp b/indra/llui/llscrolllistcolumn.cpp index af124d9826..cc9ff7a487 100755 --- a/indra/llui/llscrolllistcolumn.cpp +++ b/indra/llui/llscrolllistcolumn.cpp @@ -236,7 +236,8 @@ void LLScrollColumnHeader::handleReshape(const LLRect& new_rect, bool by_user) // tell scroll list to layout columns again // do immediate update to get proper feedback to resize handle // which needs to know how far the resize actually went - mColumn->mParentCtrl->updateColumns(); + const bool force_update = true; + mColumn->mParentCtrl->updateColumns(force_update); } } diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index 7f04c92b27..6e03f604a2 100755 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -615,7 +615,6 @@ S32 LLScrollListCtrl::calcMaxContentWidth() if (mColumnWidthsDirty) { - mColumnWidthsDirty = false; // update max content width for this column, by looking at all items column->mMaxContentWidth = column->mHeader ? LLFontGL::getFontSansSerifSmall()->getWidth(column->mLabel) + mColumnPadding + HEADING_TEXT_PADDING : 0; item_list::iterator iter; @@ -629,6 +628,7 @@ S32 LLScrollListCtrl::calcMaxContentWidth() } max_item_width += column->mMaxContentWidth; } + mColumnWidthsDirty = false; return max_item_width; } @@ -643,7 +643,7 @@ bool LLScrollListCtrl::updateColumnWidths() if (!column) continue; // update column width - S32 new_width = column->getWidth(); + S32 new_width = 0; if (column->mRelWidth >= 0) { new_width = (S32)llround(column->mRelWidth*mItemListRect.getWidth()); @@ -652,6 +652,10 @@ bool LLScrollListCtrl::updateColumnWidths() { new_width = (mItemListRect.getWidth() - mTotalStaticColumnWidth - mTotalColumnPadding) / mNumDynamicWidthColumns; } + else + { + new_width = column->getWidth(); + } if (column->getWidth() != new_width) { @@ -693,9 +697,9 @@ void LLScrollListCtrl::updateLineHeightInsert(LLScrollListItem* itemp) } -void LLScrollListCtrl::updateColumns() +void LLScrollListCtrl::updateColumns(bool force_update) { - if (!mColumnsDirty) + if (!mColumnsDirty && !force_update) return; mColumnsDirty = false; @@ -749,7 +753,7 @@ void LLScrollListCtrl::updateColumns() } // propagate column widths to individual cells - if (columns_changed_width) + if (columns_changed_width || force_update) { item_list::iterator iter; for (iter = mItemList.begin(); iter != mItemList.end(); iter++) @@ -1179,10 +1183,10 @@ LLScrollListItem* LLScrollListCtrl::addSeparator(EAddPosition pos) // Selects first enabled item of the given name. // Returns false if item not found. // Calls getItemByLabel in order to combine functionality -BOOL LLScrollListCtrl::selectItemByLabel(const std::string& label, BOOL case_sensitive) +BOOL LLScrollListCtrl::selectItemByLabel(const std::string& label, BOOL case_sensitive, S32 column/* = 0*/) { deselectAllItems(TRUE); // ensure that no stale items are selected, even if we don't find a match - LLScrollListItem* item = getItemByLabel(label, case_sensitive); + LLScrollListItem* item = getItemByLabel(label, case_sensitive, column); bool found = NULL != item; if(found) diff --git a/indra/llui/llscrolllistctrl.h b/indra/llui/llscrolllistctrl.h index 8fa06cc499..c61e281a31 100755 --- a/indra/llui/llscrolllistctrl.h +++ b/indra/llui/llscrolllistctrl.h @@ -241,7 +241,7 @@ public: // one of which can be selected at a time. virtual LLScrollListItem* addSimpleElement(const std::string& value, EAddPosition pos = ADD_BOTTOM, const LLSD& id = LLSD()); - BOOL selectItemByLabel( const std::string& item, BOOL case_sensitive = TRUE ); // FALSE if item not found + BOOL selectItemByLabel( const std::string& item, BOOL case_sensitive = TRUE, S32 column = 0 ); // FALSE if item not found BOOL selectItemByPrefix(const std::string& target, BOOL case_sensitive = TRUE); BOOL selectItemByPrefix(const LLWString& target, BOOL case_sensitive = TRUE); LLScrollListItem* getItemByLabel( const std::string& item, BOOL case_sensitive = TRUE, S32 column = 0 ); @@ -342,7 +342,7 @@ public: static void onClickColumn(void *userdata); - virtual void updateColumns(); + virtual void updateColumns(bool force_update = false); S32 calcMaxContentWidth(); bool updateColumnWidths(); diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index a45c4ced2e..cc171661ce 100755 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -180,6 +180,7 @@ LLTextBase::Params::Params() LLTextBase::LLTextBase(const LLTextBase::Params &p) : LLUICtrl(p, LLTextViewModelPtr(new LLTextViewModel)), mURLClickSignal(NULL), + mIsFriendSignal(NULL), mMaxTextByteLength( p.max_text_length ), mFont(p.font), mFontShadow(p.font_shadow), @@ -653,6 +654,10 @@ void LLTextBase::drawText() mSpellCheckEnd = end; } } + else + { + mMisspellRanges.clear(); + } LLTextSegmentPtr cur_segment = *seg_iter; @@ -1850,7 +1855,17 @@ LLTextBase::segment_set_t::iterator LLTextBase::getSegIterContaining(S32 index) static LLPointer<LLIndexSegment> index_segment = new LLIndexSegment(); - if (index > getLength()) { return mSegments.end(); } + S32 text_len = 0; + if (!useLabel()) + { + text_len = getLength(); + } + else + { + text_len = mLabel.getWString().length(); + } + + if (index > text_len) { return mSegments.end(); } // when there are no segments, we return the end iterator, which must be checked by caller if (mSegments.size() <= 1) { return mSegments.begin(); } @@ -1866,7 +1881,17 @@ LLTextBase::segment_set_t::const_iterator LLTextBase::getSegIterContaining(S32 i { static LLPointer<LLIndexSegment> index_segment = new LLIndexSegment(); - if (index > getLength()) { return mSegments.end(); } + S32 text_len = 0; + if (!useLabel()) + { + text_len = getLength(); + } + else + { + text_len = mLabel.getWString().length(); + } + + if (index > text_len) { return mSegments.end(); } // when there are no segments, we return the end iterator, which must be checked by caller if (mSegments.size() <= 1) { return mSegments.begin(); } @@ -1916,9 +1941,12 @@ void LLTextBase::createUrlContextMenu(S32 x, S32 y, const std::string &in_url) registrar.add("Url.OpenInternal", boost::bind(&LLUrlAction::openURLInternal, url)); registrar.add("Url.OpenExternal", boost::bind(&LLUrlAction::openURLExternal, url)); registrar.add("Url.Execute", boost::bind(&LLUrlAction::executeSLURL, url)); + registrar.add("Url.Block", boost::bind(&LLUrlAction::blockObject, url)); registrar.add("Url.Teleport", boost::bind(&LLUrlAction::teleportToLocation, url)); registrar.add("Url.ShowProfile", boost::bind(&LLUrlAction::showProfile, url)); registrar.add("Url.AddFriend", boost::bind(&LLUrlAction::addFriend, url)); + registrar.add("Url.RemoveFriend", boost::bind(&LLUrlAction::removeFriend, url)); + registrar.add("Url.SendIM", boost::bind(&LLUrlAction::sendIM, url)); registrar.add("Url.ShowOnMap", boost::bind(&LLUrlAction::showLocationOnMap, url)); registrar.add("Url.CopyLabel", boost::bind(&LLUrlAction::copyLabelToClipboard, url)); registrar.add("Url.CopyUrl", boost::bind(&LLUrlAction::copyURLToClipboard, url)); @@ -1927,6 +1955,19 @@ void LLTextBase::createUrlContextMenu(S32 x, S32 y, const std::string &in_url) delete mPopupMenu; mPopupMenu = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>(xui_file, LLMenuGL::sMenuContainer, LLMenuHolderGL::child_registry_t::instance()); + if (mIsFriendSignal) + { + bool isFriend = *(*mIsFriendSignal)(LLUUID(LLUrlAction::getUserID(url))); + LLView* addFriendButton = mPopupMenu->getChild<LLView>("add_friend"); + LLView* removeFriendButton = mPopupMenu->getChild<LLView>("remove_friend"); + + if (addFriendButton && removeFriendButton) + { + addFriendButton->setEnabled(!isFriend); + removeFriendButton->setEnabled(isFriend); + } + } + if (mPopupMenu) { mPopupMenu->show(x, y); @@ -2096,7 +2137,7 @@ void LLTextBase::resetLabel() } } -bool LLTextBase::useLabel() +bool LLTextBase::useLabel() const { return !getLength() && !mLabel.empty() && !hasFocus(); } @@ -2338,7 +2379,6 @@ S32 LLTextBase::getDocIndexFromLocalCoord( S32 local_x, S32 local_y, BOOL round, { // Figure out which line we're nearest to. LLRect doc_rect = mDocumentView->getRect(); - S32 doc_y = local_y - doc_rect.mBottom; // binary search for line that starts before local_y @@ -2602,21 +2642,18 @@ void LLTextBase::setCursorAtLocalPos( S32 local_x, S32 local_y, bool round, bool void LLTextBase::changeLine( S32 delta ) { S32 line = getLineNumFromDocIndex(mCursorPos); + S32 max_line_nb = getLineCount() - 1; + max_line_nb = (max_line_nb < 0 ? 0 : max_line_nb); + + S32 new_line = llclamp(line + delta, 0, max_line_nb); - S32 new_line = line; - if( (delta < 0) && (line > 0 ) ) - { - new_line = line - 1; - } - else if( (delta > 0) && (line < (getLineCount() - 1)) ) - { - new_line = line + 1; - } - - LLRect visible_region = getVisibleDocumentRect(); - - S32 new_cursor_pos = getDocIndexFromLocalCoord(mDesiredXPixel, mLineInfoList[new_line].mRect.mBottom + mVisibleTextRect.mBottom - visible_region.mBottom, TRUE); - setCursorPos(new_cursor_pos, true); + if (new_line != line) + { + LLRect visible_region = getVisibleDocumentRect(); + S32 new_cursor_pos = getDocIndexFromLocalCoord(mDesiredXPixel, + mLineInfoList[new_line].mRect.mBottom + mVisibleTextRect.mBottom - visible_region.mBottom, TRUE); + setCursorPos(new_cursor_pos, true); + } } bool LLTextBase::scrolledToStart() @@ -2910,6 +2947,15 @@ boost::signals2::connection LLTextBase::setURLClickedCallback(const commit_signa return mURLClickSignal->connect(cb); } +boost::signals2::connection LLTextBase::setIsFriendCallback(const is_friend_signal_t::slot_type& cb) +{ + if (!mIsFriendSignal) + { + mIsFriendSignal = new is_friend_signal_t(); + } + return mIsFriendSignal->connect(cb); +} + // // LLTextSegment // @@ -3203,7 +3249,7 @@ S32 LLNormalTextSegment::getNumChars(S32 num_pixels, S32 segment_offset, S32 lin : LLFontGL::ONLY_WORD_BOUNDARIES; - LLWString offsetString(text.c_str() + segment_offset + mStart); + S32 offsetLength = text.length() - (segment_offset + mStart); if(getLength() < segment_offset + mStart) { @@ -3211,13 +3257,13 @@ S32 LLNormalTextSegment::getNumChars(S32 num_pixels, S32 segment_offset, S32 lin << segment_offset << "\tmStart:\t" << mStart << "\tsegments\t" << mEditor.mSegments.size() << "\tmax_chars\t" << max_chars << llendl; } - if(offsetString.length() + 1 < max_chars) + if( (offsetLength + 1) < max_chars) { - llinfos << "offsetString.length() + 1 < max_chars\t max_chars:\t" << max_chars << "\toffsetString.length():\t" << offsetString.length() << " getLength() : " + llinfos << "offsetString.length() + 1 < max_chars\t max_chars:\t" << max_chars << "\toffsetLength:\t" << offsetLength << " getLength() : " << getLength() << "\tsegment_offset:\t" << segment_offset << "\tmStart:\t" << mStart << "\tsegments\t" << mEditor.mSegments.size() << llendl; } - S32 num_chars = mStyle->getFont()->maxDrawableChars(offsetString.c_str(), + S32 num_chars = mStyle->getFont()->maxDrawableChars( text.c_str() + (segment_offset + mStart), (F32)num_pixels, max_chars, word_wrap_style); diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index 20a73387b5..a74e97cac8 100755 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -258,6 +258,8 @@ public: friend class LLNormalTextSegment; friend class LLUICtrlFactory; + typedef boost::signals2::signal<bool (const LLUUID& user_id)> is_friend_signal_t; + struct LineSpacingParams : public LLInitParam::ChoiceBlock<LineSpacingParams> { Alternative<F32> multiple; @@ -434,6 +436,7 @@ public: virtual void appendImageSegment(const LLStyle::Params& style_params); virtual void appendWidget(const LLInlineViewSegment::Params& params, const std::string& text, bool allow_undo); boost::signals2::connection setURLClickedCallback(const commit_signal_t::slot_type& cb); + boost::signals2::connection setIsFriendCallback(const is_friend_signal_t::slot_type& cb); void setWordWrap(bool wrap); LLScrollContainer* getScrollContainer() const { return mScroller; } @@ -507,7 +510,7 @@ protected: void initFromParams(const Params& p); virtual void beforeValueChange(); virtual void onValueChange(S32 start, S32 end); - virtual bool useLabel(); + virtual bool useLabel() const; // draw methods void drawSelectionBackground(); // draws the black box behind the selected text @@ -648,6 +651,9 @@ protected: // Fired when a URL link is clicked commit_signal_t* mURLClickSignal; + // Used to check if user with given ID is avatar's friend + is_friend_signal_t* mIsFriendSignal; + LLUIString mLabel; // text label that is visible when no user text provided }; diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 83d89af4b0..4bab68b339 100755 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -1125,7 +1125,8 @@ void LLTextEditor::addChar(llwchar wc) } } -void LLTextEditor::addLineBreakChar() + +void LLTextEditor::addLineBreakChar(BOOL group_together) { if( !getEnabled() ) { @@ -1143,7 +1144,7 @@ void LLTextEditor::addLineBreakChar() LLStyleConstSP sp(new LLStyle(LLStyle::Params())); LLTextSegmentPtr segment = new LLLineBreakTextSegment(sp, mCursorPos); - S32 pos = execute(new TextCmdAddChar(mCursorPos, FALSE, '\n', segment)); + S32 pos = execute(new TextCmdAddChar(mCursorPos, group_together, '\n', segment)); setCursorPos(mCursorPos + pos); } @@ -1484,21 +1485,28 @@ void LLTextEditor::pasteTextWithLinebreaks(LLWString & clean_string) std::basic_string<llwchar>::size_type start = 0; std::basic_string<llwchar>::size_type pos = clean_string.find('\n',start); - while(pos!=-1) + while((pos != -1) && (pos != clean_string.length() -1)) { if(pos!=start) { std::basic_string<llwchar> str = std::basic_string<llwchar>(clean_string,start,pos-start); - setCursorPos(mCursorPos + insert(mCursorPos, str, FALSE, LLTextSegmentPtr())); + setCursorPos(mCursorPos + insert(mCursorPos, str, TRUE, LLTextSegmentPtr())); } - addLineBreakChar(); - + addLineBreakChar(TRUE); // Add a line break and group with the next addition. + start = pos+1; pos = clean_string.find('\n',start); } - std::basic_string<llwchar> str = std::basic_string<llwchar>(clean_string,start,clean_string.length()-start); - setCursorPos(mCursorPos + insert(mCursorPos, str, FALSE, LLTextSegmentPtr())); + if (pos != start) + { + std::basic_string<llwchar> str = std::basic_string<llwchar>(clean_string,start,clean_string.length()-start); + setCursorPos(mCursorPos + insert(mCursorPos, str, FALSE, LLTextSegmentPtr())); + } + else + { + addLineBreakChar(FALSE); // Add a line break and end the grouping. + } } // copy selection to primary @@ -1964,8 +1972,7 @@ void LLTextEditor::onFocusReceived() updateAllowingLanguageInput(); } -// virtual, from LLView -void LLTextEditor::onFocusLost() +void LLTextEditor::focusLostHelper() { updateAllowingLanguageInput(); @@ -1982,7 +1989,11 @@ void LLTextEditor::onFocusLost() // Make sure cursor is shown again getWindow()->showCursorFromMouseMove(); +} +void LLTextEditor::onFocusLost() +{ + focusLostHelper(); LLTextBase::onFocusLost(); } @@ -2128,12 +2139,17 @@ void LLTextEditor::drawPreeditMarker() continue; } - S32 preedit_left = mVisibleTextRect.mLeft; + line_info& line = mLineInfoList[cur_line]; + LLRect text_rect(line.mRect); + text_rect.mRight = mDocumentView->getRect().getWidth(); // clamp right edge to document extents + text_rect.translate(mDocumentView->getRect().mLeft, mDocumentView->getRect().mBottom); // adjust by scroll position + + S32 preedit_left = text_rect.mLeft; if (left > line_start) { preedit_left += mFont->getWidth(text, line_start, left - line_start); } - S32 preedit_right = mVisibleTextRect.mLeft; + S32 preedit_right = text_rect.mLeft; if (right < line_end) { preedit_right += mFont->getWidth(text, line_start, right - line_start); @@ -2146,18 +2162,18 @@ void LLTextEditor::drawPreeditMarker() if (mPreeditStandouts[i]) { gl_rect_2d(preedit_left + preedit_standout_gap, - line_y + preedit_standout_position, - preedit_right - preedit_standout_gap - 1, - line_y + preedit_standout_position - preedit_standout_thickness, - (mCursorColor.get() * preedit_standout_brightness + mWriteableBgColor.get() * (1 - preedit_standout_brightness)).setAlpha(1.0f)); + text_rect.mBottom + mFont->getDescenderHeight() - 1, + preedit_right - preedit_standout_gap - 1, + text_rect.mBottom + mFont->getDescenderHeight() - 1 - preedit_standout_thickness, + (mCursorColor.get() * preedit_standout_brightness + mWriteableBgColor.get() * (1 - preedit_standout_brightness)).setAlpha(1.0f)); } else { gl_rect_2d(preedit_left + preedit_marker_gap, - line_y + preedit_marker_position, - preedit_right - preedit_marker_gap - 1, - line_y + preedit_marker_position - preedit_marker_thickness, - (mCursorColor.get() * preedit_marker_brightness + mWriteableBgColor.get() * (1 - preedit_marker_brightness)).setAlpha(1.0f)); + text_rect.mBottom + mFont->getDescenderHeight() - 1, + preedit_right - preedit_marker_gap - 1, + text_rect.mBottom + mFont->getDescenderHeight() - 1 - preedit_marker_thickness, + (mCursorColor.get() * preedit_marker_brightness + mWriteableBgColor.get() * (1 - preedit_marker_brightness)).setAlpha(1.0f)); } } } @@ -2240,12 +2256,13 @@ void LLTextEditor::draw() LLRect clip_rect(mVisibleTextRect); clip_rect.stretch(1); LLLocalClipRect clip(clip_rect); - drawPreeditMarker(); } LLTextBase::draw(); drawLineNumbers(); + drawPreeditMarker(); + //RN: the decision was made to always show the orange border for keyboard focus but do not put an insertion caret // when in readonly mode mBorder->setKeyboardFocusHighlight( hasFocus() );// && !mReadOnly); @@ -2689,14 +2706,20 @@ BOOL LLTextEditor::hasPreeditString() const void LLTextEditor::resetPreedit() { + if (hasSelection()) + { + if (hasPreeditString()) + { + llwarns << "Preedit and selection!" << llendl; + deselect(); + } + else + { + deleteSelection(TRUE); + } + } if (hasPreeditString()) { - if (hasSelection()) - { - llwarns << "Preedit and selection!" << llendl; - deselect(); - } - setCursorPos(mPreeditPositions.front()); removeStringNoUndo(mCursorPos, mPreeditPositions.back() - mCursorPos); insertStringNoUndo(mCursorPos, mPreeditOverwrittenWString); @@ -2744,7 +2767,10 @@ void LLTextEditor::updatePreedit(const LLWString &preedit_string, { mPreeditOverwrittenWString.clear(); } - insertStringNoUndo(insert_preedit_at, mPreeditWString); + + segment_vec_t segments; + //pass empty segments to let "insertStringNoUndo" make new LLNormalTextSegment and insert it, if needed. + insertStringNoUndo(insert_preedit_at, mPreeditWString, &segments); mPreeditStandouts = preedit_standouts; diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h index 2a0a0d524f..8cc0e03712 100755 --- a/indra/llui/lltexteditor.h +++ b/indra/llui/lltexteditor.h @@ -252,13 +252,14 @@ protected: // Undoable operations void addChar(llwchar c); // at mCursorPos S32 addChar(S32 pos, llwchar wc); - void addLineBreakChar(); + void addLineBreakChar(BOOL group_together = FALSE); S32 overwriteChar(S32 pos, llwchar wc); void removeChar(); S32 removeChar(S32 pos); S32 insert(S32 pos, const LLWString &wstr, bool group_with_next_op, LLTextSegmentPtr segment); S32 remove(S32 pos, S32 length, bool group_with_next_op); + void focusLostHelper(); void updateAllowingLanguageInput(); BOOL hasPreeditString() const; diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index 3d9f5cbbc2..928e82cb8c 100755 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -381,7 +381,7 @@ bool LLToolBar::stopCommandInProgress(const LLCommandId& commandId) return (command_button != NULL); } -bool LLToolBar::flashCommand(const LLCommandId& commandId, bool flash) +bool LLToolBar::flashCommand(const LLCommandId& commandId, bool flash, bool force_flashing/* = false */) { LLButton * command_button = NULL; @@ -391,7 +391,7 @@ bool LLToolBar::flashCommand(const LLCommandId& commandId, bool flash) if (it != mButtonMap.end()) { command_button = it->second; - command_button->setFlashing(flash ? TRUE : FALSE); + command_button->setFlashing((BOOL)(flash),(BOOL)(force_flashing)); } } diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 31424a36d4..743951a41f 100755 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -192,7 +192,7 @@ public: bool hasCommand(const LLCommandId& commandId) const; // is this command bound to a button in this toolbar bool enableCommand(const LLCommandId& commandId, bool enabled); // enable/disable button bound to the specified command, if it exists in this toolbar bool stopCommandInProgress(const LLCommandId& commandId); // stop command if it is currently active - bool flashCommand(const LLCommandId& commandId, bool flash); // flash button associated with given command, if in this toolbar + bool flashCommand(const LLCommandId& commandId, bool flash, bool force_flashing = false); // flash button associated with given command, if in this toolbar void setStartDragCallback(tool_startdrag_callback_t cb) { mStartDragItemCallback = cb; } // connects drag and drop behavior to external logic void setHandleDragCallback(tool_handledrag_callback_t cb) { mHandleDragItemCallback = cb; } diff --git a/indra/llui/llurlaction.cpp b/indra/llui/llurlaction.cpp index f51aeaec13..23e574cb74 100755 --- a/indra/llui/llurlaction.cpp +++ b/indra/llui/llurlaction.cpp @@ -170,6 +170,30 @@ std::string LLUrlAction::getUserID(std::string url) return id_str; } +std::string LLUrlAction::getObjectId(std::string url) +{ + LLURI uri(url); + LLSD path_array = uri.pathArray(); + std::string id_str; + if (path_array.size() >= 3) + { + id_str = path_array.get(2).asString(); + } + return id_str; +} + +std::string LLUrlAction::getObjectName(std::string url) +{ + LLURI uri(url); + LLSD query_map = uri.queryMap(); + std::string name; + if (query_map.has("name")) + { + name = query_map["name"].asString(); + } + return name; +} + void LLUrlAction::sendIM(std::string url) { std::string id_str = getUserID(url); @@ -188,3 +212,21 @@ void LLUrlAction::addFriend(std::string url) } } +void LLUrlAction::removeFriend(std::string url) +{ + std::string id_str = getUserID(url); + if (LLUUID::validate(id_str)) + { + executeSLURL("secondlife:///app/agent/" + id_str + "/removefriend"); + } +} + +void LLUrlAction::blockObject(std::string url) +{ + std::string object_id = getObjectId(url); + std::string object_name = getObjectName(url); + if (LLUUID::validate(object_id)) + { + executeSLURL("secondlife:///app/agent/" + object_id + "/block/" + object_name); + } +} diff --git a/indra/llui/llurlaction.h b/indra/llui/llurlaction.h index e31cd71a20..e731376b95 100755 --- a/indra/llui/llurlaction.h +++ b/indra/llui/llurlaction.h @@ -77,8 +77,12 @@ public: /// if the Url specifies an SL command in the form like 'app/{cmd}/{id}/*', show its profile static void showProfile(std::string url); static std::string getUserID(std::string url); + static std::string getObjectName(std::string url); + static std::string getObjectId(std::string url); static void sendIM(std::string url); static void addFriend(std::string url); + static void removeFriend(std::string url); + static void blockObject(std::string url); /// specify the callbacks to enable this class's functionality typedef boost::function<void (const std::string&)> url_callback_t; diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index 99ee688888..b1cc502c4b 100755 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -504,6 +504,10 @@ std::string localize_slapp_label(const std::string& url, const std::string& full { return LLTrans::getString("SLappAgentRequestFriend") + " " + full_name; } + if (LLStringUtil::endsWith(url, "/removefriend")) + { + return LLTrans::getString("SLappAgentRemoveFriend") + " " + full_name; + } return full_name; } diff --git a/indra/llvfs/lldir.h b/indra/llvfs/lldir.h index cc10ed5bbd..e02bf552aa 100755 --- a/indra/llvfs/lldir.h +++ b/indra/llvfs/lldir.h @@ -32,7 +32,7 @@ #define MAX_PATH MAXPATHLEN #endif -// these numbers *may* get serialized (really??), so we need to be explicit +// these numbers are read from settings_files.xml, so we need to be explicit typedef enum ELLPath { LL_PATH_NONE = 0, diff --git a/indra/llvfs/lldir_mac.cpp b/indra/llvfs/lldir_mac.cpp index c5041d434c..e00596cdb5 100755 --- a/indra/llvfs/lldir_mac.cpp +++ b/indra/llvfs/lldir_mac.cpp @@ -134,7 +134,7 @@ LLDir_Mac::LLDir_Mac() { mOSCacheDir = *cachedir; - //SPATTERS TODO: This changes from ~/Library/Cache/Secondlife to ~/Library/Cache/com.app.secondlife/Secondlife. Last dir level could go away. + //Aura TODO: This changes from ~/Library/Cache/Secondlife to ~/Library/Cache/com.app.secondlife/Secondlife. Last dir level could go away. CreateDirectory(mOSCacheDir, secondLifeString, NULL); } diff --git a/indra/llvfs/llvfs_objc.mm b/indra/llvfs/llvfs_objc.mm index 4f9e2f81e9..47b0e73978 100755 --- a/indra/llvfs/llvfs_objc.mm +++ b/indra/llvfs/llvfs_objc.mm @@ -58,7 +58,7 @@ std::string* findSystemDirectory(NSSearchPathDirectory searchPathDirectory, if ([paths count]) { path = [paths objectAtIndex:0]; - //SPATTERS HACK: Always attempt to create directory, ignore errors. + //HACK: Always attempt to create directory, ignore errors. NSError *error = nil; [[NSFileManager defaultManager] createDirectoryAtPath:path withIntermediateDirectories:YES attributes:nil error:&error]; diff --git a/indra/llwindow/CMakeLists.txt b/indra/llwindow/CMakeLists.txt index 4c6e706119..aec6d7af4a 100755 --- a/indra/llwindow/CMakeLists.txt +++ b/indra/llwindow/CMakeLists.txt @@ -109,11 +109,14 @@ if (DARWIN) llkeyboardmacosx.cpp llwindowmacosx.cpp llwindowmacosx-objc.mm + llopenglview-objc.mm ) list(APPEND llwindow_HEADER_FILES llkeyboardmacosx.h llwindowmacosx.h llwindowmacosx-objc.h + llopenglview-objc.h + llappdelegate-objc.h ) # We use a bunch of deprecated system APIs. diff --git a/indra/llwindow/llappdelegate-objc.h b/indra/llwindow/llappdelegate-objc.h new file mode 100644 index 0000000000..faa5d3abb7 --- /dev/null +++ b/indra/llwindow/llappdelegate-objc.h @@ -0,0 +1,48 @@ +/** + * @file llappdelegate-objc.h + * @brief Class interface for the Mac version's application delegate. + * + * $LicenseInfo:firstyear=2000&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#import <Cocoa/Cocoa.h> +#import "llopenglview-objc.h" + +@interface LLAppDelegate : NSObject <NSApplicationDelegate> { + LLNSWindow *window; + NSWindow *inputWindow; + LLNonInlineTextView *inputView; + NSTimer *frameTimer; + NSString *currentInputLanguage; +} + +@property (assign) IBOutlet LLNSWindow *window; +@property (assign) IBOutlet NSWindow *inputWindow; +@property (assign) IBOutlet LLNonInlineTextView *inputView; + +@property (retain) NSString *currentInputLanguage; + +- (void) mainLoop; +- (void) showInputWindow:(bool)show withEvent:(NSEvent*)textEvent; +- (void) languageUpdated; +- (bool) romanScript; +@end diff --git a/indra/llwindow/lldragdropwin32.h b/indra/llwindow/lldragdropwin32.h index 929e7f9e37..a6824f3e90 100755 --- a/indra/llwindow/lldragdropwin32.h +++ b/indra/llwindow/lldragdropwin32.h @@ -57,7 +57,7 @@ class LLDragDropWin32 #include <windows.h> #include <ole2.h> -// imposter class that does nothing +// impostor class that does nothing class LLDragDropWin32 { public: diff --git a/indra/llwindow/llkeyboard.h b/indra/llwindow/llkeyboard.h index c155c1b362..92449c123f 100755 --- a/indra/llwindow/llkeyboard.h +++ b/indra/llwindow/llkeyboard.h @@ -82,6 +82,11 @@ public: virtual BOOL handleKeyUp(const U16 key, MASK mask) = 0; virtual BOOL handleKeyDown(const U16 key, MASK mask) = 0; + +#ifdef LL_DARWIN + // We only actually use this for OS X. + virtual void handleModifier(MASK mask) = 0; +#endif // LL_DARWIN // Asynchronously poll the control, alt, and shift keys and set the // appropriate internal key masks. diff --git a/indra/llwindow/llkeyboardheadless.cpp b/indra/llwindow/llkeyboardheadless.cpp index c87617c9ff..a1b6b294e0 100755 --- a/indra/llwindow/llkeyboardheadless.cpp +++ b/indra/llwindow/llkeyboardheadless.cpp @@ -45,6 +45,13 @@ BOOL LLKeyboardHeadless::handleKeyUp(const U16 key, const U32 mask) MASK LLKeyboardHeadless::currentMask(BOOL for_mouse_event) { return MASK_NONE; } +#ifdef LL_DARWIN +void LLKeyboardHeadless::handleModifier(MASK mask) +{ + +} +#endif + void LLKeyboardHeadless::scanKeyboard() { for (S32 key = 0; key < KEY_COUNT; key++) diff --git a/indra/llwindow/llkeyboardheadless.h b/indra/llwindow/llkeyboardheadless.h index 4e666f8ce8..8ed28ace90 100755 --- a/indra/llwindow/llkeyboardheadless.h +++ b/indra/llwindow/llkeyboardheadless.h @@ -40,6 +40,9 @@ public: /*virtual*/ void resetMaskKeys(); /*virtual*/ MASK currentMask(BOOL for_mouse_event); /*virtual*/ void scanKeyboard(); +#ifdef LL_DARWIN + /*virtual*/ void handleModifier(MASK mask); +#endif }; #endif diff --git a/indra/llwindow/llkeyboardmacosx.cpp b/indra/llwindow/llkeyboardmacosx.cpp index 7f8f303517..85bb7b9aeb 100755 --- a/indra/llwindow/llkeyboardmacosx.cpp +++ b/indra/llwindow/llkeyboardmacosx.cpp @@ -30,7 +30,7 @@ #include "llkeyboardmacosx.h" #include "llwindowcallbacks.h" -#include <Carbon/Carbon.h> +#include "llwindowmacosx-objc.h" LLKeyboardMacOSX::LLKeyboardMacOSX() { @@ -162,23 +162,25 @@ LLKeyboardMacOSX::LLKeyboardMacOSX() void LLKeyboardMacOSX::resetMaskKeys() { - U32 mask = GetCurrentEventKeyModifiers(); + U32 mask = getModifiers(); // MBW -- XXX -- This mirrors the operation of the Windows version of resetMaskKeys(). // It looks a bit suspicious, as it won't correct for keys that have been released. // Is this the way it's supposed to work? + + // We apply the modifier masks directly within getModifiers. So check to see which masks we've applied. - if(mask & shiftKey) + if(mask & MAC_SHIFT_KEY) { mKeyLevel[KEY_SHIFT] = TRUE; } - if(mask & (controlKey)) + if(mask & MAC_CTRL_KEY) { mKeyLevel[KEY_CONTROL] = TRUE; } - if(mask & optionKey) + if(mask & MAC_ALT_KEY) { mKeyLevel[KEY_ALT] = TRUE; } @@ -196,22 +198,27 @@ static BOOL translateKeyMac(const U16 key, const U32 mask, KEY &outKey, U32 &out } */ +void LLKeyboardMacOSX::handleModifier(MASK mask) +{ + updateModifiers(mask); +} + MASK LLKeyboardMacOSX::updateModifiers(const U32 mask) { // translate the mask MASK out_mask = 0; - if(mask & shiftKey) + if(mask & MAC_SHIFT_KEY) { out_mask |= MASK_SHIFT; } - if(mask & (controlKey | cmdKey)) + if(mask & (MAC_CTRL_KEY | MAC_CMD_KEY)) { out_mask |= MASK_CONTROL; } - if(mask & optionKey) + if(mask & MAC_ALT_KEY) { out_mask |= MASK_ALT; } @@ -231,7 +238,7 @@ BOOL LLKeyboardMacOSX::handleKeyDown(const U16 key, const U32 mask) { handled = handleTranslatedKeyDown(translated_key, translated_mask); } - + return handled; } @@ -255,18 +262,18 @@ BOOL LLKeyboardMacOSX::handleKeyUp(const U16 key, const U32 mask) MASK LLKeyboardMacOSX::currentMask(BOOL for_mouse_event) { MASK result = MASK_NONE; - U32 mask = GetCurrentEventKeyModifiers(); + U32 mask = getModifiers(); - if (mask & shiftKey) result |= MASK_SHIFT; - if (mask & controlKey) result |= MASK_CONTROL; - if (mask & optionKey) result |= MASK_ALT; + if (mask & MAC_SHIFT_KEY) result |= MASK_SHIFT; + if (mask & MAC_CTRL_KEY) result |= MASK_CONTROL; + if (mask & MAC_ALT_KEY) result |= MASK_ALT; // For keyboard events, consider Command equivalent to Control if (!for_mouse_event) { - if (mask & cmdKey) result |= MASK_CONTROL; + if (mask & MAC_CMD_KEY) result |= MASK_CONTROL; } - + return result; } diff --git a/indra/llwindow/llkeyboardmacosx.h b/indra/llwindow/llkeyboardmacosx.h index f09ff720ce..f9d014ab70 100755 --- a/indra/llwindow/llkeyboardmacosx.h +++ b/indra/llwindow/llkeyboardmacosx.h @@ -29,6 +29,15 @@ #include "llkeyboard.h" +// These more or less mirror their equivalents in NSEvent.h. +enum EMacEventKeys { + MAC_SHIFT_KEY = 1 << 17, + MAC_CTRL_KEY = 1 << 18, + MAC_ALT_KEY = 1 << 19, + MAC_CMD_KEY = 1 << 20, + MAC_FN_KEY = 1 << 23 +}; + class LLKeyboardMacOSX : public LLKeyboard { public: @@ -40,6 +49,7 @@ public: /*virtual*/ void resetMaskKeys(); /*virtual*/ MASK currentMask(BOOL for_mouse_event); /*virtual*/ void scanKeyboard(); + /*virtual*/ void handleModifier(MASK mask); protected: MASK updateModifiers(const U32 mask); diff --git a/indra/llwindow/llopenglview-objc.h b/indra/llwindow/llopenglview-objc.h new file mode 100644 index 0000000000..1e0e47cd02 --- /dev/null +++ b/indra/llwindow/llopenglview-objc.h @@ -0,0 +1,111 @@ +/** + * @file llopenglview-objc.h + * @brief Class interfaces for most of the Mac facing window functionality. + * + * $LicenseInfo:firstyear=2000&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LLOpenGLView_H +#define LLOpenGLView_H + +#import <Cocoa/Cocoa.h> +#import <IOKit/IOKitLib.h> +#import <CoreFoundation/CFBase.h> +#import <CoreFoundation/CFNumber.h> +#include <string> + +@interface LLOpenGLView : NSOpenGLView <NSTextInputClient> +{ + std::string mLastDraggedUrl; + unsigned int mModifiers; + float mMousePos[2]; + bool mHasMarkedText; + unsigned int mMarkedTextLength; + bool mMarkedTextAllowed; + bool mSimulatedRightClick; +} +- (id) initWithSamples:(NSUInteger)samples; +- (id) initWithSamples:(NSUInteger)samples andVsync:(BOOL)vsync; +- (id) initWithFrame:(NSRect)frame withSamples:(NSUInteger)samples andVsync:(BOOL)vsync; + +- (void)commitCurrentPreedit; + +// rebuildContext +// Destroys and recreates a context with the view's internal format set via setPixelFormat; +// Use this in event of needing to rebuild a context for whatever reason, without needing to assign a new pixel format. +- (BOOL) rebuildContext; + +// rebuildContextWithFormat +// Destroys and recreates a context with the specified pixel format. +- (BOOL) rebuildContextWithFormat:(NSOpenGLPixelFormat *)format; + +// These are mostly just for C++ <-> Obj-C interop. We can manipulate the CGLContext from C++ without reprecussions. +- (CGLContextObj) getCGLContextObj; +- (CGLPixelFormatObj*)getCGLPixelFormatObj; + +- (unsigned long) getVramSize; + +- (void) allowMarkedTextInput:(bool)allowed; +- (void) viewDidEndLiveResize; + +@end + +@interface LLUserInputWindow : NSPanel + +@end + +@interface LLNonInlineTextView : NSTextView +{ + LLOpenGLView *glview; +} + +- (void) setGLView:(LLOpenGLView*)view; + +@end + +@interface LLNSWindow : NSWindow + +- (NSPoint)convertToScreenFromLocalPoint:(NSPoint)point relativeToView:(NSView *)view; +- (NSPoint)flipPoint:(NSPoint)aPoint; + +@end + +@interface NSScreen (PointConversion) + +/* + Returns the screen where the mouse resides + */ ++ (NSScreen *)currentScreenForMouseLocation; + +/* + Allows you to convert a point from global coordinates to the current screen coordinates. + */ +- (NSPoint)convertPointToScreenCoordinates:(NSPoint)aPoint; + +/* + Allows to flip the point coordinates, so y is 0 at the top instead of the bottom. x remains the same + */ +- (NSPoint)flipPoint:(NSPoint)aPoint; + +@end + +#endif diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm new file mode 100644 index 0000000000..7415c9d8dc --- /dev/null +++ b/indra/llwindow/llopenglview-objc.mm @@ -0,0 +1,692 @@ +/** + * @file llopenglview-objc.mm + * @brief Class implementation for most of the Mac facing window functionality. + * + * $LicenseInfo:firstyear=2000&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#import "llopenglview-objc.h" +#include "llwindowmacosx-objc.h" +#import "llappdelegate-objc.h" + +@implementation NSScreen (PointConversion) + ++ (NSScreen *)currentScreenForMouseLocation +{ + NSPoint mouseLocation = [NSEvent mouseLocation]; + + NSEnumerator *screenEnumerator = [[NSScreen screens] objectEnumerator]; + NSScreen *screen; + while ((screen = [screenEnumerator nextObject]) && !NSMouseInRect(mouseLocation, screen.frame, NO)) + ; + + return screen; +} + +- (NSPoint)convertPointToScreenCoordinates:(NSPoint)aPoint +{ + float normalizedX = fabs(fabs(self.frame.origin.x) - fabs(aPoint.x)); + float normalizedY = aPoint.y - self.frame.origin.y; + + return NSMakePoint(normalizedX, normalizedY); +} + +- (NSPoint)flipPoint:(NSPoint)aPoint +{ + return NSMakePoint(aPoint.x, self.frame.size.height - aPoint.y); +} + +@end + +attributedStringInfo getSegments(NSAttributedString *str) +{ + attributedStringInfo segments; + segment_lengths seg_lengths; + segment_standouts seg_standouts; + NSRange effectiveRange; + NSRange limitRange = NSMakeRange(0, [str length]); + + while (limitRange.length > 0) { + NSNumber *attr = [str attribute:NSUnderlineStyleAttributeName atIndex:limitRange.location longestEffectiveRange:&effectiveRange inRange:limitRange]; + limitRange = NSMakeRange(NSMaxRange(effectiveRange), NSMaxRange(limitRange) - NSMaxRange(effectiveRange)); + + if (effectiveRange.length <= 0) + { + effectiveRange.length = 1; + } + + if ([attr integerValue] == 2) + { + seg_lengths.push_back(effectiveRange.length); + seg_standouts.push_back(true); + } else + { + seg_lengths.push_back(effectiveRange.length); + seg_standouts.push_back(false); + } + } + segments.seg_lengths = seg_lengths; + segments.seg_standouts = seg_standouts; + return segments; +} + +@implementation LLOpenGLView + +// Force a high quality update after live resizing +- (void) viewDidEndLiveResize +{ + NSSize size = [self frame].size; + callResize(size.width, size.height); +} + +- (unsigned long)getVramSize +{ + CGLRendererInfoObj info = 0; + GLint vram_bytes = 0; + int num_renderers = 0; + CGLError the_err = CGLQueryRendererInfo (CGDisplayIDToOpenGLDisplayMask(kCGDirectMainDisplay), &info, &num_renderers); + if(0 == the_err) + { + CGLDescribeRenderer (info, 0, kCGLRPTextureMemory, &vram_bytes); + CGLDestroyRendererInfo (info); + } + else + { + vram_bytes = (256 << 20); + } + + return (unsigned long)vram_bytes / 1048576; // We need this in megabytes. +} + +- (void)viewDidMoveToWindow +{ + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(windowResized:) name:NSWindowDidResizeNotification + object:[self window]]; +} + +- (void)windowResized:(NSNotification *)notification; +{ + //NSSize size = [self frame].size; + //callResize(size.width, size.height); +} + +- (void)dealloc +{ + [[NSNotificationCenter defaultCenter] removeObserver:self]; + [super dealloc]; +} + +- (id) init +{ + return [self initWithFrame:[self bounds] withSamples:2 andVsync:TRUE]; +} + +- (id) initWithSamples:(NSUInteger)samples +{ + return [self initWithFrame:[self bounds] withSamples:samples andVsync:TRUE]; +} + +- (id) initWithSamples:(NSUInteger)samples andVsync:(BOOL)vsync +{ + return [self initWithFrame:[self bounds] withSamples:samples andVsync:vsync]; +} + +- (id) initWithFrame:(NSRect)frame withSamples:(NSUInteger)samples andVsync:(BOOL)vsync +{ + [self registerForDraggedTypes:[NSArray arrayWithObject:NSURLPboardType]]; + [self initWithFrame:frame]; + + // Initialize with a default "safe" pixel format that will work with versions dating back to OS X 10.6. + // Any specialized pixel formats, i.e. a core profile pixel format, should be initialized through rebuildContextWithFormat. + // 10.7 and 10.8 don't really care if we're defining a profile or not. If we don't explicitly request a core or legacy profile, it'll always assume a legacy profile (for compatibility reasons). + NSOpenGLPixelFormatAttribute attrs[] = { + NSOpenGLPFANoRecovery, + NSOpenGLPFADoubleBuffer, + NSOpenGLPFAClosestPolicy, + NSOpenGLPFAAccelerated, + NSOpenGLPFASampleBuffers, (samples > 0 ? 1 : 0), + NSOpenGLPFASamples, samples, + NSOpenGLPFAStencilSize, 8, + NSOpenGLPFADepthSize, 24, + NSOpenGLPFAAlphaSize, 8, + NSOpenGLPFAColorSize, 24, + 0 + }; + + NSOpenGLPixelFormat *pixelFormat = [[[NSOpenGLPixelFormat alloc] initWithAttributes:attrs] autorelease]; + + if (pixelFormat == nil) + { + NSLog(@"Failed to create pixel format!", nil); + return nil; + } + + NSOpenGLContext *glContext = [[NSOpenGLContext alloc] initWithFormat:pixelFormat shareContext:nil]; + + if (glContext == nil) + { + NSLog(@"Failed to create OpenGL context!", nil); + return nil; + } + + [self setPixelFormat:pixelFormat]; + + [self setOpenGLContext:glContext]; + + [glContext setView:self]; + + [glContext makeCurrentContext]; + + if (vsync) + { + [glContext setValues:(const GLint*)1 forParameter:NSOpenGLCPSwapInterval]; + } else { + [glContext setValues:(const GLint*)0 forParameter:NSOpenGLCPSwapInterval]; + } + + return self; +} + +- (BOOL) rebuildContext +{ + return [self rebuildContextWithFormat:[self pixelFormat]]; +} + +- (BOOL) rebuildContextWithFormat:(NSOpenGLPixelFormat *)format +{ + NSOpenGLContext *ctx = [self openGLContext]; + + [ctx clearDrawable]; + [ctx initWithFormat:format shareContext:nil]; + + if (ctx == nil) + { + NSLog(@"Failed to create OpenGL context!", nil); + return false; + } + + [self setOpenGLContext:ctx]; + [ctx setView:self]; + [ctx makeCurrentContext]; + return true; +} + +- (CGLContextObj)getCGLContextObj +{ + NSOpenGLContext *ctx = [self openGLContext]; + return (CGLContextObj)[ctx CGLContextObj]; +} + +- (CGLPixelFormatObj*)getCGLPixelFormatObj +{ + NSOpenGLPixelFormat *fmt = [self pixelFormat]; + return (CGLPixelFormatObj*)[fmt CGLPixelFormatObj]; +} + +// Various events can be intercepted by our view, thus not reaching our window. +// Intercept these events, and pass them to the window as needed. - Geenz + +- (void) mouseDown:(NSEvent *)theEvent +{ + // Apparently people still use this? + if ([theEvent modifierFlags] & NSCommandKeyMask && + !([theEvent modifierFlags] & NSControlKeyMask) && + !([theEvent modifierFlags] & NSShiftKeyMask) && + !([theEvent modifierFlags] & NSAlternateKeyMask) && + !([theEvent modifierFlags] & NSAlphaShiftKeyMask) && + !([theEvent modifierFlags] & NSFunctionKeyMask) && + !([theEvent modifierFlags] & NSHelpKeyMask)) + { + callRightMouseDown(mMousePos, mModifiers); + mSimulatedRightClick = true; + } else { + if ([theEvent clickCount] >= 2) + { + callDoubleClick(mMousePos, mModifiers); + } else if ([theEvent clickCount] == 1) { + callLeftMouseDown(mMousePos, mModifiers); + } + } +} + +- (void) mouseUp:(NSEvent *)theEvent +{ + if (mSimulatedRightClick) + { + callRightMouseUp(mMousePos, mModifiers); + mSimulatedRightClick = false; + } else { + callLeftMouseUp(mMousePos, mModifiers); + } +} + +- (void) rightMouseDown:(NSEvent *)theEvent +{ + callRightMouseDown(mMousePos, mModifiers); +} + +- (void) rightMouseUp:(NSEvent *)theEvent +{ + callRightMouseUp(mMousePos, mModifiers); +} + +- (void)mouseMoved:(NSEvent *)theEvent +{ + float mouseDeltas[2] = { + [theEvent deltaX], + [theEvent deltaY] + }; + + callDeltaUpdate(mouseDeltas, 0); + + NSPoint mPoint = [theEvent locationInWindow]; + mMousePos[0] = mPoint.x; + mMousePos[1] = mPoint.y; + callMouseMoved(mMousePos, 0); +} + +// NSWindow doesn't trigger mouseMoved when the mouse is being clicked and dragged. +// Use mouseDragged for situations like this to trigger our movement callback instead. + +- (void) mouseDragged:(NSEvent *)theEvent +{ + // Trust the deltas supplied by NSEvent. + // The old CoreGraphics APIs we previously relied on are now flagged as obsolete. + // NSEvent isn't obsolete, and provides us with the correct deltas. + float mouseDeltas[2] = { + [theEvent deltaX], + [theEvent deltaY] + }; + + callDeltaUpdate(mouseDeltas, 0); + + NSPoint mPoint = [theEvent locationInWindow]; + mMousePos[0] = mPoint.x; + mMousePos[1] = mPoint.y; + callMouseMoved(mMousePos, 0); +} + +- (void) otherMouseDown:(NSEvent *)theEvent +{ + callMiddleMouseDown(mMousePos, mModifiers); +} + +- (void) otherMouseUp:(NSEvent *)theEvent +{ + callMiddleMouseUp(mMousePos, mModifiers); +} + +- (void) otherMouseDragged:(NSEvent *)theEvent +{ + +} + +- (void) scrollWheel:(NSEvent *)theEvent +{ + callScrollMoved(-[theEvent deltaY]); +} + +- (void) mouseExited:(NSEvent *)theEvent +{ + callMouseExit(); +} + +- (void) keyUp:(NSEvent *)theEvent +{ + callKeyUp([theEvent keyCode], mModifiers); +} + +- (void) keyDown:(NSEvent *)theEvent +{ + uint keycode = [theEvent keyCode]; + bool acceptsText = mHasMarkedText ? false : callKeyDown(keycode, mModifiers); + if (acceptsText && + !mMarkedTextAllowed && + ![(LLAppDelegate*)[NSApp delegate] romanScript] && + [[theEvent charactersIgnoringModifiers] characterAtIndex:0] != NSDeleteCharacter && + [[theEvent charactersIgnoringModifiers] characterAtIndex:0] != NSBackspaceCharacter && + [[theEvent charactersIgnoringModifiers] characterAtIndex:0] != NSDownArrowFunctionKey && + [[theEvent charactersIgnoringModifiers] characterAtIndex:0] != NSUpArrowFunctionKey && + [[theEvent charactersIgnoringModifiers] characterAtIndex:0] != NSLeftArrowFunctionKey && + [[theEvent charactersIgnoringModifiers] characterAtIndex:0] != NSRightArrowFunctionKey) + { + [(LLAppDelegate*)[NSApp delegate] showInputWindow:true withEvent:theEvent]; + } else + { + [[self inputContext] handleEvent:theEvent]; + } + + if ([[theEvent charactersIgnoringModifiers] characterAtIndex:0] == NSCarriageReturnCharacter || + [[theEvent charactersIgnoringModifiers] characterAtIndex:0] == NSEnterCharacter) + { + // callKeyDown won't return the value we expect for enter or return. Handle them as a separate case. + [[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. + if (mModifiers & NSCommandKeyMask && !mHasMarkedText) + { + callKeyUp([theEvent keyCode], mModifiers); + } +} + +- (void)flagsChanged:(NSEvent *)theEvent { + mModifiers = [theEvent modifierFlags]; + callModifier([theEvent modifierFlags]); +} + +- (BOOL) acceptsFirstResponder +{ + return YES; +} + +- (NSDragOperation) draggingEntered:(id<NSDraggingInfo>)sender +{ + NSPasteboard *pboard; + NSDragOperation sourceDragMask; + + sourceDragMask = [sender draggingSourceOperationMask]; + + pboard = [sender draggingPasteboard]; + + if ([[pboard types] containsObject:NSURLPboardType]) + { + if (sourceDragMask & NSDragOperationLink) { + NSURL *fileUrl = [[pboard readObjectsForClasses:[NSArray arrayWithObject:[NSURL class]] options:[NSDictionary dictionary]] objectAtIndex:0]; + mLastDraggedUrl = [[fileUrl absoluteString] UTF8String]; + return NSDragOperationLink; + } + } + return NSDragOperationNone; +} + +- (NSDragOperation)draggingUpdated:(id <NSDraggingInfo>)sender +{ + callHandleDragUpdated(mLastDraggedUrl); + + return NSDragOperationLink; +} + +- (void) draggingExited:(id<NSDraggingInfo>)sender +{ + callHandleDragExited(mLastDraggedUrl); +} + +- (BOOL)prepareForDragOperation:(id < NSDraggingInfo >)sender +{ + return YES; +} + +- (BOOL) performDragOperation:(id<NSDraggingInfo>)sender +{ + callHandleDragDropped(mLastDraggedUrl); + return true; +} + +- (BOOL)hasMarkedText +{ + return mHasMarkedText; +} + +- (NSRange)markedRange +{ + int range[2]; + getPreeditMarkedRange(&range[0], &range[1]); + return NSMakeRange(range[0], range[1]); +} + +- (NSRange)selectedRange +{ + int range[2]; + getPreeditSelectionRange(&range[0], &range[1]); + return NSMakeRange(range[0], range[1]); +} + +- (void)setMarkedText:(id)aString selectedRange:(NSRange)selectedRange replacementRange:(NSRange)replacementRange +{ + if ([aString class] == NSClassFromString(@"NSConcreteMutableAttributedString")) + { + if (mMarkedTextAllowed) + { + unsigned int selected[2] = { + selectedRange.location, + selectedRange.length + }; + + unsigned int replacement[2] = { + replacementRange.location, + replacementRange.length + }; + + unichar text[[aString length]]; + [[aString mutableString] getCharacters:text range:NSMakeRange(0, [aString length])]; + attributedStringInfo segments = getSegments((NSAttributedString *)aString); + setMarkedText(text, selected, replacement, [aString length], segments); + mHasMarkedText = TRUE; + mMarkedTextLength = [aString length]; + } else { + if (mHasMarkedText) + { + [self unmarkText]; + } + } + } +} + +- (void)commitCurrentPreedit +{ + if (mHasMarkedText) + { + if ([[self inputContext] respondsToSelector:@selector(commitEditing)]) + { + [[self inputContext] commitEditing]; + } + } +} + +- (void)unmarkText +{ + [[self inputContext] discardMarkedText]; + resetPreedit(); + mHasMarkedText = FALSE; +} + +// We don't support attributed strings. +- (NSArray *)validAttributesForMarkedText +{ + return [NSArray array]; +} + +// See above. +- (NSAttributedString *)attributedSubstringForProposedRange:(NSRange)aRange actualRange:(NSRangePointer)actualRange +{ + return nil; +} + +- (void)insertText:(id)insertString +{ + if (insertString != nil) + { + [self insertText:insertString replacementRange:NSMakeRange(0, [insertString length])]; + } +} + +- (void)insertText:(id)aString replacementRange:(NSRange)replacementRange +{ + if (!mHasMarkedText) + { + for (NSInteger i = 0; i < [aString length]; i++) + { + callUnicodeCallback([aString characterAtIndex:i], mModifiers); + } + } else { + resetPreedit(); + // We may never get this point since unmarkText may be called before insertText ever gets called once we submit our text. + // But just in case... + + for (NSInteger i = 0; i < [aString length]; i++) + { + handleUnicodeCharacter([aString characterAtIndex:i]); + } + mHasMarkedText = FALSE; + } +} + +- (void) insertNewline:(id)sender +{ + if (!(mModifiers & NSCommandKeyMask) && + !(mModifiers & NSShiftKeyMask) && + !(mModifiers & NSAlternateKeyMask)) + { + callUnicodeCallback(13, 0); + } else { + callUnicodeCallback(13, mModifiers); + } +} + +- (NSUInteger)characterIndexForPoint:(NSPoint)aPoint +{ + return NSNotFound; +} + +- (NSRect)firstRectForCharacterRange:(NSRange)aRange actualRange:(NSRangePointer)actualRange +{ + float pos[4] = {0, 0, 0, 0}; + getPreeditLocation(pos, mMarkedTextLength); + return NSMakeRect(pos[0], pos[1], pos[2], pos[3]); +} + +- (void)doCommandBySelector:(SEL)aSelector +{ + if (aSelector == @selector(insertNewline:)) + { + [self insertNewline:self]; + } +} + +- (BOOL)drawsVerticallyForCharacterAtIndex:(NSUInteger)charIndex +{ + return NO; +} + +- (void) allowMarkedTextInput:(bool)allowed +{ + mMarkedTextAllowed = allowed; +} + +@end + +@implementation LLUserInputWindow + +- (void) close +{ + [self orderOut:self]; +} + +@end + +@implementation LLNonInlineTextView + +- (void) setGLView:(LLOpenGLView *)view +{ + glview = view; +} + +- (void) insertText:(id)insertString +{ + [[self inputContext] discardMarkedText]; + [self setString:@""]; + [_window orderOut:_window]; + [self insertText:insertString replacementRange:NSMakeRange(0, [insertString length])]; +} + +- (void) insertText:(id)aString replacementRange:(NSRange)replacementRange +{ + [glview insertText:aString replacementRange:replacementRange]; +} + +- (void) insertNewline:(id)sender +{ + [[self textStorage] setValue:@""]; + [[self inputContext] discardMarkedText]; + [self setString:@""]; +} + +- (void)doCommandBySelector:(SEL)aSelector +{ + if (aSelector == @selector(insertNewline:)) + { + [self insertNewline:self]; + } +} + +@end + +@implementation LLNSWindow + +- (id) init +{ + return self; +} + +- (NSPoint)convertToScreenFromLocalPoint:(NSPoint)point relativeToView:(NSView *)view +{ + NSScreen *currentScreen = [NSScreen currentScreenForMouseLocation]; + if(currentScreen) + { + NSPoint windowPoint = [view convertPoint:point toView:nil]; + NSPoint screenPoint = [[view window] convertBaseToScreen:windowPoint]; + NSPoint flippedScreenPoint = [currentScreen flipPoint:screenPoint]; + flippedScreenPoint.y += [currentScreen frame].origin.y; + + return flippedScreenPoint; + } + + return NSZeroPoint; +} + +- (NSPoint)flipPoint:(NSPoint)aPoint +{ + return NSMakePoint(aPoint.x, self.frame.size.height - aPoint.y); +} + +- (BOOL) becomeFirstResponder +{ + callFocus(); + return true; +} + +- (BOOL) resignFirstResponder +{ + callFocusLost(); + return true; +} + +- (void) close +{ + callQuitHandler(); +} + +@end diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h index e9147d552e..78186004b8 100755 --- a/indra/llwindow/llwindow.h +++ b/indra/llwindow/llwindow.h @@ -42,6 +42,7 @@ class LLWindowCallbacks; class LLWindow : public LLInstanceTracker<LLWindow> { public: + struct LLWindowResolution { S32 mWidth; diff --git a/indra/llwindow/llwindowmacosx-objc.h b/indra/llwindow/llwindowmacosx-objc.h index 7893dedda4..2cae6f3f72 100755 --- a/indra/llwindow/llwindowmacosx-objc.h +++ b/indra/llwindow/llwindowmacosx-objc.h @@ -25,13 +25,122 @@ * $/LicenseInfo$ */ +#include <map> +#include <vector> + +typedef std::vector<std::pair<int, bool> > segment_t; + +typedef std::vector<int> segment_lengths; +typedef std::vector<int> segment_standouts; + +struct attributedStringInfo { + segment_lengths seg_lengths; + segment_standouts seg_standouts; +}; // This will actually hold an NSCursor*, but that type is only available in objective C. typedef void *CursorRef; +typedef void *NSWindowRef; +typedef void *GLViewRef; + +// These are defined in llappviewermacosx.cpp. +bool initViewer(); +void handleQuit(); +bool runMainLoop(); +void initMainLoop(); +void cleanupViewer(); +void handleUrl(const char* url); /* Defined in llwindowmacosx-objc.mm: */ +int createNSApp(int argc, const char **argv); void setupCocoa(); +bool pasteBoardAvailable(); +bool copyToPBoard(const unsigned short *str, unsigned int len); +const unsigned short *copyFromPBoard(); CursorRef createImageCursor(const char *fullpath, int hotspotX, int hotspotY); -OSErr releaseImageCursor(CursorRef ref); -OSErr setImageCursor(CursorRef ref); +short releaseImageCursor(CursorRef ref); +short setImageCursor(CursorRef ref); +void setArrowCursor(); +void setIBeamCursor(); +void setPointingHandCursor(); +void setCopyCursor(); +void setCrossCursor(); +void setNotAllowedCursor(); +void hideNSCursor(); +void showNSCursor(); +void hideNSCursorTillMove(bool hide); +void requestUserAttention(); +long showAlert(std::string title, std::string text, int type); + +NSWindowRef createNSWindow(int x, int y, int width, int height); + +#include <OpenGL/OpenGL.h> +GLViewRef createOpenGLView(NSWindowRef window, unsigned int samples, bool vsync); +void glSwapBuffers(void* context); +CGLContextObj getCGLContextObj(GLViewRef view); +unsigned long getVramSize(GLViewRef view); +void getContentViewBounds(NSWindowRef window, float* bounds); +void getWindowSize(NSWindowRef window, float* size); +void setWindowSize(NSWindowRef window, int width, int height); +void getCursorPos(NSWindowRef window, float* pos); +void makeWindowOrderFront(NSWindowRef window); +void convertScreenToWindow(NSWindowRef window, float *coord); +void convertWindowToScreen(NSWindowRef window, float *coord); +void convertScreenToView(NSWindowRef window, float *coord); +void convertRectToScreen(NSWindowRef window, float *coord); +void convertRectFromScreen(NSWindowRef window, float *coord); +void setWindowPos(NSWindowRef window, float* pos); +void closeWindow(NSWindowRef window); +void removeGLView(GLViewRef view); +void makeFirstResponder(NSWindowRef window, GLViewRef view); +void setupInputWindow(NSWindowRef window, GLViewRef view); + +// These are all implemented in llwindowmacosx.cpp. +// This is largely for easier interop between Obj-C and C++ (at least in the viewer's case due to the BOOL vs. BOOL conflict) +bool callKeyUp(unsigned short key, unsigned int mask); +bool callKeyDown(unsigned short key, unsigned int mask); +void callResetKeys(); +bool callUnicodeCallback(wchar_t character, unsigned int mask); +void callRightMouseDown(float *pos, unsigned int mask); +void callRightMouseUp(float *pos, unsigned int mask); +void callLeftMouseDown(float *pos, unsigned int mask); +void callLeftMouseUp(float *pos, unsigned int mask); +void callDoubleClick(float *pos, unsigned int mask); +void callResize(unsigned int width, unsigned int height); +void callMouseMoved(float *pos, unsigned int mask); +void callScrollMoved(float delta); +void callMouseExit(); +void callWindowFocus(); +void callWindowUnfocus(); +void callDeltaUpdate(float *delta, unsigned int mask); +void callMiddleMouseDown(float *pos, unsigned int mask); +void callMiddleMouseUp(float *pos, unsigned int mask); +void callFocus(); +void callFocusLost(); +void callModifier(unsigned int mask); +void callQuitHandler(); +void commitCurrentPreedit(GLViewRef glView); + +#include <string> +void callHandleDragEntered(std::string url); +void callHandleDragExited(std::string url); +void callHandleDragUpdated(std::string url); +void callHandleDragDropped(std::string url); + +// LLPreeditor C bindings. +std::basic_string<wchar_t> getPreeditString(); +void getPreeditSelectionRange(int *position, int *length); +void getPreeditMarkedRange(int *position, int *length); +bool handleUnicodeCharacter(wchar_t c); +void updatePreeditor(unsigned short *str); +void setPreeditMarkedRange(int position, int length); +void resetPreedit(); +int wstring_length(const std::basic_string<wchar_t> & wstr, const int woffset, const int utf16_length, int *unaligned); +void setMarkedText(unsigned short *text, unsigned int *selectedRange, unsigned int *replacementRange, long text_len, attributedStringInfo segments); +void getPreeditLocation(float *location, unsigned int length); +void allowDirectMarkedTextInput(bool allow, GLViewRef glView); + +NSWindowRef getMainAppWindow(); +GLViewRef getGLView(); +unsigned int getModifiers(); diff --git a/indra/llwindow/llwindowmacosx-objc.mm b/indra/llwindow/llwindowmacosx-objc.mm index bebb537cd8..0768d0352e 100755 --- a/indra/llwindow/llwindowmacosx-objc.mm +++ b/indra/llwindow/llwindowmacosx-objc.mm @@ -1,4 +1,4 @@ -/** +/** * @file llwindowmacosx-objc.mm * @brief Definition of functions shared between llwindowmacosx.cpp * and llwindowmacosx-objc.mm. @@ -6,26 +6,30 @@ * $LicenseInfo:firstyear=2006&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2010, Linden Research, Inc. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; * version 2.1 of the License only. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * + * * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ #include <AppKit/AppKit.h> +#include <Cocoa/Cocoa.h> +#include "llopenglview-objc.h" +#include "llwindowmacosx-objc.h" +#include "llappdelegate-objc.h" /* * These functions are broken out into a separate file because the @@ -34,7 +38,10 @@ * linden headers with any objective-C++ source. */ -#include "llwindowmacosx-objc.h" +int createNSApp(int argc, const char *argv[]) +{ + return NSApplicationMain(argc, argv); +} void setupCocoa() { @@ -45,44 +52,122 @@ void setupCocoa() NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; // The following prevents the Cocoa command line parser from trying to open 'unknown' arguements as documents. - // ie. running './secondlife -set Language fr' would cause a pop-up saying can't open document 'fr' - // when init'ing the Cocoa App window. + // ie. running './secondlife -set Language fr' would cause a pop-up saying can't open document 'fr' + // when init'ing the Cocoa App window. [[NSUserDefaults standardUserDefaults] setObject:@"NO" forKey:@"NSTreatUnknownArgumentsAsOpen"]; - // This is a bit of voodoo taken from the Apple sample code "CarbonCocoa_PictureCursor": - // http://developer.apple.com/samplecode/CarbonCocoa_PictureCursor/index.html - - // Needed for Carbon based applications which call into Cocoa - NSApplicationLoad(); - - // Must first call [[[NSWindow alloc] init] release] to get the NSWindow machinery set up so that NSCursor can use a window to cache the cursor image - [[[NSWindow alloc] init] release]; - [pool release]; - + inited = true; } } +bool copyToPBoard(const unsigned short *str, unsigned int len) +{ + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc]init]; + NSPasteboard *pboard = [NSPasteboard generalPasteboard]; + [pboard clearContents]; + + NSArray *contentsToPaste = [[NSArray alloc] initWithObjects:[NSString stringWithCharacters:str length:len], nil]; + [pool release]; + return [pboard writeObjects:contentsToPaste]; +} + +bool pasteBoardAvailable() +{ + NSArray *classArray = [NSArray arrayWithObject:[NSString class]]; + return [[NSPasteboard generalPasteboard] canReadObjectForClasses:classArray options:[NSDictionary dictionary]]; +} + +const unsigned short *copyFromPBoard() +{ + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc]init]; + NSPasteboard *pboard = [NSPasteboard generalPasteboard]; + NSArray *classArray = [NSArray arrayWithObject:[NSString class]]; + NSString *str = NULL; + BOOL ok = [pboard canReadObjectForClasses:classArray options:[NSDictionary dictionary]]; + if (ok) + { + NSArray *objToPaste = [pboard readObjectsForClasses:classArray options:[NSDictionary dictionary]]; + str = [objToPaste objectAtIndex:0]; + } + unichar* temp = (unichar*)calloc([str length], sizeof(unichar)); + [str getCharacters:temp]; + [pool release]; + return temp; +} + CursorRef createImageCursor(const char *fullpath, int hotspotX, int hotspotY) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - + // extra retain on the NSCursor since we want it to live for the lifetime of the app. NSCursor *cursor = - [[[NSCursor alloc] - initWithImage: - [[[NSImage alloc] initWithContentsOfFile: - [NSString stringWithFormat:@"%s", fullpath] - ]autorelease] - hotSpot:NSMakePoint(hotspotX, hotspotY) - ]retain]; - + [[[NSCursor alloc] + initWithImage: + [[[NSImage alloc] initWithContentsOfFile: + [NSString stringWithFormat:@"%s", fullpath] + ]autorelease] + hotSpot:NSMakePoint(hotspotX, hotspotY) + ]retain]; + [pool release]; return (CursorRef)cursor; } +void setArrowCursor() +{ + NSCursor *cursor = [NSCursor arrowCursor]; + [NSCursor unhide]; + [cursor set]; +} + +void setIBeamCursor() +{ + NSCursor *cursor = [NSCursor IBeamCursor]; + [cursor set]; +} + +void setPointingHandCursor() +{ + NSCursor *cursor = [NSCursor pointingHandCursor]; + [cursor set]; +} + +void setCopyCursor() +{ + NSCursor *cursor = [NSCursor dragCopyCursor]; + [cursor set]; +} + +void setCrossCursor() +{ + NSCursor *cursor = [NSCursor crosshairCursor]; + [cursor set]; +} + +void setNotAllowedCursor() +{ + NSCursor *cursor = [NSCursor operationNotAllowedCursor]; + [cursor set]; +} + +void hideNSCursor() +{ + [NSCursor hide]; +} + +void showNSCursor() +{ + [NSCursor unhide]; +} + +void hideNSCursorTillMove(bool hide) +{ + [NSCursor setHiddenUntilMouseMoves:hide]; +} + // This is currently unused, since we want all our cursors to persist for the life of the app, but I've included it for completeness. OSErr releaseImageCursor(CursorRef ref) { @@ -118,3 +203,250 @@ OSErr setImageCursor(CursorRef ref) return noErr; } +// Now for some unholy juggling between generic pointers and casting them to Obj-C objects! +// Note: things can get a bit hairy from here. This is not for the faint of heart. + +NSWindowRef createNSWindow(int x, int y, int width, int height) +{ + LLNSWindow *window = [[LLNSWindow alloc]initWithContentRect:NSMakeRect(x, y, width, height) + styleMask:NSTitledWindowMask | NSResizableWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSTexturedBackgroundWindowMask backing:NSBackingStoreBuffered defer:NO]; + [window makeKeyAndOrderFront:nil]; + [window setAcceptsMouseMovedEvents:TRUE]; + return window; +} + +GLViewRef createOpenGLView(NSWindowRef window, unsigned int samples, bool vsync) +{ + LLOpenGLView *glview = [[LLOpenGLView alloc]initWithFrame:[(LLNSWindow*)window frame] withSamples:samples andVsync:vsync]; + [(LLNSWindow*)window setContentView:glview]; + return glview; +} + +void glSwapBuffers(void* context) +{ + [(NSOpenGLContext*)context flushBuffer]; +} + +CGLContextObj getCGLContextObj(GLViewRef view) +{ + return [(LLOpenGLView *)view getCGLContextObj]; +} + +CGLPixelFormatObj* getCGLPixelFormatObj(NSWindowRef window) +{ + LLOpenGLView *glview = [(LLNSWindow*)window contentView]; + return [glview getCGLPixelFormatObj]; +} + +unsigned long getVramSize(GLViewRef view) +{ + return [(LLOpenGLView *)view getVramSize]; +} + +void getContentViewBounds(NSWindowRef window, float* bounds) +{ + bounds[0] = [[(LLNSWindow*)window contentView] bounds].origin.x; + bounds[1] = [[(LLNSWindow*)window contentView] bounds].origin.y; + bounds[2] = [[(LLNSWindow*)window contentView] bounds].size.width; + bounds[3] = [[(LLNSWindow*)window contentView] bounds].size.height; +} + +void getWindowSize(NSWindowRef window, float* size) +{ + NSRect frame = [(LLNSWindow*)window frame]; + size[0] = frame.origin.x; + size[1] = frame.origin.y; + size[2] = frame.size.width; + size[3] = frame.size.height; +} + +void setWindowSize(NSWindowRef window, int width, int height) +{ + NSRect frame = [(LLNSWindow*)window frame]; + frame.size.width = width; + frame.size.height = height; + [(LLNSWindow*)window setFrame:frame display:TRUE]; +} + +void setWindowPos(NSWindowRef window, float* pos) +{ + NSPoint point; + point.x = pos[0]; + point.y = pos[1]; + [(LLNSWindow*)window setFrameOrigin:point]; +} + +void getCursorPos(NSWindowRef window, float* pos) +{ + NSPoint mLoc; + mLoc = [(LLNSWindow*)window mouseLocationOutsideOfEventStream]; + pos[0] = mLoc.x; + pos[1] = mLoc.y; +} + +void makeWindowOrderFront(NSWindowRef window) +{ + [(LLNSWindow*)window makeKeyAndOrderFront:nil]; +} + +void convertScreenToWindow(NSWindowRef window, float *coord) +{ + NSRect point; + point.origin.x = coord[0]; + point.origin.y = coord[1]; + point = [(LLNSWindow*)window convertRectFromScreen:point]; + coord[0] = point.origin.x; + coord[1] = point.origin.y; +} + +void convertRectToScreen(NSWindowRef window, float *coord) +{ + NSRect point; + point.origin.x = coord[0]; + point.origin.y = coord[1]; + point.size.width = coord[2]; + point.size.height = coord[3]; + + point = [(LLNSWindow*)window convertRectToScreen:point]; + + coord[0] = point.origin.x; + coord[1] = point.origin.y; + coord[2] = point.size.width; + coord[3] = point.size.height; +} + +void convertRectFromScreen(NSWindowRef window, float *coord) +{ + NSRect point; + point.origin.x = coord[0]; + point.origin.y = coord[1]; + point.size.width = coord[2]; + point.size.height = coord[3]; + + point = [(LLNSWindow*)window convertRectFromScreen:point]; + + coord[0] = point.origin.x; + coord[1] = point.origin.y; + coord[2] = point.size.width; + coord[3] = point.size.height; +} + +void convertScreenToView(NSWindowRef window, float *coord) +{ + NSRect point; + point.origin.x = coord[0]; + point.origin.y = coord[1]; + point.origin = [(LLNSWindow*)window convertScreenToBase:point.origin]; + point.origin = [[(LLNSWindow*)window contentView] convertPoint:point.origin fromView:nil]; +} + +void convertWindowToScreen(NSWindowRef window, float *coord) +{ + NSPoint point; + point.x = coord[0]; + point.y = coord[1]; + point = [(LLNSWindow*)window convertToScreenFromLocalPoint:point relativeToView:[(LLNSWindow*)window contentView]]; + coord[0] = point.x; + coord[1] = point.y; +} + +void closeWindow(NSWindowRef window) +{ + [(LLNSWindow*)window close]; + [(LLNSWindow*)window release]; +} + +void removeGLView(GLViewRef view) +{ + [(LLOpenGLView*)view removeFromSuperview]; + [(LLOpenGLView*)view release]; +} + +void setupInputWindow(NSWindowRef window, GLViewRef glview) +{ + [[(LLAppDelegate*)[NSApp delegate] inputView] setGLView:(LLOpenGLView*)glview]; +} + +void commitCurrentPreedit(GLViewRef glView) +{ + [(LLOpenGLView*)glView commitCurrentPreedit]; +} + +void allowDirectMarkedTextInput(bool allow, GLViewRef glView) +{ + [(LLOpenGLView*)glView allowMarkedTextInput:allow]; +} + +NSWindowRef getMainAppWindow() +{ + LLNSWindow *winRef = [(LLAppDelegate*)[[NSApplication sharedApplication] delegate] window]; + + [winRef setAcceptsMouseMovedEvents:TRUE]; + return winRef; +} + +void makeFirstResponder(NSWindowRef window, GLViewRef view) +{ + [(LLNSWindow*)window makeFirstResponder:(LLOpenGLView*)view]; +} + +void requestUserAttention() +{ + [[NSApplication sharedApplication] requestUserAttention:NSInformationalRequest]; +} + +long showAlert(std::string text, std::string title, int type) +{ + NSAlert *alert = [[NSAlert alloc] init]; + + [alert setMessageText:[NSString stringWithCString:title.c_str() encoding:[NSString defaultCStringEncoding]]]; + [alert setInformativeText:[NSString stringWithCString:text.c_str() encoding:[NSString defaultCStringEncoding]]]; + if (type == 0) + { + [alert addButtonWithTitle:@"Okay"]; + } else if (type == 1) + { + [alert addButtonWithTitle:@"Okay"]; + [alert addButtonWithTitle:@"Cancel"]; + } else if (type == 2) + { + [alert addButtonWithTitle:@"Yes"]; + [alert addButtonWithTitle:@"No"]; + } + long ret = [alert runModal]; + [alert dealloc]; + + if (ret == NSAlertFirstButtonReturn) + { + if (type == 1) + { + ret = 3; + } else if (type == 2) + { + ret = 0; + } + } else if (ret == NSAlertSecondButtonReturn) + { + if (type == 0 || type == 1) + { + ret = 2; + } else if (type == 2) + { + ret = 1; + } + } + + return ret; +} + +/* + GLViewRef getGLView() + { + return [(LLAppDelegate*)[[NSApplication sharedApplication] delegate] glview]; + } + */ + +unsigned int getModifiers() +{ + return [NSEvent modifierFlags]; +} diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 97637c937f..56472e6b45 100755 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -30,7 +30,6 @@ #include "llkeyboardmacosx.h" #include "llwindowcallbacks.h" -#include "llwindowmacosx-objc.h" #include "llpreeditor.h" #include "llerror.h" @@ -39,8 +38,8 @@ #include "lldir.h" #include "indra_constants.h" -#include <Carbon/Carbon.h> #include <OpenGL/OpenGL.h> +#include <CoreServices/CoreServices.h> extern BOOL gDebugWindowProc; @@ -58,7 +57,6 @@ const S32 MAX_NUM_RESOLUTIONS = 32; // BOOL LLWindowMacOSX::sUseMultGL = FALSE; -WindowRef LLWindowMacOSX::sMediaWindow = NULL; // Cross-platform bits: @@ -98,105 +96,9 @@ BOOL check_for_card(const char* RENDERER, const char* bad_card) // We may want to base this on the setting of _DEBUG... #define CAPTURE_ALL_DISPLAYS 0 -static double getDictDouble (CFDictionaryRef refDict, CFStringRef key); +//static double getDictDouble (CFDictionaryRef refDict, CFStringRef key); static long getDictLong (CFDictionaryRef refDict, CFStringRef key); - - - -// CarbonEvents we're interested in. -static EventTypeSpec WindowHandlerEventList[] = -{ - // Window-related events - { kEventClassWindow, kEventWindowActivated }, - { kEventClassWindow, kEventWindowDeactivated }, - { kEventClassWindow, kEventWindowShown }, - { kEventClassWindow, kEventWindowHidden }, - { kEventClassWindow, kEventWindowCollapsed }, - { kEventClassWindow, kEventWindowExpanded }, - { kEventClassWindow, kEventWindowGetClickActivation }, - { kEventClassWindow, kEventWindowClose }, - { kEventClassWindow, kEventWindowBoundsChanging }, - { kEventClassWindow, kEventWindowBoundsChanged }, - { kEventClassWindow, kEventWindowGetIdealSize }, - - // Mouse events - { kEventClassMouse, kEventMouseDown }, - { kEventClassMouse, kEventMouseUp }, - { kEventClassMouse, kEventMouseDragged }, - { kEventClassMouse, kEventMouseWheelMoved }, - { kEventClassMouse, kEventMouseMoved }, - - // Keyboard events - // No longer handle raw key down events directly. - // When text input events come in, extract the raw key events from them and process at that point. - // This allows input methods to eat keystrokes the way they're supposed to. -// { kEventClassKeyboard, kEventRawKeyDown }, -// { kEventClassKeyboard, kEventRawKeyRepeat }, - { kEventClassKeyboard, kEventRawKeyUp }, - { kEventClassKeyboard, kEventRawKeyModifiersChanged }, - - // Text input events - { kEventClassTextInput, kEventTextInputUnicodeForKeyEvent }, - { kEventClassTextInput, kEventTextInputUpdateActiveInputArea }, - { kEventClassTextInput, kEventTextInputOffsetToPos }, - { kEventClassTextInput, kEventTextInputPosToOffset }, - { kEventClassTextInput, kEventTextInputShowHideBottomWindow }, - { kEventClassTextInput, kEventTextInputGetSelectedText }, - { kEventClassTextInput, kEventTextInputFilterText }, - - // TSM Document Access events (advanced input method support) - { kEventClassTSMDocumentAccess, kEventTSMDocumentAccessGetLength }, - { kEventClassTSMDocumentAccess, kEventTSMDocumentAccessGetSelectedRange }, - { kEventClassTSMDocumentAccess, kEventTSMDocumentAccessGetCharacters }, - { kEventClassTSMDocumentAccess, kEventTSMDocumentAccessGetFont }, - { kEventClassTSMDocumentAccess, kEventTSMDocumentAccessGetGlyphInfo }, - { kEventClassTSMDocumentAccess, kEventTSMDocumentAccessLockDocument }, - { kEventClassTSMDocumentAccess, kEventTSMDocumentAccessUnlockDocument } -}; - -static EventTypeSpec GlobalHandlerEventList[] = -{ - // Mouse events - { kEventClassMouse, kEventMouseDown }, - { kEventClassMouse, kEventMouseUp }, - { kEventClassMouse, kEventMouseDragged }, - { kEventClassMouse, kEventMouseWheelMoved }, - { kEventClassMouse, kEventMouseMoved }, - - // Keyboard events - // No longer handle raw key down events directly. - // When text input events come in, extract the raw key events from them and process at that point. - // This allows input methods to eat keystrokes the way they're supposed to. -// { kEventClassKeyboard, kEventRawKeyDown }, -// { kEventClassKeyboard, kEventRawKeyRepeat }, - { kEventClassKeyboard, kEventRawKeyUp }, - { kEventClassKeyboard, kEventRawKeyModifiersChanged }, - - // Text input events - { kEventClassTextInput, kEventTextInputUpdateActiveInputArea }, - { kEventClassTextInput, kEventTextInputUnicodeForKeyEvent }, - { kEventClassTextInput, kEventTextInputOffsetToPos }, - { kEventClassTextInput, kEventTextInputPosToOffset }, - { kEventClassTextInput, kEventTextInputShowHideBottomWindow }, - { kEventClassTextInput, kEventTextInputGetSelectedText }, - { kEventClassTextInput, kEventTextInputFilterText }, - - // TSM Document Access events (advanced input method support) - { kEventClassTSMDocumentAccess, kEventTSMDocumentAccessGetLength }, - { kEventClassTSMDocumentAccess, kEventTSMDocumentAccessGetSelectedRange }, - { kEventClassTSMDocumentAccess, kEventTSMDocumentAccessGetCharacters }, - { kEventClassTSMDocumentAccess, kEventTSMDocumentAccessGetFont }, - { kEventClassTSMDocumentAccess, kEventTSMDocumentAccessGetGlyphInfo }, - { kEventClassTSMDocumentAccess, kEventTSMDocumentAccessLockDocument }, - { kEventClassTSMDocumentAccess, kEventTSMDocumentAccessUnlockDocument } -}; - -static EventTypeSpec CommandHandlerEventList[] = -{ - { kEventClassCommand, kEventCommandProcess } -}; - // MBW -- HACK ALERT // On the Mac, to put up an OS dialog in full screen mode, we must first switch OUT of full screen mode. // The proper way to do this is to bracket the dialog with calls to beforeDialog() and afterDialog(), but these @@ -204,8 +106,6 @@ static EventTypeSpec CommandHandlerEventList[] = // This assumes that there will be only one object of this class at any time. Hopefully this is true. static LLWindowMacOSX *gWindowImplementation = NULL; - - LLWindowMacOSX::LLWindowMacOSX(LLWindowCallbacks* callbacks, const std::string& title, const std::string& name, S32 x, S32 y, S32 width, S32 height, U32 flags, @@ -233,8 +133,6 @@ LLWindowMacOSX::LLWindowMacOSX(LLWindowCallbacks* callbacks, mContext = NULL; mPixelFormat = NULL; mDisplay = CGMainDisplayID(); - mOldDisplayMode = NULL; - mTimer = NULL; mSimulatedRightClick = FALSE; mLastModifiers = 0; mHandsOffEvents = FALSE; @@ -246,60 +144,31 @@ LLWindowMacOSX::LLWindowMacOSX(LLWindowCallbacks* callbacks, mOverrideAspectRatio = 0.f; mMaximized = FALSE; mMinimized = FALSE; - mTSMDocument = NULL; // Just in case. mLanguageTextInputAllowed = FALSE; - mTSMScriptCode = 0; - mTSMLangCode = 0; mPreeditor = NULL; - mRawKeyEvent = NULL; mFSAASamples = fsaa_samples; mForceRebuild = FALSE; - // For reasons that aren't clear to me, LLTimers seem to be created in the "started" state. - // Since the started state of this one is used to track whether the NMRec has been installed, it wants to start out in the "stopped" state. - mBounceTimer.stop(); - // Get the original aspect ratio of the main device. mOriginalAspectRatio = (double)CGDisplayPixelsWide(mDisplay) / (double)CGDisplayPixelsHigh(mDisplay); // Stash the window title - strcpy((char*)mWindowTitle + 1, title.c_str()); /* Flawfinder: ignore */ - mWindowTitle[0] = title.length(); - - mEventHandlerUPP = NewEventHandlerUPP(staticEventHandler); - mMoveEventCampartorUPP = NewEventComparatorUPP(staticMoveEventComparator); - mGlobalHandlerRef = NULL; - mWindowHandlerRef = NULL; + mWindowTitle = title; + //mWindowTitle[0] = title.length(); mDragOverrideCursor = -1; - // We're not clipping yet - SetRect( &mOldMouseClip, 0, 0, 0, 0 ); - // Set up global event handlers (the fullscreen case needs this) - InstallStandardEventHandler(GetApplicationEventTarget()); + //InstallStandardEventHandler(GetApplicationEventTarget()); // Stash an object pointer for OSMessageBox() gWindowImplementation = this; - // Create the GL context and set it up for windowed or fullscreen, as appropriate. if(createContext(x, y, width, height, 32, fullscreen, disable_vsync)) { if(mWindow != NULL) { - // MBW -- XXX -- I think we can now do this here? - // Constrain the window to the screen it's mostly on, resizing if necessary. - ConstrainWindowToScreen( - mWindow, - kWindowStructureRgn, - kWindowConstrainMayResize | - // kWindowConstrainStandardOptions | - 0, - NULL, - NULL); - - MacShowWindow(mWindow); - BringToFront(mWindow); + makeWindowOrderFront(mWindow); } if (!gGLManager.initGL()) @@ -317,480 +186,390 @@ LLWindowMacOSX::LLWindowMacOSX(LLWindowCallbacks* callbacks, //start with arrow cursor initCursors(); setCursor( UI_CURSOR_ARROW ); + + allowLanguageTextInput(NULL, FALSE); } mCallbacks = callbacks; stop_glerror(); + + } -BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits, BOOL fullscreen, BOOL disable_vsync) +// These functions are used as wrappers for our internal event handling callbacks. +// It's a good idea to wrap these to avoid reworking more code than we need to within LLWindow. + +bool callKeyUp(unsigned short key, unsigned int mask) { - OSStatus err; - BOOL glNeedsInit = FALSE; + return gKeyboard->handleKeyUp(key, mask); +} - if(mGlobalHandlerRef == NULL) - { - InstallApplicationEventHandler(mEventHandlerUPP, GetEventTypeCount (CommandHandlerEventList), CommandHandlerEventList, (void*)this, &mGlobalHandlerRef); - } +bool callKeyDown(unsigned short key, unsigned int mask) +{ + return gKeyboard->handleKeyDown(key, mask); +} - mFullscreen = fullscreen; +void callResetKeys() +{ + gKeyboard->resetKeys(); +} - if (mFullscreen && (mOldDisplayMode == NULL)) - { - LL_INFOS("Window") << "createContext: setting up fullscreen " << width << "x" << height << LL_ENDL; +bool callUnicodeCallback(wchar_t character, unsigned int mask) +{ + return gWindowImplementation->getCallbacks()->handleUnicodeChar(character, mask); +} - // NOTE: The refresh rate will be REPORTED AS 0 for many DVI and notebook displays. Plan accordingly. - double refresh = getDictDouble (CGDisplayCurrentMode (mDisplay), kCGDisplayRefreshRate); +void callFocus() +{ + if (gWindowImplementation) + { + gWindowImplementation->getCallbacks()->handleFocus(gWindowImplementation); + } +} - // If the requested width or height is 0, find the best default for the monitor. - if((width == 0) || (height == 0)) - { - // Scan through the list of modes, looking for one which has: - // height between 700 and 800 - // aspect ratio closest to the user's original mode - S32 resolutionCount = 0; - LLWindowResolution *resolutionList = getSupportedResolutions(resolutionCount); +void callFocusLost() +{ + gWindowImplementation->getCallbacks()->handleFocusLost(gWindowImplementation); +} - if(resolutionList != NULL) - { - F32 closestAspect = 0; - U32 closestHeight = 0; - U32 closestWidth = 0; - int i; +void callRightMouseDown(float *pos, MASK mask) +{ + if (gWindowImplementation->allowsLanguageInput()) + { + gWindowImplementation->interruptLanguageTextInput(); + } + + LLCoordGL outCoords; + outCoords.mX = llround(pos[0]); + outCoords.mY = llround(pos[1]); + gWindowImplementation->getCallbacks()->handleRightMouseDown(gWindowImplementation, outCoords, gKeyboard->currentMask(TRUE)); +} - LL_DEBUGS("Window") << "createContext: searching for a display mode, original aspect is " << mOriginalAspectRatio << LL_ENDL; +void callRightMouseUp(float *pos, MASK mask) +{ + if (gWindowImplementation->allowsLanguageInput()) + { + gWindowImplementation->interruptLanguageTextInput(); + } + + LLCoordGL outCoords; + outCoords.mX = llround(pos[0]); + outCoords.mY = llround(pos[1]); + gWindowImplementation->getCallbacks()->handleRightMouseUp(gWindowImplementation, outCoords, gKeyboard->currentMask(TRUE)); +} - for(i=0; i < resolutionCount; i++) - { - F32 aspect = (F32)resolutionList[i].mWidth / (F32)resolutionList[i].mHeight; +void callLeftMouseDown(float *pos, MASK mask) +{ + if (gWindowImplementation->allowsLanguageInput()) + { + gWindowImplementation->interruptLanguageTextInput(); + } + + LLCoordGL outCoords; + outCoords.mX = llround(pos[0]); + outCoords.mY = llround(pos[1]); + gWindowImplementation->getCallbacks()->handleMouseDown(gWindowImplementation, outCoords, gKeyboard->currentMask(TRUE)); +} - LL_DEBUGS("Window") << "createContext: width " << resolutionList[i].mWidth << " height " << resolutionList[i].mHeight << " aspect " << aspect << LL_ENDL; +void callLeftMouseUp(float *pos, MASK mask) +{ + if (gWindowImplementation->allowsLanguageInput()) + { + gWindowImplementation->interruptLanguageTextInput(); + } + + LLCoordGL outCoords; + outCoords.mX = llround(pos[0]); + outCoords.mY = llround(pos[1]); + gWindowImplementation->getCallbacks()->handleMouseUp(gWindowImplementation, outCoords, gKeyboard->currentMask(TRUE)); + +} - if( (resolutionList[i].mHeight >= 700) && (resolutionList[i].mHeight <= 800) && - (fabs(aspect - mOriginalAspectRatio) < fabs(closestAspect - mOriginalAspectRatio))) - { - LL_DEBUGS("Window") << " (new closest mode) " << LL_ENDL; +void callDoubleClick(float *pos, MASK mask) +{ + if (gWindowImplementation->allowsLanguageInput()) + { + gWindowImplementation->interruptLanguageTextInput(); + } + + LLCoordGL outCoords; + outCoords.mX = llround(pos[0]); + outCoords.mY = llround(pos[1]); + gWindowImplementation->getCallbacks()->handleDoubleClick(gWindowImplementation, outCoords, gKeyboard->currentMask(TRUE)); +} - // This is the closest mode we've seen yet. - closestWidth = resolutionList[i].mWidth; - closestHeight = resolutionList[i].mHeight; - closestAspect = aspect; - } - } +void callResize(unsigned int width, unsigned int height) +{ + if (gWindowImplementation != NULL) + { + gWindowImplementation->getCallbacks()->handleResize(gWindowImplementation, width, height); + } +} - width = closestWidth; - height = closestHeight; - } - } +void callMouseMoved(float *pos, MASK mask) +{ + LLCoordGL outCoords; + outCoords.mX = llround(pos[0]); + outCoords.mY = llround(pos[1]); + float deltas[2]; + gWindowImplementation->getMouseDeltas(deltas); + outCoords.mX += deltas[0]; + outCoords.mY += deltas[1]; + gWindowImplementation->getCallbacks()->handleMouseMove(gWindowImplementation, outCoords, gKeyboard->currentMask(TRUE)); + //gWindowImplementation->getCallbacks()->handleScrollWheel(gWindowImplementation, 0); +} - if((width == 0) || (height == 0)) - { - // Mode search failed for some reason. Use the old-school default. - width = 1024; - height = 768; - } +void callScrollMoved(float delta) +{ + gWindowImplementation->getCallbacks()->handleScrollWheel(gWindowImplementation, delta); +} - if (true) - { - // Fullscreen support - CFDictionaryRef refDisplayMode = 0; - boolean_t exactMatch = false; - -#if CAPTURE_ALL_DISPLAYS - // Capture all displays (may want to do this for final build) - CGCaptureAllDisplays (); -#else - // Capture only the main display (useful for debugging) - CGDisplayCapture (mDisplay); -#endif +void callMouseExit() +{ + gWindowImplementation->getCallbacks()->handleMouseLeave(gWindowImplementation); +} - // Switch the display to the desired resolution and refresh - refDisplayMode = CGDisplayBestModeForParametersAndRefreshRate( - mDisplay, - BITS_PER_PIXEL, - width, - height, - refresh, - &exactMatch); +void callWindowFocus() +{ + gWindowImplementation->getCallbacks()->handleFocus(gWindowImplementation); +} - if (refDisplayMode) - { - LL_DEBUGS("Window") << "createContext: switching display resolution" << LL_ENDL; - mOldDisplayMode = CGDisplayCurrentMode (mDisplay); - CGDisplaySwitchToMode (mDisplay, refDisplayMode); - // CFRelease(refDisplayMode); +void callWindowUnfocus() +{ + gWindowImplementation->getCallbacks()->handleFocusLost(gWindowImplementation); +} - AddEventTypesToHandler(mGlobalHandlerRef, GetEventTypeCount (GlobalHandlerEventList), GlobalHandlerEventList); - } +void callDeltaUpdate(float *delta, MASK mask) +{ + gWindowImplementation->updateMouseDeltas(delta); +} +void callMiddleMouseDown(float *pos, MASK mask) +{ + LLCoordGL outCoords; + outCoords.mX = llround(pos[0]); + outCoords.mY = llround(pos[1]); + float deltas[2]; + gWindowImplementation->getMouseDeltas(deltas); + outCoords.mX += deltas[0]; + outCoords.mY += deltas[1]; + gWindowImplementation->getCallbacks()->handleMiddleMouseDown(gWindowImplementation, outCoords, mask); +} - mFullscreen = TRUE; - mFullscreenWidth = CGDisplayPixelsWide(mDisplay); - mFullscreenHeight = CGDisplayPixelsHigh(mDisplay); - mFullscreenBits = CGDisplayBitsPerPixel(mDisplay); - mFullscreenRefresh = llround(getDictDouble (CGDisplayCurrentMode (mDisplay), kCGDisplayRefreshRate)); +void callMiddleMouseUp(float *pos, MASK mask) +{ + LLCoordGL outCoords; + outCoords.mX = llround(pos[0]); + outCoords.mY = llround(pos[1]); + float deltas[2]; + gWindowImplementation->getMouseDeltas(deltas); + outCoords.mX += deltas[0]; + outCoords.mY += deltas[1]; + gWindowImplementation->getCallbacks()->handleMiddleMouseUp(gWindowImplementation, outCoords, mask); +} - LL_INFOS("Window") << "Running at " << mFullscreenWidth - << "x" << mFullscreenHeight - << "x" << mFullscreenBits - << " @ " << mFullscreenRefresh - << LL_ENDL; - } - else - { - // No fullscreen support - mFullscreen = FALSE; - mFullscreenWidth = -1; - mFullscreenHeight = -1; - mFullscreenBits = -1; - mFullscreenRefresh = -1; - - std::string error= llformat("Unable to run fullscreen at %d x %d.\nRunning in window.", width, height); - OSMessageBox(error, "Error", OSMB_OK); - } - } +void callModifier(MASK mask) +{ + gKeyboard->handleModifier(mask); +} - if(!mFullscreen && (mWindow == NULL)) - { - //int displayWidth = CGDisplayPixelsWide(mDisplay); - //int displayHeight = CGDisplayPixelsHigh(mDisplay); - //const int menuBarPlusTitleBar = 44; // Ugly magic number. +void callHandleDragEntered(std::string url) +{ + gWindowImplementation->handleDragNDrop(url, LLWindowCallbacks::DNDA_START_TRACKING); +} - LL_DEBUGS("Window") << "createContext: creating window" << LL_ENDL; +void callHandleDragExited(std::string url) +{ + gWindowImplementation->handleDragNDrop(url, LLWindowCallbacks::DNDA_STOP_TRACKING); +} - mPreviousWindowRect.left = (long) x; - mPreviousWindowRect.right = (long) x + width; - mPreviousWindowRect.top = (long) y; - mPreviousWindowRect.bottom = (long) y + height; +void callHandleDragUpdated(std::string url) +{ + gWindowImplementation->handleDragNDrop(url, LLWindowCallbacks::DNDA_TRACK); +} - //----------------------------------------------------------------------- - // Create the window - //----------------------------------------------------------------------- - mWindow = NewCWindow( - NULL, - &mPreviousWindowRect, - mWindowTitle, - false, // Create the window invisible. Whoever calls createContext() should show it after any moving/resizing. - // noGrowDocProc, // Window with no grow box and no zoom box - zoomDocProc, // Window with a grow box and a zoom box - // zoomNoGrow, // Window with a zoom box but no grow box - kFirstWindowOfClass, - true, - (long)this); +void callHandleDragDropped(std::string url) +{ + gWindowImplementation->handleDragNDrop(url, LLWindowCallbacks::DNDA_DROPPED); +} - if (!mWindow) +void callQuitHandler() +{ + if (gWindowImplementation) + { + if(gWindowImplementation->getCallbacks()->handleCloseRequest(gWindowImplementation)) { - setupFailure("Window creation error", "Error", OSMB_OK); - return FALSE; + gWindowImplementation->getCallbacks()->handleQuit(gWindowImplementation); } - - // Turn on live resize. - // For this to work correctly, we need to be able to call LLViewerWindow::draw from - // the event handler for kEventWindowBoundsChanged. It's not clear that we have access from here. - // err = ChangeWindowAttributes(mWindow, kWindowLiveResizeAttribute, 0); - - // Set up window event handlers (some window-related events ONLY go to window handlers.) - InstallStandardEventHandler(GetWindowEventTarget(mWindow)); - InstallWindowEventHandler(mWindow, mEventHandlerUPP, GetEventTypeCount (WindowHandlerEventList), WindowHandlerEventList, (void*)this, &mWindowHandlerRef); // add event handler -#if LL_OS_DRAGDROP_ENABLED - InstallTrackingHandler( dragTrackingHandler, mWindow, (void*)this ); - InstallReceiveHandler( dragReceiveHandler, mWindow, (void*)this ); -#endif // LL_OS_DRAGDROP_ENABLED } +} +void getPreeditSelectionRange(int *position, int *length) +{ + if (gWindowImplementation->getPreeditor()) { - // Create and initialize our TSM document for language text input. - // If an error occured, we can do nothing better than simply ignore it. - // mTSMDocument will be kept NULL in case. - if (mTSMDocument) - { - DeactivateTSMDocument(mTSMDocument); - DeleteTSMDocument(mTSMDocument); - mTSMDocument = NULL; - } - static InterfaceTypeList types = { kUnicodeDocument }; - err = NewTSMDocument(1, types, &mTSMDocument, 0); - if (err != noErr) - { - LL_WARNS("Window") << "createContext: couldn't create a TSMDocument (" << err << ")" << LL_ENDL; - } - if (mTSMDocument) - { - ActivateTSMDocument(mTSMDocument); - allowLanguageTextInput(NULL, FALSE); - } + gWindowImplementation->getPreeditor()->getSelectionRange(position, length); } +} - if(mContext == NULL) +void getPreeditMarkedRange(int *position, int *length) +{ + if (gWindowImplementation->getPreeditor()) { - AGLRendererInfo rendererInfo = NULL; - - //----------------------------------------------------------------------- - // Create GL drawing context - //----------------------------------------------------------------------- - - if(mPixelFormat == NULL) - { - if(mFullscreen) - { - GLint fullscreenAttrib[] = - { - AGL_RGBA, - AGL_FULLSCREEN, - AGL_NO_RECOVERY, - AGL_SAMPLE_BUFFERS_ARB, mFSAASamples > 0 ? 1 : 0, - AGL_SAMPLES_ARB, mFSAASamples, - AGL_DOUBLEBUFFER, - AGL_CLOSEST_POLICY, - AGL_ACCELERATED, - AGL_RED_SIZE, 8, - AGL_GREEN_SIZE, 8, - AGL_BLUE_SIZE, 8, - AGL_ALPHA_SIZE, 8, - AGL_DEPTH_SIZE, 24, - AGL_STENCIL_SIZE, 8, - AGL_NONE - }; - - LL_DEBUGS("Window") << "createContext: creating fullscreen pixelformat" << LL_ENDL; - - GDHandle gdhDisplay = NULL; - err = DMGetGDeviceByDisplayID ((DisplayIDType)mDisplay, &gdhDisplay, false); - - mPixelFormat = aglChoosePixelFormat(&gdhDisplay, 1, fullscreenAttrib); - rendererInfo = aglQueryRendererInfo(&gdhDisplay, 1); - } - else - { - // NOTE from Leslie: - // - // AGL_NO_RECOVERY, when combined with AGL_ACCELERATED prevents software rendering - // fallback which means we won't hvae shaders that compile and link but then don't - // work. The drawback is that our shader compilation will be a bit more finicky though. - - GLint windowedAttrib[] = - { - AGL_RGBA, - AGL_NO_RECOVERY, - AGL_DOUBLEBUFFER, - AGL_CLOSEST_POLICY, - AGL_ACCELERATED, - AGL_SAMPLE_BUFFERS_ARB, mFSAASamples > 0 ? 1 : 0, - AGL_SAMPLES_ARB, mFSAASamples, - AGL_RED_SIZE, 8, - AGL_GREEN_SIZE, 8, - AGL_BLUE_SIZE, 8, - AGL_ALPHA_SIZE, 8, - AGL_DEPTH_SIZE, 24, - AGL_STENCIL_SIZE, 8, - AGL_NONE - }; - - LL_DEBUGS("Window") << "createContext: creating windowed pixelformat" << LL_ENDL; - - mPixelFormat = aglChoosePixelFormat(NULL, 0, windowedAttrib); - - GDHandle gdhDisplay = GetMainDevice(); - rendererInfo = aglQueryRendererInfo(&gdhDisplay, 1); - } - - // May want to get the real error text like this: - // (char *) aglErrorString(aglGetError()); - - if(aglGetError() != AGL_NO_ERROR) - { - setupFailure("Can't find suitable pixel format", "Error", OSMB_OK); - return FALSE; - } - } - - if(mPixelFormat) - { - LL_DEBUGS("Window") << "createContext: creating GL context" << LL_ENDL; - mContext = aglCreateContext(mPixelFormat, NULL); - } - - if(mContext == NULL) - { - setupFailure("Can't make GL context", "Error", OSMB_OK); - return FALSE; - } - - gGLManager.mVRAM = 0; - - if(rendererInfo != NULL) - { - GLint result; - - if(aglDescribeRenderer(rendererInfo, AGL_VIDEO_MEMORY, &result)) - { - // llinfos << "createContext: aglDescribeRenderer(AGL_VIDEO_MEMORY) returned " << result << llendl; - gGLManager.mVRAM = result / (1024 * 1024); - } - else - { - // llinfos << "createContext: aglDescribeRenderer(AGL_VIDEO_MEMORY) failed." << llendl; - } - - // This could be useful at some point, if it takes into account the memory already used by screen buffers, etc... - if(aglDescribeRenderer(rendererInfo, AGL_TEXTURE_MEMORY, &result)) - { - // llinfos << "createContext: aglDescribeRenderer(AGL_TEXTURE_MEMORY) returned " << result << llendl; - } - else - { - // llinfos << "createContext: aglDescribeRenderer(AGL_TEXTURE_MEMORY) failed." << llendl; - } - - aglDestroyRendererInfo(rendererInfo); - } - - // Since we just created the context, it needs to be set up. - glNeedsInit = TRUE; + gWindowImplementation->getPreeditor()->getPreeditRange(position, length); } +} - // Hook up the context to a drawable - if (mFullscreen && (mOldDisplayMode != NULL)) +void setPreeditMarkedRange(int position, int length) +{ + if (gWindowImplementation->getPreeditor()) { - // We successfully captured the display. Use a fullscreen drawable - - LL_DEBUGS("Window") << "createContext: attaching fullscreen drawable" << LL_ENDL; - -#if CAPTURE_ALL_DISPLAYS - // Capture all displays (may want to do this for final build) - aglDisable (mContext, AGL_FS_CAPTURE_SINGLE); -#else - // Capture only the main display (useful for debugging) - aglEnable (mContext, AGL_FS_CAPTURE_SINGLE); -#endif - - if (!aglSetFullScreen (mContext, 0, 0, 0, 0)) - { - setupFailure("Can't set GL fullscreen", "Error", OSMB_OK); - return FALSE; - } + gWindowImplementation->getPreeditor()->markAsPreedit(position, length); } - else if(!mFullscreen && (mWindow != NULL)) - { - LL_DEBUGS("Window") << "createContext: attaching windowed drawable" << LL_ENDL; +} - // We created a window. Use it as the drawable. - if(!aglSetDrawable(mContext, GetWindowPort (mWindow))) - { - setupFailure("Can't set GL drawable", "Error", OSMB_OK); - return FALSE; - } - } - else +bool handleUnicodeCharacter(wchar_t c) +{ + bool success = false; + if (gWindowImplementation->getPreeditor()) { - setupFailure("Can't get fullscreen or windowed drawable.", "Error", OSMB_OK); - return FALSE; + success = gWindowImplementation->getPreeditor()->handleUnicodeCharHere(c); } + + return success; +} - if(mContext != NULL) +void resetPreedit() +{ + if (gWindowImplementation->getPreeditor()) { - LL_DEBUGS("Window") << "createContext: setting current context" << LL_ENDL; + gWindowImplementation->getPreeditor()->resetPreedit(); + } +} - if (!aglSetCurrentContext(mContext)) +// For reasons of convenience, handle IME updates here. +// This largely mirrors the old implementation, only sans the carbon parameters. +void setMarkedText(unsigned short *unitext, unsigned int *selectedRange, unsigned int *replacementRange, long text_len, attributedStringInfo segments) +{ + if (gWindowImplementation->getPreeditor()) + { + LLPreeditor *preeditor = gWindowImplementation->getPreeditor(); + preeditor->resetPreedit(); + // This should be a viable replacement for the kEventParamTextInputSendReplaceRange parameter. + if (replacementRange[0] < replacementRange[1]) { - setupFailure("Can't activate GL rendering context", "Error", OSMB_OK); - return FALSE; + const LLWString& text = preeditor->getPreeditString(); + const S32 location = wstring_wstring_length_from_utf16_length(text, 0, replacementRange[0]); + const S32 length = wstring_wstring_length_from_utf16_length(text, location, replacementRange[1]); + preeditor->markAsPreedit(location, length); } + + LLWString fix_str = utf16str_to_wstring(llutf16string(unitext, text_len)); + + S32 caret_position = fix_str.length(); + + preeditor->updatePreedit(fix_str, segments.seg_lengths, segments.seg_standouts, caret_position); } +} - if(glNeedsInit) +void getPreeditLocation(float *location, unsigned int length) +{ + if (gWindowImplementation->getPreeditor()) { - // Check for some explicitly unsupported cards. - const char* RENDERER = (const char*) glGetString(GL_RENDERER); - - const char* CARD_LIST[] = - { "RAGE 128", - "RIVA TNT2", - "Intel 810", - "3Dfx/Voodoo3", - "Radeon 7000", - "Radeon 7200", - "Radeon 7500", - "Radeon DDR", - "Radeon VE", - "GDI Generic" }; - const S32 CARD_COUNT = LL_ARRAY_SIZE(CARD_LIST); - - // Future candidates: - // ProSavage/Twister - // SuperSavage + LLPreeditor *preeditor = gWindowImplementation->getPreeditor(); + LLCoordGL coord; + LLCoordScreen screen; + LLRect rect; + + preeditor->getPreeditLocation(length, &coord, &rect, NULL); + + float c[4] = {coord.mX, coord.mY, 0, 0}; + + convertRectToScreen(gWindowImplementation->getWindow(), c); + + location[0] = c[0]; + location[1] = c[1]; + } +} - S32 i; - for (i = 0; i < CARD_COUNT; i++) +void LLWindowMacOSX::updateMouseDeltas(float* deltas) +{ + if (mCursorDecoupled) + { + mCursorLastEventDeltaX = llround(deltas[0]); + mCursorLastEventDeltaY = llround(-deltas[1]); + + if (mCursorIgnoreNextDelta) { - if (check_for_card(RENDERER, CARD_LIST[i])) - { - close(); - return FALSE; - } + mCursorLastEventDeltaX = 0; + mCursorLastEventDeltaY = 0; + mCursorIgnoreNextDelta = FALSE; } + } else { + mCursorLastEventDeltaX = 0; + mCursorLastEventDeltaY = 0; } +} + +void LLWindowMacOSX::getMouseDeltas(float* delta) +{ + delta[0] = mCursorLastEventDeltaX; + delta[1] = mCursorLastEventDeltaY; +} - GLint colorBits, alphaBits, depthBits, stencilBits; +BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits, BOOL fullscreen, BOOL disable_vsync) +{ + BOOL glNeedsInit = FALSE; - if( !aglDescribePixelFormat(mPixelFormat, AGL_BUFFER_SIZE, &colorBits) || - !aglDescribePixelFormat(mPixelFormat, AGL_ALPHA_SIZE, &alphaBits) || - !aglDescribePixelFormat(mPixelFormat, AGL_DEPTH_SIZE, &depthBits) || - !aglDescribePixelFormat(mPixelFormat, AGL_STENCIL_SIZE, &stencilBits)) + mFullscreen = fullscreen; + + if (mWindow == NULL) { - close(); - setupFailure("Can't get pixel format description", "Error", OSMB_OK); - return FALSE; + mWindow = getMainAppWindow(); } - LL_INFOS("GLInit") << "GL buffer: Color Bits " << S32(colorBits) - << " Alpha Bits " << S32(alphaBits) - << " Depth Bits " << S32(depthBits) - << " Stencil Bits" << S32(stencilBits) - << LL_ENDL; - - if (colorBits < 32) + if(mContext == NULL) { - close(); - setupFailure( - "Second Life requires True Color (32-bit) to run in a window.\n" - "Please go to Control Panels -> Display -> Settings and\n" - "set the screen to 32-bit color.\n" - "Alternately, if you choose to run fullscreen, Second Life\n" - "will automatically adjust the screen each time it runs.", - "Error", - OSMB_OK); - return FALSE; + // Our OpenGL view is already defined within SecondLife.xib. + // Get the view instead. + mGLView = createOpenGLView(mWindow, mFSAASamples, !disable_vsync); + mContext = getCGLContextObj(mGLView); + + // Since we just created the context, it needs to be set up. + glNeedsInit = TRUE; + + gGLManager.mVRAM = getVramSize(mGLView); } + + // This sets up our view to recieve text from our non-inline text input window. + setupInputWindow(mWindow, mGLView); + + // Hook up the context to a drawable - if (alphaBits < 8) + if(mContext != NULL) { - close(); - setupFailure( - "Second Life is unable to run because it can't get an 8 bit alpha\n" - "channel. Usually this is due to video card driver issues.\n" - "Please make sure you have the latest video card drivers installed.\n" - "Also be sure your monitor is set to True Color (32-bit) in\n" - "Control Panels -> Display -> Settings.\n" - "If you continue to receive this message, contact customer service.", - "Error", - OSMB_OK); - return FALSE; + + + U32 err = CGLSetCurrentContext(mContext); + if (err != kCGLNoError) + { + setupFailure("Can't activate GL rendering context", "Error", OSMB_OK); + return FALSE; + } } // Disable vertical sync for swap GLint frames_per_swap = 0; if (disable_vsync) { - LL_DEBUGS("GLInit") << "Disabling vertical sync" << LL_ENDL; frames_per_swap = 0; } else { - LL_DEBUGS("GLinit") << "Keeping vertical sync" << LL_ENDL; frames_per_swap = 1; } - aglSetInteger(mContext, AGL_SWAP_INTERVAL, &frames_per_swap); + + CGLSetParameter(mContext, kCGLCPSwapInterval, &frames_per_swap); //enable multi-threaded OpenGL if (sUseMultGL) @@ -809,109 +588,17 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits LL_DEBUGS("GLInit") << "Multi-threaded OpenGL enabled." << LL_ENDL; } } - - // Don't need to get the current gamma, since there's a call that restores it to the system defaults. + makeFirstResponder(mWindow, mGLView); + return TRUE; } -// changing fullscreen resolution, or switching between windowed and fullscreen mode. +// We only support OS X 10.7's fullscreen app mode which is literally a full screen window that fills a virtual desktop. +// This makes this method obsolete. BOOL LLWindowMacOSX::switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp) { - BOOL needsRebuild = FALSE; - BOOL result = true; - - if(fullscreen) - { - if(mFullscreen) - { - // Switching resolutions in fullscreen mode. Don't need to rebuild for this. - // Fullscreen support - CFDictionaryRef refDisplayMode = 0; - boolean_t exactMatch = false; - - // Switch the display to the desired resolution and refresh - refDisplayMode = CGDisplayBestModeForParametersAndRefreshRate( - mDisplay, - BITS_PER_PIXEL, - size.mX, - size.mY, - getDictDouble (CGDisplayCurrentMode (mDisplay), kCGDisplayRefreshRate), - &exactMatch); - - if (refDisplayMode) - { - CGDisplaySwitchToMode (mDisplay, refDisplayMode); - // CFRelease(refDisplayMode); - } - - mFullscreenWidth = CGDisplayPixelsWide(mDisplay); - mFullscreenHeight = CGDisplayPixelsHigh(mDisplay); - mFullscreenBits = CGDisplayBitsPerPixel(mDisplay); - mFullscreenRefresh = llround(getDictDouble (CGDisplayCurrentMode (mDisplay), kCGDisplayRefreshRate)); - - LL_INFOS("Window") << "Switched resolution to " << mFullscreenWidth - << "x" << mFullscreenHeight - << "x" << mFullscreenBits - << " @ " << mFullscreenRefresh - << LL_ENDL; - - // Update the GL context to the new screen size - if (!aglUpdateContext(mContext)) - { - setupFailure("Can't set GL fullscreen", "Error", OSMB_OK); - result = FALSE; - } - } - else - { - // Switching from windowed to fullscreen - needsRebuild = TRUE; - } - } - else - { - if(mFullscreen) - { - // Switching from fullscreen to windowed - needsRebuild = TRUE; - } - else - { - // Windowed to windowed -- not sure why we would be called like this. Just change the window size. - // The bounds changed event handler will do the rest. - if(mWindow != NULL) - { - ::SizeWindow(mWindow, size.mX, size.mY, true); - } - } - } - - stop_glerror(); - if(needsRebuild || mForceRebuild) - { - mForceRebuild = FALSE; - destroyContext(); - result = createContext(0, 0, size.mX, size.mY, 0, fullscreen, disable_vsync); - if (result) - { - if(mWindow != NULL) - { - MacShowWindow(mWindow); - BringToFront(mWindow); - } - - llverify(gGLManager.initGL()); - - //start with arrow cursor - initCursors(); - setCursor( UI_CURSOR_ARROW ); - } - } - - stop_glerror(); - - return result; + return FALSE; } void LLWindowMacOSX::destroyContext() @@ -925,32 +612,7 @@ void LLWindowMacOSX::destroyContext() if(mContext != NULL) { LL_DEBUGS("Window") << "destroyContext: unhooking drawable " << LL_ENDL; - - aglSetCurrentContext (NULL); - aglSetDrawable(mContext, NULL); - } - - // Make sure the display resolution gets restored - if(mOldDisplayMode != NULL) - { - LL_DEBUGS("Window") << "destroyContext: restoring display resolution " << LL_ENDL; - - CGDisplaySwitchToMode (mDisplay, mOldDisplayMode); - -#if CAPTURE_ALL_DISPLAYS - // Uncapture all displays (may want to do this for final build) - CGReleaseAllDisplays (); -#else - // Uncapture only the main display (useful for debugging) - CGDisplayRelease (mDisplay); -#endif - - // CFRelease(mOldDisplayMode); - - mOldDisplayMode = NULL; - - // Remove the global event handlers the fullscreen case needed - RemoveEventTypesFromHandler(mGlobalHandlerRef, GetEventTypeCount (GlobalHandlerEventList), GlobalHandlerEventList); + CGLSetCurrentContext(NULL); } // Clean up remaining GL state before blowing away window @@ -959,49 +621,29 @@ void LLWindowMacOSX::destroyContext() // Clean up the pixel format if(mPixelFormat != NULL) { - LL_DEBUGS("Window") << "destroyContext: destroying pixel format " << LL_ENDL; - aglDestroyPixelFormat(mPixelFormat); + CGLDestroyPixelFormat(mPixelFormat); mPixelFormat = NULL; } - // Remove any Carbon Event handlers we installed - if(mGlobalHandlerRef != NULL) - { - LL_DEBUGS("Window") << "destroyContext: removing global event handler" << LL_ENDL; - RemoveEventHandler(mGlobalHandlerRef); - mGlobalHandlerRef = NULL; - } - - if(mWindowHandlerRef != NULL) + // Clean up the GL context + if(mContext != NULL) { - LL_DEBUGS("Window") << "destroyContext: removing window event handler" << LL_ENDL; - RemoveEventHandler(mWindowHandlerRef); - mWindowHandlerRef = NULL; + CGLDestroyContext(mContext); } - - // Cleanup any TSM document we created. - if(mTSMDocument != NULL) + + // Destroy our LLOpenGLView + if(mGLView != NULL) { - LL_DEBUGS("Window") << "destroyContext: deleting TSM document" << LL_ENDL; - DeactivateTSMDocument(mTSMDocument); - DeleteTSMDocument(mTSMDocument); - mTSMDocument = NULL; + removeGLView(mGLView); + mGLView = NULL; } - + // Close the window if(mWindow != NULL) { - LL_DEBUGS("Window") << "destroyContext: disposing window" << LL_ENDL; - DisposeWindow(mWindow); - mWindow = NULL; - } - - // Clean up the GL context - if(mContext != NULL) - { - LL_DEBUGS("Window") << "destroyContext: destroying GL context" << LL_ENDL; - aglDestroyContext(mContext); - mContext = NULL; + NSWindowRef dead_window = mWindow; + mWindow = NULL; + closeWindow(dead_window); } } @@ -1022,17 +664,11 @@ LLWindowMacOSX::~LLWindowMacOSX() void LLWindowMacOSX::show() { - if(IsWindowCollapsed(mWindow)) - CollapseWindow(mWindow, false); - - MacShowWindow(mWindow); - BringToFront(mWindow); } void LLWindowMacOSX::hide() { setMouseClipping(FALSE); - HideWindow(mWindow); } //virtual @@ -1040,7 +676,6 @@ void LLWindowMacOSX::minimize() { setMouseClipping(FALSE); showCursor(); - CollapseWindow(mWindow, true); } //virtual @@ -1086,7 +721,6 @@ BOOL LLWindowMacOSX::getVisible() result = TRUE; }if (mWindow) { - if(MacIsWindowVisible(mWindow)) result = TRUE; } @@ -1107,7 +741,6 @@ BOOL LLWindowMacOSX::maximize() { if (mWindow && !mMaximized) { - ZoomWindow(mWindow, inContent, true); } return mMaximized; @@ -1120,58 +753,13 @@ BOOL LLWindowMacOSX::getFullscreen() void LLWindowMacOSX::gatherInput() { - // stop bouncing icon after fixed period of time - if (mBounceTimer.getStarted() && mBounceTimer.getElapsedTimeF32() > mBounceTime) - { - stopDockTileBounce(); - } - - // Use the old-school version so we get AppleEvent handler dispatch and menuselect handling. - // Anything that has an event handler will get processed inside WaitNextEvent, so we only need to handle - // the odd stuff here. - EventRecord evt; - while(WaitNextEvent(everyEvent, &evt, 0, NULL)) - { - // printf("WaitNextEvent returned true, event is %d.\n", evt.what); - switch(evt.what) - { - case mouseDown: - { - short part; - WindowRef window; - long selectResult; - part = FindWindow(evt.where, &window); - switch ( part ) - { - case inMenuBar: - selectResult = MenuSelect(evt.where); - - HiliteMenu(0); - break; - } - } - break; - - case kHighLevelEvent: - AEProcessAppleEvent (&evt); - break; - - case updateEvt: - // We shouldn't be getting these regularly (since our window will be buffered), but we need to handle them correctly... - BeginUpdate((WindowRef)evt.message); - EndUpdate((WindowRef)evt.message); - break; - - } - } - updateCursor(); } BOOL LLWindowMacOSX::getPosition(LLCoordScreen *position) { - Rect window_rect; - OSStatus err = -1; + float rect[4]; + S32 err = -1; if(mFullscreen) { @@ -1181,10 +769,10 @@ BOOL LLWindowMacOSX::getPosition(LLCoordScreen *position) } else if(mWindow) { - err = GetWindowBounds(mWindow, kWindowContentRgn, &window_rect); + getContentViewBounds(mWindow, rect); - position->mX = window_rect.left; - position->mY = window_rect.top; + position->mX = rect[0]; + position->mY = rect[1]; } else { @@ -1196,8 +784,8 @@ BOOL LLWindowMacOSX::getPosition(LLCoordScreen *position) BOOL LLWindowMacOSX::getSize(LLCoordScreen *size) { - Rect window_rect; - OSStatus err = -1; + float rect[4]; + S32 err = -1; if(mFullscreen) { @@ -1207,10 +795,10 @@ BOOL LLWindowMacOSX::getSize(LLCoordScreen *size) } else if(mWindow) { - err = GetWindowBounds(mWindow, kWindowContentRgn, &window_rect); + getContentViewBounds(mWindow, rect); - size->mX = window_rect.right - window_rect.left; - size->mY = window_rect.bottom - window_rect.top; + size->mX = rect[2]; + size->mY = rect[3]; } else { @@ -1222,9 +810,9 @@ BOOL LLWindowMacOSX::getSize(LLCoordScreen *size) BOOL LLWindowMacOSX::getSize(LLCoordWindow *size) { - Rect window_rect; - OSStatus err = -1; - + float rect[4]; + S32 err = -1; + if(mFullscreen) { size->mX = mFullscreenWidth; @@ -1233,16 +821,16 @@ BOOL LLWindowMacOSX::getSize(LLCoordWindow *size) } else if(mWindow) { - err = GetWindowBounds(mWindow, kWindowContentRgn, &window_rect); - - size->mX = window_rect.right - window_rect.left; - size->mY = window_rect.bottom - window_rect.top; + getContentViewBounds(mWindow, rect); + + size->mX = rect[2]; + size->mY = rect[3]; } else { llerrs << "LLWindowMacOSX::getPosition(): no window and not fullscreen!" << llendl; } - + return (err == noErr); } @@ -1250,7 +838,8 @@ BOOL LLWindowMacOSX::setPosition(const LLCoordScreen position) { if(mWindow) { - MacMoveWindow(mWindow, position.mX, position.mY, false); + float pos[2] = {position.mX, position.mY}; + setWindowPos(mWindow, pos); } return TRUE; @@ -1260,45 +849,35 @@ BOOL LLWindowMacOSX::setSizeImpl(const LLCoordScreen size) { if(mWindow) { - SizeWindow(mWindow, size.mX, size.mY, true); + LLCoordWindow to; + convertCoords(size, &to); + setWindowSize(mWindow, to.mX, to.mY); + return TRUE; } - return TRUE; + return FALSE; } BOOL LLWindowMacOSX::setSizeImpl(const LLCoordWindow size) { - Rect client_rect; if (mWindow) { - OSStatus err = GetWindowBounds(mWindow, kWindowContentRgn, &client_rect); - if (err == noErr) - { - client_rect.right = client_rect.left + size.mX; - client_rect.bottom = client_rect.top + size.mY; - err = SetWindowBounds(mWindow, kWindowContentRgn, &client_rect); - } - if (err == noErr) - { - return TRUE; - } - else - { - llinfos << "Error setting size" << err << llendl; - return FALSE; - } + const int titlePadding = 22; + setWindowSize(mWindow, size.mX, size.mY + titlePadding); + return TRUE; } + return FALSE; } void LLWindowMacOSX::swapBuffers() { - aglSwapBuffers(mContext); + CGLFlushDrawable(mContext); } F32 LLWindowMacOSX::getGamma() { - F32 result = 1.8; // Default to something sane + F32 result = 2.2; // Default to something sane CGGammaValue redMin; CGGammaValue redMax; @@ -1454,39 +1033,15 @@ BOOL LLWindowMacOSX::setCursorPosition(const LLCoordWindow position) return result; } -static void fixOrigin(void) -{ - GrafPtr port; - Rect portrect; - - ::GetPort(&port); - ::GetPortBounds(port, &portrect); - if((portrect.left != 0) || (portrect.top != 0)) - { - // Mozilla sometimes changes our port origin. - ::SetOrigin(0,0); - } -} - BOOL LLWindowMacOSX::getCursorPosition(LLCoordWindow *position) { - Point cursor_point; + float cursor_point[2]; LLCoordScreen screen_pos; - GrafPtr save; if(mWindow == NULL) return FALSE; - - ::GetPort(&save); - ::SetPort(GetWindowPort(mWindow)); - fixOrigin(); - - // gets the mouse location in local coordinates - ::GetMouse(&cursor_point); - -// lldebugs << "getCursorPosition(): cursor is at " << cursor_point.h << ", " << cursor_point.v << " port origin: " << portrect.left << ", " << portrect.top << llendl; - - ::SetPort(save); + + getCursorPos(mWindow, cursor_point); if(mCursorDecoupled) { @@ -1499,12 +1054,12 @@ BOOL LLWindowMacOSX::getCursorPosition(LLCoordWindow *position) // CGGetLastMouseDelta may behave strangely when the cursor's first captured. // Stash in the event handler instead. - cursor_point.h += mCursorLastEventDeltaX; - cursor_point.v += mCursorLastEventDeltaY; + cursor_point[0] += mCursorLastEventDeltaX; + cursor_point[1] += mCursorLastEventDeltaY; } - position->mX = cursor_point.h; - position->mY = cursor_point.v; + position->mX = cursor_point[0]; + position->mY = cursor_point[1]; return TRUE; } @@ -1521,7 +1076,6 @@ void LLWindowMacOSX::adjustCursorDecouple(bool warpingMouse) // llinfos << "adjustCursorDecouple: decoupling cursor" << llendl; CGAssociateMouseAndMouseCursorPosition(false); mCursorDecoupled = true; - FlushSpecificEventsFromQueue(GetCurrentEventQueue(), mMoveEventCampartorUPP, NULL); mCursorIgnoreNextDelta = TRUE; } } @@ -1568,179 +1122,46 @@ F32 LLWindowMacOSX::getPixelAspectRatio() // MBW -- XXX -- There's got to be a better way than this. Find it, please... +// Since we're no longer supporting the "typical" fullscreen mode with CGL or NSOpenGL anymore, these are unnecessary. -Geenz void LLWindowMacOSX::beforeDialog() { - if(mFullscreen) - { - -#if CAPTURE_ALL_DISPLAYS - // Uncapture all displays (may want to do this for final build) - CGReleaseAllDisplays (); -#else - // Uncapture only the main display (useful for debugging) - CGDisplayRelease (mDisplay); -#endif - // kDocumentWindowClass - // kMovableModalWindowClass - // kAllWindowClasses - - // GLint order = 0; - // aglSetInteger(mContext, AGL_ORDER_CONTEXT_TO_FRONT, &order); - aglSetDrawable(mContext, NULL); - // GetWindowGroupLevel(GetWindowGroupOfClass(kAllWindowClasses), &oldWindowLevel); - // SetWindowGroupLevel(GetWindowGroupOfClass(kAllWindowClasses), CGShieldingWindowLevel()); - - mHandsOffEvents = TRUE; - - } } void LLWindowMacOSX::afterDialog() { - if(mFullscreen) - { - mHandsOffEvents = FALSE; - - // SetWindowGroupLevel(GetWindowGroupOfClass(kAllWindowClasses), oldWindowLevel); - aglSetFullScreen(mContext, 0, 0, 0, 0); - // GLint order = 1; - // aglSetInteger(mContext, AGL_ORDER_CONTEXT_TO_FRONT, &order); - -#if CAPTURE_ALL_DISPLAYS - // Capture all displays (may want to do this for final build) - CGCaptureAllDisplays (); -#else - // Capture only the main display (useful for debugging) - CGDisplayCapture (mDisplay); -#endif - } } void LLWindowMacOSX::flashIcon(F32 seconds) { - // Don't do this if we're already started, since this would try to install the NMRec twice. - if(!mBounceTimer.getStarted()) - { - OSErr err; - - mBounceTime = seconds; - memset(&mBounceRec, 0, sizeof(mBounceRec)); - mBounceRec.qType = nmType; - mBounceRec.nmMark = 1; - err = NMInstall(&mBounceRec); - if(err == noErr) - { - mBounceTimer.start(); - } - else - { - // This is very not-fatal (only problem is the icon will not bounce), but we'd like to find out about it somehow... - llinfos << "NMInstall failed with error code " << err << llendl; - } - } + // For consistency with OS X conventions, the number of seconds given is ignored and + // left up to the OS (which will actually bounce it for one second). + requestUserAttention(); } BOOL LLWindowMacOSX::isClipboardTextAvailable() { - OSStatus err; - ScrapRef scrap; - ScrapFlavorFlags flags; - BOOL result = false; - - err = GetCurrentScrap(&scrap); - - if(err == noErr) - { - err = GetScrapFlavorFlags(scrap, kScrapFlavorTypeUnicode, &flags); - } - - if(err == noErr) - result = true; - - return result; + return pasteBoardAvailable(); } BOOL LLWindowMacOSX::pasteTextFromClipboard(LLWString &dst) -{ - OSStatus err; - ScrapRef scrap; - Size len; - BOOL result = false; - - err = GetCurrentScrap(&scrap); - - if(err == noErr) +{ + llutf16string str(copyFromPBoard()); + dst = utf16str_to_wstring(str); + if (dst != L"") { - err = GetScrapFlavorSize(scrap, kScrapFlavorTypeUnicode, &len); - } - - if((err == noErr) && (len > 0)) - { - int u16len = len / sizeof(U16); - U16 *temp = new U16[u16len + 1]; - if (temp) - { - memset(temp, 0, (u16len + 1) * sizeof(temp[0])); - err = GetScrapFlavorData(scrap, kScrapFlavorTypeUnicode, &len, temp); - if (err == noErr) - { - // convert \r\n to \n and \r to \n in the incoming text. - U16 *s, *d; - for(s = d = temp; s[0] != '\0'; s++, d++) - { - if(s[0] == '\r') - { - if(s[1] == '\n') - { - // CRLF, a.k.a. DOS newline. Collapse to a single '\n'. - s++; - } - - d[0] = '\n'; - } - else - { - d[0] = s[0]; - } - } - - d[0] = '\0'; - - dst = utf16str_to_wstring(temp); - - result = true; - } - delete[] temp; - } + return true; + } else { + return false; } - - return result; } BOOL LLWindowMacOSX::copyTextToClipboard(const LLWString &s) { - OSStatus err; - ScrapRef scrap; - //Size len; - //char *temp; BOOL result = false; - - if (!s.empty()) - { - err = GetCurrentScrap(&scrap); - if (err == noErr) - err = ClearScrap(&scrap); - - if (err == noErr) - { - llutf16string utf16str = wstring_to_utf16str(s); - size_t u16len = utf16str.length() * sizeof(U16); - err = PutScrapFlavor(scrap, kScrapFlavorTypeUnicode, kScrapFlavorMaskNone, u16len, utf16str.data()); - if (err == noErr) - result = true; - } - } + llutf16string utf16str = wstring_to_utf16str(s); + + result = copyToPBoard(utf16str.data(), utf16str.length()); return result; } @@ -1806,122 +1227,52 @@ LLWindow::LLWindowResolution* LLWindowMacOSX::getSupportedResolutions(S32 &num_r BOOL LLWindowMacOSX::convertCoords(LLCoordGL from, LLCoordWindow *to) { - S32 client_height; - Rect client_rect; - - if(mFullscreen) - { - // In the fullscreen case, the "window" is the entire screen. - client_rect.left = 0; - client_rect.top = 0; - client_rect.right = mFullscreenWidth; - client_rect.bottom = mFullscreenHeight; - } - else if (!mWindow || - (GetWindowBounds(mWindow, kWindowContentRgn, &client_rect) != noErr) || - NULL == to) - { - return FALSE; - } - to->mX = from.mX; - client_height = client_rect.bottom - client_rect.top; - to->mY = client_height - from.mY - 1; - + to->mY = from.mY; return TRUE; } BOOL LLWindowMacOSX::convertCoords(LLCoordWindow from, LLCoordGL* to) { - S32 client_height; - Rect client_rect; - - if(mFullscreen) - { - // In the fullscreen case, the "window" is the entire screen. - client_rect.left = 0; - client_rect.top = 0; - client_rect.right = mFullscreenWidth; - client_rect.bottom = mFullscreenHeight; - } - else if (!mWindow || - (GetWindowBounds(mWindow, kWindowContentRgn, &client_rect) != noErr) || - NULL == to) - { - return FALSE; - } - to->mX = from.mX; - client_height = client_rect.bottom - client_rect.top; - to->mY = client_height - from.mY - 1; - + to->mY = from.mY; return TRUE; } BOOL LLWindowMacOSX::convertCoords(LLCoordScreen from, LLCoordWindow* to) { - if(mFullscreen) - { - // In the fullscreen case, window and screen coordinates are the same. - to->mX = from.mX; - to->mY = from.mY; - return TRUE; - } - else if(mWindow) + if(mWindow) { - GrafPtr save; - Point mouse_point; - - mouse_point.h = from.mX; - mouse_point.v = from.mY; - - ::GetPort(&save); - ::SetPort(GetWindowPort(mWindow)); - fixOrigin(); - - ::GlobalToLocal(&mouse_point); + float mouse_point[2]; - to->mX = mouse_point.h; - to->mY = mouse_point.v; + mouse_point[0] = from.mX; + mouse_point[1] = from.mY; + + convertScreenToWindow(mWindow, mouse_point); - ::SetPort(save); + to->mX = mouse_point[0]; + to->mY = mouse_point[1]; return TRUE; } - return FALSE; } BOOL LLWindowMacOSX::convertCoords(LLCoordWindow from, LLCoordScreen *to) { - if(mFullscreen) - { - // In the fullscreen case, window and screen coordinates are the same. - to->mX = from.mX; - to->mY = from.mY; - return TRUE; - } - else if(mWindow) + if(mWindow) { - GrafPtr save; - Point mouse_point; - - mouse_point.h = from.mX; - mouse_point.v = from.mY; - ::GetPort(&save); - ::SetPort(GetWindowPort(mWindow)); - fixOrigin(); - - LocalToGlobal(&mouse_point); + float mouse_point[2]; - to->mX = mouse_point.h; - to->mY = mouse_point.v; + mouse_point[0] = from.mX; + mouse_point[1] = from.mY; + convertWindowToScreen(mWindow, mouse_point); - ::SetPort(save); + to->mX = mouse_point[0]; + to->mY = mouse_point[1]; return TRUE; } - return FALSE; } @@ -1949,862 +1300,6 @@ void LLWindowMacOSX::setupFailure(const std::string& text, const std::string& ca OSMessageBox(text, caption, type); } -pascal Boolean LLWindowMacOSX::staticMoveEventComparator( EventRef event, void* data) -{ - UInt32 evtClass = GetEventClass (event); - UInt32 evtKind = GetEventKind (event); - - if ((evtClass == kEventClassMouse) && ((evtKind == kEventMouseDragged) || (evtKind == kEventMouseMoved))) - { - return true; - } - - else - { - return false; - } -} - - -pascal OSStatus LLWindowMacOSX::staticEventHandler(EventHandlerCallRef myHandler, EventRef event, void* userData) -{ - LLWindowMacOSX *self = (LLWindowMacOSX*)userData; - - return(self->eventHandler(myHandler, event)); -} - -OSStatus LLWindowMacOSX::eventHandler (EventHandlerCallRef myHandler, EventRef event) -{ - OSStatus result = eventNotHandledErr; - UInt32 evtClass = GetEventClass (event); - UInt32 evtKind = GetEventKind (event); - - // Always handle command events, even in hands-off mode. - if((evtClass == kEventClassCommand) && (evtKind == kEventCommandProcess)) - { - HICommand command; - GetEventParameter (event, kEventParamDirectObject, typeHICommand, NULL, sizeof(command), NULL, &command); - - switch(command.commandID) - { - case kHICommandQuit: - if(mCallbacks->handleCloseRequest(this)) - { - // Get the app to initiate cleanup. - mCallbacks->handleQuit(this); - // The app is responsible for calling destroyWindow when done with GL - } - result = noErr; - break; - - default: - // MBW -- XXX -- Should we handle other events here? - break; - } - } - - if(mHandsOffEvents) - { - return(result); - } - - switch (evtClass) - { - case kEventClassTextInput: - { - switch (evtKind) - { - case kEventTextInputUpdateActiveInputArea: - { - EventParamType param_type; - - long fix_len; - UInt32 text_len; - if (mPreeditor - && (result = GetEventParameter(event, kEventParamTextInputSendFixLen, - typeLongInteger, ¶m_type, sizeof(fix_len), NULL, &fix_len)) == noErr - && typeLongInteger == param_type - && (result = GetEventParameter(event, kEventParamTextInputSendText, - typeUnicodeText, ¶m_type, 0, &text_len, NULL)) == noErr - && typeUnicodeText == param_type) - { - // Handle an optional (but essential to facilitate TSMDA) ReplaceRange param. - CFRange range; - if (GetEventParameter(event, kEventParamTextInputSendReplaceRange, - typeCFRange, ¶m_type, sizeof(range), NULL, &range) == noErr - && typeCFRange == param_type) - { - // Although the spec. is unclear, replace range should - // not present when there is an active preedit. We just - // ignore the case. markAsPreedit will detect the case and warn it. - const LLWString & text = mPreeditor->getPreeditString(); - const S32 location = wstring_wstring_length_from_utf16_length(text, 0, range.location); - const S32 length = wstring_wstring_length_from_utf16_length(text, location, range.length); - mPreeditor->markAsPreedit(location, length); - } - mPreeditor->resetPreedit(); - - // Receive the text from input method. - U16 *const text = new U16[text_len / sizeof(U16)]; - GetEventParameter(event, kEventParamTextInputSendText, typeUnicodeText, NULL, text_len, NULL, text); - if (fix_len < 0) - { - // Do we still need this? Seems obsolete... - fix_len = text_len; - } - const LLWString fix_string - = utf16str_to_wstring(llutf16string(text, fix_len / sizeof(U16))); - const LLWString preedit_string - = utf16str_to_wstring(llutf16string(text + fix_len / sizeof(U16), (text_len - fix_len) / sizeof(U16))); - delete[] text; - - // Handle fixed (comitted) string. - if (fix_string.length() > 0) - { - for (LLWString::const_iterator i = fix_string.begin(); i != fix_string.end(); i++) - { - mPreeditor->handleUnicodeCharHere(*i); - } - } - - // Receive the segment info and caret position. - LLPreeditor::segment_lengths_t preedit_segment_lengths; - LLPreeditor::standouts_t preedit_standouts; - S32 caret_position = preedit_string.length(); - UInt32 text_range_array_size; - if (GetEventParameter(event, kEventParamTextInputSendHiliteRng, typeTextRangeArray, - ¶m_type, 0, &text_range_array_size, NULL) == noErr - && typeTextRangeArray == param_type - && text_range_array_size > sizeof(TextRangeArray)) - { - // TextRangeArray is a variable-length struct. - TextRangeArray * const text_range_array = (TextRangeArray *) new char[text_range_array_size]; - GetEventParameter(event, kEventParamTextInputSendHiliteRng, typeTextRangeArray, - NULL, text_range_array_size, NULL, text_range_array); - - // WARNING: We assume ranges are in ascending order, - // although the condition is undocumented. It seems - // OK to assume this. I also assumed - // the ranges are contiguous in previous versions, but I - // have heard a rumore that older versions os ATOK may - // return ranges with some _gap_. I don't know whether - // it is true, but I'm preparing my code for the case. - - const S32 ranges = text_range_array->fNumOfRanges; - preedit_segment_lengths.reserve(ranges); - preedit_standouts.reserve(ranges); - - S32 last_bytes = 0; - S32 last_utf32 = 0; - for (S32 i = 0; i < ranges; i++) - { - const TextRange &range = text_range_array->fRange[i]; - if (range.fStart > last_bytes) - { - const S32 length_utf16 = (range.fStart - last_bytes) / sizeof(U16); - const S32 length_utf32 = wstring_wstring_length_from_utf16_length(preedit_string, last_utf32, length_utf16); - preedit_segment_lengths.push_back(length_utf32); - preedit_standouts.push_back(FALSE); - last_utf32 += length_utf32; - } - if (range.fEnd > range.fStart) - { - const S32 length_utf16 = (range.fEnd - range.fStart) / sizeof(U16); - const S32 length_utf32 = wstring_wstring_length_from_utf16_length(preedit_string, last_utf32, length_utf16); - preedit_segment_lengths.push_back(length_utf32); - preedit_standouts.push_back( - kTSMHiliteSelectedRawText == range.fHiliteStyle - || kTSMHiliteSelectedConvertedText == range.fHiliteStyle - || kTSMHiliteSelectedText == range.fHiliteStyle); - last_utf32 += length_utf32; - } - if (kTSMHiliteCaretPosition == range.fHiliteStyle) - { - caret_position = last_utf32; - } - last_bytes = range.fEnd; - } - if (preedit_string.length() > last_utf32) - { - preedit_segment_lengths.push_back(preedit_string.length() - last_utf32); - preedit_standouts.push_back(FALSE); - } - - delete[] (char *) text_range_array; - } - - // Handle preedit string. - if (preedit_string.length() == 0) - { - preedit_segment_lengths.clear(); - preedit_standouts.clear(); - } - else if (preedit_segment_lengths.size() == 0) - { - preedit_segment_lengths.push_back(preedit_string.length()); - preedit_standouts.push_back(FALSE); - } - mPreeditor->updatePreedit(preedit_string, preedit_segment_lengths, preedit_standouts, caret_position); - - result = noErr; - } - } - break; - - case kEventTextInputUnicodeForKeyEvent: - { - UInt32 modifiers = 0; - - - // First, process the raw event. - { - EventRef rawEvent = NULL; - - // Get the original event and extract the modifier keys, so we can ignore command-key events. - if (GetEventParameter(event, kEventParamTextInputSendKeyboardEvent, typeEventRef, NULL, sizeof(rawEvent), NULL, &rawEvent) == noErr) - { - // Grab the modifiers for later use in this function... - GetEventParameter (rawEvent, kEventParamKeyModifiers, typeUInt32, NULL, sizeof(UInt32), NULL, &modifiers); - - // and call this function recursively to handle the raw key event. - eventHandler (myHandler, rawEvent); - - // save the raw event until we're done processing the unicode input as well. - mRawKeyEvent = rawEvent; - } - } - - OSStatus err = noErr; - EventParamType actualType = typeUnicodeText; - UInt32 actualSize = 0; - size_t actualCount = 0; - U16 *buffer = NULL; - - // Get the size of the unicode data - err = GetEventParameter (event, kEventParamTextInputSendText, typeUnicodeText, &actualType, 0, &actualSize, NULL); - if(err == noErr) - { - // allocate a buffer and get the actual data. - actualCount = actualSize / sizeof(U16); - buffer = new U16[actualCount]; - err = GetEventParameter (event, kEventParamTextInputSendText, typeUnicodeText, &actualType, actualSize, &actualSize, buffer); - } - - if(err == noErr) - { - if(modifiers & (cmdKey | controlKey)) - { - // This was a menu key equivalent. Ignore it. - } - else - { - MASK mask = LLWindowMacOSX::modifiersToMask(modifiers); - - llassert( actualType == typeUnicodeText ); - - // The result is a UTF16 buffer. Pass the characters in turn to handleUnicodeChar. - - // Convert to UTF32 and go character-by-character. - llutf16string utf16(buffer, actualCount); - LLWString utf32 = utf16str_to_wstring(utf16); - LLWString::iterator iter; - - for(iter = utf32.begin(); iter != utf32.end(); iter++) - { - mCallbacks->handleUnicodeChar(*iter, mask); - } - } - } - - if(buffer != NULL) - { - delete[] buffer; - } - - mRawKeyEvent = NULL; - result = err; - } - break; - - case kEventTextInputOffsetToPos: - { - EventParamType param_type; - long offset; - if (mPreeditor - && GetEventParameter(event, kEventParamTextInputSendTextOffset, typeLongInteger, - ¶m_type, sizeof(offset), NULL, &offset) == noErr - && typeLongInteger == param_type) - { - S32 preedit, preedit_length; - mPreeditor->getPreeditRange(&preedit, &preedit_length); - const LLWString & text = mPreeditor->getPreeditString(); - - LLCoordGL caret_coord; - LLRect preedit_bounds; - if (0 <= offset - && mPreeditor->getPreeditLocation(wstring_wstring_length_from_utf16_length(text, preedit, offset / sizeof(U16)), - &caret_coord, &preedit_bounds, NULL)) - { - LLCoordGL caret_base_coord(caret_coord.mX, preedit_bounds.mBottom); - LLCoordScreen caret_base_coord_screen; - convertCoords(caret_base_coord, &caret_base_coord_screen); - Point qd_point; - qd_point.h = caret_base_coord_screen.mX; - qd_point.v = caret_base_coord_screen.mY; - SetEventParameter(event, kEventParamTextInputReplyPoint, typeQDPoint, sizeof(qd_point), &qd_point); - - short line_height = (short) preedit_bounds.getHeight(); - SetEventParameter(event, kEventParamTextInputReplyLineHeight, typeShortInteger, sizeof(line_height), &line_height); - - result = noErr; - } - else - { - result = errOffsetInvalid; - } - } - } - break; - - case kEventTextInputGetSelectedText: - { - if (mPreeditor) - { - S32 selection, selection_length; - mPreeditor->getSelectionRange(&selection, &selection_length); - if (selection_length) - { - const LLWString text = mPreeditor->getPreeditString().substr(selection, selection_length); - const llutf16string text_utf16 = wstring_to_utf16str(text); - result = SetEventParameter(event, kEventParamTextInputReplyText, typeUnicodeText, - text_utf16.length() * sizeof(U16), text_utf16.c_str()); - } - } - } - break; - } - } - break; - - case kEventClassKeyboard: - { - UInt32 keyCode = 0; - char charCode = 0; - UInt32 modifiers = 0; - - // Some of these may fail for some event types. That's fine. - GetEventParameter (event, kEventParamKeyCode, typeUInt32, NULL, sizeof(UInt32), NULL, &keyCode); - GetEventParameter (event, kEventParamKeyModifiers, typeUInt32, NULL, sizeof(UInt32), NULL, &modifiers); - - // save the raw event so getNativeKeyData can use it. - mRawKeyEvent = event; - - // printf("key event, key code = 0x%08x, char code = 0x%02x (%c), modifiers = 0x%08x\n", keyCode, charCode, (char)charCode, modifiers); - // fflush(stdout); - - switch (evtKind) - { - case kEventRawKeyDown: - case kEventRawKeyRepeat: - if (gDebugWindowProc) - { - printf("key down, key code = 0x%08x, char code = 0x%02x (%c), modifiers = 0x%08x\n", - (unsigned int)keyCode, charCode, (char)charCode, (unsigned int)modifiers); - fflush(stdout); - } - gKeyboard->handleKeyDown(keyCode, modifiers); - result = eventNotHandledErr; - break; - - case kEventRawKeyUp: - if (gDebugWindowProc) - { - printf("key up, key code = 0x%08x, char code = 0x%02x (%c), modifiers = 0x%08x\n", - (unsigned int)keyCode, charCode, (char)charCode, (unsigned int)modifiers); - fflush(stdout); - } - gKeyboard->handleKeyUp(keyCode, modifiers); - result = eventNotHandledErr; - break; - - case kEventRawKeyModifiersChanged: - // The keyboard input system wants key up/down events for modifier keys. - // Mac OS doesn't supply these directly, but can supply events when the collective modifier state changes. - // Use these events to generate up/down events for the modifiers. - - if((modifiers & shiftKey) && !(mLastModifiers & shiftKey)) - { - if (gDebugWindowProc) printf("Shift key down event\n"); - gKeyboard->handleKeyDown(0x38, (modifiers & 0x00FFFFFF) | ((0x38 << 24) & 0xFF000000)); - } - else if(!(modifiers & shiftKey) && (mLastModifiers & shiftKey)) - { - if (gDebugWindowProc) printf("Shift key up event\n"); - gKeyboard->handleKeyUp(0x38, (modifiers & 0x00FFFFFF) | ((0x38 << 24) & 0xFF000000)); - } - - if((modifiers & alphaLock) && !(mLastModifiers & alphaLock)) - { - if (gDebugWindowProc) printf("Caps lock down event\n"); - gKeyboard->handleKeyDown(0x39, (modifiers & 0x00FFFFFF) | ((0x39 << 24) & 0xFF000000)); - } - else if(!(modifiers & alphaLock) && (mLastModifiers & alphaLock)) - { - if (gDebugWindowProc) printf("Caps lock up event\n"); - gKeyboard->handleKeyUp(0x39, (modifiers & 0x00FFFFFF) | ((0x39 << 24) & 0xFF000000)); - } - - if((modifiers & controlKey) && !(mLastModifiers & controlKey)) - { - if (gDebugWindowProc) printf("Control key down event\n"); - gKeyboard->handleKeyDown(0x3b, (modifiers & 0x00FFFFFF) | ((0x3b << 24) & 0xFF000000)); - } - else if(!(modifiers & controlKey) && (mLastModifiers & controlKey)) - { - if (gDebugWindowProc) printf("Control key up event\n"); - gKeyboard->handleKeyUp(0x3b, (modifiers & 0x00FFFFFF) | ((0x3b << 24) & 0xFF000000)); - } - - if((modifiers & optionKey) && !(mLastModifiers & optionKey)) - { - if (gDebugWindowProc) printf("Option key down event\n"); - gKeyboard->handleKeyDown(0x3a, (modifiers & 0x00FFFFFF) | ((0x3a << 24) & 0xFF000000)); - } - else if(!(modifiers & optionKey) && (mLastModifiers & optionKey)) - { - if (gDebugWindowProc) printf("Option key up event\n"); - gKeyboard->handleKeyUp(0x3a, (modifiers & 0x00FFFFFF) | ((0x3a << 24) & 0xFF000000)); - } - - // When the state of the 'Fn' key (the one that changes some of the mappings on a powerbook/macbook keyboard - // to an embedded keypad) changes, it may subsequently cause a key up event to be lost, which may lead to - // a movement key getting "stuck" down. This is bad. - // This is an OS bug -- even the GetKeys() API doesn't tell you the key has been released. - // This workaround causes all held-down keys to be reset whenever the state of the Fn key changes. This isn't - // exactly what we want, but it does avoid the case where you get stuck running forward. - if((modifiers & kEventKeyModifierFnMask) != (mLastModifiers & kEventKeyModifierFnMask)) - { - if (gDebugWindowProc) printf("Fn key state change event\n"); - gKeyboard->resetKeys(); - } - - if (gDebugWindowProc) fflush(stdout); - - mLastModifiers = modifiers; - result = eventNotHandledErr; - break; - } - - mRawKeyEvent = NULL; - } - break; - - case kEventClassMouse: - { - result = CallNextEventHandler(myHandler, event); - if (eventNotHandledErr == result) - { // only handle events not already handled (prevents wierd resize interaction) - EventMouseButton button = kEventMouseButtonPrimary; - HIPoint location = {0.0f, 0.0f}; - UInt32 modifiers = 0; - UInt32 clickCount = 1; - long wheelDelta = 0; - LLCoordScreen inCoords; - LLCoordGL outCoords; - MASK mask = 0; - - GetEventParameter(event, kEventParamMouseButton, typeMouseButton, NULL, sizeof(button), NULL, &button); - GetEventParameter(event, kEventParamMouseLocation, typeHIPoint, NULL, sizeof(location), NULL, &location); - GetEventParameter(event, kEventParamKeyModifiers, typeUInt32, NULL, sizeof(modifiers), NULL, &modifiers); - GetEventParameter(event, kEventParamMouseWheelDelta, typeLongInteger, NULL, sizeof(wheelDelta), NULL, &wheelDelta); - GetEventParameter(event, kEventParamClickCount, typeUInt32, NULL, sizeof(clickCount), NULL, &clickCount); - - inCoords.mX = llround(location.x); - inCoords.mY = llround(location.y); - - if(modifiers & shiftKey) { mask |= MASK_SHIFT; } - if(modifiers & controlKey) { mask |= MASK_CONTROL; } - if(modifiers & optionKey) { mask |= MASK_ALT; } - - if(mCursorDecoupled) - { - CGMouseDelta x, y; - - // If the cursor's decoupled, we need to read the latest movement delta as well. - CGGetLastMouseDelta( &x, &y ); - mCursorLastEventDeltaX = x; - mCursorLastEventDeltaY = y; - - if(mCursorIgnoreNextDelta) - { - mCursorLastEventDeltaX = 0; - mCursorLastEventDeltaY = 0; - mCursorIgnoreNextDelta = FALSE; - } - } - else - { - mCursorLastEventDeltaX = 0; - mCursorLastEventDeltaY = 0; - } - - inCoords.mX += mCursorLastEventDeltaX; - inCoords.mY += mCursorLastEventDeltaY; - - convertCoords(inCoords, &outCoords); - - // printf("coords in: %d, %d; coords out: %d, %d\n", inCoords.mX, inCoords.mY, outCoords.mX, outCoords.mY); - // fflush(stdout); - - - switch (evtKind) - { - case kEventMouseDown: - if (mLanguageTextInputAllowed) - { - // We need to interrupt before handling mouse events, - // so that the fixed string from IM are delivered to - // the currently focused UI component. - interruptLanguageTextInput(); - } - switch(button) - { - case kEventMouseButtonPrimary: - if(modifiers & cmdKey) - { - // Simulate a right click - mSimulatedRightClick = true; - mCallbacks->handleRightMouseDown(this, outCoords, mask); - } - else if(clickCount == 2) - { - // Windows double-click events replace the second mousedown event in a double-click. - mCallbacks->handleDoubleClick(this, outCoords, mask); - } - else - { - mCallbacks->handleMouseDown(this, outCoords, mask); - } - break; - case kEventMouseButtonSecondary: - mCallbacks->handleRightMouseDown(this, outCoords, mask); - break; - - case kEventMouseButtonTertiary: - mCallbacks->handleMiddleMouseDown(this, outCoords, mask); - break; - } - result = noErr; - break; - case kEventMouseUp: - - switch(button) - { - case kEventMouseButtonPrimary: - if(mSimulatedRightClick) - { - // End of simulated right click - mSimulatedRightClick = false; - mCallbacks->handleRightMouseUp(this, outCoords, mask); - } - else - { - mCallbacks->handleMouseUp(this, outCoords, mask); - } - break; - case kEventMouseButtonSecondary: - mCallbacks->handleRightMouseUp(this, outCoords, mask); - break; - - case kEventMouseButtonTertiary: - mCallbacks->handleMiddleMouseUp(this, outCoords, mask); - break; - } - result = noErr; - break; - - case kEventMouseWheelMoved: - { - static S32 z_delta = 0; - - z_delta += wheelDelta; - - if (z_delta <= -WHEEL_DELTA || WHEEL_DELTA <= z_delta) - { - mCallbacks->handleScrollWheel(this, -z_delta / WHEEL_DELTA); - z_delta = 0; - } - } - result = noErr; - break; - - case kEventMouseDragged: - case kEventMouseMoved: - mCallbacks->handleMouseMove(this, outCoords, mask); - result = noErr; - break; - - } - } - } - break; - - case kEventClassWindow: - switch(evtKind) - { - case kEventWindowActivated: - if (mTSMDocument) - { - ActivateTSMDocument(mTSMDocument); - } - mCallbacks->handleFocus(this); - break; - case kEventWindowDeactivated: - if (mTSMDocument) - { - DeactivateTSMDocument(mTSMDocument); - } - mCallbacks->handleFocusLost(this); - break; - - case kEventWindowBoundsChanging: - { - // This is where we would constrain move/resize to a particular screen - - const S32 MIN_WIDTH = mMinWindowWidth; - const S32 MIN_HEIGHT = mMinWindowHeight; - - Rect currentBounds; - Rect previousBounds; - - GetEventParameter(event, kEventParamCurrentBounds, typeQDRectangle, NULL, sizeof(Rect), NULL, ¤tBounds); - GetEventParameter(event, kEventParamPreviousBounds, typeQDRectangle, NULL, sizeof(Rect), NULL, &previousBounds); - - // Put an offset into window un-maximize operation since the kEventWindowGetIdealSize - // event only allows the specification of size and not position. - if (mMaximized) - { - short leftOffset = mPreviousWindowRect.left - currentBounds.left; - currentBounds.left += leftOffset; - currentBounds.right += leftOffset; - - short topOffset = mPreviousWindowRect.top - currentBounds.top; - currentBounds.top += topOffset; - currentBounds.bottom += topOffset; - } - else - { - // Store off the size for future un-maximize operations - mPreviousWindowRect = previousBounds; - } - - if ((currentBounds.right - currentBounds.left) < MIN_WIDTH) - { - currentBounds.right = currentBounds.left + MIN_WIDTH; - } - - if ((currentBounds.bottom - currentBounds.top) < MIN_HEIGHT) - { - currentBounds.bottom = currentBounds.top + MIN_HEIGHT; - } - - SetEventParameter(event, kEventParamCurrentBounds, typeQDRectangle, sizeof(Rect), ¤tBounds); - result = noErr; - } - break; - - case kEventWindowBoundsChanged: - { - // Get new window bounds - Rect newBounds; - GetEventParameter(event, kEventParamCurrentBounds, typeQDRectangle, NULL, sizeof(Rect), NULL, &newBounds); - - // Get previous window bounds - Rect oldBounds; - GetEventParameter(event, kEventParamPreviousBounds, typeQDRectangle, NULL, sizeof(Rect), NULL, &oldBounds); - - // Determine if the new size is larger than the old - bool newBoundsLarger = ((newBounds.right - newBounds.left) >= (oldBounds.right - oldBounds.left)); - newBoundsLarger &= ((newBounds.bottom - newBounds.top) >= (oldBounds.bottom - oldBounds.top)); - - // Check to see if this is a zoom event (+ button on window pane) - unsigned int eventParams; - GetEventParameter(event, kEventParamAttributes, typeUInt32, NULL, sizeof(int), NULL, &eventParams); - bool isZoomEvent = ((eventParams & kWindowBoundsChangeZoom) != 0); - - // Maximized flag is if zoom event and increasing window size - mMaximized = (isZoomEvent && newBoundsLarger); - - aglUpdateContext(mContext); - - mCallbacks->handleResize(this, newBounds.right - newBounds.left, newBounds.bottom - newBounds.top); - } - break; - - case kEventWindowGetIdealSize: - // Only recommend a new ideal size when un-maximizing - if (mMaximized == TRUE) - { - Point nonMaximizedSize; - - nonMaximizedSize.v = mPreviousWindowRect.bottom - mPreviousWindowRect.top; - nonMaximizedSize.h = mPreviousWindowRect.right - mPreviousWindowRect.left; - - SetEventParameter(event, kEventParamDimensions, typeQDPoint, sizeof(Point), &nonMaximizedSize); - result = noErr; - } - break; - - case kEventWindowClose: - if(mCallbacks->handleCloseRequest(this)) - { - // Get the app to initiate cleanup. - mCallbacks->handleQuit(this); - // The app is responsible for calling destroyWindow when done with GL - } - result = noErr; - break; - - case kEventWindowHidden: - // llinfos << "LLWindowMacOSX: Deactivating on hide" << llendl; - mMinimized = TRUE; - mCallbacks->handleActivate(this, false); - // result = noErr; - break; - - case kEventWindowShown: - // llinfos << "LLWindowMacOSX: Activating on show" << llendl; - mMinimized = FALSE; - mCallbacks->handleActivate(this, true); - // result = noErr; - break; - - case kEventWindowCollapsed: - // llinfos << "LLWindowMacOSX: Deactivating on collapse" << llendl; - mMinimized = TRUE; - mCallbacks->handleActivate(this, false); - // result = noErr; - break; - - case kEventWindowExpanded: - // llinfos << "LLWindowMacOSX: Activating on expand" << llendl; - mMinimized = FALSE; - mCallbacks->handleActivate(this, true); - // result = noErr; - break; - - case kEventWindowGetClickActivation: - // BringToFront(mWindow); - // result = noErr; - break; - } - break; - - case kEventClassTSMDocumentAccess: - if (mPreeditor) - { - switch(evtKind) - { - - case kEventTSMDocumentAccessGetLength: - { - // Return the number of UTF-16 units in the text, excluding those for preedit. - - S32 preedit, preedit_length; - mPreeditor->getPreeditRange(&preedit, &preedit_length); - const LLWString & text = mPreeditor->getPreeditString(); - const CFIndex length = wstring_utf16_length(text, 0, preedit) - + wstring_utf16_length(text, preedit + preedit_length, text.length()); - result = SetEventParameter(event, kEventParamTSMDocAccessCharacterCount, typeCFIndex, sizeof(length), &length); - } - break; - - case kEventTSMDocumentAccessGetSelectedRange: - { - // Return the selected range, excluding preedit. - // In our preeditor, preedit and selection are exclusive, so, - // when it has a preedit, there is no selection and the - // insertion point is on the preedit that corrupses into the - // beginning of the preedit when the preedit was removed. - - S32 preedit, preedit_length; - mPreeditor->getPreeditRange(&preedit, &preedit_length); - const LLWString & text = mPreeditor->getPreeditString(); - - CFRange range; - if (preedit_length) - { - range.location = wstring_utf16_length(text, 0, preedit); - range.length = 0; - } - else - { - S32 selection, selection_length; - mPreeditor->getSelectionRange(&selection, &selection_length); - range.location = wstring_utf16_length(text, 0, selection); - range.length = wstring_utf16_length(text, selection, selection_length); - } - - result = SetEventParameter(event, kEventParamTSMDocAccessReplyCharacterRange, typeCFRange, sizeof(range), &range); - } - break; - - case kEventTSMDocumentAccessGetCharacters: - { - UniChar *target_pointer; - CFRange range; - EventParamType param_type; - if ((result = GetEventParameter(event, kEventParamTSMDocAccessSendCharacterRange, - typeCFRange, ¶m_type, sizeof(range), NULL, &range)) == noErr - && typeCFRange == param_type - && (result = GetEventParameter(event, kEventParamTSMDocAccessSendCharactersPtr, - typePtr, ¶m_type, sizeof(target_pointer), NULL, &target_pointer)) == noErr - && typePtr == param_type) - { - S32 preedit, preedit_length; - mPreeditor->getPreeditRange(&preedit, &preedit_length); - const LLWString & text = mPreeditor->getPreeditString(); - - // The GetCharacters event of TSMDA has a fundamental flaw; - // An input method need to decide the starting offset and length - // *before* it actually see the contents, so it is impossible - // to guarantee the character-aligned access. The event reply - // has no way to indicate a condition something like "Request - // was not fulfilled due to unaligned access. Please retry." - // Any error sent back to the input method stops use of TSMDA - // entirely during the session... - // We need to simulate very strictly the behaviour as if the - // underlying *text engine* holds the contents in UTF-16. - // I guess this is the reason why Apple repeats saying "all - // text handling application should use UTF-16." They are - // trying to _fix_ the flaw by changing the appliations... - // ... or, domination of UTF-16 in the industry may be a part - // of the company vision, and Apple is trying to force third - // party developers to obey their vision. Remember that use - // of 16 bits per _a_character_ was one of the very fundamental - // Unicode design policy on its early days (during late 80s) - // and the original Unicode design was by two Apple employees... - - const llutf16string text_utf16 - = wstring_to_utf16str(text, preedit) - + wstring_to_utf16str(text.substr(preedit + preedit_length)); - - llassert_always(sizeof(U16) == sizeof(UniChar)); - llassert(0 <= range.location && 0 <= range.length && range.location + range.length <= text_utf16.length()); - memcpy(target_pointer, text_utf16.c_str() + range.location, range.length * sizeof(UniChar)); - - // Note that result has already been set above. - } - } - break; - - } - } - break; - } - return result; -} - const char* cursorIDToName(int id) { switch (id) @@ -2876,7 +1371,7 @@ static void initPixmapCursor(int cursorid, int hotspotX, int hotspotY) void LLWindowMacOSX::updateCursor() { - OSStatus result = noErr; + S32 result = 0; if (mDragOverrideCursor != -1) { @@ -2909,11 +1404,11 @@ void LLWindowMacOSX::updateCursor() { default: case UI_CURSOR_ARROW: - InitCursor(); + setArrowCursor(); if(mCursorHidden) { // Since InitCursor resets the hide level, correct for it here. - ::HideCursor(); + hideNSCursor(); } break; @@ -2921,12 +1416,12 @@ void LLWindowMacOSX::updateCursor() // Find out what they look like and replicate them. // These are essentially correct - case UI_CURSOR_WAIT: SetThemeCursor(kThemeWatchCursor); break; - case UI_CURSOR_IBEAM: SetThemeCursor(kThemeIBeamCursor); break; - case UI_CURSOR_CROSS: SetThemeCursor(kThemeCrossCursor); break; - case UI_CURSOR_HAND: SetThemeCursor(kThemePointingHandCursor); break; + case UI_CURSOR_WAIT: /* Apple purposely doesn't allow us to set the beachball cursor manually. Let NSApp figure out when to do this. */ break; + case UI_CURSOR_IBEAM: setIBeamCursor(); break; + case UI_CURSOR_CROSS: setCrossCursor(); break; + case UI_CURSOR_HAND: setPointingHandCursor(); break; // case UI_CURSOR_NO: SetThemeCursor(kThemeNotAllowedCursor); break; - case UI_CURSOR_ARROWCOPY: SetThemeCursor(kThemeCopyArrowCursor); break; + case UI_CURSOR_ARROWCOPY: setCopyCursor(); break; // Double-check these case UI_CURSOR_NO: @@ -2969,7 +1464,7 @@ void LLWindowMacOSX::updateCursor() if(result != noErr) { - InitCursor(); + setArrowCursor(); } mCurrentCursor = mNextCursor; @@ -3039,7 +1534,7 @@ void LLWindowMacOSX::hideCursor() // llinfos << "hideCursor: hiding" << llendl; mCursorHidden = TRUE; mHideCursorPermanent = TRUE; - ::HideCursor(); + hideNSCursor(); } else { @@ -3056,7 +1551,7 @@ void LLWindowMacOSX::showCursor() // llinfos << "showCursor: showing" << llendl; mCursorHidden = FALSE; mHideCursorPermanent = FALSE; - ::ShowCursor(); + showNSCursor(); } else { @@ -3100,24 +1595,6 @@ LLSplashScreenMacOSX::~LLSplashScreenMacOSX() void LLSplashScreenMacOSX::showImpl() { // This code _could_ be used to display a spash screen... -#if 0 - IBNibRef nib = NULL; - OSStatus err; - - err = CreateNibReference(CFSTR("SecondLife"), &nib); - - if(err == noErr) - { - CreateWindowFromNib(nib, CFSTR("Splash Screen"), &mWindow); - - DisposeNibReference(nib); - } - - if(mWindow != NULL) - { - ShowWindow(mWindow); - } -#endif } void LLSplashScreenMacOSX::updateImpl(const std::string& mesg) @@ -3127,25 +1604,6 @@ void LLSplashScreenMacOSX::updateImpl(const std::string& mesg) CFStringRef string = NULL; string = CFStringCreateWithCString(NULL, mesg.c_str(), kCFStringEncodingUTF8); - - if(string != NULL) - { - ControlRef progressText = NULL; - ControlID id; - OSStatus err; - - id.signature = 'what'; - id.id = 0; - - err = GetControlByID(mWindow, &id, &progressText); - if(err == noErr) - { - err = SetControlData(progressText, kControlEntireControl, kControlStaticTextCFStringTag, sizeof(CFStringRef), (Ptr)&string); - Draw1Control(progressText); - } - - CFRelease(string); - } } } @@ -3154,111 +1612,21 @@ void LLSplashScreenMacOSX::hideImpl() { if(mWindow != NULL) { - DisposeWindow(mWindow); mWindow = NULL; } } - - S32 OSMessageBoxMacOSX(const std::string& text, const std::string& caption, U32 type) { - S32 result = OSBTN_CANCEL; - SInt16 retval_mac = 1; - AlertStdCFStringAlertParamRec params; - CFStringRef errorString = NULL; - CFStringRef explanationString = NULL; - DialogRef alert = NULL; - AlertType alertType = kAlertCautionAlert; - OSStatus err; - - explanationString = CFStringCreateWithCString(NULL, text.c_str(), kCFStringEncodingUTF8); - errorString = CFStringCreateWithCString(NULL, caption.c_str(), kCFStringEncodingUTF8); - - params.version = kStdCFStringAlertVersionOne; - params.movable = false; - params.helpButton = false; - params.defaultText = (CFStringRef)kAlertDefaultOKText; - params.cancelText = 0; - params.otherText = 0; - params.defaultButton = 1; - params.cancelButton = 0; - params.position = kWindowDefaultPosition; - params.flags = 0; - - switch(type) - { - case OSMB_OK: - default: - break; - case OSMB_OKCANCEL: - params.cancelText = (CFStringRef)kAlertDefaultCancelText; - params.cancelButton = 2; - break; - case OSMB_YESNO: - alertType = kAlertNoteAlert; - params.defaultText = CFSTR("Yes"); - params.cancelText = CFSTR("No"); - params.cancelButton = 2; - break; - } - - if(gWindowImplementation != NULL) - gWindowImplementation->beforeDialog(); - - err = CreateStandardAlert( - alertType, - errorString, - explanationString, - ¶ms, - &alert); - - if(err == noErr) - { - err = RunStandardAlert( - alert, - NULL, - &retval_mac); - } - - if(gWindowImplementation != NULL) - gWindowImplementation->afterDialog(); - - switch(type) - { - case OSMB_OK: - case OSMB_OKCANCEL: - default: - if(retval_mac == 1) - result = OSBTN_OK; - else - result = OSBTN_CANCEL; - break; - case OSMB_YESNO: - if(retval_mac == 1) - result = OSBTN_YES; - else - result = OSBTN_NO; - break; - } - - if(errorString != NULL) - { - CFRelease(errorString); - } - - if(explanationString != NULL) - { - CFRelease(explanationString); - } - - return result; + return showAlert(text, caption, type); } // Open a URL with the user's default web browser. // Must begin with protocol identifier. void LLWindowMacOSX::spawnWebBrowser(const std::string& escaped_url, bool async) { + // I'm fairly certain that this is all legitimate under Apple's currently supported APIs. + bool found = false; S32 i; for (i = 0; i < gURLProtocolWhitelistCount; i++) @@ -3276,7 +1644,7 @@ void LLWindowMacOSX::spawnWebBrowser(const std::string& escaped_url, bool async) return; } - OSStatus result = noErr; + S32 result = 0; CFURLRef urlRef = NULL; llinfos << "Opening URL " << escaped_url << llendl; @@ -3313,7 +1681,7 @@ void LLWindowMacOSX::spawnWebBrowser(const std::string& escaped_url, bool async) LLSD LLWindowMacOSX::getNativeKeyData() { LLSD result = LLSD::emptyMap(); - +#if 0 if(mRawKeyEvent) { char char_code = 0; @@ -3335,7 +1703,7 @@ LLSD LLWindowMacOSX::getNativeKeyData() // This causes trouble for control characters -- apparently character codes less than 32 (escape, control-A, etc) // cause llsd serialization to create XML that the llsd deserializer won't parse! std::string unicode; - OSStatus err = noErr; + S32 err = noErr; EventParamType actualType = typeUTF8Text; UInt32 actualSize = 0; char *buffer = NULL; @@ -3357,7 +1725,7 @@ LLSD LLWindowMacOSX::getNativeKeyData() #endif } - +#endif lldebugs << "native key data is: " << result << llendl; @@ -3367,34 +1735,9 @@ LLSD LLWindowMacOSX::getNativeKeyData() BOOL LLWindowMacOSX::dialogColorPicker( F32 *r, F32 *g, F32 *b) { + // Is this even used anywhere? Do we really need an OS color picker? BOOL retval = FALSE; - OSErr error = noErr; - NColorPickerInfo info; - - memset(&info, 0, sizeof(info)); - info.theColor.color.rgb.red = (UInt16)(*r * 65535.f); - info.theColor.color.rgb.green = (UInt16)(*g * 65535.f); - info.theColor.color.rgb.blue = (UInt16)(*b * 65535.f); - info.placeWhere = kCenterOnMainScreen; - - if(gWindowImplementation != NULL) - gWindowImplementation->beforeDialog(); - - error = NPickColor(&info); - - if(gWindowImplementation != NULL) - gWindowImplementation->afterDialog(); - - if (error == noErr) - { - retval = info.newColorChosen; - if (info.newColorChosen) - { - *r = ((float) info.theColor.color.rgb.red) / 65535.0; - *g = ((float) info.theColor.color.rgb.green) / 65535.0; - *b = ((float) info.theColor.color.rgb.blue) / 65535.0; - } - } + //S32 error = 0; return (retval); } @@ -3405,44 +1748,8 @@ void *LLWindowMacOSX::getPlatformWindow() return (void*)mWindow; } -void *LLWindowMacOSX::getMediaWindow() -{ - /* - Mozilla needs to be initialized with a WindowRef to function properly. - (There's no good reason for this, since it shouldn't be interacting with our window in any way, but that's another issue.) - If we're in windowed mode, we _could_ hand it our actual window pointer, but a subsequent switch to fullscreen will destroy that window, - which trips up Mozilla. - Instead of using our actual window, we create an invisible window which will persist for the lifetime of the application and pass that to Mozilla. - This satisfies its deep-seated need to latch onto a WindowRef and solves the issue with switching between fullscreen and windowed modes. - - Note that we will never destroy this window (by design!), but since only one will ever be created per run of the application, that's okay. - */ - - if(sMediaWindow == NULL) - { - Rect window_rect = {100, 100, 200, 200}; - - sMediaWindow = NewCWindow( - NULL, - &window_rect, - (ConstStr255Param) "\p", - false, // Create the window invisible. - zoomDocProc, // Window with a grow box and a zoom box - kLastWindowOfClass, // create it behind other windows - false, // no close box - 0); - } - - return (void*)sMediaWindow; -} - -void LLWindowMacOSX::stopDockTileBounce() -{ - NMRemove(&mBounceRec); - mBounceTimer.stop(); -} - // get a double value from a dictionary +/* static double getDictDouble (CFDictionaryRef refDict, CFStringRef key) { double double_value; @@ -3452,7 +1759,7 @@ static double getDictDouble (CFDictionaryRef refDict, CFStringRef key) if (!CFNumberGetValue(number_value, kCFNumberDoubleType, &double_value)) // or if cant convert it return -1; // fail return double_value; // otherwise return the long value -} +}*/ // get a long value from a dictionary static long getDictLong (CFDictionaryRef refDict, CFStringRef key) @@ -3468,8 +1775,8 @@ static long getDictLong (CFDictionaryRef refDict, CFStringRef key) void LLWindowMacOSX::allowLanguageTextInput(LLPreeditor *preeditor, BOOL b) { - ScriptLanguageRecord script_language; - + allowDirectMarkedTextInput(b, mGLView); + if (preeditor != mPreeditor && !b) { // This condition may occur by a call to @@ -3480,9 +1787,7 @@ void LLWindowMacOSX::allowLanguageTextInput(LLPreeditor *preeditor, BOOL b) // is not disturbed. return; } - - UseInputWindow(mTSMDocument, !b); - + // Take care of old and new preeditors. if (preeditor != mPreeditor || !b) { @@ -3495,44 +1800,17 @@ void LLWindowMacOSX::allowLanguageTextInput(LLPreeditor *preeditor, BOOL b) } mPreeditor = (b ? preeditor : NULL); } - + if (b == mLanguageTextInputAllowed) { return; } mLanguageTextInputAllowed = b; - - if (b) - { - if (mTSMScriptCode != smRoman) - { - script_language.fScript = mTSMScriptCode; - script_language.fLanguage = mTSMLangCode; - SetTextServiceLanguage(&script_language); - } - } - else - { - GetTextServiceLanguage(&script_language); - mTSMScriptCode = script_language.fScript; - mTSMLangCode = script_language.fLanguage; - if (mTSMScriptCode != smRoman) - { - script_language.fScript = smRoman; - script_language.fLanguage = langEnglish; - SetTextServiceLanguage(&script_language); - } - } } void LLWindowMacOSX::interruptLanguageTextInput() { - if (mTSMDocument) - { - FixTSMDocument(mTSMDocument); - } - // Don't we need to call resetPreedit here? - // Well, if Apple's TSM document is correct, we don't. + commitCurrentPreedit(mGLView); } //static @@ -3543,21 +1821,21 @@ std::vector<std::string> LLWindowMacOSX::getDynamicFallbackFontList() } // static -MASK LLWindowMacOSX::modifiersToMask(SInt16 modifiers) +MASK LLWindowMacOSX::modifiersToMask(S16 modifiers) { MASK mask = 0; - if(modifiers & shiftKey) { mask |= MASK_SHIFT; } - if(modifiers & (cmdKey | controlKey)) { mask |= MASK_CONTROL; } - if(modifiers & optionKey) { mask |= MASK_ALT; } + if(modifiers & MAC_SHIFT_KEY) { mask |= MASK_SHIFT; } + if(modifiers & (MAC_CMD_KEY | MAC_CTRL_KEY)) { mask |= MASK_CONTROL; } + if(modifiers & MAC_ALT_KEY) { mask |= MASK_ALT; } return mask; } #if LL_OS_DRAGDROP_ENABLED - -OSErr LLWindowMacOSX::dragTrackingHandler(DragTrackingMessage message, WindowRef theWindow, +/* +S16 LLWindowMacOSX::dragTrackingHandler(DragTrackingMessage message, WindowRef theWindow, void * handlerRefCon, DragRef drag) { - OSErr result = noErr; + S16 result = 0; LLWindowMacOSX *self = (LLWindowMacOSX*)handlerRefCon; lldebugs << "drag tracking handler, message = " << message << llendl; @@ -3582,7 +1860,6 @@ OSErr LLWindowMacOSX::dragTrackingHandler(DragTrackingMessage message, WindowRef return result; } - OSErr LLWindowMacOSX::dragReceiveHandler(WindowRef theWindow, void * handlerRefCon, DragRef drag) { @@ -3590,126 +1867,69 @@ OSErr LLWindowMacOSX::dragReceiveHandler(WindowRef theWindow, void * handlerRefC return self->handleDragNDrop(drag, LLWindowCallbacks::DNDA_DROPPED); } - -OSErr LLWindowMacOSX::handleDragNDrop(DragRef drag, LLWindowCallbacks::DragNDropAction action) +*/ +void LLWindowMacOSX::handleDragNDrop(std::string url, LLWindowCallbacks::DragNDropAction action) { - OSErr result = dragNotAcceptedErr; // overall function result - OSErr err = noErr; // for local error handling - - // Get the mouse position and modifiers of this drag. - SInt16 modifiers, mouseDownModifiers, mouseUpModifiers; - ::GetDragModifiers(drag, &modifiers, &mouseDownModifiers, &mouseUpModifiers); - MASK mask = LLWindowMacOSX::modifiersToMask(modifiers); + MASK mask = LLWindowMacOSX::modifiersToMask(getModifiers()); - Point mouse_point; - // This will return the mouse point in global screen coords - ::GetDragMouse(drag, &mouse_point, NULL); - LLCoordScreen screen_coords(mouse_point.h, mouse_point.v); + float mouse_point[2]; + // This will return the mouse point in window coords + getCursorPos(mWindow, mouse_point); + LLCoordWindow window_coords(mouse_point[0], mouse_point[1]); LLCoordGL gl_pos; - convertCoords(screen_coords, &gl_pos); - - // Look at the pasteboard and try to extract an URL from it - PasteboardRef pasteboard; - if(GetDragPasteboard(drag, &pasteboard) == noErr) + convertCoords(window_coords, &gl_pos); + + if(!url.empty()) { - ItemCount num_items = 0; - // Treat an error here as an item count of 0 - (void)PasteboardGetItemCount(pasteboard, &num_items); - - // Only deal with single-item drags. - if(num_items == 1) - { - PasteboardItemID item_id = NULL; - CFArrayRef flavors = NULL; - CFDataRef data = NULL; - - err = PasteboardGetItemIdentifier(pasteboard, 1, &item_id); // Yes, this really is 1-based. - - // Try to extract an URL from the pasteboard - if(err == noErr) - { - err = PasteboardCopyItemFlavors( pasteboard, item_id, &flavors); - } - - if(err == noErr) - { - if(CFArrayContainsValue(flavors, CFRangeMake(0, CFArrayGetCount(flavors)), kUTTypeURL)) - { - // This is an URL. - err = PasteboardCopyItemFlavorData(pasteboard, item_id, kUTTypeURL, &data); - } - else if(CFArrayContainsValue(flavors, CFRangeMake(0, CFArrayGetCount(flavors)), kUTTypeUTF8PlainText)) + LLWindowCallbacks::DragNDropResult res = + mCallbacks->handleDragNDrop(this, gl_pos, mask, action, url); + + switch (res) { + case LLWindowCallbacks::DND_NONE: // No drop allowed + if (action == LLWindowCallbacks::DNDA_TRACK) { - // This is a string that might be an URL. - err = PasteboardCopyItemFlavorData(pasteboard, item_id, kUTTypeUTF8PlainText, &data); + mDragOverrideCursor = 0; } - - } - - if(flavors != NULL) - { - CFRelease(flavors); - } - - if(data != NULL) - { - std::string url; - url.assign((char*)CFDataGetBytePtr(data), CFDataGetLength(data)); - CFRelease(data); - - if(!url.empty()) - { - LLWindowCallbacks::DragNDropResult res = - mCallbacks->handleDragNDrop(this, gl_pos, mask, action, url); - - switch (res) { - case LLWindowCallbacks::DND_NONE: // No drop allowed - if (action == LLWindowCallbacks::DNDA_TRACK) - { - mDragOverrideCursor = kThemeNotAllowedCursor; - } - else { - mDragOverrideCursor = -1; - } - break; - case LLWindowCallbacks::DND_MOVE: // Drop accepted would result in a "move" operation - mDragOverrideCursor = kThemePointingHandCursor; - result = noErr; - break; - case LLWindowCallbacks::DND_COPY: // Drop accepted would result in a "copy" operation - mDragOverrideCursor = kThemeCopyArrowCursor; - result = noErr; - break; - case LLWindowCallbacks::DND_LINK: // Drop accepted would result in a "link" operation: - mDragOverrideCursor = kThemeAliasArrowCursor; - result = noErr; - break; - default: - mDragOverrideCursor = -1; - break; - } - // This overrides the cursor being set by setCursor. - // This is a bit of a hack workaround because lots of areas - // within the viewer just blindly set the cursor. - if (mDragOverrideCursor == -1) - { - // Restore the cursor - ECursorType temp_cursor = mCurrentCursor; - // get around the "setting the same cursor" code in setCursor() - mCurrentCursor = UI_CURSOR_COUNT; - setCursor(temp_cursor); - } - else { - // Override the cursor - SetThemeCursor(mDragOverrideCursor); - } - + else { + mDragOverrideCursor = -1; } - } + break; + case LLWindowCallbacks::DND_MOVE: // Drop accepted would result in a "move" operation + mDragOverrideCursor = UI_CURSOR_NO; + break; + case LLWindowCallbacks::DND_COPY: // Drop accepted would result in a "copy" operation + mDragOverrideCursor = UI_CURSOR_ARROWCOPY; + break; + default: + mDragOverrideCursor = -1; + break; + } + // This overrides the cursor being set by setCursor. + // This is a bit of a hack workaround because lots of areas + // within the viewer just blindly set the cursor. + if (mDragOverrideCursor == -1) + { + // Restore the cursor + ECursorType temp_cursor = mCurrentCursor; + // get around the "setting the same cursor" code in setCursor() + mCurrentCursor = UI_CURSOR_COUNT; + setCursor(temp_cursor); + } + else { + // Override the cursor + switch (mDragOverrideCursor) { + case 0: + setArrowCursor(); + break; + case UI_CURSOR_NO: + setNotAllowedCursor(); + case UI_CURSOR_ARROWCOPY: + setCopyCursor(); + default: + break; + }; } } - - return result; } #endif // LL_OS_DRAGDROP_ENABLED diff --git a/indra/llwindow/llwindowmacosx.h b/indra/llwindow/llwindowmacosx.h index af83b50097..6a6b39e674 100755 --- a/indra/llwindow/llwindowmacosx.h +++ b/indra/llwindow/llwindowmacosx.h @@ -29,11 +29,12 @@ #include "llwindow.h" #include "llwindowcallbacks.h" +#include "llwindowmacosx-objc.h" #include "lltimer.h" -#include <Carbon/Carbon.h> -#include <AGL/agl.h> +#include <ApplicationServices/ApplicationServices.h> +#include <OpenGL/OpenGL.h> // AssertMacros.h does bad things. #include "fix_macros.h" @@ -106,7 +107,6 @@ public: /*virtual*/ BOOL dialogColorPicker(F32 *r, F32 *g, F32 *b); /*virtual*/ void *getPlatformWindow(); - /*virtual*/ void *getMediaWindow(); /*virtual*/ void bringToFront() {}; /*virtual*/ void allowLanguageTextInput(LLPreeditor *preeditor, BOOL b); @@ -117,7 +117,17 @@ public: // Provide native key event data /*virtual*/ LLSD getNativeKeyData(); - + + void* getWindow() { return mWindow; } + LLWindowCallbacks* getCallbacks() { return mCallbacks; } + LLPreeditor* getPreeditor() { return mPreeditor; } + + void updateMouseDeltas(float* deltas); + void getMouseDeltas(float* delta); + + void handleDragNDrop(std::string url, LLWindowCallbacks::DragNDropAction action); + + bool allowsLanguageInput() { return mLanguageTextInputAllowed; } protected: LLWindowMacOSX(LLWindowCallbacks* callbacks, @@ -153,40 +163,33 @@ protected: BOOL createContext(int x, int y, int width, int height, int bits, BOOL fullscreen, BOOL disable_vsync); void destroyContext(); void setupFailure(const std::string& text, const std::string& caption, U32 type); - static pascal OSStatus staticEventHandler (EventHandlerCallRef myHandler, EventRef event, void* userData); - static pascal Boolean staticMoveEventComparator( EventRef event, void* data); - OSStatus eventHandler (EventHandlerCallRef myHandler, EventRef event); void adjustCursorDecouple(bool warpingMouse = false); - void stopDockTileBounce(); - static MASK modifiersToMask(SInt16 modifiers); + static MASK modifiersToMask(S16 modifiers); #if LL_OS_DRAGDROP_ENABLED - static OSErr dragTrackingHandler(DragTrackingMessage message, WindowRef theWindow, - void * handlerRefCon, DragRef theDrag); - static OSErr dragReceiveHandler(WindowRef theWindow, void * handlerRefCon, DragRef theDrag); - OSErr handleDragNDrop(DragRef theDrag, LLWindowCallbacks::DragNDropAction action); + + //static OSErr dragTrackingHandler(DragTrackingMessage message, WindowRef theWindow, void * handlerRefCon, DragRef theDrag); + //static OSErr dragReceiveHandler(WindowRef theWindow, void * handlerRefCon, DragRef theDrag); + + #endif // LL_OS_DRAGDROP_ENABLED // // Platform specific variables // - WindowRef mWindow; - AGLContext mContext; - AGLPixelFormat mPixelFormat; + + // Use generic pointers here. This lets us do some funky Obj-C interop using Obj-C objects without having to worry about any compilation problems that may arise. + NSWindowRef mWindow; + GLViewRef mGLView; + CGLContextObj mContext; + CGLPixelFormatObj mPixelFormat; CGDirectDisplayID mDisplay; - CFDictionaryRef mOldDisplayMode; - EventLoopTimerRef mTimer; - EventHandlerUPP mEventHandlerUPP; - EventHandlerRef mGlobalHandlerRef; - EventHandlerRef mWindowHandlerRef; - EventComparatorUPP mMoveEventCampartorUPP; - Rect mOldMouseClip; // Screen rect to which the mouse cursor was globally constrained before we changed it in clipMouse() - Rect mPreviousWindowRect; // Save previous window for un-maximize event - Str255 mWindowTitle; + LLRect mOldMouseClip; // Screen rect to which the mouse cursor was globally constrained before we changed it in clipMouse() + std::string mWindowTitle; double mOriginalAspectRatio; BOOL mSimulatedRightClick; - UInt32 mLastModifiers; + U32 mLastModifiers; BOOL mHandsOffEvents; // When true, temporarially disable CarbonEvent processing. // Used to allow event processing when putting up dialogs in fullscreen mode. BOOL mCursorDecoupled; @@ -201,25 +204,16 @@ protected: U32 mFSAASamples; BOOL mForceRebuild; - S32 mDragOverrideCursor; - - F32 mBounceTime; - NMRec mBounceRec; - LLTimer mBounceTimer; + S32 mDragOverrideCursor; // Input method management through Text Service Manager. - TSMDocumentID mTSMDocument; BOOL mLanguageTextInputAllowed; - ScriptCode mTSMScriptCode; - LangCode mTSMLangCode; LLPreeditor* mPreeditor; static BOOL sUseMultGL; friend class LLWindowManager; - static WindowRef sMediaWindow; - EventRef mRawKeyEvent; - + }; diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 43c0090993..30f5526500 100755 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -159,9 +159,8 @@ LLWinImm LLWinImm::sTheInstance; LLWinImm::LLWinImm() : mHImmDll(NULL) { // Check system metrics - if ( !GetSystemMetrics( SM_DBCSENABLED ) ) + if ( !GetSystemMetrics( SM_IMMENABLED ) ) return; - mHImmDll = LoadLibraryA("Imm32"); if (mHImmDll != NULL) @@ -3500,19 +3499,11 @@ void LLWindowWin32::updateLanguageTextInputArea() void LLWindowWin32::interruptLanguageTextInput() { - if (mPreeditor) + if (mPreeditor && LLWinImm::isAvailable()) { - if (LLWinImm::isAvailable()) - { - HIMC himc = LLWinImm::getContext(mWindowHandle); - LLWinImm::notifyIME(himc, NI_COMPOSITIONSTR, CPS_COMPLETE, 0); - LLWinImm::releaseContext(mWindowHandle, himc); - } - - // Win32 document says there will be no composition string - // after NI_COMPOSITIONSTR returns. The following call to - // resetPreedit should be a NOP unless IME goes mad... - mPreeditor->resetPreedit(); + HIMC himc = LLWinImm::getContext(mWindowHandle); + LLWinImm::notifyIME(himc, NI_COMPOSITIONSTR, CPS_COMPLETE, 0); + LLWinImm::releaseContext(mWindowHandle, himc); } } diff --git a/indra/llxml/llcontrol.cpp b/indra/llxml/llcontrol.cpp index 666c03e9ff..16f2290787 100755 --- a/indra/llxml/llcontrol.cpp +++ b/indra/llxml/llcontrol.cpp @@ -132,14 +132,14 @@ bool LLControlVariable::llsd_compare(const LLSD& a, const LLSD & b) LLControlVariable::LLControlVariable(const std::string& name, eControlType type, LLSD initial, const std::string& comment, - bool persist, bool hidefromsettingseditor) + ePersist persist, bool hidefromsettingseditor) : mName(name), mComment(comment), mType(type), mPersist(persist), mHideFromSettingsEditor(hidefromsettingseditor) { - if (mPersist && mComment.empty()) + if ((persist != PERSIST_NO) && mComment.empty()) { llerrs << "Must supply a comment for control " << mName << llendl; } @@ -260,7 +260,7 @@ void LLControlVariable::setDefaultValue(const LLSD& value) } } -void LLControlVariable::setPersist(bool state) +void LLControlVariable::setPersist(ePersist state) { mPersist = state; } @@ -292,10 +292,29 @@ void LLControlVariable::resetToDefault(bool fire_signal) } } -bool LLControlVariable::isSaveValueDefault() -{ - return (mValues.size() == 1) - || ((mValues.size() > 1) && llsd_compare(mValues[1], mValues[0])); +bool LLControlVariable::shouldSave(bool nondefault_only) +{ + // This method is used to decide whether we should save a given + // variable. Two of the three values of mPersist are easy. + if (mPersist == PERSIST_NO) + return false; + + if (mPersist == PERSIST_ALWAYS) + return true; + + // PERSIST_NONDFT + // If caller doesn't need us to filter, just save. + if (! nondefault_only) + return true; + + // PERSIST_NONDFT: caller only wants us to save this variable if its value + // differs from default. + if (isDefault()) // never been altered + return false; + + // We've set at least one other value: compare it to default. Save only if + // they differ. + return ! llsd_compare(getSaveValue(), getDefault()); } LLSD LLControlVariable::getSaveValue() const @@ -355,12 +374,12 @@ std::string LLControlGroup::typeEnumToString(eControlType typeenum) return mTypeString[typeenum]; } -BOOL LLControlGroup::declareControl(const std::string& name, eControlType type, const LLSD initial_val, const std::string& comment, BOOL persist, BOOL hidefromsettingseditor) +LLControlVariable* LLControlGroup::declareControl(const std::string& name, eControlType type, const LLSD initial_val, const std::string& comment, LLControlVariable::ePersist persist, BOOL hidefromsettingseditor) { LLControlVariable* existing_control = getControl(name); if (existing_control) { - if (persist && existing_control->isType(type)) + if ((persist != LLControlVariable::PERSIST_NO) && existing_control->isType(type)) { if (!existing_control->llsd_compare(existing_control->getDefault(), initial_val)) { @@ -374,66 +393,66 @@ BOOL LLControlGroup::declareControl(const std::string& name, eControlType type, { llwarns << "Control named " << name << " already exists, ignoring new declaration." << llendl; } - return TRUE; + return existing_control; } // if not, create the control and add it to the name table LLControlVariable* control = new LLControlVariable(name, type, initial_val, comment, persist, hidefromsettingseditor); mNameTable[name] = control; - return TRUE; + return control; } -BOOL LLControlGroup::declareU32(const std::string& name, const U32 initial_val, const std::string& comment, BOOL persist) +LLControlVariable* LLControlGroup::declareU32(const std::string& name, const U32 initial_val, const std::string& comment, LLControlVariable::ePersist persist) { return declareControl(name, TYPE_U32, (LLSD::Integer) initial_val, comment, persist); } -BOOL LLControlGroup::declareS32(const std::string& name, const S32 initial_val, const std::string& comment, BOOL persist) +LLControlVariable* LLControlGroup::declareS32(const std::string& name, const S32 initial_val, const std::string& comment, LLControlVariable::ePersist persist) { return declareControl(name, TYPE_S32, initial_val, comment, persist); } -BOOL LLControlGroup::declareF32(const std::string& name, const F32 initial_val, const std::string& comment, BOOL persist) +LLControlVariable* LLControlGroup::declareF32(const std::string& name, const F32 initial_val, const std::string& comment, LLControlVariable::ePersist persist) { return declareControl(name, TYPE_F32, initial_val, comment, persist); } -BOOL LLControlGroup::declareBOOL(const std::string& name, const BOOL initial_val, const std::string& comment, BOOL persist) +LLControlVariable* LLControlGroup::declareBOOL(const std::string& name, const BOOL initial_val, const std::string& comment, LLControlVariable::ePersist persist) { return declareControl(name, TYPE_BOOLEAN, initial_val, comment, persist); } -BOOL LLControlGroup::declareString(const std::string& name, const std::string& initial_val, const std::string& comment, BOOL persist) +LLControlVariable* LLControlGroup::declareString(const std::string& name, const std::string& initial_val, const std::string& comment, LLControlVariable::ePersist persist) { return declareControl(name, TYPE_STRING, initial_val, comment, persist); } -BOOL LLControlGroup::declareVec3(const std::string& name, const LLVector3 &initial_val, const std::string& comment, BOOL persist) +LLControlVariable* LLControlGroup::declareVec3(const std::string& name, const LLVector3 &initial_val, const std::string& comment, LLControlVariable::ePersist persist) { return declareControl(name, TYPE_VEC3, initial_val.getValue(), comment, persist); } -BOOL LLControlGroup::declareVec3d(const std::string& name, const LLVector3d &initial_val, const std::string& comment, BOOL persist) +LLControlVariable* LLControlGroup::declareVec3d(const std::string& name, const LLVector3d &initial_val, const std::string& comment, LLControlVariable::ePersist persist) { return declareControl(name, TYPE_VEC3D, initial_val.getValue(), comment, persist); } -BOOL LLControlGroup::declareRect(const std::string& name, const LLRect &initial_val, const std::string& comment, BOOL persist) +LLControlVariable* LLControlGroup::declareRect(const std::string& name, const LLRect &initial_val, const std::string& comment, LLControlVariable::ePersist persist) { return declareControl(name, TYPE_RECT, initial_val.getValue(), comment, persist); } -BOOL LLControlGroup::declareColor4(const std::string& name, const LLColor4 &initial_val, const std::string& comment, BOOL persist ) +LLControlVariable* LLControlGroup::declareColor4(const std::string& name, const LLColor4 &initial_val, const std::string& comment, LLControlVariable::ePersist persist ) { return declareControl(name, TYPE_COL4, initial_val.getValue(), comment, persist); } -BOOL LLControlGroup::declareColor3(const std::string& name, const LLColor3 &initial_val, const std::string& comment, BOOL persist ) +LLControlVariable* LLControlGroup::declareColor3(const std::string& name, const LLColor3 &initial_val, const std::string& comment, LLControlVariable::ePersist persist ) { return declareControl(name, TYPE_COL3, initial_val.getValue(), comment, persist); } -BOOL LLControlGroup::declareLLSD(const std::string& name, const LLSD &initial_val, const std::string& comment, BOOL persist ) +LLControlVariable* LLControlGroup::declareLLSD(const std::string& name, const LLSD &initial_val, const std::string& comment, LLControlVariable::ePersist persist ) { return declareControl(name, TYPE_LLSD, initial_val, comment, persist); } @@ -664,11 +683,11 @@ U32 LLControlGroup::loadFromFileLegacy(const std::string& filename, BOOL require switch(declare_as) { case TYPE_COL4: - declareColor4(name, LLColor4::white, LLStringUtil::null, NO_PERSIST); + declareColor4(name, LLColor4::white, LLStringUtil::null, LLControlVariable::PERSIST_NO); break; case TYPE_STRING: default: - declareString(name, LLStringUtil::null, LLStringUtil::null, NO_PERSIST); + declareString(name, LLStringUtil::null, LLStringUtil::null, LLControlVariable::PERSIST_NO); break; } } @@ -805,21 +824,12 @@ U32 LLControlGroup::saveToFile(const std::string& filename, BOOL nondefault_only { llwarns << "Tried to save invalid control: " << iter->first << llendl; } - - if( control && control->isPersisted() ) + else if( control->shouldSave(nondefault_only) ) { - if (!(nondefault_only && (control->isSaveValueDefault()))) - { - settings[iter->first]["Type"] = typeEnumToString(control->type()); - settings[iter->first]["Comment"] = control->getComment(); - settings[iter->first]["Value"] = control->getSaveValue(); - ++num_saved; - } - else - { - // Debug spam - // llinfos << "Skipping " << control->getName() << llendl; - } + settings[iter->first]["Type"] = typeEnumToString(control->type()); + settings[iter->first]["Comment"] = control->getComment(); + settings[iter->first]["Value"] = control->getSaveValue(); + ++num_saved; } } llofstream file; @@ -862,13 +872,14 @@ U32 LLControlGroup::loadFromFile(const std::string& filename, bool set_default_v for(LLSD::map_const_iterator itr = settings.beginMap(); itr != settings.endMap(); ++itr) { - bool persist = true; + LLControlVariable::ePersist persist = LLControlVariable::PERSIST_NONDFT; std::string const & name = itr->first; LLSD const & control_map = itr->second; if(control_map.has("Persist")) { - persist = control_map["Persist"].asInteger(); + persist = control_map["Persist"].asInteger()? + LLControlVariable::PERSIST_NONDFT : LLControlVariable::PERSIST_NO; } // Sometimes we want to use the settings system to provide cheap persistence, but we @@ -887,6 +898,8 @@ U32 LLControlGroup::loadFromFile(const std::string& filename, bool set_default_v LLControlVariable* existing_control = getControl(name); if(existing_control) { + // set_default_values is true when we're loading the initial, + // immutable files from app_settings, e.g. settings.xml. if(set_default_values) { // Override all previously set properties of this control. @@ -908,6 +921,9 @@ U32 LLControlGroup::loadFromFile(const std::string& filename, bool set_default_v } else if(existing_control->isPersisted()) { + // save_values is specifically false for (e.g.) + // SessionSettingsFile and UserSessionSettingsFile -- in other + // words, for a file that's supposed to be transient. existing_control->setValue(control_map["Value"], save_values); } // *NOTE: If not persisted and not setting defaults, @@ -915,6 +931,39 @@ U32 LLControlGroup::loadFromFile(const std::string& filename, bool set_default_v } else { + // We've never seen this control before. Either we're loading up + // the initial set of default settings files (set_default_values) + // -- or we're loading user settings last saved by a viewer that + // supports a superset of the variables we know. + // CHOP-962: if we're loading an unrecognized user setting, make + // sure we save it later. If you try an experimental viewer, tweak + // a new setting, briefly revert to an old viewer, then return to + // the new one, we don't want the old viewer to discard the + // setting you changed. + if (! set_default_values) + { + // Using PERSIST_ALWAYS insists that saveToFile() (which calls + // LLControlVariable::shouldSave()) must save this control + // variable regardless of its value. We can safely set this + // LLControlVariable persistent because the 'persistent' flag + // is not itself persisted! + persist = LLControlVariable::PERSIST_ALWAYS; + // We want to mention unrecognized user settings variables + // (e.g. from a newer version of the viewer) in the log. But + // we also arrive here for Boolean variables generated by + // the notifications subsystem when the user checks "Don't + // show me this again." These aren't declared in settings.xml; + // they're actually named for the notification they suppress. + // We don't want to mention those. Apologies, this is a bit of + // a hack: we happen to know that user settings go into an + // LLControlGroup whose name is "Global". + if (getKey() == "Global") + { + LL_INFOS("LLControlGroup") << "preserving unrecognized " << getKey() + << " settings variable " << name << LL_ENDL; + } + } + declareControl(name, typeStringToEnum(control_map["Type"].asString()), control_map["Value"], @@ -923,7 +972,7 @@ U32 LLControlGroup::loadFromFile(const std::string& filename, bool set_default_v hidefromsettingseditor ); } - + ++validitems; } diff --git a/indra/llxml/llcontrol.h b/indra/llxml/llcontrol.h index ee7d1d50b7..e1f9be80dd 100755 --- a/indra/llxml/llcontrol.h +++ b/indra/llxml/llcontrol.h @@ -72,8 +72,6 @@ class LLVector3d; class LLColor4; class LLColor3; -const BOOL NO_PERSIST = FALSE; - typedef enum e_control_type { TYPE_U32 = 0, @@ -100,21 +98,28 @@ public: typedef boost::signals2::signal<bool(LLControlVariable* control, const LLSD&), boost_boolean_combiner> validate_signal_t; typedef boost::signals2::signal<void(LLControlVariable* control, const LLSD&, const LLSD&)> commit_signal_t; + enum ePersist + { + PERSIST_NO, // don't save this var + PERSIST_NONDFT, // save this var if differs from default + PERSIST_ALWAYS // save this var even if has default value + }; + private: std::string mName; std::string mComment; eControlType mType; - bool mPersist; + ePersist mPersist; bool mHideFromSettingsEditor; std::vector<LLSD> mValues; - + commit_signal_t mCommitSignal; validate_signal_t mValidateSignal; public: LLControlVariable(const std::string& name, eControlType type, LLSD initial, const std::string& comment, - bool persist = true, bool hidefromsettingseditor = false); + ePersist persist = PERSIST_NONDFT, bool hidefromsettingseditor = false); virtual ~LLControlVariable(); @@ -131,8 +136,8 @@ public: validate_signal_t* getValidateSignal() { return &mValidateSignal; } bool isDefault() { return (mValues.size() == 1); } - bool isSaveValueDefault(); - bool isPersisted() { return mPersist; } + bool shouldSave(bool nondefault_only); + bool isPersisted() { return mPersist != PERSIST_NO; } bool isHiddenFromSettingsEditor() { return mHideFromSettingsEditor; } LLSD get() const { return getValue(); } LLSD getValue() const { return mValues.back(); } @@ -142,7 +147,7 @@ public: void set(const LLSD& val) { setValue(val); } void setValue(const LLSD& value, bool saved_value = TRUE); void setDefaultValue(const LLSD& value); - void setPersist(bool state); + void setPersist(ePersist); void setHiddenFromSettingsEditor(bool hide); void setComment(const std::string& comment); @@ -207,19 +212,19 @@ public: virtual void apply(const std::string& name, LLControlVariable* control) = 0; }; void applyToAll(ApplyFunctor* func); - - BOOL declareControl(const std::string& name, eControlType type, const LLSD initial_val, const std::string& comment, BOOL persist, BOOL hidefromsettingseditor = FALSE); - BOOL declareU32(const std::string& name, U32 initial_val, const std::string& comment, BOOL persist = TRUE); - BOOL declareS32(const std::string& name, S32 initial_val, const std::string& comment, BOOL persist = TRUE); - BOOL declareF32(const std::string& name, F32 initial_val, const std::string& comment, BOOL persist = TRUE); - BOOL declareBOOL(const std::string& name, BOOL initial_val, const std::string& comment, BOOL persist = TRUE); - BOOL declareString(const std::string& name, const std::string &initial_val, const std::string& comment, BOOL persist = TRUE); - BOOL declareVec3(const std::string& name, const LLVector3 &initial_val,const std::string& comment, BOOL persist = TRUE); - BOOL declareVec3d(const std::string& name, const LLVector3d &initial_val, const std::string& comment, BOOL persist = TRUE); - BOOL declareRect(const std::string& name, const LLRect &initial_val, const std::string& comment, BOOL persist = TRUE); - BOOL declareColor4(const std::string& name, const LLColor4 &initial_val, const std::string& comment, BOOL persist = TRUE); - BOOL declareColor3(const std::string& name, const LLColor3 &initial_val, const std::string& comment, BOOL persist = TRUE); - BOOL declareLLSD(const std::string& name, const LLSD &initial_val, const std::string& comment, BOOL persist = TRUE); + + LLControlVariable* declareControl(const std::string& name, eControlType type, const LLSD initial_val, const std::string& comment, LLControlVariable::ePersist persist, BOOL hidefromsettingseditor = FALSE); + LLControlVariable* declareU32(const std::string& name, U32 initial_val, const std::string& comment, LLControlVariable::ePersist persist = LLControlVariable::PERSIST_NONDFT); + LLControlVariable* declareS32(const std::string& name, S32 initial_val, const std::string& comment, LLControlVariable::ePersist persist = LLControlVariable::PERSIST_NONDFT); + LLControlVariable* declareF32(const std::string& name, F32 initial_val, const std::string& comment, LLControlVariable::ePersist persist = LLControlVariable::PERSIST_NONDFT); + LLControlVariable* declareBOOL(const std::string& name, BOOL initial_val, const std::string& comment, LLControlVariable::ePersist persist = LLControlVariable::PERSIST_NONDFT); + LLControlVariable* declareString(const std::string& name, const std::string &initial_val, const std::string& comment, LLControlVariable::ePersist persist = LLControlVariable::PERSIST_NONDFT); + LLControlVariable* declareVec3(const std::string& name, const LLVector3 &initial_val,const std::string& comment, LLControlVariable::ePersist persist = LLControlVariable::PERSIST_NONDFT); + LLControlVariable* declareVec3d(const std::string& name, const LLVector3d &initial_val, const std::string& comment, LLControlVariable::ePersist persist = LLControlVariable::PERSIST_NONDFT); + LLControlVariable* declareRect(const std::string& name, const LLRect &initial_val, const std::string& comment, LLControlVariable::ePersist persist = LLControlVariable::PERSIST_NONDFT); + LLControlVariable* declareColor4(const std::string& name, const LLColor4 &initial_val, const std::string& comment, LLControlVariable::ePersist persist = LLControlVariable::PERSIST_NONDFT); + LLControlVariable* declareColor3(const std::string& name, const LLColor3 &initial_val, const std::string& comment, LLControlVariable::ePersist persist = LLControlVariable::PERSIST_NONDFT); + LLControlVariable* declareLLSD(const std::string& name, const LLSD &initial_val, const std::string& comment, LLControlVariable::ePersist persist = LLControlVariable::PERSIST_NONDFT); std::string getString(const std::string& name); std::string getText(const std::string& name); @@ -368,7 +373,7 @@ private: init_value = convert_to_llsd(default_value); if(type < TYPE_COUNT) { - group.declareControl(name, type, init_value, comment, FALSE); + group.declareControl(name, type, init_value, comment, LLControlVariable::PERSIST_NO); return true; } return false; diff --git a/indra/llxml/tests/llcontrol_test.cpp b/indra/llxml/tests/llcontrol_test.cpp index ede81956ec..c273773c9b 100755 --- a/indra/llxml/tests/llcontrol_test.cpp +++ b/indra/llxml/tests/llcontrol_test.cpp @@ -128,7 +128,11 @@ namespace tut template<> template<> void control_group_t::test<3>() { - int results = mCG->loadFromFile(mTestConfigFile.c_str()); + // Pass default_values = true. This tells loadFromFile() we're loading + // a default settings file that declares variables, rather than a user + // settings file. When loadFromFile() encounters an unrecognized user + // settings variable, it forcibly preserves it (CHOP-962). + int results = mCG->loadFromFile(mTestConfigFile.c_str(), true); LLControlVariable* control = mCG->getControl("TestSetting"); LLSD new_value = 13; control->setValue(new_value, FALSE); diff --git a/indra/lscript/lscript_compile/indra.l b/indra/lscript/lscript_compile/indra.l index 1bb38bbf65..88dfc2e9f3 100755 --- a/indra/lscript/lscript_compile/indra.l +++ b/indra/lscript/lscript_compile/indra.l @@ -79,8 +79,8 @@ void parse_string(); #define yyfree indra_free -int yylex( void ); int yyparse( void ); +int yylex( void ); int yyerror(const char *fmt, ...); %} @@ -161,6 +161,7 @@ int yyerror(const char *fmt, ...); "STATUS_DIE_AT_EDGE" { count(); yylval.ival = 0x80; return(INTEGER_CONSTANT); } "STATUS_RETURN_AT_EDGE" { count(); yylval.ival = 0x100; return(INTEGER_CONSTANT); } "STATUS_CAST_SHADOWS" { count(); yylval.ival = 0x200; return(INTEGER_CONSTANT); } +"STATUS_BLOCK_GRAB_OBJECT" { count(); yylval.ival = 0x400; return(INTEGER_CONSTANT); } "AGENT_FLYING" { count(); yylval.ival = AGENT_FLYING; return(INTEGER_CONSTANT); } "AGENT_ATTACHMENTS" { count(); yylval.ival = AGENT_ATTACHMENTS; return(INTEGER_CONSTANT); } @@ -235,6 +236,8 @@ int yyerror(const char *fmt, ...); "PERMISSION_TRACK_CAMERA" { count(); yylval.ival = LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_TRACK_CAMERA]; return(INTEGER_CONSTANT); } "PERMISSION_CONTROL_CAMERA" { count(); yylval.ival = LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_CONTROL_CAMERA]; return(INTEGER_CONSTANT); } "PERMISSION_TELEPORT" { count(); yylval.ival = LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_TELEPORT]; return(INTEGER_CONSTANT); } +"PERMISSION_SILENT_ESTATE_MANAGEMENT" { count(); yylval.ival = LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_SILENT_ESTATE_MANAGEMENT]; return(INTEGER_CONSTANT); } +"PERMISSION_OVERRIDE_ANIMATIONS" { count(); yylval.ival = LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_OVERRIDE_ANIMATIONS]; return(INTEGER_CONSTANT); } "INVENTORY_TEXTURE" { count(); yylval.ival = LLAssetType::AT_TEXTURE; return(INTEGER_CONSTANT); } "INVENTORY_SOUND" { count(); yylval.ival = LLAssetType::AT_SOUND; return(INTEGER_CONSTANT); } @@ -271,6 +274,22 @@ int yyerror(const char *fmt, ...); "OBJECT_OWNER" { count(); yylval.ival = OBJECT_OWNER; return(INTEGER_CONSTANT); } "OBJECT_GROUP" { count(); yylval.ival = OBJECT_GROUP; return(INTEGER_CONSTANT); } "OBJECT_CREATOR" { count(); yylval.ival = OBJECT_CREATOR; return(INTEGER_CONSTANT); } +"OBJECT_RUNNING_SCRIPT_COUNT" { count(); yylval.ival = OBJECT_RUNNING_SCRIPT_COUNT; return(INTEGER_CONSTANT); } +"OBJECT_TOTAL_SCRIPT_COUNT" { count(); yylval.ival = OBJECT_TOTAL_SCRIPT_COUNT; return(INTEGER_CONSTANT); } +"OBJECT_SCRIPT_MEMORY" { count(); yylval.ival = OBJECT_SCRIPT_MEMORY; return(INTEGER_CONSTANT); } +"OBJECT_SCRIPT_TIME" { count(); yylval.ival = OBJECT_SCRIPT_TIME; return(INTEGER_CONSTANT); } +"OBJECT_PRIM_EQUIVALENCE" { count(); yylval.ival = OBJECT_PRIM_EQUIVALENCE; return(INTEGER_CONSTANT); } +"OBJECT_SERVER_COST" { count(); yylval.ival = OBJECT_SERVER_COST; return(INTEGER_CONSTANT); } +"OBJECT_STREAMING_COST" { count(); yylval.ival = OBJECT_STREAMING_COST; return(INTEGER_CONSTANT); } +"OBJECT_PHYSICS_COST" { count(); yylval.ival = OBJECT_PHYSICS_COST; return(INTEGER_CONSTANT); } +"OBJECT_CHARACTER_TIME" { count(); yylval.ival = OBJECT_CHARACTER_TIME; return(INTEGER_CONSTANT); } +"OBJECT_ROOT" { count(); yylval.ival = OBJECT_ROOT; return(INTEGER_CONSTANT); } +"OBJECT_ATTACHED_POINT" { count(); yylval.ival = OBJECT_ATTACHED_POINT; return(INTEGER_CONSTANT); } +"OBJECT_PATHFINDING_TYPE" { count(); yylval.ival = OBJECT_PATHFINDING_TYPE; return(INTEGER_CONSTANT); } +"OBJECT_PHYSICS" { count(); yylval.ival = OBJECT_PHYSICS; return(INTEGER_CONSTANT); } +"OBJECT_PHANTOM" { count(); yylval.ival = OBJECT_PHANTOM; return(INTEGER_CONSTANT); } +"OBJECT_TEMP_ON_REZ" { count(); yylval.ival = OBJECT_TEMP_ON_REZ; return(INTEGER_CONSTANT); } +"OBJECT_RENDER_WEIGHT" { count(); yylval.ival = OBJECT_RENDER_WEIGHT; return(INTEGER_CONSTANT); } "TYPE_INTEGER" { count(); yylval.ival = LST_INTEGER; return(INTEGER_CONSTANT); } "TYPE_FLOAT" { count(); yylval.ival = LST_FLOATINGPOINT; return(INTEGER_CONSTANT); } @@ -336,6 +355,8 @@ int yyerror(const char *fmt, ...); "ATTACH_HUD_BOTTOM_LEFT" { count(); yylval.ival = 36; return(INTEGER_CONSTANT); } "ATTACH_HUD_BOTTOM" { count(); yylval.ival = 37; return(INTEGER_CONSTANT); } "ATTACH_HUD_BOTTOM_RIGHT" { count(); yylval.ival = 38; return(INTEGER_CONSTANT); } +"ATTACH_NECK" { count(); yylval.ival = 39; return(INTEGER_CONSTANT); } +"ATTACH_AVATAR_CENTER" { count(); yylval.ival = 40; return(INTEGER_CONSTANT); } "LAND_LEVEL" { count(); yylval.ival = E_LANDBRUSH_LEVEL; return(INTEGER_CONSTANT); } "LAND_RAISE" { count(); yylval.ival = E_LANDBRUSH_RAISE; return(INTEGER_CONSTANT); } @@ -374,6 +395,10 @@ int yyerror(const char *fmt, ...); "PSYS_PART_END_SCALE" { count(); yylval.ival = LLPS_PART_END_SCALE; return (INTEGER_CONSTANT); } "PSYS_PART_MAX_AGE" { count(); yylval.ival = LLPS_PART_MAX_AGE; return (INTEGER_CONSTANT); } +"PSYS_PART_BLEND_FUNC_SOURCE" { count(); yylval.ival = LLPS_PART_BLEND_FUNC_SOURCE; return (INTEGER_CONSTANT); } +"PSYS_PART_BLEND_FUNC_DEST" { count(); yylval.ival = LLPS_PART_BLEND_FUNC_DEST; return (INTEGER_CONSTANT); } +"PSYS_PART_START_GLOW" { count(); yylval.ival = LLPS_PART_START_GLOW; return (INTEGER_CONSTANT); } +"PSYS_PART_END_GLOW" { count(); yylval.ival = LLPS_PART_END_GLOW; return (INTEGER_CONSTANT); } "PSYS_PART_WIND_MASK" { count(); yylval.ival = LLPartData::LL_PART_WIND_MASK; return(INTEGER_CONSTANT); } "PSYS_PART_INTERP_COLOR_MASK" { count(); yylval.ival = LLPartData::LL_PART_INTERP_COLOR_MASK; return(INTEGER_CONSTANT); } @@ -384,6 +409,16 @@ int yyerror(const char *fmt, ...); "PSYS_PART_TARGET_POS_MASK" { count(); yylval.ival = LLPartData::LL_PART_TARGET_POS_MASK; return(INTEGER_CONSTANT); } "PSYS_PART_EMISSIVE_MASK" { count(); yylval.ival = LLPartData::LL_PART_EMISSIVE_MASK; return(INTEGER_CONSTANT); } "PSYS_PART_TARGET_LINEAR_MASK" { count(); yylval.ival = LLPartData::LL_PART_TARGET_LINEAR_MASK; return(INTEGER_CONSTANT); } +"PSYS_PART_RIBBON_MASK" { count(); yylval.ival = LLPartData::LL_PART_RIBBON_MASK; return(INTEGER_CONSTANT); } + +"PSYS_PART_BF_ONE" { count(); yylval.ival = LLPartData::LL_PART_BF_ONE; return(INTEGER_CONSTANT); } +"PSYS_PART_BF_ZERO" { count(); yylval.ival = LLPartData::LL_PART_BF_ZERO; return(INTEGER_CONSTANT); } +"PSYS_PART_BF_DEST_COLOR" { count(); yylval.ival = LLPartData::LL_PART_BF_DEST_COLOR; return(INTEGER_CONSTANT); } +"PSYS_PART_BF_SOURCE_COLOR" { count(); yylval.ival = LLPartData::LL_PART_BF_SOURCE_COLOR; return(INTEGER_CONSTANT); } +"PSYS_PART_BF_ONE_MINUS_DEST_COLOR" { count(); yylval.ival = LLPartData::LL_PART_BF_ONE_MINUS_DEST_COLOR; return(INTEGER_CONSTANT); } +"PSYS_PART_BF_ONE_MINUS_SOURCE_COLOR" { count(); yylval.ival = LLPartData::LL_PART_BF_ONE_MINUS_SOURCE_COLOR; return(INTEGER_CONSTANT); } +"PSYS_PART_BF_SOURCE_ALPHA" { count(); yylval.ival = LLPartData::LL_PART_BF_SOURCE_ALPHA; return(INTEGER_CONSTANT); } +"PSYS_PART_BF_ONE_MINUS_SOURCE_ALPHA" { count(); yylval.ival = LLPartData::LL_PART_BF_ONE_MINUS_SOURCE_ALPHA; return(INTEGER_CONSTANT); } "PSYS_SRC_MAX_AGE" { count(); yylval.ival = LLPS_SRC_MAX_AGE; return(INTEGER_CONSTANT); } @@ -479,7 +514,17 @@ int yyerror(const char *fmt, ...); "PRIM_BUMP_SHINY" { count(); yylval.ival = LSL_PRIM_BUMP_SHINY; return(INTEGER_CONSTANT); } "PRIM_FULLBRIGHT" { count(); yylval.ival = LSL_PRIM_FULLBRIGHT; return(INTEGER_CONSTANT); } "PRIM_TEXGEN" { count(); yylval.ival = LSL_PRIM_TEXGEN; return(INTEGER_CONSTANT); } -"PRIM_GLOW" { count(); yylval.ival = LSL_PRIM_GLOW; return(INTEGER_CONSTANT); } +"PRIM_GLOW" { count(); yylval.ival = LSL_PRIM_GLOW; return(INTEGER_CONSTANT); } +"PRIM_TEXT" { count(); yylval.ival = LSL_PRIM_TEXT; return(INTEGER_CONSTANT); } +"PRIM_NAME" { count(); yylval.ival = LSL_PRIM_NAME; return(INTEGER_CONSTANT); } +"PRIM_DESC" { count(); yylval.ival = LSL_PRIM_DESC; return(INTEGER_CONSTANT); } +"PRIM_OMEGA" { count(); yylval.ival = LSL_PRIM_OMEGA; return(INTEGER_CONSTANT); } +"PRIM_LINK_TARGET" { count(); yylval.ival = LSL_PRIM_LINK_TARGET; return(INTEGER_CONSTANT); } +"PRIM_SLICE" { count(); yylval.ival = LSL_PRIM_SLICE; return(INTEGER_CONSTANT); } + +"PRIM_PHYSICS_SHAPE_PRIM" { count(); yylval.ival = LSL_PRIM_PHYSICS_SHAPE_PRIM; return(INTEGER_CONSTANT); } +"PRIM_PHYSICS_SHAPE_NONE" { count(); yylval.ival = LSL_PRIM_PHYSICS_SHAPE_NONE; return(INTEGER_CONSTANT); } +"PRIM_PHYSICS_SHAPE_CONVEX" { count(); yylval.ival = LSL_PRIM_PHYSICS_SHAPE_CONVEX; return(INTEGER_CONSTANT); } "PRIM_TYPE_BOX" { count(); yylval.ival = LSL_PRIM_TYPE_BOX; return(INTEGER_CONSTANT); } "PRIM_TYPE_CYLINDER" { count(); yylval.ival = LSL_PRIM_TYPE_CYLINDER; return(INTEGER_CONSTANT); } diff --git a/indra/lscript/lscript_execute/lscript_readlso.cpp b/indra/lscript/lscript_execute/lscript_readlso.cpp index 8b41cb5a72..6384a57100 100755 --- a/indra/lscript/lscript_execute/lscript_readlso.cpp +++ b/indra/lscript/lscript_execute/lscript_readlso.cpp @@ -145,7 +145,6 @@ void LLScriptLSOParse::printGlobals(LLFILE *fp) // get offset to skip past name varoffset = global_v_offset; bytestream2integer(mRawData, global_v_offset); - // get typeexport type = *(mRawData + global_v_offset++); @@ -347,6 +346,7 @@ void LLScriptLSOParse::printStates(LLFILE *fp) S32 temp_end; opcode_end = worst_case_opcode_end; + (void)opcode_end; for (k = LSTT_STATE_BEGIN; k < LSTT_STATE_END; k++) { diff --git a/indra/mac_updater/mac_updater.cpp b/indra/mac_updater/mac_updater.cpp new file mode 100644 index 0000000000..f533d47b18 --- /dev/null +++ b/indra/mac_updater/mac_updater.cpp @@ -0,0 +1,1266 @@ +/** + * @file mac_updater.cpp + * @brief + * + * $LicenseInfo:firstyear=2006&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "linden_common.h" + +#include <boost/format.hpp> + +#include <libgen.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <unistd.h> + +#include <curl/curl.h> +#include <pthread.h> + +#include "llerror.h" +#include "lltimer.h" +#include "lldir.h" +#include "llfile.h" + +#include "llstring.h" + +#include <Carbon/Carbon.h> + +#include "llerrorcontrol.h" + +#if LL_DARWIN +// FSPathMakeRef, FSObjectCopy, deprecations... +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + +enum +{ + kEventClassCustom = 'Cust', + kEventCustomProgress = 'Prog', + kEventParamCustomCurValue = 'Cur ', + kEventParamCustomMaxValue = 'Max ', + kEventParamCustomText = 'Text', + kEventCustomDone = 'Done', +}; + +WindowRef gWindow = NULL; +EventHandlerRef gEventHandler = NULL; +OSStatus gFailure = noErr; +Boolean gCancelled = false; + +const char *gUpdateURL; +const char *gProductName; +const char *gBundleID; +const char *gDmgFile; +const char *gMarkerPath; + +void *updatethreadproc(void*); + +pthread_t updatethread; + +OSStatus setProgress(int cur, int max) +{ + OSStatus err; + ControlRef progressBar = NULL; + ControlID id; + + id.signature = 'prog'; + id.id = 0; + + err = GetControlByID(gWindow, &id, &progressBar); + if(err == noErr) + { + Boolean indeterminate; + + if(max == 0) + { + indeterminate = true; + err = SetControlData(progressBar, kControlEntireControl, kControlProgressBarIndeterminateTag, sizeof(Boolean), (Ptr)&indeterminate); + } + else + { + double percentage = (double)cur / (double)max; + SetControlMinimum(progressBar, 0); + SetControlMaximum(progressBar, 100); + SetControlValue(progressBar, (SInt16)(percentage * 100)); + + indeterminate = false; + err = SetControlData(progressBar, kControlEntireControl, kControlProgressBarIndeterminateTag, sizeof(Boolean), (Ptr)&indeterminate); + + Draw1Control(progressBar); + } + } + + return(err); +} + +OSStatus setProgressText(CFStringRef text) +{ + OSStatus err; + ControlRef progressText = NULL; + ControlID id; + + id.signature = 'what'; + id.id = 0; + + err = GetControlByID(gWindow, &id, &progressText); + if(err == noErr) + { + err = SetControlData(progressText, kControlEntireControl, kControlStaticTextCFStringTag, sizeof(CFStringRef), (Ptr)&text); + Draw1Control(progressText); + } + + return(err); +} + +OSStatus sendProgress(long cur, long max, CFStringRef text = NULL) +{ + OSStatus result; + EventRef evt; + + result = CreateEvent( + NULL, + kEventClassCustom, + kEventCustomProgress, + 0, + kEventAttributeNone, + &evt); + + // This event needs to be targeted at the window so it goes to the window's handler. + if(result == noErr) + { + EventTargetRef target = GetWindowEventTarget(gWindow); + result = SetEventParameter ( + evt, + kEventParamPostTarget, + typeEventTargetRef, + sizeof(target), + &target); + } + + if(result == noErr) + { + result = SetEventParameter ( + evt, + kEventParamCustomCurValue, + typeLongInteger, + sizeof(cur), + &cur); + } + + if(result == noErr) + { + result = SetEventParameter ( + evt, + kEventParamCustomMaxValue, + typeLongInteger, + sizeof(max), + &max); + } + + if(result == noErr) + { + if(text != NULL) + { + result = SetEventParameter ( + evt, + kEventParamCustomText, + typeCFStringRef, + sizeof(text), + &text); + } + } + + if(result == noErr) + { + // Send the event + PostEventToQueue( + GetMainEventQueue(), + evt, + kEventPriorityStandard); + + } + + return(result); +} + +OSStatus sendDone(void) +{ + OSStatus result; + EventRef evt; + + result = CreateEvent( + NULL, + kEventClassCustom, + kEventCustomDone, + 0, + kEventAttributeNone, + &evt); + + // This event needs to be targeted at the window so it goes to the window's handler. + if(result == noErr) + { + EventTargetRef target = GetWindowEventTarget(gWindow); + result = SetEventParameter ( + evt, + kEventParamPostTarget, + typeEventTargetRef, + sizeof(target), + &target); + } + + if(result == noErr) + { + // Send the event + PostEventToQueue( + GetMainEventQueue(), + evt, + kEventPriorityStandard); + + } + + return(result); +} + +OSStatus dialogHandler(EventHandlerCallRef handler, EventRef event, void *userdata) +{ + OSStatus result = eventNotHandledErr; + OSStatus err; + UInt32 evtClass = GetEventClass(event); + UInt32 evtKind = GetEventKind(event); + + if((evtClass == kEventClassCommand) && (evtKind == kEventCommandProcess)) + { + HICommand cmd; + err = GetEventParameter(event, kEventParamDirectObject, typeHICommand, NULL, sizeof(cmd), NULL, &cmd); + + if(err == noErr) + { + switch(cmd.commandID) + { + case kHICommandCancel: + gCancelled = true; +// QuitAppModalLoopForWindow(gWindow); + result = noErr; + break; + } + } + } + else if((evtClass == kEventClassCustom) && (evtKind == kEventCustomProgress)) + { + // Request to update the progress dialog + long cur = 0; + long max = 0; + CFStringRef text = NULL; + (void) GetEventParameter(event, kEventParamCustomCurValue, typeLongInteger, NULL, sizeof(cur), NULL, &cur); + (void) GetEventParameter(event, kEventParamCustomMaxValue, typeLongInteger, NULL, sizeof(max), NULL, &max); + (void) GetEventParameter(event, kEventParamCustomText, typeCFStringRef, NULL, sizeof(text), NULL, &text); + + err = setProgress(cur, max); + if(err == noErr) + { + if(text != NULL) + { + setProgressText(text); + } + } + + result = noErr; + } + else if((evtClass == kEventClassCustom) && (evtKind == kEventCustomDone)) + { + // We're done. Exit the modal loop. + QuitAppModalLoopForWindow(gWindow); + result = noErr; + } + + return(result); +} + +#if 0 +size_t curl_download_callback(void *data, size_t size, size_t nmemb, + void *user_data) +{ + S32 bytes = size * nmemb; + char *cdata = (char *) data; + for (int i =0; i < bytes; i += 1) + { + gServerResponse.append(cdata[i]); + } + return bytes; +} +#endif + +int curl_progress_callback_func(void *clientp, + double dltotal, + double dlnow, + double ultotal, + double ulnow) +{ + int max = (int)(dltotal / 1024.0); + int cur = (int)(dlnow / 1024.0); + sendProgress(cur, max); + + if(gCancelled) + return(1); + + return(0); +} + +int parse_args(int argc, char **argv) +{ + int j; + + for (j = 1; j < argc; j++) + { + if ((!strcmp(argv[j], "-url")) && (++j < argc)) + { + gUpdateURL = argv[j]; + } + else if ((!strcmp(argv[j], "-name")) && (++j < argc)) + { + gProductName = argv[j]; + } + else if ((!strcmp(argv[j], "-bundleid")) && (++j < argc)) + { + gBundleID = argv[j]; + } + else if ((!strcmp(argv[j], "-dmg")) && (++j < argc)) + { + gDmgFile = argv[j]; + } + else if ((!strcmp(argv[j], "-marker")) && (++j < argc)) + { + gMarkerPath = argv[j];; + } + } + + return 0; +} + +int main(int argc, char **argv) +{ + // We assume that all the logs we're looking for reside on the current drive + gDirUtilp->initAppDirs("SecondLife"); + + LLError::initForApplication( gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "")); + + // Rename current log file to ".old" + std::string old_log_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "updater.log.old"); + std::string log_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "updater.log"); + LLFile::rename(log_file.c_str(), old_log_file.c_str()); + + // Set the log file to updater.log + LLError::logToFile(log_file); + + ///////////////////////////////////////// + // + // Process command line arguments + // + gUpdateURL = NULL; + gProductName = NULL; + gBundleID = NULL; + gDmgFile = NULL; + gMarkerPath = NULL; + parse_args(argc, argv); + if ((gUpdateURL == NULL) && (gDmgFile == NULL)) + { + llinfos << "Usage: mac_updater -url <url> | -dmg <dmg file> [-name <product_name>] [-program <program_name>]" << llendl; + exit(1); + } + else + { + llinfos << "Update url is: " << gUpdateURL << llendl; + if (gProductName) + { + llinfos << "Product name is: " << gProductName << llendl; + } + else + { + gProductName = "Second Life"; + } + if (gBundleID) + { + llinfos << "Bundle ID is: " << gBundleID << llendl; + } + else + { + gBundleID = "com.secondlife.indra.viewer"; + } + } + + llinfos << "Starting " << gProductName << " Updater" << llendl; + + // Real UI... + OSStatus err; + IBNibRef nib = NULL; + + err = CreateNibReference(CFSTR("AutoUpdater"), &nib); + + char windowTitle[MAX_PATH]; /* Flawfinder: ignore */ + snprintf(windowTitle, sizeof(windowTitle), "%s Updater", gProductName); + CFStringRef windowTitleRef = NULL; + windowTitleRef = CFStringCreateWithCString(NULL, windowTitle, kCFStringEncodingUTF8); + + if(err == noErr) + { + err = CreateWindowFromNib(nib, CFSTR("Updater"), &gWindow); + } + + if (err == noErr) + { + err = SetWindowTitleWithCFString(gWindow, windowTitleRef); + } + CFRelease(windowTitleRef); + + if(err == noErr) + { + // Set up an event handler for the window. + EventTypeSpec handlerEvents[] = + { + { kEventClassCommand, kEventCommandProcess }, + { kEventClassCustom, kEventCustomProgress }, + { kEventClassCustom, kEventCustomDone } + }; + InstallStandardEventHandler(GetWindowEventTarget(gWindow)); + InstallWindowEventHandler( + gWindow, + NewEventHandlerUPP(dialogHandler), + GetEventTypeCount (handlerEvents), + handlerEvents, + 0, + &gEventHandler); + } + + if(err == noErr) + { + ShowWindow(gWindow); + SelectWindow(gWindow); + } + + if(err == noErr) + { + pthread_create(&updatethread, + NULL, + &updatethreadproc, + NULL); + + } + + if(err == noErr) + { + RunAppModalLoopForWindow(gWindow); + } + + void *threadresult; + + pthread_join(updatethread, &threadresult); + + if(!gCancelled && (gFailure != noErr)) + { + // Something went wrong. Since we always just tell the user to download a new version, we don't really care what. + AlertStdCFStringAlertParamRec params; + SInt16 retval_mac = 1; + DialogRef alert = NULL; + OSStatus err; + + params.version = kStdCFStringAlertVersionOne; + params.movable = false; + params.helpButton = false; + params.defaultText = (CFStringRef)kAlertDefaultOKText; + params.cancelText = 0; + params.otherText = 0; + params.defaultButton = 1; + params.cancelButton = 0; + params.position = kWindowDefaultPosition; + params.flags = 0; + + err = CreateStandardAlert( + kAlertStopAlert, + CFSTR("Error"), + CFSTR("An error occurred while updating Second Life. Please download the latest version from www.secondlife.com."), + ¶ms, + &alert); + + if(err == noErr) + { + err = RunStandardAlert( + alert, + NULL, + &retval_mac); + } + + if(gMarkerPath != 0) + { + // Create a install fail marker that can be used by the viewer to + // detect install problems. + std::ofstream stream(gMarkerPath); + if(stream) stream << -1; + } + exit(-1); + } else { + exit(0); + } + + if(gWindow != NULL) + { + DisposeWindow(gWindow); + } + + if(nib != NULL) + { + DisposeNibReference(nib); + } + + return 0; +} + +bool isDirWritable(FSRef &dir) +{ + bool result = false; + + // Test for a writable directory by creating a directory, then deleting it again. + // This is kinda lame, but will pretty much always give the right answer. + + OSStatus err = noErr; + char temp[PATH_MAX] = ""; /* Flawfinder: ignore */ + + err = FSRefMakePath(&dir, (UInt8*)temp, sizeof(temp)); + + if(err == noErr) + { + strncat(temp, "/.test_XXXXXX", (sizeof(temp) - strlen(temp)) - 1); + + if(mkdtemp(temp) != NULL) + { + // We were able to make the directory. This means the directory is writable. + result = true; + + // Clean up. + rmdir(temp); + } + } + +#if 0 + // This seemed like a good idea, but won't tell us if we're on a volume mounted read-only. + UInt8 perm; + err = FSGetUserPrivilegesPermissions(&targetParentRef, &perm, NULL); + if(err == noErr) + { + if(perm & kioACUserNoMakeChangesMask) + { + // Parent directory isn't writable. + llinfos << "Target parent directory not writable." << llendl; + err = -1; + replacingTarget = false; + } + } +#endif + + return result; +} + +static std::string HFSUniStr255_to_utf8str(const HFSUniStr255* src) +{ + llutf16string string16((U16*)&(src->unicode), src->length); + std::string result = utf16str_to_utf8str(string16); + return result; +} + +int restoreObject(const char* aside, const char* target, const char* path, const char* object) +{ + char source[PATH_MAX] = ""; /* Flawfinder: ignore */ + char dest[PATH_MAX] = ""; /* Flawfinder: ignore */ + snprintf(source, sizeof(source), "%s/%s/%s", aside, path, object); + snprintf(dest, sizeof(dest), "%s/%s", target, path); + FSRef sourceRef; + FSRef destRef; + OSStatus err; + err = FSPathMakeRef((UInt8 *)source, &sourceRef, NULL); + if(err != noErr) return false; + err = FSPathMakeRef((UInt8 *)dest, &destRef, NULL); + if(err != noErr) return false; + + llinfos << "Copying " << source << " to " << dest << llendl; + + err = FSCopyObjectSync( + &sourceRef, + &destRef, + NULL, + NULL, + kFSFileOperationOverwrite); + + if(err != noErr) return false; + return true; +} + +// Replace any mention of "Second Life" with the product name. +void filterFile(const char* filename) +{ + char temp[PATH_MAX] = ""; /* Flawfinder: ignore */ + // First copy the target's version, so we can run it through sed. + snprintf(temp, sizeof(temp), "cp '%s' '%s.tmp'", filename, filename); + system(temp); /* Flawfinder: ignore */ + + // Now run it through sed. + snprintf(temp, sizeof(temp), + "sed 's/Second Life/%s/g' '%s.tmp' > '%s'", gProductName, filename, filename); + system(temp); /* Flawfinder: ignore */ +} + +static bool isFSRefViewerBundle(FSRef *targetRef) +{ + bool result = false; + CFURLRef targetURL = NULL; + CFBundleRef targetBundle = NULL; + CFStringRef targetBundleID = NULL; + CFStringRef sourceBundleID = NULL; + + targetURL = CFURLCreateFromFSRef(NULL, targetRef); + + if(targetURL == NULL) + { + llinfos << "Error creating target URL." << llendl; + } + else + { + targetBundle = CFBundleCreate(NULL, targetURL); + } + + if(targetBundle == NULL) + { + llinfos << "Failed to create target bundle." << llendl; + } + else + { + targetBundleID = CFBundleGetIdentifier(targetBundle); + } + + if(targetBundleID == NULL) + { + llinfos << "Couldn't retrieve target bundle ID." << llendl; + } + else + { + sourceBundleID = CFStringCreateWithCString(NULL, gBundleID, kCFStringEncodingUTF8); + if(CFStringCompare(sourceBundleID, targetBundleID, 0) == kCFCompareEqualTo) + { + // This is the bundle we're looking for. + result = true; + } + else + { + llinfos << "Target bundle ID mismatch." << llendl; + } + } + + // Don't release targetBundleID -- since we don't retain it, it's released when targetBundle is released. + if(targetURL != NULL) + CFRelease(targetURL); + if(targetBundle != NULL) + CFRelease(targetBundle); + + return result; +} + +// Search through the directory specified by 'parent' for an item that appears to be a Second Life viewer. +static OSErr findAppBundleOnDiskImage(FSRef *parent, FSRef *app) +{ + FSIterator iterator; + bool found = false; + + OSErr err = FSOpenIterator( parent, kFSIterateFlat, &iterator ); + if(!err) + { + do + { + ItemCount actualObjects = 0; + Boolean containerChanged = false; + FSCatalogInfo info; + FSRef ref; + HFSUniStr255 unicodeName; + err = FSGetCatalogInfoBulk( + iterator, + 1, + &actualObjects, + &containerChanged, + kFSCatInfoNodeFlags, + &info, + &ref, + NULL, + &unicodeName ); + + if(actualObjects == 0) + break; + + if(!err) + { + // Call succeeded and not done with the iteration. + std::string name = HFSUniStr255_to_utf8str(&unicodeName); + + llinfos << "Considering \"" << name << "\"" << llendl; + + if(info.nodeFlags & kFSNodeIsDirectoryMask) + { + // This is a directory. See if it's a .app + if(name.find(".app") != std::string::npos) + { + // Looks promising. Check to see if it has the right bundle identifier. + if(isFSRefViewerBundle(&ref)) + { + llinfos << name << " is the one" << llendl; + // This is the one. Return it. + *app = ref; + found = true; + break; + } else { + llinfos << name << " is not the bundle we are looking for; move along" << llendl; + } + + } + } + } + } + while(!err); + + llinfos << "closing the iterator" << llendl; + + FSCloseIterator(iterator); + + llinfos << "closed" << llendl; + } + + if(!err && !found) + err = fnfErr; + + return err; +} + +void *updatethreadproc(void*) +{ + char tempDir[PATH_MAX] = ""; /* Flawfinder: ignore */ + FSRef tempDirRef; + char temp[PATH_MAX] = ""; /* Flawfinder: ignore */ + // *NOTE: This buffer length is used in a scanf() below. + char deviceNode[1024] = ""; /* Flawfinder: ignore */ + LLFILE *downloadFile = NULL; + OSStatus err; + ProcessSerialNumber psn; + char target[PATH_MAX] = ""; /* Flawfinder: ignore */ + FSRef targetRef; + FSRef targetParentRef; + FSVolumeRefNum targetVol; + FSRef trashFolderRef; + Boolean replacingTarget = false; + + memset(&tempDirRef, 0, sizeof(tempDirRef)); + memset(&targetRef, 0, sizeof(targetRef)); + memset(&targetParentRef, 0, sizeof(targetParentRef)); + + try + { + // Attempt to get a reference to the Second Life application bundle containing this updater. + // Any failures during this process will cause us to default to updating /Applications/Second Life.app + { + FSRef myBundle; + + err = GetCurrentProcess(&psn); + if(err == noErr) + { + err = GetProcessBundleLocation(&psn, &myBundle); + } + + if(err == noErr) + { + // Sanity check: Make sure the name of the item referenced by targetRef is "Second Life.app". + FSRefMakePath(&myBundle, (UInt8*)target, sizeof(target)); + + llinfos << "Updater bundle location: " << target << llendl; + } + + // Our bundle should be in Second Life.app/Contents/Resources/AutoUpdater.app + // so we need to go up 3 levels to get the path to the main application bundle. + if(err == noErr) + { + err = FSGetCatalogInfo(&myBundle, kFSCatInfoNone, NULL, NULL, NULL, &targetRef); + } + if(err == noErr) + { + err = FSGetCatalogInfo(&targetRef, kFSCatInfoNone, NULL, NULL, NULL, &targetRef); + } + if(err == noErr) + { + err = FSGetCatalogInfo(&targetRef, kFSCatInfoNone, NULL, NULL, NULL, &targetRef); + } + + // And once more to get the parent of the target + if(err == noErr) + { + err = FSGetCatalogInfo(&targetRef, kFSCatInfoNone, NULL, NULL, NULL, &targetParentRef); + } + + if(err == noErr) + { + FSRefMakePath(&targetRef, (UInt8*)target, sizeof(target)); + llinfos << "Path to target: " << target << llendl; + } + + // Sanity check: make sure the target is a bundle with the right identifier + if(err == noErr) + { + // Assume the worst... + err = -1; + + if(isFSRefViewerBundle(&targetRef)) + { + // This is the bundle we're looking for. + err = noErr; + replacingTarget = true; + } + } + + // Make sure the target's parent directory is writable. + if(err == noErr) + { + if(!isDirWritable(targetParentRef)) + { + // Parent directory isn't writable. + llinfos << "Target parent directory not writable." << llendl; + err = -1; + replacingTarget = false; + } + } + + if(err != noErr) + { + Boolean isDirectory; + llinfos << "Target search failed, defaulting to /Applications/" << gProductName << ".app." << llendl; + + // Set up the parent directory + err = FSPathMakeRef((UInt8*)"/Applications", &targetParentRef, &isDirectory); + if((err != noErr) || (!isDirectory)) + { + // We're so hosed. + llinfos << "Applications directory not found, giving up." << llendl; + throw 0; + } + + snprintf(target, sizeof(target), "/Applications/%s.app", gProductName); + + memset(&targetRef, 0, sizeof(targetRef)); + err = FSPathMakeRef((UInt8*)target, &targetRef, NULL); + if(err == fnfErr) + { + // This is fine, just means we're not replacing anything. + err = noErr; + replacingTarget = false; + } + else + { + replacingTarget = true; + } + + // Make sure the target's parent directory is writable. + if(err == noErr) + { + if(!isDirWritable(targetParentRef)) + { + // Parent directory isn't writable. + llinfos << "Target parent directory not writable." << llendl; + err = -1; + replacingTarget = false; + } + } + + } + + // If we haven't fixed all problems by this point, just bail. + if(err != noErr) + { + llinfos << "Unable to pick a target, giving up." << llendl; + throw 0; + } + } + + // Find the volID of the volume the target resides on + { + FSCatalogInfo info; + err = FSGetCatalogInfo( + &targetParentRef, + kFSCatInfoVolume, + &info, + NULL, + NULL, + NULL); + + if(err != noErr) + throw 0; + + targetVol = info.volume; + } + + // Find the temporary items and trash folders on that volume. + err = FSFindFolder( + targetVol, + kTrashFolderType, + true, + &trashFolderRef); + + if(err != noErr) + throw 0; + +#if 0 // *HACK for DEV-11935 see below for details. + + FSRef tempFolderRef; + + err = FSFindFolder( + targetVol, + kTemporaryFolderType, + true, + &tempFolderRef); + + if(err != noErr) + throw 0; + + err = FSRefMakePath(&tempFolderRef, (UInt8*)temp, sizeof(temp)); + + if(err != noErr) + throw 0; + +#else + + // *HACK for DEV-11935 the above kTemporaryFolderType query was giving + // back results with path names that seem to be too long to be used as + // mount points. I suspect this incompatibility was introduced in the + // Leopard 10.5.2 update, but I have not verified this. + char const HARDCODED_TMP[] = "/tmp"; + strncpy(temp, HARDCODED_TMP, sizeof(HARDCODED_TMP)); + +#endif // 0 *HACK for DEV-11935 + + // Skip downloading the file if the dmg was passed on the command line. + std::string dmgName; + if(gDmgFile != NULL) { + dmgName = basename((char *)gDmgFile); + char * dmgDir = dirname((char *)gDmgFile); + strncpy(tempDir, dmgDir, sizeof(tempDir)); + err = FSPathMakeRef((UInt8*)tempDir, &tempDirRef, NULL); + if(err != noErr) throw 0; + chdir(tempDir); + goto begin_install; + } else { + // Continue on to download file. + dmgName = "SecondLife.dmg"; + } + + + strncat(temp, "/SecondLifeUpdate_XXXXXX", (sizeof(temp) - strlen(temp)) - 1); + if(mkdtemp(temp) == NULL) + { + throw 0; + } + + strncpy(tempDir, temp, sizeof(tempDir)); + temp[sizeof(tempDir) - 1] = '\0'; + + llinfos << "tempDir is " << tempDir << llendl; + + err = FSPathMakeRef((UInt8*)tempDir, &tempDirRef, NULL); + + if(err != noErr) + throw 0; + + chdir(tempDir); + + snprintf(temp, sizeof(temp), "SecondLife.dmg"); + + downloadFile = LLFile::fopen(temp, "wb"); /* Flawfinder: ignore */ + if(downloadFile == NULL) + { + throw 0; + } + + { + CURL *curl = curl_easy_init(); + + curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1); + // curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, &curl_download_callback); + curl_easy_setopt(curl, CURLOPT_FILE, downloadFile); + curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0); + curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, &curl_progress_callback_func); + curl_easy_setopt(curl, CURLOPT_URL, gUpdateURL); + curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1); + + sendProgress(0, 1, CFSTR("Downloading...")); + + CURLcode result = curl_easy_perform(curl); + + curl_easy_cleanup(curl); + + if(gCancelled) + { + llinfos << "User cancel, bailing out."<< llendl; + throw 0; + } + + if(result != CURLE_OK) + { + llinfos << "Error " << result << " while downloading disk image."<< llendl; + throw 0; + } + + fclose(downloadFile); + downloadFile = NULL; + } + + begin_install: + sendProgress(0, 0, CFSTR("Mounting image...")); + LLFile::mkdir("mnt", 0700); + + // NOTE: we could add -private at the end of this command line to keep the image from showing up in the Finder, + // but if our cleanup fails, this makes it much harder for the user to unmount the image. + std::string mountOutput; + boost::format cmdFormat("hdiutil attach %s -mountpoint mnt"); + cmdFormat % dmgName; + FILE* mounter = popen(cmdFormat.str().c_str(), "r"); /* Flawfinder: ignore */ + + if(mounter == NULL) + { + llinfos << "Failed to mount disk image, exiting."<< llendl; + throw 0; + } + + // We need to scan the output from hdiutil to find the device node it uses to attach the disk image. + // If we don't have this information, we can't detach it later. + while(mounter != NULL) + { + size_t len = fread(temp, 1, sizeof(temp)-1, mounter); + temp[len] = 0; + mountOutput.append(temp); + if(len < sizeof(temp)-1) + { + // End of file or error. + int result = pclose(mounter); + if(result != 0) + { + // NOTE: We used to abort here, but pclose() started returning + // -1, possibly when the size of the DMG passed a certain point + llinfos << "Unexpected result closing pipe: " << result << llendl; + } + mounter = NULL; + } + } + + if(!mountOutput.empty()) + { + const char *s = mountOutput.c_str(); + const char *prefix = "/dev/"; + char *sub = strstr(s, prefix); + + if(sub != NULL) + { + sub += strlen(prefix); /* Flawfinder: ignore */ + sscanf(sub, "%1023s", deviceNode); /* Flawfinder: ignore */ + } + } + + if(deviceNode[0] != 0) + { + llinfos << "Disk image attached on /dev/" << deviceNode << llendl; + } + else + { + llinfos << "Disk image device node not found!" << llendl; + throw 0; + } + + // Get an FSRef to the new application on the disk image + FSRef sourceRef; + FSRef mountRef; + snprintf(temp, sizeof(temp), "%s/mnt", tempDir); + + llinfos << "Disk image mount point is: " << temp << llendl; + + err = FSPathMakeRef((UInt8 *)temp, &mountRef, NULL); + if(err != noErr) + { + llinfos << "Couldn't make FSRef to disk image mount point." << llendl; + throw 0; + } + + sendProgress(0, 0, CFSTR("Searching for the app bundle...")); + err = findAppBundleOnDiskImage(&mountRef, &sourceRef); + if(err != noErr) + { + llinfos << "Couldn't find application bundle on mounted disk image." << llendl; + throw 0; + } + else + { + llinfos << "found the bundle." << llendl; + } + + sendProgress(0, 0, CFSTR("Preparing to copy files...")); + + FSRef asideRef; + char aside[MAX_PATH]; /* Flawfinder: ignore */ + + // this will hold the name of the destination target + CFStringRef appNameRef; + + if(replacingTarget) + { + // Get the name of the target we're replacing + HFSUniStr255 appNameUniStr; + err = FSGetCatalogInfo(&targetRef, 0, NULL, &appNameUniStr, NULL, NULL); + if(err != noErr) + throw 0; + appNameRef = FSCreateStringFromHFSUniStr(NULL, &appNameUniStr); + + // Move aside old version (into work directory) + err = FSMoveObject(&targetRef, &tempDirRef, &asideRef); + if(err != noErr) + { + llwarns << "failed to move aside old version (error code " << + err << ")" << llendl; + throw 0; + } + + // Grab the path for later use. + err = FSRefMakePath(&asideRef, (UInt8*)aside, sizeof(aside)); + } + else + { + // Construct the name of the target based on the product name + char appName[MAX_PATH]; /* Flawfinder: ignore */ + snprintf(appName, sizeof(appName), "%s.app", gProductName); + appNameRef = CFStringCreateWithCString(NULL, appName, kCFStringEncodingUTF8); + } + + sendProgress(0, 0, CFSTR("Copying files...")); + + llinfos << "Starting copy..." << llendl; + + // Copy the new version from the disk image to the target location. + err = FSCopyObjectSync( + &sourceRef, + &targetParentRef, + appNameRef, + &targetRef, + kFSFileOperationDefaultOptions); + + // Grab the path for later use. + err = FSRefMakePath(&targetRef, (UInt8*)target, sizeof(target)); + if(err != noErr) + throw 0; + + llinfos << "Copy complete. Target = " << target << llendl; + + if(err != noErr) + { + // Something went wrong during the copy. Attempt to put the old version back and bail. + (void)FSDeleteObject(&targetRef); + if(replacingTarget) + { + (void)FSMoveObject(&asideRef, &targetParentRef, NULL); + } + throw 0; + } + else + { + // The update has succeeded. Clear the cache directory. + + sendProgress(0, 0, CFSTR("Clearing cache...")); + + llinfos << "Clearing cache..." << llendl; + + gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE,""), "*.*"); + + llinfos << "Clear complete." << llendl; + + } + } + catch(...) + { + if(!gCancelled) + if(gFailure == noErr) + gFailure = -1; + } + + // Failures from here on out are all non-fatal and not reported. + sendProgress(0, 3, CFSTR("Cleaning up...")); + + // Close disk image file if necessary + if(downloadFile != NULL) + { + llinfos << "Closing download file." << llendl; + + fclose(downloadFile); + downloadFile = NULL; + } + + sendProgress(1, 3); + // Unmount image + if(deviceNode[0] != 0) + { + llinfos << "Detaching disk image." << llendl; + + snprintf(temp, sizeof(temp), "hdiutil detach '%s'", deviceNode); + system(temp); /* Flawfinder: ignore */ + } + + sendProgress(2, 3); + + // Move work directory to the trash + if(tempDir[0] != 0) + { + llinfos << "Moving work directory to the trash." << llendl; + + FSRef trashRef; + OSStatus err = FSMoveObjectToTrashSync(&tempDirRef, &trashRef, 0); + if(err != noErr) { + llwarns << "failed to move files to trash, (error code " << + err << ")" << llendl; + } + } + + if(!gCancelled && !gFailure && (target[0] != 0)) + { + llinfos << "Touching application bundle." << llendl; + + snprintf(temp, sizeof(temp), "touch '%s'", target); + system(temp); /* Flawfinder: ignore */ + + llinfos << "Launching updated application." << llendl; + + snprintf(temp, sizeof(temp), "open '%s'", target); + system(temp); /* Flawfinder: ignore */ + } + + sendDone(); + + return(NULL); +} + +#if LL_DARWIN +#pragma GCC diagnostic warning "-Wdeprecated-declarations" +#endif diff --git a/indra/media_plugins/quicktime/media_plugin_quicktime.cpp b/indra/media_plugins/quicktime/media_plugin_quicktime.cpp index 24328202cb..2dd97a9ba7 100755 --- a/indra/media_plugins/quicktime/media_plugin_quicktime.cpp +++ b/indra/media_plugins/quicktime/media_plugin_quicktime.cpp @@ -232,12 +232,8 @@ private: mMovieHandle = NULL; }; - if ( mGWorldHandle ) - { - DisposeGWorld( mGWorldHandle ); - mGWorldHandle = NULL; - }; - + mGWorldHandle = NULL; + setStatus(STATUS_NONE); return true; @@ -273,6 +269,7 @@ private: //std::cerr << "<--- Sending size change request to application with name: " << mTextureSegmentName << " - size is " << width << " x " << height << std::endl; } } + // sanitize destination size Rect dest_rect = rectFromSize(mWidth, mHeight); @@ -281,12 +278,10 @@ private: int depth_bits = mDepth * 8; long rowbytes = mDepth * mTextureWidth; - GWorldPtr old_gworld_handle = mGWorldHandle; - if(mPixels != NULL) { // We have pixels. Set up a GWorld pointing at the texture. - OSErr result = NewGWorldFromPtr( &mGWorldHandle, depth_bits, &dest_rect, NULL, NULL, 0, (Ptr)mPixels, rowbytes); + OSErr result = QTNewGWorldFromPtr( &mGWorldHandle, depth_bits, &dest_rect, NULL, NULL, 0, (Ptr)mPixels, rowbytes); if ( noErr != result ) { // TODO: unrecoverable?? throw exception? return something? @@ -297,7 +292,7 @@ private: { // We don't have pixels. Create a fake GWorld we can point the movie at when it's not safe to render normally. Rect tempRect = rectFromSize(1, 1); - OSErr result = NewGWorld( &mGWorldHandle, depth_bits, &tempRect, NULL, NULL, 0); + OSErr result = QTNewGWorld( &mGWorldHandle, depth_bits, &tempRect, NULL, NULL, 0); if ( noErr != result ) { // TODO: unrecoverable?? throw exception? return something? @@ -305,14 +300,8 @@ private: } } - SetMovieGWorld( mMovieHandle, mGWorldHandle, GetGWorldDevice( mGWorldHandle ) ); - - // If the GWorld was already set up, delete it. - if(old_gworld_handle != NULL) - { - DisposeGWorld( old_gworld_handle ); - } - + SetMovieGWorld( mMovieHandle, mGWorldHandle, NULL ); + // Set up the movie display matrix { // scale movie to fit rect and invert vertically to match opengl image format @@ -579,28 +568,7 @@ private: } }; - - int getDataWidth() const - { - if ( mGWorldHandle ) - { - int depth = mDepth; - - if (depth < 1) - depth = 1; - - // ALWAYS use the row bytes from the PixMap if we have a GWorld because - // sometimes it's not the same as mMediaDepth * mMediaWidth ! - PixMapHandle pix_map_handle = GetGWorldPixMap( mGWorldHandle ); - return QTGetPixMapHandleRowBytes( pix_map_handle ) / depth; - } - else - { - // TODO : return LLMediaImplCommon::getaDataWidth(); - return 0; - } - }; - + void seek( F64 time ) { if ( mMovieController ) diff --git a/indra/media_plugins/webkit/mac_volume_catcher.cpp b/indra/media_plugins/webkit/mac_volume_catcher.cpp index 8a06bb8487..cc94556413 100755 --- a/indra/media_plugins/webkit/mac_volume_catcher.cpp +++ b/indra/media_plugins/webkit/mac_volume_catcher.cpp @@ -35,10 +35,13 @@ #include "volume_catcher.h" -#include <Carbon/Carbon.h> #include <QuickTime/QuickTime.h> #include <AudioUnit/AudioUnit.h> +#if LL_DARWIN +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + struct VolumeCatcherStorage; class VolumeCatcherImpl @@ -266,3 +269,6 @@ void VolumeCatcher::pump() // No periodic tasks are necessary for this implementation. } +#if LL_DARWIN +#pragma GCC diagnostic warning "-Wdeprecated-declarations" +#endif diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index dfe169828f..b6618f2935 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -124,6 +124,7 @@ set(viewer_SOURCE_FILES llavatariconctrl.cpp llavatarlist.cpp llavatarlistitem.cpp + llavatarrenderinfoaccountant.cpp llavatarpropertiesprocessor.cpp llblockedlistitem.cpp llblocklist.cpp @@ -229,6 +230,7 @@ set(viewer_SOURCE_FILES llfloaterfonttest.cpp llfloatergesture.cpp llfloatergodtools.cpp + llfloatergotoline.cpp llfloatergroupinvite.cpp llfloatergroups.cpp llfloaterhandler.cpp @@ -708,6 +710,7 @@ set(viewer_HEADER_FILES llavatarlist.h llavatarlistitem.h llavatarpropertiesprocessor.h + llavatarrenderinfoaccountant.h llblockedlistitem.h llblocklist.h llbox.h @@ -812,6 +815,7 @@ set(viewer_HEADER_FILES llfloaterfonttest.h llfloatergesture.h llfloatergodtools.h + llfloatergotoline.h llfloatergroupinvite.h llfloatergroups.h llfloaterhandler.h @@ -1270,6 +1274,11 @@ set_source_files_properties( if (DARWIN) LIST(APPEND viewer_SOURCE_FILES llappviewermacosx.cpp) + LIST(APPEND viewer_SOURCE_FILES llfilepicker_mac.mm) + LIST(APPEND viewer_HEADER_FILES llfilepicker_mac.h) + + # This should be compiled with the viewer. + LIST(APPEND viewer_SOURCE_FILES llappdelegate-objc.mm) find_library(AGL_LIBRARY AGL) find_library(APPKIT_LIBRARY AppKit) @@ -1290,7 +1299,7 @@ if (DARWIN) macview.r gpu_table.txt Info-SecondLife.plist - SecondLife.nib/ + SecondLife.xib/ # CMake doesn't seem to support Xcode language variants well just yet English.lproj/InfoPlist.strings English.lproj/language.txt @@ -1670,6 +1679,7 @@ if (WINDOWS) ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/zlib1.dll ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/vivoxplatform.dll ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/vivoxoal.dll + ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/ca-bundle.crt ${GOOGLE_PERF_TOOLS_SOURCE} ${CMAKE_CURRENT_SOURCE_DIR}/licenses-win32.txt ${CMAKE_CURRENT_SOURCE_DIR}/featuretable.txt @@ -1969,20 +1979,25 @@ if (LINUX) endif (LINUX) if (DARWIN) + # These all get set with PROPERTIES set(product "Second Life") - + set(MACOSX_BUNDLE_INFO_STRING "Second Life Viewer") + set(MACOSX_BUNDLE_ICON_FILE "secondlife.icns") + set(MACOSX_BUNDLE_GUI_IDENTIFIER "com.secondlife.indra.viewer") + set(MACOSX_BUNDLE_LONG_VERSION_STRING "${VIEWER_CHANNEL} ${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}") + set(MACOSX_BUNDLE_BUNDLE_NAME "SecondLife") + set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${VIEWER_SHORT_VERSION}") + set(MACOSX_BUNDLE_BUNDLE_VERSION "${VIEWER_SHORT_VERSION}${VIEWER_MACOSX_PHASE}${VIEWER_REVISION}") + set(MACOSX_BUNDLE_COPYRIGHT "Copyright © Linden Research, Inc. 2007") + set(MACOSX_BUNDLE_NSMAIN_NIB_FILE "SecondLife.nib") + set(MACOSX_BUNDLE_NSPRINCIPAL_CLASS "NSApplication") + set_target_properties( ${VIEWER_BINARY_NAME} PROPERTIES OUTPUT_NAME "${product}" - MACOSX_BUNDLE_INFO_STRING "Second Life Viewer" - MACOSX_BUNDLE_ICON_FILE "secondlife.icns" - MACOSX_BUNDLE_GUI_IDENTIFIER "com.secondlife.indra.viewer" - MACOSX_BUNDLE_LONG_VERSION_STRING "${VIEWER_CHANNEL} ${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}" - MACOSX_BUNDLE_BUNDLE_NAME "Second Life" - MACOSX_BUNDLE_SHORT_VERSION_STRING "${VIEWER_SHORT_VERSION}" - MACOSX_BUNDLE_BUNDLE_VERSION "${VIEWER_SHORT_VERSION}${VIEWER_MACOSX_PHASE}${VIEWER_REVISION}" - MACOSX_BUNDLE_COPYRIGHT "Copyright © Linden Research, Inc. 2007" + MACOSX_BUNDLE_INFO_PLIST + "${CMAKE_CURRENT_SOURCE_DIR}/Info-SecondLife.plist" ) configure_file( diff --git a/indra/newview/Info-SecondLife.plist b/indra/newview/Info-SecondLife.plist index a19844f11c..9b8136a827 100755 --- a/indra/newview/Info-SecondLife.plist +++ b/indra/newview/Info-SecondLife.plist @@ -5,19 +5,33 @@ <key>CFBundleDevelopmentRegion</key> <string>English</string> <key>CFBundleExecutable</key> - <string>Second Life</string> + <string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string> + <key>CFBundleGetInfoString</key> + <string>${MACOSX_BUNDLE_INFO_STRING}</string> <key>CFBundleIconFile</key> - <string>secondlife.icns</string> + <string>${MACOSX_BUNDLE_ICON_FILE}</string> <key>CFBundleIdentifier</key> - <string>com.secondlife.indra.viewer</string> + <string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> + <key>CFBundleLongVersionString</key> + <string>${MACOSX_BUNDLE_LONG_VERSION_STRING}</string> <key>CFBundleName</key> - <string>Second Life</string> + <string>${MACOSX_BUNDLE_BUNDLE_NAME}</string> <key>CFBundlePackageType</key> <string>APPL</string> + <key>CFBundleShortVersionString</key> + <string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string> <key>CFBundleSignature</key> <string>????</string> + <key>CFBundleVersion</key> + <string>${VIEWER_VERSION_MAJOR}.${VIEWER_VERSION_MINOR}.${VIEWER_VERSION_PATCH}.${VIEWER_VERSION_REVISION}</string> + <key>CSResourcesFileMapped</key> + <true/> + <key>LSRequiresCarbon</key> + <true/> + <key>NSHumanReadableCopyright</key> + <string>${MACOSX_BUNDLE_COPYRIGHT}</string> <key>CFBundleDocumentTypes</key> <array> <dict> @@ -59,9 +73,9 @@ <true/> </dict> </array> - <key>CFBundleVersion</key> - <string>${VIEWER_VERSION_MAJOR}.${VIEWER_VERSION_MINOR}.${VIEWER_VERSION_PATCH}.${VIEWER_VERSION_REVISION}</string> - <key>CSResourcesFileMapped</key> - <true/> + <key>NSPrincipalClass</key> + <string>${MACOSX_BUNDLE_NSPRINCIPAL_CLASS}</string> + <key>NSMainNibFile</key> + <string>${MACOSX_BUNDLE_NSMAIN_NIB_FILE}</string> </dict> </plist> diff --git a/indra/newview/SecondLife.nib b/indra/newview/SecondLife.nib Binary files differnew file mode 100644 index 0000000000..8b99b5a770 --- /dev/null +++ b/indra/newview/SecondLife.nib diff --git a/indra/newview/SecondLife.nib/classes.nib b/indra/newview/SecondLife.nib/classes.nib deleted file mode 100755 index ea58db1189..0000000000 --- a/indra/newview/SecondLife.nib/classes.nib +++ /dev/null @@ -1,4 +0,0 @@ -{ -IBClasses = (); -IBVersion = 1; -} diff --git a/indra/newview/SecondLife.nib/info.nib b/indra/newview/SecondLife.nib/info.nib deleted file mode 100755 index 1b531de104..0000000000 --- a/indra/newview/SecondLife.nib/info.nib +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>IBDocumentLocation</key> - <string>85 13 356 240 0 0 1280 1002 </string> - <key>IBEditorPositions</key> - <dict> - <key>29</key> - <string>27 314 247 44 0 0 1280 1002 </string> - </dict> - <key>IBFramework Version</key> - <string>362.0</string> - <key>IBOpenObjects</key> - <array> - <integer>191</integer> - </array> - <key>IBSystem Version</key> - <string>7D24</string> - <key>targetFramework</key> - <string>IBCarbonFramework</string> -</dict> -</plist> diff --git a/indra/newview/SecondLife.nib/objects.xib b/indra/newview/SecondLife.nib/objects.xib deleted file mode 100755 index b7ff30f2b2..0000000000 --- a/indra/newview/SecondLife.nib/objects.xib +++ /dev/null @@ -1,259 +0,0 @@ -<?xml version="1.0" standalone="yes"?> -<object class="NSIBObjectData"> - <string name="targetFramework">IBCarbonFramework</string> - <object name="rootObject" class="NSCustomObject" id="1"> - <string name="customClass">NSApplication</string> - </object> - <array count="31" name="allObjects"> - <object class="IBCarbonMenu" id="29"> - <string name="title">SecondLife</string> - <array count="4" name="items"> - <object class="IBCarbonMenuItem" id="182"> - <string name="title">Second Life</string> - <object name="submenu" class="IBCarbonMenu" id="181"> - <string name="title">Second Life</string> - <array count="1" name="items"> - <object class="IBCarbonMenuItem" id="183"> - <boolean name="disabled">TRUE</boolean> - <boolean name="updateSingleItem">TRUE</boolean> - <string name="title">About Second Life</string> - <int name="keyEquivalentModifier">0</int> - <ostype name="command">abou</ostype> - </object> - </array> - <string name="name">_NSAppleMenu</string> - </object> - </object> - <object class="IBCarbonMenuItem" id="127"> - <string name="title">File</string> - <object name="submenu" class="IBCarbonMenu" id="131"> - <string name="title">File</string> - </object> - </object> - <object class="IBCarbonMenuItem" id="152"> - <string name="title">Edit</string> - <object name="submenu" class="IBCarbonMenu" id="147"> - <string name="title">Edit</string> - <array count="10" name="items"> - <object class="IBCarbonMenuItem" id="141"> - <boolean name="updateSingleItem">TRUE</boolean> - <string name="title">Undo</string> - <string name="keyEquivalent">z</string> - <ostype name="command">undo</ostype> - </object> - <object class="IBCarbonMenuItem" id="146"> - <boolean name="updateSingleItem">TRUE</boolean> - <string name="title">Redo</string> - <string name="keyEquivalent">Z</string> - <ostype name="command">redo</ostype> - </object> - <object class="IBCarbonMenuItem" id="142"> - <boolean name="separator">TRUE</boolean> - </object> - <object class="IBCarbonMenuItem" id="143"> - <boolean name="updateSingleItem">TRUE</boolean> - <string name="title">Cut</string> - <string name="keyEquivalent">x</string> - <ostype name="command">cut </ostype> - </object> - <object class="IBCarbonMenuItem" id="149"> - <boolean name="updateSingleItem">TRUE</boolean> - <string name="title">Copy</string> - <string name="keyEquivalent">c</string> - <ostype name="command">copy</ostype> - </object> - <object class="IBCarbonMenuItem" id="144"> - <boolean name="updateSingleItem">TRUE</boolean> - <string name="title">Paste</string> - <string name="keyEquivalent">v</string> - <ostype name="command">past</ostype> - </object> - <object class="IBCarbonMenuItem" id="151"> - <boolean name="updateSingleItem">TRUE</boolean> - <string name="title">Delete</string> - <ostype name="command">clea</ostype> - </object> - <object class="IBCarbonMenuItem" id="148"> - <boolean name="updateSingleItem">TRUE</boolean> - <string name="title">Select All</string> - <string name="keyEquivalent">a</string> - <ostype name="command">sall</ostype> - </object> - <object class="IBCarbonMenuItem" id="188"> - <boolean name="separator">TRUE</boolean> - </object> - <object class="IBCarbonMenuItem" id="187"> - <boolean name="updateSingleItem">TRUE</boolean> - <string name="title">Special Characters…</string> - <ostype name="command">chrp</ostype> - </object> - </array> - </object> - </object> - <object class="IBCarbonMenuItem" id="153"> - <string name="title">Window</string> - <object name="submenu" class="IBCarbonMenu" id="154"> - <string name="title">Window</string> - <array count="6" name="items"> - <object class="IBCarbonMenuItem" id="155"> - <boolean name="dynamic">TRUE</boolean> - <boolean name="updateSingleItem">TRUE</boolean> - <string name="title">Minimize Window</string> - <string name="keyEquivalent">m</string> - <ostype name="command">mini</ostype> - </object> - <object class="IBCarbonMenuItem" id="184"> - <boolean name="dynamic">TRUE</boolean> - <boolean name="updateSingleItem">TRUE</boolean> - <string name="title">Minimize All Windows</string> - <string name="keyEquivalent">m</string> - <int name="keyEquivalentModifier">1572864</int> - <ostype name="command">mina</ostype> - </object> - <object class="IBCarbonMenuItem" id="186"> - <boolean name="updateSingleItem">TRUE</boolean> - <string name="title">Zoom</string> - <ostype name="command">zoom</ostype> - </object> - <object class="IBCarbonMenuItem" id="156"> - <boolean name="separator">TRUE</boolean> - </object> - <object class="IBCarbonMenuItem" id="157"> - <boolean name="dynamic">TRUE</boolean> - <boolean name="updateSingleItem">TRUE</boolean> - <string name="title">Bring All to Front</string> - <ostype name="command">bfrt</ostype> - </object> - <object class="IBCarbonMenuItem" id="185"> - <boolean name="dynamic">TRUE</boolean> - <boolean name="updateSingleItem">TRUE</boolean> - <string name="title">Arrange in Front</string> - <int name="keyEquivalentModifier">1572864</int> - <ostype name="command">frnt</ostype> - </object> - </array> - <string name="name">_NSWindowsMenu</string> - </object> - </object> - </array> - <string name="name">_NSMainMenu</string> - </object> - <reference idRef="127"/> - <reference idRef="131"/> - <reference idRef="141"/> - <reference idRef="142"/> - <reference idRef="143"/> - <reference idRef="144"/> - <reference idRef="146"/> - <reference idRef="147"/> - <reference idRef="148"/> - <reference idRef="149"/> - <reference idRef="151"/> - <reference idRef="152"/> - <reference idRef="153"/> - <reference idRef="154"/> - <reference idRef="155"/> - <reference idRef="156"/> - <reference idRef="157"/> - <reference idRef="181"/> - <reference idRef="182"/> - <reference idRef="183"/> - <reference idRef="184"/> - <reference idRef="185"/> - <reference idRef="186"/> - <reference idRef="187"/> - <reference idRef="188"/> - <object class="IBCarbonRootControl" id="190"> - <string name="bounds">0 0 482 694 </string> - <string name="viewFrame">0 0 694 482 </string> - <array count="2" name="subviews"> - <object class="IBCarbonButton" id="192"> - <string name="bounds">442 604 462 674 </string> - <string name="viewFrame">604 442 70 20 </string> - <string name="title">OK</string> - <ostype name="command">ok </ostype> - <object name="layoutInfo" class="IBCarbonHILayoutInfo"> - <int name="bindingBottomKind">2</int> - <int name="bindingRightKind">2</int> - </object> - <int name="buttonType">1</int> - </object> - <object class="IBCarbonScrollView" id="201"> - <string name="bounds">20 20 422 674 </string> - <string name="viewFrame">20 20 654 402 </string> - <array count="1" name="subviews"> - <object class="IBCarbonTextView" id="200"> - <string name="bounds">20 20 422 659 </string> - <string name="viewFrame">0 0 639 402 </string> - <ostype name="controlSignature">text</ostype> - <int name="fontStyle">5</int> - <boolean name="readOnly">TRUE</boolean> - </object> - </array> - <boolean name="scrollHorizontally">FALSE</boolean> - </object> - </array> - </object> - <object class="IBCarbonWindow" id="191"> - <string name="windowRect">84 72 566 766 </string> - <string name="title">Release Notes</string> - <reference name="rootControl" idRef="190"/> - <boolean name="receiveUpdates">FALSE</boolean> - <boolean name="hasCloseBox">FALSE</boolean> - <boolean name="hasCollapseBox">FALSE</boolean> - <boolean name="hasHorizontalZoom">FALSE</boolean> - <boolean name="isResizable">FALSE</boolean> - <boolean name="hasVerticalZoom">FALSE</boolean> - <boolean name="liveResize">TRUE</boolean> - <boolean name="compositing">TRUE</boolean> - <int name="carbonWindowClass">4</int> - <int name="windowPosition">1</int> - <boolean name="isConstrained">FALSE</boolean> - </object> - <reference idRef="192"/> - <reference idRef="200"/> - <reference idRef="201"/> - </array> - <array count="31" name="allParents"> - <reference idRef="1"/> - <reference idRef="29"/> - <reference idRef="127"/> - <reference idRef="147"/> - <reference idRef="147"/> - <reference idRef="147"/> - <reference idRef="147"/> - <reference idRef="147"/> - <reference idRef="152"/> - <reference idRef="147"/> - <reference idRef="147"/> - <reference idRef="147"/> - <reference idRef="29"/> - <reference idRef="29"/> - <reference idRef="153"/> - <reference idRef="154"/> - <reference idRef="154"/> - <reference idRef="154"/> - <reference idRef="182"/> - <reference idRef="29"/> - <reference idRef="181"/> - <reference idRef="154"/> - <reference idRef="154"/> - <reference idRef="154"/> - <reference idRef="147"/> - <reference idRef="147"/> - <reference idRef="191"/> - <reference idRef="1"/> - <reference idRef="190"/> - <reference idRef="201"/> - <reference idRef="190"/> - </array> - <dictionary count="3" name="nameTable"> - <string>Files Owner</string> - <reference idRef="1"/> - <string>MenuBar</string> - <reference idRef="29"/> - <string>Release Notes</string> - <reference idRef="191"/> - </dictionary> - <unsigned_int name="nextObjectID">202</unsigned_int> -</object> diff --git a/indra/newview/SecondLife.xib b/indra/newview/SecondLife.xib new file mode 100644 index 0000000000..370df6bf5f --- /dev/null +++ b/indra/newview/SecondLife.xib @@ -0,0 +1,1136 @@ +<?xml version="1.0" encoding="UTF-8"?> +<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="8.00"> + <data> + <int key="IBDocument.SystemTarget">1060</int> + <string key="IBDocument.SystemVersion">12E55</string> + <string key="IBDocument.InterfaceBuilderVersion">4457.6</string> + <string key="IBDocument.AppKitVersion">1187.39</string> + <string key="IBDocument.HIToolboxVersion">626.00</string> + <object class="NSMutableDictionary" key="IBDocument.PluginVersions"> + <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="NS.object.0">4457.6</string> + </object> + <array key="IBDocument.IntegratedClassDependencies"> + <string>NSCustomObject</string> + <string>NSMenu</string> + <string>NSMenuItem</string> + <string>NSScrollView</string> + <string>NSScroller</string> + <string>NSTextView</string> + <string>NSView</string> + <string>NSWindowTemplate</string> + </array> + <array key="IBDocument.PluginDependencies"> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + </array> + <object class="NSMutableDictionary" key="IBDocument.Metadata"> + <string key="NS.key.0">PluginDependencyRecalculationVersion</string> + <integer value="1" key="NS.object.0"/> + </object> + <array class="NSMutableArray" key="IBDocument.RootObjects" id="1048"> + <object class="NSCustomObject" id="1021"> + <string key="NSClassName">NSApplication</string> + </object> + <object class="NSCustomObject" id="1014"> + <string key="NSClassName">FirstResponder</string> + </object> + <object class="NSCustomObject" id="1050"> + <string key="NSClassName">NSApplication</string> + </object> + <object class="NSMenu" id="649796088"> + <string key="NSTitle">Main Menu</string> + <array class="NSMutableArray" key="NSMenuItems"> + <object class="NSMenuItem" id="694149608"> + <reference key="NSMenu" ref="649796088"/> + <string key="NSTitle">Second Life</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <object class="NSCustomResource" key="NSOnImage" id="353210768"> + <string key="NSClassName">NSImage</string> + <string key="NSResourceName">NSMenuCheckmark</string> + </object> + <object class="NSCustomResource" key="NSMixedImage" id="549394948"> + <string key="NSClassName">NSImage</string> + <string key="NSResourceName">NSMenuMixedState</string> + </object> + <string key="NSAction">submenuAction:</string> + <object class="NSMenu" key="NSSubmenu" id="110575045"> + <string key="NSTitle">Second Life</string> + <array class="NSMutableArray" key="NSMenuItems"> + <object class="NSMenuItem" id="238522557"> + <reference key="NSMenu" ref="110575045"/> + <string key="NSTitle">About Second Life</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="353210768"/> + <reference key="NSMixedImage" ref="549394948"/> + </object> + <object class="NSMenuItem" id="304266470"> + <reference key="NSMenu" ref="110575045"/> + <bool key="NSIsDisabled">YES</bool> + <bool key="NSIsSeparator">YES</bool> + <string key="NSTitle"/> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="353210768"/> + <reference key="NSMixedImage" ref="549394948"/> + </object> + <object class="NSMenuItem" id="609285721"> + <reference key="NSMenu" ref="110575045"/> + <string key="NSTitle">Preferences…</string> + <string key="NSKeyEquiv">,</string> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="353210768"/> + <reference key="NSMixedImage" ref="549394948"/> + </object> + <object class="NSMenuItem" id="481834944"> + <reference key="NSMenu" ref="110575045"/> + <bool key="NSIsDisabled">YES</bool> + <bool key="NSIsSeparator">YES</bool> + <string key="NSTitle"/> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="353210768"/> + <reference key="NSMixedImage" ref="549394948"/> + </object> + <object class="NSMenuItem" id="1046388886"> + <reference key="NSMenu" ref="110575045"/> + <string key="NSTitle">Services</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="353210768"/> + <reference key="NSMixedImage" ref="549394948"/> + <string key="NSAction">submenuAction:</string> + <object class="NSMenu" key="NSSubmenu" id="752062318"> + <string key="NSTitle">Services</string> + <array class="NSMutableArray" key="NSMenuItems"/> + <string key="NSName">_NSServicesMenu</string> + </object> + </object> + <object class="NSMenuItem" id="646227648"> + <reference key="NSMenu" ref="110575045"/> + <bool key="NSIsDisabled">YES</bool> + <bool key="NSIsSeparator">YES</bool> + <string key="NSTitle"/> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="353210768"/> + <reference key="NSMixedImage" ref="549394948"/> + </object> + <object class="NSMenuItem" id="755159360"> + <reference key="NSMenu" ref="110575045"/> + <string key="NSTitle">Hide NewApplication</string> + <string key="NSKeyEquiv">h</string> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="353210768"/> + <reference key="NSMixedImage" ref="549394948"/> + </object> + <object class="NSMenuItem" id="342932134"> + <reference key="NSMenu" ref="110575045"/> + <string key="NSTitle">Hide Others</string> + <string key="NSKeyEquiv">h</string> + <int key="NSKeyEquivModMask">1572864</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="353210768"/> + <reference key="NSMixedImage" ref="549394948"/> + </object> + <object class="NSMenuItem" id="908899353"> + <reference key="NSMenu" ref="110575045"/> + <string key="NSTitle">Show All</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="353210768"/> + <reference key="NSMixedImage" ref="549394948"/> + </object> + <object class="NSMenuItem" id="1056857174"> + <reference key="NSMenu" ref="110575045"/> + <bool key="NSIsDisabled">YES</bool> + <bool key="NSIsSeparator">YES</bool> + <string key="NSTitle"/> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="353210768"/> + <reference key="NSMixedImage" ref="549394948"/> + </object> + <object class="NSMenuItem" id="632727374"> + <reference key="NSMenu" ref="110575045"/> + <string key="NSTitle">Quit Second Life</string> + <string key="NSKeyEquiv">q</string> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="353210768"/> + <reference key="NSMixedImage" ref="549394948"/> + </object> + </array> + <string key="NSName">_NSAppleMenu</string> + </object> + </object> + <object class="NSMenuItem" id="725688984"> + <reference key="NSMenu" ref="649796088"/> + <string key="NSTitle">Edit</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="353210768"/> + <reference key="NSMixedImage" ref="549394948"/> + <string key="NSAction">submenuAction:</string> + <object class="NSMenu" key="NSSubmenu" id="701759256"> + <string key="NSTitle">Edit</string> + <array class="NSMutableArray" key="NSMenuItems"> + <object class="NSMenuItem" id="521487141"> + <reference key="NSMenu" ref="701759256"/> + <string key="NSTitle">Undo</string> + <string key="NSKeyEquiv">z</string> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="353210768"/> + <reference key="NSMixedImage" ref="549394948"/> + </object> + <object class="NSMenuItem" id="668936019"> + <reference key="NSMenu" ref="701759256"/> + <string key="NSTitle">Redo</string> + <string key="NSKeyEquiv">Z</string> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="353210768"/> + <reference key="NSMixedImage" ref="549394948"/> + </object> + <object class="NSMenuItem" id="383018193"> + <reference key="NSMenu" ref="701759256"/> + <bool key="NSIsDisabled">YES</bool> + <bool key="NSIsSeparator">YES</bool> + <string key="NSTitle"/> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="353210768"/> + <reference key="NSMixedImage" ref="549394948"/> + </object> + <object class="NSMenuItem" id="984623395"> + <reference key="NSMenu" ref="701759256"/> + <string key="NSTitle">Cut</string> + <string key="NSKeyEquiv">x</string> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="353210768"/> + <reference key="NSMixedImage" ref="549394948"/> + </object> + <object class="NSMenuItem" id="656529582"> + <reference key="NSMenu" ref="701759256"/> + <string key="NSTitle">Copy</string> + <string key="NSKeyEquiv">c</string> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="353210768"/> + <reference key="NSMixedImage" ref="549394948"/> + </object> + <object class="NSMenuItem" id="1032676691"> + <reference key="NSMenu" ref="701759256"/> + <string key="NSTitle">Paste</string> + <string key="NSKeyEquiv">v</string> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="353210768"/> + <reference key="NSMixedImage" ref="549394948"/> + </object> + <object class="NSMenuItem" id="538907583"> + <reference key="NSMenu" ref="701759256"/> + <string key="NSTitle">Select All</string> + <string key="NSKeyEquiv">a</string> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="353210768"/> + <reference key="NSMixedImage" ref="549394948"/> + </object> + </array> + </object> + </object> + <object class="NSMenuItem" id="713487014"> + <reference key="NSMenu" ref="649796088"/> + <string key="NSTitle">Window</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="353210768"/> + <reference key="NSMixedImage" ref="549394948"/> + <string key="NSAction">submenuAction:</string> + <object class="NSMenu" key="NSSubmenu" id="835318025"> + <string key="NSTitle">Window</string> + <array class="NSMutableArray" key="NSMenuItems"> + <object class="NSMenuItem" id="1011231497"> + <reference key="NSMenu" ref="835318025"/> + <string key="NSTitle">Minimize</string> + <string key="NSKeyEquiv">m</string> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="353210768"/> + <reference key="NSMixedImage" ref="549394948"/> + </object> + <object class="NSMenuItem" id="575023229"> + <reference key="NSMenu" ref="835318025"/> + <string key="NSTitle">Zoom</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="353210768"/> + <reference key="NSMixedImage" ref="549394948"/> + </object> + <object class="NSMenuItem" id="86356408"> + <reference key="NSMenu" ref="835318025"/> + <string key="NSTitle">Enter Full Screen</string> + <string key="NSKeyEquiv">f</string> + <int key="NSKeyEquivModMask">1310720</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="353210768"/> + <reference key="NSMixedImage" ref="549394948"/> + </object> + <object class="NSMenuItem" id="299356726"> + <reference key="NSMenu" ref="835318025"/> + <bool key="NSIsDisabled">YES</bool> + <bool key="NSIsSeparator">YES</bool> + <string key="NSTitle"/> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="353210768"/> + <reference key="NSMixedImage" ref="549394948"/> + </object> + <object class="NSMenuItem" id="625202149"> + <reference key="NSMenu" ref="835318025"/> + <string key="NSTitle">Bring All to Front</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="353210768"/> + <reference key="NSMixedImage" ref="549394948"/> + </object> + </array> + <string key="NSName">_NSWindowsMenu</string> + </object> + </object> + <object class="NSMenuItem" id="391199113"> + <reference key="NSMenu" ref="649796088"/> + <string key="NSTitle">Help</string> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="353210768"/> + <reference key="NSMixedImage" ref="549394948"/> + </object> + </array> + <string key="NSName">_NSMainMenu</string> + </object> + <object class="NSCustomObject" id="756173070"> + <string key="NSClassName">LLAppDelegate</string> + </object> + <object class="NSWindowTemplate" id="110292814"> + <int key="NSWindowStyleMask">15</int> + <int key="NSWindowBacking">2</int> + <string key="NSWindowRect">{{196, 240}, {1024, 600}}</string> + <int key="NSWTFlags">74974208</int> + <string key="NSWindowTitle">Second Life</string> + <string key="NSWindowClass">LLNSWindow</string> + <nil key="NSViewClass"/> + <nil key="NSUserInterfaceItemIdentifier"/> + <object class="NSView" key="NSWindowView" id="305280978"> + <reference key="NSNextResponder"/> + <int key="NSvFlags">256</int> + <array class="NSMutableArray" key="NSSubviews"/> + <string key="NSFrameSize">{1024, 600}</string> + <reference key="NSSuperview"/> + <reference key="NSWindow"/> + <string key="NSReuseIdentifierKey">_NS:20</string> + </object> + <string key="NSScreenRect">{{0, 0}, {2560, 1418}}</string> + <string key="NSMaxSize">{10000000000000, 10000000000000}</string> + <string key="NSFrameAutosaveName">Second Life</string> + <int key="NSWindowCollectionBehavior">128</int> + <bool key="NSWindowIsRestorable">YES</bool> + </object> + <object class="NSWindowTemplate" id="979091056"> + <int key="NSWindowStyleMask">31</int> + <int key="NSWindowBacking">2</int> + <string key="NSWindowRect">{{272, 176}, {938, 42}}</string> + <int key="NSWTFlags">-1535638528</int> + <string key="NSWindowTitle">Input Window</string> + <string key="NSWindowClass">LLUserInputWindow</string> + <nil key="NSViewClass"/> + <nil key="NSUserInterfaceItemIdentifier"/> + <object class="NSView" key="NSWindowView" id="1044753903"> + <reference key="NSNextResponder"/> + <int key="NSvFlags">256</int> + <array class="NSMutableArray" key="NSSubviews"> + <object class="NSScrollView" id="238626476"> + <reference key="NSNextResponder" ref="1044753903"/> + <int key="NSvFlags">256</int> + <array class="NSMutableArray" key="NSSubviews"> + <object class="NSClipView" id="871543330"> + <reference key="NSNextResponder" ref="238626476"/> + <int key="NSvFlags">2322</int> + <array class="NSMutableArray" key="NSSubviews"> + <object class="NSTextView" id="395788163"> + <reference key="NSNextResponder" ref="871543330"/> + <int key="NSvFlags">2322</int> + <set class="NSMutableSet" key="NSDragTypes"> + <string>Apple HTML pasteboard type</string> + <string>Apple PDF pasteboard type</string> + <string>Apple PICT pasteboard type</string> + <string>Apple PNG pasteboard type</string> + <string>Apple URL pasteboard type</string> + <string>CorePasteboardFlavorType 0x6D6F6F76</string> + <string>NSColor pasteboard type</string> + <string>NSFilenamesPboardType</string> + <string>NSStringPboardType</string> + <string>NeXT Encapsulated PostScript v1.2 pasteboard type</string> + <string>NeXT RTFD pasteboard type</string> + <string>NeXT Rich Text Format v1.0 pasteboard type</string> + <string>NeXT TIFF v4.0 pasteboard type</string> + <string>NeXT font pasteboard type</string> + <string>NeXT ruler pasteboard type</string> + <string>WebURLsWithTitlesPboardType</string> + <string>public.url</string> + </set> + <string key="NSFrameSize">{938, 42}</string> + <reference key="NSSuperview" ref="871543330"/> + <reference key="NSWindow"/> + <reference key="NSNextKeyView" ref="339833963"/> + <string key="NSReuseIdentifierKey">_NS:13</string> + <object class="NSTextContainer" key="NSTextContainer" id="648552009"> + <object class="NSLayoutManager" key="NSLayoutManager"> + <object class="NSTextStorage" key="NSTextStorage"> + <object class="NSMutableString" key="NSString"> + <characters key="NS.bytes"/> + </object> + <nil key="NSDelegate"/> + </object> + <array class="NSMutableArray" key="NSTextContainers"> + <reference ref="648552009"/> + </array> + <int key="NSLMFlags">166</int> + <nil key="NSDelegate"/> + </object> + <reference key="NSTextView" ref="395788163"/> + <double key="NSWidth">938</double> + <int key="NSTCFlags">1</int> + </object> + <object class="NSTextViewSharedData" key="NSSharedData"> + <int key="NSFlags">67121127</int> + <int key="NSTextCheckingTypes">0</int> + <nil key="NSMarkedAttributes"/> + <object class="NSColor" key="NSBackgroundColor" id="535647664"> + <int key="NSColorSpace">3</int> + <bytes key="NSWhite">MQA</bytes> + </object> + <dictionary key="NSSelectedAttributes"> + <object class="NSColor" key="NSBackgroundColor"> + <int key="NSColorSpace">6</int> + <string key="NSCatalogName">System</string> + <string key="NSColorName">selectedTextBackgroundColor</string> + <object class="NSColor" key="NSColor"> + <int key="NSColorSpace">3</int> + <bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes> + </object> + </object> + <object class="NSColor" key="NSColor"> + <int key="NSColorSpace">6</int> + <string key="NSCatalogName">System</string> + <string key="NSColorName">selectedTextColor</string> + <object class="NSColor" key="NSColor" id="835883401"> + <int key="NSColorSpace">3</int> + <bytes key="NSWhite">MAA</bytes> + </object> + </object> + </dictionary> + <reference key="NSInsertionColor" ref="835883401"/> + <dictionary key="NSLinkAttributes"> + <object class="NSColor" key="NSColor"> + <int key="NSColorSpace">1</int> + <bytes key="NSRGB">MCAwIDEAA</bytes> + </object> + <object class="NSCursor" key="NSCursor"> + <string key="NSHotSpot">{8, -8}</string> + <int key="NSCursorType">13</int> + </object> + <integer value="1" key="NSUnderline"/> + </dictionary> + <nil key="NSDefaultParagraphStyle"/> + <nil key="NSTextFinder"/> + <int key="NSPreferredTextFinderStyle">1</int> + </object> + <int key="NSTVFlags">6</int> + <string key="NSMaxSize">{939, 10000000}</string> + <nil key="NSDelegate"/> + </object> + </array> + <string key="NSFrame">{{1, 1}, {938, 42}}</string> + <reference key="NSSuperview" ref="238626476"/> + <reference key="NSWindow"/> + <reference key="NSNextKeyView" ref="395788163"/> + <string key="NSReuseIdentifierKey">_NS:11</string> + <reference key="NSDocView" ref="395788163"/> + <reference key="NSBGColor" ref="535647664"/> + <object class="NSCursor" key="NSCursor"> + <string key="NSHotSpot">{4, 5}</string> + <object class="NSImage" key="NSImage"> + <int key="NSImageFlags">79691776</int> + <array key="NSReps"> + <array> + <integer value="5"/> + <object class="NSURL"> + <nil key="NS.base"/> + <string key="NS.relative">file://localhost/Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework/Resources/DVTIbeamCursor.tiff</string> + </object> + </array> + </array> + <object class="NSColor" key="NSColor"> + <int key="NSColorSpace">3</int> + <bytes key="NSWhite">MCAwAA</bytes> + </object> + </object> + </object> + <int key="NScvFlags">4</int> + </object> + <object class="NSScroller" id="339833963"> + <reference key="NSNextResponder" ref="238626476"/> + <int key="NSvFlags">256</int> + <string key="NSFrame">{{923, 1}, {16, 42}}</string> + <reference key="NSSuperview" ref="238626476"/> + <reference key="NSWindow"/> + <reference key="NSNextKeyView"/> + <string key="NSReuseIdentifierKey">_NS:83</string> + <bool key="NSAllowsLogicalLayoutDirection">NO</bool> + <reference key="NSTarget" ref="238626476"/> + <string key="NSAction">_doScroller:</string> + <double key="NSPercent">0.96666666666666667</double> + </object> + <object class="NSScroller" id="1067057765"> + <reference key="NSNextResponder" ref="238626476"/> + <int key="NSvFlags">-2147483392</int> + <string key="NSFrame">{{-100, -100}, {87, 18}}</string> + <reference key="NSSuperview" ref="238626476"/> + <reference key="NSWindow"/> + <reference key="NSNextKeyView" ref="871543330"/> + <string key="NSReuseIdentifierKey">_NS:33</string> + <bool key="NSAllowsLogicalLayoutDirection">NO</bool> + <int key="NSsFlags">1</int> + <reference key="NSTarget" ref="238626476"/> + <string key="NSAction">_doScroller:</string> + <double key="NSCurValue">1</double> + <double key="NSPercent">0.94565218687057495</double> + </object> + </array> + <string key="NSFrame">{{-1, -1}, {940, 44}}</string> + <reference key="NSSuperview" ref="1044753903"/> + <reference key="NSWindow"/> + <reference key="NSNextKeyView" ref="1067057765"/> + <string key="NSReuseIdentifierKey">_NS:9</string> + <int key="NSsFlags">133138</int> + <reference key="NSVScroller" ref="339833963"/> + <reference key="NSHScroller" ref="1067057765"/> + <reference key="NSContentView" ref="871543330"/> + <double key="NSMinMagnification">0.25</double> + <double key="NSMaxMagnification">4</double> + <double key="NSMagnification">1</double> + </object> + </array> + <string key="NSFrameSize">{938, 42}</string> + <reference key="NSSuperview"/> + <reference key="NSWindow"/> + <reference key="NSNextKeyView" ref="238626476"/> + <string key="NSReuseIdentifierKey">_NS:21</string> + </object> + <string key="NSScreenRect">{{0, 0}, {2560, 1418}}</string> + <string key="NSMaxSize">{10000000000000, 10000000000000}</string> + <bool key="NSWindowIsRestorable">YES</bool> + </object> + </array> + <object class="IBObjectContainer" key="IBDocument.Objects"> + <array class="NSMutableArray" key="connectionRecords"> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">terminate:</string> + <reference key="source" ref="1050"/> + <reference key="destination" ref="632727374"/> + </object> + <int key="connectionID">823</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">orderFrontStandardAboutPanel:</string> + <reference key="source" ref="1021"/> + <reference key="destination" ref="238522557"/> + </object> + <int key="connectionID">142</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">delegate</string> + <reference key="source" ref="1021"/> + <reference key="destination" ref="756173070"/> + </object> + <int key="connectionID">845</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">performMiniaturize:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="1011231497"/> + </object> + <int key="connectionID">37</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">arrangeInFront:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="625202149"/> + </object> + <int key="connectionID">39</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">performZoom:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="575023229"/> + </object> + <int key="connectionID">240</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">hide:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="755159360"/> + </object> + <int key="connectionID">369</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">hideOtherApplications:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="342932134"/> + </object> + <int key="connectionID">370</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">unhideAllApplications:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="908899353"/> + </object> + <int key="connectionID">372</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">cut:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="984623395"/> + </object> + <int key="connectionID">768</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">paste:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="1032676691"/> + </object> + <int key="connectionID">769</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">undo:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="521487141"/> + </object> + <int key="connectionID">776</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">copy:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="656529582"/> + </object> + <int key="connectionID">782</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">selectAll:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="538907583"/> + </object> + <int key="connectionID">785</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">toggleFullScreen:</string> + <reference key="source" ref="1014"/> + <reference key="destination" ref="86356408"/> + </object> + <int key="connectionID">842</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">window</string> + <reference key="source" ref="756173070"/> + <reference key="destination" ref="110292814"/> + </object> + <int key="connectionID">850</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">inputWindow</string> + <reference key="source" ref="756173070"/> + <reference key="destination" ref="979091056"/> + </object> + <int key="connectionID">953</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">inputView</string> + <reference key="source" ref="756173070"/> + <reference key="destination" ref="395788163"/> + </object> + <int key="connectionID">954</int> + </object> + </array> + <object class="IBMutableOrderedSet" key="objectRecords"> + <array key="orderedObjects"> + <object class="IBObjectRecord"> + <int key="objectID">0</int> + <array key="object" id="0"/> + <reference key="children" ref="1048"/> + <nil key="parent"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">-2</int> + <reference key="object" ref="1021"/> + <reference key="parent" ref="0"/> + <string key="objectName">File's Owner</string> + </object> + <object class="IBObjectRecord"> + <int key="objectID">-1</int> + <reference key="object" ref="1014"/> + <reference key="parent" ref="0"/> + <string key="objectName">First Responder</string> + </object> + <object class="IBObjectRecord"> + <int key="objectID">-3</int> + <reference key="object" ref="1050"/> + <reference key="parent" ref="0"/> + <string key="objectName">Application</string> + </object> + <object class="IBObjectRecord"> + <int key="objectID">29</int> + <reference key="object" ref="649796088"/> + <array class="NSMutableArray" key="children"> + <reference ref="713487014"/> + <reference ref="694149608"/> + <reference ref="391199113"/> + <reference ref="725688984"/> + </array> + <reference key="parent" ref="0"/> + <string key="objectName">Main Menu</string> + </object> + <object class="IBObjectRecord"> + <int key="objectID">19</int> + <reference key="object" ref="713487014"/> + <array class="NSMutableArray" key="children"> + <reference ref="835318025"/> + </array> + <reference key="parent" ref="649796088"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">56</int> + <reference key="object" ref="694149608"/> + <array class="NSMutableArray" key="children"> + <reference ref="110575045"/> + </array> + <reference key="parent" ref="649796088"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">103</int> + <reference key="object" ref="391199113"/> + <array class="NSMutableArray" key="children"/> + <reference key="parent" ref="649796088"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">57</int> + <reference key="object" ref="110575045"/> + <array class="NSMutableArray" key="children"> + <reference ref="238522557"/> + <reference ref="755159360"/> + <reference ref="908899353"/> + <reference ref="632727374"/> + <reference ref="646227648"/> + <reference ref="609285721"/> + <reference ref="481834944"/> + <reference ref="304266470"/> + <reference ref="1046388886"/> + <reference ref="1056857174"/> + <reference ref="342932134"/> + </array> + <reference key="parent" ref="694149608"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">58</int> + <reference key="object" ref="238522557"/> + <reference key="parent" ref="110575045"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">134</int> + <reference key="object" ref="755159360"/> + <reference key="parent" ref="110575045"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">150</int> + <reference key="object" ref="908899353"/> + <reference key="parent" ref="110575045"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">136</int> + <reference key="object" ref="632727374"/> + <reference key="parent" ref="110575045"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">144</int> + <reference key="object" ref="646227648"/> + <reference key="parent" ref="110575045"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">129</int> + <reference key="object" ref="609285721"/> + <reference key="parent" ref="110575045"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">143</int> + <reference key="object" ref="481834944"/> + <reference key="parent" ref="110575045"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">236</int> + <reference key="object" ref="304266470"/> + <reference key="parent" ref="110575045"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">131</int> + <reference key="object" ref="1046388886"/> + <array class="NSMutableArray" key="children"> + <reference ref="752062318"/> + </array> + <reference key="parent" ref="110575045"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">149</int> + <reference key="object" ref="1056857174"/> + <reference key="parent" ref="110575045"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">145</int> + <reference key="object" ref="342932134"/> + <reference key="parent" ref="110575045"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">130</int> + <reference key="object" ref="752062318"/> + <reference key="parent" ref="1046388886"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">24</int> + <reference key="object" ref="835318025"/> + <array class="NSMutableArray" key="children"> + <reference ref="299356726"/> + <reference ref="625202149"/> + <reference ref="575023229"/> + <reference ref="1011231497"/> + <reference ref="86356408"/> + </array> + <reference key="parent" ref="713487014"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">92</int> + <reference key="object" ref="299356726"/> + <reference key="parent" ref="835318025"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">5</int> + <reference key="object" ref="625202149"/> + <reference key="parent" ref="835318025"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">239</int> + <reference key="object" ref="575023229"/> + <reference key="parent" ref="835318025"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">23</int> + <reference key="object" ref="1011231497"/> + <reference key="parent" ref="835318025"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">711</int> + <reference key="object" ref="725688984"/> + <array class="NSMutableArray" key="children"> + <reference ref="701759256"/> + </array> + <reference key="parent" ref="649796088"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">712</int> + <reference key="object" ref="701759256"/> + <array class="NSMutableArray" key="children"> + <reference ref="521487141"/> + <reference ref="668936019"/> + <reference ref="383018193"/> + <reference ref="984623395"/> + <reference ref="656529582"/> + <reference ref="1032676691"/> + <reference ref="538907583"/> + </array> + <reference key="parent" ref="725688984"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">716</int> + <reference key="object" ref="984623395"/> + <reference key="parent" ref="701759256"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">717</int> + <reference key="object" ref="656529582"/> + <reference key="parent" ref="701759256"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">718</int> + <reference key="object" ref="1032676691"/> + <reference key="parent" ref="701759256"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">721</int> + <reference key="object" ref="538907583"/> + <reference key="parent" ref="701759256"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">824</int> + <reference key="object" ref="756173070"/> + <reference key="parent" ref="0"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">841</int> + <reference key="object" ref="86356408"/> + <reference key="parent" ref="835318025"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">828</int> + <reference key="object" ref="110292814"/> + <array class="NSMutableArray" key="children"> + <reference ref="305280978"/> + </array> + <reference key="parent" ref="0"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">829</int> + <reference key="object" ref="305280978"/> + <array class="NSMutableArray" key="children"/> + <reference key="parent" ref="110292814"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">713</int> + <reference key="object" ref="521487141"/> + <reference key="parent" ref="701759256"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">714</int> + <reference key="object" ref="668936019"/> + <reference key="parent" ref="701759256"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">715</int> + <reference key="object" ref="383018193"/> + <reference key="parent" ref="701759256"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">941</int> + <reference key="object" ref="979091056"/> + <array class="NSMutableArray" key="children"> + <reference ref="1044753903"/> + </array> + <reference key="parent" ref="0"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">942</int> + <reference key="object" ref="1044753903"/> + <array class="NSMutableArray" key="children"> + <reference ref="238626476"/> + </array> + <reference key="parent" ref="979091056"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">943</int> + <reference key="object" ref="238626476"/> + <array class="NSMutableArray" key="children"> + <reference ref="395788163"/> + <reference ref="1067057765"/> + <reference ref="339833963"/> + </array> + <reference key="parent" ref="1044753903"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">944</int> + <reference key="object" ref="395788163"/> + <reference key="parent" ref="238626476"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">945</int> + <reference key="object" ref="1067057765"/> + <reference key="parent" ref="238626476"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">946</int> + <reference key="object" ref="339833963"/> + <reference key="parent" ref="238626476"/> + </object> + </array> + </object> + <dictionary class="NSMutableDictionary" key="flattenedProperties"> + <string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="-3.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="103.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="129.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="130.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="131.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="134.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="136.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="143.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="144.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="145.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="149.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="150.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="19.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="23.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="236.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="239.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="24.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="29.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="5.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="56.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="57.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="58.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="711.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="712.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="713.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="714.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="715.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="716.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="717.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="718.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="721.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="824.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <boolean value="YES" key="828.IBNSWindowAutoPositionCentersHorizontal"/> + <boolean value="YES" key="828.IBNSWindowAutoPositionCentersVertical"/> + <string key="828.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <boolean value="YES" key="828.NSWindowTemplate.visibleAtLaunch"/> + <string key="829.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="841.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="92.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="941.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <boolean value="NO" key="941.NSWindowTemplate.visibleAtLaunch"/> + <string key="942.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="943.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="944.CustomClassName">LLNonInlineTextView</string> + <string key="944.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="945.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + <string key="946.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string> + </dictionary> + <dictionary class="NSMutableDictionary" key="unlocalizedProperties"/> + <nil key="activeLocalization"/> + <dictionary class="NSMutableDictionary" key="localizations"/> + <nil key="sourceID"/> + <int key="maxID">954</int> + </object> + <object class="IBClassDescriber" key="IBDocument.Classes"> + <array class="NSMutableArray" key="referencedPartialClassDescriptions"> + <object class="IBPartialClassDescription"> + <string key="className">LLAppDelegate</string> + <string key="superclassName">NSObject</string> + <dictionary class="NSMutableDictionary" key="outlets"> + <string key="inputView">LLNonInlineTextView</string> + <string key="inputWindow">NSWindow</string> + <string key="window">LLNSWindow</string> + </dictionary> + <dictionary class="NSMutableDictionary" key="toOneOutletInfosByName"> + <object class="IBToOneOutletInfo" key="inputView"> + <string key="name">inputView</string> + <string key="candidateClassName">LLNonInlineTextView</string> + </object> + <object class="IBToOneOutletInfo" key="inputWindow"> + <string key="name">inputWindow</string> + <string key="candidateClassName">NSWindow</string> + </object> + <object class="IBToOneOutletInfo" key="window"> + <string key="name">window</string> + <string key="candidateClassName">LLNSWindow</string> + </object> + </dictionary> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/LLAppDelegate.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">LLNSWindow</string> + <string key="superclassName">NSWindow</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/LLNSWindow.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">LLNonInlineTextView</string> + <string key="superclassName">NSTextView</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/LLNonInlineTextView.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">LLUserInputWindow</string> + <string key="superclassName">NSPanel</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/LLUserInputWindow.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSTextView</string> + <dictionary class="NSMutableDictionary" key="actions"> + <string key="orderFrontSharingServicePicker:">id</string> + <string key="toggleQuickLookPreviewPanel:">id</string> + </dictionary> + <dictionary class="NSMutableDictionary" key="actionInfosByName"> + <object class="IBActionInfo" key="orderFrontSharingServicePicker:"> + <string key="name">orderFrontSharingServicePicker:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo" key="toggleQuickLookPreviewPanel:"> + <string key="name">toggleQuickLookPreviewPanel:</string> + <string key="candidateClassName">id</string> + </object> + </dictionary> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/NSTextView.h</string> + </object> + </object> + </array> + </object> + <int key="IBDocument.localizationMode">0</int> + <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string> + <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies"> + <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string> + <real value="1060" key="NS.object.0"/> + </object> + <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies"> + <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string> + <integer value="4600" key="NS.object.0"/> + </object> + <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool> + <int key="IBDocument.defaultPropertyAccessControl">3</int> + <dictionary class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes"> + <string key="NSMenuCheckmark">{11, 11}</string> + <string key="NSMenuMixedState">{10, 3}</string> + </dictionary> + </data> +</archive> diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt index 9575d51bad..424e1794de 100644 --- a/indra/newview/VIEWER_VERSION.txt +++ b/indra/newview/VIEWER_VERSION.txt @@ -1 +1 @@ -3.6.1 +3.6.8 diff --git a/indra/newview/app_settings/cmd_line.xml b/indra/newview/app_settings/cmd_line.xml index 7ab7787d77..a9f6079630 100755 --- a/indra/newview/app_settings/cmd_line.xml +++ b/indra/newview/app_settings/cmd_line.xml @@ -22,7 +22,8 @@ <map> <key>count</key> <integer>1</integer> - <!-- Special case. Not mapped to a setting. --> + <key>map-to</key> + <string>CmdLineChannel</string> </map> <key>console</key> @@ -96,6 +97,8 @@ 0 - low, 1 - medium, 2 - high, 3 - ultra</string> <key>count</key> <integer>1</integer> + <key>map-to</key> + <string>RenderQualityPerformance</string> </map> <key>grid</key> @@ -108,6 +111,16 @@ <string>CmdLineGridChoice</string> </map> + <key>update-service</key> + <map> + <key>desc</key> + <string>Override the url base for the update query.</string> + <key>count</key> + <integer>1</integer> + <key>map-to</key> + <string>CmdLineUpdateService</string> + </map> + <key>help</key> <map> <key>desc</key> @@ -370,7 +383,8 @@ <boolean>true</boolean> <key>last_option</key> <boolean>true</boolean> - <!-- Special case. Not mapped to a setting. --> + <key>map-to</key> + <string>CmdLineLoginLocation</string> </map> <key>url</key> @@ -381,7 +395,8 @@ <integer>1</integer> <key>last_option</key> <boolean>true</boolean> - <!-- Special case. Not mapped to a setting. --> + <key>map-to</key> + <string>CmdLineLoginLocation</string> </map> <key>usersessionsettings</key> diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 12ca902c59..eeed12499d 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -126,6 +126,17 @@ <key>Value</key> <integer>1</integer> </map> + <key>AnalyzePerformance</key> + <map> + <key>Comment</key> + <string>Request performance analysis for a particular viewer run</string> + <key>Persist</key> + <integer>0</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> <key>AnimateTextures</key> <map> <key>Comment</key> @@ -1738,6 +1749,17 @@ <key>Value</key> <integer>0</integer> </map> + <key>CmdLineChannel</key> + <map> + <key>Comment</key> + <string>Command line specified channel name</string> + <key>Persist</key> + <integer>0</integer> + <key>Type</key> + <string>String</string> + <key>Value</key> + <string /> + </map> <key>CmdLineDisableVoice</key> <map> <key>Comment</key> @@ -1760,6 +1782,17 @@ <key>Value</key> <string /> </map> + <key>CmdLineUpdateService</key> + <map> + <key>Comment</key> + <string>Override the url base for the update query.</string> + <key>Persist</key> + <integer>0</integer> + <key>Type</key> + <string>String</string> + <key>Value</key> + <string /> + </map> <key>CmdLineHelperURI</key> <map> <key>Comment</key> @@ -1784,6 +1817,17 @@ <string /> </array> </map> + <key>CmdLineLoginLocation</key> + <map> + <key>Comment</key> + <string>Startup destination requested on command line</string> + <key>Persist</key> + <integer>0</integer> + <key>Type</key> + <string>String</string> + <key>Value</key> + <string/> + </map> <key>ConnectAsGod</key> <map> <key>Comment</key> @@ -1916,6 +1960,17 @@ <key>Value</key> <integer>262144</integer> </map> + <key>CrashOnStartup</key> + <map> + <key>Comment</key> + <string>User-requested crash on viewer startup</string> + <key>Persist</key> + <integer>0</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> <key>CreateToolCopyCenters</key> <map> <key>Comment</key> @@ -2158,6 +2213,28 @@ <key>Value</key> <integer>0</integer> </map> + <key>DebugSession</key> + <map> + <key>Comment</key> + <string>Request debugging for a particular viewer session</string> + <key>Persist</key> + <integer>0</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> + <key>DebugShowAvatarRenderInfo</key> + <map> + <key>Comment</key> + <string>Show avatar render cost information</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> <key>DebugShowColor</key> <map> <key>Comment</key> @@ -2972,6 +3049,17 @@ <key>Value</key> <integer>0</integer> </map> + <key>DisableCrashLogger</key> + <map> + <key>Comment</key> + <string>Do not send crash report to Linden server</string> + <key>Persist</key> + <integer>0</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> <key>DisableMouseWarp</key> <map> <key>Comment</key> @@ -3489,16 +3577,27 @@ <key>Value</key> <real>10.0</real> </map> - <key>FilterItemsPerFrame</key> + <key>FilterItemsMaxTimePerFrameVisible</key> <map> - <key>Comment</key> - <string>Maximum number of inventory items to match against search filter every frame (lower to increase framerate while searching, higher to improve search speed)</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>S32</string> - <key>Value</key> - <integer>500</integer> + <key>Comment</key> + <string>Max time devoted to items filtering per frame for visible inventory listings (in milliseconds)</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>10</integer> + </map> + <key>FilterItemsMaxTimePerFrameUnvisible</key> + <map> + <key>Comment</key> + <string>Max time devoted to items filtering per frame for non visible inventory listings (in milliseconds)</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>1</integer> </map> <key>FindLandArea</key> <map> @@ -5217,6 +5316,28 @@ <key>Value</key> <integer>0</integer> </map> + <key>LogMetrics</key> + <map> + <key>Comment</key> + <string>Log viewer metrics</string> + <key>Persist</key> + <integer>0</integer> + <key>Type</key> + <string>String</string> + <key>Value</key> + <string/> + </map> + <key>LogPerformance</key> + <map> + <key>Comment</key> + <string>Log performance analysis for a particular viewer run</string> + <key>Persist</key> + <integer>0</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> <key>LogTextureNetworkTraffic</key> <map> <key>Comment</key> @@ -6394,6 +6515,17 @@ <key>Value</key> <integer>0</integer> </map> + <key>NoQuickTime</key> + <map> + <key>Comment</key> + <string>Disable QuickTime for a particular viewer run</string> + <key>Persist</key> + <integer>0</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> <key>NoVerifySSLCert</key> <map> <key>Comment</key> @@ -6430,7 +6562,10 @@ <key>NotificationConferenceIMOptions</key> <map> <key>Comment</key> - <string>Specifies how the UI responds to Conference IM Notifications.</string> + <string> + Specifies how the UI responds to Conference IM Notifications. + Allowed values: [openconversations,toast,flash,noaction] + </string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -6441,7 +6576,10 @@ <key>NotificationFriendIMOptions</key> <map> <key>Comment</key> - <string>Specifies how the UI responds to Friend IM Notifications.</string> + <string> + Specifies how the UI responds to Friend IM Notifications. + Allowed values: [openconversations,toast,flash,noaction] + </string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -6452,7 +6590,10 @@ <key>NotificationGroupChatOptions</key> <map> <key>Comment</key> - <string>Specifies how the UI responds to Group Chat Notifications.</string> + <string> + Specifies how the UI responds to Group Chat Notifications. + Allowed values: [openconversations,toast,flash,noaction] + </string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -6463,7 +6604,10 @@ <key>NotificationNearbyChatOptions</key> <map> <key>Comment</key> - <string>Specifies how the UI responds to Nearby Chat Notifications.</string> + <string> + Specifies how the UI responds to Nearby Chat Notifications. + Allowed values: [openconversations,toast,flash,noaction] + </string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -6474,7 +6618,24 @@ <key>NotificationNonFriendIMOptions</key> <map> <key>Comment</key> - <string>Specifies how the UI responds to Non Friend IM Notifications.</string> + <string> + Specifies how the UI responds to Non Friend IM Notifications. + Allowed values: [openconversations,toast,flash,noaction] + </string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>String</string> + <key>Value</key> + <string>toast</string> + </map> + <key>NotificationObjectIMOptions</key> + <map> + <key>Comment</key> + <string> + Specifies how the UI responds to Object IM Notifications. + Allowed values: [openconversations,toast,flash,noaction] + </string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -6987,6 +7148,17 @@ <key>Value</key> <real>90.0</real> </map> + <key>PlayChatAnim</key> + <map> + <key>Comment</key> + <string>Your avatar plays the chat animation whenever you say, shout or whisper something in nearby chat</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> <key>PlayTypingAnim</key> <map> <key>Comment</key> @@ -7020,6 +7192,72 @@ <key>Value</key> <integer>0</integer> </map> + <key>PlaySoundFriendIM</key> + <map> + <key>Comment</key> + <string>Plays a sound when friend's IM received.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> + <key>PlaySoundNonFriendIM</key> + <map> + <key>Comment</key> + <string>Plays a sound when non-friend's IM received.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> + <key>PlaySoundConferenceIM</key> + <map> + <key>Comment</key> + <string>Plays a sound when conference IM received.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> + <key>PlaySoundGroupChatIM</key> + <map> + <key>Comment</key> + <string>Plays a sound when group chat IM received.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> + <key>PlaySoundNearbyChatIM</key> + <map> + <key>Comment</key> + <string>Plays a sound when nearby chat IM received.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> + <key>PlaySoundObjectIM</key> + <map> + <key>Comment</key> + <string>Plays a sound when IM fom an object received.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> <key>PlaySoundNewConversation</key> <map> <key>Comment</key> @@ -7732,7 +7970,7 @@ <key>Type</key> <string>S32</string> <key>Value</key> - <integer>4</integer> + <integer>3</integer> </map> <key>OctreeAlphaDistanceFactor</key> @@ -8446,6 +8684,18 @@ <integer>0</integer> </map> + <key>RenderDepthOfFieldInEditMode</key> + <map> + <key>Comment</key> + <string>Whether to use depth of field effect when in edit mode</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> + <key>CameraDoFResScale</key> <map> <key>Comment</key> @@ -8504,7 +8754,6 @@ <key>Value</key> <real>1.0</real> </map> - <key>RenderDeferredTreeShadowBias</key> <map> <key>Comment</key> @@ -8593,6 +8842,18 @@ </array> </map> + <key>RenderSpecularPrecision</key> + <map> + <key>Comment</key> + <string>Force 32-bit floating point LUT</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>U32</string> + <key>Value</key> + <real>0</real> + </map> + <key>RenderSpecularResX</key> <map> <key>Comment</key> @@ -8883,6 +9144,17 @@ <key>Value</key> <real>1.0</real> </map> + <key>RenderDeferredDisplayGamma</key> + <map> + <key>Comment</key> + <string>Gamma ramp exponent for final correction before display gamma.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>2.2</real> + </map> <key>RenderGLCoreProfile</key> <map> <key>Comment</key> @@ -9486,10 +9758,22 @@ <key>Value</key> <integer>1</integer> </map> + <key>RenderAutoMuteByteLimit</key> <map> <key>Comment</key> - <string>Maximum bytes of attachments before an avatar is automatically visually muted (0 for no limit).</string> + <string>Maximum bytes of attachments before an avatar is rendered as a simple impostor (0 for no limit).</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>U32</string> + <key>Value</key> + <integer>0</integer> + </map> + <key>RenderAutoMuteRenderWeightLimit</key> + <map> + <key>Comment</key> + <string>Maximum render weight before an avatar is rendered as a simple impostor (0 to not use this limit).</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -9500,7 +9784,7 @@ <key>RenderAutoMuteSurfaceAreaLimit</key> <map> <key>Comment</key> - <string>Maximum surface area of attachments before an avatar is automatically visually muted (0 for no limit).</string> + <string>Maximum surface area of attachments before an avatar is rendered as a simple impostor (0 to not use this limit).</string> <key>Persist</key> <integer>1</integer> <key>Type</key> @@ -9508,7 +9792,28 @@ <key>Value</key> <integer>0</integer> </map> - + <key>RenderAutoMuteFunctions</key> + <map> + <key>Comment</key> + <string>Developing feature to render some avatars using simple impostors or colored silhouettes. (Set to 7 for all functionality)</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>U32</string> + <key>Value</key> + <real>0</real> + </map> + <key>RenderAutoMuteLogging</key> + <map> + <key>Comment</key> + <string>Show extra information in viewer logs about avatar rendering costs</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> <key>RenderAutoHideSurfaceAreaLimit</key> <map> <key>Comment</key> @@ -9610,6 +9915,17 @@ <key>Value</key> <integer>1</integer> </map> + <key>RenderWaterMaterials</key> + <map> + <key>Comment</key> + <string>Water planar reflections include materials rendering.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>0</integer> + </map> <key>RenderWaterMipNormal</key> <map> <key>Comment</key> @@ -9643,6 +9959,28 @@ <key>Value</key> <integer>1</integer> </map> + <key>ReplaySession</key> + <map> + <key>Comment</key> + <string>Request replay of previously-recorded pilot file</string> + <key>Persist</key> + <integer>0</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> + <key>RevokePermsOnStopAnimation</key> + <map> + <key>Comment</key> + <string>Clear animation permssions when choosing "Stop Animating Me"</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> <key>RotateRight</key> <map> <key>Comment</key> @@ -12859,12 +13197,13 @@ <key>UserLoginInfo</key> <map> <key>Comment</key> - <string>Users loging data.</string> + <string>User login data.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>LLSD</string> <key>Value</key> + <string/> </map> <key>VFSOldSize</key> <map> @@ -14544,5 +14883,18 @@ <key>Value</key> <integer>0</integer> </map> + + <key>VersionChannelName</key> + <map> + <key>Comment</key> + <string>Version information generated by running the viewer</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>String</string> + <key>Value</key> + <string /> + </map> </map> </llsd> + diff --git a/indra/newview/app_settings/settings_files.xml b/indra/newview/app_settings/settings_files.xml index bfc09286e3..4a9e522a96 100755 --- a/indra/newview/app_settings/settings_files.xml +++ b/indra/newview/app_settings/settings_files.xml @@ -4,6 +4,9 @@ <file name="Global" file_name="settings.xml" required="true"/> + <file name="Global" + file_name="settings_install.xml" + required="false"/> <file name="PerAccount" file_name="settings_per_account.xml" required="true"/> diff --git a/indra/newview/app_settings/settings_minimal.xml b/indra/newview/app_settings/settings_minimal.xml index 01a70f2671..e660c1a33b 100755 --- a/indra/newview/app_settings/settings_minimal.xml +++ b/indra/newview/app_settings/settings_minimal.xml @@ -1 +1,4 @@ -<llsd/>
\ No newline at end of file +<?xml version="1.0"?> +<llsd> + <undef/> +</llsd> diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index 590f41283b..636caf5ef3 100755 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -109,18 +109,7 @@ <string>Boolean</string> <key>Value</key> <integer>0</integer> - </map> - <key>DisplayDestinationsOnInitialRun</key> - <map> - <key>Comment</key> - <string>Display the destinations guide when a user first launches Second Life.</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> + </map> <key>LastInventoryInboxActivity</key> <map> <key>Comment</key> diff --git a/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl b/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl index 43ed41a205..efd0d03965 100755 --- a/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl +++ b/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl @@ -45,3 +45,4 @@ mat4 getObjectSkinnedTransform() return mat; } + diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl index 77a53a71aa..e5f7366b70 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl @@ -35,6 +35,26 @@ out vec4 frag_color; #define frag_color gl_FragColor #endif +uniform float display_gamma; +uniform vec4 gamma; +uniform vec4 lightnorm; +uniform vec4 sunlight_color; +uniform vec4 ambient; +uniform vec4 blue_horizon; +uniform vec4 blue_density; +uniform float haze_horizon; +uniform float haze_density; +uniform float cloud_shadow; +uniform float density_multiplier; +uniform float distance_multiplier; +uniform float max_y; +uniform vec4 glow; +uniform float scene_light_strength; +uniform mat3 env_mat; +uniform mat3 ssao_effect_mat; + +uniform vec3 sun_dir; + #if HAS_SHADOW uniform sampler2DShadow shadowMap0; uniform sampler2DShadow shadowMap1; @@ -53,14 +73,8 @@ uniform float shadow_bias; uniform sampler2D diffuseMap; #endif -vec3 atmosLighting(vec3 light); -vec3 scaleSoftClip(vec3 light); - -VARYING vec3 vary_ambient; -VARYING vec3 vary_directional; VARYING vec3 vary_fragcoord; VARYING vec3 vary_position; -VARYING vec3 vary_pointlight_col; VARYING vec2 vary_texcoord0; VARYING vec3 vary_norm; @@ -68,28 +82,92 @@ VARYING vec3 vary_norm; VARYING vec4 vertex_color; #endif +vec3 vary_PositionEye; +vec3 vary_SunlitColor; +vec3 vary_AmblitColor; +vec3 vary_AdditiveColor; +vec3 vary_AtmosAttenuation; + +uniform mat4 inv_proj; +uniform vec2 screen_res; + uniform vec4 light_position[8]; uniform vec3 light_direction[8]; uniform vec3 light_attenuation[8]; uniform vec3 light_diffuse[8]; -uniform vec2 screen_res; +vec3 srgb_to_linear(vec3 cs) +{ + vec3 low_range = cs / vec3(12.92); + vec3 high_range = pow((cs+vec3(0.055))/vec3(1.055), vec3(2.4)); + bvec3 lte = lessThanEqual(cs,vec3(0.04045)); + +#ifdef OLD_SELECT + vec3 result; + result.r = lte.r ? low_range.r : high_range.r; + result.g = lte.g ? low_range.g : high_range.g; + result.b = lte.b ? low_range.b : high_range.b; + return result; +#else + return mix(high_range, low_range, lte); +#endif + +} + +vec3 linear_to_srgb(vec3 cl) +{ + cl = clamp(cl, vec3(0), vec3(1)); + vec3 low_range = cl * 12.92; + vec3 high_range = 1.055 * pow(cl, vec3(0.41666)) - 0.055; + bvec3 lt = lessThan(cl,vec3(0.0031308)); + +#ifdef OLD_SELECT + vec3 result; + result.r = lt.r ? low_range.r : high_range.r; + result.g = lt.g ? low_range.g : high_range.g; + result.b = lt.b ? low_range.b : high_range.b; + return result; +#else + return mix(high_range, low_range, lt); +#endif + +} + +vec2 encode_normal(vec3 n) +{ + float f = sqrt(8 * n.z + 8); + return n.xy / f + 0.5; +} + +vec3 decode_normal (vec2 enc) +{ + vec2 fenc = enc*4-2; + float f = dot(fenc,fenc); + float g = sqrt(1-f/4); + vec3 n; + n.xy = fenc*g; + n.z = 1-f/2; + return n; +} vec3 calcDirectionalLight(vec3 n, vec3 l) { float a = max(dot(n,l),0.0); + a = pow(a, 1.0/1.3); return vec3(a,a,a); } -vec3 calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) +vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 diffuse, vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) { //get light vector vec3 lv = lp.xyz-v; //get distance - float d = dot(lv,lv); + float d = length(lv); - float da = 0.0; + float da = 1.0; + + vec3 col = vec3(0); if (d > 0.0 && la > 0.0 && fa > 0.0) { @@ -97,9 +175,10 @@ vec3 calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float lv = normalize(lv); //distance attenuation - float dist2 = d/la; - da = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); - da = pow(da, 2.2) * 2.2; + float dist = d/la; + float dist_atten = clamp(1.0-(dist-1.0*(1.0-fa))/fa, 0.0, 1.0); + dist_atten *= dist_atten; + dist_atten *= 2.0; // spotlight coefficient. float spot = max(dot(-ln, lv), is_pointlight); @@ -107,9 +186,15 @@ vec3 calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float //angular attenuation da *= max(dot(n, lv), 0.0); + + float lit = max(da * dist_atten,0.0); + + col = light_col * lit * diffuse; + + // no spec for alpha shader... } - return vec3(da,da,da); + return max(col, vec3(0.0,0.0,0.0)); } #if HAS_SHADOW @@ -132,6 +217,237 @@ float pcfShadow(sampler2DShadow shadowMap, vec4 stc) } #endif +#ifdef WATER_FOG +uniform vec4 waterPlane; +uniform vec4 waterFogColor; +uniform float waterFogDensity; +uniform float waterFogKS; + +vec4 applyWaterFogDeferred(vec3 pos, vec4 color) +{ + //normalize view vector + vec3 view = normalize(pos); + float es = -(dot(view, waterPlane.xyz)); + + //find intersection point with water plane and eye vector + + //get eye depth + float e0 = max(-waterPlane.w, 0.0); + + vec3 int_v = waterPlane.w > 0.0 ? view * waterPlane.w/es : vec3(0.0, 0.0, 0.0); + + //get object depth + float depth = length(pos - int_v); + + //get "thickness" of water + float l = max(depth, 0.1); + + float kd = waterFogDensity; + float ks = waterFogKS; + vec4 kc = waterFogColor; + + float F = 0.98; + + float t1 = -kd * pow(F, ks * e0); + float t2 = kd + ks * es; + float t3 = pow(F, t2*l) - 1.0; + + float L = min(t1/t2*t3, 1.0); + + float D = pow(0.98, l*kd); + + color.rgb = color.rgb * D + kc.rgb * L; + color.a = kc.a + color.a; + + return color; +} +#endif + +vec3 getSunlitColor() +{ + return vary_SunlitColor; +} +vec3 getAmblitColor() +{ + return vary_AmblitColor; +} +vec3 getAdditiveColor() +{ + return vary_AdditiveColor; +} +vec3 getAtmosAttenuation() +{ + return vary_AtmosAttenuation; +} + +void setPositionEye(vec3 v) +{ + vary_PositionEye = v; +} + +void setSunlitColor(vec3 v) +{ + vary_SunlitColor = v; +} + +void setAmblitColor(vec3 v) +{ + vary_AmblitColor = v; +} + +void setAdditiveColor(vec3 v) +{ + vary_AdditiveColor = v; +} + +void setAtmosAttenuation(vec3 v) +{ + vary_AtmosAttenuation = v; +} + +void calcAtmospherics(vec3 inPositionEye, float ambFactor) { + + vec3 P = inPositionEye; + setPositionEye(P); + + vec3 tmpLightnorm = lightnorm.xyz; + + vec3 Pn = normalize(P); + float Plen = length(P); + + vec4 temp1 = vec4(0); + vec3 temp2 = vec3(0); + vec4 blue_weight; + vec4 haze_weight; + vec4 sunlight = sunlight_color; + vec4 light_atten; + + //sunlight attenuation effect (hue and brightness) due to atmosphere + //this is used later for sunlight modulation at various altitudes + light_atten = (blue_density + vec4(haze_density * 0.25)) * (density_multiplier * max_y); + //I had thought blue_density and haze_density should have equal weighting, + //but attenuation due to haze_density tends to seem too strong + + temp1 = blue_density + vec4(haze_density); + blue_weight = blue_density / temp1; + haze_weight = vec4(haze_density) / temp1; + + //(TERRAIN) compute sunlight from lightnorm only (for short rays like terrain) + temp2.y = max(0.0, tmpLightnorm.y); + temp2.y = 1. / temp2.y; + sunlight *= exp( - light_atten * temp2.y); + + // main atmospheric scattering line integral + temp2.z = Plen * density_multiplier; + + // Transparency (-> temp1) + // ATI Bugfix -- can't store temp1*temp2.z*distance_multiplier in a variable because the ati + // compiler gets confused. + temp1 = exp(-temp1 * temp2.z * distance_multiplier); + + //final atmosphere attenuation factor + setAtmosAttenuation(temp1.rgb); + + //compute haze glow + //(can use temp2.x as temp because we haven't used it yet) + temp2.x = dot(Pn, tmpLightnorm.xyz); + temp2.x = 1. - temp2.x; + //temp2.x is 0 at the sun and increases away from sun + temp2.x = max(temp2.x, .03); //was glow.y + //set a minimum "angle" (smaller glow.y allows tighter, brighter hotspot) + temp2.x *= glow.x; + //higher glow.x gives dimmer glow (because next step is 1 / "angle") + temp2.x = pow(temp2.x, glow.z); + //glow.z should be negative, so we're doing a sort of (1 / "angle") function + + //add "minimum anti-solar illumination" + temp2.x += .25; + + //increase ambient when there are more clouds + vec4 tmpAmbient = ambient + (vec4(1.) - ambient) * cloud_shadow * 0.5; + + /* decrease value and saturation (that in HSV, not HSL) for occluded areas + * // for HSV color/geometry used here, see http://gimp-savvy.com/BOOK/index.html?node52.html + * // The following line of code performs the equivalent of: + * float ambAlpha = tmpAmbient.a; + * float ambValue = dot(vec3(tmpAmbient), vec3(0.577)); // projection onto <1/rt(3), 1/rt(3), 1/rt(3)>, the neutral white-black axis + * vec3 ambHueSat = vec3(tmpAmbient) - vec3(ambValue); + * tmpAmbient = vec4(RenderSSAOEffect.valueFactor * vec3(ambValue) + RenderSSAOEffect.saturationFactor *(1.0 - ambFactor) * ambHueSat, ambAlpha); + */ + tmpAmbient = vec4(mix(ssao_effect_mat * tmpAmbient.rgb, tmpAmbient.rgb, ambFactor), tmpAmbient.a); + + //haze color + setAdditiveColor( + vec3(blue_horizon * blue_weight * (sunlight*(1.-cloud_shadow) + tmpAmbient) + + (haze_horizon * haze_weight) * (sunlight*(1.-cloud_shadow) * temp2.x + + tmpAmbient))); + + //brightness of surface both sunlight and ambient + setSunlitColor(vec3(sunlight * .5)); + setAmblitColor(vec3(tmpAmbient * .25)); + setAdditiveColor(getAdditiveColor() * vec3(1.0 - temp1)); +} + +vec3 atmosLighting(vec3 light) +{ + light *= getAtmosAttenuation().r; + light += getAdditiveColor(); + return (2.0 * light); +} + +vec3 atmosTransport(vec3 light) { + light *= getAtmosAttenuation().r; + light += getAdditiveColor() * 2.0; + return light; +} +vec3 atmosGetDiffuseSunlightColor() +{ + return getSunlitColor(); +} + +vec3 scaleDownLight(vec3 light) +{ + return (light / vec3(scene_light_strength, scene_light_strength, scene_light_strength)); +} + +vec3 scaleUpLight(vec3 light) +{ + return (light * vec3(scene_light_strength, scene_light_strength, scene_light_strength)); +} + +vec3 atmosAmbient(vec3 light) +{ + return getAmblitColor() + (light * vec3(0.5f, 0.5f, 0.5f)); +} + +vec3 atmosAffectDirectionalLight(float lightIntensity) +{ + return getSunlitColor() * vec3(lightIntensity, lightIntensity, lightIntensity); +} + +vec3 scaleSoftClip(vec3 light) +{ + //soft clip effect: + vec3 zeroes = vec3(0.0f, 0.0f, 0.0f); + vec3 ones = vec3(1.0f, 1.0f, 1.0f); + + light = ones - clamp(light, zeroes, ones); + light = ones - pow(light, gamma.xxx); + + return light; +} + +vec3 fullbrightAtmosTransport(vec3 light) { + float brightness = dot(light.rgb, vec3(0.33333)); + + return mix(atmosTransport(light.rgb), light.rgb + getAdditiveColor().rgb, brightness * brightness); +} + +vec3 fullbrightScaleSoftClip(vec3 light) +{ + //soft clip effect: + return light; +} void main() { @@ -140,13 +456,15 @@ void main() vec4 pos = vec4(vary_position, 1.0); + float shadow = 1.0; #if HAS_SHADOW - float shadow = 0.0; vec4 spos = pos; if (spos.z > -shadow_clip.w) { + shadow = 0.0; + vec4 lpos; vec4 near_split = shadow_clip*-0.75; @@ -213,34 +531,75 @@ void main() vec4 diff = texture2D(diffuseMap,vary_texcoord0.xy); #endif - diff.rgb = pow(diff.rgb, vec3(2.2f, 2.2f, 2.2f)); +#ifdef FOR_IMPOSTOR + vec4 color; + color.rgb = diff.rgb; #ifdef USE_VERTEX_COLOR - float vertex_color_alpha = vertex_color.a; + float final_alpha = diff.a * vertex_color.a; + diff.rgb *= vertex_color.rgb; #else - float vertex_color_alpha = 1.0; + float final_alpha = diff.a; #endif - vec3 normal = vary_norm; + // Insure we don't pollute depth with invis pixels in impostor rendering + // + if (final_alpha < 0.01) + { + discard; + } +#else - vec3 l = light_position[0].xyz; - vec3 dlight = calcDirectionalLight(normal, l) * 2.6; - dlight = dlight * vary_directional.rgb * vary_pointlight_col; - -#if HAS_SHADOW - vec4 col = vec4(vary_ambient + dlight * shadow, vertex_color_alpha); +#ifdef USE_VERTEX_COLOR + float final_alpha = diff.a * vertex_color.a; + diff.rgb *= vertex_color.rgb; #else - vec4 col = vec4(vary_ambient + dlight, vertex_color_alpha); + float final_alpha = diff.a; #endif - vec4 color = diff * col; + + vec4 gamma_diff = diff; + diff.rgb = srgb_to_linear(diff.rgb); + + vec3 norm = vary_norm; + + calcAtmospherics(pos.xyz, 1.0); + + vec2 abnormal = encode_normal(norm.xyz); + norm.xyz = decode_normal(abnormal.xy); + + float da = dot(norm.xyz, sun_dir.xyz); + + float final_da = da; + final_da = min(final_da, shadow); + final_da = max(final_da, 0.0f); + final_da = min(final_da, 1.0f); + final_da = pow(final_da, 1.0/1.3); + + vec4 color = vec4(0,0,0,0); + + color.rgb = atmosAmbient(color.rgb); + color.a = final_alpha; + + float ambient = abs(da); + ambient *= 0.5; + ambient *= ambient; + ambient = (1.0-ambient); + + color.rgb *= ambient; + color.rgb += atmosAffectDirectionalLight(final_da); + color.rgb *= gamma_diff.rgb; + + //color.rgb = mix(diff.rgb, color.rgb, final_alpha); color.rgb = atmosLighting(color.rgb); - color.rgb = scaleSoftClip(color.rgb); - col = vec4(0,0,0,0); - #define LIGHT_LOOP(i) col.rgb += light_diffuse[i].rgb * calcPointLightOrSpotLight(pos.xyz, normal, light_position[i], light_direction[i].xyz, light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z); + vec4 light = vec4(0,0,0,0); + + color.rgb = srgb_to_linear(color.rgb); + + #define LIGHT_LOOP(i) light.rgb += calcPointLightOrSpotLight(light_diffuse[i].rgb, diff.rgb, pos.xyz, norm, light_position[i], light_direction[i].xyz, light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z); LIGHT_LOOP(1) LIGHT_LOOP(2) @@ -250,9 +609,19 @@ void main() LIGHT_LOOP(6) LIGHT_LOOP(7) - color.rgb += diff.rgb * vary_pointlight_col * col.rgb; + // keep it linear + // + color.rgb += light.rgb; - color.rgb = pow(color.rgb, vec3(1.0/2.2)); + // straight to display gamma, we're post-deferred + // + color.rgb = linear_to_srgb(color.rgb); + +#ifdef WATER_FOG + color = applyWaterFogDeferred(pos.xyz, color); +#endif + +#endif frag_color = color; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl deleted file mode 100755 index 2ce44d599f..0000000000 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl +++ /dev/null @@ -1,150 +0,0 @@ -/** - * @file alphaF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#extension GL_ARB_texture_rectangle : enable - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif - -uniform sampler2DRect depthMap; -uniform sampler2D diffuseMap; - - -uniform vec2 screen_res; - -vec3 atmosLighting(vec3 light); -vec3 scaleSoftClip(vec3 light); - -VARYING vec3 vary_ambient; -VARYING vec3 vary_directional; -VARYING vec3 vary_fragcoord; -VARYING vec3 vary_position; -VARYING vec3 vary_pointlight_col; -VARYING vec2 vary_texcoord0; -VARYING vec4 vertex_color; -VARYING vec3 vary_norm; - -uniform mat4 inv_proj; - -uniform vec4 light_position[8]; -uniform vec3 light_direction[8]; -uniform vec3 light_attenuation[8]; -uniform vec3 light_diffuse[8]; - -vec3 calcDirectionalLight(vec3 n, vec3 l) -{ - float a = pow(max(dot(n,l),0.0), 0.7); - return vec3(a,a,a); -} - -vec3 calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) -{ - //get light vector - vec3 lv = lp.xyz-v; - - //get distance - float d = dot(lv,lv); - - float da = 0.0; - - if (d > 0.0 && la > 0.0 && fa > 0.0) - { - //normalize light vector - lv = normalize(lv); - - //distance attenuation - float dist2 = d/la; - da = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); - - // spotlight coefficient. - float spot = max(dot(-ln, lv), is_pointlight); - da *= spot*spot; // GL_SPOT_EXPONENT=2 - - //angular attenuation - da *= max(pow(dot(n, lv), 0.7), 0.0); - } - - return vec3(da,da,da); -} - -vec4 getPosition(vec2 pos_screen) -{ - float depth = texture2DRect(depthMap, pos_screen.xy).a; - vec2 sc = pos_screen.xy*2.0; - sc /= screen_res; - sc -= vec2(1.0,1.0); - vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); - vec4 pos = inv_proj * ndc; - pos /= pos.w; - pos.w = 1.0; - return pos; -} - -void main() -{ - vec2 frag = vary_fragcoord.xy/vary_fragcoord.z*0.5+0.5; - frag *= screen_res; - - vec4 pos = vec4(vary_position, 1.0); - - vec4 diff= texture2D(diffuseMap,vary_texcoord0.xy); - - vec3 n = vary_norm; - vec3 l = light_position[0].xyz; - vec3 dlight = calcDirectionalLight(n, l); - dlight = dlight * vary_directional.rgb * vary_pointlight_col; - - vec4 col = vec4(vary_ambient + dlight, vertex_color.a); - vec4 color = diff * col; - - color.rgb = atmosLighting(color.rgb); - - color.rgb = scaleSoftClip(color.rgb); - vec3 light_col = vec3(0,0,0); - - #define LIGHT_LOOP(i) \ - light_col += light_diffuse[i].rgb * calcPointLightOrSpotLight(pos.xyz, vary_norm, light_position[i], light_direction[i], light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z); - - LIGHT_LOOP(1) - LIGHT_LOOP(2) - LIGHT_LOOP(3) - LIGHT_LOOP(4) - LIGHT_LOOP(5) - LIGHT_LOOP(6) - LIGHT_LOOP(7) - - color.rgb += diff.rgb * vary_pointlight_col * light_col; - - color.rgb = pow(color.rgb, vec3(1.0/2.2)); - - frag_color = color; - //frag_color = vec4(1,0,1,1); - //frag_color = vec4(1,0,1,1)*shadow; - -} - diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl deleted file mode 100755 index 1113a9845b..0000000000 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl +++ /dev/null @@ -1,92 +0,0 @@ -/** - * @file alphaNonIndexedNoColorF.glsl - * - * $LicenseInfo:firstyear=2005&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2005, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#extension GL_ARB_texture_rectangle : enable - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif - -uniform float minimum_alpha; - -uniform sampler2DRect depthMap; -uniform sampler2D diffuseMap; - -uniform vec2 screen_res; - -vec3 atmosLighting(vec3 light); -vec3 scaleSoftClip(vec3 light); - -VARYING vec3 vary_ambient; -VARYING vec3 vary_directional; -VARYING vec3 vary_fragcoord; -VARYING vec3 vary_position; -VARYING vec3 vary_pointlight_col; -VARYING vec2 vary_texcoord0; - -uniform mat4 inv_proj; - -vec4 getPosition(vec2 pos_screen) -{ - float depth = texture2DRect(depthMap, pos_screen.xy).a; - vec2 sc = pos_screen.xy*2.0; - sc /= screen_res; - sc -= vec2(1.0,1.0); - vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); - vec4 pos = inv_proj * ndc; - pos /= pos.w; - pos.w = 1.0; - return pos; -} - -void main() -{ - vec2 frag = vary_fragcoord.xy/vary_fragcoord.z*0.5+0.5; - frag *= screen_res; - - vec4 pos = vec4(vary_position, 1.0); - - vec4 diff= texture2D(diffuseMap,vary_texcoord0.xy); - - if (diff.a < minimum_alpha) - { - discard; - } - - vec4 col = vec4(vary_ambient + vary_directional.rgb, 1.0); - vec4 color = diff * col; - - - color.rgb = atmosLighting(color.rgb); - - color.rgb = scaleSoftClip(color.rgb); - - color.rgb += diff.rgb * vary_pointlight_col.rgb; - - frag_color = color; -} - diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl deleted file mode 100755 index 5f93986f1d..0000000000 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl +++ /dev/null @@ -1,136 +0,0 @@ -/** - * @file alphaSkinnedV.glsl - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -uniform mat4 projection_matrix; -uniform mat4 modelview_matrix; - -ATTRIBUTE vec3 position; -ATTRIBUTE vec3 normal; -ATTRIBUTE vec4 diffuse_color; -ATTRIBUTE vec2 texcoord0; - -mat4 getObjectSkinnedTransform(); -void calcAtmospherics(vec3 inPositionEye); - -float calcDirectionalLight(vec3 n, vec3 l); - -vec3 atmosAmbient(vec3 light); -vec3 atmosAffectDirectionalLight(float lightIntensity); - -VARYING vec3 vary_position; -VARYING vec3 vary_ambient; -VARYING vec3 vary_directional; -VARYING vec3 vary_fragcoord; -VARYING vec3 vary_pointlight_col; -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; - -VARYING vec3 vary_norm; - -uniform float near_clip; - -uniform vec4 light_position[8]; -uniform vec3 light_direction[8]; -uniform vec3 light_attenuation[8]; -uniform vec3 light_diffuse[8]; - -float calcDirectionalLight(vec3 n, vec3 l) -{ - float a = max(dot(n,l),0.0); - return a; -} - -float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) -{ - //get light vector - vec3 lv = lp.xyz-v; - - //get distance - float d = dot(lv,lv); - - float da = 0.0; - - if (d > 0.0 && la > 0.0 && fa > 0.0) - { - //normalize light vector - lv = normalize(lv); - - //distance attenuation - float dist2 = d/la; - da = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); - - // spotlight coefficient. - float spot = max(dot(-ln, lv), is_pointlight); - da *= spot*spot; // GL_SPOT_EXPONENT=2 - - //angular attenuation - da *= max(dot(n, lv), 0.0); - } - - return da; -} - -void main() -{ - vary_texcoord0 = texcoord0; - - vec4 pos; - vec3 norm; - - mat4 trans = getObjectSkinnedTransform(); - trans = modelview_matrix * trans; - - pos = trans * vec4(position.xyz, 1.0); - - norm = position.xyz + normal.xyz; - norm = normalize(( trans*vec4(norm, 1.0) ).xyz-pos.xyz); - vary_norm = norm; - vec4 frag_pos = projection_matrix * pos; - gl_Position = frag_pos; - - vary_position = pos.xyz; - - calcAtmospherics(pos.xyz); - - //vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.)); - vec4 col = vec4(0.0, 0.0, 0.0, diffuse_color.a); - vary_pointlight_col = diffuse_color.rgb; - col.rgb = vec3(0,0,0); - - // Add windlight lights - col.rgb = atmosAmbient(vec3(0.)); - - vary_ambient = col.rgb*diffuse_color.rgb; - vary_directional.rgb = atmosAffectDirectionalLight(1); - - col.rgb = col.rgb*diffuse_color.rgb; - - vertex_color = col; - - - - vary_fragcoord.xyz = frag_pos.xyz + vec3(0,0,near_clip); -} - - diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl index 247ee0a34f..b40785bbd7 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl @@ -55,75 +55,18 @@ mat4 getSkinnedTransform(); #endif #endif -vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); -void calcAtmospherics(vec3 inPositionEye); - -vec3 calcDirectionalLight(vec3 n, vec3 l); - -vec3 atmosAmbient(vec3 light); -vec3 atmosAffectDirectionalLight(float lightIntensity); -vec3 scaleDownLight(vec3 light); -vec3 scaleUpLight(vec3 light); - -VARYING vec3 vary_ambient; -VARYING vec3 vary_directional; VARYING vec3 vary_fragcoord; VARYING vec3 vary_position; -VARYING vec3 vary_pointlight_col; #ifdef USE_VERTEX_COLOR VARYING vec4 vertex_color; #endif VARYING vec2 vary_texcoord0; - VARYING vec3 vary_norm; uniform float near_clip; -uniform vec4 light_position[8]; -uniform vec3 light_direction[8]; -uniform vec3 light_attenuation[8]; -uniform vec3 light_diffuse[8]; - -uniform vec3 sun_dir; - -vec3 calcDirectionalLight(vec3 n, vec3 l) -{ - float a = max(dot(n,l),0.0); - return vec3(a,a,a); -} - -vec3 calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) -{ - //get light vector - vec3 lv = lp.xyz-v; - - //get distance - float d = dot(lv,lv); - - float da = 0.0; - - if (d > 0.0 && la > 0.0 && fa > 0.0) - { - //normalize light vector - lv = normalize(lv); - - //distance attenuation - float dist2 = d/la; - da = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); - - // spotlight coefficient. - float spot = max(dot(-ln, lv), is_pointlight); - da *= spot*spot; // GL_SPOT_EXPONENT=2 - - //angular attenuation - da *= max(dot(n, lv), 0.0); - } - - return vec3(da,da,da); -} - void main() { vec4 pos; @@ -176,41 +119,8 @@ void main() vary_norm = norm; vary_position = pos.xyz; - calcAtmospherics(pos.xyz); - -#ifndef USE_VERTEX_COLOR - vec4 diffuse_color = vec4(1,1,1,1); -#endif - //vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.)); - vec4 col = vec4(0.0, 0.0, 0.0, diffuse_color.a); - - vec3 diff = pow(diffuse_color.rgb, vec3(2.2)); - - - - vary_pointlight_col = diff; - - - col.rgb = vec3(0,0,0); - - // Add windlight lights - col.rgb = atmosAmbient(col.rgb); - - float ambient = min(abs(dot(norm.xyz, sun_dir.xyz)), 1.0); - ambient *= 0.5; - ambient *= ambient; - ambient = (1.0-ambient); - - col.rgb *= ambient; - - vary_ambient = col.rgb*diff.rgb; - - vary_directional.rgb = atmosAffectDirectionalLight(1.0f); - - col.rgb = col.rgb*diff.rgb; - #ifdef USE_VERTEX_COLOR - vertex_color = col; + vertex_color = diffuse_color; #endif #ifdef HAS_SKIN diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl deleted file mode 100755 index d6149fcc32..0000000000 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl +++ /dev/null @@ -1,153 +0,0 @@ -/** - * @file avatarAlphaV.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -uniform mat4 projection_matrix; - -ATTRIBUTE vec3 position; -ATTRIBUTE vec3 normal; -ATTRIBUTE vec2 texcoord0; - -vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); -mat4 getSkinnedTransform(); -void calcAtmospherics(vec3 inPositionEye); - -float calcDirectionalLight(vec3 n, vec3 l); -float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight); - -vec3 atmosAmbient(vec3 light); -vec3 atmosAffectDirectionalLight(float lightIntensity); -vec3 scaleDownLight(vec3 light); -vec3 scaleUpLight(vec3 light); - -VARYING vec3 vary_position; -VARYING vec3 vary_ambient; -VARYING vec3 vary_directional; -VARYING vec3 vary_fragcoord; -VARYING vec3 vary_pointlight_col; -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; - - -uniform float near_clip; - -uniform vec4 color; - -uniform vec4 light_position[8]; -uniform vec3 light_direction[8]; -uniform vec3 light_attenuation[8]; -uniform vec3 light_diffuse[8]; - -float calcDirectionalLight(vec3 n, vec3 l) -{ - float a = max(dot(n,l),0.0); - return a; -} - -float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) -{ - //get light vector - vec3 lv = lp.xyz-v; - - //get distance - float d = dot(lv,lv); - - float da = 0.0; - - if (d > 0.0 && la > 0.0 && fa > 0.0) - { - //normalize light vector - lv = normalize(lv); - - //distance attenuation - float dist2 = d/la; - da = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); - - // spotlight coefficient. - float spot = max(dot(-ln, lv), is_pointlight); - da *= spot*spot; // GL_SPOT_EXPONENT=2 - - //angular attenuation - da *= max(dot(n, lv), 0.0); - } - - return da; -} - -void main() -{ - vary_texcoord0 = texcoord0; - - vec4 pos; - vec3 norm; - - mat4 trans = getSkinnedTransform(); - vec4 pos_in = vec4(position.xyz, 1.0); - pos.x = dot(trans[0], pos_in); - pos.y = dot(trans[1], pos_in); - pos.z = dot(trans[2], pos_in); - pos.w = 1.0; - - norm.x = dot(trans[0].xyz, normal); - norm.y = dot(trans[1].xyz, normal); - norm.z = dot(trans[2].xyz, normal); - norm = normalize(norm); - - vec4 frag_pos = projection_matrix * pos; - gl_Position = frag_pos; - - vary_position = pos.xyz; - - calcAtmospherics(pos.xyz); - - vec4 col = vec4(0.0, 0.0, 0.0, 1.0); - - // Collect normal lights - col.rgb += light_diffuse[2].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[2], light_direction[2], light_attenuation[2].x, light_attenuation[2].y, light_attenuation[2].z); - col.rgb += light_diffuse[3].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[3], light_direction[3], light_attenuation[3].x, light_attenuation[3].y, light_attenuation[3].z); - col.rgb += light_diffuse[4].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[4], light_direction[4], light_attenuation[4].x, light_attenuation[4].y, light_attenuation[4].z); - col.rgb += light_diffuse[5].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[5], light_direction[5], light_attenuation[5].x, light_attenuation[5].y, light_attenuation[5].z); - col.rgb += light_diffuse[6].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[6], light_direction[6], light_attenuation[6].x, light_attenuation[6].y, light_attenuation[6].z); - col.rgb += light_diffuse[7].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[7], light_direction[7], light_attenuation[7].x, light_attenuation[7].y, light_attenuation[7].z); - - vary_pointlight_col = col.rgb*color.rgb; - - col.rgb = vec3(0,0,0); - - // Add windlight lights - col.rgb = atmosAmbient(vec3(0.)); - - vary_ambient = col.rgb*color.rgb; - vary_directional = color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, light_position[0].xyz), 0.0)); - - col.rgb = col.rgb * color.rgb; - - vertex_color = col; - - - - vary_fragcoord.xyz = frag_pos.xyz + vec3(0,0,near_clip); -} - - diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl index bcccbf77d2..662c762bca 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl @@ -31,6 +31,8 @@ out vec4 frag_data[3]; uniform sampler2D diffuseMap; +uniform float minimum_alpha; + VARYING vec3 vary_normal; VARYING vec2 vary_texcoord0; @@ -44,7 +46,7 @@ void main() { vec4 diff = texture2D(diffuseMap, vary_texcoord0.xy); - if (diff.a < 0.2) + if (diff.a < minimum_alpha) { discard; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl index eebeb91bf8..a4f54dff70 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl @@ -46,11 +46,6 @@ VARYING vec2 vary_fragcoord; uniform mat4 inv_proj; uniform vec2 screen_res; -vec3 getKern(int i) -{ - return kern[i]; -} - vec4 getPosition(vec2 pos_screen) { float depth = texture2DRect(depthMap, pos_screen.xy).r; @@ -64,22 +59,6 @@ vec4 getPosition(vec2 pos_screen) return pos; } -#ifdef SINGLE_FP_ONLY -vec2 encode_normal(vec3 n) -{ - vec2 sn; - sn.xy = (n.xy * vec2(0.5f,0.5f)) + vec2(0.5f,0.5f); - return sn; -} - -vec3 decode_normal (vec2 enc) -{ - vec3 n; - n.xy = (enc.xy * vec2(2.0f,2.0f)) - vec2(1.0f,1.0f); - n.z = sqrt(1.0f - dot(n.xy,n.xy)); - return n; -} -#else vec2 encode_normal(vec3 n) { float f = sqrt(8 * n.z + 8); @@ -96,7 +75,6 @@ vec3 decode_normal (vec2 enc) n.z = 1-f/2; return n; } -#endif void main() { @@ -110,7 +88,7 @@ void main() vec2 dlt = kern_scale * delta / (1.0+norm.xy*norm.xy); dlt /= max(-pos.z*dist_factor, 1.0); - vec2 defined_weight = getKern(0).xy; // special case the first (centre) sample's weight in the blur; we have to sample it anyway so we get it for 'free' + vec2 defined_weight = kern[0].xy; // special case the first (centre) sample's weight in the blur; we have to sample it anyway so we get it for 'free' vec4 col = defined_weight.xyxx * ccol; // relax tolerance according to distance to avoid speckling artifacts, as angles and distances are a lot more abrupt within a small screen area at larger distances @@ -120,28 +98,33 @@ void main() float tc_mod = 0.5*(tc.x + tc.y); // mod(tc.x+tc.y,2) tc_mod -= floor(tc_mod); tc_mod *= 2.0; - tc += ( (tc_mod - 0.5) * getKern(1).z * dlt * 0.5 ); + tc += ( (tc_mod - 0.5) * kern[1].z * dlt * 0.5 ); for (int i = 1; i < 4; i++) { - vec2 samptc = tc + getKern(i).z*dlt; - vec3 samppos = getPosition(samptc).xyz; + vec2 samptc = tc + kern[i].z*dlt; + vec3 samppos = getPosition(samptc).xyz; + float d = dot(norm.xyz, samppos.xyz-pos.xyz);// dist from plane + if (d*d <= pointplanedist_tolerance_pow2) { - col += texture2DRect(lightMap, samptc)*getKern(i).xyxx; - defined_weight += getKern(i).xy; + col += texture2DRect(lightMap, samptc)*kern[i].xyxx; + defined_weight += kern[i].xy; } } + for (int i = 1; i < 4; i++) { - vec2 samptc = tc - getKern(i).z*dlt; - vec3 samppos = getPosition(samptc).xyz; + vec2 samptc = tc - kern[i].z*dlt; + vec3 samppos = getPosition(samptc).xyz; + float d = dot(norm.xyz, samppos.xyz-pos.xyz);// dist from plane + if (d*d <= pointplanedist_tolerance_pow2) { - col += texture2DRect(lightMap, samptc)*getKern(i).xyxx; - defined_weight += getKern(i).xy; + col += texture2DRect(lightMap, samptc)*kern[i].xyxx; + defined_weight += kern[i].xy; } } diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl index 59d109b886..8525e13333 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl @@ -50,7 +50,7 @@ void main() { discard; } - + frag_data[0] = vec4(col.rgb, 0.0); frag_data[1] = vec4(0,0,0,0); vec3 nvn = normalize(vary_normal); diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl index a2c3ec3355..adc361d7a2 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl @@ -43,10 +43,12 @@ vec2 encode_normal(vec3 n) void main() { vec3 col = vertex_color.rgb * diffuseLookup(vary_texcoord0.xy).rgb; + + vec3 spec; + spec.rgb = vec3(vertex_color.a); frag_data[0] = vec4(col, 0.0); - frag_data[1] = vertex_color.aaaa; // spec - frag_data[1] = vec4(vec3(vertex_color.a), vertex_color.a+(1.0-vertex_color.a)*vertex_color.a); // spec - from former class3 - maybe better, but not so well tested + frag_data[1] = vec4(spec, vertex_color.a); // spec vec3 nvn = normalize(vary_normal); frag_data[2] = vec4(encode_normal(nvn.xyz), vertex_color.a, 0.0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl index dc1dead656..f22b16965c 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl @@ -35,29 +35,143 @@ out vec4 frag_color; uniform sampler2D diffuseMap; #endif +VARYING vec3 vary_position; VARYING vec4 vertex_color; VARYING vec2 vary_texcoord0; -vec3 fullbrightAtmosTransport(vec3 light); -vec3 fullbrightScaleSoftClip(vec3 light); +vec3 srgb_to_linear(vec3 cs) +{ + vec3 low_range = cs / vec3(12.92); + vec3 high_range = pow((cs+vec3(0.055))/vec3(1.055), vec3(2.4)); + bvec3 lte = lessThanEqual(cs,vec3(0.04045)); + +#ifdef OLD_SELECT + vec3 result; + result.r = lte.r ? low_range.r : high_range.r; + result.g = lte.g ? low_range.g : high_range.g; + result.b = lte.b ? low_range.b : high_range.b; + return result; +#else + return mix(high_range, low_range, lte); +#endif + +} + +vec3 linear_to_srgb(vec3 cl) +{ + cl = clamp(cl, vec3(0), vec3(1)); + vec3 low_range = cl * 12.92; + vec3 high_range = 1.055 * pow(cl, vec3(0.41666)) - 0.055; + bvec3 lt = lessThan(cl,vec3(0.0031308)); + +#ifdef OLD_SELECT + vec3 result; + result.r = lt.r ? low_range.r : high_range.r; + result.g = lt.g ? low_range.g : high_range.g; + result.b = lt.b ? low_range.b : high_range.b; + return result; +#else + return mix(high_range, low_range, lt); +#endif + +} + +vec3 fullbrightAtmosTransportDeferred(vec3 light) +{ + return light; +} + +vec3 fullbrightScaleSoftClipDeferred(vec3 light) +{ + //soft clip effect: + return light; +} + +#ifdef HAS_ALPHA_MASK +uniform float minimum_alpha; +#endif + +#ifdef WATER_FOG +uniform vec4 waterPlane; +uniform vec4 waterFogColor; +uniform float waterFogDensity; +uniform float waterFogKS; + +vec4 applyWaterFogDeferred(vec3 pos, vec4 color) +{ + //normalize view vector + vec3 view = normalize(pos); + float es = -(dot(view, waterPlane.xyz)); + + //find intersection point with water plane and eye vector + + //get eye depth + float e0 = max(-waterPlane.w, 0.0); + + vec3 int_v = waterPlane.w > 0.0 ? view * waterPlane.w/es : vec3(0.0, 0.0, 0.0); + + //get object depth + float depth = length(pos - int_v); + + //get "thickness" of water + float l = max(depth, 0.1); + + float kd = waterFogDensity; + float ks = waterFogKS; + vec4 kc = waterFogColor; + + float F = 0.98; + + float t1 = -kd * pow(F, ks * e0); + float t2 = kd + ks * es; + float t3 = pow(F, t2*l) - 1.0; + + float L = min(t1/t2*t3, 1.0); + + float D = pow(0.98, l*kd); + + color.rgb = color.rgb * D + kc.rgb * L; + color.a = kc.a + color.a; + + return color; +} +#endif void main() { #if HAS_DIFFUSE_LOOKUP - vec4 color = diffuseLookup(vary_texcoord0.xy)*vertex_color; + vec4 color = diffuseLookup(vary_texcoord0.xy); #else - vec4 color = texture2D(diffuseMap, vary_texcoord0.xy)*vertex_color; + vec4 color = texture2D(diffuseMap, vary_texcoord0.xy); #endif - color.rgb = pow(color.rgb,vec3(2.2f,2.2f,2.2f)); - - color.rgb = fullbrightAtmosTransport(color.rgb); + float final_alpha = color.a * vertex_color.a; - color.rgb = fullbrightScaleSoftClip(color.rgb); +#ifdef HAS_ALPHA_MASK + if (color.a < minimum_alpha) + { + discard; + } +#endif + + color.rgb *= vertex_color.rgb; + color.rgb = srgb_to_linear(color.rgb); + color.rgb = fullbrightAtmosTransportDeferred(color.rgb); + color.rgb = fullbrightScaleSoftClipDeferred(color.rgb); + + color.rgb = linear_to_srgb(color.rgb); - color.rgb = pow(color.rgb, vec3(1.0/2.2)); +#ifdef WATER_FOG + vec3 pos = vary_position; + vec4 fogged = applyWaterFogDeferred(pos, vec4(color.rgb, final_alpha)); + color.rgb = fogged.rgb; + color.a = fogged.a; +#else + color.a = final_alpha; +#endif - frag_color = color; + frag_color.rgb = color.rgb; + frag_color.a = color.a; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl index 3f09a15375..8e899e3e0f 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl @@ -40,6 +40,9 @@ vec3 atmosAffectDirectionalLight(float lightIntensity); vec3 scaleDownLight(vec3 light); vec3 scaleUpLight(vec3 light); +#ifdef WATER_FOG +VARYING vec3 vary_position; +#endif VARYING vec4 vertex_color; VARYING vec2 vary_texcoord0; @@ -53,7 +56,11 @@ void main() passTextureIndex(); gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); - + +#ifdef WATER_FOG + vary_position = pos.xyz; +#endif + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; calcAtmospherics(pos.xyz); diff --git a/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl index 2cef8f2a5d..a2b4b3b8c8 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl @@ -24,6 +24,7 @@ */ #extension GL_ARB_texture_rectangle : enable +#extension GL_ARB_shader_texture_lod : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; diff --git a/indra/newview/app_settings/shaders/class1/deferred/giF.glsl b/indra/newview/app_settings/shaders/class1/deferred/giF.glsl deleted file mode 100755 index da1b234240..0000000000 --- a/indra/newview/app_settings/shaders/class1/deferred/giF.glsl +++ /dev/null @@ -1,190 +0,0 @@ -/** - * @file giF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#extension GL_ARB_texture_rectangle : enable - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif - -uniform sampler2DRect depthMap; -uniform sampler2DRect normalMap; -uniform sampler2D noiseMap; - -uniform sampler2D diffuseGIMap; -uniform sampler2D normalGIMap; -uniform sampler2D depthGIMap; - -uniform sampler2D lightFunc; - -// Inputs -VARYING vec2 vary_fragcoord; - -uniform vec2 screen_res; - -uniform mat4 inv_proj; -uniform mat4 gi_mat; //gPipeline.mGIMatrix - eye space to sun space -uniform mat4 gi_mat_proj; //gPipeline.mGIMatrixProj - eye space to projected sun space -uniform mat4 gi_norm_mat; //gPipeline.mGINormalMatrix - eye space normal to sun space normal matrix -uniform mat4 gi_inv_proj; //gPipeline.mGIInvProj - projected sun space to sun space -uniform float gi_radius; -uniform float gi_intensity; -uniform int gi_samples; -uniform vec2 gi_kern[25]; -uniform vec2 gi_scale; -uniform vec3 gi_quad; -uniform vec3 gi_spec; -uniform float gi_direction_weight; -uniform float gi_light_offset; - -vec4 getPosition(vec2 pos_screen) -{ - float depth = texture2DRect(depthMap, pos_screen.xy).a; - vec2 sc = pos_screen.xy*2.0; - sc /= screen_res; - sc -= vec2(1.0,1.0); - vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); - vec4 pos = inv_proj * ndc; - pos /= pos.w; - pos.w = 1.0; - return pos; -} - -vec4 getGIPosition(vec2 gi_tc) -{ - float depth = texture2D(depthGIMap, gi_tc).a; - vec2 sc = gi_tc*2.0; - sc -= vec2(1.0, 1.0); - vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); - vec4 pos = gi_inv_proj*ndc; - pos.xyz /= pos.w; - pos.w = 1.0; - return pos; -} - -vec3 giAmbient(vec3 pos, vec3 norm) -{ - vec4 gi_c = gi_mat_proj * vec4(pos, 1.0); - gi_c.xyz /= gi_c.w; - - vec4 gi_pos = gi_mat*vec4(pos,1.0); - vec3 gi_norm = (gi_norm_mat*vec4(norm,1.0)).xyz; - gi_norm = normalize(gi_norm); - - vec2 tcx = gi_norm.xy; - vec2 tcy = gi_norm.yx; - - vec4 eye_pos = gi_mat*vec4(0,0,0,1.0); - - vec3 eye_dir = normalize(gi_pos.xyz-eye_pos.xyz/eye_pos.w); - - //vec3 eye_dir = vec3(0,0,-1); - //eye_dir = (gi_norm_mat*vec4(eye_dir, 1.0)).xyz; - //eye_dir = normalize(eye_dir); - - //float round_x = gi_scale.x; - //float round_y = gi_scale.y; - - vec3 debug = texture2D(normalGIMap, gi_c.xy).rgb*0.5+0.5; - debug.xz = vec2(0.0,0.0); - //debug = fract(debug); - - float round_x = 1.0/64.0; - float round_y = 1.0/64.0; - - //gi_c.x = floor(gi_c.x/round_x+0.5)*round_x; - //gi_c.y = floor(gi_c.y/round_y+0.5)*round_y; - - float fda = 0.0; - vec3 fdiff = vec3(0,0,0); - - vec3 rcol = vec3(0,0,0); - - float fsa = 0.0; - - for (int i = -1; i < 2; i+=2 ) - { - for (int j = -1; j < 2; j+=2) - { - vec2 tc = vec2(i, j)*0.75; - vec3 nz = texture2D(noiseMap, vary_fragcoord.xy/128.0+tc*0.5).xyz; - //tc += gi_norm.xy*nz.z; - tc += nz.xy*2.0; - tc /= gi_samples; - tc += gi_c.xy; - - vec3 lnorm = -normalize(texture2D(normalGIMap, tc.xy).xyz*2.0-1.0); - vec3 lpos = getGIPosition(tc.xy).xyz; - - vec3 at = lpos-gi_pos.xyz; - float dist = dot(at,at); - float da = clamp(1.0/(gi_spec.x*dist), 0.0, 1.0); - - if (da > 0.0) - { - //add angular attenuation - vec3 ldir = at; - float ang_atten = clamp(dot(ldir, gi_norm), 0.0, 1.0); - - float ld = -dot(ldir, lnorm); - - if (ang_atten > 0.0 && ld < 0.0) - { - vec3 diff = texture2D(diffuseGIMap, tc.xy).xyz; - da = da*ang_atten; - fda += da; - fdiff += diff*da; - } - } - } - } - - fdiff /= max(gi_spec.y*fda, gi_quad.z); - fdiff = clamp(fdiff, vec3(0), vec3(1)); - - vec3 ret = fda*fdiff; - //ret = ret*ret*gi_quad.x+ret*gi_quad.y+gi_quad.z; - - //fda *= nz.z; - - //rcol.rgb *= gi_intensity; - //return rcol.rgb+vary_AmblitColor.rgb*0.25; - //return vec4(debug, 0.0); - //return vec4(fda*fdiff, 0.0); - return clamp(ret,vec3(0.0), vec3(1.0)); - //return debug.xyz; -} - -void main() -{ - vec2 pos_screen = vary_fragcoord.xy; - vec4 pos = getPosition(pos_screen); - vec3 norm = texture2DRect(normalMap, pos_screen).xyz; - norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm - - frag_color.xyz = giAmbient(pos, norm); -} diff --git a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl index bc0719cb82..f8fdde43f9 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl @@ -38,6 +38,42 @@ uniform sampler2D specularMap; VARYING vec2 vary_texcoord0; +vec3 decode_normal (vec2 enc) +{ + vec2 fenc = enc*4-2; + float f = dot(fenc,fenc); + float g = sqrt(1-f/4); + vec3 n; + n.xy = fenc*g; + n.z = 1-f/2; + return n; +} + +vec2 encode_normal(vec3 n) +{ + float f = sqrt(8 * n.z + 8); + return n.xy / f + 0.5; +} + +vec3 linear_to_srgb(vec3 cl) +{ + cl = clamp(cl, vec3(0), vec3(1)); + vec3 low_range = cl * 12.92; + vec3 high_range = 1.055 * pow(cl, vec3(0.41666)) - 0.055; + bvec3 lt = lessThan(cl,vec3(0.0031308)); + +#ifdef OLD_SELECT + vec3 result; + result.r = lt.r ? low_range.r : high_range.r; + result.g = lt.g ? low_range.g : high_range.g; + result.b = lt.b ? low_range.b : high_range.b; + return result; +#else + return mix(high_range, low_range, lt); +#endif + +} + void main() { vec4 col = texture2D(diffuseMap, vary_texcoord0.xy); @@ -47,7 +83,12 @@ void main() discard; } - frag_data[0] = vec4(col.rgb, col.a * 0.005); - frag_data[1] = texture2D(specularMap, vary_texcoord0.xy); - frag_data[2] = vec4(texture2D(normalMap, vary_texcoord0.xy).xyz, 0.0); + vec4 norm = texture2D(normalMap, vary_texcoord0.xy); + vec4 spec = texture2D(specularMap, vary_texcoord0.xy); + + col.rgb = linear_to_srgb(col.rgb); + + frag_data[0] = vec4(col.rgb, 0.0); + frag_data[1] = spec; + frag_data[2] = vec4(norm.xy,0,0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl index de2f74b681..07d28ed4cd 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl @@ -29,6 +29,44 @@ #define DIFFUSE_ALPHA_MODE_EMISSIVE 3 uniform float emissive_brightness; +uniform float display_gamma; + +vec3 srgb_to_linear(vec3 cs) +{ + vec3 low_range = cs / vec3(12.92); + vec3 high_range = pow((cs+vec3(0.055))/vec3(1.055), vec3(2.4)); + bvec3 lte = lessThanEqual(cs,vec3(0.04045)); + +#ifdef OLD_SELECT + vec3 result; + result.r = lte.r ? low_range.r : high_range.r; + result.g = lte.g ? low_range.g : high_range.g; + result.b = lte.b ? low_range.b : high_range.b; + return result; +#else + return mix(high_range, low_range, lte); +#endif + +} + +vec3 linear_to_srgb(vec3 cl) +{ + cl = clamp(cl, vec3(0), vec3(1)); + vec3 low_range = cl * 12.92; + vec3 high_range = 1.055 * pow(cl, vec3(0.41666)) - 0.055; + bvec3 lt = lessThan(cl,vec3(0.0031308)); + +#ifdef OLD_SELECT + vec3 result; + result.r = lt.r ? low_range.r : high_range.r; + result.g = lt.g ? low_range.g : high_range.g; + result.b = lt.b ? low_range.b : high_range.b; + return result; +#else + return mix(high_range, low_range, lt); +#endif + +} #if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_BLEND) @@ -114,6 +152,52 @@ uniform vec3 light_direction[8]; uniform vec3 light_attenuation[8]; uniform vec3 light_diffuse[8]; +#ifdef WATER_FOG +uniform vec4 waterPlane; +uniform vec4 waterFogColor; +uniform float waterFogDensity; +uniform float waterFogKS; + +vec4 applyWaterFogDeferred(vec3 pos, vec4 color) +{ + //normalize view vector + vec3 view = normalize(pos); + float es = -(dot(view, waterPlane.xyz)); + + //find intersection point with water plane and eye vector + + //get eye depth + float e0 = max(-waterPlane.w, 0.0); + + vec3 int_v = waterPlane.w > 0.0 ? view * waterPlane.w/es : vec3(0.0, 0.0, 0.0); + + //get object depth + float depth = length(pos - int_v); + + //get "thickness" of water + float l = max(depth, 0.1); + + float kd = waterFogDensity; + float ks = waterFogKS; + vec4 kc = waterFogColor; + + float F = 0.98; + + float t1 = -kd * pow(F, ks * e0); + float t2 = kd + ks * es; + float t3 = pow(F, t2*l) - 1.0; + + float L = min(t1/t2*t3, 1.0); + + float D = pow(0.98, l*kd); + + color.rgb = color.rgb * D + kc.rgb * L; + color.a = kc.a + color.a; + + return color; +} +#endif + vec3 calcDirectionalLight(vec3 n, vec3 l) { float a = max(dot(n,l),0.0); @@ -127,7 +211,7 @@ vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 npos, vec3 diffuse, vec4 spe vec3 lv = lp.xyz-v; //get distance - float d = dot(lv,lv); + float d = length(lv); float da = 1.0; @@ -139,8 +223,10 @@ vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 npos, vec3 diffuse, vec4 spe lv = normalize(lv); //distance attenuation - float dist2 = d/la; - float dist_atten = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); + float dist = d/la; + float dist_atten = clamp(1.0-(dist-1.0*(1.0-fa))/fa, 0.0, 1.0); + dist_atten *= dist_atten; + dist_atten *= 2.0; // spotlight coefficient. float spot = max(dot(-ln, lv), is_pointlight); @@ -197,10 +283,13 @@ vec4 getPosition_d(vec2 pos_screen, float depth) return pos; } +#ifndef WATER_FOG vec3 getPositionEye() { return vary_PositionEye; } +#endif + vec3 getSunlitColor() { return vary_SunlitColor; @@ -321,9 +410,9 @@ void calcAtmospherics(vec3 inPositionEye, float ambFactor) { + tmpAmbient))); //brightness of surface both sunlight and ambient - setSunlitColor(pow(vec3(sunlight * .5), vec3(2.2)) * 2.2); - setAmblitColor(pow(vec3(tmpAmbient * .25), vec3(2.2)) * 2.2); - setAdditiveColor(pow(getAdditiveColor() * vec3(1.0 - temp1), vec3(2.2)) * 2.2); + setSunlitColor(vec3(sunlight * .5)); + setAmblitColor(vec3(tmpAmbient * .25)); + setAdditiveColor(getAdditiveColor() * vec3(1.0 - temp1)); } vec3 atmosLighting(vec3 light) @@ -426,22 +515,6 @@ VARYING vec3 vary_normal; VARYING vec4 vertex_color; VARYING vec2 vary_texcoord0; -#ifdef SINGLE_FP_ONLY -vec2 encode_normal(vec3 n) -{ - vec2 sn; - sn.xy = (n.xy * vec2(0.5f,0.5f)) + vec2(0.5f,0.5f); - return sn; -} - -vec3 decode_normal (vec2 enc) -{ - vec3 n; - n.xy = (enc.xy * vec2(2.0f,2.0f)) - vec2(1.0f,1.0f); - n.z = sqrt(1.0f - dot(n.xy,n.xy)); - return n; -} -#else vec2 encode_normal(vec3 n) { float f = sqrt(8 * n.z + 8); @@ -458,7 +531,6 @@ vec3 decode_normal (vec2 enc) n.z = 1-f/2; return n; } -#endif void main() { @@ -473,8 +545,8 @@ void main() #endif #if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_BLEND) - vec3 old_diffcol = diffcol.rgb; - diffcol.rgb = pow(diffcol.rgb, vec3(2.2)); + vec3 gamma_diff = diffcol.rgb; + diffcol.rgb = srgb_to_linear(diffcol.rgb); #endif #if HAS_SPECULAR_MAP @@ -500,6 +572,9 @@ void main() norm.xyz = tnorm; norm.xyz = normalize(norm.xyz); + vec2 abnormal = encode_normal(norm.xyz); + norm.xyz = decode_normal(abnormal.xy); + vec4 final_color = diffcol; #if (DIFFUSE_ALPHA_MODE != DIFFUSE_ALPHA_MODE_EMISSIVE) @@ -603,22 +678,26 @@ void main() vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); float da =dot(norm.xyz, sun_dir.xyz); + float final_da = da; final_da = min(final_da, shadow); - final_da = max(final_da, diffuse.a); + //final_da = max(final_da, diffuse.a); final_da = max(final_da, 0.0f); + final_da = min(final_da, 1.0f); + final_da = pow(final_da, 1.0/1.3); col.rgb = atmosAmbient(col); - float ambient = min(abs(dot(norm.xyz, sun_dir.xyz)), 1.0); + float ambient = min(abs(da), 1.0); ambient *= 0.5; ambient *= ambient; ambient = (1.0-ambient); col.rgb *= ambient; - col.rgb = col.rgb + atmosAffectDirectionalLight(final_da * 2.6); - col.rgb *= diffuse.rgb; + col.rgb = col.rgb + atmosAffectDirectionalLight(final_da); + + col.rgb *= gamma_diff.rgb; float glare = 0.0; @@ -641,15 +720,15 @@ void main() col += spec_contrib; } - col = mix(col.rgb, old_diffcol.rgb, diffuse.a); + + col = mix(col.rgb, diffcol.rgb, diffuse.a); if (envIntensity > 0.0) { //add environmentmap vec3 env_vec = env_mat * refnormpersp; - float exponent = mix(2.2, 1.0, diffuse.a); - - vec3 refcol = pow(textureCube(environmentMap, env_vec).rgb, vec3(exponent))*exponent; + + vec3 refcol = textureCube(environmentMap, env_vec).rgb; col = mix(col.rgb, refcol, envIntensity); @@ -660,17 +739,20 @@ void main() glare += cur_glare; } - float exponent = mix(1.0, 2.2, diffuse.a); - col = pow(col, vec3(exponent)); - - - col = mix(atmosLighting(col), fullbrightAtmosTransport(col), diffuse.a); - col = mix(scaleSoftClip(col), fullbrightScaleSoftClip(col), diffuse.a); + //col = mix(atmosLighting(col), fullbrightAtmosTransport(col), diffuse.a); + //col = mix(scaleSoftClip(col), fullbrightScaleSoftClip(col), diffuse.a); + + col = atmosLighting(col); + col = scaleSoftClip(col); + + //convert to linear space before adding local lights + col = srgb_to_linear(col); - vec3 npos = normalize(-pos.xyz); + + vec3 light = vec3(0,0,0); - #define LIGHT_LOOP(i) col.rgb = col.rgb + calcPointLightOrSpotLight(light_diffuse[i].rgb, npos, diffuse.rgb, final_specular, pos.xyz, norm.xyz, light_position[i], light_direction[i].xyz, light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z, glare); + #define LIGHT_LOOP(i) light.rgb += calcPointLightOrSpotLight(light_diffuse[i].rgb, npos, diffuse.rgb, final_specular, pos.xyz, norm.xyz, light_position[i], light_direction[i].xyz, light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z, glare); LIGHT_LOOP(1) LIGHT_LOOP(2) @@ -680,12 +762,22 @@ void main() LIGHT_LOOP(6) LIGHT_LOOP(7) + col.rgb += light.rgb; + + glare = min(glare, 1.0); + float al = max(diffcol.a,glare)*vertex_color.a; - col.rgb = pow(col.rgb, vec3(1.0/2.2)); + //convert to gamma space for display on screen + col.rgb = linear_to_srgb(col.rgb); + +#ifdef WATER_FOG + vec4 temp = applyWaterFogDeferred(pos, vec4(col.rgb, al)); + col.rgb = temp.rgb; + al = temp.a; +#endif frag_color.rgb = col.rgb; - glare = min(glare, 1.0); - frag_color.a = max(diffcol.a,glare)*vertex_color.a; + frag_color.a = al; #else frag_data[0] = final_color; @@ -693,3 +785,4 @@ void main() frag_data[2] = final_normal; // XY = Normal. Z = Env. intensity. #endif } + diff --git a/indra/newview/app_settings/shaders/class1/deferred/materialV.glsl b/indra/newview/app_settings/shaders/class1/deferred/materialV.glsl index b25032866b..393d1e69da 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/materialV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/materialV.glsl @@ -142,3 +142,4 @@ vary_normal = n; #endif #endif } + diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl index b35ba549f6..236567219b 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl @@ -45,9 +45,8 @@ uniform float sun_wash; uniform int light_count; -#define MAX_LIGHT_COUNT 16 -uniform vec4 light[MAX_LIGHT_COUNT]; -uniform vec4 light_col[MAX_LIGHT_COUNT]; +uniform vec4 light[LIGHT_COUNT]; +uniform vec4 light_col[LIGHT_COUNT]; VARYING vec4 vary_fragcoord; uniform vec2 screen_res; @@ -56,22 +55,6 @@ uniform float far_z; uniform mat4 inv_proj; -#ifdef SINGLE_FP_ONLY -vec2 encode_normal(vec3 n) -{ - vec2 sn; - sn.xy = (n.xy * vec2(0.5f,0.5f)) + vec2(0.5f,0.5f); - return sn; -} - -vec3 decode_normal (vec2 enc) -{ - vec3 n; - n.xy = (enc.xy * vec2(2.0f,2.0f)) - vec2(1.0f,1.0f); - n.z = sqrt(1.0f - dot(n.xy,n.xy)); - return n; -} -#else vec2 encode_normal(vec3 n) { float f = sqrt(8 * n.z + 8); @@ -88,7 +71,6 @@ vec3 decode_normal (vec2 enc) n.z = 1-f/2; return n; } -#endif vec4 getPosition(vec2 pos_screen) { @@ -117,39 +99,30 @@ void main() norm = normalize(norm); vec4 spec = texture2DRect(specularRect, frag.xy); vec3 diff = texture2DRect(diffuseRect, frag.xy).rgb; + float noise = texture2D(noiseMap, frag.xy/128.0).b; vec3 out_col = vec3(0,0,0); vec3 npos = normalize(-pos); // As of OSX 10.6.7 ATI Apple's crash when using a variable size loop - for (int i = 0; i < MAX_LIGHT_COUNT; ++i) + for (int i = 0; i < LIGHT_COUNT; ++i) { - bool light_contrib = (i < light_count); - vec3 lv = light[i].xyz-pos; - float dist2 = dot(lv,lv); - dist2 /= light[i].w; - if (dist2 > 1.0) + float dist = length(lv); + dist /= light[i].w; + if (dist <= 1.0) { - light_contrib = false; - } - float da = dot(norm, lv); - if (da < 0.0) - { - light_contrib = false; - } - - if (light_contrib) + if (da > 0.0) { lv = normalize(lv); da = dot(norm, lv); float fa = light_col[i].a+1.0; - float dist_atten = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); + float dist_atten = clamp(1.0-(dist-1.0*(1.0-fa))/fa, 0.0, 1.0); + dist_atten *= dist_atten; + dist_atten *= 2.0; - dist_atten = pow(dist_atten, 2.2) * 2.2; - dist_atten *= noise; float lit = da * dist_atten; @@ -183,12 +156,9 @@ void main() out_col += col; } } - - if (dot(out_col, out_col) <= 0.0) - { - discard; } + frag_color.rgb = out_col; frag_color.a = 0.0; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl index 36fb4afa52..0e6ab80d4d 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl @@ -32,6 +32,7 @@ out vec4 frag_color; //class 1 -- no shadows #extension GL_ARB_texture_rectangle : enable +#extension GL_ARB_shader_texture_lod : enable uniform sampler2DRect diffuseRect; uniform sampler2DRect specularRect; @@ -67,22 +68,6 @@ uniform vec2 screen_res; uniform mat4 inv_proj; -#ifdef SINGLE_FP_ONLY -vec2 encode_normal(vec3 n) -{ - vec2 sn; - sn.xy = (n.xy * vec2(0.5f,0.5f)) + vec2(0.5f,0.5f); - return sn; -} - -vec3 decode_normal (vec2 enc) -{ - vec3 n; - n.xy = (enc.xy * vec2(2.0f,2.0f)) - vec2(1.0f,1.0f); - n.z = sqrt(1.0f - dot(n.xy,n.xy)); - return n; -} -#else vec2 encode_normal(vec3 n) { float f = sqrt(8 * n.z + 8); @@ -99,17 +84,48 @@ vec3 decode_normal (vec2 enc) n.z = 1-f/2; return n; } +vec3 srgb_to_linear(vec3 cs) +{ + vec3 low_range = cs / vec3(12.92); + vec3 high_range = pow((cs+vec3(0.055))/vec3(1.055), vec3(2.4)); + bvec3 lte = lessThanEqual(cs,vec3(0.04045)); + +#ifdef OLD_SELECT + vec3 result; + result.r = lte.r ? low_range.r : high_range.r; + result.g = lte.g ? low_range.g : high_range.g; + result.b = lte.b ? low_range.b : high_range.b; + return result; +#else + return mix(high_range, low_range, lte); #endif -vec4 correctWithGamma(vec4 col) +} + +vec3 linear_to_srgb(vec3 cl) { - return vec4(pow(col.rgb, vec3(2.2)), col.a); + cl = clamp(cl, vec3(0), vec3(1)); + vec3 low_range = cl * 12.92; + vec3 high_range = 1.055 * pow(cl, vec3(0.41666)) - 0.055; + bvec3 lt = lessThan(cl,vec3(0.0031308)); + +#ifdef OLD_SELECT + vec3 result; + result.r = lt.r ? low_range.r : high_range.r; + result.g = lt.g ? low_range.g : high_range.g; + result.b = lt.b ? low_range.b : high_range.b; + return result; +#else + return mix(high_range, low_range, lt); +#endif + } + vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod) { vec4 ret = texture2DLod(projectionMap, tc, lod); - ret = correctWithGamma(ret); + ret.rgb = srgb_to_linear(ret.rgb); vec2 dist = tc-vec2(0.5); @@ -125,7 +141,7 @@ vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod) vec4 texture2DLodDiffuse(sampler2D projectionMap, vec2 tc, float lod) { vec4 ret = texture2DLod(projectionMap, tc, lod); - ret = correctWithGamma(ret); + ret.rgb = srgb_to_linear(ret.rgb); vec2 dist = vec2(0.5) - abs(tc-vec2(0.5)); @@ -143,7 +159,7 @@ vec4 texture2DLodDiffuse(sampler2D projectionMap, vec2 tc, float lod) vec4 texture2DLodAmbient(sampler2D projectionMap, vec2 tc, float lod) { vec4 ret = texture2DLod(projectionMap, tc, lod); - ret = correctWithGamma(ret); + ret.rgb = srgb_to_linear(ret.rgb); vec2 dist = tc-vec2(0.5); @@ -177,9 +193,9 @@ void main() vec3 pos = getPosition(frag.xy).xyz; vec3 lv = center.xyz-pos.xyz; - float dist2 = dot(lv,lv); - dist2 /= size; - if (dist2 > 1.0) + float dist = length(lv); + dist /= size; + if (dist > 1.0) { discard; } @@ -201,8 +217,10 @@ void main() proj_tc.xyz /= proj_tc.w; float fa = falloff+1.0; - float dist_atten = min(1.0-(dist2-1.0*(1.0-fa))/fa, 1.0); - dist_atten = pow(dist_atten, 2.2) * 2.2; + float dist_atten = min(1.0-(dist-1.0*(1.0-fa))/fa, 1.0); + dist_atten *= dist_atten; + dist_atten *= 2.0; + if (dist_atten <= 0.0) { discard; @@ -293,14 +311,11 @@ void main() vec3 pfinal = pos + ref * dot(pdelta, proj_n)/ds; vec4 stc = (proj_mat * vec4(pfinal.xyz, 1.0)); - + stc /= stc.w; if (stc.z > 0.0) { - stc.xy /= stc.w; - - float fatten = clamp(envIntensity*envIntensity+envIntensity*0.5, 0.25, 1.0); + float fatten = clamp(envIntensity*envIntensity+envIntensity*0.25, 0.25, 1.0); - //stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); if (stc.x < 1.0 && @@ -308,7 +323,7 @@ void main() stc.x > 0.0 && stc.y > 0.0) { - col += color.rgb*texture2DLodSpecular(projectionMap, stc.xy, proj_lod-envIntensity*proj_lod).rgb*spec.rgb; + col += color.rgb*texture2DLodSpecular(projectionMap, stc.xy, proj_lod).rgb*spec.rgb; } } } diff --git a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl index c6b1eb7c8d..106d48bd71 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl @@ -54,22 +54,6 @@ uniform vec2 screen_res; uniform mat4 inv_proj; uniform vec4 viewport; -#ifdef SINGLE_FP_ONLY -vec2 encode_normal(vec3 n) -{ - vec2 sn; - sn.xy = (n.xy * vec2(0.5f,0.5f)) + vec2(0.5f,0.5f); - return sn; -} - -vec3 decode_normal (vec2 enc) -{ - vec3 n; - n.xy = (enc.xy * vec2(2.0f,2.0f)) - vec2(1.0f,1.0f); - n.z = sqrt(1.0f - dot(n.xy,n.xy)); - return n; -} -#else vec2 encode_normal(vec3 n) { float f = sqrt(8 * n.z + 8); @@ -86,7 +70,6 @@ vec3 decode_normal (vec2 enc) n.z = 1-f/2; return n; } -#endif vec4 getPosition(vec2 pos_screen) { @@ -110,9 +93,9 @@ void main() vec3 pos = getPosition(frag.xy).xyz; vec3 lv = trans_center.xyz-pos; - float dist2 = dot(lv,lv); - dist2 /= size; - if (dist2 > 1.0) + float dist = length(lv); + dist /= size; + if (dist > 1.0) { discard; } @@ -133,8 +116,10 @@ void main() vec3 col = texture2DRect(diffuseRect, frag.xy).rgb; float fa = falloff+1.0; - float dist_atten = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); - dist_atten = pow(dist_atten, 2.2) * 2.2; + float dist_atten = clamp(1.0-(dist-1.0*(1.0-fa))/fa, 0.0, 1.0); + dist_atten *= dist_atten; + dist_atten *= 2.0; + float lit = da * dist_atten * noise; col = color.rgb*lit*col; diff --git a/indra/newview/app_settings/shaders/class1/deferred/pointLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/pointLightV.glsl index 9491421236..a5625fbc16 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/pointLightV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/pointLightV.glsl @@ -37,7 +37,7 @@ VARYING vec3 trans_center; void main() { //transform vertex - vec3 p = position*sqrt(size)+center; + vec3 p = position*size+center; vec4 pos = modelview_projection_matrix * vec4(p.xyz, 1.0); vary_fragcoord = pos; trans_center = (modelview_matrix*vec4(center.xyz, 1.0)).xyz; diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl index 6f2cfae6d2..4e2f98aa29 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl @@ -36,11 +36,32 @@ uniform sampler2DRect diffuseRect; uniform vec2 screen_res; VARYING vec2 vary_fragcoord; -uniform float texture_gamma; +uniform float display_gamma; + +vec3 linear_to_srgb(vec3 cl) +{ + cl = clamp(cl, vec3(0), vec3(1)); + vec3 low_range = cl * 12.92; + vec3 high_range = 1.055 * pow(cl, vec3(0.41666)) - 0.055; + bvec3 lt = lessThan(cl,vec3(0.0031308)); + +#ifdef OLD_SELECT + vec3 result; + result.r = lt.r ? low_range.r : high_range.r; + result.g = lt.g ? low_range.g : high_range.g; + result.b = lt.b ? low_range.b : high_range.b; + return result; +#else + return mix(high_range, low_range, lt); +#endif + +} + void main() { vec4 diff = texture2DRect(diffuseRect, vary_fragcoord); - frag_color = pow(diff, vec4(texture_gamma, texture_gamma, texture_gamma, 1.0f)); + diff.rgb = linear_to_srgb(diff.rgb); + frag_color = diff; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index b40850e769..760d52a9ce 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -24,6 +24,7 @@ */ #extension GL_ARB_texture_rectangle : enable +#extension GL_ARB_shader_texture_lod : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; @@ -78,22 +79,43 @@ vec3 vary_AtmosAttenuation; uniform mat4 inv_proj; uniform vec2 screen_res; -#ifdef SINGLE_FP_ONLY -vec2 encode_normal(vec3 n) +vec3 srgb_to_linear(vec3 cs) { - vec2 sn; - sn.xy = (n.xy * vec2(0.5f,0.5f)) + vec2(0.5f,0.5f); - return sn; + vec3 low_range = cs / vec3(12.92); + vec3 high_range = pow((cs+vec3(0.055))/vec3(1.055), vec3(2.4)); + bvec3 lte = lessThanEqual(cs,vec3(0.04045)); + +#ifdef OLD_SELECT + vec3 result; + result.r = lte.r ? low_range.r : high_range.r; + result.g = lte.g ? low_range.g : high_range.g; + result.b = lte.b ? low_range.b : high_range.b; + return result; +#else + return mix(high_range, low_range, lte); +#endif + } -vec3 decode_normal (vec2 enc) +vec3 linear_to_srgb(vec3 cl) { - vec3 n; - n.xy = (enc.xy * vec2(2.0f,2.0f)) - vec2(1.0f,1.0f); - n.z = sqrt(1.0f - dot(n.xy,n.xy)); - return n; -} + vec3 low_range = cl * 12.92; + vec3 high_range = 1.055 * pow(cl, vec3(0.41666)) - 0.055; + bvec3 lt = lessThan(cl,vec3(0.0031308)); + +#ifdef OLD_SELECT + vec3 result; + result.r = lt.r ? low_range.r : high_range.r; + result.g = lt.g ? low_range.g : high_range.g; + result.b = lt.b ? low_range.b : high_range.b; + return result; #else + return mix(high_range, low_range, lt); +#endif + +} + + vec3 decode_normal (vec2 enc) { vec2 fenc = enc*4-2; @@ -104,7 +126,6 @@ vec3 decode_normal (vec2 enc) n.z = 1-f/2; return n; } -#endif vec4 getPosition_d(vec2 pos_screen, float depth) { @@ -170,6 +191,53 @@ void setAtmosAttenuation(vec3 v) vary_AtmosAttenuation = v; } + +#ifdef WATER_FOG +uniform vec4 waterPlane; +uniform vec4 waterFogColor; +uniform float waterFogDensity; +uniform float waterFogKS; + +vec4 applyWaterFogDeferred(vec3 pos, vec4 color) +{ + //normalize view vector + vec3 view = normalize(pos); + float es = -(dot(view, waterPlane.xyz)); + + //find intersection point with water plane and eye vector + + //get eye depth + float e0 = max(-waterPlane.w, 0.0); + + vec3 int_v = waterPlane.w > 0.0 ? view * waterPlane.w/es : vec3(0.0, 0.0, 0.0); + + //get object depth + float depth = length(pos - int_v); + + //get "thickness" of water + float l = max(depth, 0.1); + + float kd = waterFogDensity; + float ks = waterFogKS; + vec4 kc = waterFogColor; + + float F = 0.98; + + float t1 = -kd * pow(F, ks * e0); + float t2 = kd + ks * es; + float t3 = pow(F, t2*l) - 1.0; + + float L = min(t1/t2*t3, 1.0); + + float D = pow(0.98, l*kd); + + color.rgb = color.rgb * D + kc.rgb * L; + color.a = kc.a + color.a; + + return color; +} +#endif + void calcAtmospherics(vec3 inPositionEye, float ambFactor) { vec3 P = inPositionEye; @@ -248,9 +316,9 @@ void calcAtmospherics(vec3 inPositionEye, float ambFactor) { + tmpAmbient))); //brightness of surface both sunlight and ambient - setSunlitColor(pow(vec3(sunlight * .5), vec3(global_gamma)) * global_gamma); - setAmblitColor(pow(vec3(tmpAmbient * .25), vec3(global_gamma)) * global_gamma); - setAdditiveColor(pow(getAdditiveColor() * vec3(1.0 - temp1), vec3(global_gamma)) * global_gamma); + setSunlitColor(vec3(sunlight * .5)); + setAmblitColor(vec3(tmpAmbient * .25)); + setAdditiveColor(getAdditiveColor() * vec3(1.0 - temp1)); } vec3 atmosLighting(vec3 light) @@ -324,9 +392,17 @@ void main() float envIntensity = norm.z; norm.xyz = decode_normal(norm.xy); // unpack norm - float da = max(dot(norm.xyz, sun_dir.xyz), 0.0); + float da = dot(norm.xyz, sun_dir.xyz); + + float final_da = max(0.0,da); + final_da = min(final_da, 1.0f); + final_da = pow(final_da, 1.0/1.3); vec4 diffuse = texture2DRect(diffuseRect, tc); + + //convert to gamma space + diffuse.rgb = linear_to_srgb(diffuse.rgb); + vec4 spec = texture2DRect(specularRect, vary_fragcoord.xy); vec3 col; float bloom = 0.0; @@ -341,7 +417,7 @@ void main() col.rgb *= ambient; - col += atmosAffectDirectionalLight(max(min(da, 1.0) * 2.6, 0.0)); + col += atmosAffectDirectionalLight(final_da); col *= diffuse.rgb; @@ -362,23 +438,18 @@ void main() } - col = mix(col.rgb, pow(diffuse.rgb, vec3(1.0/2.2)), diffuse.a); - - + col = mix(col.rgb, diffuse.rgb, diffuse.a); + if (envIntensity > 0.0) { //add environmentmap vec3 env_vec = env_mat * refnormpersp; - float exponent = mix(2.2, 1.0, diffuse.a); - vec3 refcol = pow(textureCube(environmentMap, env_vec).rgb, vec3(exponent))*exponent; + + vec3 refcol = textureCube(environmentMap, env_vec).rgb; col = mix(col.rgb, refcol, envIntensity); - } - - float exponent = mix(1.0, 2.2, diffuse.a); - col = pow(col, vec3(exponent)); if (norm.w < 0.5) { @@ -386,11 +457,19 @@ void main() col = mix(scaleSoftClip(col), fullbrightScaleSoftClip(col), diffuse.a); } + #ifdef WATER_FOG + vec4 fogged = applyWaterFogDeferred(pos,vec4(col, bloom)); + col = fogged.rgb; + bloom = fogged.a; + #endif + + col = srgb_to_linear(col); + //col = vec3(1,0,1); //col.g = envIntensity; } - - frag_color.rgb = col; + frag_color.rgb = col.rgb; frag_color.a = bloom; } + diff --git a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl index 3539c8d2b2..8d8a6c9dde 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl @@ -22,8 +22,9 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + #extension GL_ARB_texture_rectangle : enable +#extension GL_ARB_shader_texture_lod : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; @@ -31,6 +32,8 @@ out vec4 frag_color; #define frag_color gl_FragColor #endif +//class 1 -- no shadows + uniform sampler2DRect diffuseRect; uniform sampler2DRect specularRect; uniform sampler2DRect depthMap; @@ -65,22 +68,6 @@ uniform vec2 screen_res; uniform mat4 inv_proj; -#ifdef SINGLE_FP_ONLY -vec2 encode_normal(vec3 n) -{ - vec2 sn; - sn.xy = (n.xy * vec2(0.5f,0.5f)) + vec2(0.5f,0.5f); - return sn; -} - -vec3 decode_normal (vec2 enc) -{ - vec3 n; - n.xy = (enc.xy * vec2(2.0f,2.0f)) - vec2(1.0f,1.0f); - n.z = sqrt(1.0f - dot(n.xy,n.xy)); - return n; -} -#else vec2 encode_normal(vec3 n) { float f = sqrt(8 * n.z + 8); @@ -97,11 +84,47 @@ vec3 decode_normal (vec2 enc) n.z = 1-f/2; return n; } + +vec3 srgb_to_linear(vec3 cs) +{ + vec3 low_range = cs / vec3(12.92); + vec3 high_range = pow((cs+vec3(0.055))/vec3(1.055), vec3(2.4)); + bvec3 lte = lessThanEqual(cs,vec3(0.04045)); + +#ifdef OLD_SELECT + vec3 result; + result.r = lte.r ? low_range.r : high_range.r; + result.g = lte.g ? low_range.g : high_range.g; + result.b = lte.b ? low_range.b : high_range.b; + return result; +#else + return mix(high_range, low_range, lte); #endif +} + +vec3 linear_to_srgb(vec3 cl) +{ + cl = clamp(cl, vec3(0), vec3(1)); + vec3 low_range = cl * 12.92; + vec3 high_range = 1.055 * pow(cl, vec3(0.41666)) - 0.055; + bvec3 lt = lessThan(cl,vec3(0.0031308)); + +#ifdef OLD_SELECT + vec3 result; + result.r = lt.r ? low_range.r : high_range.r; + result.g = lt.g ? low_range.g : high_range.g; + result.b = lt.b ? low_range.b : high_range.b; + return result; +#else + return mix(high_range, low_range, lt); +#endif + +} + vec4 correctWithGamma(vec4 col) { - return vec4(pow(col.rgb, vec3(2.2)), col.a); + return vec4(srgb_to_linear(col.rgb), col.a); } vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod) @@ -175,9 +198,9 @@ void main() vec3 pos = getPosition(frag.xy).xyz; vec3 lv = trans_center.xyz-pos.xyz; - float dist2 = dot(lv,lv); - dist2 /= size; - if (dist2 > 1.0) + float dist = length(lv); + dist /= size; + if (dist > 1.0) { discard; } @@ -199,8 +222,10 @@ void main() proj_tc.xyz /= proj_tc.w; float fa = falloff+1.0; - float dist_atten = min(1.0-(dist2-1.0*(1.0-fa))/fa, 1.0); - dist_atten = pow(dist_atten, 2.2) * 2.2; + float dist_atten = min(1.0-(dist-1.0*(1.0-fa))/fa, 1.0); + dist_atten *= dist_atten; + dist_atten *= 2.0; + if (dist_atten <= 0.0) { discard; @@ -279,10 +304,7 @@ void main() //col += spec.rgb; } } - - - - + if (envIntensity > 0.0) { diff --git a/indra/newview/app_settings/shaders/class1/deferred/srgb.glsl b/indra/newview/app_settings/shaders/class1/deferred/srgb.glsl new file mode 100644 index 0000000000..587f3d5a94 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/deferred/srgb.glsl @@ -0,0 +1,46 @@ +/** + * @file srgb.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2007, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +vec3 srgb_to_linear(vec3 cs) +{ + vec3 low_range = cs / vec3(12.92); + vec3 high_range = pow((cs+vec3(0.055))/vec3(1.055), vec3(2.4)); + + bvec3 lte = lessThanEqual(cs,vec3(0.04045)); + return mix(high_range, low_range, lte); + +} + +vec3 linear_to_srgb(vec3 cl) +{ + cl = clamp(cl, vec3(0), vec3(1)); + vec3 low_range = cl * 12.92; + vec3 high_range = 1.055 * pow(cl, vec3(0.41666)) - 0.055; + + bvec3 lt = lessThan(cl,vec3(0.0031308)); + return mix(high_range, low_range, lt); + +} + diff --git a/indra/newview/app_settings/shaders/class1/deferred/srgb_mac.glsl b/indra/newview/app_settings/shaders/class1/deferred/srgb_mac.glsl new file mode 100644 index 0000000000..6cc1e6e798 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/deferred/srgb_mac.glsl @@ -0,0 +1,54 @@ +/** + * @file srgb.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2007, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +vec3 srgb_to_linear(vec3 cs) +{ + vec3 low_range = cs / vec3(12.92); + vec3 high_range = pow((cs+vec3(0.055))/vec3(1.055), vec3(2.4)); + + bvec3 lte = lessThanEqual(cs,vec3(0.04045)); + + vec3 result; + result.r = lte.r ? low_range.r : high_range.r; + result.g = lte.g ? low_range.g : high_range.g; + result.b = lte.b ? low_range.b : high_range.b; + return result; +} + +vec3 linear_to_srgb(vec3 cl) +{ + cl = clamp(cl, vec3(0), vec3(1)); + vec3 low_range = cl * 12.92; + vec3 high_range = 1.055 * pow(cl, vec3(0.41666)) - 0.055; + + bvec3 lt = lessThan(cl,vec3(0.0031308)); + + vec3 result; + result.r = lt.r ? low_range.r : high_range.r; + result.g = lt.g ? low_range.g : high_range.g; + result.b = lt.b ? low_range.b : high_range.b; + return result; +} + diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl index 6653f57ee1..c0a5865bef 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl @@ -49,22 +49,6 @@ VARYING vec2 vary_fragcoord; uniform mat4 inv_proj; uniform vec2 screen_res; -#ifdef SINGLE_FP_ONLY -vec2 encode_normal(vec3 n) -{ - vec2 sn; - sn.xy = (n.xy * vec2(0.5f,0.5f)) + vec2(0.5f,0.5f); - return sn; -} - -vec3 decode_normal (vec2 enc) -{ - vec3 n; - n.xy = (enc.xy * vec2(2.0f,2.0f)) - vec2(1.0f,1.0f); - n.z = sqrt(1.0f - dot(n.xy,n.xy)); - return n; -} -#else vec2 encode_normal(vec3 n) { float f = sqrt(8 * n.z + 8); @@ -81,7 +65,6 @@ vec3 decode_normal (vec2 enc) n.z = 1-f/2; return n; } -#endif vec4 getPosition(vec2 pos_screen) { diff --git a/indra/newview/app_settings/shaders/class1/deferred/underWaterF.glsl b/indra/newview/app_settings/shaders/class1/deferred/underWaterF.glsl new file mode 100644 index 0000000000..78f841c733 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/deferred/underWaterF.glsl @@ -0,0 +1,157 @@ +/** + * @file underWaterF.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2007, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 frag_data[3]; +#else +#define frag_data gl_FragData +#endif + +uniform sampler2D diffuseMap; +uniform sampler2D bumpMap; +uniform sampler2D screenTex; +uniform sampler2D refTex; +uniform sampler2D screenDepth; + +uniform vec4 fogCol; +uniform vec3 lightDir; +uniform vec3 specular; +uniform float lightExp; +uniform vec2 fbScale; +uniform float refScale; +uniform float znear; +uniform float zfar; +uniform float kd; +uniform vec4 waterPlane; +uniform vec3 eyeVec; +uniform vec4 waterFogColor; +uniform float waterFogDensity; +uniform float waterFogKS; +uniform vec2 screenRes; + +//bigWave is (refCoord.w, view.w); +VARYING vec4 refCoord; +VARYING vec4 littleWave; +VARYING vec4 view; + +vec3 srgb_to_linear(vec3 cs) +{ + vec3 low_range = cs / vec3(12.92); + vec3 high_range = pow((cs+vec3(0.055))/vec3(1.055), vec3(2.4)); + bvec3 lte = lessThanEqual(cs,vec3(0.04045)); + +#ifdef OLD_SELECT + vec3 result; + result.r = lte.r ? low_range.r : high_range.r; + result.g = lte.g ? low_range.g : high_range.g; + result.b = lte.b ? low_range.b : high_range.b; + return result; +#else + return mix(high_range, low_range, lte); +#endif + +} + +vec3 linear_to_srgb(vec3 cl) +{ + cl = clamp(cl, vec3(0), vec3(1)); + vec3 low_range = cl * 12.92; + vec3 high_range = 1.055 * pow(cl, vec3(0.41666)) - 0.055; + bvec3 lt = lessThan(cl,vec3(0.0031308)); + +#ifdef OLD_SELECT + vec3 result; + result.r = lt.r ? low_range.r : high_range.r; + result.g = lt.g ? low_range.g : high_range.g; + result.b = lt.b ? low_range.b : high_range.b; + return result; +#else + return mix(high_range, low_range, lt); +#endif + +} + +vec2 encode_normal(vec3 n) +{ + float f = sqrt(8 * n.z + 8); + return n.xy / f + 0.5; +} + +vec4 applyWaterFog(vec4 color, vec3 viewVec) +{ + //normalize view vector + vec3 view = normalize(viewVec); + float es = -view.z; + + //find intersection point with water plane and eye vector + + //get eye depth + float e0 = max(-waterPlane.w, 0.0); + + //get object depth + float depth = length(viewVec); + + //get "thickness" of water + float l = max(depth, 0.1); + + float kd = waterFogDensity; + float ks = waterFogKS; + vec4 kc = waterFogColor; + + float F = 0.98; + + float t1 = -kd * pow(F, ks * e0); + float t2 = kd + ks * es; + float t3 = pow(F, t2*l) - 1.0; + + float L = min(t1/t2*t3, 1.0); + + float D = pow(0.98, l*kd); + //return vec4(1.0, 0.0, 1.0, 1.0); + return color * D + kc * L; + //depth /= 10.0; + //return vec4(depth,depth,depth,0.0); +} + +void main() +{ + vec4 color; + + //get detail normals + vec3 wave1 = texture2D(bumpMap, vec2(refCoord.w, view.w)).xyz*2.0-1.0; + vec3 wave2 = texture2D(bumpMap, littleWave.xy).xyz*2.0-1.0; + vec3 wave3 = texture2D(bumpMap, littleWave.zw).xyz*2.0-1.0; + vec3 wavef = normalize(wave1+wave2+wave3); + + //figure out distortion vector (ripply) + vec2 distort = (refCoord.xy/refCoord.z) * 0.5 + 0.5; + distort = distort+wavef.xy*refScale; + + vec4 fb = texture2D(screenTex, distort); + + frag_data[0] = vec4(linear_to_srgb(fb.rgb), 1.0); // diffuse + frag_data[1] = vec4(0.5,0.5,0.5, 0.95); // speccolor*spec, spec + frag_data[2] = vec4(encode_normal(wavef), 0.0, 0.0); // normalxyz, displace +} diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl index daa2fb390a..1c3ad49a21 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl @@ -67,6 +67,43 @@ VARYING vec4 littleWave; VARYING vec4 view; VARYING vec4 vary_position; +vec3 srgb_to_linear(vec3 cs) +{ + vec3 low_range = cs / vec3(12.92); + vec3 high_range = pow((cs+vec3(0.055))/vec3(1.055), vec3(2.4)); + bvec3 lte = lessThanEqual(cs,vec3(0.04045)); + +#ifdef OLD_SELECT + vec3 result; + result.r = lte.r ? low_range.r : high_range.r; + result.g = lte.g ? low_range.g : high_range.g; + result.b = lte.b ? low_range.b : high_range.b; + return result; +#else + return mix(high_range, low_range, lte); +#endif + +} + +vec3 linear_to_srgb(vec3 cl) +{ + cl = clamp(cl, vec3(0), vec3(1)); + vec3 low_range = cl * 12.92; + vec3 high_range = 1.055 * pow(cl, vec3(0.41666)) - 0.055; + bvec3 lt = lessThan(cl,vec3(0.0031308)); + +#ifdef OLD_SELECT + vec3 result; + result.r = lt.r ? low_range.r : high_range.r; + result.g = lt.g ? low_range.g : high_range.g; + result.b = lt.b ? low_range.b : high_range.b; + return result; +#else + return mix(high_range, low_range, lt); +#endif + +} + vec2 encode_normal(vec3 n) { float f = sqrt(8 * n.z + 8); @@ -121,7 +158,7 @@ void main() refcol *= df1 * 0.333; vec3 wavef = (wave1 + wave2 * 0.4 + wave3 * 0.6) * 0.5; - //wavef.z *= max(-viewVec.z, 0.1); + wavef.z *= max(-viewVec.z, 0.1); wavef = normalize(wavef); float df2 = dot(viewVec, wavef) * fresnelScale+fresnelOffset; @@ -131,13 +168,14 @@ void main() vec2 refvec4 = distort+refdistort4/dmod; float dweight = min(dist2*blurMultiplier, 1.0); vec4 baseCol = texture2D(refTex, refvec4); + refcol = mix(baseCol*df2, refcol, dweight); //get specular component - //float spec = clamp(dot(lightDir, (reflect(viewVec,wavef))),0.0,1.0); + float spec = clamp(dot(lightDir, (reflect(viewVec,wavef))),0.0,1.0); //harden specular - //spec = pow(spec, 128.0); + spec = pow(spec, 128.0); //figure out distortion vector (ripply) vec2 distort2 = distort+wavef.xy*refScale/max(dmod*df1, 1.0); @@ -148,24 +186,17 @@ void main() // Note we actually want to use just df1, but multiplying by 0.999999 gets around an nvidia compiler bug color.rgb = mix(fb.rgb, refcol.rgb, df1 * 0.99999); - float shadow = 1.0; vec4 pos = vary_position; - //vec3 nz = texture2D(noiseMap, gl_FragCoord.xy/128.0).xyz; - vec4 spos = pos; - - //spec *= shadow; - //color.rgb += spec * specular; + color.rgb += spec * specular; color.rgb = atmosTransport(color.rgb); color.rgb = scaleSoftClip(color.rgb); - //color.a = spec * sunAngle2; + color.a = spec * sunAngle2; - //wavef.z *= 0.1f; - //wavef = normalize(wavef); - vec3 screenspacewavef = (norm_mat*vec4(wavef, 1.0)).xyz; + vec3 screenspacewavef = normalize((norm_mat*vec4(wavef, 1.0)).xyz); - frag_data[0] = vec4(color.rgb, 0.5); // diffuse - frag_data[1] = vec4(0.5,0.5,0.5, 0.95); // speccolor*spec, spec - frag_data[2] = vec4(encode_normal(screenspacewavef), 0.0, 0.0); // normalxyz, displace + frag_data[0] = vec4(color.rgb, color); // diffuse + frag_data[1] = vec4(0); // speccolor, spec + frag_data[2] = vec4(encode_normal(screenspacewavef.xyz*0.5+0.5), 0.05, 0);// normalxy, 0, 0 } diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterV.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterV.glsl index ece34dcc4e..9734acf005 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/waterV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/waterV.glsl @@ -85,7 +85,7 @@ void main() pos.w = 1.0; pos = modelview_matrix*pos; - calcAtmospherics(view.xyz); + calcAtmospherics(pos.xyz); //pass wave parameters to pixel shader vec2 bigWave = (v.xy) * vec2(0.04,0.04) + d1 * time * 0.055; diff --git a/indra/newview/app_settings/shaders/class1/interface/downsampleDepthF.glsl b/indra/newview/app_settings/shaders/class1/interface/downsampleDepthF.glsl new file mode 100644 index 0000000000..f8efd7cb4a --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/downsampleDepthF.glsl @@ -0,0 +1,65 @@ +/** + * @file debugF.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 frag_color; +#else +#define frag_color gl_FragColor +#endif + +uniform sampler2D depthMap; + +VARYING vec2 tc0; +VARYING vec2 tc1; +VARYING vec2 tc2; +VARYING vec2 tc3; +VARYING vec2 tc4; +VARYING vec2 tc5; +VARYING vec2 tc6; +VARYING vec2 tc7; +VARYING vec2 tc8; + +void main() +{ + vec4 depth1 = + vec4(texture2D(depthMap, tc0).r, + texture2D(depthMap, tc1).r, + texture2D(depthMap, tc2).r, + texture2D(depthMap, tc3).r); + + vec4 depth2 = + vec4(texture2D(depthMap, tc4).r, + texture2D(depthMap, tc5).r, + texture2D(depthMap, tc6).r, + texture2D(depthMap, tc7).r); + + depth1 = min(depth1, depth2); + float depth = min(depth1.x, depth1.y); + depth = min(depth, depth1.z); + depth = min(depth, depth1.w); + depth = min(depth, texture2D(depthMap, tc8).r); + + gl_FragDepth = depth; +} diff --git a/indra/newview/app_settings/shaders/class1/interface/downsampleDepthRectF.glsl b/indra/newview/app_settings/shaders/class1/interface/downsampleDepthRectF.glsl new file mode 100644 index 0000000000..942c5888e7 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/downsampleDepthRectF.glsl @@ -0,0 +1,67 @@ +/** + * @file debugF.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#extension GL_ARB_texture_rectangle : enable + +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 frag_color; +#else +#define frag_color gl_FragColor +#endif + +uniform sampler2DRect depthMap; + +VARYING vec2 tc0; +VARYING vec2 tc1; +VARYING vec2 tc2; +VARYING vec2 tc3; +VARYING vec2 tc4; +VARYING vec2 tc5; +VARYING vec2 tc6; +VARYING vec2 tc7; +VARYING vec2 tc8; + +void main() +{ + vec4 depth1 = + vec4(texture2DRect(depthMap, tc0).r, + texture2DRect(depthMap, tc1).r, + texture2DRect(depthMap, tc2).r, + texture2DRect(depthMap, tc3).r); + + vec4 depth2 = + vec4(texture2DRect(depthMap, tc4).r, + texture2DRect(depthMap, tc5).r, + texture2DRect(depthMap, tc6).r, + texture2DRect(depthMap, tc7).r); + + depth1 = min(depth1, depth2); + float depth = min(depth1.x, depth1.y); + depth = min(depth, depth1.z); + depth = min(depth, depth1.w); + depth = min(depth, texture2DRect(depthMap, tc8).r); + + gl_FragDepth = depth; +} diff --git a/indra/newview/app_settings/shaders/class1/interface/downsampleDepthV.glsl b/indra/newview/app_settings/shaders/class1/interface/downsampleDepthV.glsl new file mode 100644 index 0000000000..71d80911d6 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/downsampleDepthV.glsl @@ -0,0 +1,59 @@ +/** + * @file debugV.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +uniform mat4 modelview_projection_matrix; + +ATTRIBUTE vec3 position; + +uniform vec2 screen_res; + +uniform vec2 delta; + +VARYING vec2 tc0; +VARYING vec2 tc1; +VARYING vec2 tc2; +VARYING vec2 tc3; +VARYING vec2 tc4; +VARYING vec2 tc5; +VARYING vec2 tc6; +VARYING vec2 tc7; +VARYING vec2 tc8; + +void main() +{ + gl_Position = vec4(position, 1.0); + + vec2 tc = (position.xy*0.5+0.5)*screen_res; + tc0 = tc+vec2(-delta.x,-delta.y); + tc1 = tc+vec2(0,-delta.y); + tc2 = tc+vec2(delta.x,-delta.y); + tc3 = tc+vec2(-delta.x,0); + tc4 = tc+vec2(0,0); + tc5 = tc+vec2(delta.x,0); + tc6 = tc+vec2(-delta.x,delta.y); + tc7 = tc+vec2(0,delta.y); + tc8 = tc+vec2(delta.x,delta.y); +} + diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl index eaaa7b208d..cad5b9ff04 100755 --- a/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl @@ -41,13 +41,13 @@ void default_lighting() { vec4 color = diffuseLookup(vary_texcoord0.xy); + color *= vertex_color; + if (color.a < minimum_alpha) { discard; } - color.rgb *= vertex_color.rgb; - color.rgb = atmosLighting(color.rgb); color.rgb = scaleSoftClip(color.rgb); diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl deleted file mode 100755 index 9670d59399..0000000000 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl +++ /dev/null @@ -1,235 +0,0 @@ -/** - * @file alphaF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#extension GL_ARB_texture_rectangle : enable - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif - -uniform sampler2DShadow shadowMap0; -uniform sampler2DShadow shadowMap1; -uniform sampler2DShadow shadowMap2; -uniform sampler2DShadow shadowMap3; -uniform sampler2DRect depthMap; -uniform sampler2D diffuseMap; - -uniform mat4 shadow_matrix[6]; -uniform vec4 shadow_clip; -uniform vec2 screen_res; - -vec3 atmosLighting(vec3 light); -vec3 scaleSoftClip(vec3 light); - -VARYING vec3 vary_ambient; -VARYING vec3 vary_directional; -VARYING vec3 vary_fragcoord; -VARYING vec3 vary_position; -VARYING vec3 vary_pointlight_col; -VARYING vec2 vary_texcoord0; -VARYING vec4 vertex_color; -VARYING vec3 vary_norm; - -uniform vec2 shadow_res; -uniform float shadow_bias; - -uniform mat4 inv_proj; - -uniform vec4 light_position[8]; -uniform vec3 light_direction[8]; -uniform vec3 light_attenuation[8]; -uniform vec3 light_diffuse[8]; - -vec3 calcDirectionalLight(vec3 n, vec3 l) -{ - float a = pow(max(dot(n,l),0.0), 0.7); - return vec3(a,a,a); -} - -vec3 calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) -{ - //get light vector - vec3 lv = lp.xyz-v; - - //get distance - float d = dot(lv,lv); - - float da = 0.0; - - if (d > 0.0 && la > 0.0 && fa > 0.0) - { - //normalize light vector - lv = normalize(lv); - - //distance attenuation - float dist2 = d/la; - da = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); - - // spotlight coefficient. - float spot = max(dot(-ln, lv), is_pointlight); - da *= spot*spot; // GL_SPOT_EXPONENT=2 - - //angular attenuation - da *= max(pow(dot(n, lv), 0.7), 0.0); - } - - return vec3(da,da,da); -} - -vec4 getPosition(vec2 pos_screen) -{ - float depth = texture2DRect(depthMap, pos_screen.xy).a; - vec2 sc = pos_screen.xy*2.0; - sc /= screen_res; - sc -= vec2(1.0,1.0); - vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); - vec4 pos = inv_proj * ndc; - pos.xyz /= pos.w; - pos.w = 1.0; - return pos; -} - -float pcfShadow(sampler2DShadow shadowMap, vec4 stc) -{ - stc.xyz /= stc.w; - stc.z += shadow_bias; - - stc.x = floor(stc.x*shadow_res.x + fract(stc.y*12345))/shadow_res.x; // add some chaotic jitter to X sample pos according to Y to disguise the snapping going on here - - float cs = shadow2D(shadowMap, stc.xyz).x; - float shadow = cs; - - shadow += shadow2D(shadowMap, stc.xyz+vec3(2.0/shadow_res.x, 1.5/shadow_res.y, 0.0)).x; - shadow += shadow2D(shadowMap, stc.xyz+vec3(1.0/shadow_res.x, -1.5/shadow_res.y, 0.0)).x; - shadow += shadow2D(shadowMap, stc.xyz+vec3(-1.0/shadow_res.x, 1.5/shadow_res.y, 0.0)).x; - shadow += shadow2D(shadowMap, stc.xyz+vec3(-2.0/shadow_res.x, -1.5/shadow_res.y, 0.0)).x; - - return shadow*0.2; -} - - -void main() -{ - vec2 frag = vary_fragcoord.xy/vary_fragcoord.z*0.5+0.5; - frag *= screen_res; - - float shadow = 0.0; - vec4 pos = vec4(vary_position, 1.0); - - vec4 spos = pos; - - if (spos.z > -shadow_clip.w) - { - vec4 lpos; - - vec4 near_split = shadow_clip*-0.75; - vec4 far_split = shadow_clip*-1.25; - vec4 transition_domain = near_split-far_split; - float weight = 0.0; - - if (spos.z < near_split.z) - { - lpos = shadow_matrix[3]*spos; - - float w = 1.0; - w -= max(spos.z-far_split.z, 0.0)/transition_domain.z; - shadow += pcfShadow(shadowMap3, lpos)*w; - weight += w; - shadow += max((pos.z+shadow_clip.z)/(shadow_clip.z-shadow_clip.w)*2.0-1.0, 0.0); - } - - if (spos.z < near_split.y && spos.z > far_split.z) - { - lpos = shadow_matrix[2]*spos; - - float w = 1.0; - w -= max(spos.z-far_split.y, 0.0)/transition_domain.y; - w -= max(near_split.z-spos.z, 0.0)/transition_domain.z; - shadow += pcfShadow(shadowMap2, lpos)*w; - weight += w; - } - - if (spos.z < near_split.x && spos.z > far_split.y) - { - lpos = shadow_matrix[1]*spos; - - float w = 1.0; - w -= max(spos.z-far_split.x, 0.0)/transition_domain.x; - w -= max(near_split.y-spos.z, 0.0)/transition_domain.y; - shadow += pcfShadow(shadowMap1, lpos)*w; - weight += w; - } - - if (spos.z > far_split.x) - { - lpos = shadow_matrix[0]*spos; - - float w = 1.0; - w -= max(near_split.x-spos.z, 0.0)/transition_domain.x; - - shadow += pcfShadow(shadowMap0, lpos)*w; - weight += w; - } - - - shadow /= weight; - - } - else - { - shadow = 1.0; - } - vec3 n = vary_norm; - vec3 l = light_position[0].xyz; - vec3 dlight = calcDirectionalLight(n, l); - dlight = dlight * vary_directional.rgb * vary_pointlight_col; - vec4 diff = texture2D(diffuseMap,vary_texcoord0.xy); - - vec4 col = vec4(vary_ambient + dlight*shadow, vertex_color.a); - vec4 color = diff * col; - - color.rgb = atmosLighting(color.rgb); - - color.rgb = scaleSoftClip(color.rgb); - vec3 light_col = vec3(0,0,0); - - #define LIGHT_LOOP(i) \ - light_col += light_diffuse[i].rgb * calcPointLightOrSpotLight(pos.xyz, vary_norm, light_position[i], light_direction[i], light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z); - - LIGHT_LOOP(1) - LIGHT_LOOP(2) - LIGHT_LOOP(3) - LIGHT_LOOP(4) - LIGHT_LOOP(5) - LIGHT_LOOP(6) - LIGHT_LOOP(7) - - color.rgb += diff.rgb * vary_pointlight_col * light_col; - - frag_color = color; -} - diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl deleted file mode 100755 index fae279fba0..0000000000 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl +++ /dev/null @@ -1,242 +0,0 @@ -/** - * @file alphaNonIndexedNoColorF.glsl - * - * $LicenseInfo:firstyear=2005&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2005, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#extension GL_ARB_texture_rectangle : enable - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif - -uniform float minimum_alpha; - -uniform sampler2DShadow shadowMap0; -uniform sampler2DShadow shadowMap1; -uniform sampler2DShadow shadowMap2; -uniform sampler2DShadow shadowMap3; -uniform sampler2DRect depthMap; -uniform sampler2D diffuseMap; - -uniform mat4 shadow_matrix[6]; -uniform vec4 shadow_clip; -uniform vec2 screen_res; - -vec3 atmosLighting(vec3 light); -vec3 scaleSoftClip(vec3 light); - -VARYING vec3 vary_ambient; -VARYING vec3 vary_directional; -VARYING vec3 vary_fragcoord; -VARYING vec3 vary_position; -VARYING vec3 vary_pointlight_col; -VARYING vec2 vary_texcoord0; -VARYING vec3 vary_norm; - -uniform vec2 shadow_res; - -uniform float shadow_bias; - -uniform mat4 inv_proj; - -uniform vec4 light_position[8]; -uniform vec3 light_direction[8]; -uniform vec3 light_attenuation[8]; -uniform vec3 light_diffuse[8]; - -vec3 calcDirectionalLight(vec3 n, vec3 l) -{ - float a = pow(max(dot(n,l),0.0), 0.7); - return vec3(a, a, a); -} - -vec3 calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) -{ - //get light vector - vec3 lv = lp.xyz-v; - - //get distance - float d = dot(lv,lv); - - float da = 0.0; - - if (d > 0.0 && la > 0.0 && fa > 0.0) - { - //normalize light vector - lv = normalize(lv); - - //distance attenuation - float dist2 = d/la; - da = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); - - // spotlight coefficient. - float spot = max(dot(-ln, lv), is_pointlight); - da *= spot*spot; // GL_SPOT_EXPONENT=2 - - //angular attenuation - da *= max(pow(dot(n, lv), 0.7), 0.0); - } - - return vec3(da,da,da); -} - -vec4 getPosition(vec2 pos_screen) -{ - float depth = texture2DRect(depthMap, pos_screen.xy).a; - vec2 sc = pos_screen.xy*2.0; - sc /= screen_res; - sc -= vec2(1.0,1.0); - vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); - vec4 pos = inv_proj * ndc; - pos.xyz /= pos.w; - pos.w = 1.0; - return pos; -} - -float pcfShadow(sampler2DShadow shadowMap, vec4 stc) -{ - stc.xyz /= stc.w; - stc.z += shadow_bias; - - stc.x = floor(stc.x*shadow_res.x + fract(stc.y*12345))/shadow_res.x; // add some chaotic jitter to X sample pos according to Y to disguise the snapping going on here - float cs = shadow2D(shadowMap, stc.xyz).x; - - float shadow = cs; - - shadow += shadow2D(shadowMap, stc.xyz+vec3(2.0/shadow_res.x, 1.5/shadow_res.y, 0.0)).x; - shadow += shadow2D(shadowMap, stc.xyz+vec3(1.0/shadow_res.x, -1.5/shadow_res.y, 0.0)).x; - shadow += shadow2D(shadowMap, stc.xyz+vec3(-1.0/shadow_res.x, 1.5/shadow_res.y, 0.0)).x; - shadow += shadow2D(shadowMap, stc.xyz+vec3(-2.0/shadow_res.x, -1.5/shadow_res.y, 0.0)).x; - - return shadow*0.2; -} - - -void main() -{ - vec2 frag = vary_fragcoord.xy/vary_fragcoord.z*0.5+0.5; - frag *= screen_res; - - float shadow = 0.0; - vec4 pos = vec4(vary_position, 1.0); - - vec4 diff = texture2D(diffuseMap,vary_texcoord0.xy); - - if (diff.a < minimum_alpha) - { - discard; - } - - vec4 spos = pos; - - if (spos.z > -shadow_clip.w) - { - vec4 lpos; - - vec4 near_split = shadow_clip*-0.75; - vec4 far_split = shadow_clip*-1.25; - vec4 transition_domain = near_split-far_split; - float weight = 0.0; - - if (spos.z < near_split.z) - { - lpos = shadow_matrix[3]*spos; - - float w = 1.0; - w -= max(spos.z-far_split.z, 0.0)/transition_domain.z; - shadow += pcfShadow(shadowMap3, lpos)*w; - weight += w; - shadow += max((pos.z+shadow_clip.z)/(shadow_clip.z-shadow_clip.w)*2.0-1.0, 0.0); - } - - if (spos.z < near_split.y && spos.z > far_split.z) - { - lpos = shadow_matrix[2]*spos; - - float w = 1.0; - w -= max(spos.z-far_split.y, 0.0)/transition_domain.y; - w -= max(near_split.z-spos.z, 0.0)/transition_domain.z; - shadow += pcfShadow(shadowMap2, lpos)*w; - weight += w; - } - - if (spos.z < near_split.x && spos.z > far_split.y) - { - lpos = shadow_matrix[1]*spos; - - float w = 1.0; - w -= max(spos.z-far_split.x, 0.0)/transition_domain.x; - w -= max(near_split.y-spos.z, 0.0)/transition_domain.y; - shadow += pcfShadow(shadowMap1, lpos)*w; - weight += w; - } - - if (spos.z > far_split.x) - { - lpos = shadow_matrix[0]*spos; - - float w = 1.0; - w -= max(near_split.x-spos.z, 0.0)/transition_domain.x; - - shadow += pcfShadow(shadowMap0, lpos)*w; - weight += w; - } - - - shadow /= weight; - } - else - { - shadow = 1.0; - } - vec3 n = vary_norm; - vec3 l = light_position[0].xyz; - vec3 dlight = calcDirectionalLight(n, l); - dlight = dlight * vary_directional.rgb * vary_pointlight_col; - - vec4 col = vec4(vary_ambient + dlight*shadow, 1.0); - vec4 color = diff * col; - - color.rgb = atmosLighting(color.rgb); - - color.rgb = scaleSoftClip(color.rgb); - vec3 light_col = vec3(0,0,0); - - #define LIGHT_LOOP(i) \ - light_col += light_diffuse[i].rgb * calcPointLightOrSpotLight(pos.xyz, vary_norm, light_position[i], light_direction[i], light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z); - - LIGHT_LOOP(1) - LIGHT_LOOP(2) - LIGHT_LOOP(3) - LIGHT_LOOP(4) - LIGHT_LOOP(5) - LIGHT_LOOP(6) - LIGHT_LOOP(7) - - color.rgb += diff.rgb * vary_pointlight_col * light_col; - - frag_color = color; -} - diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl deleted file mode 100755 index 7f4d82ecc6..0000000000 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl +++ /dev/null @@ -1,156 +0,0 @@ -/** - * @file alphaSkinnedV.glsl - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -uniform mat4 projection_matrix; -uniform mat4 texture_matrix0; -uniform mat4 modelview_matrix; -uniform mat4 modelview_projection_matrix; - -ATTRIBUTE vec3 position; -ATTRIBUTE vec3 normal; -ATTRIBUTE vec4 diffuse_color; -ATTRIBUTE vec2 texcoord0; - -vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); -void calcAtmospherics(vec3 inPositionEye); - -float calcDirectionalLight(vec3 n, vec3 l); -mat4 getObjectSkinnedTransform(); -vec3 atmosAmbient(vec3 light); -vec3 atmosAffectDirectionalLight(float lightIntensity); -vec3 scaleDownLight(vec3 light); -vec3 scaleUpLight(vec3 light); - -VARYING vec3 vary_ambient; -VARYING vec3 vary_directional; -VARYING vec3 vary_fragcoord; -VARYING vec3 vary_position; -VARYING vec3 vary_pointlight_col; - -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; -VARYING vec3 vary_norm; - -uniform float near_clip; -uniform float shadow_offset; -uniform float shadow_bias; - -uniform vec4 light_position[8]; -uniform vec3 light_direction[8]; -uniform vec3 light_attenuation[8]; -uniform vec3 light_diffuse[8]; - -float calcDirectionalLight(vec3 n, vec3 l) -{ - float a = max(dot(n,l),0.0); - return a; -} - -float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) -{ -//get light vector - vec3 lv = lp.xyz-v; - - //get distance - float d = dot(lv,lv); - - float da = 0.0; - - if (d > 0.0 && la > 0.0 && fa > 0.0) - { - //normalize light vector - lv = normalize(lv); - - //distance attenuation - float dist2 = d/la; - da = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); - - // spotlight coefficient. - float spot = max(dot(-ln, lv), is_pointlight); - da *= spot*spot; // GL_SPOT_EXPONENT=2 - - //angular attenuation - da *= max(dot(n, lv), 0.0); - } - - return da; -} - -void main() -{ - vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; - - mat4 mat = getObjectSkinnedTransform(); - - mat = modelview_matrix * mat; - - vec3 pos = (mat*vec4(position, 1.0)).xyz; - - gl_Position = projection_matrix * vec4(pos, 1.0); - - vec4 n = vec4(position, 1.0); - n.xyz += normal.xyz; - n.xyz = (mat*n).xyz; - n.xyz = normalize(n.xyz-pos.xyz); - - vec3 norm = n.xyz; - vary_norm = norm; - - float dp_directional_light = max(0.0, dot(norm, light_position[0].xyz)); - vary_position = pos.xyz + light_position[0].xyz * (1.0-dp_directional_light)*shadow_offset; - - calcAtmospherics(pos.xyz); - - //vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.)); - vec4 col = vec4(0.0, 0.0, 0.0, diffuse_color.a); - - // Collect normal lights - col.rgb += light_diffuse[2].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[2], light_direction[2], light_attenuation[2].x, light_attenuation[2].y, light_attenuation[2].z); - col.rgb += light_diffuse[3].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[3], light_direction[3], light_attenuation[3].x, light_attenuation[3].y, light_attenuation[3].z); - col.rgb += light_diffuse[4].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[4], light_direction[4], light_attenuation[4].x, light_attenuation[4].y, light_attenuation[4].z); - col.rgb += light_diffuse[5].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[5], light_direction[5], light_attenuation[5].x, light_attenuation[5].y, light_attenuation[5].z); - col.rgb += light_diffuse[6].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[6], light_direction[6], light_attenuation[6].x, light_attenuation[6].y, light_attenuation[6].z); - col.rgb += light_diffuse[7].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[7], light_direction[7], light_attenuation[7].x, light_attenuation[7].y, light_attenuation[7].z); - - vary_pointlight_col = col.rgb*diffuse_color.rgb; - - col.rgb = vec3(0,0,0); - - // Add windlight lights - col.rgb = atmosAmbient(vec3(0.)); - - vary_ambient = col.rgb*diffuse_color.rgb; - vary_directional.rgb = diffuse_color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, light_position[0].xyz), (1.0-diffuse_color.a)*(1.0-diffuse_color.a))); - - col.rgb = min(col.rgb*diffuse_color.rgb, 1.0); - - vertex_color = col; - - - - pos.xyz = (modelview_projection_matrix * vec4(position.xyz, 1.0)).xyz; - vary_fragcoord.xyz = pos.xyz + vec3(0,0,near_clip); - -} - diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl deleted file mode 100755 index 13c6ffc607..0000000000 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl +++ /dev/null @@ -1,224 +0,0 @@ -/** - * @file alphaV.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -uniform mat3 normal_matrix; -uniform mat4 texture_matrix0; -uniform mat4 projection_matrix; -uniform mat4 modelview_matrix; -uniform mat4 modelview_projection_matrix; - -ATTRIBUTE vec3 position; - -#ifdef USE_INDEXED_TEX -void passTextureIndex(); -#endif - -ATTRIBUTE vec3 normal; - -#ifdef USE_VERTEX_COLOR -ATTRIBUTE vec4 diffuse_color; -#endif - -ATTRIBUTE vec2 texcoord0; - -#ifdef HAS_SKIN -mat4 getObjectSkinnedTransform(); -#else -#ifdef IS_AVATAR_SKIN -mat4 getSkinnedTransform(); -#endif -#endif - -vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); -void calcAtmospherics(vec3 inPositionEye); - -vec3 calcDirectionalLight(vec3 n, vec3 l); - -vec3 atmosAmbient(vec3 light); -vec3 atmosAffectDirectionalLight(float lightIntensity); -vec3 scaleDownLight(vec3 light); -vec3 scaleUpLight(vec3 light); - -VARYING vec3 vary_ambient; -VARYING vec3 vary_directional; -VARYING vec3 vary_fragcoord; -VARYING vec3 vary_position; -VARYING vec3 vary_pointlight_col; - -#ifdef USE_VERTEX_COLOR -VARYING vec4 vertex_color; -#endif - -VARYING vec2 vary_texcoord0; -VARYING vec3 vary_norm; - -uniform float near_clip; -uniform float shadow_offset; -uniform float shadow_bias; - -uniform vec4 light_position[8]; -uniform vec3 light_direction[8]; -uniform vec3 light_attenuation[8]; -uniform vec3 light_diffuse[8]; - -uniform vec3 sun_dir; - -vec3 calcDirectionalLight(vec3 n, vec3 l) -{ - float a = max(dot(n,l),0.0); - return vec3(a,a,a); -} - -vec3 calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) -{ - //get light vector - vec3 lv = lp.xyz-v; - - //get distance - float d = dot(lv,lv); - - float da = 0.0; - - if (d > 0.0 && la > 0.0 && fa > 0.0) - { - //normalize light vector - lv = normalize(lv); - - //distance attenuation - float dist2 = d/la; - da = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); - - // spotlight coefficient. - float spot = max(dot(-ln, lv), is_pointlight); - da *= spot*spot; // GL_SPOT_EXPONENT=2 - - //angular attenuation - da *= max(dot(n, lv), 0.0); - } - - return vec3(da,da,da); -} - -void main() -{ - vec4 pos; - vec3 norm; - - //transform vertex -#ifdef HAS_SKIN - mat4 trans = getObjectSkinnedTransform(); - trans = modelview_matrix * trans; - - pos = trans * vec4(position.xyz, 1.0); - - norm = position.xyz + normal.xyz; - norm = normalize((trans * vec4(norm, 1.0)).xyz - pos.xyz); - vec4 frag_pos = projection_matrix * pos; - gl_Position = frag_pos; -#else - -#ifdef IS_AVATAR_SKIN - mat4 trans = getSkinnedTransform(); - vec4 pos_in = vec4(position.xyz, 1.0); - pos.x = dot(trans[0], pos_in); - pos.y = dot(trans[1], pos_in); - pos.z = dot(trans[2], pos_in); - pos.w = 1.0; - - norm.x = dot(trans[0].xyz, normal); - norm.y = dot(trans[1].xyz, normal); - norm.z = dot(trans[2].xyz, normal); - norm = normalize(norm); - - vec4 frag_pos = projection_matrix * pos; - gl_Position = frag_pos; -#else - norm = normalize(normal_matrix * normal); - vec4 vert = vec4(position.xyz, 1.0); - pos = (modelview_matrix * vert); - gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); -#endif - -#endif - -#ifdef USE_INDEXED_TEX - passTextureIndex(); - vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; -#else - vary_texcoord0 = texcoord0; -#endif - - vary_norm = norm; - float dp_directional_light = max(0.0, dot(norm, light_position[0].xyz)); - vary_position = pos.xyz + light_position[0].xyz * (1.0-dp_directional_light)*shadow_offset; - - calcAtmospherics(pos.xyz); - -#ifndef USE_VERTEX_COLOR - vec4 diffuse_color = vec4(1,1,1,1); -#endif - - //vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.)); - vec4 col = vec4(0.0, 0.0, 0.0, diffuse_color.a); - - vec3 dff = pow(diffuse_color.rgb, vec3(2.2f,2.2f,2.2f)); - - vary_pointlight_col = dff; - - col.rgb = vec3(0,0,0); - - // Add windlight lights - col.rgb = atmosAmbient(col.rgb); - - float ambient = min(abs(dot(norm.xyz, sun_dir.xyz)), 1.0); - ambient *= 0.5; - ambient *= ambient; - ambient = (1.0-ambient); - - col.rgb *= ambient; - - vary_directional.rgb = atmosAffectDirectionalLight(1.0f); - vary_ambient = col.rgb*dff; - - col.rgb = col.rgb*dff; - -#ifdef USE_VERTEX_COLOR - vertex_color = col; -#endif - -#ifdef HAS_SKIN - vary_fragcoord.xyz = frag_pos.xyz + vec3(0,0,near_clip); -#else - -#ifdef IS_AVATAR_SKIN - vary_fragcoord.xyz = pos.xyz + vec3(0,0,near_clip); -#else - pos = modelview_projection_matrix * vert; - vary_fragcoord.xyz = pos.xyz + vec3(0,0,near_clip); -#endif - -#endif - -} diff --git a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl deleted file mode 100755 index 44aaa98b97..0000000000 --- a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl +++ /dev/null @@ -1,153 +0,0 @@ -/** - * @file avatarAlphaV.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -uniform mat4 projection_matrix; - -ATTRIBUTE vec3 position; -ATTRIBUTE vec3 normal; -ATTRIBUTE vec2 texcoord0; - -vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); -mat4 getSkinnedTransform(); -void calcAtmospherics(vec3 inPositionEye); - -float calcDirectionalLight(vec3 n, vec3 l); -float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight); - -vec3 atmosAmbient(vec3 light); -vec3 atmosAffectDirectionalLight(float lightIntensity); -vec3 scaleDownLight(vec3 light); -vec3 scaleUpLight(vec3 light); - -VARYING vec3 vary_position; -VARYING vec3 vary_ambient; -VARYING vec3 vary_directional; -VARYING vec3 vary_fragcoord; -VARYING vec3 vary_pointlight_col; -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; - -uniform vec4 color; - -uniform float near_clip; -uniform float shadow_offset; -uniform float shadow_bias; - -uniform vec4 light_position[8]; -uniform vec3 light_direction[8]; -uniform vec3 light_attenuation[8]; -uniform vec3 light_diffuse[8]; - -float calcDirectionalLight(vec3 n, vec3 l) -{ - float a = max(dot(n,l),0.0); - return a; -} - -float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) -{ - //get light vector - vec3 lv = lp.xyz-v; - - //get distance - float d = dot(lv,lv); - - float da = 0.0; - - if (d > 0.0 && la > 0.0 && fa > 0.0) - { - //normalize light vector - lv = normalize(lv); - - //distance attenuation - float dist2 = d/la; - da = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); - - // spotlight coefficient. - float spot = max(dot(-ln, lv), is_pointlight); - da *= spot*spot; // GL_SPOT_EXPONENT=2 - - //angular attenuation - da *= max(dot(n, lv), 0.0); - } - - return da; -} - -void main() -{ - vary_texcoord0 = texcoord0; - - vec4 pos; - vec3 norm; - - mat4 trans = getSkinnedTransform(); - vec4 pos_in = vec4(position.xyz, 1.0); - pos.x = dot(trans[0], pos_in); - pos.y = dot(trans[1], pos_in); - pos.z = dot(trans[2], pos_in); - pos.w = 1.0; - - norm.x = dot(trans[0].xyz, normal); - norm.y = dot(trans[1].xyz, normal); - norm.z = dot(trans[2].xyz, normal); - norm = normalize(norm); - - gl_Position = projection_matrix * pos; - - float dp_directional_light = max(0.0, dot(norm, light_position[0].xyz)); - vary_position = pos.xyz + light_position[0].xyz * (1.0-dp_directional_light)*shadow_offset; - - calcAtmospherics(pos.xyz); - - vec4 col = vec4(0.0, 0.0, 0.0, 1.0); - - // Collect normal lights - col.rgb += light_diffuse[2].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[2], light_direction[2], light_attenuation[2].x, light_attenuation[2].y, light_attenuation[2].z); - col.rgb += light_diffuse[3].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[3], light_direction[3], light_attenuation[3].x, light_attenuation[3].y, light_attenuation[3].z); - col.rgb += light_diffuse[4].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[4], light_direction[4], light_attenuation[4].x, light_attenuation[4].y, light_attenuation[4].z); - col.rgb += light_diffuse[5].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[5], light_direction[5], light_attenuation[5].x, light_attenuation[5].y, light_attenuation[5].z); - col.rgb += light_diffuse[6].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[6], light_direction[6], light_attenuation[6].x, light_attenuation[6].y, light_attenuation[6].z); - col.rgb += light_diffuse[7].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[7], light_direction[7], light_attenuation[7].x, light_attenuation[7].y, light_attenuation[7].z); - - vary_pointlight_col = col.rgb*color.rgb; - - col.rgb = vec3(0,0,0); - - // Add windlight lights - col.rgb = atmosAmbient(vec3(0.)); - - vary_ambient = col.rgb*color.rgb; - vary_directional = atmosAffectDirectionalLight(max(calcDirectionalLight(norm, light_position[0].xyz), 0.0)); - - col.rgb = col.rgb*color.rgb; - - vertex_color = col; - - - vary_fragcoord.xyz = pos.xyz + vec3(0,0,near_clip); -} - - diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl index eaacb93cb9..c20e00163c 100755 --- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl @@ -24,6 +24,7 @@ */ #extension GL_ARB_texture_rectangle : enable +#extension GL_ARB_shader_texture_lod : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; @@ -68,22 +69,43 @@ uniform vec2 screen_res; uniform mat4 inv_proj; -#ifdef SINGLE_FP_ONLY -vec2 encode_normal(vec3 n) +vec3 srgb_to_linear(vec3 cs) { - vec2 sn; - sn.xy = (n.xy * vec2(0.5f,0.5f)) + vec2(0.5f,0.5f); - return sn; + vec3 low_range = cs / vec3(12.92); + vec3 high_range = pow((cs+vec3(0.055))/vec3(1.055), vec3(2.4)); + bvec3 lte = lessThanEqual(cs,vec3(0.04045)); + +#ifdef OLD_SELECT + vec3 result; + result.r = lte.r ? low_range.r : high_range.r; + result.g = lte.g ? low_range.g : high_range.g; + result.b = lte.b ? low_range.b : high_range.b; + return result; +#else + return mix(high_range, low_range, lte); +#endif + } -vec3 decode_normal (vec2 enc) +vec3 linear_to_srgb(vec3 cl) { - vec3 n; - n.xy = (enc.xy * vec2(2.0f,2.0f)) - vec2(1.0f,1.0f); - n.z = sqrt(1.0f - dot(n.xy,n.xy)); - return n; -} + cl = clamp(cl, vec3(0), vec3(1)); + vec3 low_range = cl * 12.92; + vec3 high_range = 1.055 * pow(cl, vec3(0.41666)) - 0.055; + bvec3 lt = lessThan(cl,vec3(0.0031308)); + +#ifdef OLD_SELECT + vec3 result; + result.r = lt.r ? low_range.r : high_range.r; + result.g = lt.g ? low_range.g : high_range.g; + result.b = lt.b ? low_range.b : high_range.b; + return result; #else + return mix(high_range, low_range, lt); +#endif + +} + vec2 encode_normal(vec3 n) { float f = sqrt(8 * n.z + 8); @@ -100,14 +122,12 @@ vec3 decode_normal (vec2 enc) n.z = 1-f/2; return n; } -#endif vec4 correctWithGamma(vec4 col) { - return vec4(pow(col.rgb, vec3(2.2)), col.a); + return vec4(srgb_to_linear(col.rgb), col.a); } - vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod) { vec4 ret = texture2DLod(projectionMap, tc, lod); @@ -179,9 +199,9 @@ void main() vec3 pos = getPosition(frag.xy).xyz; vec3 lv = center.xyz-pos.xyz; - float dist2 = dot(lv,lv); - dist2 /= size; - if (dist2 > 1.0) + float dist = length(lv); + dist /= size; + if (dist > 1.0) { discard; } @@ -215,8 +235,9 @@ void main() proj_tc.xyz /= proj_tc.w; float fa = falloff+1.0; - float dist_atten = min(1.0-(dist2-1.0*(1.0-fa))/fa, 1.0); - dist_atten = pow(dist_atten, 2.2) * 2.2; + float dist_atten = min(1.0-(dist-1.0*(1.0-fa))/fa, 1.0); + dist_atten *= dist_atten; + dist_atten *= 2.0; if (dist_atten <= 0.0) { discard; @@ -313,14 +334,12 @@ void main() vec3 pfinal = pos + ref * dot(pdelta, proj_n)/ds; vec4 stc = (proj_mat * vec4(pfinal.xyz, 1.0)); + stc /= stc.w; if (stc.z > 0.0) { - stc.xy /= stc.w; + float fatten = clamp(envIntensity*envIntensity+envIntensity*0.25, 0.25, 1.0); - float fatten = clamp(envIntensity*envIntensity+envIntensity*0.5, 0.25, 1.0); - - //stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); if (stc.x < 1.0 && @@ -328,12 +347,16 @@ void main() stc.x > 0.0 && stc.y > 0.0) { - col += color.rgb*texture2DLodSpecular(projectionMap, stc.xy, proj_lod-envIntensity*proj_lod).rgb*shadow*spec.rgb; + col += color.rgb*texture2DLodSpecular(projectionMap, stc.xy, proj_lod).rgb*shadow*spec.rgb; } } } } + + //not sure why, but this line prevents MATBUG-194 + col = max(col, vec3(0.0)); + frag_color.rgb = col; frag_color.a = 0.0; } diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index 4fe2f1551e..1022c23f7b 100755 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -78,22 +78,43 @@ vec3 vary_AtmosAttenuation; uniform mat4 inv_proj; uniform vec2 screen_res; -#ifdef SINGLE_FP_ONLY -vec2 encode_normal(vec3 n) +vec3 srgb_to_linear(vec3 cs) { - vec2 sn; - sn.xy = (n.xy * vec2(0.5f,0.5f)) + vec2(0.5f,0.5f); - return sn; + vec3 low_range = cs / vec3(12.92); + vec3 high_range = pow((cs+vec3(0.055))/vec3(1.055), vec3(2.4)); + bvec3 lte = lessThanEqual(cs,vec3(0.04045)); + +#ifdef OLD_SELECT + vec3 result; + result.r = lte.r ? low_range.r : high_range.r; + result.g = lte.g ? low_range.g : high_range.g; + result.b = lte.b ? low_range.b : high_range.b; + return result; +#else + return mix(high_range, low_range, lte); +#endif + } -vec3 decode_normal (vec2 enc) +vec3 linear_to_srgb(vec3 cl) { - vec3 n; - n.xy = (enc.xy * vec2(2.0f,2.0f)) - vec2(1.0f,1.0f); - n.z = sqrt(1.0f - dot(n.xy,n.xy)); - return n; -} + cl = clamp(cl, vec3(0), vec3(1)); + vec3 low_range = cl * 12.92; + vec3 high_range = 1.055 * pow(cl, vec3(0.41666)) - 0.055; + bvec3 lt = lessThan(cl,vec3(0.0031308)); + +#ifdef OLD_SELECT + vec3 result; + result.r = lt.r ? low_range.r : high_range.r; + result.g = lt.g ? low_range.g : high_range.g; + result.b = lt.b ? low_range.b : high_range.b; + return result; #else + return mix(high_range, low_range, lt); +#endif + +} + vec2 encode_normal(vec3 n) { float f = sqrt(8 * n.z + 8); @@ -110,7 +131,6 @@ vec3 decode_normal (vec2 enc) n.z = 1-f/2; return n; } -#endif vec4 getPosition_d(vec2 pos_screen, float depth) { @@ -254,10 +274,60 @@ void calcAtmospherics(vec3 inPositionEye, float ambFactor) { + tmpAmbient))); //brightness of surface both sunlight and ambient - setSunlitColor(pow(vec3(sunlight * .5), vec3(global_gamma)) * global_gamma); + /*setSunlitColor(pow(vec3(sunlight * .5), vec3(global_gamma)) * global_gamma); setAmblitColor(pow(vec3(tmpAmbient * .25), vec3(global_gamma)) * global_gamma); - setAdditiveColor(pow(getAdditiveColor() * vec3(1.0 - temp1), vec3(global_gamma)) * global_gamma); + setAdditiveColor(pow(getAdditiveColor() * vec3(1.0 - temp1), vec3(global_gamma)) * global_gamma);*/ + + setSunlitColor(vec3(sunlight * .5)); + setAmblitColor(vec3(tmpAmbient * .25)); + setAdditiveColor(getAdditiveColor() * vec3(1.0 - temp1)); +} + +#ifdef WATER_FOG +uniform vec4 waterPlane; +uniform vec4 waterFogColor; +uniform float waterFogDensity; +uniform float waterFogKS; + +vec4 applyWaterFogDeferred(vec3 pos, vec4 color) +{ + //normalize view vector + vec3 view = normalize(pos); + float es = -(dot(view, waterPlane.xyz)); + + //find intersection point with water plane and eye vector + + //get eye depth + float e0 = max(-waterPlane.w, 0.0); + + vec3 int_v = waterPlane.w > 0.0 ? view * waterPlane.w/es : vec3(0.0, 0.0, 0.0); + + //get object depth + float depth = length(pos - int_v); + + //get "thickness" of water + float l = max(depth, 0.1); + + float kd = waterFogDensity; + float ks = waterFogKS; + vec4 kc = waterFogColor; + + float F = 0.98; + + float t1 = -kd * pow(F, ks * e0); + float t2 = kd + ks * es; + float t3 = pow(F, t2*l) - 1.0; + + float L = min(t1/t2*t3, 1.0); + + float D = pow(0.98, l*kd); + + color.rgb = color.rgb * D + kc.rgb * L; + color.a = kc.a + color.a; + + return color; } +#endif vec3 atmosLighting(vec3 light) { @@ -332,7 +402,14 @@ void main() float da = max(dot(norm.xyz, sun_dir.xyz), 0.0); + float light_gamma = 1.0/1.3; + da = pow(da, light_gamma); + + vec4 diffuse = texture2DRect(diffuseRect, tc); + + //convert to gamma space + diffuse.rgb = linear_to_srgb(diffuse.rgb); vec3 col; float bloom = 0.0; @@ -340,7 +417,12 @@ void main() vec4 spec = texture2DRect(specularRect, vary_fragcoord.xy); vec2 scol_ambocc = texture2DRect(lightMap, vary_fragcoord.xy).rg; + scol_ambocc = pow(scol_ambocc, vec2(light_gamma)); + float scol = max(scol_ambocc.r, diffuse.a); + + + float ambocc = scol_ambocc.g; calcAtmospherics(pos.xyz, ambocc); @@ -353,7 +435,7 @@ void main() col.rgb *= ambient; - col += atmosAffectDirectionalLight(max(min(da, scol) * 2.6, 0.0)); + col += atmosAffectDirectionalLight(max(min(da, scol), 0.0)); col *= diffuse.rgb; @@ -374,30 +456,33 @@ void main() } - col = mix(col.rgb, pow(diffuse.rgb, vec3(1.0/2.2)), diffuse.a); - - + col = mix(col, diffuse.rgb, diffuse.a); + if (envIntensity > 0.0) { //add environmentmap vec3 env_vec = env_mat * refnormpersp; - float exponent = mix(2.2, 1.0, diffuse.a); - vec3 refcol = pow(textureCube(environmentMap, env_vec).rgb, vec3(exponent))*exponent; + vec3 refcol = textureCube(environmentMap, env_vec).rgb; col = mix(col.rgb, refcol, envIntensity); } - - float exponent = mix(1.0, 2.2, diffuse.a); - col = pow(col, vec3(exponent)); - + if (norm.w < 0.5) { col = mix(atmosLighting(col), fullbrightAtmosTransport(col), diffuse.a); col = mix(scaleSoftClip(col), fullbrightScaleSoftClip(col), diffuse.a); } + #ifdef WATER_FOG + vec4 fogged = applyWaterFogDeferred(pos,vec4(col, bloom)); + col = fogged.rgb; + bloom = fogged.a; + #endif + + col = srgb_to_linear(col); + //col = vec3(1,0,1); //col.g = envIntensity; } diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl index bdb713d682..7689b72d20 100755 --- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl @@ -24,6 +24,7 @@ */ #extension GL_ARB_texture_rectangle : enable +#extension GL_ARB_shader_texture_lod : enable #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; @@ -68,22 +69,6 @@ uniform vec2 screen_res; uniform mat4 inv_proj; -#ifdef SINGLE_FP_ONLY -vec2 encode_normal(vec3 n) -{ - vec2 sn; - sn.xy = (n.xy * vec2(0.5f,0.5f)) + vec2(0.5f,0.5f); - return sn; -} - -vec3 decode_normal (vec2 enc) -{ - vec3 n; - n.xy = (enc.xy * vec2(2.0f,2.0f)) - vec2(1.0f,1.0f); - n.z = sqrt(1.0f - dot(n.xy,n.xy)); - return n; -} -#else vec2 encode_normal(vec3 n) { float f = sqrt(8 * n.z + 8); @@ -100,11 +85,47 @@ vec3 decode_normal (vec2 enc) n.z = 1-f/2; return n; } + +vec3 srgb_to_linear(vec3 cs) +{ + vec3 low_range = cs / vec3(12.92); + vec3 high_range = pow((cs+vec3(0.055))/vec3(1.055), vec3(2.4)); + bvec3 lte = lessThanEqual(cs,vec3(0.04045)); + +#ifdef OLD_SELECT + vec3 result; + result.r = lte.r ? low_range.r : high_range.r; + result.g = lte.g ? low_range.g : high_range.g; + result.b = lte.b ? low_range.b : high_range.b; + return result; +#else + return mix(high_range, low_range, lte); #endif +} + +vec3 linear_to_srgb(vec3 cl) +{ + cl = clamp(cl, vec3(0), vec3(1)); + vec3 low_range = cl * 12.92; + vec3 high_range = 1.055 * pow(cl, vec3(0.41666)) - 0.055; + bvec3 lt = lessThan(cl,vec3(0.0031308)); + +#ifdef OLD_SELECT + vec3 result; + result.r = lt.r ? low_range.r : high_range.r; + result.g = lt.g ? low_range.g : high_range.g; + result.b = lt.b ? low_range.b : high_range.b; + return result; +#else + return mix(high_range, low_range, lt); +#endif + +} + vec4 correctWithGamma(vec4 col) { - return vec4(pow(col.rgb, vec3(2.2)), col.a); + return vec4(srgb_to_linear(col.rgb), col.a); } vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod) @@ -178,9 +199,9 @@ void main() vec3 pos = getPosition(frag.xy).xyz; vec3 lv = trans_center.xyz-pos.xyz; - float dist2 = dot(lv,lv); - dist2 /= size; - if (dist2 > 1.0) + float dist = length(lv); + dist /= size; + if (dist > 1.0) { discard; } @@ -212,8 +233,10 @@ void main() proj_tc.xyz /= proj_tc.w; float fa = falloff+1.0; - float dist_atten = min(1.0-(dist2-1.0*(1.0-fa))/fa, 1.0); - dist_atten = pow(dist_atten, 2.2) * 2.2; + float dist_atten = min(1.0-(dist-1.0*(1.0-fa))/fa, 1.0); + dist_atten *= dist_atten; + dist_atten *= 2.0; + if (dist_atten <= 0.0) { discard; @@ -331,6 +354,9 @@ void main() } } + //not sure why, but this line prevents MATBUG-194 + col = max(col, vec3(0.0)); + frag_color.rgb = col; frag_color.a = 0.0; } diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl index 7b09dd29dd..95c09d3238 100755 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl @@ -65,22 +65,6 @@ uniform float shadow_offset; uniform float spot_shadow_bias; uniform float spot_shadow_offset; -#ifdef SINGLE_FP_ONLY -vec2 encode_normal(vec3 n) -{ - vec2 sn; - sn.xy = (n.xy * vec2(0.5f,0.5f)) + vec2(0.5f,0.5f); - return sn; -} - -vec3 decode_normal (vec2 enc) -{ - vec3 n; - n.xy = (enc.xy * vec2(2.0f,2.0f)) - vec2(1.0f,1.0f); - n.z = sqrt(1.0f - dot(n.xy,n.xy)); - return n; -} -#else vec2 encode_normal(vec3 n) { float f = sqrt(8 * n.z + 8); @@ -97,7 +81,6 @@ vec3 decode_normal (vec2 enc) n.z = 1-f/2; return n; } -#endif vec4 getPosition(vec2 pos_screen) { diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl index 01e34ed792..b5ff6404ea 100755 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl @@ -66,22 +66,6 @@ uniform float shadow_offset; uniform float spot_shadow_bias; uniform float spot_shadow_offset; -#ifdef SINGLE_FP_ONLY -vec2 encode_normal(vec3 n) -{ - vec2 sn; - sn.xy = (n.xy * vec2(0.5f,0.5f)) + vec2(0.5f,0.5f); - return sn; -} - -vec3 decode_normal (vec2 enc) -{ - vec3 n; - n.xy = (enc.xy * vec2(2.0f,2.0f)) - vec2(1.0f,1.0f); - n.z = sqrt(1.0f - dot(n.xy,n.xy)); - return n; -} -#else vec2 encode_normal(vec3 n) { float f = sqrt(8 * n.z + 8); @@ -98,7 +82,6 @@ vec3 decode_normal (vec2 enc) n.z = 1-f/2; return n; } -#endif vec4 getPosition(vec2 pos_screen) { diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl index 8fd06c7e2f..d174805cc0 100755 --- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl @@ -54,7 +54,6 @@ uniform float density_multiplier; uniform float distance_multiplier; uniform float max_y; uniform vec4 glow; -uniform float global_gamma; void calcAtmospherics(vec3 inPositionEye) { @@ -132,9 +131,9 @@ void calcAtmospherics(vec3 inPositionEye) { + tmpAmbient))); //brightness of surface both sunlight and ambient - setSunlitColor(pow(vec3(sunlight * .5), vec3(global_gamma)) * global_gamma); - setAmblitColor(pow(vec3(tmpAmbient * .25), vec3(global_gamma)) * global_gamma); - setAdditiveColor(pow(getAdditiveColor() * vec3(1.0 - temp1), vec3(global_gamma)) * global_gamma); + setSunlitColor(vec3(sunlight * .5)); + setAmblitColor(vec3(tmpAmbient * .25)); + setAdditiveColor(getAdditiveColor() * vec3(1.0 - temp1)); // vary_SunlitColor = vec3(0); // vary_AmblitColor = vec3(0); diff --git a/indra/newview/featuretable_mac.txt b/indra/newview/featuretable_mac.txt index 1c0d45c11b..0bdd425504 100755 --- a/indra/newview/featuretable_mac.txt +++ b/indra/newview/featuretable_mac.txt @@ -309,8 +309,8 @@ RenderVolumeLODFactor 1 2.0 VertexShaderEnable 1 1 WindLightUseAtmosShaders 1 1 WLSkyDetail 1 128 -RenderDeferred 1 0 -RenderDeferredSSAO 1 0 +RenderDeferred 1 1 +RenderDeferredSSAO 1 1 RenderShadowDetail 1 2 RenderFSAASamples 1 2 diff --git a/indra/newview/gpu_table.txt b/indra/newview/gpu_table.txt index c64e11929d..23a065caff 100755 --- a/indra/newview/gpu_table.txt +++ b/indra/newview/gpu_table.txt @@ -1,3 +1,4 @@ +//GPU_TABLE - that token on line 1 tags this as a gpu table file // // Categorizes graphics chips into various classes by name // @@ -38,7 +39,7 @@ ATI 3D-Analyze .*ATI.*3D-Analyze.* 0 0 0 0 ATI All-in-Wonder 7500 .*ATI.*All-in-Wonder 75.* 0 1 0 0 ATI All-in-Wonder 8500 .*ATI.*All-in-Wonder 85.* 0 1 0 0 ATI All-in-Wonder 9200 .*ATI.*All-in-Wonder 92.* 0 1 0 0 -ATI All-in-Wonder 9xxx .*ATI.*All-in-Wonder 9.* 1 1 0 0 +ATI All-in-Wonder 9xxx .*ATI.*All-in-Wonder 9.* 1 1 0 2.1 ATI All-in-Wonder HD .*ATI.*All-in-Wonder HD.* 1 1 1 3.3 ATI All-in-Wonder X600 .*ATI.*All-in-Wonder X6.* 1 1 0 0 ATI All-in-Wonder X800 .*ATI.*All-in-Wonder X8.* 1 1 1 2.1 @@ -46,162 +47,132 @@ ATI All-in-Wonder X1800 .*ATI.*All-in-Wonder X18.* 3 1 0 0 ATI All-in-Wonder X1900 .*ATI.*All-in-Wonder X19.* 3 1 0 0 ATI All-in-Wonder PCI-E .*ATI.*All-in-Wonder.*PCI-E.* 1 1 0 0 ATI All-in-Wonder Radeon .*ATI.*All-in-Wonder Radeon.* 0 1 0 0 -ATI ASUS ARES .*ATI.*ASUS.*ARES.* 3 1 0 0 -ATI ASUS A9xxx .*ATI.*ASUS.*A9.* 1 1 0 0 -ATI ASUS AH24xx .*ATI.*ASUS.*AH24.* 1 1 1 3.3 -ATI ASUS AH26xx .*ATI.*ASUS.*AH26.* 1 1 1 3.3 -ATI ASUS AH34xx .*ATI.*ASUS.*AH34.* 1 1 1 3.3 -ATI ASUS AH36xx .*ATI.*ASUS.*AH36.* 1 1 1 3.3 -ATI ASUS AH46xx .*ATI.*ASUS.*AH46.* 2 1 1 3.3 -ATI ASUS AX3xx .*ATI.*ASUS.*AX3.* 1 1 0 0 -ATI ASUS AX5xx .*ATI.*ASUS.*AX5.* 1 1 0 0 -ATI ASUS AX8xx .*ATI.*ASUS.*AX8.* 2 1 0 0 -ATI ASUS EAH24xx .*ATI.*ASUS.*EAH24.* 2 1 0 0 -ATI ASUS EAH26xx .*ATI.*ASUS.*EAH26.* 3 1 0 0 -ATI ASUS EAH29xx .*ATI.*ASUS.*EAH29.* 3 1 0 0 -ATI ASUS EAH34xx .*ATI.*ASUS.*EAH34.* 1 1 0 0 -ATI ASUS EAH36xx .*ATI.*ASUS.*EAH36.* 2 1 0 0 -ATI ASUS EAH38xx .*ATI.*ASUS.*EAH38.* 2 1 1 3.3 -ATI ASUS EAH43xx .*ATI.*ASUS.*EAH43.* 2 1 1 3.3 -ATI ASUS EAH45xx .*ATI.*ASUS.*EAH45.* 2 1 0 0 -ATI ASUS EAH48xx .*ATI.*ASUS.*EAH48.* 3 1 1 3.3 -ATI ASUS EAH57xx .*ATI.*ASUS.*EAH57.* 3 1 1 4.1 -ATI ASUS EAH58xx .*ATI.*ASUS.*EAH58.* 5 1 1 4.1 -ATI ASUS EAH62xx .*ATI.*ASUS.*EAH62.* 2 1 0 0 -ATI ASUS EAH63xx .*ATI.*ASUS.*EAH63.* 2 1 0 0 -ATI ASUS EAH64xx .*ATI.*ASUS.*EAH64.* 2 1 0 0 -ATI ASUS EAH65xx .*ATI.*ASUS.*EAH65.* 2 1 0 4.1 -ATI ASUS EAH66xx .*ATI.*ASUS.*EAH66.* 3 1 0 4.1 -ATI ASUS EAH67xx .*ATI.*ASUS.*EAH67.* 3 1 0 0 -ATI ASUS EAH68xx .*ATI.*ASUS.*EAH68.* 5 1 0 4 -ATI ASUS EAH69xx .*ATI.*ASUS.*EAH69.* 5 1 0 4.1 -ATI ASUS Radeon X1xxx .*ATI.*ASUS.*X1.* 2 1 1 2.1 -ATI Radeon X7xx .*ATI.*ASUS.*X7.* 1 1 0 0 -ATI Radeon X19xx .*ATI.*(Radeon|Diamond) X19.* ?.* 2 1 1 2.1 -ATI Radeon X18xx .*ATI.*(Radeon|Diamond) X18.* ?.* 3 1 1 2.1 +ATI Radeon X1300 .*ATI.*(ASUS|Radeon).*X13.* 2 1 1 2.1 +ATI Radeon X1500 .*ATI.*(ASUS|Radeon).*X15.* 2 1 1 2.1 +ATI Radeon X1600 .*ATI.*(ASUS|Radeon).*X16.* 2 1 1 2.1 +ATI Radeon X1700 .*ATI.*(ASUS|Radeon).*X17.* 2 1 1 2.1 +ATI Radeon X1800 .*ATI.*(Radeon|Diamond) X18.* ?.* 3 1 1 2.1 +ATI Radeon X1900 .*ATI.*(Radeon|Diamond|ASUS) X19.* ?.* 2 1 1 2.1 ATI Radeon X17xx .*ATI.*(Radeon|Diamond) X17.* ?.* 1 1 1 2.1 -ATI Radeon X16xx .*ATI.*(Radeon|Diamond) X16.* ?.* 1 1 1 2.1 -ATI Radeon X15xx .*ATI.*(Radeon|Diamond) X15.* ?.* 1 1 1 2.1 -ATI Radeon X13xx .*ATI.*(Radeon|Diamond) X13.* ?.* 1 1 1 2.1 -ATI Radeon X1xxx .*ATI.*(Radeon|Diamond) X1.. ?.* 0 1 1 2.1 -ATI Radeon X2xxx .*ATI.*(Radeon|Diamond) X2.. ?.* 1 1 1 2.1 +ATI Radeon X16xx .*ATI.*(Radeon|Diamond) X17.* ?.* 1 1 1 2.1 +ATI Radeon X28xx .*ATI.*(Radeon|Diamond) X28.. ?.* 1 1 1 2.1 ATI Display Adapter .*ATI.*display adapter.* 1 1 1 4.1 ATI FireGL 5200 .*ATI.*FireGL V52.* 1 1 1 2.1 ATI FireGL 5xxx .*ATI.*FireGL V5.* 2 1 1 3.3 ATI FireGL .*ATI.*Fire.*GL.* 4 1 1 4.2 -ATI FirePro M3900 .*ATI.*FirePro.*M39.* 2 1 0 0 +ATI FirePro M3900 .*ATI.*FirePro.*M39.* 2 1 0 4.1 ATI FirePro M5800 .*ATI.*FirePro.*M58.* 3 1 0 0 ATI FirePro M7740 .*ATI.*FirePro.*M77.* 3 1 0 0 ATI FirePro M7820 .*ATI.*FirePro.*M78.* 5 1 1 4.2 -ATI FireMV .*ATI.*FireMV.* 0 1 1 1.3 +ATI FireMV .*ATI.*FireMV.* 0 1 1 3.2 ATI Generic .*ATI.*Generic.* 0 0 0 0 ATI Hercules 9800 .*ATI.*Hercules.* 9800.* 1 1 0 0 -ATI IGP 340M .*ATI.*IGP.*340M.* 0 0 0 0 +ATI IGP 340M .*ATI.*IGP.* 34[0-9]M.* 0 0 0 1.3 ATI M52 .*ATI.*M52.* 1 1 0 0 ATI M54 .*ATI.*M54.* 1 1 0 0 ATI M56 .*ATI.*M56.* 1 1 0 0 ATI M71 .*ATI.*M71.* 1 1 0 0 ATI M72 .*ATI.*M72.* 1 1 0 0 ATI M76 .*ATI.*M76.* 3 1 0 0 -ATI Radeon HD 64xx .*ATI.*AMD Radeon.* HD [67]4..[MG] 2 1 1 4.2 -ATI Radeon HD 65xx .*ATI.*AMD Radeon.* HD [67]5..[MG] 2 1 1 4.2 -ATI Radeon HD 66xx .*ATI.*AMD Radeon.* HD [67]6..[MG] 3 1 1 4.2 -ATI Radeon HD 7100 .*ATI.*AMD Radeon.* HD 71.* 2 1 0 0 -ATI Radeon HD 7200 .*ATI.*AMD Radeon.* HD 72.* 2 1 0 0 -ATI Radeon HD 7300 .*ATI.*AMD Radeon.* HD 73.* 2 1 0 4.2 -ATI Radeon HD 7400 .*ATI.*AMD Radeon.* HD 74.* 2 1 0 4.2 -ATI Radeon HD 7500 .*ATI.*AMD Radeon.* HD 75.* 3 1 1 4.2 -ATI Radeon HD 7600 .*ATI.*AMD Radeon.* HD 76.* 3 1 0 4.2 -ATI Radeon HD 7700 .*ATI.*AMD Radeon.* HD 77.* 4 1 1 4.2 -ATI Radeon HD 7800 .*ATI.*AMD Radeon.* HD 78.* 5 1 1 4.2 -ATI Radeon HD 7900 .*ATI.*AMD Radeon.* HD 79.* 5 1 1 4.2 -ATI ASUS HD7100 .*ATI.*ASUS.* HD71.* 2 1 0 0 -ATI ASUS HD7200 .*ATI.*ASUS.* HD72.* 2 1 0 0 -ATI ASUS HD7300 .*ATI.*ASUS.* HD73.* 2 1 0 0 -ATI ASUS HD7400 .*ATI.*ASUS.* HD74.* 2 1 0 0 -ATI ASUS HD7500 .*ATI.*ASUS.* HD75.* 3 1 1 4.2 -ATI ASUS HD7600 .*ATI.*ASUS.* HD76.* 3 1 0 0 -ATI ASUS HD7700 .*ATI.*ASUS.* HD77.* 4 1 1 4.2 -ATI ASUS HD7800 .*ATI.*ASUS.* HD78.* 5 1 1 4.2 -ATI ASUS HD7900 .*ATI.*ASUS.* HD79.* 5 1 1 4.2 +ATI Radeon HD 6300M .*ATI.*AMD Radeon.* (HD|HD )63..M 2 1 1 4.2 +ATI Radeon HD 6400M .*ATI.*AMD Radeon.* (HD|HD )64..M 2 1 1 4.2 +ATI Radeon HD 6500M .*ATI.*AMD Radeon.* (HD|HD )65..M 2 1 1 4.2 +ATI Radeon HD 6600M .*ATI.*AMD Radeon.* (HD 6|6)6..M 3 1 1 4.2 +ATI Radeon HD 6700M .*ATI.*AMD Radeon.* (HD|HD )67..M 3 1 1 4.2 +ATI Radeon HD 6800M .*ATI.*AMD Radeon.* (HD|HD )68..M 3 1 1 4.2 +ATI Radeon HD 6300G .*ATI.*AMD Radeon.* (HD|HD )63..G 2 1 1 4.2 +ATI Radeon HD 6400G .*ATI.*AMD Radeon.* (HD|HD )64..G 2 1 1 4.2 +ATI Radeon HD 6500G .*ATI.*AMD Radeon.* (HD|HD )65..G 2 1 1 4.2 +ATI Radeon HD 6600G .*ATI.*AMD Radeon.* (HD|HD )66..G 3 1 1 4.2 +ATI Radeon HD 7100 .*ATI.*(Radeon|ASUS).* (HD|HD )71.* 2 1 0 0 +ATI Radeon HD 7200 .*ATI.*(Radeon|ASUS).* (HD|HD )72.* 2 1 0 4.2 +ATI Radeon HD 7300 .*ATI.*(Radeon|ASUS).* (HD|HD )73.* 2 1 0 4.2 +ATI Radeon HD 7400 .*ATI.*(Radeon|ASUS).* (HD|HD )74.* 2 1 0 4.2 +ATI Radeon HD 7500 .*ATI.*(Radeon|ASUS).* (HD|HD )75.* 3 1 1 4.2 +ATI Radeon HD 7600 .*ATI.*(Radeon|ASUS).* (HD|HD )76.* 3 1 0 4.2 +ATI Radeon HD 7700 .*ATI.*(Radeon|ASUS).* (HD|HD )77.* 4 1 1 4.2 +ATI Radeon HD 7800 .*ATI.*(Radeon|ASUS).* (HD|HD )78.* 5 1 1 4.2 +ATI Radeon HD 7900 .*ATI.*(Radeon|ASUS).* (HD|HD )79.* 5 1 1 4.2 +ATI Radeon HD 7000 Series .*ATI.*(Radeon|ASUS).* (HD|HD )7000 Series.* 3 1 1 4.2 ATI Mobility Radeon 4100 .*ATI.*Mobility.* 41.. 1 1 1 3.3 +ATI Mobility Radeon 5000 .*ATI.*Mobility.* 50.. 1 1 1 4.2 ATI Mobility Radeon 7xxx .*ATI.*Mobility.*Radeon 7.* 0 1 1 1.3 ATI Mobility Radeon 8xxx .*ATI.*Mobility.*Radeon 8.* 0 1 0 0 ATI Mobility Radeon 9800 .*ATI.*Mobility.* 98.* 1 1 0 0 ATI Mobility Radeon 9700 .*ATI.*Mobility.* 97.* 0 1 1 2.1 ATI Mobility Radeon 9600 .*ATI.*Mobility.* 96.* 1 1 1 2.1 -ATI Mobility Radeon HD 530v .*ATI.*Mobility.*HD *530v.* 1 1 1 3.3 -ATI Mobility Radeon HD 540v .*ATI.*Mobility.*HD *540v.* 1 1 1 3.3 -ATI Mobility Radeon HD 545v .*ATI.*Mobility.*HD *545v.* 2 1 1 4 -ATI Mobility Radeon HD 550v .*ATI.*Mobility.*HD *550v.* 3 1 1 4 -ATI Mobility Radeon HD 560v .*ATI.*Mobility.*HD *560v.* 3 1 1 3.2 -ATI Mobility Radeon HD 565v .*ATI.*Mobility.*HD *565v.* 3 1 1 3.3 -ATI Mobility Radeon HD 2300 .*ATI.*Mobility.*HD *23.* 0 1 1 2.1 -ATI Mobility Radeon HD 2400 .*ATI.*Mobility.*HD *24.* 1 1 1 3.3 -ATI Mobility Radeon HD 2600 .*ATI.*Mobility.*HD *26.* 1 1 1 3.3 -ATI Mobility Radeon HD 2700 .*ATI.*Mobility.*HD *27.* 3 1 0 0 -ATI Mobility Radeon HD 3100 .*ATI.*Mobility.*HD *31.* 0 1 0 0 -ATI Mobility Radeon HD 3200 .*ATI.*Mobility.*HD *32.* 0 1 0 0 -ATI Mobility Radeon HD 3400 .*ATI.*Mobility.*HD *34.* 1 1 1 3.3 -ATI Mobility Radeon HD 3600 .*ATI.*Mobility.*HD *36.* 1 1 1 4 -ATI Mobility Radeon HD 3800 .*ATI.*Mobility.*HD *38.* 3 1 1 3.3 -ATI Mobility Radeon HD 4200 .*ATI.*Mobility.*HD *42.* 1 1 1 4 -ATI Mobility Radeon HD 4300 .*ATI.*Mobility.*HD *43.* 1 1 1 4 -ATI Mobility Radeon HD 4500 .*ATI.*Mobility.*HD *45.* 1 1 1 4 -ATI Mobility Radeon HD 4600 .*ATI.*Mobility.*HD *46.* 2 1 1 3.3 -ATI Mobility Radeon HD 4800 .*ATI.*Mobility.*HD *48.* 3 1 1 3.3 -ATI Mobility Radeon HD 5100 .*ATI.*Mobility.*HD *51.* 3 1 1 3.2 -ATI Mobility Radeon HD 5300 .*ATI.*Mobility.*HD *53.* 3 1 0 0 -ATI Mobility Radeon HD 5400 .*ATI.*Mobility.*HD *54.* 2 1 1 4.2 -ATI Mobility Radeon HD 5500 .*ATI.*Mobility.*HD *55.* 3 1 0 0 -ATI Mobility Radeon HD 5600 .*ATI.*Mobility.*HD *56.* 3 1 1 4.2 -ATI Mobility Radeon HD 5700 .*ATI.*Mobility.*HD *57.* 3 1 1 4.1 -ATI Mobility Radeon HD 6200 .*ATI.*Mobility.*HD *62.* 3 1 0 0 -ATI Mobility Radeon HD 6300 .*ATI.*Mobility.*HD *63.* 3 1 1 4.2 -ATI Mobility Radeon HD 6400M .*ATI.*Mobility.*HD *64.* 3 1 0 0 -ATI Mobility Radeon HD 6500M .*ATI.*Mobility.*HD *65.* 5 1 1 4.2 -ATI Mobility Radeon HD 6600M .*ATI.*Mobility.*HD *66.* 5 1 0 0 -ATI Mobility Radeon HD 6700M .*ATI.*Mobility.*HD *67.* 5 1 0 0 -ATI Mobility Radeon HD 6800M .*ATI.*Mobility.*HD *68.* 5 1 0 0 -ATI Mobility Radeon HD 6900M .*ATI.*Mobility.*HD *69.* 5 1 0 0 -ATI Radeon HD 2300 .*ATI.*Radeon HD *23.. 0 1 1 3.3 -ATI Radeon HD 2400 .*ATI.*Radeon HD *24.. 1 1 1 4 -ATI Radeon HD 2600 .*ATI.*Radeon HD *26.. 2 1 1 3.3 -ATI Radeon HD 2900 .*ATI.*Radeon HD *29.. 3 1 1 3.3 -ATI Radeon HD 3000 .*ATI.*Radeon HD *30.. 0 1 0 0 -ATI Radeon HD 3100 .*ATI.*Radeon HD *31.. 1 1 0 0 -ATI Radeon HD 3200 .*ATI.*Radeon HD *32.. 1 1 1 4 -ATI Radeon HD 3300 .*ATI.*Radeon HD *33.. 1 1 1 3.3 -ATI Radeon HD 3400 .*ATI.*Radeon HD *34.. 1 1 1 4 -ATI Radeon HD 3500 .*ATI.*Radeon HD *35.. 2 1 0 0 -ATI Radeon HD 3600 .*ATI.*Radeon HD *36.. 3 1 1 3.3 -ATI Radeon HD 3700 .*ATI.*Radeon HD *37.. 3 1 0 0 +ATI Mobility Radeon HD 530v .*ATI.*Mobility.*HD 530v.* 1 1 1 3.3 +ATI Mobility Radeon HD 540v .*ATI.*Mobility.*HD 540v.* 1 1 1 3.3 +ATI Mobility Radeon HD 545v .*ATI.*Mobility.*HD 545v.* 2 1 1 4 +ATI Mobility Radeon HD 550v .*ATI.*Mobility.*HD 550v.* 3 1 1 4 +ATI Mobility Radeon HD 560v .*ATI.*Mobility.*HD 560v.* 3 1 1 3.2 +ATI Mobility Radeon HD 565v .*ATI.*Mobility.*HD 565v.* 3 1 1 3.3 +ATI Mobility Radeon HD 2300 .*ATI.*Mobility.*HD 23.* 0 1 1 2.1 +ATI Mobility Radeon HD 2400 .*ATI.*Mobility.*HD 24.* 1 1 1 3.3 +ATI Mobility Radeon HD 2600 .*ATI.*Mobility.*HD 26.* 1 1 1 3.3 +ATI Mobility Radeon HD 2700 .*ATI.*Mobility.*HD 27.* 3 1 0 0 +ATI Mobility Radeon HD 3100 .*ATI.*Mobility.*HD 31.* 0 1 0 0 +ATI Mobility Radeon HD 3200 .*ATI.*Mobility.*HD 32.* 0 1 0 0 +ATI Mobility Radeon HD 3400 .*ATI.*Mobility.*HD 34.* 1 1 1 4 +ATI Mobility Radeon HD 3600 .*ATI.*Mobility.*HD 36.* 1 1 1 4 +ATI Mobility Radeon HD 3800 .*ATI.*Mobility.*HD 38.* 3 1 1 3.3 +ATI Mobility Radeon HD 4200 .*ATI.*Mobility.*HD 42.* 1 1 1 4 +ATI Mobility Radeon HD 4300 .*ATI.*Mobility.*(HD |HD)43.* 1 1 1 4 +ATI Mobility Radeon HD 4500 .*ATI.*Mobility.*HD 45.* 1 1 1 4 +ATI Mobility Radeon HD 4600 .*ATI.*Mobility.*HD 46.* 2 1 1 3.3 +ATI Mobility Radeon HD 4800 .*ATI.*Mobility.*HD 48.* 3 1 1 3.3 +ATI Mobility Radeon HD 5000 Series .*ATI.*Mobility.*HD 50.* 3 1 1 3.2 +ATI Mobility Radeon HD 5100 .*ATI.*Mobility.*HD 51.* 3 1 1 3.2 +ATI Mobility Radeon HD 5300 .*ATI.*Mobility.*HD 53.* 3 1 0 0 +ATI Mobility Radeon HD 5400 .*ATI.*Mobility.*HD 54.* 2 1 1 4.2 +ATI Mobility Radeon HD 5500 .*ATI.*Mobility.*HD 55.* 3 1 0 4.2 +ATI Mobility Radeon HD 5600 .*ATI.*Mobility.*HD 56.* 3 1 1 4.2 +ATI Mobility Radeon HD 5700 .*ATI.*Mobility.*HD 57.* 3 1 1 4.1 +ATI Mobility Radeon HD 6200 .*ATI.*Mobility.*HD 62.* 3 1 0 0 +ATI Mobility Radeon HD 6300 .*ATI.*Mobility.*HD 63.* 3 1 1 4.2 +ATI Mobility Radeon HD 6400M .*ATI.*Mobility.*HD 64.* 3 1 0 0 +ATI Mobility Radeon HD 6500M .*ATI.*Mobility.*HD 65.* 5 1 1 4.2 +ATI Mobility Radeon HD 6600M .*ATI.*Mobility.*HD 66.* 5 1 0 0 +ATI Mobility Radeon HD 6700M .*ATI.*Mobility.*HD 67.* 5 1 0 0 +ATI Mobility Radeon HD 6800M .*ATI.*Mobility.*HD 68.* 5 1 0 0 +ATI Mobility Radeon HD 6900M .*ATI.*Mobility.*HD 69.* 5 1 0 0 +ATI Mobility Radeon Graphics .*ATI Mobility Radeon Graphics.* 1 1 0 4 +ATI Radeon HD 2300 .*ATI.*Radeon.* (HD|HD )23.. 0 1 1 3.3 +ATI Radeon HD 2400 .*ATI.*(Radeon|ASUS).* (HD|HD |EAH)24.. 1 1 1 4 +ATI Radeon HD 2600 .*ATI.*(Radeon|ASUS).* (HD|HD |EAH)26.. 2 1 1 4 +ATI Radeon HD 2900 .*ATI.*Radeon.* (HD|HD )29.. 3 1 1 3.3 +ATI Radeon HD 3000 .*ATI.*Radeon.* (HD|HD )30.. 0 1 0 0 +ATI Radeon HD 3100 .*ATI.*Radeon.* (HD|HD )31.. 1 1 0 0 +ATI Radeon HD 3200 .*ATI.*Radeon.* (HD|HD )32.. 1 1 1 4 +ATI Radeon HD 3300 .*ATI.*Radeon.* (HD|HD )33.. 1 1 1 3.3 +ATI Radeon HD 3400 .*ATI.*(Radeon|ASUS).* (HD|HD |AH|EAH)34.. 1 1 1 4 +ATI Radeon HD 3500 .*ATI.*Radeon.* (HD|HD )35.. 2 1 0 0 +ATI Radeon HD 3600 .*ATI.*(Radeon|ASUS).* (HD|HD |AH|EAH)36.. 3 1 1 4 +ATI Radeon HD 3700 .*ATI.*Radeon.* (HD|HD )37.. 3 1 0 3.3 ATI HD3700 .*ATI.* HD37.. 3 1 0 3.3 -ATI Radeon HD 3800 .*ATI.*Radeon HD *38.. 3 1 1 4 -ATI Radeon HD 4100 .*ATI.*Radeon HD *41.. 1 1 0 0 -ATI Radeon HD 4200 .*ATI.*Radeon HD *42.. 1 1 1 4 -ATI Radeon HD 4300 .*ATI.*Radeon HD *43.. 2 1 1 4 -ATI Radeon HD 4400 .*ATI.*Radeon HD *44.. 2 1 0 0 -ATI Radeon HD 4500 .*ATI.*Radeon HD *45.. 2 1 1 3.3 -ATI Radeon HD 4600 .*ATI.*Radeon HD *46.. 3 1 1 4 -ATI Radeon HD 4700 .*ATI.*Radeon HD *47.. 3 1 1 3.3 -ATI Radeon HD 4800 .*ATI.*Radeon HD *48.. 3 1 1 4 -ATI ASUS EAH5400 .*ATI.*ASUS EAH54.. 3 1 1 4.2 -ATI Radeon HD 5400 .*ATI.*Radeon HD *54.. 3 1 1 4.2 -ATI Radeon HD 5500 .*ATI.*Radeon HD *55.. 3 1 1 4.2 -ATI ASUS EAH5500 .*ATI.*ASUS EAH55.. 3 1 1 4.2 -ATI Radeon HD 5600 .*ATI.*Radeon HD *56.. 3 1 1 4.2 -ATI Radeon HD 5700 .*ATI.*Radeon HD *57.. 3 1 1 4.2 -ATI Radeon HD 5800 .*ATI.*Radeon HD *58.. 4 1 1 4.2 -ATI Radeon HD 5900 .*ATI.*Radeon HD *59.. 4 1 1 4.2 -ATI Radeon HD 6200 .*ATI.*Radeon HD *62.. 0 1 1 4.2 -ATI Radeon HD 6300 .*ATI.*Radeon HD *63.. 1 1 1 4.2 -ATI Radeon HD 6400 .*ATI.*Radeon HD *64.. 3 1 1 4.2 -ATI Radeon HD 6500 .*ATI.*Radeon HD *65.. 3 1 1 4.2 -ATI Radeon HD 6600 .*ATI.*Radeon HD *66.. 3 1 1 4.2 -ATI Radeon HD 6700 .*ATI.*Radeon HD *67.. 3 1 1 4.2 -ATI Radeon HD 6800 .*ATI.*Radeon HD *68.. 4 1 1 4.2 -ATI Radeon HD 6900 .*ATI.*Radeon HD *69.. 5 1 1 4.2 +ATI Radeon HD 3800 .*ATI.*(Radeon|ASUS).* (HD|HD |EAH)38.. 3 1 1 4 +ATI Radeon HD 4100 .*ATI.*Radeon.* (HD|HD )41.. 1 1 0 0 +ATI Radeon HD 4200 .*ATI.*Radeon.* (HD|HD )42.. 1 1 1 4 +ATI Radeon HD 4300 .*ATI.*(Radeon|ASUS).* (HD4|HD 4|EAH4|4)3.. 2 1 1 4 +ATI Radeon HD 4400 .*ATI.*Radeon.* (HD|HD )44.. 2 1 0 0 +ATI Radeon HD 4500 .*ATI.*(Radeon|ASUS).* (HD|HD |EAH)45.. 2 1 1 3.3 +ATI Radeon HD 4600 .*ATI.*(Radeon|ASUS).* (HD|HD |EAH)46.. 3 1 1 4 +ATI Radeon HD 4700 .*ATI.*(Radeon|ASUS).* (HD|HD |EAH)47.. 3 1 1 3.3 +ATI Radeon HD 4800 .*ATI.*(Radeon|ASUS).* (HD|HD |EAH)48.. 3 1 1 4 +ATI Radeon HD 5400 .*ATI.*(Radeon|ASUS).* (HD|HD |EAH)54.. 3 1 1 4.2 +ATI Radeon HD 5500 .*ATI.*(Radeon|ASUS).* (HD|HD |EAH)55.. 3 1 1 4.2 +ATI Radeon HD 5600 .*ATI.*(Radeon|ASUS).* (HD|HD |EAH)56.. 3 1 1 4.2 +ATI Radeon HD 5700 .*ATI.*(Radeon|ASUS).* (HD|HD |EAH)57.. 3 1 1 4.2 +ATI Radeon HD 5800 .*ATI.*(Radeon|ASUS).* (HD|HD |EAH)58.. 4 1 1 4.2 +ATI Radeon HD 5900 .*ATI.*Radeon.* (HD|HD )59.. 4 1 1 4.2 +ATI Radeon HD 6200 .*ATI.*Radeon.* (HD|HD )62.. 0 1 1 4.2 +ATI Radeon HD 6300 .*ATI.*Radeon.* (HD|HD )63.. 1 1 1 4.2 +ATI Radeon HD 6400 .*ATI.*(Radeon|ASUS).* (HD|HD |EAH)64.. 3 1 1 4.2 +ATI Radeon HD 6500 .*ATI.*(Radeon|ASUS).* (HD|HD |EAH)65.. 3 1 1 4.2 +ATI Radeon HD 6600 .*ATI.*(Radeon|ASUS).* (HD|HD |EAH)66.. 3 1 1 4.2 +ATI Radeon HD 6700 .*ATI.*(Radeon|ASUS).* (HD|HD |EAH)67.. 3 1 1 4.2 +ATI Radeon HD 6800 .*ATI.*(Radeon|ASUS).* (HD|HD |EAH)68.. 4 1 1 4.2 +ATI Radeon HD 6900 .*ATI.*(Radeon|ASUS).* (HD|HD |EAH)69.. 5 1 1 4.2 ATI Radeon OpenGL .*ATI.*Radeon OpenGL.* 0 0 0 0 ATI Radeon 2100 .*ATI.*Radeon 21.. 0 1 1 2.1 ATI Radeon 3000 .*ATI.*Radeon 30.. 1 1 1 4 @@ -219,17 +190,21 @@ ATI Radeon 9800 .*ATI.*Radeon 98.. 1 1 1 2.1 ATI Radeon RV250 .*ATI.*RV250.* 0 1 0 0 ATI Radeon RV600 .*ATI.*RV6.* 1 1 0 0 ATI Radeon RX700 .*ATI.*RX70.* 1 1 0 0 -ATI Radeon RX800 .*ATI.*Radeon *RX80.* 2 1 0 0 +ATI Radeon RX800 .*ATI.*Radeon RX80.* 2 1 0 0 ATI RS880M .*ATI.*RS880M 1 1 0 0 ATI Radeon RX9550 .*ATI.*RX9550.* 1 1 0 0 ATI Radeon VE .*ATI.*Radeon.*VE.* 0 0 0 0 -ATI Radeon X300 .*ATI.*Radeon *X3.* 1 1 1 2.1 +ATI Radeon X300 .*ATI.*Radeon X3.* 1 1 1 2.1 ATI Radeon X400 .*ATI.*Radeon ?X4.* 0 1 0 0 ATI Radeon X500 .*ATI.*Radeon ?X5.* 1 1 1 2.1 -ATI Radeon X600 .*ATI.*Radeon ?X6.* 1 1 1 2.1 +ATI Radeon X600 .*ATI.*(Radeon |ASUS Extreme A)X6.* 1 1 1 2.1 ATI Radeon X700 .*ATI.*Radeon ?X7.* 2 1 1 2.1 ATI Radeon X800 .*ATI.*Radeon ?X8.* 1 1 1 2.1 ATI Radeon X900 .*ATI.*Radeon ?X9.* 2 1 0 0 +ATI Radeon X1000 .*ATI.*Radeon ?X10.* 2 1 0 2.1 +ATI Radeon X1200 .*ATI.*Radeon ?X12.* 2 1 0 2.1 +ATI Radeon X1400 .*ATI.*Radeon ?X14.* 2 1 0 2.1 +ATI Radeon X2300 .*ATI.*Radeon ?X23.* 2 1 0 2.1 ATI Radeon Xpress .*ATI.*Radeon Xpress.* 0 1 1 2.1 ATI Rage 128 .*ATI.*Rage 128.* 0 1 0 0 ATI R300 (9700) .*R300.* 0 1 1 2.1 @@ -248,41 +223,43 @@ ATI RV530 .*RV530.* 1 1 0 0 ATI RX480 (Xpress 200P) .*RX480.* 0 1 0 0 ATI RX700 .*RX700.* 1 1 0 0 AMD ANTILLES (HD 6990) .*(AMD|ATI).*Antilles.* 3 1 0 0 +ATI ROBSON .*(AMD|ATI).*ROBSON.* 3 1 0 4 AMD BARTS (HD 6800) .*(AMD|ATI).*Barts.* 3 1 1 2.1 +AMD WRESTLER .*(AMD|ATI).*WRESTLER.* 3 1 1 4 +AMD SUMO .*(AMD|ATI).*SUMO.* 3 1 1 4.1 AMD CAICOS (HD 6400) .*(AMD|ATI).*Caicos.* 3 1 0 0 AMD CAYMAN (HD 6900) .*(AMD|ATI).*(Cayman|CAYMAM).* 3 1 0 0 -AMD CEDAR (HD 5450) .*(AMD|ATI).*Cedar.* 2 1 0 0 +AMD CEDAR (HD 5450) .*(AMD|ATI).*Cedar.* 2 1 0 2.1 AMD CYPRESS (HD 5800) .*(AMD|ATI).*Cypress.* 3 1 0 0 AMD HEMLOCK (HD 5970) .*(AMD|ATI).*Hemlock.* 3 1 0 0 AMD JUNIPER (HD 5700) .*(AMD|ATI).*Juniper.* 3 1 0 0 AMD PARK .*(AMD|ATI).*Park.* 3 1 0 0 -AMD REDWOOD (HD 5500/5600) .*(AMD|ATI).*Redwood.* 3 1 0 0 -AMD TURKS (HD 6500/6600) .*(AMD|ATI).*Turks.* 3 1 0 0 +AMD REDWOOD (HD 5500/5600) .*(AMD|ATI).*Redwood.* 3 1 0 1.4 +AMD TURKS (HD 6500/6600) .*(AMD|ATI).*Turks.* 3 1 0 2.1 AMD RS780 (HD 3200) .*RS780.* 0 1 1 2.1 AMD RS880 (HD 4200) .*RS880.* 0 1 1 3.2 AMD RV610 (HD 2400) .*RV610.* 1 1 0 0 AMD RV620 (HD 3400) .*RV620.* 1 1 0 0 AMD RV630 (HD 2600) .*RV630.* 2 1 0 0 -AMD RV635 (HD 3600) .*RV635.* 3 1 0 0 +AMD RV635 (HD 3600) .*RV635.* 3 1 0 1.4 AMD RV670 (HD 3800) .*RV670.* 3 1 0 0 AMD R680 (HD 3870 X2) .*R680.* 3 1 0 0 AMD R700 (HD 4800 X2) .*R700.* 3 1 0 0 AMD RV710 (HD 4300) .*RV710.* 0 1 1 1.4 -AMD RV730 (HD 4600) .*RV730.* 3 1 0 0 +AMD RV730 (HD 4600) .*RV730.* 3 1 0 1.4 AMD RV740 (HD 4700) .*RV740.* 3 1 0 0 AMD RV770 (HD 4800) .*RV770.* 3 1 0 0 AMD RV790 (HD 4800) .*RV790.* 3 1 0 0 ATI 760G/Radeon 3000 .*ATI.*AMD 760G.* 1 1 1 3.3 ATI 780L/Radeon 3000 .*ATI.*AMD 780L.* 1 1 0 0 ATI Radeon DDR .*ATI.*Radeon ?DDR.* 0 1 0 0 -ATI FirePro 2000 .*ATI.*FirePro 2.* 2 1 1 4.1 +ATI FirePro 2000 .*ATI.*FirePro 2.* 2 1 1 4.2 ATI FirePro 3000 .*ATI.*FirePro V3.* 2 1 0 0 -ATI FirePro 4000 .*ATI.*FirePro V4.* 2 1 0 0 +ATI FirePro 4000 .*ATI.*FirePro V4.* 2 1 0 4.1 ATI FirePro 5000 .*ATI.*FirePro V5.* 3 1 0 0 ATI FirePro 7000 .*ATI.*FirePro V7.* 3 1 0 0 ATI FirePro M .*ATI.*FirePro M.* 3 1 1 4.2 ATI R300 (9700) .*R300.* 0 1 1 2.1 -ATI Radeon .*ATI.*(Diamond|Radeon).* 0 1 0 4.2 Intel X3100 .*Intel.*X3100.* 1 1 1 2.1 Intel GMA 3600 .*Intel.* 3600.* 0 1 1 3 Intel 830M .*Intel.*830M 0 0 0 0 @@ -308,8 +285,6 @@ Intel Graphics Media HD .*Intel.*Graphics Media.*HD.* 1 1 1 2.1 Intel HD Graphics 2000 .*Intel.*HD Graphics 2.* 2 1 0 4 Intel HD Graphics 3000 .*Intel.*HD Graphics 3.* 3 1 1 3.1 Intel HD Graphics 4000 .*Intel.*HD Graphics 4.* 3 1 1 4 -Intel HD2000 .*Intel.*HD2000.* 2 1 0 0 -Intel HD3000 .*Intel.*HD3000.* 3 1 0 0 Intel HD Graphics .*Intel.*HD Graphics.* 2 1 1 4 Intel Mobile 4 Series .*Intel.*Mobile.* 4 Series.* 0 1 1 2.1 Intel 4 Series Internal .*Intel.* 4 Series Internal.* 1 1 1 2.1 @@ -322,113 +297,109 @@ Intel Q45/Q43 .*Intel.*Q4.* 1 1 1 2.1 Intel B45/B43 .*Intel.*B4.* 1 1 1 2.1 Intel 3D-Analyze .*Intel.*3D-Analyze.* 2 1 0 0 Matrox .*Matrox.* 0 0 0 0 -Mesa .*Mesa.* 1 0 1 2.1 +Mesa .*Mesa.* 1 0 1 3 Gallium .*Gallium.* 1 1 1 2.1 -NVIDIA G100M .*NVIDIA .*100M.* 4 1 1 3.3 -NVIDIA G102M .*NVIDIA .*102M.* 1 1 1 3.3 -NVIDIA G103M .*NVIDIA .*103M.* 2 1 1 3.3 -NVIDIA G105M .*NVIDIA .*105M.* 2 1 1 3.3 -NVIDIA G 110M .*NVIDIA .*110M.* 1 1 1 3.3 -NVIDIA G 120M .*NVIDIA .*120M.* 1 1 1 3.3 -NVIDIA G 205M .*NVIDIA .*205M.* 1 1 0 0 -NVIDIA G 410M .*NVIDIA .*410M.* 3 1 1 4.2 -NVIDIA GT 120M .*NVIDIA .*GT *12*M.* 3 1 1 3.3 -NVIDIA GT 130M .*NVIDIA .*GT *13*M.* 3 1 1 3.3 -NVIDIA GT 140M .*NVIDIA .*GT *14*M.* 3 1 1 3.3 -NVIDIA GT 150M .*NVIDIA .*GTS *15*M.* 2 1 0 0 -NVIDIA GTS 160M .*NVIDIA .*GTS *16*M.* 2 1 0 0 -NVIDIA G210M .*NVIDIA .*G21*M.* 3 1 0 0 -NVIDIA GT 220M .*NVIDIA .*GT *22*M.* 3 1 1 3.3 -NVIDIA GT 230M .*NVIDIA .*GT *23*M.* 3 1 1 3.3 -NVIDIA GT 240M .*NVIDIA .*GT *24*M.* 3 1 1 3.3 -NVIDIA GTS 250M .*NVIDIA .*GTS *25*M.* 3 1 0 0 -NVIDIA GTS 260M .*NVIDIA .*GTS *26*M.* 3 1 0 0 -NVIDIA GTX 260M .*NVIDIA .*GTX *26*M.* 3 1 0 0 -NVIDIA GTX 270M .*NVIDIA .*GTX *27*M.* 3 1 0 0 -NVIDIA GTX 280M .*NVIDIA .*GTX *28*M.* 3 1 0 0 -NVIDIA 300M .*NVIDIA .*30*M.* 3 1 1 4.2 -NVIDIA G 310M .*NVIDIA .*31*M.* 2 1 0 0 -NVIDIA GT 320M .*NVIDIA .*GT *32*M.* 3 1 0 0 -NVIDIA GT 325M .*NVIDIA .*GT *32*M.* 3 1 1 3.3 -NVIDIA GT 330M .*NVIDIA .*GT *33*M.* 3 1 1 3.3 -NVIDIA GT 340M .*NVIDIA .*GT *34*M.* 4 1 1 3.3 -NVIDIA GTS 350M .*NVIDIA .*GTS *35*M.* 4 1 1 3.3 -NVIDIA GTS 360M .*NVIDIA .*GTS *360M.* 5 1 1 3.3 -NVIDIA 405M .*NVIDIA .* 40*M.* 2 1 0 4.2 -NVIDIA 410M .*NVIDIA .* 41*M.* 3 1 0 0 -NVIDIA GT 415M .*NVIDIA .*GT *41*M.* 3 1 1 4.2 -NVIDIA GT 420M .*NVIDIA .*GT *42*M.* 3 1 1 4.2 -NVIDIA GT 430M .*NVIDIA .*GT *43*M.* 3 1 1 4.2 -NVIDIA GT 440M .*NVIDIA .*GT *44*M.* 3 1 1 4.2 -NVIDIA GT 450M .*NVIDIA .*GT *45*M.* 3 1 0 0 -NVIDIA GTX 460M .*NVIDIA .*GTX *46*M.* 4 1 1 4.2 -NVIDIA GTX 470M .*NVIDIA .*GTX *47*M.* 3 1 0 0 -NVIDIA GTX 480M .*NVIDIA .*GTX *48*M.* 3 1 1 4.2 -NVIDIA GT 520M .*NVIDIA .*GT *52*M.* 3 1 1 4.2 -NVIDIA GT 530M .*NVIDIA .*GT *53*M.* 3 1 1 4.2 -NVIDIA GT 540M .*NVIDIA .*GT *54*M.* 3 1 1 4.2 -NVIDIA GT 550M .*NVIDIA .*GT *55*M.* 3 1 1 4.2 -NVIDIA GTX 560M .*NVIDIA .*GTX *56*M.* 3 1 0 0 -NVIDIA GTX 570M .*NVIDIA .*GTX *57*M.* 5 1 0 0 -NVIDIA GTX 580M .*NVIDIA .*GTX *58*M.* 5 1 1 4.2 -NVIDIA 610M .*NVIDIA.* 61*M.* 3 1 1 4.2 -NVIDIA GT 620M .*NVIDIA .*GT *62*M.* 3 1 0 0 -NVIDIA GT 630M .*NVIDIA .*GT *63*M.* 3 1 0 0 -NVIDIA GT 640M .*NVIDIA .*GT *64*M.* 3 1 0 0 -NVIDIA GT 650M .*NVIDIA .*GT *65*M.* 3 1 0 0 -NVIDIA GTX 660M .*NVIDIA .*GTX *66*M.* 5 1 0 0 -NVIDIA GTX 670M .*NVIDIA .*GTX *67*M.* 5 1 1 4.2 -NVIDIA GTX 680M .*NVIDIA .*GTX *68*M.* 5 1 0 0 -NVIDIA GTX 690M .*NVIDIA .*GTX *69*M.* 5 1 0 0 +NVIDIA G100M .*NVIDIA .* 10[0-9]M.* 4 1 1 3.3 +NVIDIA G 110M .*NVIDIA .* 11[0-9]M.* 1 1 1 3.3 +NVIDIA G 120M .*NVIDIA .* 12[0-9]M.* 1 1 1 3.3 +NVIDIA G 200M .*NVIDIA .* 20[0-9]M.* 1 1 0 0 +NVIDIA G 410M .*NVIDIA .* 41[0-9]M.* 3 1 1 4.2 +NVIDIA GT 130M .*NVIDIA .*GT 13[0-9]M.* 3 1 1 3.3 +NVIDIA GT 140M .*NVIDIA .*GT 14[0-9]M.* 3 1 1 3.3 +NVIDIA GT 150M .*NVIDIA .*GTS 15[0-9]M.* 2 1 0 0 +NVIDIA GTS 160M .*NVIDIA .*GTS 16[0-9]M.* 2 1 0 0 +NVIDIA G210M .*NVIDIA .*G21[0-9]M.* 3 1 0 3.3 +NVIDIA GT 220M .*NVIDIA .*GT 22[0-9]M.* 3 1 1 3.3 +NVIDIA GT 230M .*NVIDIA .*GT 23[0-9]M.* 3 1 1 3.3 +NVIDIA GT 240M .*NVIDIA .*GT 24[0-9]M.* 3 1 1 3.3 +NVIDIA GTS 250M .*NVIDIA .*GTS 25[0-9]M.* 3 1 0 3.3 +NVIDIA GTS 260M .*NVIDIA .*GTS 26[0-9]M.* 3 1 0 0 +NVIDIA GTX 260M .*NVIDIA .*GTX 26[0-9]M.* 3 1 0 3.3 +NVIDIA GTX 270M .*NVIDIA .*GTX 27[0-9]M.* 3 1 0 0 +NVIDIA GTX 280M .*NVIDIA .*GTX 28[0-9]M.* 3 1 0 3.3 +NVIDIA 300M .*NVIDIA .*GT 30[0-9]M.* 3 1 1 4.2 +NVIDIA G 310M .*NVIDIA .* 31[0-9]M.* 2 1 0 3.3 +NVIDIA GT 320M .*NVIDIA .* 32[0-9]M.* 3 1 0 3.3 +NVIDIA GT 330M .*NVIDIA .*GT 33[0-9]M.* 3 1 1 3.3 +NVIDIA GT 340M .*NVIDIA .*GT 34[0-9]M.* 4 1 1 3.3 +NVIDIA GTS 350M .*NVIDIA .*GTS 35[0-9]M.* 4 1 1 3.3 +NVIDIA GTS 360M .*NVIDIA .*GTS 36[0-9]M.* 5 1 1 3.3 +NVIDIA 400M .*NVIDIA .* 40[0-9]M.* 2 1 0 0 +NVIDIA 410M .*NVIDIA .* 41[0-9]M.* 3 1 0 0 +NVIDIA GT 420M .*NVIDIA .*GT 42[0-9]M.* 3 1 1 4.2 +NVIDIA GT 430M .*NVIDIA .*GT 43[0-9]M.* 3 1 1 4.2 +NVIDIA GT 440M .*NVIDIA .*GT 44[0-9]M.* 3 1 1 4.2 +NVIDIA GT 450M .*NVIDIA .*GT 45[0-9]M.* 3 1 0 0 +NVIDIA GTX 460M .*NVIDIA .*GTX 46[0-9]M.* 4 1 1 4.3 +NVIDIA GTX 470M .*NVIDIA .*GTX 47[0-9]M.* 3 1 0 4.2 +NVIDIA GTX 480M .*NVIDIA .*GTX 48[0-9]M.* 3 1 1 4.2 +NVIDIA GT 520M .*NVIDIA .*GT 52[0-9]M.* 3 1 1 4.2 +NVIDIA GT 530M .*NVIDIA .*GT 53[0-9]M.* 3 1 1 4.2 +NVIDIA GT 540M .*NVIDIA .*GT 54[0-9]M.* 3 1 1 4.2 +NVIDIA GT 550M .*GeForce GT 55[0-9]M.* 3 1 1 4.2 +NVIDIA GTX 560M .*NVIDIA .*GTX 56[0-9]M.* 3 1 0 4.2 +NVIDIA GTX 570M .*NVIDIA .*GTX 57[0-9]M.* 5 1 0 4.2 +NVIDIA GTX 580M .*NVIDIA .*GTX 58[0-9]M.* 5 1 1 4.2 +NVIDIA 610M .*NVIDIA.* 61[0-9]M.* 3 1 1 4.2 +NVIDIA GT 620M .*NVIDIA .*GT 62[0-9]M.* 3 1 0 4.2 +NVIDIA GT 630M .*NVIDIA .*GT 63[0-9]M.* 3 1 0 4.2 +NVIDIA GT 640M .*NVIDIA .*GT 64[0-9]M.* 3 1 0 4.2 +NVIDIA GT 650M .*NVIDIA .*GT 65[0-9]M.* 3 1 0 4.2 +NVIDIA GTX 660M .*NVIDIA .*GTX 66[0-9]M.* 5 1 0 4.3 +NVIDIA GTX 670M .*NVIDIA .*GTX 67[0-9]M.* 5 1 1 4.2 +NVIDIA GTX 680M .*NVIDIA .*GTX 68[0-9]M.* 5 1 0 4.2 +NVIDIA GTX 690M .*NVIDIA .*GTX 69[0-9]M.* 5 1 0 0 NVIDIA G100 .*NVIDIA .*G10.* 3 1 1 4.2 -NVIDIA GT 120 .*NVIDIA .*GT *12.* 2 1 0 3 -NVIDIA GT 130 .*NVIDIA .*GT *13.* 2 1 0 3.3 -NVIDIA GTS 150 .*NVIDIA .*GTS *15.* 2 1 0 0 +NVIDIA GT 120 .*NVIDIA .*GT 12.* 2 1 0 3.3 +NVIDIA GT 130 .*NVIDIA .*GT 13.* 2 1 0 3.3 +NVIDIA GT 140 .*NVIDIA .*GT 14.* 2 1 0 3.3 +NVIDIA GTS 150 .*NVIDIA .*GTS 15.* 2 1 0 0 NVIDIA 200 .*NVIDIA .*GeForce 20.* 2 1 1 3.3 NVIDIA G200 .*NVIDIA .*GeForce G20.* 2 1 1 3.3 NVIDIA G210 .*NVIDIA .*GeForce G210.* 3 1 1 3.3 NVIDIA 210 .*NVIDIA .*GeForce 210.* 3 1 1 3.3 -NVIDIA GT 220 .*NVIDIA .*GT *22.* 2 1 1 3.3 -NVIDIA GT 230 .*NVIDIA .*GT *23.* 2 1 1 3.3 -NVIDIA GT 240 .*NVIDIA .*GT *24.* 4 1 1 3.3 -NVIDIA GTS 240 .*NVIDIA .*GTS *24.* 4 1 1 3.3 -NVIDIA GTS 250 .*NVIDIA .*GTS *25.* 4 1 1 3.3 -NVIDIA GTX 260 .*NVIDIA .*GTX *26.* 4 1 1 3.3 -NVIDIA GTX 270 .*NVIDIA .*GTX *27.* 4 1 0 3.3 -NVIDIA GTX 280 .*NVIDIA .*GTX *28.* 4 1 1 3.3 -NVIDIA GTX 290 .*NVIDIA .*GTX *29.* 5 1 0 3.3 +NVIDIA GT 220 .*NVIDIA .*GT 22.* 2 1 1 3.3 +NVIDIA GT 230 .*NVIDIA .*GT 23.* 2 1 1 3.3 +NVIDIA GT 240 .*NVIDIA .*GT 24.* 4 1 1 3.3 +NVIDIA GTS 240 .*NVIDIA .*GTS 24.* 4 1 1 3.3 +NVIDIA GTS 250 .*NVIDIA .*GTS 25.* 4 1 1 3.3 +NVIDIA GTX 260 .*NVIDIA .*GTX 26.* 4 1 1 3.3 +NVIDIA GTX 270 .*NVIDIA .*GTX 27.* 4 1 0 3.3 +NVIDIA GTX 280 .*NVIDIA .*GTX 28.* 4 1 1 3.3 +NVIDIA GTX 290 .*NVIDIA .*GTX 29.* 5 1 0 3.3 NVIDIA 310 .*NVIDIA .*GeForce 310.* 3 1 1 3.3 NVIDIA 315 .*NVIDIA .*GeForce 315.* 3 1 1 3.3 -NVIDIA GT 320 .*NVIDIA .*GT *32.* 3 1 0 3.3 -NVIDIA GT 330 .*NVIDIA .*GT *33.* 3 1 0 3.3 -NVIDIA GT 340 .*NVIDIA .*GT *34.* 3 1 0 0 +NVIDIA GT 320 .*NVIDIA .*GT 32.* 3 1 0 3.3 +NVIDIA GT 330 .*NVIDIA .*GT 33.* 3 1 0 3.3 +NVIDIA GT 340 .*NVIDIA .*GT 34.* 3 1 0 3.3 NVIDIA 405 .*NVIDIA .* 405.* 3 1 0 3.3 -NVIDIA GT 420 .*NVIDIA .*GT *42.* 3 1 1 4.2 -NVIDIA GT 430 .*NVIDIA .*GT *43.* 3 1 1 4.2 -NVIDIA GT 440 .*NVIDIA .*GT *44.* 4 1 0 4.2 -NVIDIA GTS 450 .*NVIDIA .*GTS *45.* 4 1 1 4.2 -NVIDIA GTX 460 .*NVIDIA .*GTX *46.* 5 1 1 4.3 -NVIDIA GTX 470 .*NVIDIA .*GTX *47.* 5 1 1 4.2 -NVIDIA GTX 480 .*NVIDIA .*GTX *48.* 5 1 1 4.2 -NVIDIA 510 .*NVIDIA .* 510.* 3 1 0 0 -NVIDIA GT 520 .*NVIDIA .*GT *52.* 3 1 1 4.2 -NVIDIA GT 530 .*NVIDIA .*GT *53.* 3 1 1 4.2 -NVIDIA GT 540 .*NVIDIA .*GT *54.* 3 1 1 4.2 -NVIDIA GTX 550 .*NVIDIA .*GTX *55.* 5 1 1 4.3 -NVIDIA GTX 560 .*NVIDIA .*GTX *56.* 5 1 1 4.2 -NVIDIA GTX 570 .*NVIDIA .*GTX *57.* 5 1 1 4.2 -NVIDIA GTX 580 .*NVIDIA .*GTX *58.* 5 1 1 4.3 -NVIDIA GTX 590 .*NVIDIA .*GTX *59.* 5 1 1 4.2 -NVIDIA GT 610 .*NVIDIA .*GT *61.* 3 1 1 4.2 -NVIDIA GT 620 .*NVIDIA .*GT *62.* 3 1 0 4.2 -NVIDIA GT 630 .*NVIDIA .*GT *63.* 3 1 0 4.2 -NVIDIA GT 640 .*NVIDIA .*GT *64.* 3 1 0 4.3 -NVIDIA GT 650 .*NVIDIA .*GT *65.* 3 1 1 4.2 -NVIDIA GTX 650 .*NVIDIA .*GTX *65.* 3 1 1 4.2 -NVIDIA GTX 660 .*NVIDIA .*GTX *66.* 5 1 0 4.3 -NVIDIA GTX 670 .*NVIDIA .*GTX *67.* 5 1 1 4.2 -NVIDIA GTX 680 .*NVIDIA .*GTX *68.* 5 1 1 4.2 -NVIDIA GTX 690 .*NVIDIA .*GTX *69.* 5 1 1 4.2 +NVIDIA GT 420 .*NVIDIA .*GT 42.* 3 1 1 4.2 +NVIDIA GT 430 .*NVIDIA .*GT 43.* 3 1 1 4.3 +NVIDIA GT 440 .*NVIDIA .*GT 44.* 4 1 0 4.3 +NVIDIA GTS 450 .*NVIDIA .*GTS 45.* 4 1 1 4.2 +NVIDIA GTX 460 .*NVIDIA .*GTX 46.* 5 1 1 4.3 +NVIDIA GTX 470 .*NVIDIA .*GTX 47.* 5 1 1 4.2 +NVIDIA GTX 480 .*NVIDIA .*GTX 48.* 5 1 1 4.2 +NVIDIA 510 .*NVIDIA .* 510.* 3 1 0 4.2 +NVIDIA GT 520 .*NVIDIA .*GT 52.* 3 1 1 4.2 +NVIDIA GT 530 .*NVIDIA .*GT 53.* 3 1 1 4.2 +NVIDIA GT 540 .*NVIDIA .*GT 54.* 3 1 1 4.2 +NVIDIA GTX 550 .*NVIDIA .*GTX 55.* 5 1 1 4.3 +NVIDIA GTX 560 .*NVIDIA .*GTX 56.* 5 1 1 4.3 +NVIDIA GTX 570 .*NVIDIA .*GTX 57.* 5 1 1 4.2 +NVIDIA GTX 580 .*NVIDIA .*GTX 58.* 5 1 1 4.3 +NVIDIA GTX 590 .*NVIDIA .*GTX 59.* 5 1 1 4.2 +NVIDIA 605 .*NVIDIA .* 605.* 3 1 1 4.2 +NVIDIA GT 610 .*NVIDIA .*GT 61.* 3 1 1 4.2 +NVIDIA GT 620 .*NVIDIA .*GT 62.* 3 1 0 4.2 +NVIDIA GT 630 .*NVIDIA .*GT 63.* 3 1 0 4.2 +NVIDIA GT 640 .*NVIDIA .*GT 64.* 3 1 0 4.2 +NVIDIA GT 650 .*NVIDIA .*GT 65.* 3 1 1 4.2 +NVIDIA GTX 650 .*NVIDIA .*GTX 65.* 3 1 1 4.2 +NVIDIA GTX 660 .*NVIDIA .*GTX 66.* 5 1 0 4.3 +NVIDIA GTX 670 .*NVIDIA .*GTX 67.* 5 1 1 4.2 +NVIDIA GTX 680 .*NVIDIA .*GTX 68.* 5 1 1 4.2 +NVIDIA GTX 690 .*NVIDIA .*GTX 69.* 5 1 1 4.2 NVIDIA C51 .*NVIDIA .*C51.* 0 1 1 2 NVIDIA G72 .*NVIDIA .*G72.* 1 1 0 0 NVIDIA G73 .*NVIDIA .*G73.* 1 1 0 0 @@ -437,13 +408,7 @@ NVIDIA G86 .*NVIDIA .*G86.* 3 1 0 0 NVIDIA G92 .*NVIDIA .*G92.* 3 1 0 0 NVIDIA GeForce .*GeForce 256.* 0 0 0 0 NVIDIA GeForce 2 .*GeForce ?2 ?.* 0 1 1 1.5 -NVIDIA GeForce 3 .*GeForce ?3 ?.* 2 1 1 2.1 -NVIDIA GeForce 3 Ti .*GeForce ?3 Ti.* 0 1 0 0 NVIDIA GeForce 4 .*NVIDIA .*GeForce ?4.* 0 1 1 1.5 -NVIDIA GeForce 4 Go .*NVIDIA .*GeForce ?4.*Go.* 0 1 0 0 -NVIDIA GeForce 4 MX .*NVIDIA .*GeForce ?4 MX.* 0 1 0 0 -NVIDIA GeForce 4 PCX .*NVIDIA .*GeForce ?4 PCX.* 0 1 0 0 -NVIDIA GeForce 4 Ti .*NVIDIA .*GeForce ?4 Ti.* 0 1 0 0 NVIDIA GeForce 6100 .*NVIDIA .*GeForce 61.* 3 1 1 4.2 NVIDIA GeForce 6200 .*NVIDIA .*GeForce 62.* 0 1 1 2.1 NVIDIA GeForce 6500 .*NVIDIA .*GeForce 65.* 1 1 1 2.1 @@ -458,33 +423,33 @@ NVIDIA GeForce 7500 .*NVIDIA .*GeForce 75.* 2 1 1 2.1 NVIDIA GeForce 7600 .*NVIDIA .*GeForce 76.* 2 1 1 2.1 NVIDIA GeForce 7800 .*NVIDIA .*GeForce 78.* 2 1 1 2.1 NVIDIA GeForce 7900 .*NVIDIA .*GeForce 79.* 3 1 1 2.1 -NVIDIA GeForce 8100 .*NVIDIA .*GeForce 81.* 1 1 0 0 -NVIDIA GeForce 8200M .*NVIDIA .*GeForce 8200M.* 1 1 0 3.3 -NVIDIA GeForce 8200 .*NVIDIA .*GeForce 82.* 1 1 0 2.1 +NVIDIA GeForce 8100 .*NVIDIA .*GeForce 81.* 1 1 0 3.3 +NVIDIA GeForce 8200M .*NVIDIA .*GeForce 820[0-9]M.* 1 1 0 3.3 +NVIDIA GeForce 8200 .*NVIDIA .*GeForce 82.* 1 1 0 3.3 NVIDIA GeForce 8300 .*NVIDIA .*GeForce 83.* 3 1 1 3.3 -NVIDIA GeForce 8400M .*NVIDIA .*GeForce 8400M.* 1 1 1 3.3 +NVIDIA GeForce 8400M .*NVIDIA .*GeForce 840[0-9]M.* 1 1 1 3.3 NVIDIA GeForce 8400 .*NVIDIA .*GeForce 84.* 2 1 1 3.3 NVIDIA GeForce 8500 .*NVIDIA .*GeForce 85.* 2 1 1 3.3 -NVIDIA GeForce 8600M .*NVIDIA .*GeForce 8600M.* 2 1 1 3.3 +NVIDIA GeForce 8600M .*NVIDIA .*GeForce 860[0-9]M.* 2 1 1 3.3 NVIDIA GeForce 8600 .*NVIDIA .*GeForce 86.* 3 1 1 3.3 -NVIDIA GeForce 8700M .*NVIDIA .*GeForce 8700M.* 2 1 1 3.3 +NVIDIA GeForce 8700M .*NVIDIA .*GeForce 870[0-9]M.* 2 1 1 3.3 NVIDIA GeForce 8700 .*NVIDIA .*GeForce 87.* 3 1 0 0 -NVIDIA GeForce 8800M .*NVIDIA .*GeForce 8800M.* 2 1 1 3.3 +NVIDIA GeForce 8800M .*NVIDIA .*GeForce 880[0-9]M.* 2 1 1 3.3 NVIDIA GeForce 8800 .*NVIDIA .*GeForce 88.* 3 1 1 3.3 -NVIDIA GeForce 9100M .*NVIDIA .*GeForce 9100M.* 0 1 0 0 +NVIDIA GeForce 9100M .*NVIDIA .*GeForce 910[0-9]M.* 0 1 0 3.3 NVIDIA GeForce 9100 .*NVIDIA .*GeForce 91.* 0 1 0 3.3 -NVIDIA GeForce 9200M .*NVIDIA .*GeForce 9200M.* 1 1 0 3.1 +NVIDIA GeForce 9200M .*NVIDIA .*GeForce 920[0-9]M.* 1 1 0 3.3 NVIDIA GeForce 9200 .*NVIDIA .*GeForce 92.* 1 1 0 3.3 -NVIDIA GeForce 9300M .*NVIDIA .*GeForce 9300M.* 1 1 1 3.3 +NVIDIA GeForce 9300M .*NVIDIA .*GeForce 930[0-9]M.* 1 1 1 3.3 NVIDIA GeForce 9300 .*NVIDIA .*GeForce 93.* 1 1 1 3.3 -NVIDIA GeForce 9400M .*NVIDIA .*GeForce 9400M.* 2 1 1 3.3 +NVIDIA GeForce 9400M .*NVIDIA .*GeForce 940[0-9]M.* 2 1 1 3.3 NVIDIA GeForce 9400 .*NVIDIA .*GeForce 94.* 3 1 1 3.3 -NVIDIA GeForce 9500M .*NVIDIA .*GeForce 9500M.* 1 1 1 3.3 +NVIDIA GeForce 9500M .*NVIDIA .*GeForce 950[0-9]M.* 1 1 1 3.3 NVIDIA GeForce 9500 .*NVIDIA .*GeForce 95.* 3 1 1 3.3 -NVIDIA GeForce 9600M .*NVIDIA .*GeForce 9600M.* 2 1 1 3.3 +NVIDIA GeForce 9600M .*NVIDIA .*GeForce 960[0-9]M.* 2 1 1 3.3 NVIDIA GeForce 9600 .*NVIDIA .*GeForce 96.* 3 1 1 3.3 -NVIDIA GeForce 9700M .*NVIDIA .*GeForce 9700M.* 0 1 1 3.3 -NVIDIA GeForce 9800M .*NVIDIA .*GeForce 9800M.* 2 1 1 3.3 +NVIDIA GeForce 9700M .*NVIDIA .*GeForce 970[0-9]M.* 0 1 1 3.3 +NVIDIA GeForce 9800M .*NVIDIA .*GeForce 980[0-9]M.* 2 1 1 3.3 NVIDIA GeForce 9800 .*NVIDIA .*GeForce 98.* 3 1 1 3.3 NVIDIA GeForce FX 5100 .*NVIDIA .*GeForce FX 51.* 0 1 0 0 NVIDIA GeForce FX 5200 .*NVIDIA .*GeForce FX 52.* 0 1 0 2.1 @@ -495,7 +460,7 @@ NVIDIA GeForce FX 5700 .*NVIDIA .*GeForce FX 57.* 0 1 1 2.1 NVIDIA GeForce FX 5800 .*NVIDIA .*GeForce FX 58.* 1 1 0 0 NVIDIA GeForce FX 5900 .*NVIDIA .*GeForce FX 59.* 1 1 1 2.1 NVIDIA GeForce FX Go5100 .*NVIDIA .*GeForce FX Go51.* 0 1 0 0 -NVIDIA GeForce FX Go5200 .*NVIDIA .*GeForce FX Go52.* 0 1 0 0 +NVIDIA GeForce FX Go5200 .*NVIDIA .*GeForce FX Go52.* 0 1 0 1.5 NVIDIA GeForce FX Go5300 .*NVIDIA .*GeForce FX Go53.* 0 1 0 0 NVIDIA GeForce FX Go5500 .*NVIDIA .*GeForce FX Go55.* 0 1 0 0 NVIDIA GeForce FX Go5600 .*NVIDIA .*GeForce FX Go56.* 0 1 1 2.1 @@ -504,13 +469,13 @@ NVIDIA GeForce FX Go5800 .*NVIDIA .*GeForce FX Go58.* 1 1 0 0 NVIDIA GeForce FX Go5900 .*NVIDIA .*GeForce FX Go59.* 1 1 0 0 NVIDIA GeForce FX Go5xxx .*NVIDIA .*GeForce FX Go.* 0 1 0 0 NVIDIA GeForce Go 6100 .*NVIDIA .*GeForce Go 61.* 0 1 1 2.1 -NVIDIA GeForce Go 6200 .*NVIDIA .*GeForce Go 62.* 0 1 0 0 -NVIDIA GeForce Go 6400 .*NVIDIA .*GeForce Go 64.* 1 1 1 2 +NVIDIA GeForce Go 6200 .*NVIDIA .*GeForce Go 62.* 0 1 0 1.5 +NVIDIA GeForce Go 6400 .*NVIDIA .*GeForce Go 64.* 1 1 1 2.1 NVIDIA GeForce Go 6500 .*NVIDIA .*GeForce Go 65.* 1 1 0 0 NVIDIA GeForce Go 6600 .*NVIDIA .*GeForce Go 66.* 0 1 1 2.1 NVIDIA GeForce Go 6700 .*NVIDIA .*GeForce Go 67.* 1 1 0 0 NVIDIA GeForce Go 6800 .*NVIDIA .*GeForce Go 68.* 0 1 1 2.1 -NVIDIA GeForce Go 7200 .*NVIDIA .*GeForce Go 72.* 1 1 0 0 +NVIDIA GeForce Go 7200 .*NVIDIA .*GeForce Go 72.* 1 1 0 2.1 NVIDIA GeForce Go 7300 LE .*NVIDIA .*GeForce Go 73.*LE.* 1 1 0 0 NVIDIA GeForce Go 7300 .*NVIDIA .*GeForce Go 73.* 1 1 1 2.1 NVIDIA GeForce Go 7400 .*NVIDIA .*GeForce Go 74.* 1 1 1 2.1 @@ -528,9 +493,9 @@ NVIDIA NB8P .*NVIDIA .*NB8P.* 2 1 0 0 NVIDIA NB9E .*NVIDIA .*NB9E.* 3 1 0 0 NVIDIA NB9M .*NVIDIA .*NB9M.* 1 1 0 0 NVIDIA NB9P .*NVIDIA .*NB9P.* 2 1 0 0 -NVIDIA N10 .*NVIDIA .*N10.* 1 1 0 0 -NVIDIA GeForce PCX .*GeForce PCX.* 0 1 0 0 -NVIDIA Generic .*NVIDIA .*Unknown.* 0 0 0 3 +NVIDIA N10 .*NVIDIA .*N10.* 1 1 0 2.1 +NVIDIA GeForce PCX .*GeForce PCX.* 0 1 0 1.5 +NVIDIA Generic .*NVIDIA .*Unknown.* 0 0 0 2.1 NVIDIA NV17 .*NVIDIA .*NV17.* 0 1 0 0 NVIDIA NV34 .*NVIDIA .*NV34.* 0 1 0 0 NVIDIA NV35 .*NVIDIA .*NV35.* 0 1 0 0 @@ -540,7 +505,7 @@ NVIDIA NV43 .*NVIDIA .*NV43.* 1 1 0 0 NVIDIA NV44 .*NVIDIA .*NV44.* 1 1 0 0 NVIDIA nForce .*NVIDIA .*nForce.* 0 0 0 3.3 NVIDIA MCP51 .*NVIDIA .*MCP51.* 1 1 0 0 -NVIDIA MCP61 .*NVIDIA .*MCP61.* 1 1 0 0 +NVIDIA MCP61 .*NVIDIA .*MCP61.* 1 1 0 2.1 NVIDIA MCP67 .*NVIDIA .*MCP67.* 1 1 0 0 NVIDIA MCP68 .*NVIDIA .*MCP68.* 1 1 0 0 NVIDIA MCP73 .*NVIDIA .*MCP73.* 1 1 0 0 @@ -548,44 +513,44 @@ NVIDIA MCP77 .*NVIDIA .*MCP77.* 1 1 0 0 NVIDIA MCP78 .*NVIDIA .*MCP78.* 1 1 0 0 NVIDIA MCP79 .*NVIDIA .*MCP79.* 1 1 0 0 NVIDIA MCP7A .*NVIDIA .*MCP7A.* 1 1 0 0 -NVIDIA Quadro2 .*Quadro2.* 0 1 0 0 -NVIDIA Quadro 1000M .*Quadro.*1000M.* 2 1 0 4.2 -NVIDIA Quadro 2000 M/D .*Quadro.*2000.* 3 1 0 4.2 -NVIDIA Quadro 3000M .*Quadro.*3000M.* 3 1 0 0 -NVIDIA Quadro 4000M .*Quadro.*4000M.* 3 1 0 0 -NVIDIA Quadro 4000 .*Quadro *4000.* 3 1 0 4.2 -NVIDIA Quadro 50x0 M .*Quadro.*50.0.* 3 1 0 0 +NVIDIA Quadro2 .*Quadro2.* 0 1 0 1.5 +NVIDIA Quadro 1000M .*Quadro.* (K1|1)00[0-9]M.* 2 1 0 4.2 +NVIDIA Quadro 2000 M/D .*Quadro.* (K2|2)000.* 3 1 0 4.2 +NVIDIA Quadro 3000M .*Quadro.* (K3|3)00[0-9]M.* 3 1 0 4.2 +NVIDIA Quadro 4000M .*Quadro.* (K4|4)00[0-9]M.* 3 1 0 4.2 +NVIDIA Quadro 4000 .*Quadro 4000.* 3 1 0 4.2 +NVIDIA Quadro 50x0 M .*Quadro.* 50.0.* 3 1 0 4.2 NVIDIA Quadro 6000 .*Quadro.* 6000.* 3 1 0 0 NVIDIA Quadro 400 .*Quadro.* 400.* 2 1 0 3.3 -NVIDIA Quadro 600 .*Quadro.*600.* 2 1 0 3.3 -NVIDIA Quadro4 .*Quadro4.* 0 1 0 0 +NVIDIA Quadro 600 .*Quadro.* 600.* 2 1 0 4.2 +NVIDIA Quadro4 .*Quadro4.* 0 1 0 1.5 NVIDIA Quadro DCC .*Quadro DCC.* 0 1 0 0 NVIDIA Quadro CX .*Quadro.*CX.* 3 1 0 0 -NVIDIA Quadro FX 770M .*Quadro.*FX *770M.* 2 1 0 0 -NVIDIA Quadro FX 1500M .*Quadro.*FX *1500M.* 1 1 0 2.1 -NVIDIA Quadro FX 1600M .*Quadro.*FX *1600M.* 2 1 0 0 -NVIDIA Quadro FX 2500M .*Quadro.*FX *2500M.* 2 1 0 0 -NVIDIA Quadro FX 2700M .*Quadro.*FX *2700M.* 3 1 0 0 -NVIDIA Quadro FX 2800M .*Quadro.*FX *2800M.* 3 1 0 3.3 -NVIDIA Quadro FX 3500 .*Quadro.*FX *3500.* 2 1 0 2.1 -NVIDIA Quadro FX 3600 .*Quadro.*FX *3600.* 3 1 0 0 -NVIDIA Quadro FX 3700 .*Quadro.*FX *3700.* 3 1 0 3.3 -NVIDIA Quadro FX 3800 .*Quadro.*FX *3800.* 3 1 0 3.2 -NVIDIA Quadro FX 4500 .*Quadro.*FX *45.* 3 1 0 0 -NVIDIA Quadro FX 880M .*Quadro.*FX *880M.* 3 1 0 3.3 -NVIDIA Quadro FX 4800 .*NVIDIA .*Quadro *FX *4800.* 3 1 0 0 +NVIDIA Quadro FX 770M .*Quadro.*FX 77[0-9]M.* 2 1 0 3.3 +NVIDIA Quadro FX 1500M .*Quadro.*FX 150[0-9]M.* 1 1 0 2.1 +NVIDIA Quadro FX 1600M .*Quadro.*FX 160[0-9]M.* 2 1 0 3.3 +NVIDIA Quadro FX 2500M .*Quadro.*FX 250[0-9]M.* 2 1 0 2.1 +NVIDIA Quadro FX 2700M .*Quadro.*FX 270[0-9]M.* 3 1 0 3.3 +NVIDIA Quadro FX 2800M .*Quadro.*FX 280[0-9]M.* 3 1 0 3.3 +NVIDIA Quadro FX 3500 .*Quadro.*FX 3500.* 2 1 0 2.1 +NVIDIA Quadro FX 3600 .*Quadro.*FX 3600.* 3 1 0 3.3 +NVIDIA Quadro FX 3700 .*Quadro.*FX 3700.* 3 1 0 3.3 +NVIDIA Quadro FX 3800 .*Quadro.*FX 3800.* 3 1 0 3.3 +NVIDIA Quadro FX 4500 .*Quadro.*FX 45.* 3 1 0 2.1 +NVIDIA Quadro FX 880M .*Quadro.*FX 88[0-9]M.* 3 1 0 3.3 +NVIDIA Quadro FX 4800 .*NVIDIA .*Quadro FX 4800.* 3 1 0 3.1 NVIDIA Quadro FX .*Quadro FX.* 1 1 0 3.3 -NVIDIA Quadro NVS 1xxM .*Quadro NVS *1.[05]M.* 0 1 1 3.3 -NVIDIA Quadro NVS 300M .*NVIDIA .*NVS *300M.* 2 1 0 0 -NVIDIA Quadro NVS 320M .*NVIDIA .*NVS *320M.* 2 1 0 0 -NVIDIA Quadro NVS 2100M .*NVIDIA .*NVS *2100M.* 2 1 0 0 -NVIDIA Quadro NVS 3100M .*NVIDIA .*NVS *3100M.* 2 1 0 0 -NVIDIA Quadro NVS 4200M .*NVIDIA .*NVS *4200M.* 2 1 0 4.1 -NVIDIA Quadro NVS 5100M .*NVIDIA .*NVS *5100M.* 2 1 0 0 -NVIDIA Quadro NVS .*NVIDIA .*NVS 0 1 0 3.2 +NVIDIA Quadro NVS 1xxM .*Quadro NVS 1.[05]M.* 0 1 1 3.3 +NVIDIA Quadro NVS 300M .*NVIDIA .*NVS 30[0-9]M.* 2 1 0 0 +NVIDIA Quadro NVS 320M .*NVIDIA .*NVS 32[0-9]M.* 2 1 0 0 +NVIDIA Quadro NVS 2100M .*NVIDIA .*NVS 210[0-9]M.* 2 1 0 3.3 +NVIDIA Quadro NVS 3100M .*NVIDIA .*NVS 310[0-9]M.* 2 1 0 3.3 +NVIDIA Quadro NVS 4200M .*NVIDIA .*NVS 420[0-9]M.* 2 1 0 4.2 +NVIDIA Quadro NVS 5100M .*NVIDIA .*NVS 510[0-9]M.* 2 1 0 0 +NVIDIA Quadro NVS .*NVIDIA .*NVS 0 1 0 4.2 NVIDIA Corporation N12P .*NVIDIA .*N12P.* 1 1 1 4.1 -NVIDIA Corporation N11M .*NVIDIA .*N11M.* 2 1 0 0 -NVIDIA RIVA TNT .*RIVA TNT.* 0 0 0 0 +NVIDIA Corporation N11M .*NVIDIA .*N11M.* 2 1 0 3.1 +NVIDIA RIVA TNT .*RIVA TNT.* 0 0 0 1.5 S3 .*S3 Graphics.* 0 0 1 1.4 SiS SiS.* 0 0 1 1.5 Trident Trident.* 0 0 0 0 diff --git a/indra/newview/linux_tools/wrapper.sh b/indra/newview/linux_tools/wrapper.sh index d8440eebf1..c23401d5a6 100755 --- a/indra/newview/linux_tools/wrapper.sh +++ b/indra/newview/linux_tools/wrapper.sh @@ -121,37 +121,21 @@ export SAVED_LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" export LD_LIBRARY_PATH="$PWD/lib:${LD_LIBRARY_PATH}" -# Have to deal specially with gridargs.dat; typical contents look like: -# --channel "Second Life Test" --settings settings_test.xml -# Simply embedding $(<etc/gridargs.dat) into a command line treats each of -# Second, Life and Developer as separate args -- no good. We need bash to -# process quotes using eval. -# First, check if we have been instructed to skip reading in gridargs.dat: -skip_gridargs=false -argnum=0 +# Copy "$@" to ARGS array specifically to delete the --skip-gridargs switch. +# The gridargs.dat file is no more, but we still want to avoid breaking +# scripts that invoke this one with --skip-gridargs. +ARGS=() for ARG in "$@"; do - if [ "--skip-gridargs" == "$ARG" ]; then - skip_gridargs=true - else - ARGS[$argnum]="$ARG" - argnum=$(($argnum+1)) + if [ "--skip-gridargs" != "$ARG" ]; then + ARGS[${#ARGS[*]}]="$ARG" fi done -# Second, read it without scanning, then scan that string. Break quoted words -# into a bash array. Note that if gridargs.dat is empty, or contains only -# whitespace, the resulting gridargs array will be empty -- zero entries -- -# therefore "${gridargs[@]}" entirely vanishes from the command line below, -# just as we want. -if ! $skip_gridargs ; then - eval gridargs=("$(<etc/gridargs.dat)") -fi - # Run the program. # Don't quote $LL_WRAPPER because, if empty, it should simply vanish from the -# command line. But DO quote "$@": preserve separate args as individually -# quoted. Similar remarks about the contents of gridargs. -$LL_WRAPPER bin/do-not-directly-run-secondlife-bin "${gridargs[@]}" "${ARGS[@]}" +# command line. But DO quote "${ARGS[@]}": preserve separate args as +# individually quoted. +$LL_WRAPPER bin/do-not-directly-run-secondlife-bin "${ARGS[@]}" LL_RUN_ERR=$? # Handle any resulting errors diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 3e94c5edf7..49f77e6c34 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -46,6 +46,7 @@ #include "llenvmanager.h" #include "llfirstuse.h" #include "llfloatercamera.h" +#include "llfloaterimcontainer.h" #include "llfloaterreg.h" #include "llfloatertools.h" #include "llgroupactions.h" @@ -90,7 +91,9 @@ #include "llwindow.h" #include "llworld.h" #include "llworldmap.h" +#include "lscript_byteformat.h" #include "stringize.h" +#include "boost/foreach.hpp" using namespace LLAvatarAppearanceDefines; @@ -433,7 +436,7 @@ void LLAgent::init() { mMoveTimer.start(); - gSavedSettings.declareBOOL("SlowMotionAnimation", FALSE, "Declared in code", FALSE); + gSavedSettings.declareBOOL("SlowMotionAnimation", FALSE, "Declared in code", LLControlVariable::PERSIST_NO); gSavedSettings.getControl("SlowMotionAnimation")->getSignal()->connect(boost::bind(&handleSlowMotionAnimation, _2)); // *Note: this is where LLViewerCamera::getInstance() used to be constructed. @@ -2037,7 +2040,16 @@ void LLAgent::endAnimationUpdateUI() { skip_list.insert(LLFloaterReg::findInstance("mini_map")); } - + + LLFloaterIMContainer* im_box = LLFloaterReg::getTypedInstance<LLFloaterIMContainer>("im_container"); + LLFloaterIMContainer::floater_list_t conversations; + im_box->getDetachedConversationFloaters(conversations); + BOOST_FOREACH(LLFloater* conversation, conversations) + { + llinfos << "skip_list.insert(session_floater): " << conversation->getTitle() << llendl; + skip_list.insert(conversation); + } + gFloaterView->popVisibleAll(skip_list); #endif mViewsPushed = FALSE; @@ -3048,6 +3060,55 @@ void LLAgent::sendAnimationRequest(const LLUUID &anim_id, EAnimRequest request) sendReliableMessage(); } +// Send a message to the region to stop the NULL animation state +// This will reset animation state overrides for the agent. +void LLAgent::sendAnimationStateReset() +{ + if (gAgentID.isNull() || !mRegionp) + { + return; + } + + LLMessageSystem* msg = gMessageSystem; + msg->newMessageFast(_PREHASH_AgentAnimation); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, getID()); + msg->addUUIDFast(_PREHASH_SessionID, getSessionID()); + + msg->nextBlockFast(_PREHASH_AnimationList); + msg->addUUIDFast(_PREHASH_AnimID, LLUUID::null ); + msg->addBOOLFast(_PREHASH_StartAnim, FALSE); + + msg->nextBlockFast(_PREHASH_PhysicalAvatarEventList); + msg->addBinaryDataFast(_PREHASH_TypeData, NULL, 0); + sendReliableMessage(); +} + + +// Send a message to the region to revoke sepecified permissions on ALL scripts in the region +// If the target is an object in the region, permissions in scripts on that object are cleared. +// If it is the region ID, all scripts clear the permissions for this agent +void LLAgent::sendRevokePermissions(const LLUUID & target, U32 permissions) +{ + // Currently only the bits for SCRIPT_PERMISSION_TRIGGER_ANIMATION and SCRIPT_PERMISSION_OVERRIDE_ANIMATIONS + // are supported by the server. Sending any other bits will cause the message to be dropped without changing permissions + + if (gAgentID.notNull() && gMessageSystem) + { + LLMessageSystem* msg = gMessageSystem; + msg->newMessageFast(_PREHASH_RevokePermissions); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, getID()); // Must be our ID + msg->addUUIDFast(_PREHASH_SessionID, getSessionID()); + + msg->nextBlockFast(_PREHASH_Data); + msg->addUUIDFast(_PREHASH_ObjectID, target); // Must be in the region + msg->addS32Fast(_PREHASH_ObjectPermissions, (S32) permissions); + + sendReliableMessage(); + } +} + void LLAgent::sendWalkRun(bool running) { LLMessageSystem* msgsys = gMessageSystem; @@ -4126,6 +4187,8 @@ void LLAgent::stopCurrentAnimations() // avatar, propagating this change back to the server. if (isAgentAvatarValid()) { + LLDynamicArray<LLUUID> anim_ids; + for ( LLVOAvatar::AnimIterator anim_it = gAgentAvatarp->mPlayingAnimations.begin(); anim_it != gAgentAvatarp->mPlayingAnimations.end(); @@ -4143,7 +4206,24 @@ void LLAgent::stopCurrentAnimations() // stop this animation locally gAgentAvatarp->stopMotion(anim_it->first, TRUE); // ...and tell the server to tell everyone. - sendAnimationRequest(anim_it->first, ANIM_REQUEST_STOP); + anim_ids.push_back(anim_it->first); + } + } + + sendAnimationRequests(anim_ids, ANIM_REQUEST_STOP); + + // Tell the region to clear any animation state overrides + sendAnimationStateReset(); + + // Revoke all animation permissions + if (mRegionp && + gSavedSettings.getBOOL("RevokePermsOnStopAnimation")) + { + U32 permissions = LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_TRIGGER_ANIMATION] | LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_OVERRIDE_ANIMATIONS]; + sendRevokePermissions(mRegionp->getRegionID(), permissions); + if (gAgentAvatarp->isSitting()) + { // Also stand up, since auto-granted sit animation permission has been revoked + gAgent.standUp(); } } diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index f5f26f69d8..7fac17d098 100755 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -431,6 +431,9 @@ public: void onAnimStop(const LLUUID& id); void sendAnimationRequests(LLDynamicArray<LLUUID> &anim_ids, EAnimRequest request); void sendAnimationRequest(const LLUUID &anim_id, EAnimRequest request); + void sendAnimationStateReset(); + void sendRevokePermissions(const LLUUID & target, U32 permissions); + void endAnimationUpdateUI(); void unpauseAnimation() { mPauseRequest = NULL; } BOOL getCustomAnim() const { return mCustomAnim; } diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm new file mode 100644 index 0000000000..91251ed7c0 --- /dev/null +++ b/indra/newview/llappdelegate-objc.mm @@ -0,0 +1,157 @@ +/** + * @file llappdelegate-objc.mm + * @brief Class implementation for the Mac version's application delegate. + * + * $LicenseInfo:firstyear=2000&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#import "llappdelegate-objc.h" +#include "llwindowmacosx-objc.h" +#include <Carbon/Carbon.h> // Used for Text Input Services ("Safe" API - it's supported) + +@implementation LLAppDelegate + +@synthesize window; +@synthesize inputWindow; +@synthesize inputView; +@synthesize currentInputLanguage; + +- (void)dealloc +{ + [super dealloc]; +} + +- (void) applicationDidFinishLaunching:(NSNotification *)notification +{ + frameTimer = nil; + + [self languageUpdated]; + + if (initViewer()) + { + frameTimer = [NSTimer scheduledTimerWithTimeInterval:0.0 target:self selector:@selector(mainLoop) userInfo:nil repeats:YES]; + } else { + handleQuit(); + } + + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(languageUpdated) name:@"NSTextInputContextKeyboardSelectionDidChangeNotification" object:nil]; + + [[NSAppleEventManager sharedAppleEventManager] setEventHandler:self andSelector:@selector(handleGetURLEvent:withReplyEvent:) forEventClass:kInternetEventClass andEventID:kAEGetURL]; +} + +- (void) handleGetURLEvent:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent { + NSString *url= nil; + url = [[[[NSAppleEventManager sharedAppleEventManager]// 1 + currentAppleEvent]// 2 + paramDescriptorForKeyword:keyDirectObject]// 3 + stringValue];// 4 + + const char* url_utf8 = [url UTF8String]; + handleUrl(url_utf8); +} + +- (void) applicationDidBecomeActive:(NSNotification *)notification +{ + callWindowFocus(); +} + +- (void) applicationDidResignActive:(NSNotification *)notification +{ + callWindowUnfocus(); +} + +- (NSApplicationDelegateReply) applicationShouldTerminate:(NSApplication *)sender +{ + if (!runMainLoop()) + { + handleQuit(); + return NSTerminateCancel; + } else { + [frameTimer release]; + cleanupViewer(); + return NSTerminateNow; + } +} + +- (void) mainLoop +{ + bool appExiting = runMainLoop(); + if (appExiting) + { + [frameTimer release]; + [[NSApplication sharedApplication] terminate:self]; + } +} + +- (void) showInputWindow:(bool)show withEvent:(NSEvent*)textEvent +{ + if (![self romanScript]) + { + if (show) + { + NSLog(@"Showing input window."); + [inputWindow makeKeyAndOrderFront:inputWindow]; + if (textEvent != nil) + { + [[inputView inputContext] discardMarkedText]; + [[inputView inputContext] handleEvent:textEvent]; + } + } else { + NSLog(@"Hiding input window."); + [inputWindow orderOut:inputWindow]; + [window makeKeyAndOrderFront:window]; + } + } +} + +// This will get called multiple times by NSNotificationCenter. +// It will be called every time that the window focus changes, and every time that the input language gets changed. +// The primary use case for this selector is to update our current input language when the user, for whatever reason, changes the input language. +// This is the more elegant way of handling input language changes instead of checking every time we want to use the input window. + +- (void) languageUpdated +{ + TISInputSourceRef currentInput = TISCopyCurrentKeyboardInputSource(); + CFArrayRef languages = (CFArrayRef)TISGetInputSourceProperty(currentInput, kTISPropertyInputSourceLanguages); + +#if 0 // In the event of ever needing to add new language sources, change this to 1 and watch the terminal for "languages:" + NSLog(@"languages: %@", TISGetInputSourceProperty(currentInput, kTISPropertyInputSourceLanguages)); +#endif + + // Typically the language we want is going to be the very first result in the array. + currentInputLanguage = (NSString*)CFArrayGetValueAtIndex(languages, 0); +} + +- (bool) romanScript +{ + // How to add support for new languages with the input window: + // Simply append this array with the language code (ja for japanese, ko for korean, zh for chinese, etc.) + NSArray *nonRomanScript = [[NSArray alloc] initWithObjects:@"ja", @"ko", @"zh-Hant", @"zh-Hans", nil]; + if ([nonRomanScript containsObject:currentInputLanguage]) + { + return false; + } + + return true; +} + +@end diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index f92274dbbd..f67142d1ed 100755 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -96,6 +96,7 @@ #include "llupdaterservice.h" #include "llfloatertexturefetchdebugger.h" #include "llspellcheck.h" +#include "llavatarrenderinfoaccountant.h" // Linden library includes #include "llavatarnamecache.h" @@ -570,7 +571,7 @@ static void settings_to_globals() LLSurface::setTextureSize(gSavedSettings.getU32("RegionTextureSize")); LLRender::sGLCoreProfile = gSavedSettings.getBOOL("RenderGLCoreProfile"); - + LLVertexBuffer::sUseVAO = gSavedSettings.getBOOL("RenderUseVAO"); LLImageGL::sGlobalUseAnisotropic = gSavedSettings.getBOOL("RenderAnisotropic"); LLImageGL::sCompressTextures = gSavedSettings.getBOOL("RenderCompressTextures"); LLVOVolume::sLODFactor = gSavedSettings.getF32("RenderVolumeLODFactor"); @@ -668,7 +669,6 @@ LLAppViewer::LLAppViewer() : mSecondInstance(false), mSavedFinalSnapshot(false), mSavePerAccountSettings(false), // don't save settings on logout unless login succeeded. - mForceGraphicsDetail(false), mQuitRequested(false), mLogoutRequestSent(false), mYieldTime(-1), @@ -724,6 +724,11 @@ bool LLAppViewer::init() // we run the "program crashed last time" error handler below. // LLFastTimer::reset(); + + +#ifdef LL_DARWIN + mMainLoopInitialized = false; +#endif // initialize LLWearableType translation bridge. // Memory will be cleaned up in ::cleanupClass() @@ -1254,40 +1259,57 @@ LLFastTimer::DeclareTimer FTM_FRAME("Frame", true); bool LLAppViewer::mainLoop() { - mMainloopTimeout = new LLWatchdogTimeout(); +#ifdef LL_DARWIN + if (!mMainLoopInitialized) +#endif + { + mMainloopTimeout = new LLWatchdogTimeout(); + + //------------------------------------------- + // Run main loop until time to quit + //------------------------------------------- + + // Create IO Pump to use for HTTP Requests. + gServicePump = new LLPumpIO(gAPRPoolp); + LLHTTPClient::setPump(*gServicePump); + LLCurl::setCAFile(gDirUtilp->getCAFile()); + + // Note: this is where gLocalSpeakerMgr and gActiveSpeakerMgr used to be instantiated. + + LLVoiceChannel::initClass(); + LLVoiceClient::getInstance()->init(gServicePump); + LLVoiceChannel::setCurrentVoiceChannelChangedCallback(boost::bind(&LLFloaterIMContainer::onCurrentChannelChanged, _1), true); + + joystick = LLViewerJoystick::getInstance(); + joystick->setNeedsReset(true); + +#ifdef LL_DARWIN + // Ensure that this section of code never gets called again on OS X. + mMainLoopInitialized = true; +#endif + } + // As we do not (yet) send data on the mainloop LLEventPump that varies + // with each frame, no need to instantiate a new LLSD event object each + // time. Obviously, if that changes, just instantiate the LLSD at the + // point of posting. + + LLEventPump& mainloop(LLEventPumps::instance().obtain("mainloop")); + + LLSD newFrame; - //------------------------------------------- - // Run main loop until time to quit - //------------------------------------------- - - // Create IO Pump to use for HTTP Requests. - gServicePump = new LLPumpIO(gAPRPoolp); - LLHTTPClient::setPump(*gServicePump); - LLCurl::setCAFile(gDirUtilp->getCAFile()); - - // Note: this is where gLocalSpeakerMgr and gActiveSpeakerMgr used to be instantiated. - - LLVoiceChannel::initClass(); - LLVoiceClient::getInstance()->init(gServicePump); - LLVoiceChannel::setCurrentVoiceChannelChangedCallback(boost::bind(&LLFloaterIMContainer::onCurrentChannelChanged, _1), true); LLTimer frameTimer,idleTimer; LLTimer debugTime; - LLViewerJoystick* joystick(LLViewerJoystick::getInstance()); - joystick->setNeedsReset(true); - - LLEventPump& mainloop(LLEventPumps::instance().obtain("mainloop")); - // As we do not (yet) send data on the mainloop LLEventPump that varies - // with each frame, no need to instantiate a new LLSD event object each - // time. Obviously, if that changes, just instantiate the LLSD at the - // point of posting. - LLSD newFrame; - + //LLPrivateMemoryPoolTester::getInstance()->run(false) ; //LLPrivateMemoryPoolTester::getInstance()->run(true) ; //LLPrivateMemoryPoolTester::destroy() ; // Handle messages +#ifdef LL_DARWIN + if (!LLApp::isExiting()) +#else while (!LLApp::isExiting()) +#endif { LLFastTimer _(FTM_FRAME); LLFastTimer::nextFrame(); @@ -1563,34 +1585,37 @@ bool LLAppViewer::mainLoop() } } - // Save snapshot for next time, if we made it through initialization - if (STATE_STARTED == LLStartUp::getStartupState()) + if (LLApp::isExiting()) { - try - { - saveFinalSnapshot(); - } - catch(std::bad_alloc) + // Save snapshot for next time, if we made it through initialization + if (STATE_STARTED == LLStartUp::getStartupState()) { - llwarns << "Bad memory allocation when saveFinalSnapshot() is called!" << llendl ; - - //stop memory leaking simulation - LLFloaterMemLeak* mem_leak_instance = - LLFloaterReg::findTypedInstance<LLFloaterMemLeak>("mem_leaking"); - if(mem_leak_instance) + try { - mem_leak_instance->stop() ; - } + saveFinalSnapshot(); + } + catch(std::bad_alloc) + { + llwarns << "Bad memory allocation when saveFinalSnapshot() is called!" << llendl ; + + //stop memory leaking simulation + LLFloaterMemLeak* mem_leak_instance = + LLFloaterReg::findTypedInstance<LLFloaterMemLeak>("mem_leaking"); + if(mem_leak_instance) + { + mem_leak_instance->stop() ; + } + } } + + delete gServicePump; + + destroyMainloopTimeout(); + + llinfos << "Exiting main_loop" << llendflush; } - - delete gServicePump; - destroyMainloopTimeout(); - - llinfos << "Exiting main_loop" << llendflush; - - return true; + return LLApp::isExiting(); } void LLAppViewer::flushVFSIO() @@ -1613,6 +1638,8 @@ bool LLAppViewer::cleanup() //ditch LLVOAvatarSelf instance gAgentAvatarp = NULL; + LLNotifications::instance().clear(); + // workaround for DEV-35406 crash on shutdown LLEventPumps::instance().reset(); @@ -2307,17 +2334,24 @@ void LLAppViewer::loadColorSettings() LLUIColorTable::instance().loadFromSettings(); } +namespace +{ + void handleCommandLineError(LLControlGroupCLP& clp) + { + llwarns << "Error parsing command line options. Command Line options ignored." << llendl; + + llinfos << "Command line usage:\n" << clp << llendl; + + OSMessageBox(STRINGIZE(LLTrans::getString("MBCmdLineError") << clp.getErrorMessage()), + LLStringUtil::null, + OSMB_OK); + } +} // anonymous namespace + bool LLAppViewer::initConfiguration() { //Load settings files list std::string settings_file_list = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "settings_files.xml"); - //LLControlGroup settings_control("SettingsFiles"); - //llinfos << "Loading settings file list " << settings_file_list << llendl; - //if (0 == settings_control.loadFromFile(settings_file_list)) - //{ - // llerrs << "Cannot load default configuration file " << settings_file_list << llendl; - //} - LLXMLNodePtr root; BOOL success = LLXMLNode::parseFile(settings_file_list, root, NULL); if (!success) @@ -2376,9 +2410,7 @@ bool LLAppViewer::initConfiguration() { c->setValue(true, false); } -#endif -#ifndef LL_RELEASE_FOR_DOWNLOAD gSavedSettings.setBOOL("QAMode", TRUE ); gSavedSettings.setS32("WatchdogEnabled", 0); #endif @@ -2414,13 +2446,7 @@ bool LLAppViewer::initConfiguration() if(!initParseCommandLine(clp)) { - llwarns << "Error parsing command line options. Command Line options ignored." << llendl; - - llinfos << "Command line usage:\n" << clp << llendl; - - std::ostringstream msg; - msg << LLTrans::getString("MBCmdLineError") << clp.getErrorMessage(); - OSMessageBox(msg.str(),LLStringUtil::null,OSMB_OK); + handleCommandLineError(clp); return false; } @@ -2467,12 +2493,16 @@ bool LLAppViewer::initConfiguration() loadSettingsFromDirectory("UserSession"); // - apply command line settings - clp.notify(); + if (! clp.notify()) + { + handleCommandLineError(clp); + return false; + } // Register the core crash option as soon as we can // if we want gdb post-mortem on cores we need to be up and running // ASAP or we might miss init issue etc. - if(clp.hasOption("disablecrashlogger")) + if(gSavedSettings.getBOOL("DisableCrashLogger")) { llwarns << "Crashes will be handled by system, stack trace logs and crash logger are both disabled" << llendl; LLAppViewer::instance()->disableCrashlogger(); @@ -2545,91 +2575,52 @@ bool LLAppViewer::initConfiguration() } } - if(clp.hasOption("channel")) - { - LLVersionInfo::resetChannel(clp.getOption("channel")[0]); + std::string CmdLineChannel(gSavedSettings.getString("CmdLineChannel")); + if(! CmdLineChannel.empty()) + { + LLVersionInfo::resetChannel(CmdLineChannel); } // If we have specified crash on startup, set the global so we'll trigger the crash at the right time - if(clp.hasOption("crashonstartup")) - { - gCrashOnStartup = TRUE; - } + gCrashOnStartup = gSavedSettings.getBOOL("CrashOnStartup"); - if (clp.hasOption("logperformance")) + if (gSavedSettings.getBOOL("LogPerformance")) { LLFastTimer::sLog = TRUE; LLFastTimer::sLogName = std::string("performance"); } - - if (clp.hasOption("logmetrics")) - { - LLFastTimer::sMetricLog = TRUE ; - // '--logmetrics' can be specified with a named test metric argument so the data gathering is done only on that test - // In the absence of argument, every metric is gathered (makes for a rather slow run and hard to decipher report...) - std::string test_name = clp.getOption("logmetrics")[0]; + + std::string test_name(gSavedSettings.getString("LogMetrics")); + if (! test_name.empty()) + { + LLFastTimer::sMetricLog = TRUE ; + // '--logmetrics' is specified with a named test metric argument so the data gathering is done only on that test + // In the absence of argument, every metric would be gathered (makes for a rather slow run and hard to decipher report...) llinfos << "'--logmetrics' argument : " << test_name << llendl; - if (test_name == "") - { - llwarns << "No '--logmetrics' argument given, will output all metrics to " << DEFAULT_METRIC_NAME << llendl; - LLFastTimer::sLogName = DEFAULT_METRIC_NAME; - } - else - { - LLFastTimer::sLogName = test_name; - } + LLFastTimer::sLogName = test_name; } if (clp.hasOption("graphicslevel")) { - const LLCommandLineParser::token_vector_t& value = clp.getOption("graphicslevel"); - if(value.size() != 1) - { - llwarns << "Usage: -graphicslevel <0-3>" << llendl; - } - else - { - std::string detail = value.front(); - mForceGraphicsDetail = TRUE; - - switch (detail.c_str()[0]) - { - case '0': - gSavedSettings.setU32("RenderQualityPerformance", 0); - break; - case '1': - gSavedSettings.setU32("RenderQualityPerformance", 1); - break; - case '2': - gSavedSettings.setU32("RenderQualityPerformance", 2); - break; - case '3': - gSavedSettings.setU32("RenderQualityPerformance", 3); - break; - default: - mForceGraphicsDetail = FALSE; - llwarns << "Usage: -graphicslevel <0-3>" << llendl; - break; - } - } - } - - if (clp.hasOption("analyzeperformance")) - { - LLFastTimerView::sAnalyzePerformance = TRUE; + // User explicitly requested --graphicslevel on the command line. We + // expect this switch has already set RenderQualityPerformance. Check + // that value for validity. + U32 graphicslevel = gSavedSettings.getU32("RenderQualityPerformance"); + if (LLFeatureManager::instance().isValidGraphicsLevel(graphicslevel)) + { + // graphicslevel is valid: save it and engage it later. Capture + // the requested value separately from the settings variable + // because, if this is the first run, LLViewerWindow's constructor + // will call LLFeatureManager::applyRecommendedSettings(), which + // overwrites this settings variable! + mForceGraphicsLevel = graphicslevel; + } } - if (clp.hasOption("replaysession")) - { - gAgentPilot.setReplaySession(TRUE); - } + LLFastTimerView::sAnalyzePerformance = gSavedSettings.getBOOL("AnalyzePerformance"); + gAgentPilot.setReplaySession(gSavedSettings.getBOOL("ReplaySession")); - if (clp.hasOption("nonotifications")) - { - gSavedSettings.getControl("IgnoreAllNotifications")->setValue(true, false); - } - - if (clp.hasOption("debugsession")) + if (gSavedSettings.getBOOL("DebugSession")) { gDebugSession = TRUE; gDebugGL = TRUE; @@ -2654,20 +2645,16 @@ bool LLAppViewer::initConfiguration() // What can happen is that someone can use IE (or potentially // other browsers) and do the rough equivalent of command // injection and steal passwords. Phoenix. SL-55321 - if(clp.hasOption("url")) - { - LLStartUp::setStartSLURL(LLSLURL(clp.getOption("url")[0])); - if(LLStartUp::getStartSLURL().getType() == LLSLURL::LOCATION) - { - LLGridManager::getInstance()->setGridChoice(LLStartUp::getStartSLURL().getGrid()); - - } - } - else if(clp.hasOption("slurl")) - { - LLSLURL start_slurl(clp.getOption("slurl")[0]); + std::string CmdLineLoginLocation(gSavedSettings.getString("CmdLineLoginLocation")); + if(! CmdLineLoginLocation.empty()) + { + LLSLURL start_slurl(CmdLineLoginLocation); LLStartUp::setStartSLURL(start_slurl); - } + if(start_slurl.getType() == LLSLURL::LOCATION) + { + LLGridManager::getInstance()->setGridChoice(start_slurl.getGrid()); + } + } const LLControlVariable* skinfolder = gSavedSettings.getControl("SkinCurrent"); if(skinfolder && LLStringUtil::null != skinfolder->getValue().asString()) @@ -2708,8 +2695,6 @@ bool LLAppViewer::initConfiguration() //} #if LL_DARWIN - // Initialize apple menubar and various callbacks - init_apple_menu(LLTrans::getString("APP_NAME").c_str()); #if __ppc__ // If the CPU doesn't have Altivec (i.e. it's not at least a G4), don't go any further. @@ -2810,9 +2795,8 @@ bool LLAppViewer::initConfiguration() LL_DEBUGS("AppInit")<<"set start from NextLoginLocation: "<<nextLoginLocation<<LL_ENDL; LLStartUp::setStartSLURL(LLSLURL(nextLoginLocation)); } - else if ( ( clp.hasOption("login") || clp.hasOption("autologin")) - && !clp.hasOption("url") - && !clp.hasOption("slurl")) + else if ((clp.hasOption("login") || clp.hasOption("autologin")) + && gSavedSettings.getString("CmdLineLoginLocation").empty()) { // If automatic login from command line with --login switch // init StartSLURL location. @@ -3048,13 +3032,19 @@ namespace { void LLAppViewer::initUpdater() { // Initialize the updater service. - // Generate URL to the udpater service // Get Channel // Get Version - std::string url = gSavedSettings.getString("UpdaterServiceURL"); + + /***************************************************************** + * Previously, the url was derived from the settings + * UpdaterServiceURL + * UpdaterServicePath + * it is now obtained from the grid manager. The settings above + * are no longer used. + *****************************************************************/ std::string channel = LLVersionInfo::getChannel(); std::string version = LLVersionInfo::getVersion(); - std::string service_path = gSavedSettings.getString("UpdaterServicePath"); + U32 check_period = gSavedSettings.getU32("UpdaterServiceCheckPeriod"); bool willing_to_test; LL_DEBUGS("UpdaterService") << "channel " << channel << LL_ENDL; @@ -3079,9 +3069,7 @@ void LLAppViewer::initUpdater() } mUpdater->setAppExitCallback(boost::bind(&LLAppViewer::forceQuit, this)); - mUpdater->initialize(url, - service_path, - channel, + mUpdater->initialize(channel, version, gPlatform, getOSInfo().getOSVersionString(), @@ -3186,11 +3174,12 @@ bool LLAppViewer::initWindow() // Initialize GL stuff // - if (mForceGraphicsDetail) + if (mForceGraphicsLevel) { - LLFeatureManager::getInstance()->setGraphicsLevel(gSavedSettings.getU32("RenderQualityPerformance"), false); + LLFeatureManager::getInstance()->setGraphicsLevel(*mForceGraphicsLevel, false); + gSavedSettings.setU32("RenderQualityPerformance", *mForceGraphicsLevel); } - + // Set this flag in case we crash while initializing GL gSavedSettings.setBOOL("RenderInitError", TRUE); gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile"), TRUE ); @@ -4599,11 +4588,6 @@ void LLAppViewer::idle() llinfos << "Dead object updates: " << gObjectList.mNumDeadObjectUpdates << llendl; gObjectList.mNumDeadObjectUpdates = 0; } - if (gObjectList.mNumUnknownKills) - { - llinfos << "Kills on unknown objects: " << gObjectList.mNumUnknownKills << llendl; - gObjectList.mNumUnknownKills = 0; - } if (gObjectList.mNumUnknownUpdates) { llinfos << "Unknown object updates: " << gObjectList.mNumUnknownUpdates << llendl; @@ -4840,6 +4824,9 @@ void LLAppViewer::idle() gObjectList.updateApparentAngles(gAgent); } + // Update AV render info + LLAvatarRenderInfoAccountant::idle(); + { LLFastTimer t(FTM_AUDIO_UPDATE); diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index cd91ae8b2b..3ae8a78845 100755 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -32,6 +32,7 @@ #include "llsys.h" // for LLOSInfo #include "lltimer.h" #include "llappcorehttp.h" +#include <boost/optional.hpp> class LLCommandLineParser; class LLFrameTimer; @@ -41,6 +42,7 @@ class LLImageDecodeThread; class LLTextureFetch; class LLWatchdogTimeout; class LLUpdaterService; +class LLViewerJoystick; extern LLFastTimer::DeclareTimer FTM_FRAME; @@ -254,11 +256,13 @@ private: std::string mSerialNumber; bool mPurgeCache; bool mPurgeOnExit; + bool mMainLoopInitialized; + LLViewerJoystick* joystick; bool mSavedFinalSnapshot; bool mSavePerAccountSettings; // only save per account settings if login succeeded - bool mForceGraphicsDetail; + boost::optional<U32> mForceGraphicsLevel; bool mQuitRequested; // User wants to quit, may have modified documents open. bool mLogoutRequestSent; // Disconnect message sent to simulator, no longer safe to send messages to the sim. diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp index 4d340cafa9..2723f0b90d 100755 --- a/indra/newview/llappviewermacosx.cpp +++ b/indra/newview/llappviewermacosx.cpp @@ -30,7 +30,10 @@ #error "Use only with Mac OS X" #endif +#define LL_CARBON_CRASH_HANDLER 1 + #include "llappviewermacosx.h" +#include "llwindowmacosx-objc.h" #include "llcommandlineparser.h" #include "llviewernetwork.h" @@ -38,7 +41,10 @@ #include "llmd5.h" #include "llfloaterworldmap.h" #include "llurldispatcher.h" +#include <ApplicationServices/ApplicationServices.h> +#ifdef LL_CARBON_CRASH_HANDLER #include <Carbon/Carbon.h> +#endif #include "lldir.h" #include <signal.h> #include <CoreAudio/CoreAudio.h> // for systemwide mute @@ -50,9 +56,9 @@ namespace // They are not used immediately by the app. int gArgC; char** gArgV; - bool sCrashReporterIsRunning = false; - + LLAppViewerMacOSX* gViewerAppPtr; +#ifdef LL_CARBON_CRASH_HANDLER OSErr AEQuitHandler(const AppleEvent *messagein, AppleEvent *reply, long refIn) { OSErr result = noErr; @@ -61,9 +67,10 @@ namespace return(result); } +#endif } -int main( int argc, char **argv ) +bool initViewer() { #if LL_SOLARIS && defined(__sparc) asm ("ta\t6"); // NOTE: Make sure memory alignment is enforced on SPARC @@ -73,43 +80,60 @@ int main( int argc, char **argv ) if (chdir(gDirUtilp->getAppRODataDir().c_str()) == -1) { llwarns << "Could not change directory to " - << gDirUtilp->getAppRODataDir() << ": " << strerror(errno) - << llendl; + << gDirUtilp->getAppRODataDir() << ": " << strerror(errno) + << llendl; } - - LLAppViewerMacOSX* viewer_app_ptr = new LLAppViewerMacOSX(); - - viewer_app_ptr->setErrorHandler(LLAppViewer::handleViewerCrash); - - // Store off the command line args for use later. - gArgC = argc; - gArgV = argv; - bool ok = viewer_app_ptr->init(); + gViewerAppPtr = new LLAppViewerMacOSX(); + + gViewerAppPtr->setErrorHandler(LLAppViewer::handleViewerCrash); + + + + bool ok = gViewerAppPtr->init(); if(!ok) { llwarns << "Application init failed." << llendl; - return -1; } + + return ok; +} - // Run the application main loop - if(!LLApp::isQuitting()) +void handleQuit() +{ + LLAppViewer::instance()->userQuit(); +} + +bool runMainLoop() +{ + bool ret = LLApp::isQuitting(); + if (!ret && gViewerAppPtr != NULL) { - viewer_app_ptr->mainLoop(); + ret = gViewerAppPtr->mainLoop(); + } else { + ret = true; } + + return ret; +} - if (!LLApp::isError()) +void cleanupViewer() +{ + if(!LLApp::isError()) { - // - // We don't want to do cleanup here if the error handler got called - - // the assumption is that the error handler is responsible for doing - // app cleanup if there was a problem. - // - viewer_app_ptr->cleanup(); + gViewerAppPtr->cleanup(); } - delete viewer_app_ptr; - viewer_app_ptr = NULL; - return 0; + + delete gViewerAppPtr; + gViewerAppPtr = NULL; +} + +int main( int argc, char **argv ) +{ + // Store off the command line args for use later. + gArgC = argc; + gArgV = argv; + return createNSApp(argc, (const char**)argv); } LLAppViewerMacOSX::LLAppViewerMacOSX() @@ -148,28 +172,13 @@ bool LLAppViewerMacOSX::initParseCommandLine(LLCommandLineParser& clp) // The next two lines add the support for parsing the mac -psn_XXX arg. clp.addOptionDesc("psn", NULL, 1, "MacOSX process serial number"); clp.setCustomParser(parse_psn); - - // First read in the args from arguments txt. - const char* filename = "arguments.txt"; - llifstream ifs(filename, llifstream::binary); - if (!ifs.is_open()) - { - llwarns << "Unable to open file" << filename << llendl; - return false; - } - - if(clp.parseCommandLineFile(ifs) == false) - { - return false; - } - // Then parse the user's command line, so that any --url arg can appear last - // Succesive calls to clp.parse... will NOT override earlier options. + // parse the user's command line if(clp.parseCommandLine(gArgC, gArgV) == false) { return false; } - + // Get the user's preferred language string based on the Mac OS localization mechanism. // To add a new localization: // go to the "Resources" section of the project @@ -254,23 +263,24 @@ bool LLAppViewerMacOSX::restoreErrorTrap() return reset_count == 0; } -static OSStatus CarbonEventHandler(EventHandlerCallRef inHandlerCallRef, - EventRef inEvent, +#ifdef LL_CARBON_CRASH_HANDLER +static OSStatus CarbonEventHandler(EventHandlerCallRef inHandlerCallRef, + EventRef inEvent, void* inUserData) { ProcessSerialNumber psn; - GetEventParameter(inEvent, - kEventParamProcessID, - typeProcessSerialNumber, - NULL, - sizeof(psn), - NULL, + GetEventParameter(inEvent, + kEventParamProcessID, + typeProcessSerialNumber, + NULL, + sizeof(psn), + NULL, &psn); - if( GetEventKind(inEvent) == kEventAppTerminated ) + if( GetEventKind(inEvent) == kEventAppTerminated ) { - Boolean matching_psn = FALSE; + Boolean matching_psn = FALSE; OSErr os_result = SameProcess(&psn, (ProcessSerialNumber*)inUserData, &matching_psn); if(os_result >= 0 && matching_psn) { @@ -280,48 +290,58 @@ static OSStatus CarbonEventHandler(EventHandlerCallRef inHandlerCallRef, } return noErr; } +#endif void LLAppViewerMacOSX::handleCrashReporting(bool reportFreeze) { - // This used to use fork&exec, but is switched to LSOpenApplication to +#ifdef LL_CARBON_CRASH_HANDLER + // This used to use fork&exec, but is switched to LSOpenApplication to // Make sure the crash reporter launches in front of the SL window. std::string command_str; //command_str = "open Second Life.app/Contents/Resources/mac-crash-logger.app"; command_str = "mac-crash-logger.app/Contents/MacOS/mac-crash-logger"; + CFURLRef urlRef = CFURLCreateFromFileSystemRepresentation(NULL, (UInt8*)command_str.c_str(), strlen(command_str.c_str()), FALSE); + + // FSRef apparently isn't deprecated. + // There's other funcitonality that depends on it existing as well that isn't deprecated. + // There doesn't seem to be much to directly verify what the status of FSRef is, outside of some documentation pointing at FSRef being valid, and other documentation pointing to everything in Files.h being deprecated. + // We'll assume it isn't for now, since all non-deprecated functions that use it seem to assume similar. + FSRef appRef; - Boolean isDir = 0; - OSStatus os_result = FSPathMakeRef((UInt8*)command_str.c_str(), - &appRef, - &isDir); - if(os_result >= 0) + Boolean pathstatus = CFURLGetFSRef(urlRef, &appRef); + + OSStatus os_result = noErr; + + if(pathstatus == true) { LSApplicationParameters appParams; memset(&appParams, 0, sizeof(appParams)); appParams.version = 0; appParams.flags = kLSLaunchNoParams | kLSLaunchStartClassic; + appParams.application = &appRef; if(reportFreeze) { - // Make sure freeze reporting launches the crash logger synchronously, lest + // Make sure freeze reporting launches the crash logger synchronously, lest // Log files get changed by SL while the logger is running. - + // *NOTE:Mani A better way - make a copy of the data that the crash reporter will send // and let SL go about its business. This way makes the mac work like windows and linux - // and is the smallest patch for the issue. + // and is the smallest patch for the issue. sCrashReporterIsRunning = false; ProcessSerialNumber o_psn; - + static EventHandlerRef sCarbonEventsRef = NULL; - static const EventTypeSpec kEvents[] = + static const EventTypeSpec kEvents[] = { { kEventClassApplication, kEventAppTerminated } }; // Install the handler to detect crash logger termination - InstallEventHandler(GetApplicationEventTarget(), + InstallEventHandler(GetApplicationEventTarget(), (EventHandlerUPP) CarbonEventHandler, GetEventTypeCount(kEvents), kEvents, @@ -329,31 +349,31 @@ void LLAppViewerMacOSX::handleCrashReporting(bool reportFreeze) &sCarbonEventsRef ); - // Remove, temporarily the quit handler - which has *crash* behavior before + // Remove, temporarily the quit handler - which has *crash* behavior before // the mainloop gets running! - AERemoveEventHandler(kCoreEventClass, - kAEQuitApplication, + AERemoveEventHandler(kCoreEventClass, + kAEQuitApplication, NewAEEventHandlerUPP(AEQuitHandler), false); - + // Launch the crash reporter. os_result = LSOpenApplication(&appParams, &o_psn); if(os_result >= 0) - { + { sCrashReporterIsRunning = true; } - + while(sCrashReporterIsRunning) { RunApplicationEventLoop(); } - + // Re-install the apps quit handler. - AEInstallEventHandler(kCoreEventClass, - kAEQuitApplication, + AEInstallEventHandler(kCoreEventClass, + kAEQuitApplication, NewAEEventHandlerUPP(AEQuitHandler), - 0, + 0, false); // Remove the crash reporter quit handler. @@ -363,12 +383,12 @@ void LLAppViewerMacOSX::handleCrashReporting(bool reportFreeze) { appParams.flags |= kLSLaunchAsync; clear_signals(); - + ProcessSerialNumber o_psn; os_result = LSOpenApplication(&appParams, &o_psn); } - } +#endif } std::string LLAppViewerMacOSX::generateSerialNumber() @@ -463,111 +483,24 @@ bool LLAppViewerMacOSX::getMasterSystemAudioMute() return (mute != 0); } -OSErr AEGURLHandler(const AppleEvent *messagein, AppleEvent *reply, long refIn) -{ - OSErr result = noErr; - DescType actualType; - char buffer[1024]; // Flawfinder: ignore - Size size; - - result = AEGetParamPtr ( - messagein, - keyDirectObject, - typeCString, - &actualType, - (Ptr)buffer, - sizeof(buffer), - &size); - - if(result == noErr) - { - std::string url = buffer; - - // Safari 3.2 silently mangles secondlife:///app/ URLs into - // secondlife:/app/ (only one leading slash). - // Fix them up to meet the URL specification. JC - const std::string prefix = "secondlife:/app/"; - std::string test_prefix = url.substr(0, prefix.length()); - LLStringUtil::toLower(test_prefix); - if (test_prefix == prefix) - { - url.replace(0, prefix.length(), "secondlife:///app/"); - } - - LLMediaCtrl* web = NULL; - const bool trusted_browser = false; - LLURLDispatcher::dispatch(url, "", web, trusted_browser); - } - - return(result); -} - -OSStatus simpleDialogHandler(EventHandlerCallRef handler, EventRef event, void *userdata) +void handleUrl(const char* url_utf8) { - OSStatus result = eventNotHandledErr; - OSStatus err; - UInt32 evtClass = GetEventClass(event); - UInt32 evtKind = GetEventKind(event); - WindowRef window = (WindowRef)userdata; - - if((evtClass == kEventClassCommand) && (evtKind == kEventCommandProcess)) - { - HICommand cmd; - err = GetEventParameter(event, kEventParamDirectObject, typeHICommand, NULL, sizeof(cmd), NULL, &cmd); + if (url_utf8) + { + std::string url = url_utf8; + // Safari 3.2 silently mangles secondlife:///app/ URLs into + // secondlife:/app/ (only one leading slash). + // Fix them up to meet the URL specification. JC + const std::string prefix = "secondlife:/app/"; + std::string test_prefix = url.substr(0, prefix.length()); + LLStringUtil::toLower(test_prefix); + if (test_prefix == prefix) + { + url.replace(0, prefix.length(), "secondlife:///app/"); + } - if(err == noErr) - { - switch(cmd.commandID) - { - case kHICommandOK: - QuitAppModalLoopForWindow(window); - result = noErr; - break; - - case kHICommandCancel: - QuitAppModalLoopForWindow(window); - result = userCanceledErr; - break; - } - } - } - - return(result); -} - -void init_apple_menu(const char* product) -{ - // Load up a proper menu bar. - { - OSStatus err; - IBNibRef nib = NULL; - // NOTE: DO NOT translate or brand this string. It's an internal name in the .nib file, and MUST match exactly. - err = CreateNibReference(CFSTR("SecondLife"), &nib); - - if(err == noErr) - { - // NOTE: DO NOT translate or brand this string. It's an internal name in the .nib file, and MUST match exactly. - SetMenuBarFromNib(nib, CFSTR("MenuBar")); - } - - if(nib != NULL) - { - DisposeNibReference(nib); - } - } - - // Install a handler for 'gurl' AppleEvents. This is how secondlife:// URLs get passed to the viewer. - - if(AEInstallEventHandler('GURL', 'GURL', NewAEEventHandlerUPP(AEGURLHandler),0, false) != noErr) - { - // Couldn't install AppleEvent handler. This error shouldn't be fatal. - llinfos << "Couldn't install 'GURL' AppleEvent handler. Continuing..." << llendl; - } - - // Install a handler for 'quit' AppleEvents. This makes quitting the application from the dock work. - if(AEInstallEventHandler(kCoreEventClass, kAEQuitApplication, NewAEEventHandlerUPP(AEQuitHandler),0, false) != noErr) - { - // Couldn't install AppleEvent handler. This error shouldn't be fatal. - llinfos << "Couldn't install Quit AppleEvent handler. Continuing..." << llendl; - } + LLMediaCtrl* web = NULL; + const bool trusted_browser = false; + LLURLDispatcher::dispatch(url, "", web, trusted_browser); + } } diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp new file mode 100644 index 0000000000..9e3225a264 --- /dev/null +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -0,0 +1,398 @@ +/** + * @file llavatarrenderinfoaccountant.cpp + * @author Dave Simmons + * @date 2013-02-28 + * @brief + * + * $LicenseInfo:firstyear=2013&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2013, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +// Precompiled header +#include "llviewerprecompiledheaders.h" +// associated header +#include "llavatarrenderinfoaccountant.h" +// STL headers +// std headers +// external library headers +// other Linden headers +#include "llcharacter.h" +#include "llhttpclient.h" +#include "lltimer.h" +#include "llviewercontrol.h" +#include "llviewermenu.h" +#include "llviewerobjectlist.h" +#include "llviewerregion.h" +#include "llvoavatar.h" +#include "llworld.h" + + +static const std::string KEY_AGENTS = "agents"; // map +static const std::string KEY_WEIGHT = "weight"; // integer + +static const std::string KEY_IDENTIFIER = "identifier"; +static const std::string KEY_MESSAGE = "message"; +static const std::string KEY_ERROR = "error"; + + +// Send data updates about once per minute, only need per-frame resolution +LLFrameTimer LLAvatarRenderInfoAccountant::sRenderInfoReportTimer; + + +// HTTP responder class for GET request for avatar render weight information +class LLAvatarRenderInfoGetResponder : public LLHTTPClient::Responder +{ +public: + LLAvatarRenderInfoGetResponder(U64 region_handle) : mRegionHandle(region_handle) + { + } + + virtual void error(U32 statusNum, const std::string& reason) + { + LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); + if (regionp) + { + llwarns << "HTTP error result for avatar weight GET: " << statusNum + << ", " << reason + << " returned by region " << regionp->getName() + << llendl; + } + else + { + llwarns << "Avatar render weight GET error recieved but region not found for " + << mRegionHandle + << ", error " << statusNum + << ", " << reason + << llendl; + } + + } + + virtual void result(const LLSD& content) + { + LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); + if (regionp) + { + if (LLAvatarRenderInfoAccountant::logRenderInfo()) + { + llinfos << "LRI: Result for avatar weights request for region " << regionp->getName() << ":" << llendl; + } + + if (content.isMap()) + { + if (content.has(KEY_AGENTS)) + { + const LLSD & agents = content[KEY_AGENTS]; + if (agents.isMap()) + { + LLSD::map_const_iterator report_iter = agents.beginMap(); + while (report_iter != agents.endMap()) + { + LLUUID target_agent_id = LLUUID(report_iter->first); + const LLSD & agent_info_map = report_iter->second; + LLViewerObject* avatarp = gObjectList.findObject(target_agent_id); + if (avatarp && + avatarp->isAvatar() && + agent_info_map.isMap()) + { // Extract the data for this avatar + + if (LLAvatarRenderInfoAccountant::logRenderInfo()) + { + llinfos << "LRI: Agent " << target_agent_id + << ": " << agent_info_map << llendl; + } + + if (agent_info_map.has(KEY_WEIGHT)) + { + ((LLVOAvatar *) avatarp)->setReportedVisualComplexity(agent_info_map[KEY_WEIGHT].asInteger()); + } + } + report_iter++; + } + } + } // has "agents" + else if (content.has(KEY_ERROR)) + { + const LLSD & error = content[KEY_ERROR]; + llwarns << "Avatar render info GET error: " + << error[KEY_IDENTIFIER] + << ": " << error[KEY_MESSAGE] + << " from region " << regionp->getName() + << llendl; + } + } + } + else + { + llinfos << "Avatar render weight info recieved but region not found for " + << mRegionHandle << llendl; + } + } + +private: + U64 mRegionHandle; +}; + + +// HTTP responder class for POST request for avatar render weight information +class LLAvatarRenderInfoPostResponder : public LLHTTPClient::Responder +{ +public: + LLAvatarRenderInfoPostResponder(U64 region_handle) : mRegionHandle(region_handle) + { + } + + virtual void error(U32 statusNum, const std::string& reason) + { + LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); + if (regionp) + { + llwarns << "HTTP error result for avatar weight POST: " << statusNum + << ", " << reason + << " returned by region " << regionp->getName() + << llendl; + } + else + { + llwarns << "Avatar render weight POST error recieved but region not found for " + << mRegionHandle + << ", error " << statusNum + << ", " << reason + << llendl; + } + } + + virtual void result(const LLSD& content) + { + LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); + if (regionp) + { + if (LLAvatarRenderInfoAccountant::logRenderInfo()) + { + llinfos << "LRI: Result for avatar weights POST for region " << regionp->getName() + << ": " << content << llendl; + } + + if (content.isMap()) + { + if (content.has(KEY_ERROR)) + { + const LLSD & error = content[KEY_ERROR]; + llwarns << "Avatar render info POST error: " + << error[KEY_IDENTIFIER] + << ": " << error[KEY_MESSAGE] + << " from region " << regionp->getName() + << llendl; + } + } + } + else + { + llinfos << "Avatar render weight POST result recieved but region not found for " + << mRegionHandle << llendl; + } + } + +private: + U64 mRegionHandle; +}; + + +// static +// Send request for one region, no timer checks +void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regionp) +{ + std::string url = regionp->getCapability("AvatarRenderInfo"); + if (!url.empty()) + { + if (logRenderInfo()) + { + llinfos << "LRI: Sending avatar render info to region " + << regionp->getName() + << " from " << url + << llendl; + } + + // Build the render info to POST to the region + LLSD report = LLSD::emptyMap(); + LLSD agents = LLSD::emptyMap(); + + std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin(); + while( iter != LLCharacter::sInstances.end() ) + { + LLVOAvatar* avatar = dynamic_cast<LLVOAvatar*>(*iter); + if (avatar && + avatar->getRezzedStatus() >= 2 && // Mostly rezzed (maybe without baked textures downloaded) + !avatar->isDead() && // Not dead yet + avatar->getObjectHost() == regionp->getHost()) // Ensure it's on the same region + { + avatar->calculateUpdateRenderCost(); // Make sure the numbers are up-to-date + + LLSD info = LLSD::emptyMap(); + if (avatar->getVisualComplexity() > 0) + { + info[KEY_WEIGHT] = avatar->getVisualComplexity(); + agents[avatar->getID().asString()] = info; + + if (logRenderInfo()) + { + llinfos << "LRI: Sending avatar render info for " << avatar->getID() + << ": " << info << llendl; + llinfos << "LRI: geometry " << avatar->getAttachmentGeometryBytes() + << ", area " << avatar->getAttachmentSurfaceArea() + << llendl; + } + } + } + iter++; + } + + report[KEY_AGENTS] = agents; + if (agents.size() > 0) + { + LLHTTPClient::post(url, report, new LLAvatarRenderInfoPostResponder(regionp->getHandle())); + } + } +} + + + + +// static +// Send request for one region, no timer checks +void LLAvatarRenderInfoAccountant::getRenderInfoFromRegion(LLViewerRegion * regionp) +{ + std::string url = regionp->getCapability("AvatarRenderInfo"); + if (!url.empty()) + { + if (logRenderInfo()) + { + llinfos << "LRI: Requesting avatar render info for region " + << regionp->getName() + << " from " << url + << llendl; + } + + // First send a request to get the latest data + LLHTTPClient::get(url, new LLAvatarRenderInfoGetResponder(regionp->getHandle())); + } +} + + +// static +// Called every frame - send render weight requests to every region +void LLAvatarRenderInfoAccountant::idle() +{ + if (sRenderInfoReportTimer.hasExpired()) + { + const F32 SECS_BETWEEN_REGION_SCANS = 5.f; // Scan the region list every 5 seconds + const F32 SECS_BETWEEN_REGION_REQUEST = 60.0; // Update each region every 60 seconds + + S32 num_avs = LLCharacter::sInstances.size(); + + if (logRenderInfo()) + { + llinfos << "LRI: Scanning all regions and checking for render info updates" + << llendl; + } + + // Check all regions and see if it's time to fetch/send data + for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); + iter != LLWorld::getInstance()->getRegionList().end(); ++iter) + { + LLViewerRegion* regionp = *iter; + if (regionp && + regionp->isAlive() && + regionp->capabilitiesReceived() && // Region has capability URLs available + regionp->getRenderInfoRequestTimer().hasExpired()) // Time to make request + { + sendRenderInfoToRegion(regionp); + getRenderInfoFromRegion(regionp); + + // Reset this regions timer, moving to longer intervals if there are lots of avatars around + regionp->getRenderInfoRequestTimer().resetWithExpiry(SECS_BETWEEN_REGION_REQUEST + (2.f * num_avs)); + } + } + + // We scanned all the regions, reset the request timer. + sRenderInfoReportTimer.resetWithExpiry(SECS_BETWEEN_REGION_SCANS); + } + + static LLCachedControl<U32> render_auto_mute_functions(gSavedSettings, "RenderAutoMuteFunctions"); + static U32 prev_render_auto_mute_functions = (U32) -1; + if (prev_render_auto_mute_functions != render_auto_mute_functions) + { + prev_render_auto_mute_functions = render_auto_mute_functions; + + // Adjust menus + BOOL show_items = (BOOL)(render_auto_mute_functions & 0x04); + gMenuAvatarOther->setItemVisible( std::string("Normal"), show_items); + gMenuAvatarOther->setItemVisible( std::string("Always use impostor"), show_items); + gMenuAvatarOther->setItemVisible( std::string("Never use impostor"), show_items); + gMenuAvatarOther->setItemVisible( std::string("Impostor seperator"), show_items); + + gMenuAttachmentOther->setItemVisible( std::string("Normal"), show_items); + gMenuAttachmentOther->setItemVisible( std::string("Always use impostor"), show_items); + gMenuAttachmentOther->setItemVisible( std::string("Never use impostor"), show_items); + gMenuAttachmentOther->setItemVisible( std::string("Impostor seperator"), show_items); + + if (!show_items) + { // Turning off visual muting + for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin(); + iter != LLCharacter::sInstances.end(); ++iter) + { // Make sure all AVs have the setting cleared + LLVOAvatar* inst = (LLVOAvatar*) *iter; + inst->setCachedVisualMute(false); + } + } + } +} + + +// static +// Make sRenderInfoReportTimer expire so the next call to idle() will scan and query a new region +// called via LLViewerRegion::setCapabilitiesReceived() boost signals when the capabilities +// are returned for a new LLViewerRegion, and is the earliest time to get render info +void LLAvatarRenderInfoAccountant::expireRenderInfoReportTimer(const LLUUID& region_id) +{ + if (logRenderInfo()) + { + llinfos << "LRI: Viewer has new region capabilities, clearing global render info timer" + << " and timer for region " << region_id + << llendl; + } + + // Reset the global timer so it will scan regions immediately + sRenderInfoReportTimer.reset(); + + LLViewerRegion* regionp = LLWorld::instance().getRegionFromID(region_id); + if (regionp) + { // Reset the region's timer so it will request data immediately + regionp->getRenderInfoRequestTimer().reset(); + } +} + +// static +bool LLAvatarRenderInfoAccountant::logRenderInfo() +{ + static LLCachedControl<bool> render_mute_logging_enabled(gSavedSettings, "RenderAutoMuteLogging", false); + return render_mute_logging_enabled; +} diff --git a/indra/newview/llavatarrenderinfoaccountant.h b/indra/newview/llavatarrenderinfoaccountant.h new file mode 100644 index 0000000000..d68f2dccfb --- /dev/null +++ b/indra/newview/llavatarrenderinfoaccountant.h @@ -0,0 +1,56 @@ +/** + * @file llavatarrenderinfoaccountant.h + * @author Dave Simmons + * @date 2013-02-28 + * @brief + * + * $LicenseInfo:firstyear=2013&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2013, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#if ! defined(LL_llavatarrenderinfoaccountant_H) +#define LL_llavatarrenderinfoaccountant_H + +class LLViewerRegion; + +// Class to gather avatar rendering information +// that is sent to or fetched from regions. +class LLAvatarRenderInfoAccountant +{ +public: + LLAvatarRenderInfoAccountant() {}; + ~LLAvatarRenderInfoAccountant() {}; + + static void sendRenderInfoToRegion(LLViewerRegion * regionp); + static void getRenderInfoFromRegion(LLViewerRegion * regionp); + + static void expireRenderInfoReportTimer(const LLUUID& region_id); + + static void idle(); + + static bool logRenderInfo(); + +private: + // Send data updates about once per minute, only need per-frame resolution + static LLFrameTimer sRenderInfoReportTimer; +}; + +#endif /* ! defined(LL_llavatarrenderinfoaccountant_H) */ diff --git a/indra/newview/llchannelmanager.cpp b/indra/newview/llchannelmanager.cpp index 43757d0174..8b2d9e639f 100755 --- a/indra/newview/llchannelmanager.cpp +++ b/indra/newview/llchannelmanager.cpp @@ -139,8 +139,6 @@ void LLChannelManager::onLoginCompleted() } LLPersistentNotificationStorage::getInstance()->loadNotifications(); - - LLDoNotDisturbNotificationStorage::getInstance()->initialize(); LLDoNotDisturbNotificationStorage::getInstance()->loadNotifications(); } diff --git a/indra/newview/llchatbar.cpp b/indra/newview/llchatbar.cpp index 7d0331757b..b3bc0ba966 100755 --- a/indra/newview/llchatbar.cpp +++ b/indra/newview/llchatbar.cpp @@ -381,7 +381,7 @@ void LLChatBar::sendChat( EChatType type ) if (!utf8_revised_text.empty()) { // Chat with animation - sendChatFromViewer(utf8_revised_text, type, TRUE); + sendChatFromViewer(utf8_revised_text, type, gSavedSettings.getBOOL("PlayChatAnim")); } } } diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 0f138873ac..43a733f918 100755 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -628,6 +628,7 @@ LLChatHistory::LLChatHistory(const LLChatHistory::Params& p) editor_params.enabled = false; // read only editor_params.show_context_menu = "true"; mEditor = LLUICtrlFactory::create<LLTextEditor>(editor_params, this); + mEditor->setIsFriendCallback(LLAvatarActions::isFriend); } LLSD LLChatHistory::getValue() const @@ -897,20 +898,10 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL LLStyle::Params link_params(body_message_params); link_params.overwriteFrom(LLStyleMap::instance().lookupAgent(chat.mFromID)); - if (from_me) - { std::string localized_name; - bool is_localized = LLTrans::findString(localized_name, "AgentNameSubst"); - mEditor->appendText((is_localized? localized_name:"(You)") + delimiter, - prependNewLineState, link_params); - prependNewLineState = false; - } - else - { // Add link to avatar's inspector and delimiter to message. - mEditor->appendText(std::string(link_params.link_href) + delimiter, - prependNewLineState, link_params); - prependNewLineState = false; - } + mEditor->appendText(std::string(link_params.link_href) + delimiter, + prependNewLineState, link_params); + prependNewLineState = false; } else { diff --git a/indra/newview/llchatitemscontainerctrl.cpp b/indra/newview/llchatitemscontainerctrl.cpp index a1a9463d43..fd4f17b694 100755 --- a/indra/newview/llchatitemscontainerctrl.cpp +++ b/indra/newview/llchatitemscontainerctrl.cpp @@ -323,12 +323,11 @@ BOOL LLFloaterIMNearbyChatToastPanel::handleMouseUp (S32 x, S32 y, MASK mask) return TRUE; else { - (LLFloaterReg::getTypedInstance<LLFloaterIMNearbyChat>("nearby_chat"))->showHistory(); + LLFloaterReg::getTypedInstance<LLFloaterIMNearbyChat>("nearby_chat")->showHistory(); return FALSE; } } - - (LLFloaterReg::getTypedInstance<LLFloaterIMNearbyChat>("nearby_chat"))->showHistory(); + LLFloaterReg::getTypedInstance<LLFloaterIMNearbyChat>("nearby_chat")->showHistory(); return LLPanel::handleMouseUp(x,y,mask); } diff --git a/indra/newview/llcommandlineparser.cpp b/indra/newview/llcommandlineparser.cpp index 17d403bbe1..a6384ded12 100755 --- a/indra/newview/llcommandlineparser.cpp +++ b/indra/newview/llcommandlineparser.cpp @@ -38,16 +38,23 @@ #endif #include <boost/program_options.hpp> +#include <boost/lexical_cast.hpp> #include <boost/bind.hpp> -#include<boost/tokenizer.hpp> +#include <boost/tokenizer.hpp> +#include <boost/assign/list_of.hpp> #if _MSC_VER # pragma warning(pop) #endif #include "llsdserialize.h" +#include "llerror.h" +#include "stringize.h" +#include <string> +#include <set> #include <iostream> #include <sstream> +#include <typeinfo> #include "llcontrol.h" @@ -63,10 +70,22 @@ namespace po = boost::program_options; // This could be good or bad, and probably won't matter for most use cases. namespace { + // List of command-line switches that can't map-to settings variables. + // Going forward, we want every new command-line switch to map-to some + // settings variable. This list is used to validate that. + const std::set<std::string> unmapped_options = boost::assign::list_of + ("help") + ("set") + ("setdefault") + ("settings") + ("sessionsettings") + ("usersessionsettings") + ; + po::options_description gOptionsDesc; po::positional_options_description gPositionalOptions; po::variables_map gVariableMap; - + const LLCommandLineParser::token_vector_t gEmptyValue; void read_file_into_string(std::string& str, const std::basic_istream < char >& file) @@ -384,9 +403,19 @@ bool LLCommandLineParser::parseCommandLineFile(const std::basic_istream < char > return parseCommandLineString(args); } -void LLCommandLineParser::notify() +bool LLCommandLineParser::notify() { - po::notify(gVariableMap); + try + { + po::notify(gVariableMap); + return true; + } + catch (const LLCLPError& e) + { + llwarns << "Caught Error: " << e.what() << llendl; + mErrorMsg = e.what(); + return false; + } } void LLCommandLineParser::printOptions() const @@ -428,43 +457,129 @@ const LLCommandLineParser::token_vector_t& LLCommandLineParser::getOption(const //---------------------------------------------------------------------------- // LLControlGroupCLP defintions //---------------------------------------------------------------------------- +namespace { +LLCommandLineParser::token_vector_t::value_type +onevalue(const std::string& option, + const LLCommandLineParser::token_vector_t& value) +{ + if (value.empty()) + { + // What does it mean when the user specifies a command-line switch + // that requires a value, but omits the value? Complain. + throw LLCLPError(STRINGIZE("No value specified for --" << option << "!")); + } + else if (value.size() > 1) + { + llwarns << "Ignoring extra tokens specified for --" + << option << "." << llendl; + } + return value[0]; +} + +void badvalue(const std::string& option, + const std::string& varname, + const std::string& type, + const std::string& value) +{ + // If the user passes an unusable value for a command-line switch, it + // seems like a really bad idea to just ignore it, even with a log + // warning. + throw LLCLPError(STRINGIZE("Invalid value specified by command-line switch '" << option + << "' for variable '" << varname << "' of type " << type + << ": '" << value << "'")); +} + +template <typename T> +T convertTo(const std::string& option, + const std::string& varname, + const LLCommandLineParser::token_vector_t::value_type& value) +{ + try + { + return boost::lexical_cast<T>(value); + } + catch (const boost::bad_lexical_cast&) + { + badvalue(option, varname, typeid(T).name(), value); + // bogus return; compiler unaware that badvalue() won't return + return T(); + } +} + void setControlValueCB(const LLCommandLineParser::token_vector_t& value, - const std::string& opt_name, - LLControlGroup* ctrlGroup) + const std::string& option, + LLControlVariable* ctrl) { - // *FIX: Do sematic conversion here. + // *FIX: Do semantic conversion here. // LLSD (ImplString) Is no good for doing string to type conversion for... // booleans // compound types // ?... - LLControlVariable* ctrl = ctrlGroup->getControl(opt_name); if(NULL != ctrl) { switch(ctrl->type()) { case TYPE_BOOLEAN: - if(value.size() > 1) + if (value.empty()) { - llwarns << "Ignoring extra tokens." << llendl; + // Boolean-valued command-line switches are unusual. If you + // simply specify the switch without an explicit value, we can + // infer you mean 'true'. + ctrl->setValue(LLSD(true), false); } - - if(value.size() > 0) + else { + // Only call onevalue() AFTER handling value.empty() case! + std::string token(onevalue(option, value)); + // There's a token. check the string for true/false/1/0 etc. BOOL result = false; - BOOL gotSet = LLStringUtil::convertToBOOL(value[0], result); - if(gotSet) + BOOL gotSet = LLStringUtil::convertToBOOL(token, result); + if (gotSet) { ctrl->setValue(LLSD(result), false); } + else + { + badvalue(option, ctrl->getName(), "bool", token); + } + } + break; + + case TYPE_U32: + { + std::string token(onevalue(option, value)); + // To my surprise, for an unsigned target, lexical_cast() doesn't + // complain about an input string such as "-17". In that case, you + // get a very large positive result. So for U32, make sure there's + // no minus sign! + if (token.find('-') == std::string::npos) + { + ctrl->setValue(LLSD::Integer(convertTo<U32>(option, ctrl->getName(), token)), + false); } else { - ctrl->setValue(LLSD(true), false); + badvalue(option, ctrl->getName(), "unsigned", token); } break; + } + + case TYPE_S32: + ctrl->setValue(convertTo<S32>(option, ctrl->getName(), + onevalue(option, value)), false); + break; + + case TYPE_F32: + ctrl->setValue(convertTo<F32>(option, ctrl->getName(), + onevalue(option, value)), false); + break; + // It appears that no one has yet tried to define a command-line + // switch mapped to a settings variable of TYPE_VEC3, TYPE_VEC3D, + // TYPE_RECT, TYPE_COL4, TYPE_COL3. Such types would certainly seem to + // call for a bit of special handling here... default: { // For the default types, let llsd do the conversion. @@ -481,16 +596,9 @@ void setControlValueCB(const LLCommandLineParser::token_vector_t& value, ctrl->setValue(llsdArray, false); } - else if(value.size() > 0) + else { - if(value.size() > 1) - { - llwarns << "Ignoring extra tokens mapped to the setting: " << opt_name << "." << llendl; - } - - LLSD llsdValue; - llsdValue.assign(LLSD::String(value[0])); - ctrl->setValue(llsdValue, false); + ctrl->setValue(onevalue(option, value), false); } } break; @@ -498,12 +606,14 @@ void setControlValueCB(const LLCommandLineParser::token_vector_t& value, } else { - llwarns << "Command Line option mapping '" - << opt_name - << "' not found! Ignoring." - << llendl; + // This isn't anything a user can affect -- it's a misconfiguration on + // the part of the coder. Rub the coder's nose in the problem right + // away so even preliminary testing will surface it. + llerrs << "Command Line option --" << option + << " maps to unknown setting!" << llendl; } } +} // anonymous namespace void LLControlGroupCLP::configure(const std::string& config_filename, LLControlGroup* controlGroup) { @@ -561,11 +671,37 @@ void LLControlGroupCLP::configure(const std::string& config_filename, LLControlG } boost::function1<void, const token_vector_t&> callback; - if(option_params.has("map-to") && (NULL != controlGroup)) + if (! option_params.has("map-to")) + { + // If this option isn't mapped to a settings variable, is it + // one of the ones for which that's unreasonable, or did + // someone carelessly add a new option? (Make all these + // configuration errors fatal so a maintainer will catch them + // right away.) + std::set<std::string>::const_iterator found = unmapped_options.find(long_name); + if (found == unmapped_options.end()) + { + llerrs << "New command-line option " << long_name + << " should map-to a variable in settings.xml" << llendl; + } + } + else // option specifies map-to { std::string controlName = option_params["map-to"].asString(); - callback = boost::bind(setControlValueCB, _1, - controlName, controlGroup); + if (! controlGroup) + { + llerrs << "Must pass gSavedSettings to LLControlGroupCLP::configure() for " + << long_name << " (map-to " << controlName << ")" << llendl; + } + + LLControlVariable* ctrl = controlGroup->getControl(controlName); + if (! ctrl) + { + llerrs << "Option " << long_name << " specifies map-to " << controlName + << " which does not exist" << llendl; + } + + callback = boost::bind(setControlValueCB, _1, long_name, ctrl); } this->addOptionDesc( diff --git a/indra/newview/llcommandlineparser.h b/indra/newview/llcommandlineparser.h index 44f2a26843..71388b8217 100755 --- a/indra/newview/llcommandlineparser.h +++ b/indra/newview/llcommandlineparser.h @@ -86,7 +86,7 @@ public: * * Use this to handle the results of parsing. */ - void notify(); + bool notify(); /** @brief Print a description of the configured options. * diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp index c74ce24872..192a594c9d 100755 --- a/indra/newview/llconversationmodel.cpp +++ b/indra/newview/llconversationmodel.cpp @@ -363,7 +363,10 @@ void LLConversationItemSession::buildContextMenu(LLMenuGL& menu, U32 flags) lldebugs << "LLConversationItemParticipant::buildContextMenu()" << llendl; menuentry_vec_t items; menuentry_vec_t disabled_items; - + if((flags & ITEM_IN_MULTI_SELECTION) && (this->getType() != CONV_SESSION_NEARBY)) + { + items.push_back(std::string("close_selected_conversations")); + } if(this->getType() == CONV_SESSION_1_ON_1) { items.push_back(std::string("close_conversation")); @@ -386,6 +389,10 @@ void LLConversationItemSession::buildContextMenu(LLMenuGL& menu, U32 flags) addVoiceOptions(items); items.push_back(std::string("chat_history")); } + else if(this->getType() == CONV_SESSION_NEARBY) + { + items.push_back(std::string("chat_history")); + } hide_context_entries(menu, items, disabled_items); } diff --git a/indra/newview/llconversationmodel.h b/indra/newview/llconversationmodel.h index 8766585049..d8cdcdfc97 100755..100644 --- a/indra/newview/llconversationmodel.h +++ b/indra/newview/llconversationmodel.h @@ -252,11 +252,10 @@ public: const std::string& getName() const { return mEmpty; } const std::string& getFilterText() { return mEmpty; } void setModified(EFilterModified behavior = FILTER_RESTART) { } - - void setFilterCount(S32 count) { } - S32 getFilterCount() const { return 0; } - void decrementFilterCount() { } - + + void resetTime(S32 timeout) { } + bool isTimedOut() { return false; } + bool isDefault() const { return true; } bool isNotDefault() const { return false; } void markDefault() { } diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp index b6c53e5e30..9faa12b2ee 100755..100644 --- a/indra/newview/llconversationview.cpp +++ b/indra/newview/llconversationview.cpp @@ -118,9 +118,19 @@ void LLConversationViewSession::setFlashState(bool flash_state) mFlashTimer->stopFlashing(); } +void LLConversationViewSession::setHighlightState(bool hihglight_state) +{ + mFlashStateOn = hihglight_state; + mFlashStarted = true; + mFlashTimer->stopFlashing(); +} + void LLConversationViewSession::startFlashing() { - if (isInVisibleChain() && mFlashStateOn && !mFlashStarted) + LLFloaterIMContainer* im_box = LLFloaterReg::getTypedInstance<LLFloaterIMContainer>("im_container"); + + // Need to start flashing only when "Conversations" is opened or brought on top + if (isInVisibleChain() && !im_box->isMinimized() && mFlashStateOn && !mFlashStarted) { mFlashStarted = true; mFlashTimer->startFlashing(); @@ -263,6 +273,29 @@ BOOL LLConversationViewSession::handleMouseDown( S32 x, S32 y, MASK mask ) return result; } +BOOL LLConversationViewSession::handleMouseUp( S32 x, S32 y, MASK mask ) +{ + BOOL result = LLFolderViewFolder::handleMouseUp(x, y, mask); + + LLFloater* volume_floater = LLFloaterReg::findInstance("floater_voice_volume"); + LLFloater* chat_volume_floater = LLFloaterReg::findInstance("chat_voice"); + if (result + && getRoot() + && !(volume_floater && volume_floater->isShown() && volume_floater->hasFocus()) + && !(chat_volume_floater && chat_volume_floater->isShown() && chat_volume_floater->hasFocus())) + { + LLConversationItem* item = dynamic_cast<LLConversationItem *>(getViewModelItem()); + LLUUID session_id = item? item->getUUID() : LLUUID(); + LLFloaterIMSessionTab* session_floater = LLFloaterIMSessionTab::findConversation(session_id); + if(!session_floater->hasFocus()) + { + session_floater->setFocus(true); + } + } + + return result; +} + BOOL LLConversationViewSession::handleRightMouseDown( S32 x, S32 y, MASK mask ) { BOOL result = LLFolderViewFolder::handleRightMouseDown(x, y, mask); @@ -340,16 +373,20 @@ void LLConversationViewSession::setVisibleIfDetached(BOOL visible) { // Do this only if the conversation floater has been torn off (i.e. no multi floater host) and is not minimized // Note: minimized dockable floaters are brought to front hence unminimized when made visible and we don't want that here - LLFolderViewModelItem* item = mViewModelItem; - LLUUID session_uuid = dynamic_cast<LLConversationItem*>(item)->getUUID(); - LLFloater* session_floater = LLFloaterIMSessionTab::getConversation(session_uuid); - - if (session_floater && !session_floater->getHost() && !session_floater->isMinimized()) + LLFloater* session_floater = getSessionFloater(); + if (session_floater && session_floater->isDetachedAndNotMinimized()) { session_floater->setVisible(visible); } } +LLFloater* LLConversationViewSession::getSessionFloater() +{ + LLFolderViewModelItem* item = mViewModelItem; + LLUUID session_uuid = dynamic_cast<LLConversationItem*>(item)->getUUID(); + return LLFloaterIMSessionTab::getConversation(session_uuid); +} + LLConversationViewParticipant* LLConversationViewSession::findParticipant(const LLUUID& participant_id) { // This is *not* a general tree parsing algorithm. We search only in the mItems list diff --git a/indra/newview/llconversationview.h b/indra/newview/llconversationview.h index 3eb2e63792..5a74974302 100755..100644 --- a/indra/newview/llconversationview.h +++ b/indra/newview/llconversationview.h @@ -69,6 +69,7 @@ public: /*virtual*/ void draw(); /*virtual*/ BOOL handleMouseDown( S32 x, S32 y, MASK mask ); /*virtual*/ BOOL handleRightMouseDown( S32 x, S32 y, MASK mask ); + /*virtual*/ BOOL handleMouseUp( S32 x, S32 y, MASK mask ); /*virtual*/ S32 arrange(S32* width, S32* height); @@ -86,6 +87,9 @@ public: virtual void refresh(); /*virtual*/ void setFlashState(bool flash_state); + void setHighlightState(bool hihglight_state); + + LLFloater* getSessionFloater(); private: diff --git a/indra/newview/lldirpicker.cpp b/indra/newview/lldirpicker.cpp index d7d9f82910..4c4424edc4 100755 --- a/indra/newview/lldirpicker.cpp +++ b/indra/newview/lldirpicker.cpp @@ -37,7 +37,7 @@ #include "llwindow.h" // beforeDialog() #include "llviewercontrol.h" -#if LL_LINUX || LL_SOLARIS +#if LL_LINUX || LL_SOLARIS || LL_DARWIN # include "llfilepicker.h" #endif @@ -147,152 +147,36 @@ std::string LLDirPicker::getDirName() #elif LL_DARWIN LLDirPicker::LLDirPicker() : - mFileName(NULL), - mLocked(false) +mFileName(NULL), +mLocked(false) { + mFilePicker = new LLFilePicker(); reset(); - - memset(&mNavOptions, 0, sizeof(mNavOptions)); - OSStatus error = NavGetDefaultDialogCreationOptions(&mNavOptions); - if (error == noErr) - { - mNavOptions.modality = kWindowModalityAppModal; - } } LLDirPicker::~LLDirPicker() { - // nothing + delete mFilePicker; } -//static -pascal void LLDirPicker::doNavCallbackEvent(NavEventCallbackMessage callBackSelector, - NavCBRecPtr callBackParms, void* callBackUD) +void LLDirPicker::reset() { - switch(callBackSelector) - { - case kNavCBStart: - { - if (!sInstance.mFileName) break; - - OSStatus error = noErr; - AEDesc theLocation = {typeNull, NULL}; - FSSpec outFSSpec; - - //Convert string to a FSSpec - FSRef myFSRef; - - const char* filename=sInstance.mFileName->c_str(); - - error = FSPathMakeRef ((UInt8*)filename, &myFSRef, NULL); - - if (error != noErr) break; - - error = FSGetCatalogInfo (&myFSRef, kFSCatInfoNone, NULL, NULL, &outFSSpec, NULL); - - if (error != noErr) break; - - error = AECreateDesc(typeFSS, &outFSSpec, sizeof(FSSpec), &theLocation); - - if (error != noErr) break; - - error = NavCustomControl(callBackParms->context, - kNavCtlSetLocation, (void*)&theLocation); - - } - } + if (mFilePicker) + mFilePicker->reset(); } -OSStatus LLDirPicker::doNavChooseDialog() -{ - OSStatus error = noErr; - NavDialogRef navRef = NULL; - NavReplyRecord navReply; - - memset(&navReply, 0, sizeof(navReply)); - - // NOTE: we are passing the address of a local variable here. - // This is fine, because the object this call creates will exist for less than the lifetime of this function. - // (It is destroyed by NavDialogDispose() below.) - - error = NavCreateChooseFolderDialog(&mNavOptions, &doNavCallbackEvent, NULL, NULL, &navRef); - - gViewerWindow->getWindow()->beforeDialog(); - - if (error == noErr) - error = NavDialogRun(navRef); - - gViewerWindow->getWindow()->afterDialog(); - - if (error == noErr) - error = NavDialogGetReply(navRef, &navReply); - - if (navRef) - NavDialogDispose(navRef); - - if (error == noErr && navReply.validRecord) - { - FSRef fsRef; - AEKeyword theAEKeyword; - DescType typeCode; - Size actualSize = 0; - char path[LL_MAX_PATH]; /*Flawfinder: ignore*/ - - memset(&fsRef, 0, sizeof(fsRef)); - error = AEGetNthPtr(&navReply.selection, 1, typeFSRef, &theAEKeyword, &typeCode, &fsRef, sizeof(fsRef), &actualSize); - - if (error == noErr) - error = FSRefMakePath(&fsRef, (UInt8*) path, sizeof(path)); - - if (error == noErr) - mDir = path; - } - - return error; -} +//static BOOL LLDirPicker::getDir(std::string* filename) { - if( mLocked ) return FALSE; - BOOL success = FALSE; - OSStatus error = noErr; - - // if local file browsing is turned off, return without opening dialog - if ( check_local_file_access_enabled() == false ) - { - return FALSE; - } - - mFileName = filename; - -// mNavOptions.saveFileName - - // Modal, so pause agent - send_agent_pause(); - { - error = doNavChooseDialog(); - } - send_agent_resume(); - if (error == noErr) - { - if (mDir.length() > 0) - success = true; - } - - // Account for the fact that the app has been stalled. - LLFrameTimer::updateFrameTime(); - return success; + LLFilePicker::ELoadFilter filter=LLFilePicker::FFLOAD_DIRECTORY; + + return mFilePicker->getOpenFile(filter, true); } std::string LLDirPicker::getDirName() { - return mDir; -} - -void LLDirPicker::reset() -{ - mLocked = false; - mDir.clear(); + return mFilePicker->getFirstFile(); } #elif LL_LINUX || LL_SOLARIS diff --git a/indra/newview/lldirpicker.h b/indra/newview/lldirpicker.h index 682f9d6476..9cc62431ef 100755 --- a/indra/newview/lldirpicker.h +++ b/indra/newview/lldirpicker.h @@ -34,11 +34,10 @@ #include "stdtypes.h" #if LL_DARWIN -#include <Carbon/Carbon.h> // AssertMacros.h does bad things. -#include "fix_macros.h" #undef verify +#undef check #undef require #include <vector> @@ -77,15 +76,7 @@ private: void buildDirname( void ); bool check_local_file_access_enabled(); -#if LL_DARWIN - NavDialogCreationOptions mNavOptions; - static pascal void doNavCallbackEvent(NavEventCallbackMessage callBackSelector, - NavCBRecPtr callBackParms, void* callBackUD); - OSStatus doNavChooseDialog(); - -#endif - -#if LL_LINUX || LL_SOLARIS +#if LL_LINUX || LL_SOLARIS || LL_DARWIN // On Linux we just implement LLDirPicker on top of LLFilePicker LLFilePicker *mFilePicker; #endif diff --git a/indra/newview/lldonotdisturbnotificationstorage.cpp b/indra/newview/lldonotdisturbnotificationstorage.cpp index 82affcf068..495cd01349 100755 --- a/indra/newview/lldonotdisturbnotificationstorage.cpp +++ b/indra/newview/lldonotdisturbnotificationstorage.cpp @@ -70,7 +70,7 @@ BOOL LLDoNotDisturbNotificationStorageTimer::tick() LLDoNotDisturbNotificationStorage::LLDoNotDisturbNotificationStorage() : LLSingleton<LLDoNotDisturbNotificationStorage>() - , LLNotificationStorage(gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "dnd_notifications.xml")) + , LLNotificationStorage("") , mDirty(false) { nameToPayloadParameterMap[toastName] = "SESSION_ID"; @@ -83,6 +83,7 @@ LLDoNotDisturbNotificationStorage::~LLDoNotDisturbNotificationStorage() void LLDoNotDisturbNotificationStorage::initialize() { + setFileName(gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "dnd_notifications.xml")); getCommunicationChannel()->connectFailedFilter(boost::bind(&LLDoNotDisturbNotificationStorage::onChannelChanged, this, _1)); } @@ -115,7 +116,8 @@ void LLDoNotDisturbNotificationStorage::saveNotifications() { LLNotificationPtr notificationPtr = historyIter->second; - if (!notificationPtr->isRespondedTo() && !notificationPtr->isCancelled() && !notificationPtr->isExpired()) + if (!notificationPtr->isRespondedTo() && !notificationPtr->isCancelled() && + !notificationPtr->isExpired() && !notificationPtr->isPersistent()) { data.append(notificationPtr->asLLSD(true)); } @@ -210,12 +212,8 @@ void LLDoNotDisturbNotificationStorage::loadNotifications() } - if(imToastExists) - { - LLFloaterReg::showInstance("im_container"); - } - - if(group_ad_hoc_toast_exists) + bool isConversationLoggingAllowed = gSavedPerAccountSettings.getS32("KeepConversationLogTranscripts") > 0; + if(group_ad_hoc_toast_exists && isConversationLoggingAllowed) { LLFloaterReg::showInstance("conversation"); } @@ -266,11 +264,6 @@ void LLDoNotDisturbNotificationStorage::updateNotifications() } } - if(imToastExists) - { - LLFloaterReg::showInstance("im_container"); - } - if(imToastExists || offerExists) { make_ui_sound("UISndNewIncomingIMSession"); diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index 8c9fd4152a..9682f38227 100755 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -132,10 +132,16 @@ void LLDrawable::destroy() sNumZombieDrawables--; } + // Attempt to catch violations of this in debug, + // knowing that some false alarms may result + // + llassert(!LLSpatialGroup::sNoDelete); + + /* cannot be guaranteed and causes crashes on false alarms if (LLSpatialGroup::sNoDelete) { llerrs << "Illegal deletion of LLDrawable!" << llendl; - } + }*/ std::for_each(mFaces.begin(), mFaces.end(), DeletePointer()); mFaces.clear(); @@ -527,6 +533,8 @@ void LLDrawable::makeStatic(BOOL warning_enabled) } updatePartition(); } + + llassert(isAvatar() || isRoot() || mParent->isStatic()); } // Returns "distance" between target destination and resulting xfrom diff --git a/indra/newview/lldrawpool.cpp b/indra/newview/lldrawpool.cpp index 04e31e6486..714f9a1718 100755 --- a/indra/newview/lldrawpool.cpp +++ b/indra/newview/lldrawpool.cpp @@ -504,6 +504,7 @@ void LLRenderPass::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture, BOOL ba { params.mGroup->rebuildMesh(); } + params.mVertexBuffer->setBuffer(mask); params.mVertexBuffer->drawRange(params.mDrawMode, params.mStart, params.mEnd, params.mCount, params.mOffset); gPipeline.addTrianglesDrawn(params.mCount, params.mDrawMode); diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index c832e1401d..6c5d229dba 100755 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -93,15 +93,35 @@ void LLDrawPoolAlpha::beginPostDeferredPass(S32 pass) if (pass == 0) { + if (LLPipeline::sImpostorRender) + { + simple_shader = &gDeferredAlphaImpostorProgram; + fullbright_shader = &gDeferredFullbrightProgram; + } + else if (LLPipeline::sUnderWaterRender) + { + simple_shader = &gDeferredAlphaWaterProgram; + fullbright_shader = &gDeferredFullbrightWaterProgram; + } + else + { simple_shader = &gDeferredAlphaProgram; - fullbright_shader = &gObjectFullbrightProgram; + fullbright_shader = &gDeferredFullbrightProgram; + } + + F32 gamma = gSavedSettings.getF32("RenderDeferredDisplayGamma"); + fullbright_shader->bind(); fullbright_shader->uniform1f(LLShaderMgr::TEXTURE_GAMMA, 2.2f); + fullbright_shader->uniform1f(LLShaderMgr::DISPLAY_GAMMA, (gamma > 0.1f) ? 1.0f / gamma : (1.0f/2.2f)); fullbright_shader->unbind(); + //prime simple shader (loads shadow relevant uniforms) gPipeline.bindDeferredShader(*simple_shader); + + simple_shader->uniform1f(LLShaderMgr::DISPLAY_GAMMA, (gamma > 0.1f) ? 1.0f / gamma : (1.0f/2.2f)); } - else + else if (!LLPipeline::sImpostorRender) { //update depth buffer sampler gPipeline.mScreen.flush(); @@ -113,6 +133,23 @@ void LLDrawPoolAlpha::beginPostDeferredPass(S32 pass) gObjectFullbrightAlphaMaskProgram.setMinimumAlpha(0.33f); } + + if (LLPipeline::sRenderDeferred) + { + emissive_shader = &gDeferredEmissiveProgram; + } + else + { + if (LLPipeline::sUnderWaterRender) + { + emissive_shader = &gObjectEmissiveWaterProgram; + } + else + { + emissive_shader = &gObjectEmissiveProgram; + } + } + deferred_render = TRUE; if (mVertexShaderLevel > 0) { @@ -124,7 +161,7 @@ void LLDrawPoolAlpha::beginPostDeferredPass(S32 pass) void LLDrawPoolAlpha::endPostDeferredPass(S32 pass) { - if (pass == 1) + if (pass == 1 && !LLPipeline::sImpostorRender) { gPipeline.mDeferredDepth.flush(); gPipeline.mScreen.bindTarget(); @@ -144,7 +181,13 @@ void LLDrawPoolAlpha::beginRenderPass(S32 pass) { LLFastTimer t(FTM_RENDER_ALPHA); - if (LLPipeline::sUnderWaterRender) + if (LLPipeline::sImpostorRender) + { + simple_shader = &gObjectSimpleImpostorProgram; + fullbright_shader = &gObjectFullbrightProgram; + emissive_shader = &gObjectEmissiveProgram; + } + else if (LLPipeline::sUnderWaterRender) { simple_shader = &gObjectSimpleWaterProgram; fullbright_shader = &gObjectFullbrightWaterProgram; @@ -192,8 +235,13 @@ void LLDrawPoolAlpha::render(S32 pass) gGL.setColorMask(true, true); } - LLGLDepthTest depth(GL_TRUE, LLDrawPoolWater::sSkipScreenCopy || - (deferred_render && pass == 1) ? GL_TRUE : GL_FALSE); + bool write_depth = LLDrawPoolWater::sSkipScreenCopy + || (deferred_render && pass == 1) + // we want depth written so that rendered alpha will + // contribute to the alpha mask used for impostors + || LLPipeline::sImpostorRenderAlphaDepthPass; + + LLGLDepthTest depth(GL_TRUE, write_depth ? GL_TRUE : GL_FALSE); if (deferred_render && pass == 1) { @@ -239,11 +287,11 @@ void LLDrawPoolAlpha::render(S32 pass) if (mVertexShaderLevel > 0) { - renderAlpha(getVertexDataMask() | LLVertexBuffer::MAP_TEXTURE_INDEX | LLVertexBuffer::MAP_TANGENT | LLVertexBuffer::MAP_TEXCOORD1 | LLVertexBuffer::MAP_TEXCOORD2); + renderAlpha(getVertexDataMask() | LLVertexBuffer::MAP_TEXTURE_INDEX | LLVertexBuffer::MAP_TANGENT | LLVertexBuffer::MAP_TEXCOORD1 | LLVertexBuffer::MAP_TEXCOORD2, pass); } else { - renderAlpha(getVertexDataMask()); + renderAlpha(getVertexDataMask(), pass); } gGL.setColorMask(true, false); @@ -315,7 +363,7 @@ void LLDrawPoolAlpha::renderAlphaHighlight(U32 mask) } } -void LLDrawPoolAlpha::renderAlpha(U32 mask) +void LLDrawPoolAlpha::renderAlpha(U32 mask, S32 pass) { BOOL initialized_lighting = FALSE; BOOL light_enabled = TRUE; @@ -331,10 +379,18 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) if (group->mSpatialPartition->mRenderByGroup && !group->isDead()) { + bool is_particle_or_hud_particle = group->mSpatialPartition->mPartitionType == LLViewerRegion::PARTITION_PARTICLE + || group->mSpatialPartition->mPartitionType == LLViewerRegion::PARTITION_HUD_PARTICLE; + bool draw_glow_for_this_partition = mVertexShaderLevel > 0 && // no shaders = no glow. // All particle systems seem to come off the wire with texture entries which claim that they glow. This is probably a bug in the data. Suppress. - group->mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_PARTICLE && - group->mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_HUD_PARTICLE; + !is_particle_or_hud_particle; + + static LLFastTimer::DeclareTimer FTM_RENDER_ALPHA_GROUP_LOOP("Alpha Group"); + LLFastTimer t(FTM_RENDER_ALPHA_GROUP_LOOP); + + bool disable_cull = is_particle_or_hud_particle; + LLGLDisable cull(disable_cull ? GL_CULL_FACE : 0); LLSpatialGroup::drawmap_elem_t& draw_info = group->mDrawMap[LLRenderPass::PASS_ALPHA]; @@ -348,11 +404,28 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) continue; } + // Fix for bug - NORSPEC-271 + // If the face is more than 90% transparent, then don't update the Depth buffer for Dof + // We don't want the nearly invisible objects to cause of DoF effects + if(pass == 1 && !LLPipeline::sImpostorRender) + { + LLFace* face = params.mFace; + if(face) + { + const LLTextureEntry* tep = face->getTextureEntry(); + if(tep) + { + if(tep->getColor().mV[3] < 0.1f) + continue; + } + } + } + LLRenderPass::applyModelMatrix(params); LLMaterial* mat = NULL; - if (deferred_render && !LLPipeline::sUnderWaterRender) + if (deferred_render) { mat = params.mMaterial; } @@ -396,6 +469,11 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) llassert(mask < LLMaterial::SHADER_COUNT); target_shader = &(gDeferredMaterialProgram[mask]); + if (LLPipeline::sUnderWaterRender) + { + target_shader = &(gDeferredMaterialWaterProgram[mask]); + } + if (current_shader != target_shader) { gPipeline.bindDeferredShader(*target_shader); @@ -500,9 +578,15 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) } } - params.mVertexBuffer->setBuffer(mask); + static LLFastTimer::DeclareTimer FTM_RENDER_ALPHA_PUSH("Alpha Push Verts"); + { + LLFastTimer t(FTM_RENDER_ALPHA_PUSH); + gGL.blendFunc((LLRender::eBlendFactor) params.mBlendFuncSrc, (LLRender::eBlendFactor) params.mBlendFuncDst, mAlphaSFactor, mAlphaDFactor); + params.mVertexBuffer->setBuffer(mask & ~(params.mFullbright ? (LLVertexBuffer::MAP_TANGENT | LLVertexBuffer::MAP_TEXCOORD1 | LLVertexBuffer::MAP_TEXCOORD2) : 0)); + params.mVertexBuffer->drawRange(params.mDrawMode, params.mStart, params.mEnd, params.mCount, params.mOffset); gPipeline.addTrianglesDrawn(params.mCount, params.mDrawMode); + } // If this alpha mesh has glow, then draw it a second time to add the destination-alpha (=glow). Interleaving these state-changing calls could be expensive, but glow must be drawn Z-sorted with alpha. if (current_shader && @@ -515,7 +599,6 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) emissive_shader->bind(); - // glow doesn't use vertex colors from the mesh data params.mVertexBuffer->setBuffer((mask & ~LLVertexBuffer::MAP_COLOR) | LLVertexBuffer::MAP_EMISSIVE); // do the actual drawing, again @@ -538,6 +621,8 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) } } + gGL.setSceneBlendType(LLRender::BT_ALPHA); + LLVertexBuffer::unbind(); if (!light_enabled) diff --git a/indra/newview/lldrawpoolalpha.h b/indra/newview/lldrawpoolalpha.h index 43122218ed..d064a3a324 100755 --- a/indra/newview/lldrawpoolalpha.h +++ b/indra/newview/lldrawpoolalpha.h @@ -63,7 +63,7 @@ public: /*virtual*/ void prerender(); void renderGroupAlpha(LLSpatialGroup* group, U32 type, U32 mask, BOOL texture = TRUE); - void renderAlpha(U32 mask); + void renderAlpha(U32 mask, S32 pass); void renderAlphaHighlight(U32 mask); static BOOL sShowDebugAlpha; diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 075299386e..ba8c449c3d 100755 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -49,6 +49,7 @@ #include "llappviewer.h" #include "llrendersphere.h" #include "llviewerpartsim.h" +#include "llviewercontrol.h" // for gSavedSettings static U32 sDataMask = LLDrawPoolAvatar::VERTEX_DATA_MASK; static U32 sBufferUsage = GL_STREAM_DRAW_ARB; @@ -59,6 +60,7 @@ LLGLSLShader* LLDrawPoolAvatar::sVertexProgram = NULL; BOOL LLDrawPoolAvatar::sSkipOpaque = FALSE; BOOL LLDrawPoolAvatar::sSkipTransparent = FALSE; S32 LLDrawPoolAvatar::sDiffuseChannel = 0; +F32 LLDrawPoolAvatar::sMinimumAlpha = 0.2f; static bool is_deferred_render = false; @@ -135,6 +137,16 @@ void LLDrawPoolAvatar::prerender() { sBufferUsage = GL_STREAM_DRAW_ARB; } + + if (!mDrawFace.empty()) + { + const LLFace *facep = mDrawFace[0]; + if (facep && facep->getDrawable()) + { + LLVOAvatar* avatarp = (LLVOAvatar *)facep->getDrawable()->getVObj().get(); + updateRiggedVertexBuffers(avatarp); + } + } } LLMatrix4& LLDrawPoolAvatar::getModelView() @@ -272,7 +284,7 @@ void LLDrawPoolAvatar::beginPostDeferredAlpha() gPipeline.bindDeferredShader(*sVertexProgram); - sVertexProgram->setMinimumAlpha(0.2f); + sVertexProgram->setMinimumAlpha(LLDrawPoolAvatar::sMinimumAlpha); sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); } @@ -299,6 +311,11 @@ void LLDrawPoolAvatar::beginDeferredRiggedMaterialAlpha(S32 pass) sVertexProgram = &gDeferredMaterialProgram[pass]; + if (LLPipeline::sUnderWaterRender) + { + sVertexProgram = &(gDeferredMaterialWaterProgram[pass]); + } + gPipeline.bindDeferredShader(*sVertexProgram); sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); normal_channel = sVertexProgram->enableTexture(LLViewerShaderMgr::BUMP_MAP); @@ -491,7 +508,7 @@ S32 LLDrawPoolAvatar::getNumDeferredPasses() { if (LLPipeline::sImpostorRender) { - return 3; + return 19; } else { @@ -650,7 +667,7 @@ void LLDrawPoolAvatar::beginRigid() if (sVertexProgram != NULL) { //eyeballs render with the specular shader sVertexProgram->bind(); - sVertexProgram->setMinimumAlpha(0.2f); + sVertexProgram->setMinimumAlpha(LLDrawPoolAvatar::sMinimumAlpha); } } else @@ -677,12 +694,10 @@ void LLDrawPoolAvatar::beginDeferredImpostor() } sVertexProgram = &gDeferredImpostorProgram; - specular_channel = sVertexProgram->enableTexture(LLViewerShaderMgr::SPECULAR_MAP); normal_channel = sVertexProgram->enableTexture(LLViewerShaderMgr::DEFERRED_NORMAL); sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); - - sVertexProgram->bind(); + gPipeline.bindDeferredShader(*sVertexProgram); sVertexProgram->setMinimumAlpha(0.01f); } @@ -692,8 +707,9 @@ void LLDrawPoolAvatar::endDeferredImpostor() sVertexProgram->disableTexture(LLViewerShaderMgr::DEFERRED_NORMAL); sVertexProgram->disableTexture(LLViewerShaderMgr::SPECULAR_MAP); sVertexProgram->disableTexture(LLViewerShaderMgr::DIFFUSE_MAP); - sVertexProgram->unbind(); - gGL.getTexUnit(0)->activate(); + gPipeline.unbindDeferredShader(*sVertexProgram); + sVertexProgram = NULL; + sDiffuseChannel = 0; } void LLDrawPoolAvatar::beginDeferredRigid() @@ -701,7 +717,7 @@ void LLDrawPoolAvatar::beginDeferredRigid() sVertexProgram = &gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram; sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); sVertexProgram->bind(); - sVertexProgram->setMinimumAlpha(0.2f); + sVertexProgram->setMinimumAlpha(LLDrawPoolAvatar::sMinimumAlpha); } void LLDrawPoolAvatar::endDeferredRigid() @@ -759,7 +775,7 @@ void LLDrawPoolAvatar::beginSkinned() if (LLGLSLShader::sNoFixedFunction) { - sVertexProgram->setMinimumAlpha(0.2f); + sVertexProgram->setMinimumAlpha(LLDrawPoolAvatar::sMinimumAlpha); } } @@ -881,6 +897,8 @@ void LLDrawPoolAvatar::beginRiggedGlow() sVertexProgram->bind(); sVertexProgram->uniform1f(LLShaderMgr::TEXTURE_GAMMA, LLPipeline::sRenderDeferred ? 2.2f : 1.1f); + F32 gamma = gSavedSettings.getF32("RenderDeferredDisplayGamma"); + sVertexProgram->uniform1f(LLShaderMgr::DISPLAY_GAMMA, (gamma > 0.1f) ? 1.0f / gamma : (1.0f/2.2f)); } } @@ -933,6 +951,9 @@ void LLDrawPoolAvatar::beginRiggedFullbright() else { sVertexProgram->uniform1f(LLShaderMgr::TEXTURE_GAMMA, 2.2f); + + F32 gamma = gSavedSettings.getF32("RenderDeferredDisplayGamma"); + sVertexProgram->uniform1f(LLShaderMgr::DISPLAY_GAMMA, (gamma > 0.1f) ? 1.0f / gamma : (1.0f/2.2f)); } } } @@ -1034,6 +1055,8 @@ void LLDrawPoolAvatar::beginRiggedFullbrightShiny() else { sVertexProgram->uniform1f(LLShaderMgr::TEXTURE_GAMMA, 2.2f); + F32 gamma = gSavedSettings.getF32("RenderDeferredDisplayGamma"); + sVertexProgram->uniform1f(LLShaderMgr::DISPLAY_GAMMA, (gamma > 0.1f) ? 1.0f / gamma : (1.0f/2.2f)); } } } @@ -1093,6 +1116,12 @@ void LLDrawPoolAvatar::beginDeferredRiggedMaterial(S32 pass) return; } sVertexProgram = &gDeferredMaterialProgram[pass+LLMaterial::SHADER_COUNT]; + + if (LLPipeline::sUnderWaterRender) + { + sVertexProgram = &(gDeferredMaterialWaterProgram[pass+LLMaterial::SHADER_COUNT]); + } + sVertexProgram->bind(); normal_channel = sVertexProgram->enableTexture(LLViewerShaderMgr::BUMP_MAP); specular_channel = sVertexProgram->enableTexture(LLViewerShaderMgr::SPECULAR_MAP); @@ -1126,7 +1155,7 @@ void LLDrawPoolAvatar::beginDeferredSkinned() sRenderingSkinned = TRUE; sVertexProgram->bind(); - sVertexProgram->setMinimumAlpha(0.2f); + sVertexProgram->setMinimumAlpha(LLDrawPoolAvatar::sMinimumAlpha); sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); gGL.getTexUnit(0)->activate(); @@ -1434,6 +1463,65 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) } } +void LLDrawPoolAvatar::getRiggedGeometry(LLFace* face, LLPointer<LLVertexBuffer>& buffer, U32 data_mask, const LLMeshSkinInfo* skin, LLVolume* volume, const LLVolumeFace& vol_face) +{ + face->setGeomIndex(0); + face->setIndicesIndex(0); + + //rigged faces do not batch textures + face->setTextureIndex(255); + + if (buffer.isNull() || buffer->getTypeMask() != data_mask || !buffer->isWriteable()) + { //make a new buffer + if (sShaderLevel > 0) + { + buffer = new LLVertexBuffer(data_mask, GL_DYNAMIC_DRAW_ARB); + } + else + { + buffer = new LLVertexBuffer(data_mask, GL_STREAM_DRAW_ARB); + } + buffer->allocateBuffer(vol_face.mNumVertices, vol_face.mNumIndices, true); + } + else + { //resize existing buffer + buffer->resizeBuffer(vol_face.mNumVertices, vol_face.mNumIndices); + } + + face->setSize(vol_face.mNumVertices, vol_face.mNumIndices); + face->setVertexBuffer(buffer); + + U16 offset = 0; + + LLMatrix4 mat_vert = skin->mBindShapeMatrix; + glh::matrix4f m((F32*) mat_vert.mMatrix); + m = m.inverse().transpose(); + + F32 mat3[] = + { m.m[0], m.m[1], m.m[2], + m.m[4], m.m[5], m.m[6], + m.m[8], m.m[9], m.m[10] }; + + LLMatrix3 mat_normal(mat3); + + //let getGeometryVolume know if alpha should override shiny + U32 type = gPipeline.getPoolTypeFromTE(face->getTextureEntry(), face->getTexture()); + + if (type == LLDrawPool::POOL_ALPHA) + { + face->setPoolType(LLDrawPool::POOL_ALPHA); + } + else + { + face->setPoolType(LLDrawPool::POOL_AVATAR); + } + + //llinfos << "Rebuilt face " << face->getTEOffset() << " of " << face->getDrawable() << " at " << gFrameTimeSeconds << llendl; + face->getGeometryVolume(*volume, face->getTEOffset(), mat_vert, mat_normal, offset, true); + + buffer->flush(); +} + void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(LLVOAvatar* avatar, LLFace* face, const LLMeshSkinInfo* skin, LLVolume* volume, const LLVolumeFace& vol_face) { LLVector4a* weight = vol_face.mWeights; @@ -1453,60 +1541,27 @@ void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(LLVOAvatar* avatar, LLFace* buffer->getNumIndices() != vol_face.mNumIndices || (drawable && drawable->isState(LLDrawable::REBUILD_ALL))) { - face->setGeomIndex(0); - face->setIndicesIndex(0); - - //rigged faces do not batch textures - face->setTextureIndex(255); - - if (buffer.isNull() || buffer->getTypeMask() != data_mask || !buffer->isWriteable()) - { //make a new buffer - if (sShaderLevel > 0) + if (drawable && drawable->isState(LLDrawable::REBUILD_ALL)) + { //rebuild EVERY face in the drawable, not just this one, to avoid missing drawable wide rebuild issues + for (S32 i = 0; i < drawable->getNumFaces(); ++i) { - buffer = new LLVertexBuffer(data_mask, GL_DYNAMIC_DRAW_ARB); - } - else - { - buffer = new LLVertexBuffer(data_mask, GL_STREAM_DRAW_ARB); + LLFace* facep = drawable->getFace(i); + U32 face_data_mask = facep->getRiggedVertexBufferDataMask(); + if (face_data_mask) + { + LLPointer<LLVertexBuffer> cur_buffer = facep->getVertexBuffer(); + const LLVolumeFace& cur_vol_face = volume->getVolumeFace(i); + getRiggedGeometry(facep, cur_buffer, face_data_mask, skin, volume, cur_vol_face); + } } - buffer->allocateBuffer(vol_face.mNumVertices, vol_face.mNumIndices, true); - } - else - { //resize existing buffer - buffer->resizeBuffer(vol_face.mNumVertices, vol_face.mNumIndices); - } - - face->setSize(vol_face.mNumVertices, vol_face.mNumIndices); - face->setVertexBuffer(buffer); - - U16 offset = 0; - - LLMatrix4 mat_vert = skin->mBindShapeMatrix; - glh::matrix4f m((F32*) mat_vert.mMatrix); - m = m.inverse().transpose(); - - F32 mat3[] = - { m.m[0], m.m[1], m.m[2], - m.m[4], m.m[5], m.m[6], - m.m[8], m.m[9], m.m[10] }; - - LLMatrix3 mat_normal(mat3); + drawable->clearState(LLDrawable::REBUILD_ALL); - //let getGeometryVolume know if alpha should override shiny - U32 type = gPipeline.getPoolTypeFromTE(face->getTextureEntry(), face->getTexture()); - - if (type == LLDrawPool::POOL_ALPHA) - { - face->setPoolType(LLDrawPool::POOL_ALPHA); + buffer = face->getVertexBuffer(); } else - { - face->setPoolType(LLDrawPool::POOL_AVATAR); + { //just rebuild this face + getRiggedGeometry(face, buffer, data_mask, skin, volume, vol_face); } - - face->getGeometryVolume(*volume, face->getTEOffset(), mat_vert, mat_normal, offset, true); - - buffer->flush(); } if (sShaderLevel <= 0 && face->mLastSkinTime < avatar->getLastSkinTime()) @@ -1591,11 +1646,6 @@ void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(LLVOAvatar* avatar, LLFace* } } } - - if (drawable && (face->getTEOffset() == drawable->getNumFaces()-1)) - { - drawable->clearState(LLDrawable::REBUILD_ALL); - } } void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) @@ -1674,7 +1724,7 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) stop_glerror(); - LLDrawPoolAvatar::sVertexProgram->uniformMatrix4fv("matrixPalette", + LLDrawPoolAvatar::sVertexProgram->uniformMatrix4fv(LLViewerShaderMgr::AVATAR_MATRIX, count, FALSE, (GLfloat*) mat[0].mMatrix); @@ -1751,7 +1801,7 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) } } - if (face->mTextureMatrix) + if (face->mTextureMatrix && vobj->mTexAnimMode) { gGL.matrixMode(LLRender::MM_TEXTURE); gGL.loadMatrix((F32*) face->mTextureMatrix->mMatrix); @@ -1765,13 +1815,14 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) buff->setBuffer(data_mask); buff->drawRange(LLRender::TRIANGLES, start, end, count, offset); } + + gPipeline.addTrianglesDrawn(count, LLRender::TRIANGLES); } } } void LLDrawPoolAvatar::renderDeferredRiggedSimple(LLVOAvatar* avatar) { - updateRiggedVertexBuffers(avatar); renderRigged(avatar, RIGGED_DEFERRED_SIMPLE); } @@ -1840,7 +1891,6 @@ void LLDrawPoolAvatar::updateRiggedVertexBuffers(LLVOAvatar* avatar) void LLDrawPoolAvatar::renderRiggedSimple(LLVOAvatar* avatar) { - updateRiggedVertexBuffers(avatar); renderRigged(avatar, RIGGED_SIMPLE); } diff --git a/indra/newview/lldrawpoolavatar.h b/indra/newview/lldrawpoolavatar.h index 7d0368a945..b9d2204052 100755 --- a/indra/newview/lldrawpoolavatar.h +++ b/indra/newview/lldrawpoolavatar.h @@ -133,6 +133,7 @@ public: void endDeferredRiggedSimple(); void endDeferredRiggedBump(); + void getRiggedGeometry(LLFace* face, LLPointer<LLVertexBuffer>& buffer, U32 data_mask, const LLMeshSkinInfo* skin, LLVolume* volume, const LLVolumeFace& vol_face); void updateRiggedFaceVertexBuffer(LLVOAvatar* avatar, LLFace* facep, const LLMeshSkinInfo* skin, @@ -271,6 +272,7 @@ public: static BOOL sSkipOpaque; static BOOL sSkipTransparent; static S32 sDiffuseChannel; + static F32 sMinimumAlpha; static LLGLSLShader* sVertexProgram; }; diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp index 155e289c9d..6b4c5cfca1 100755 --- a/indra/newview/lldrawpoolbump.cpp +++ b/indra/newview/lldrawpoolbump.cpp @@ -461,6 +461,8 @@ void LLDrawPoolBump::unbindCubeMap(LLGLSLShader* shader, S32 shader_level, S32& } } } + // Moved below shader->disableTexture call to avoid false alarms from auto-re-enable of textures on stage 0 + // MAINT-755 cube_map->disable(); cube_map->restoreMatrix(); } @@ -1377,9 +1379,14 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI LLGLDisable blend(GL_BLEND); gGL.setColorMask(TRUE, TRUE); gNormalMapGenProgram.bind(); - gNormalMapGenProgram.uniform1f("norm_scale", gSavedSettings.getF32("RenderNormalMapScale")); - gNormalMapGenProgram.uniform1f("stepX", 1.f/bump->getWidth()); - gNormalMapGenProgram.uniform1f("stepY", 1.f/bump->getHeight()); + + static LLStaticHashedString sNormScale("norm_scale"); + static LLStaticHashedString sStepX("stepX"); + static LLStaticHashedString sStepY("stepY"); + + gNormalMapGenProgram.uniform1f(sNormScale, gSavedSettings.getF32("RenderNormalMapScale")); + gNormalMapGenProgram.uniform1f(sStepX, 1.f/bump->getWidth()); + gNormalMapGenProgram.uniform1f(sStepY, 1.f/bump->getHeight()); LLVector2 v((F32) bump->getWidth()/gPipeline.mScreen.getWidth(), (F32) bump->getHeight()/gPipeline.mScreen.getHeight()); diff --git a/indra/newview/lldrawpoolmaterials.cpp b/indra/newview/lldrawpoolmaterials.cpp index 08a36bddf1..d1b5080650 100644 --- a/indra/newview/lldrawpoolmaterials.cpp +++ b/indra/newview/lldrawpoolmaterials.cpp @@ -72,6 +72,12 @@ void LLDrawPoolMaterials::beginDeferredPass(S32 pass) }; mShader = &(gDeferredMaterialProgram[shader_idx[pass]]); + + if (LLPipeline::sUnderWaterRender) + { + mShader = &(gDeferredMaterialWaterProgram[shader_idx[pass]]); + } + mShader->bind(); diffuse_channel = mShader->enableTexture(LLShaderMgr::DIFFUSE_MAP); @@ -215,3 +221,4 @@ void LLDrawPoolMaterials::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture, gGL.matrixMode(LLRender::MM_MODELVIEW); } } + diff --git a/indra/newview/lldrawpoolsimple.cpp b/indra/newview/lldrawpoolsimple.cpp index 2cf9d833c6..8926f64c64 100755 --- a/indra/newview/lldrawpoolsimple.cpp +++ b/indra/newview/lldrawpoolsimple.cpp @@ -37,6 +37,7 @@ #include "llviewershadermgr.h" #include "llrender.h" +#define GE_FORCE_WORKAROUND LL_DARWIN static LLGLSLShader* simple_shader = NULL; static LLGLSLShader* fullbright_shader = NULL; @@ -111,7 +112,14 @@ void LLDrawPoolGlow::render(S32 pass) LLGLSLShader* shader = LLPipeline::sUnderWaterRender ? &gObjectEmissiveWaterProgram : &gObjectEmissiveProgram; shader->bind(); - shader->uniform1f(LLShaderMgr::TEXTURE_GAMMA, 1.f); + if (LLPipeline::sRenderDeferred) + { + shader->uniform1f(LLShaderMgr::TEXTURE_GAMMA, 2.2f); + } + else + { + shader->uniform1f(LLShaderMgr::TEXTURE_GAMMA, 1.f); + } LLGLDepthTest depth(GL_TRUE, GL_FALSE); gGL.setColorMask(false, true); @@ -148,7 +156,11 @@ void LLDrawPoolSimple::beginRenderPass(S32 pass) { LLFastTimer t(FTM_RENDER_SIMPLE); - if (LLPipeline::sUnderWaterRender) + if (LLPipeline::sImpostorRender) + { + simple_shader = &gObjectSimpleImpostorProgram; + } + else if (LLPipeline::sUnderWaterRender) { simple_shader = &gObjectSimpleWaterProgram; } @@ -536,7 +548,15 @@ void LLDrawPoolFullbright::prerender() void LLDrawPoolFullbright::beginPostDeferredPass(S32 pass) { - gDeferredFullbrightProgram.bind(); + if (LLPipeline::sUnderWaterRender) + { + gDeferredFullbrightWaterProgram.bind(); + } + else + { + gDeferredFullbrightProgram.bind(); + } + } void LLDrawPoolFullbright::renderPostDeferred(S32 pass) @@ -550,7 +570,14 @@ void LLDrawPoolFullbright::renderPostDeferred(S32 pass) void LLDrawPoolFullbright::endPostDeferredPass(S32 pass) { - gDeferredFullbrightProgram.unbind(); + if (LLPipeline::sUnderWaterRender) + { + gDeferredFullbrightWaterProgram.unbind(); + } + else + { + gDeferredFullbrightProgram.unbind(); + } LLRenderPass::endRenderPass(pass); } @@ -625,15 +652,35 @@ S32 LLDrawPoolFullbright::getNumPasses() void LLDrawPoolFullbrightAlphaMask::beginPostDeferredPass(S32 pass) { - gObjectFullbrightAlphaMaskProgram.bind(); + if (LLPipeline::sRenderingHUDs || !LLPipeline::sRenderDeferred) { + gObjectFullbrightAlphaMaskProgram.bind(); gObjectFullbrightAlphaMaskProgram.uniform1f(LLShaderMgr::TEXTURE_GAMMA, 1.0f); } else - { + { + +// Work-around until we can figure out why the right shader causes +// the GeForce driver to go tango uniform on OS X 10.6.8 only +// +#if GE_FORCE_WORKAROUND + gObjectFullbrightAlphaMaskProgram.bind(); gObjectFullbrightAlphaMaskProgram.uniform1f(LLShaderMgr::TEXTURE_GAMMA, 2.2f); +#else + if (LLPipeline::sUnderWaterRender) + { + gDeferredFullbrightAlphaMaskWaterProgram.bind(); + gDeferredFullbrightAlphaMaskWaterProgram.uniform1f(LLShaderMgr::TEXTURE_GAMMA, 2.2f); + } + else + { + gDeferredFullbrightAlphaMaskProgram.bind(); + gDeferredFullbrightAlphaMaskProgram.uniform1f(LLShaderMgr::TEXTURE_GAMMA, 2.2f); + } +#endif } + } void LLDrawPoolFullbrightAlphaMask::renderPostDeferred(S32 pass) @@ -646,7 +693,30 @@ void LLDrawPoolFullbrightAlphaMask::renderPostDeferred(S32 pass) void LLDrawPoolFullbrightAlphaMask::endPostDeferredPass(S32 pass) { - gObjectFullbrightAlphaMaskProgram.unbind(); + if (LLPipeline::sRenderingHUDs || !LLPipeline::sRenderDeferred) + { + gObjectFullbrightAlphaMaskProgram.unbind(); + } + else + { + +// Work-around until we can figure out why the right shader causes +// the GeForce driver to go tango uniform on OS X 10.6.8 only +// +#if GE_FORCE_WORKAROUND + gObjectFullbrightAlphaMaskProgram.unbind(); +#else + if (LLPipeline::sUnderWaterRender) + { + gDeferredFullbrightAlphaMaskWaterProgram.unbind(); + } + else + { + gDeferredFullbrightAlphaMaskProgram.unbind(); + } +#endif + + } LLRenderPass::endRenderPass(pass); } diff --git a/indra/newview/lldrawpoolsky.cpp b/indra/newview/lldrawpoolsky.cpp index 7f7d9f65c6..ef8bdc3304 100755 --- a/indra/newview/lldrawpoolsky.cpp +++ b/indra/newview/lldrawpoolsky.cpp @@ -155,3 +155,4 @@ void LLDrawPoolSky::renderSkyCubeFace(U8 side) void LLDrawPoolSky::endRenderPass( S32 pass ) { } + diff --git a/indra/newview/lldrawpoolterrain.cpp b/indra/newview/lldrawpoolterrain.cpp index 0adb42428d..c3ec234223 100755 --- a/indra/newview/lldrawpoolterrain.cpp +++ b/indra/newview/lldrawpoolterrain.cpp @@ -354,8 +354,8 @@ void LLDrawPoolTerrain::renderFullShader() LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr; llassert(shader); - shader->uniform4fv("object_plane_s", 1, tp0.mV); - shader->uniform4fv("object_plane_t", 1, tp1.mV); + shader->uniform4fv(LLShaderMgr::OBJECT_PLANE_S, 1, tp0.mV); + shader->uniform4fv(LLShaderMgr::OBJECT_PLANE_T, 1, tp1.mV); gGL.matrixMode(LLRender::MM_TEXTURE); gGL.loadIdentity(); @@ -864,8 +864,8 @@ void LLDrawPoolTerrain::renderSimple() if (LLGLSLShader::sNoFixedFunction) { - sShader->uniform4fv("object_plane_s", 1, tp0.mV); - sShader->uniform4fv("object_plane_t", 1, tp1.mV); + sShader->uniform4fv(LLShaderMgr::OBJECT_PLANE_S, 1, tp0.mV); + sShader->uniform4fv(LLShaderMgr::OBJECT_PLANE_T, 1, tp1.mV); } else { diff --git a/indra/newview/lldrawpoolwater.cpp b/indra/newview/lldrawpoolwater.cpp index 5ddc15df42..76e89b26e4 100755 --- a/indra/newview/lldrawpoolwater.cpp +++ b/indra/newview/lldrawpoolwater.cpp @@ -407,8 +407,8 @@ void LLDrawPoolWater::renderOpaqueLegacyWater() } else { - shader->uniform4fv("object_plane_s", 1, tp0); - shader->uniform4fv("object_plane_t", 1, tp1); + shader->uniform4fv(LLShaderMgr::OBJECT_PLANE_S, 1, tp0); + shader->uniform4fv(LLShaderMgr::OBJECT_PLANE_T, 1, tp1); } gGL.diffuseColor3f(1.f, 1.f, 1.f); @@ -522,14 +522,21 @@ void LLDrawPoolWater::shade() F32 eyedepth = LLViewerCamera::getInstance()->getOrigin().mV[2] - gAgent.getRegion()->getWaterHeight(); + if (eyedepth < 0.f && LLPipeline::sWaterReflections) + { if (deferred_render) { - shader = &gDeferredWaterProgram; + shader = &gDeferredUnderWaterProgram; } - else if (eyedepth < 0.f && LLPipeline::sWaterReflections) + else { shader = &gUnderWaterProgram; } + } + else if (deferred_render) + { + shader = &gDeferredWaterProgram; + } else { shader = &gWaterProgram; @@ -546,7 +553,7 @@ void LLDrawPoolWater::shade() sTime = (F32)LLFrameTimer::getElapsedSeconds()*0.5f; - S32 reftex = shader->enableTexture(LLViewerShaderMgr::WATER_REFTEX); + S32 reftex = shader->enableTexture(LLShaderMgr::WATER_REFTEX); if (reftex > -1) { @@ -577,12 +584,12 @@ void LLDrawPoolWater::shade() mWaterNormp->setFilteringOption(LLTexUnit::TFO_POINT); } - S32 screentex = shader->enableTexture(LLViewerShaderMgr::WATER_SCREENTEX); + S32 screentex = shader->enableTexture(LLShaderMgr::WATER_SCREENTEX); if (screentex > -1) { - shader->uniform4fv(LLViewerShaderMgr::WATER_FOGCOLOR, 1, sWaterFogColor.mV); - shader->uniform1f(LLViewerShaderMgr::WATER_FOGDENSITY, + shader->uniform4fv(LLShaderMgr::WATER_FOGCOLOR, 1, sWaterFogColor.mV); + shader->uniform1f(LLShaderMgr::WATER_FOGDENSITY, param_mgr->getFogDensity()); gPipeline.mWaterDis.bindTexture(0, screentex); } @@ -594,7 +601,7 @@ void LLDrawPoolWater::shade() if (mVertexShaderLevel == 1) { sWaterFogColor.mV[3] = param_mgr->mDensitySliderValue; - shader->uniform4fv(LLViewerShaderMgr::WATER_FOGCOLOR, 1, sWaterFogColor.mV); + shader->uniform4fv(LLShaderMgr::WATER_FOGCOLOR, 1, sWaterFogColor.mV); } F32 screenRes[] = @@ -602,10 +609,10 @@ void LLDrawPoolWater::shade() 1.f/gGLViewport[2], 1.f/gGLViewport[3] }; - shader->uniform2fv("screenRes", 1, screenRes); + shader->uniform2fv(LLShaderMgr::DEFERRED_SCREEN_RES, 1, screenRes); stop_glerror(); - S32 diffTex = shader->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); + S32 diffTex = shader->enableTexture(LLShaderMgr::DIFFUSE_MAP); stop_glerror(); light_dir.normVec(); @@ -614,26 +621,26 @@ void LLDrawPoolWater::shade() light_diffuse *= 6.f; //shader->uniformMatrix4fv("inverse_ref", 1, GL_FALSE, (GLfloat*) gGLObliqueProjectionInverse.mMatrix); - shader->uniform1f(LLViewerShaderMgr::WATER_WATERHEIGHT, eyedepth); - shader->uniform1f(LLViewerShaderMgr::WATER_TIME, sTime); - shader->uniform3fv(LLViewerShaderMgr::WATER_EYEVEC, 1, LLViewerCamera::getInstance()->getOrigin().mV); - shader->uniform3fv(LLViewerShaderMgr::WATER_SPECULAR, 1, light_diffuse.mV); - shader->uniform1f(LLViewerShaderMgr::WATER_SPECULAR_EXP, light_exp); - shader->uniform2fv(LLViewerShaderMgr::WATER_WAVE_DIR1, 1, param_mgr->getWave1Dir().mV); - shader->uniform2fv(LLViewerShaderMgr::WATER_WAVE_DIR2, 1, param_mgr->getWave2Dir().mV); - shader->uniform3fv(LLViewerShaderMgr::WATER_LIGHT_DIR, 1, light_dir.mV); - - shader->uniform3fv("normScale", 1, param_mgr->getNormalScale().mV); - shader->uniform1f("fresnelScale", param_mgr->getFresnelScale()); - shader->uniform1f("fresnelOffset", param_mgr->getFresnelOffset()); - shader->uniform1f("blurMultiplier", param_mgr->getBlurMultiplier()); + shader->uniform1f(LLShaderMgr::WATER_WATERHEIGHT, eyedepth); + shader->uniform1f(LLShaderMgr::WATER_TIME, sTime); + shader->uniform3fv(LLShaderMgr::WATER_EYEVEC, 1, LLViewerCamera::getInstance()->getOrigin().mV); + shader->uniform3fv(LLShaderMgr::WATER_SPECULAR, 1, light_diffuse.mV); + shader->uniform1f(LLShaderMgr::WATER_SPECULAR_EXP, light_exp); + shader->uniform2fv(LLShaderMgr::WATER_WAVE_DIR1, 1, param_mgr->getWave1Dir().mV); + shader->uniform2fv(LLShaderMgr::WATER_WAVE_DIR2, 1, param_mgr->getWave2Dir().mV); + shader->uniform3fv(LLShaderMgr::WATER_LIGHT_DIR, 1, light_dir.mV); + + shader->uniform3fv(LLShaderMgr::WATER_NORM_SCALE, 1, param_mgr->getNormalScale().mV); + shader->uniform1f(LLShaderMgr::WATER_FRESNEL_SCALE, param_mgr->getFresnelScale()); + shader->uniform1f(LLShaderMgr::WATER_FRESNEL_OFFSET, param_mgr->getFresnelOffset()); + shader->uniform1f(LLShaderMgr::WATER_BLUR_MULTIPLIER, param_mgr->getBlurMultiplier()); F32 sunAngle = llmax(0.f, light_dir.mV[2]); F32 scaledAngle = 1.f - sunAngle; - shader->uniform1f("sunAngle", sunAngle); - shader->uniform1f("scaledAngle", scaledAngle); - shader->uniform1f("sunAngle2", 0.1f + 0.2f*sunAngle); + shader->uniform1f(LLShaderMgr::WATER_SUN_ANGLE, sunAngle); + shader->uniform1f(LLShaderMgr::WATER_SCALED_ANGLE, scaledAngle); + shader->uniform1f(LLShaderMgr::WATER_SUN_ANGLE2, 0.1f + 0.2f*sunAngle); LLColor4 water_color; LLVector3 camera_up = LLViewerCamera::getInstance()->getUpAxis(); @@ -641,12 +648,12 @@ void LLDrawPoolWater::shade() if (LLViewerCamera::getInstance()->cameraUnderWater()) { water_color.setVec(1.f, 1.f, 1.f, 0.4f); - shader->uniform1f(LLViewerShaderMgr::WATER_REFSCALE, param_mgr->getScaleBelow()); + shader->uniform1f(LLShaderMgr::WATER_REFSCALE, param_mgr->getScaleBelow()); } else { water_color.setVec(1.f, 1.f, 1.f, 0.5f*(1.f + up_dot)); - shader->uniform1f(LLViewerShaderMgr::WATER_REFSCALE, param_mgr->getScaleAbove()); + shader->uniform1f(LLShaderMgr::WATER_REFSCALE, param_mgr->getScaleAbove()); } if (water_color.mV[3] > 0.9f) @@ -689,12 +696,12 @@ void LLDrawPoolWater::shade() } } - shader->disableTexture(LLViewerShaderMgr::ENVIRONMENT_MAP, LLTexUnit::TT_CUBE_MAP); - shader->disableTexture(LLViewerShaderMgr::WATER_SCREENTEX); - shader->disableTexture(LLViewerShaderMgr::BUMP_MAP); - shader->disableTexture(LLViewerShaderMgr::DIFFUSE_MAP); - shader->disableTexture(LLViewerShaderMgr::WATER_REFTEX); - shader->disableTexture(LLViewerShaderMgr::WATER_SCREENDEPTH); + shader->disableTexture(LLShaderMgr::ENVIRONMENT_MAP, LLTexUnit::TT_CUBE_MAP); + shader->disableTexture(LLShaderMgr::WATER_SCREENTEX); + shader->disableTexture(LLShaderMgr::BUMP_MAP); + shader->disableTexture(LLShaderMgr::DIFFUSE_MAP); + shader->disableTexture(LLShaderMgr::WATER_REFTEX); + shader->disableTexture(LLShaderMgr::WATER_SCREENDEPTH); if (deferred_render) { diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp index b5faff7968..a98d3e6b05 100755 --- a/indra/newview/lldrawpoolwlsky.cpp +++ b/indra/newview/lldrawpoolwlsky.cpp @@ -152,7 +152,8 @@ void LLDrawPoolWLSky::renderDome(F32 camHeightLocal, LLGLSLShader * shader) cons gGL.translatef(0.f,-camHeightLocal, 0.f); // Draw WL Sky - shader->uniform3f("camPosLocal", 0.f, camHeightLocal, 0.f); + static LLStaticHashedString sCamPosLocal("camPosLocal"); + shader->uniform3f(sCamPosLocal, 0.f, camHeightLocal, 0.f); gSky.mVOWLSkyp->drawDome(); @@ -207,7 +208,8 @@ void LLDrawPoolWLSky::renderStars(void) const if (LLGLSLShader::sNoFixedFunction) { gCustomAlphaProgram.bind(); - gCustomAlphaProgram.uniform1f("custom_alpha", star_alpha.mV[3]); + static LLStaticHashedString sCustomAlpha("custom_alpha"); + gCustomAlphaProgram.uniform1f(sCustomAlpha, star_alpha.mV[3]); } else { @@ -420,3 +422,4 @@ void LLDrawPoolWLSky::restoreGL() sCloudNoiseTexture = LLViewerTextureManager::getLocalTexture(sCloudNoiseRawImage.get(), TRUE); } } + diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index f021f4ed0f..369273bca6 100755 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -52,9 +52,20 @@ #include "llviewerwindow.h" #include "llviewershadermgr.h" #include "llviewertexture.h" +#include "llvoavatar.h" +#if LL_LINUX +// Work-around spurious used before init warning on Vector4a +// +#pragma GCC diagnostic ignored "-Wuninitialized" +#endif + +extern BOOL gGLDebugLoggingEnabled; #define LL_MAX_INDICES_COUNT 1000000 +static LLStaticHashedString sTextureIndexIn("texture_index_in"); +static LLStaticHashedString sColorIn("color_in"); + BOOL LLFace::sSafeRenderSelect = TRUE; // FALSE #define DOTVEC(a,b) (a.mV[0]*b.mV[0] + a.mV[1]*b.mV[1] + a.mV[2]*b.mV[2]) @@ -318,6 +329,12 @@ void LLFace::dirtyTexture() if (vobj) { vobj->mLODChanged = TRUE; + + LLVOAvatar* avatar = vobj->getAvatar(); + if (avatar) + { //avatar render cost may have changed + avatar->updateVisualComplexity(); + } } gPipeline.markRebuild(drawablep, LLDrawable::REBUILD_VOLUME, FALSE); } @@ -768,7 +785,7 @@ bool less_than_max_mag(const LLVector4a& vec) } BOOL LLFace::genVolumeBBoxes(const LLVolume &volume, S32 f, - const LLMatrix4& mat_vert_in, const LLMatrix3& mat_normal_in, BOOL global_volume) + const LLMatrix4& mat_vert_in, BOOL global_volume) { //get bounding box if (mDrawablep->isState(LLDrawable::REBUILD_VOLUME | LLDrawable::REBUILD_POSITION | LLDrawable::REBUILD_RIGGED)) @@ -777,10 +794,6 @@ BOOL LLFace::genVolumeBBoxes(const LLVolume &volume, S32 f, LLMatrix4a mat_vert; mat_vert.loadu(mat_vert_in); - LLMatrix4a mat_normal; - mat_normal.loadu(mat_normal_in); - - //VECTORIZE THIS LLVector4a min,max; if (f >= volume.getNumVolumeFaces()) @@ -797,100 +810,68 @@ BOOL LLFace::genVolumeBBoxes(const LLVolume &volume, S32 f, llassert(less_than_max_mag(max)); //min, max are in volume space, convert to drawable render space - LLVector4a center; - LLVector4a t; - t.setAdd(min, max); - t.mul(0.5f); - mat_vert.affineTransform(t, center); - LLVector4a size; - size.setSub(max, min); - size.mul(0.5f); - llassert(less_than_max_mag(min)); - llassert(less_than_max_mag(max)); + //get 8 corners of bounding box + LLVector4Logical mask[6]; - if (!global_volume) + for (U32 i = 0; i < 6; ++i) { - //VECTORIZE THIS - LLVector4a scale; - scale.load3(mDrawablep->getVObj()->getScale().mV); - size.mul(scale); + mask[i].clear(); } - // Catch potential badness from normalization before it happens - // - llassert(mat_normal.mMatrix[0].isFinite3() && (mat_normal.mMatrix[0].dot3(mat_normal.mMatrix[0]).getF32() > F_APPROXIMATELY_ZERO)); - llassert(mat_normal.mMatrix[1].isFinite3() && (mat_normal.mMatrix[1].dot3(mat_normal.mMatrix[1]).getF32() > F_APPROXIMATELY_ZERO)); - llassert(mat_normal.mMatrix[2].isFinite3() && (mat_normal.mMatrix[2].dot3(mat_normal.mMatrix[2]).getF32() > F_APPROXIMATELY_ZERO)); - - mat_normal.mMatrix[0].normalize3fast(); - mat_normal.mMatrix[1].normalize3fast(); - mat_normal.mMatrix[2].normalize3fast(); + mask[0].setElement<2>(); //001 + mask[1].setElement<1>(); //010 + mask[2].setElement<1>(); //011 + mask[2].setElement<2>(); + mask[3].setElement<0>(); //100 + mask[4].setElement<0>(); //101 + mask[4].setElement<2>(); + mask[5].setElement<0>(); //110 + mask[5].setElement<1>(); - LLVector4a v[4]; + LLVector4a v[8]; - //get 4 corners of bounding box - mat_normal.rotate(size,v[0]); + v[6] = min; + v[7] = max; - //VECTORIZE THIS - LLVector4a scale; - - scale.set(-1.f, -1.f, 1.f); - scale.mul(size); - mat_normal.rotate(scale, v[1]); - - scale.set(1.f, -1.f, -1.f); - scale.mul(size); - mat_normal.rotate(scale, v[2]); - - scale.set(-1.f, 1.f, -1.f); - scale.mul(size); - mat_normal.rotate(scale, v[3]); + for (U32 i = 0; i < 6; ++i) + { + v[i].setSelectWithMask(mask[i], min, max); + } + LLVector4a tv[8]; + + //transform bounding box into drawable space + for (U32 i = 0; i < 8; ++i) + { + mat_vert.affineTransform(v[i], tv[i]); + } + + //find bounding box LLVector4a& newMin = mExtents[0]; LLVector4a& newMax = mExtents[1]; - - newMin = newMax = center; - - llassert(less_than_max_mag(center)); - - for (U32 i = 0; i < 4; i++) - { - LLVector4a delta; - delta.setAbs(v[i]); - LLVector4a min; - min.setSub(center, delta); - LLVector4a max; - max.setAdd(center, delta); - newMin.setMin(newMin,min); - newMax.setMax(newMax,max); + newMin = newMax = tv[0]; - llassert(less_than_max_mag(newMin)); - llassert(less_than_max_mag(newMax)); + for (U32 i = 1; i < 8; ++i) + { + newMin.setMin(newMin, tv[i]); + newMax.setMax(newMax, tv[i]); } if (!mDrawablep->isActive()) - { + { // Shift position for region LLVector4a offset; offset.load3(mDrawablep->getRegion()->getOriginAgent().mV); newMin.add(offset); newMax.add(offset); - - llassert(less_than_max_mag(newMin)); - llassert(less_than_max_mag(newMax)); } - t.setAdd(newMin, newMax); + LLVector4a t; + t.setAdd(newMin,newMax); t.mul(0.5f); - llassert(less_than_max_mag(t)); - - //VECTORIZE THIS mCenterLocal.set(t.getF32ptr()); - - llassert(less_than_max_mag(newMin)); - llassert(less_than_max_mag(newMax)); t.setSub(newMax,newMin); mBoundingSphereRadius = t.getLength3().getF32()*0.5f; @@ -1175,6 +1156,15 @@ static LLFastTimer::DeclareTimer FTM_FACE_GEOM_COLOR("Color"); static LLFastTimer::DeclareTimer FTM_FACE_GEOM_EMISSIVE("Emissive"); static LLFastTimer::DeclareTimer FTM_FACE_GEOM_WEIGHTS("Weights"); static LLFastTimer::DeclareTimer FTM_FACE_GEOM_TANGENT("Binormal"); + +static LLFastTimer::DeclareTimer FTM_FACE_GEOM_FEEDBACK("Face Feedback"); +static LLFastTimer::DeclareTimer FTM_FACE_GEOM_FEEDBACK_POSITION("Feedback Position"); +static LLFastTimer::DeclareTimer FTM_FACE_GEOM_FEEDBACK_NORMAL("Feedback Normal"); +static LLFastTimer::DeclareTimer FTM_FACE_GEOM_FEEDBACK_TEXTURE("Feedback Texture"); +static LLFastTimer::DeclareTimer FTM_FACE_GEOM_FEEDBACK_COLOR("Feedback Color"); +static LLFastTimer::DeclareTimer FTM_FACE_GEOM_FEEDBACK_EMISSIVE("Feedback Emissive"); +static LLFastTimer::DeclareTimer FTM_FACE_GEOM_FEEDBACK_BINORMAL("Feedback Binormal"); + static LLFastTimer::DeclareTimer FTM_FACE_GEOM_INDEX("Index"); static LLFastTimer::DeclareTimer FTM_FACE_GEOM_INDEX_TAIL("Tail"); static LLFastTimer::DeclareTimer FTM_FACE_POSITION_STORE("Pos"); @@ -1400,12 +1390,15 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, #ifdef GL_TRANSFORM_FEEDBACK_BUFFER if (use_transform_feedback && + mVertexBuffer->getUsage() == GL_DYNAMIC_COPY_ARB && gTransformPositionProgram.mProgramObject && //transform shaders are loaded mVertexBuffer->useVBOs() && //target buffer is in VRAM !rebuild_weights && //TODO: add support for weights !volume.isUnique()) //source volume is NOT flexi { //use transform feedback to pack vertex buffer - + //gGLDebugLoggingEnabled = TRUE; + LLFastTimer t(FTM_FACE_GEOM_FEEDBACK); + LLGLEnable discard(GL_RASTERIZER_DISCARD); LLVertexBuffer* buff = (LLVertexBuffer*) vf.mVertexBuffer.get(); if (vf.mVertexBuffer.isNull() || buff->getNumVerts() != vf.mNumVertices) @@ -1422,7 +1415,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, if (rebuild_pos) { - LLFastTimer t(FTM_FACE_GEOM_POSITION); + LLFastTimer t(FTM_FACE_GEOM_FEEDBACK_POSITION); gTransformPositionProgram.bind(); mVertexBuffer->bindForFeedback(0, LLVertexBuffer::TYPE_VERTEX, mGeomIndex, mGeomCount); @@ -1436,7 +1429,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, vp[2] = 0; vp[3] = 0; - gTransformPositionProgram.uniform1i("texture_index_in", val); + gTransformPositionProgram.uniform1i(sTextureIndexIn, val); glBeginTransformFeedback(GL_POINTS); buff->setBuffer(LLVertexBuffer::MAP_VERTEX); @@ -1447,14 +1440,14 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, if (rebuild_color) { - LLFastTimer t(FTM_FACE_GEOM_COLOR); + LLFastTimer t(FTM_FACE_GEOM_FEEDBACK_COLOR); gTransformColorProgram.bind(); mVertexBuffer->bindForFeedback(0, LLVertexBuffer::TYPE_COLOR, mGeomIndex, mGeomCount); S32 val = *((S32*) color.mV); - gTransformColorProgram.uniform1i("color_in", val); + gTransformColorProgram.uniform1i(sColorIn, val); glBeginTransformFeedback(GL_POINTS); buff->setBuffer(LLVertexBuffer::MAP_VERTEX); push_for_transform(buff, vf.mNumVertices, mGeomCount); @@ -1463,7 +1456,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, if (rebuild_emissive) { - LLFastTimer t(FTM_FACE_GEOM_EMISSIVE); + LLFastTimer t(FTM_FACE_GEOM_FEEDBACK_EMISSIVE); gTransformColorProgram.bind(); mVertexBuffer->bindForFeedback(0, LLVertexBuffer::TYPE_EMISSIVE, mGeomIndex, mGeomCount); @@ -1475,7 +1468,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, (glow << 16) | (glow << 24); - gTransformColorProgram.uniform1i("color_in", glow32); + gTransformColorProgram.uniform1i(sColorIn, glow32); glBeginTransformFeedback(GL_POINTS); buff->setBuffer(LLVertexBuffer::MAP_VERTEX); push_for_transform(buff, vf.mNumVertices, mGeomCount); @@ -1484,7 +1477,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, if (rebuild_normal) { - LLFastTimer t(FTM_FACE_GEOM_NORMAL); + LLFastTimer t(FTM_FACE_GEOM_FEEDBACK_NORMAL); gTransformNormalProgram.bind(); mVertexBuffer->bindForFeedback(0, LLVertexBuffer::TYPE_NORMAL, mGeomIndex, mGeomCount); @@ -1510,7 +1503,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, if (rebuild_tcoord) { - LLFastTimer t(FTM_FACE_GEOM_TEXTURE); + LLFastTimer t(FTM_FACE_GEOM_FEEDBACK_TEXTURE); gTransformTexCoordProgram.bind(); mVertexBuffer->bindForFeedback(0, LLVertexBuffer::TYPE_TEXCOORD0, mGeomIndex, mGeomCount); @@ -1933,20 +1926,31 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, if (rebuild_pos) { - LLFastTimer t(FTM_FACE_GEOM_POSITION); + LLVector4a* src = vf.mPositions; + + //_mm_prefetch((char*)src, _MM_HINT_T0); + + LLVector4a* end = src+num_vertices; + //LLVector4a* end_64 = end-4; + + //LLFastTimer t(FTM_FACE_GEOM_POSITION); llassert(num_vertices > 0); mVertexBuffer->getVertexStrider(vert, mGeomIndex, mGeomCount, map_range); - LLMatrix4a mat_vert; mat_vert.loadu(mat_vert_in); - LLVector4a* src = vf.mPositions; - volatile F32* dst = (volatile F32*) vert.get(); + F32* dst = (F32*) vert.get(); + F32* end_f32 = dst+mGeomCount*4; + + //_mm_prefetch((char*)dst, _MM_HINT_NTA); + //_mm_prefetch((char*)src, _MM_HINT_NTA); + + //_mm_prefetch((char*)dst, _MM_HINT_NTA); - volatile F32* end = dst+num_vertices*4; - LLVector4a res; + + LLVector4a res0; //,res1,res2,res3; LLVector4a texIdx; @@ -1964,29 +1968,53 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, texIdx.set(0,0,0,val); + LLVector4a tmp; + { - LLFastTimer t(FTM_FACE_POSITION_STORE); - LLVector4a tmp; + //LLFastTimer t2(FTM_FACE_POSITION_STORE); + + /*if (num_vertices > 4) + { //more than 64 bytes + while (src < end_64) + { + _mm_prefetch((char*)src + 64, _MM_HINT_T0); + _mm_prefetch((char*)dst + 64, _MM_HINT_T0); + + mat_vert.affineTransform(*src, res0); + tmp.setSelectWithMask(mask, texIdx, res0); + tmp.store4a((F32*) dst); + + mat_vert.affineTransform(*(src+1), res1); + tmp.setSelectWithMask(mask, texIdx, res1); + tmp.store4a((F32*) dst+4); - do + mat_vert.affineTransform(*(src+2), res2); + tmp.setSelectWithMask(mask, texIdx, res2); + tmp.store4a((F32*) dst+8); + + mat_vert.affineTransform(*(src+3), res3); + tmp.setSelectWithMask(mask, texIdx, res3); + tmp.store4a((F32*) dst+12); + + dst += 16; + src += 4; + } + }*/ + + while (src < end) { - mat_vert.affineTransform(*src++, res); - tmp.setSelectWithMask(mask, texIdx, res); + mat_vert.affineTransform(*src++, res0); + tmp.setSelectWithMask(mask, texIdx, res0); tmp.store4a((F32*) dst); dst += 4; } - while(dst < end); } { - LLFastTimer t(FTM_FACE_POSITION_PAD); - S32 aligned_pad_vertices = mGeomCount - num_vertices; - res.set(res[0], res[1], res[2], 0.f); - - while (aligned_pad_vertices > 0) + //LLFastTimer t(FTM_FACE_POSITION_PAD); + while (dst < end_f32) { - --aligned_pad_vertices; - res.store4a((F32*) dst); + res0.store4a((F32*) dst); dst += 4; } } @@ -2000,14 +2028,16 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, if (rebuild_normal) { - LLFastTimer t(FTM_FACE_GEOM_NORMAL); + //LLFastTimer t(FTM_FACE_GEOM_NORMAL); mVertexBuffer->getNormalStrider(norm, mGeomIndex, mGeomCount, map_range); F32* normals = (F32*) norm.get(); - for (S32 i = 0; i < num_vertices; i++) + LLVector4a* src = vf.mNormals; + LLVector4a* end = src+num_vertices; + + while (src < end) { LLVector4a normal; - mat_normal.rotate(vf.mNormals[i], normal); - normal.normalize3fast(); + mat_normal.rotate(*src++, normal); normal.store4a(normals); normals += 4; } @@ -2030,14 +2060,18 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, mask.clear(); mask.setElement<3>(); - for (S32 i = 0; i < num_vertices; i++) + LLVector4a* src = vf.mTangents; + LLVector4a* end = vf.mTangents+num_vertices; + + while (src < end) { LLVector4a tangent_out; - mat_normal.rotate(vf.mTangents[i], tangent_out); + mat_normal.rotate(*src, tangent_out); tangent_out.normalize3fast(); - tangent_out.setSelectWithMask(mask, vf.mTangents[i], tangent_out); + tangent_out.setSelectWithMask(mask, *src, tangent_out); tangent_out.store4a(tangents); + src++; tangents += 4; } diff --git a/indra/newview/llface.h b/indra/newview/llface.h index 0687544d53..66b5f13740 100755 --- a/indra/newview/llface.h +++ b/indra/newview/llface.h @@ -194,8 +194,7 @@ public: void setSize(S32 numVertices, S32 num_indices = 0, bool align = false); - BOOL genVolumeBBoxes(const LLVolume &volume, S32 f, - const LLMatrix4& mat, const LLMatrix3& inv_trans_mat, BOOL global_volume = FALSE); + BOOL genVolumeBBoxes(const LLVolume &volume, S32 f,const LLMatrix4& mat, BOOL global_volume = FALSE); void init(LLDrawable* drawablep, LLViewerObject* objp); void destroy(); diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index fbf72b1a85..8e1a1df211 100755 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -345,7 +345,7 @@ BOOL LLFastTimerView::handleScrollWheel(S32 x, S32 y, S32 clicks) return TRUE; } -static LLFastTimer::DeclareTimer FTM_RENDER_TIMER("Timers", true); +static LLFastTimer::DeclareTimer FTM_RENDER_TIMER("Timers"); static std::map<LLFastTimer::NamedTimer*, LLColor4> sTimerColors; diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index 6d90667194..a2d0759587 100755 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -400,6 +400,8 @@ LLFavoritesBarCtrl::LLFavoritesBarCtrl(const LLFavoritesBarCtrl::Params& p) mMoreTextBox->setClickedCallback(boost::bind(&LLFavoritesBarCtrl::showDropDownMenu, this)); addChild(mMoreTextBox); + mDropDownItemsCount = 0; + LLTextBox::Params label_param(p.label); mBarLabel = LLUICtrlFactory::create<LLTextBox> (label_param); addChild(mBarLabel); @@ -550,6 +552,10 @@ void LLFavoritesBarCtrl::handleNewFavoriteDragAndDrop(LLInventoryItem *item, con bool insert_before = true; if (!mItems.empty()) { + // [MAINT-2386] When multiple landmarks are selected and dragged onto an empty favorites bar, + // the viewer would crash when casting mLastTab below, as mLastTab is still null when the + // second landmark is being added. + // To ensure mLastTab is valid, we need to call updateButtons() at the end of this function dest = dynamic_cast<LLFavoriteLandmarkButton*>(mLandingTab); if (!dest) { @@ -621,6 +627,11 @@ void LLFavoritesBarCtrl::handleNewFavoriteDragAndDrop(LLInventoryItem *item, con cb); } + // [MAINT-2386] Ensure the favorite button has been created and is valid. + // This also ensures that mLastTab will be valid when dropping multiple + // landmarks to an empty favorites bar. + updateButtons(); + llinfos << "Copied inventory item #" << item->getUUID() << " to favorites." << llendl; } @@ -820,11 +831,13 @@ void LLFavoritesBarCtrl::updateButtons() } // Update overflow menu LLToggleableMenu* overflow_menu = static_cast <LLToggleableMenu*> (mOverflowMenuHandle.get()); - if (overflow_menu && overflow_menu->getVisible()) + if (overflow_menu && overflow_menu->getVisible() && (overflow_menu->getItemCount() != mDropDownItemsCount)) { overflow_menu->setVisible(FALSE); if (mUpdateDropDownItems) + { showDropDownMenu(); + } } } else @@ -940,6 +953,7 @@ void LLFavoritesBarCtrl::showDropDownMenu() menu->updateParent(LLMenuGL::sMenuContainer); menu->setButtonRect(mMoreTextBox->getRect(), this); positionAndShowMenu(menu); + mDropDownItemsCount = menu->getItemCount(); } } diff --git a/indra/newview/llfavoritesbar.h b/indra/newview/llfavoritesbar.h index f06e9b9b64..211d3c4ce3 100755 --- a/indra/newview/llfavoritesbar.h +++ b/indra/newview/llfavoritesbar.h @@ -101,6 +101,7 @@ protected: LLUUID mFavoriteFolderId; const LLFontGL *mFont; S32 mFirstDropDownItem; + S32 mDropDownItemsCount; bool mUpdateDropDownItems; bool mRestoreOverflowMenu; diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index ddb9d3bc43..c47618e1ec 100755 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -30,6 +30,7 @@ #include <fstream> #include <boost/regex.hpp> +#include <boost/assign/list_of.hpp> #include "llfeaturemanager.h" #include "lldir.h" @@ -52,6 +53,8 @@ #include "llboost.h" #include "llweb.h" #include "llviewershadermgr.h" +#include "llstring.h" +#include "stringize.h" #if LL_WINDOWS #include "lldxhardware.h" @@ -187,6 +190,55 @@ void LLFeatureList::dump() LL_DEBUGS("RenderInit") << LL_ENDL; } +static const std::vector<std::string> sGraphicsLevelNames = boost::assign::list_of + ("Low") + ("LowMid") + ("Mid") + ("MidHigh") + ("High") + ("HighUltra") + ("Ultra") +; + +U32 LLFeatureManager::getMaxGraphicsLevel() const +{ + return sGraphicsLevelNames.size() - 1; +} + +bool LLFeatureManager::isValidGraphicsLevel(U32 level) const +{ + return (level <= getMaxGraphicsLevel()); +} + +std::string LLFeatureManager::getNameForGraphicsLevel(U32 level) const +{ + if (isValidGraphicsLevel(level)) + { + return sGraphicsLevelNames[level]; + } + return STRINGIZE("Invalid graphics level " << level << ", valid are 0 .. " + << getMaxGraphicsLevel()); +} + +S32 LLFeatureManager::getGraphicsLevelForName(const std::string& name) const +{ + const std::string FixedFunction("FixedFunction"); + std::string rname(name); + if (LLStringUtil::endsWith(rname, FixedFunction)) + { + // chop off any "FixedFunction" suffix + rname = rname.substr(0, rname.length() - FixedFunction.length()); + } + for (S32 i(0), iend(getMaxGraphicsLevel()); i <= iend; ++i) + { + if (sGraphicsLevelNames[i] == rname) + { + return i; + } + } + return -1; +} + LLFeatureList *LLFeatureManager::findMask(const std::string& name) { if (mMaskList.count(name)) @@ -209,7 +261,7 @@ BOOL LLFeatureManager::maskFeatures(const std::string& name) return maskList(*maskp); } -BOOL LLFeatureManager::loadFeatureTables() +bool LLFeatureManager::loadFeatureTables() { // *TODO - if I or anyone else adds something else to the skipped list // make this data driven. Put it in the feature table and parse it @@ -250,28 +302,36 @@ BOOL LLFeatureManager::loadFeatureTables() // use HTTP table if it exists std::string path; + bool parse_ok = false; if (gDirUtilp->fileExists(http_path)) { - path = http_path; + parse_ok = parseFeatureTable(http_path); + if (!parse_ok) + { + // the HTTP table failed to parse, so delete it + LLFile::remove(http_path); + LL_WARNS("RenderInit") << "Removed invalid feature table '" << http_path << "'" << LL_ENDL; + } } - else + + if (!parse_ok) { - path = app_path; + parse_ok = parseFeatureTable(app_path); } - - return parseFeatureTable(path); + return parse_ok; } -BOOL LLFeatureManager::parseFeatureTable(std::string filename) +bool LLFeatureManager::parseFeatureTable(std::string filename) { - llinfos << "Looking for feature table in " << filename << llendl; + LL_INFOS("RenderInit") << "Attempting to parse feature table from " << filename << LL_ENDL; llifstream file; std::string name; U32 version; + cleanupFeatureTables(); // in case an earlier attempt left partial results file.open(filename); /*Flawfinder: ignore*/ if (!file) @@ -286,13 +346,14 @@ BOOL LLFeatureManager::parseFeatureTable(std::string filename) if (name != "version") { LL_WARNS("RenderInit") << filename << " does not appear to be a valid feature table!" << LL_ENDL; - return FALSE; + return false; } mTableVersion = version; - + LLFeatureList *flp = NULL; - while (file >> name) + bool parse_ok = true; + while (file >> name && parse_ok) { char buffer[MAX_STRING]; /*Flawfinder: ignore*/ @@ -305,39 +366,58 @@ BOOL LLFeatureManager::parseFeatureTable(std::string filename) if (name == "list") { + LL_DEBUGS("RenderInit") << "Before new list" << std::endl; if (flp) { - //flp->dump(); + flp->dump(); + } + else + { + LL_CONT << "No current list"; } + LL_CONT << LL_ENDL; + // It's a new mask, create it. file >> name; - if (mMaskList.count(name)) + if (!mMaskList.count(name)) { - LL_ERRS("RenderInit") << "Overriding mask " << name << ", this is invalid!" << LL_ENDL; + flp = new LLFeatureList(name); + mMaskList[name] = flp; + } + else + { + LL_WARNS("RenderInit") << "Overriding mask " << name << ", this is invalid!" << LL_ENDL; + parse_ok = false; } - - flp = new LLFeatureList(name); - mMaskList[name] = flp; } else { - if (!flp) + if (flp) + { + S32 available; + F32 recommended; + file >> available >> recommended; + flp->addFeature(name, available, recommended); + } + else { - LL_ERRS("RenderInit") << "Specified parameter before <list> keyword!" << LL_ENDL; - return FALSE; + LL_WARNS("RenderInit") << "Specified parameter before <list> keyword!" << LL_ENDL; + parse_ok = false; } - S32 available; - F32 recommended; - file >> available >> recommended; - flp->addFeature(name, available, recommended); } } file.close(); - return TRUE; + if (!parse_ok) + { + LL_WARNS("RenderInit") << "Discarding feature table data from " << filename << LL_ENDL; + cleanupFeatureTables(); + } + + return parse_ok; } -void LLFeatureManager::loadGPUClass() +bool LLFeatureManager::loadGPUClass() { // defaults mGPUClass = GPU_CLASS_UNKNOWN; @@ -355,29 +435,49 @@ void LLFeatureManager::loadGPUClass() // use HTTP table if it exists std::string path; + bool parse_ok = false; if (gDirUtilp->fileExists(http_path)) { - path = http_path; + parse_ok = parseGPUTable(http_path); + if (!parse_ok) + { + // the HTTP table failed to parse, so delete it + LLFile::remove(http_path); + LL_WARNS("RenderInit") << "Removed invalid gpu table '" << http_path << "'" << LL_ENDL; + } } - else + + if (!parse_ok) { - path = app_path; + parse_ok = parseGPUTable(app_path); } - parseGPUTable(path); + return parse_ok; // indicates that the file parsed correctly, not that the gpu was recognized } -void LLFeatureManager::parseGPUTable(std::string filename) +bool LLFeatureManager::parseGPUTable(std::string filename) { llifstream file; - + + LL_INFOS("RenderInit") << "Attempting to parse GPU table from " << filename << LL_ENDL; file.open(filename); - if (!file) + if (file) + { + const char recognizer[] = "//GPU_TABLE"; + char first_line[MAX_STRING]; + file.getline(first_line, MAX_STRING); + if (0 != strncmp(first_line, recognizer, strlen(recognizer))) + { + LL_WARNS("RenderInit") << "Invalid GPU table: " << filename << "!" << LL_ENDL; + return false; + } + } + else { LL_WARNS("RenderInit") << "Unable to open GPU table: " << filename << "!" << LL_ENDL; - return; + return false; } std::string rawRenderer = gGLManager.getRawGLString(); @@ -504,6 +604,7 @@ void LLFeatureManager::parseGPUTable(std::string filename) #if LL_DARWIN // never go over "Mid" settings by default on OS X mGPUClass = llmin(mGPUClass, GPU_CLASS_2); #endif + return true; } // responder saves table into file @@ -620,7 +721,7 @@ void LLFeatureManager::applyRecommendedSettings() { // apply saved settings // cap the level at 2 (high) - S32 level = llmax(GPU_CLASS_0, llmin(mGPUClass, GPU_CLASS_5)); + U32 level = llmax(GPU_CLASS_0, llmin(mGPUClass, GPU_CLASS_5)); llinfos << "Applying Recommended Features" << llendl; @@ -696,62 +797,33 @@ void LLFeatureManager::applyFeatures(bool skipFeatures) } } -void LLFeatureManager::setGraphicsLevel(S32 level, bool skipFeatures) +void LLFeatureManager::setGraphicsLevel(U32 level, bool skipFeatures) { LLViewerShaderMgr::sSkipReload = true; applyBaseMasks(); - - switch (level) + + // if we're passed an invalid level, default to "Low" + std::string features(isValidGraphicsLevel(level)? getNameForGraphicsLevel(level) : "Low"); + if (features == "Low") { - case 0: #if LL_DARWIN - // This Mac-specific change is to insure that we force 'Basic Shaders' for all Mac - // systems which support them instead of falling back to fixed-function unnecessarily - // MAINT-2157 - // - if (gGLManager.mGLVersion < 2.1f) - { - maskFeatures("LowFixedFunction"); - } - else - { //same as low, but with "Basic Shaders" enabled - maskFeatures("Low"); - } + // This Mac-specific change is to insure that we force 'Basic Shaders' for all Mac + // systems which support them instead of falling back to fixed-function unnecessarily + // MAINT-2157 + if (gGLManager.mGLVersion < 2.1f) #else - if (gGLManager.mGLVersion < 3.f || gGLManager.mIsIntel) - { //only use fixed function by default if GL version < 3.0 or this is an intel graphics chip - maskFeatures("LowFixedFunction"); - } - else - { //same as low, but with "Basic Shaders" enabled - maskFeatures("Low"); - } + // only use fixed function by default if GL version < 3.0 or this is an intel graphics chip + if (gGLManager.mGLVersion < 3.f || gGLManager.mIsIntel) #endif - break; - case 1: - maskFeatures("LowMid"); - break; - case 2: - maskFeatures("Mid"); - break; - case 3: - maskFeatures("MidHigh"); - break; - case 4: - maskFeatures("High"); - break; - case 5: - maskFeatures("HighUltra"); - break; - case 6: - maskFeatures("Ultra"); - break; - default: - maskFeatures("Low"); - break; + { + // same as Low, but with "Basic Shaders" disabled + features = "LowFixedFunction"; + } } + maskFeatures(features); + applyFeatures(skipFeatures); LLViewerShaderMgr::sSkipReload = false; diff --git a/indra/newview/llfeaturemanager.h b/indra/newview/llfeaturemanager.h index ad72c16743..95141b241d 100755 --- a/indra/newview/llfeaturemanager.h +++ b/indra/newview/llfeaturemanager.h @@ -75,7 +75,7 @@ public: void setFeatureAvailable(const std::string& name, const BOOL available); void setRecommendedLevel(const std::string& name, const F32 level); - BOOL loadFeatureList(LLFILE *fp); + bool loadFeatureList(LLFILE *fp); BOOL maskList(LLFeatureList &mask); @@ -114,7 +114,7 @@ public: void maskCurrentList(const std::string& name); // Mask the current feature list with the named list - BOOL loadFeatureTables(); + bool loadFeatureTables(); EGPUClass getGPUClass() { return mGPUClass; } std::string& getGPUString() { return mGPUString; } @@ -134,8 +134,18 @@ public: // skipFeatures forces skipping of mostly hardware settings // that we don't want to change when we change graphics // settings - void setGraphicsLevel(S32 level, bool skipFeatures); - + void setGraphicsLevel(U32 level, bool skipFeatures); + + // What 'level' values are valid to pass to setGraphicsLevel()? + // 0 is the low end... + U32 getMaxGraphicsLevel() const; + bool isValidGraphicsLevel(U32 level) const; + + // setGraphicsLevel() levels have names. + std::string getNameForGraphicsLevel(U32 level) const; + // returns -1 for unrecognized name (hence S32 rather than U32) + S32 getGraphicsLevelForName(const std::string& name) const; + void applyBaseMasks(); void applyRecommendedSettings(); @@ -147,9 +157,14 @@ public: void fetchHTTPTables(); protected: - void loadGPUClass(); - BOOL parseFeatureTable(std::string filename); - void parseGPUTable(std::string filename); + bool loadGPUClass(); + + bool parseFeatureTable(std::string filename); + ///< @returns TRUE is file parsed correctly, FALSE if not + + bool parseGPUTable(std::string filename); + ///< @returns true if file parsed correctly, false if not - does not reflect whether or not the gpu was recognized + void initBaseMask(); diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp index d13f85baa2..c151b51c23 100755 --- a/indra/newview/llfilepicker.cpp +++ b/indra/newview/llfilepicker.cpp @@ -62,6 +62,11 @@ LLFilePicker LLFilePicker::sInstance; #define DICTIONARY_FILTER L"Dictionary files (*.dic; *.xcu)\0*.dic;*.xcu\0" #endif +#ifdef LL_DARWIN +#include "llfilepicker_mac.h" +//#include <boost/algorithm/string/predicate.hpp> +#endif + // // Implementation // @@ -94,14 +99,6 @@ LLFilePicker::LLFilePicker() mFilesW[0] = '\0'; #endif -#if LL_DARWIN - memset(&mNavOptions, 0, sizeof(mNavOptions)); - OSStatus error = NavGetDefaultDialogCreationOptions(&mNavOptions); - if (error == noErr) - { - mNavOptions.modality = kWindowModalityAppModal; - } -#endif } LLFilePicker::~LLFilePicker() @@ -546,369 +543,197 @@ BOOL LLFilePicker::getSaveFile(ESaveFilter filter, const std::string& filename) #elif LL_DARWIN -Boolean LLFilePicker::navOpenFilterProc(AEDesc *theItem, void *info, void *callBackUD, NavFilterModes filterMode) +std::vector<std::string>* LLFilePicker::navOpenFilterProc(ELoadFilter filter) //(AEDesc *theItem, void *info, void *callBackUD, NavFilterModes filterMode) { - Boolean result = true; - ELoadFilter filter = *((ELoadFilter*) callBackUD); - OSStatus error = noErr; - - if (filterMode == kNavFilteringBrowserList && filter != FFLOAD_ALL && (theItem->descriptorType == typeFSRef || theItem->descriptorType == typeFSS)) - { - // navInfo is only valid for typeFSRef and typeFSS - NavFileOrFolderInfo *navInfo = (NavFileOrFolderInfo*) info; - if (!navInfo->isFolder) - { - AEDesc desc; - error = AECoerceDesc(theItem, typeFSRef, &desc); - if (error == noErr) - { - FSRef fileRef; - error = AEGetDescData(&desc, &fileRef, sizeof(fileRef)); - if (error == noErr) - { - LSItemInfoRecord fileInfo; - error = LSCopyItemInfoForRef(&fileRef, kLSRequestExtension | kLSRequestTypeCreator, &fileInfo); - if (error == noErr) - { - if (filter == FFLOAD_IMAGE) - { - if (fileInfo.filetype != 'JPEG' && fileInfo.filetype != 'JPG ' && - fileInfo.filetype != 'BMP ' && fileInfo.filetype != 'TGA ' && - fileInfo.filetype != 'BMPf' && fileInfo.filetype != 'TPIC' && - fileInfo.filetype != 'PNG ' && - (fileInfo.extension && (CFStringCompare(fileInfo.extension, CFSTR("jpeg"), kCFCompareCaseInsensitive) != kCFCompareEqualTo && - CFStringCompare(fileInfo.extension, CFSTR("jpg"), kCFCompareCaseInsensitive) != kCFCompareEqualTo && - CFStringCompare(fileInfo.extension, CFSTR("bmp"), kCFCompareCaseInsensitive) != kCFCompareEqualTo && - CFStringCompare(fileInfo.extension, CFSTR("tga"), kCFCompareCaseInsensitive) != kCFCompareEqualTo && - CFStringCompare(fileInfo.extension, CFSTR("png"), kCFCompareCaseInsensitive) != kCFCompareEqualTo)) - ) - { - result = false; - } - } - else if (filter == FFLOAD_WAV) - { - if (fileInfo.filetype != 'WAVE' && fileInfo.filetype != 'WAV ' && - (fileInfo.extension && (CFStringCompare(fileInfo.extension, CFSTR("wave"), kCFCompareCaseInsensitive) != kCFCompareEqualTo && - CFStringCompare(fileInfo.extension, CFSTR("wav"), kCFCompareCaseInsensitive) != kCFCompareEqualTo)) - ) - { - result = false; - } - } - else if (filter == FFLOAD_ANIM) - { - if (fileInfo.filetype != 'BVH ' && - fileInfo.filetype != 'ANIM' && - (fileInfo.extension && (CFStringCompare(fileInfo.extension, CFSTR("bvh"), kCFCompareCaseInsensitive) != kCFCompareEqualTo) && - fileInfo.extension && (CFStringCompare(fileInfo.extension, CFSTR("anim"), kCFCompareCaseInsensitive) != kCFCompareEqualTo)) - ) - { - result = false; - } - } - else if (filter == FFLOAD_COLLADA) - { - if (fileInfo.filetype != 'DAE ' && - (fileInfo.extension && (CFStringCompare(fileInfo.extension, CFSTR("dae"), kCFCompareCaseInsensitive) != kCFCompareEqualTo)) - ) - { - result = false; - } - } + std::vector<std::string> *allowedv = new std::vector< std::string >; + switch(filter) + { + case FFLOAD_ALL: + allowedv->push_back("wav"); + allowedv->push_back("bvh"); + allowedv->push_back("anim"); + allowedv->push_back("dae"); + allowedv->push_back("raw"); + allowedv->push_back("lsl"); + allowedv->push_back("dic"); + allowedv->push_back("xcu"); + case FFLOAD_IMAGE: + allowedv->push_back("jpg"); + allowedv->push_back("jpeg"); + allowedv->push_back("bmp"); + allowedv->push_back("tga"); + allowedv->push_back("bmpf"); + allowedv->push_back("tpic"); + allowedv->push_back("png"); + break; + case FFLOAD_WAV: + allowedv->push_back("wav"); + break; + case FFLOAD_ANIM: + allowedv->push_back("bvh"); + allowedv->push_back("anim"); + break; + case FFLOAD_COLLADA: + allowedv->push_back("dae"); + break; #ifdef _CORY_TESTING - else if (filter == FFLOAD_GEOMETRY) - { - if (fileInfo.filetype != 'SLG ' && - (fileInfo.extension && (CFStringCompare(fileInfo.extension, CFSTR("slg"), kCFCompareCaseInsensitive) != kCFCompareEqualTo)) - ) - { - result = false; - } - } + case FFLOAD_GEOMETRY: + allowedv->push_back("slg"); + break; #endif - else if (filter == FFLOAD_SLOBJECT) - { - llwarns << "*** navOpenFilterProc: FFLOAD_SLOBJECT NOT IMPLEMENTED ***" << llendl; - } - else if (filter == FFLOAD_RAW) - { - if (fileInfo.filetype != '\?\?\?\?' && - (fileInfo.extension && (CFStringCompare(fileInfo.extension, CFSTR("raw"), kCFCompareCaseInsensitive) != kCFCompareEqualTo)) - ) - { - result = false; - } - } - else if (filter == FFLOAD_SCRIPT) - { - if (fileInfo.filetype != 'LSL ' && - (fileInfo.extension && (CFStringCompare(fileInfo.extension, CFSTR("lsl"), kCFCompareCaseInsensitive) != kCFCompareEqualTo)) ) - { - result = false; - } - } - else if (filter == FFLOAD_DICTIONARY) - { - if (fileInfo.filetype != 'DIC ' && - fileInfo.filetype != 'XCU ' && - (fileInfo.extension && (CFStringCompare(fileInfo.extension, CFSTR("dic"), kCFCompareCaseInsensitive) != kCFCompareEqualTo) && - fileInfo.extension && (CFStringCompare(fileInfo.extension, CFSTR("xcu"), kCFCompareCaseInsensitive) != kCFCompareEqualTo))) - { - result = false; - } - } - - if (fileInfo.extension) - { - CFRelease(fileInfo.extension); - } - } - } - AEDisposeDesc(&desc); - } - } - } - return result; + case FFLOAD_RAW: + allowedv->push_back("raw"); + break; + case FFLOAD_SCRIPT: + allowedv->push_back("lsl"); + break; + case FFLOAD_DICTIONARY: + allowedv->push_back("dic"); + allowedv->push_back("xcu"); + break; + case FFLOAD_DIRECTORY: + break; + default: + llwarns << "Unsupported format." << llendl; + } + + return allowedv; } -OSStatus LLFilePicker::doNavChooseDialog(ELoadFilter filter) +bool LLFilePicker::doNavChooseDialog(ELoadFilter filter) { - OSStatus error = noErr; - NavDialogRef navRef = NULL; - NavReplyRecord navReply; - // if local file browsing is turned off, return without opening dialog if ( check_local_file_access_enabled() == false ) { - return FALSE; + return false; } - - memset(&navReply, 0, sizeof(navReply)); - - // NOTE: we are passing the address of a local variable here. - // This is fine, because the object this call creates will exist for less than the lifetime of this function. - // (It is destroyed by NavDialogDispose() below.) - error = NavCreateChooseFileDialog(&mNavOptions, NULL, NULL, NULL, navOpenFilterProc, (void*)(&filter), &navRef); - + gViewerWindow->getWindow()->beforeDialog(); - - if (error == noErr) - error = NavDialogRun(navRef); + + std::vector<std::string> *allowed_types=navOpenFilterProc(filter); + + std::vector<std::string> *filev = doLoadDialog(allowed_types, + mPickOptions); gViewerWindow->getWindow()->afterDialog(); - if (error == noErr) - error = NavDialogGetReply(navRef, &navReply); - if (navRef) - NavDialogDispose(navRef); - - if (error == noErr && navReply.validRecord) - { - SInt32 count = 0; - SInt32 index; - - // AE indexes are 1 based... - error = AECountItems(&navReply.selection, &count); - for (index = 1; index <= count; index++) - { - FSRef fsRef; - AEKeyword theAEKeyword; - DescType typeCode; - Size actualSize = 0; - char path[MAX_PATH]; /*Flawfinder: ignore*/ - - memset(&fsRef, 0, sizeof(fsRef)); - error = AEGetNthPtr(&navReply.selection, index, typeFSRef, &theAEKeyword, &typeCode, &fsRef, sizeof(fsRef), &actualSize); - - if (error == noErr) - error = FSRefMakePath(&fsRef, (UInt8*) path, sizeof(path)); - - if (error == noErr) - mFiles.push_back(std::string(path)); - } - } + if (filev && filev->size() > 0) + { + mFiles.insert(mFiles.end(), filev->begin(), filev->end()); + return true; + } - return error; + return false; } -OSStatus LLFilePicker::doNavSaveDialog(ESaveFilter filter, const std::string& filename) +bool LLFilePicker::doNavSaveDialog(ESaveFilter filter, const std::string& filename) { - OSStatus error = noErr; - NavDialogRef navRef = NULL; - NavReplyRecord navReply; - - memset(&navReply, 0, sizeof(navReply)); // Setup the type, creator, and extension - OSType type, creator; - CFStringRef extension = NULL; + std::string extension, type, creator; + switch (filter) { case FFSAVE_WAV: - type = 'WAVE'; - creator = 'TVOD'; - extension = CFSTR(".wav"); + type = "WAVE"; + creator = "TVOD"; + extension = "wav"; break; case FFSAVE_TGA: - type = 'TPIC'; - creator = 'prvw'; - extension = CFSTR(".tga"); + type = "TPIC"; + creator = "prvw"; + extension = "tga"; break; case FFSAVE_BMP: - type = 'BMPf'; - creator = 'prvw'; - extension = CFSTR(".bmp"); + type = "BMPf"; + creator = "prvw"; + extension = "bmp"; break; case FFSAVE_JPEG: - type = 'JPEG'; - creator = 'prvw'; - extension = CFSTR(".jpeg"); + type = "JPEG"; + creator = "prvw"; + extension = "jpeg"; break; case FFSAVE_PNG: - type = 'PNG '; - creator = 'prvw'; - extension = CFSTR(".png"); + type = "PNG "; + creator = "prvw"; + extension = "png"; break; case FFSAVE_AVI: - type = '\?\?\?\?'; - creator = '\?\?\?\?'; - extension = CFSTR(".mov"); + type = "\?\?\?\?"; + creator = "\?\?\?\?"; + extension = "mov"; break; case FFSAVE_ANIM: - type = '\?\?\?\?'; - creator = '\?\?\?\?'; - extension = CFSTR(".xaf"); + type = "\?\?\?\?"; + creator = "\?\?\?\?"; + extension = "xaf"; break; #ifdef _CORY_TESTING case FFSAVE_GEOMETRY: - type = '\?\?\?\?'; - creator = '\?\?\?\?'; - extension = CFSTR(".slg"); + type = "\?\?\?\?"; + creator = "\?\?\?\?"; + extension = "slg"; break; #endif case FFSAVE_RAW: - type = '\?\?\?\?'; - creator = '\?\?\?\?'; - extension = CFSTR(".raw"); + type = "\?\?\?\?"; + creator = "\?\?\?\?"; + extension = "raw"; break; case FFSAVE_J2C: - type = '\?\?\?\?'; - creator = 'prvw'; - extension = CFSTR(".j2c"); + type = "\?\?\?\?"; + creator = "prvw"; + extension = "j2c"; break; case FFSAVE_SCRIPT: - type = 'LSL '; - creator = '\?\?\?\?'; - extension = CFSTR(".lsl"); + type = "LSL "; + creator = "\?\?\?\?"; + extension = "lsl"; break; case FFSAVE_ALL: default: - type = '\?\?\?\?'; - creator = '\?\?\?\?'; - extension = CFSTR(""); + type = "\?\?\?\?"; + creator = "\?\?\?\?"; + extension = ""; break; } - // Create the dialog - error = NavCreatePutFileDialog(&mNavOptions, type, creator, NULL, NULL, &navRef); - if (error == noErr) - { - CFStringRef nameString = NULL; - bool hasExtension = true; - - // Create a CFString of the initial file name - if (!filename.empty()) - nameString = CFStringCreateWithCString(NULL, filename.c_str(), kCFStringEncodingUTF8); - else - nameString = CFSTR("Untitled"); - - // Add the extension if one was not provided - if (nameString && !CFStringHasSuffix(nameString, extension)) - { - CFStringRef tempString = nameString; - hasExtension = false; - nameString = CFStringCreateWithFormat(NULL, NULL, CFSTR("%@%@"), tempString, extension); - CFRelease(tempString); - } - - // Set the name in the dialog - if (nameString) - { - error = NavDialogSetSaveFileName(navRef, nameString); - CFRelease(nameString); - } - else - { - error = paramErr; - } - } - + std::string namestring = filename; + if (namestring.empty()) namestring="Untitled"; + +// if (! boost::algorithm::ends_with(namestring, extension) ) +// { +// namestring = namestring + "." + extension; +// +// } + gViewerWindow->getWindow()->beforeDialog(); // Run the dialog - if (error == noErr) - error = NavDialogRun(navRef); + std::string* filev = doSaveDialog(&namestring, + &type, + &creator, + &extension, + mPickOptions); gViewerWindow->getWindow()->afterDialog(); - if (error == noErr) - error = NavDialogGetReply(navRef, &navReply); - - if (navRef) - NavDialogDispose(navRef); - - if (error == noErr && navReply.validRecord) + if ( filev && !filev->empty() ) { - SInt32 count = 0; - - // AE indexes are 1 based... - error = AECountItems(&navReply.selection, &count); - if (count > 0) - { - // Get the FSRef to the containing folder - FSRef fsRef; - AEKeyword theAEKeyword; - DescType typeCode; - Size actualSize = 0; - - memset(&fsRef, 0, sizeof(fsRef)); - error = AEGetNthPtr(&navReply.selection, 1, typeFSRef, &theAEKeyword, &typeCode, &fsRef, sizeof(fsRef), &actualSize); - - if (error == noErr) - { - char path[PATH_MAX]; /*Flawfinder: ignore*/ - char newFileName[SINGLE_FILENAME_BUFFER_SIZE]; /*Flawfinder: ignore*/ - - error = FSRefMakePath(&fsRef, (UInt8*)path, PATH_MAX); - if (error == noErr) - { - if (CFStringGetCString(navReply.saveFileName, newFileName, sizeof(newFileName), kCFStringEncodingUTF8)) - { - mFiles.push_back(std::string(path) + "/" + std::string(newFileName)); - } - else - { - error = paramErr; - } - } - else - { - error = paramErr; - } - } - } - } + mFiles.push_back(*filev); + return true; + } - return error; + return false; } BOOL LLFilePicker::getOpenFile(ELoadFilter filter, bool blocking) @@ -924,16 +749,21 @@ BOOL LLFilePicker::getOpenFile(ELoadFilter filter, bool blocking) return FALSE; } - OSStatus error = noErr; - reset(); - mNavOptions.optionFlags &= ~kNavAllowMultipleFiles; + mPickOptions &= ~F_MULTIPLE; + mPickOptions |= F_FILE; + + if (filter == FFLOAD_DIRECTORY) //This should only be called from lldirpicker. + { + + mPickOptions |= ( F_NAV_SUPPORT | F_DIRECTORY ); + mPickOptions &= ~F_FILE; + } if(filter == FFLOAD_ALL) // allow application bundles etc. to be traversed; important for DEV-16869, but generally useful { - // mNavOptions.optionFlags |= kNavAllowOpenPackages; - mNavOptions.optionFlags |= kNavSupportPackages; + mPickOptions &= F_NAV_SUPPORT; } if (blocking) @@ -942,14 +772,13 @@ BOOL LLFilePicker::getOpenFile(ELoadFilter filter, bool blocking) send_agent_pause(); } + + success = doNavChooseDialog(filter); + + if (success) { - error = doNavChooseDialog(filter); - } - - if (error == noErr) - { - if (getFileCount()) - success = true; + if (!getFileCount()) + success = false; } if (blocking) @@ -975,21 +804,22 @@ BOOL LLFilePicker::getMultipleOpenFiles(ELoadFilter filter) return FALSE; } - OSStatus error = noErr; - reset(); - - mNavOptions.optionFlags |= kNavAllowMultipleFiles; + + mPickOptions |= F_FILE; + + mPickOptions |= F_MULTIPLE; // Modal, so pause agent send_agent_pause(); + + success = doNavChooseDialog(filter); + + send_agent_resume(); + + if (success) { - error = doNavChooseDialog(filter); - } - send_agent_resume(); - if (error == noErr) - { - if (getFileCount()) - success = true; + if (!getFileCount()) + success = false; if (getFileCount() > 1) mLocked = true; } @@ -1001,37 +831,39 @@ BOOL LLFilePicker::getMultipleOpenFiles(ELoadFilter filter) BOOL LLFilePicker::getSaveFile(ESaveFilter filter, const std::string& filename) { + if( mLocked ) - return FALSE; - BOOL success = FALSE; - OSStatus error = noErr; + return false; + BOOL success = false; // if local file browsing is turned off, return without opening dialog if ( check_local_file_access_enabled() == false ) { - return FALSE; + return false; } reset(); - mNavOptions.optionFlags &= ~kNavAllowMultipleFiles; + mPickOptions &= ~F_MULTIPLE; // Modal, so pause agent send_agent_pause(); + + success = doNavSaveDialog(filter, filename); + + if (success) { - error = doNavSaveDialog(filter, filename); + if (!getFileCount()) + success = false; } + send_agent_resume(); - if (error == noErr) - { - if (getFileCount()) - success = true; - } // Account for the fact that the app has been stalled. LLFrameTimer::updateFrameTime(); return success; } +//END LL_DARWIN #elif LL_LINUX || LL_SOLARIS @@ -1537,4 +1369,4 @@ BOOL LLFilePicker::getMultipleOpenFiles( ELoadFilter filter ) return FALSE; } -#endif +#endif // LL_LINUX || LL_SOLARIS diff --git a/indra/newview/llfilepicker.h b/indra/newview/llfilepicker.h index 4f602f63f1..0d279f73f3 100755 --- a/indra/newview/llfilepicker.h +++ b/indra/newview/llfilepicker.h @@ -39,8 +39,8 @@ #include <Carbon/Carbon.h> // AssertMacros.h does bad things. -#include "fix_macros.h" #undef verify +#undef check #undef require #include <vector> @@ -85,7 +85,8 @@ public: FFLOAD_MODEL = 9, FFLOAD_COLLADA = 10, FFLOAD_SCRIPT = 11, - FFLOAD_DICTIONARY = 12 + FFLOAD_DICTIONARY = 12, + FFLOAD_DIRECTORY = 13 //To call from lldirpicker. }; enum ESaveFilter @@ -158,15 +159,14 @@ private: #endif #if LL_DARWIN - NavDialogCreationOptions mNavOptions; + S32 mPickOptions; std::vector<std::string> mFileVector; UInt32 mFileIndex; - OSStatus doNavChooseDialog(ELoadFilter filter); - OSStatus doNavSaveDialog(ESaveFilter filter, const std::string& filename); - void getFilePath(SInt32 index); - void getFileName(SInt32 index); - static Boolean navOpenFilterProc(AEDesc *theItem, void *info, void *callBackUD, NavFilterModes filterMode); + bool doNavChooseDialog(ELoadFilter filter); + bool doNavSaveDialog(ESaveFilter filter, const std::string& filename); + //static Boolean navOpenFilterProc(AEDesc *theItem, void *info, void *callBackUD, NavFilterModes filterMode); + std::vector<std::string>* navOpenFilterProc(ELoadFilter filter); #endif #if LL_GTK diff --git a/indra/newview/llfilepicker_mac.h b/indra/newview/llfilepicker_mac.h new file mode 100644 index 0000000000..e0b7e2e8ce --- /dev/null +++ b/indra/newview/llfilepicker_mac.h @@ -0,0 +1,58 @@ +/** + * @file llfilepicker_mac.h + * @brief OS-specific file picker + * + * $LicenseInfo:firstyear=2001&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +// OS specific file selection dialog. This is implemented as a +// singleton class, so call the instance() method to get the working +// instance. When you call getMultipleOpenFile(), it locks the picker +// until you iterate to the end of the list of selected files with +// getNextFile() or call reset(). + +#ifndef LL_LLFILEPICKER_MAC_H +#define LL_LLFILEPICKER_MAC_H + +#if LL_DARWIN + +#include <string> +#include <vector> + +//void modelessPicker(); +std::vector<std::string>* doLoadDialog(const std::vector<std::string>* allowed_types, + unsigned int flags); +std::string* doSaveDialog(const std::string* file, + const std::string* type, + const std::string* creator, + const std::string* extension, + unsigned int flags); +enum { + F_FILE = 0x00000001, + F_DIRECTORY = 0x00000002, + F_MULTIPLE = 0x00000004, + F_NAV_SUPPORT=0x00000008 +}; + +#endif + +#endif diff --git a/indra/newview/llfilepicker_mac.mm b/indra/newview/llfilepicker_mac.mm new file mode 100644 index 0000000000..13757904e3 --- /dev/null +++ b/indra/newview/llfilepicker_mac.mm @@ -0,0 +1,133 @@ +/** + * @file llfilepicker_mac.cpp + * @brief OS-specific file picker + * + * $LicenseInfo:firstyear=2001&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifdef LL_DARWIN +#import <Cocoa/Cocoa.h> +#include <iostream> +#include "llfilepicker_mac.h" + +std::vector<std::string>* doLoadDialog(const std::vector<std::string>* allowed_types, + unsigned int flags) +{ + int i, result; + + //Aura TODO: We could init a small window and release it at the end of this routine + //for a modeless interface. + + NSOpenPanel *panel = [NSOpenPanel openPanel]; + //NSString *fileName = nil; + NSMutableArray *fileTypes = nil; + + + if ( allowed_types && !allowed_types->empty()) + { + fileTypes = [[NSMutableArray alloc] init]; + + for (i=0;i<allowed_types->size();++i) + { + [fileTypes addObject: + [NSString stringWithCString:(*allowed_types)[i].c_str() + encoding:[NSString defaultCStringEncoding]]]; + } + } + + //[panel setMessage:@"Import one or more files or directories."]; + [panel setAllowsMultipleSelection: ( (flags & F_MULTIPLE)?true:false ) ]; + [panel setCanChooseDirectories: ( (flags & F_DIRECTORY)?true:false ) ]; + [panel setCanCreateDirectories: true]; + [panel setResolvesAliases: true]; + [panel setCanChooseFiles: ( (flags & F_FILE)?true:false )]; + [panel setTreatsFilePackagesAsDirectories: ( flags & F_NAV_SUPPORT ) ]; + + std::vector<std::string>* outfiles = NULL; + + if (fileTypes) + { + [panel setAllowedFileTypes:fileTypes]; + result = [panel runModal]; + } + else + { + // I suggest it's better to open the last path and let this default to home dir as necessary + // for consistency with other OS X apps + // + //[panel setDirectoryURL: fileURLWithPath(NSHomeDirectory()) ]; + result = [panel runModal]; + } + + if (result == NSOKButton) + { + NSArray *filesToOpen = [panel URLs]; + int i, count = [filesToOpen count]; + + if (count > 0) + { + outfiles = new std::vector<std::string>; + } + + for (i=0; i<count; i++) { + NSString *aFile = [[filesToOpen objectAtIndex:i] path]; + std::string *afilestr = new std::string([aFile UTF8String]); + outfiles->push_back(*afilestr); + } + } + return outfiles; +} + + +std::string* doSaveDialog(const std::string* file, + const std::string* type, + const std::string* creator, + const std::string* extension, + unsigned int flags) +{ + NSSavePanel *panel = [NSSavePanel savePanel]; + + NSString *extensionns = [NSString stringWithCString:extension->c_str() encoding:[NSString defaultCStringEncoding]]; + NSArray *fileType = [[NSArray alloc] initWithObjects:extensionns,nil]; + + //[panel setMessage:@"Save Image File"]; + [panel setTreatsFilePackagesAsDirectories: ( flags & F_NAV_SUPPORT ) ]; + [panel setCanSelectHiddenExtension:true]; + [panel setAllowedFileTypes:fileType]; + NSString *fileName = [NSString stringWithCString:file->c_str() encoding:[NSString defaultCStringEncoding]]; + + std::string *outfile = NULL; + NSURL* url = [NSURL fileURLWithPath:fileName]; + [panel setNameFieldStringValue: fileName]; + [panel setDirectoryURL: url]; + if([panel runModal] == + NSFileHandlingPanelOKButton) + { + NSURL* url = [panel URL]; + NSString* p = [url path]; + outfile = new std::string( [p UTF8String] ); + // write the file + } + return outfile; +} + +#endif diff --git a/indra/newview/llflexibleobject.cpp b/indra/newview/llflexibleobject.cpp index caad0afec0..98c0c0bf51 100755 --- a/indra/newview/llflexibleobject.cpp +++ b/indra/newview/llflexibleobject.cpp @@ -294,6 +294,9 @@ void LLVolumeImplFlexible::onSetVolume(const LLVolumeParams &volume_params, cons void LLVolumeImplFlexible::updateRenderRes() { + if (!mAttributes) + return; + LLDrawable* drawablep = mVO->mDrawable; S32 new_res = mAttributes->getSimulateLOD(); @@ -435,7 +438,7 @@ void LLVolumeImplFlexible::doFlexibleUpdate() } } - if(!mInitialized) + if(!mInitialized || !mAttributes) { //the object is not visible return ; @@ -689,30 +692,36 @@ void LLVolumeImplFlexible::doFlexibleUpdate() LLVector4(z_axis, 0.f), LLVector4(delta_pos, 1.f)); + LL_CHECK_MEMORY for (i=0; i<=num_render_sections; ++i) { new_point = &path->mPath[i]; LLVector3 pos = newSection[i].mPosition * rel_xform; LLQuaternion rot = mSection[i].mAxisRotation * newSection[i].mRotation * delta_rot; - - if (!mUpdated || (new_point->mPos-pos).magVec()/mVO->mDrawable->mDistanceWRTCamera > 0.001f) + + LLVector3 np(new_point->mPos.getF32ptr()); + + if (!mUpdated || (np-pos).magVec()/mVO->mDrawable->mDistanceWRTCamera > 0.001f) { - new_point->mPos = newSection[i].mPosition * rel_xform; + new_point->mPos.load3((newSection[i].mPosition * rel_xform).mV); mUpdated = FALSE; } - new_point->mRot = rot; - new_point->mScale = newSection[i].mScale; + new_point->mRot.loadu(LLMatrix3(rot)); + new_point->mScale.set(newSection[i].mScale.mV[0], newSection[i].mScale.mV[1], 0,1); new_point->mTexT = ((F32)i)/(num_render_sections); } - + LL_CHECK_MEMORY mLastSegmentRotation = parentSegmentRotation; } +static LLFastTimer::DeclareTimer FTM_FLEXI_PREBUILD("Flexi Prebuild"); + void LLVolumeImplFlexible::preRebuild() { if (!mUpdated) { + LLFastTimer t(FTM_FLEXI_PREBUILD); doFlexibleRebuild(); } } diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index 83fb887d81..fea8e34729 100755 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -33,8 +33,10 @@ // Viewer includes #include "llagent.h" +#include "llagentui.h" #include "llappviewer.h" #include "llsecondlifeurls.h" +#include "llslurl.h" #include "llvoiceclient.h" #include "lluictrlfactory.h" #include "llviewertexteditor.h" @@ -250,12 +252,16 @@ LLSD LLFloaterAbout::getInfo() LLViewerRegion* region = gAgent.getRegion(); if (region) { - const LLVector3d &pos = gAgent.getPositionGlobal(); + LLVector3d pos = gAgent.getPositionGlobal(); info["POSITION"] = ll_sd_from_vector3d(pos); + info["POSITION_LOCAL"] = ll_sd_from_vector3(gAgent.getPosAgentFromGlobal(pos)); info["REGION"] = gAgent.getRegion()->getName(); info["HOSTNAME"] = gAgent.getRegion()->getHost().getHostName(); info["HOSTIP"] = gAgent.getRegion()->getHost().getString(); info["SERVER_VERSION"] = gLastVersionChannel; + LLSLURL slurl; + LLAgentUI::buildSLURL(slurl); + info["SLURL"] = slurl.getSLURLString(); } // CPU @@ -307,12 +313,12 @@ LLSD LLFloaterAbout::getInfo() static std::string get_viewer_release_notes_url() { // return a URL to the release notes for this viewer, such as: - // http://wiki.secondlife.com/wiki/Release_Notes/Second Life Beta Viewer/2.1.0 + // http://wiki.secondlife.com/wiki/Release_Notes/Second Life Beta Viewer/2.1.0.123456 std::string url = LLTrans::getString("RELEASE_NOTES_BASE_URL"); if (! LLStringUtil::endsWith(url, "/")) url += "/"; url += LLVersionInfo::getChannel() + "/"; - url += LLVersionInfo::getShortVersion(); + url += LLVersionInfo::getVersion(); return LLWeb::escapeURL(url); } diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index 113aa9a8f2..c0afb72cff 100755 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -513,6 +513,7 @@ void LLFloaterAvatarPicker::find() url += "/"; } url += "?page_size=100&names="; + std::replace(text.begin(), text.end(), '.', ' '); url += LLURI::escape(text); llinfos << "avatar picker " << url << llendl; LLHTTPClient::get(url, new LLAvatarPickerResponder(mQueryID, getKey().asString())); @@ -748,7 +749,12 @@ void LLFloaterAvatarPicker::processResponse(const LLUUID& query_id, const LLSD& { getChildView("ok_btn")->setEnabled(true); search_results->setEnabled(true); - search_results->selectFirstItem(); + search_results->sortByColumnIndex(1, TRUE); + std::string text = getChild<LLUICtrl>("Edit")->getValue().asString(); + if (!search_results->selectItemByLabel(text, TRUE, 1)) + { + search_results->selectFirstItem(); + } onList(); search_results->setFocus(TRUE); } diff --git a/indra/newview/llfloaterbulkpermission.cpp b/indra/newview/llfloaterbulkpermission.cpp index 39b6e465f3..76f62a7880 100755 --- a/indra/newview/llfloaterbulkpermission.cpp +++ b/indra/newview/llfloaterbulkpermission.cpp @@ -57,6 +57,7 @@ LLFloaterBulkPermission::LLFloaterBulkPermission(const LLSD& seed) mDone(FALSE) { mID.generate(); + mCommitCallbackRegistrar.add("BulkPermission.Ok", boost::bind(&LLFloaterBulkPermission::onOkBtn, this)); mCommitCallbackRegistrar.add("BulkPermission.Apply", boost::bind(&LLFloaterBulkPermission::onApplyBtn, this)); mCommitCallbackRegistrar.add("BulkPermission.Close", boost::bind(&LLFloaterBulkPermission::onCloseBtn, this)); mCommitCallbackRegistrar.add("BulkPermission.CheckAll", boost::bind(&LLFloaterBulkPermission::onCheckAll, this)); @@ -66,6 +67,21 @@ LLFloaterBulkPermission::LLFloaterBulkPermission(const LLSD& seed) BOOL LLFloaterBulkPermission::postBuild() { + mBulkChangeIncludeAnimations = gSavedSettings.getBOOL("BulkChangeIncludeAnimations"); + mBulkChangeIncludeBodyParts = gSavedSettings.getBOOL("BulkChangeIncludeBodyParts"); + mBulkChangeIncludeClothing = gSavedSettings.getBOOL("BulkChangeIncludeClothing"); + mBulkChangeIncludeGestures = gSavedSettings.getBOOL("BulkChangeIncludeGestures"); + mBulkChangeIncludeNotecards = gSavedSettings.getBOOL("BulkChangeIncludeNotecards"); + mBulkChangeIncludeObjects = gSavedSettings.getBOOL("BulkChangeIncludeObjects"); + mBulkChangeIncludeScripts = gSavedSettings.getBOOL("BulkChangeIncludeScripts"); + mBulkChangeIncludeSounds = gSavedSettings.getBOOL("BulkChangeIncludeSounds"); + mBulkChangeIncludeTextures = gSavedSettings.getBOOL("BulkChangeIncludeTextures"); + mBulkChangeShareWithGroup = gSavedSettings.getBOOL("BulkChangeShareWithGroup"); + mBulkChangeEveryoneCopy = gSavedSettings.getBOOL("BulkChangeEveryoneCopy"); + mBulkChangeNextOwnerModify = gSavedSettings.getBOOL("BulkChangeNextOwnerModify"); + mBulkChangeNextOwnerCopy = gSavedSettings.getBOOL("BulkChangeNextOwnerCopy"); + mBulkChangeNextOwnerTransfer = gSavedSettings.getBOOL("BulkChangeNextOwnerTransfer"); + return TRUE; } @@ -144,6 +160,12 @@ void LLFloaterBulkPermission::inventoryChanged(LLViewerObject* viewer_object, } } +void LLFloaterBulkPermission::onOkBtn() +{ + doApply(); + closeFloater(); +} + void LLFloaterBulkPermission::onApplyBtn() { doApply(); @@ -151,6 +173,20 @@ void LLFloaterBulkPermission::onApplyBtn() void LLFloaterBulkPermission::onCloseBtn() { + gSavedSettings.setBOOL("BulkChangeIncludeAnimations", mBulkChangeIncludeAnimations); + gSavedSettings.setBOOL("BulkChangeIncludeBodyParts", mBulkChangeIncludeBodyParts); + gSavedSettings.setBOOL("BulkChangeIncludeClothing", mBulkChangeIncludeClothing); + gSavedSettings.setBOOL("BulkChangeIncludeGestures", mBulkChangeIncludeGestures); + gSavedSettings.setBOOL("BulkChangeIncludeNotecards", mBulkChangeIncludeNotecards); + gSavedSettings.setBOOL("BulkChangeIncludeObjects", mBulkChangeIncludeObjects); + gSavedSettings.setBOOL("BulkChangeIncludeScripts", mBulkChangeIncludeScripts); + gSavedSettings.setBOOL("BulkChangeIncludeSounds", mBulkChangeIncludeSounds); + gSavedSettings.setBOOL("BulkChangeIncludeTextures", mBulkChangeIncludeTextures); + gSavedSettings.setBOOL("BulkChangeShareWithGroup", mBulkChangeShareWithGroup); + gSavedSettings.setBOOL("BulkChangeEveryoneCopy", mBulkChangeEveryoneCopy); + gSavedSettings.setBOOL("BulkChangeNextOwnerModify", mBulkChangeNextOwnerModify); + gSavedSettings.setBOOL("BulkChangeNextOwnerCopy", mBulkChangeNextOwnerCopy); + gSavedSettings.setBOOL("BulkChangeNextOwnerTransfer", mBulkChangeNextOwnerTransfer); closeFloater(); } diff --git a/indra/newview/llfloaterbulkpermission.h b/indra/newview/llfloaterbulkpermission.h index 7dd05df7ee..25e76eca65 100755 --- a/indra/newview/llfloaterbulkpermission.h +++ b/indra/newview/llfloaterbulkpermission.h @@ -72,6 +72,7 @@ private: bool is_new); void onCloseBtn(); + void onOkBtn(); void onApplyBtn(); void onCommitCopy(); void onCheckAll() { doCheckUncheckAll(TRUE); } @@ -94,6 +95,21 @@ private: LLUUID mCurrentObjectID; BOOL mDone; + bool mBulkChangeIncludeAnimations; + bool mBulkChangeIncludeBodyParts; + bool mBulkChangeIncludeClothing; + bool mBulkChangeIncludeGestures; + bool mBulkChangeIncludeNotecards; + bool mBulkChangeIncludeObjects; + bool mBulkChangeIncludeScripts; + bool mBulkChangeIncludeSounds; + bool mBulkChangeIncludeTextures; + bool mBulkChangeShareWithGroup; + bool mBulkChangeEveryoneCopy; + bool mBulkChangeNextOwnerModify; + bool mBulkChangeNextOwnerCopy; + bool mBulkChangeNextOwnerTransfer; + LLUUID mID; const char* mStartString; diff --git a/indra/newview/llfloaterconversationpreview.cpp b/indra/newview/llfloaterconversationpreview.cpp index a3d715530d..4a85160f95 100755 --- a/indra/newview/llfloaterconversationpreview.cpp +++ b/indra/newview/llfloaterconversationpreview.cpp @@ -43,13 +43,15 @@ LLFloaterConversationPreview::LLFloaterConversationPreview(const LLSD& session_i mCurrentPage(0), mPageSize(gSavedSettings.getS32("ConversationHistoryPageSize")), mAccountName(session_id[LL_FCP_ACCOUNT_NAME]), - mCompleteName(session_id[LL_FCP_COMPLETE_NAME]) + mCompleteName(session_id[LL_FCP_COMPLETE_NAME]), + mMutex(NULL) { } BOOL LLFloaterConversationPreview::postBuild() { mChatHistory = getChild<LLChatHistory>("chat_history"); + LLLoadHistoryThread::setLoadEndSignal(boost::bind(&LLFloaterConversationPreview::setPages, this, _1, _2)); const LLConversation* conv = LLConversationLog::instance().getConversation(mSessionID); std::string name; @@ -70,7 +72,7 @@ BOOL LLFloaterConversationPreview::postBuild() name = LLTrans::getString("NearbyChatTitle"); file = "chat"; } - + mChatHistoryFileName = file; LLStringUtil::format_map_t args; args["[NAME]"] = name; std::string title = getString("Title", args); @@ -80,53 +82,73 @@ BOOL LLFloaterConversationPreview::postBuild() load_params["load_all_history"] = true; load_params["cut_off_todays_date"] = false; - LLLogChat::loadChatHistory(file, mMessages, load_params); - mCurrentPage = mMessages.size() / mPageSize; + LLSD loading; + loading[LL_IM_TEXT] = LLTrans::getString("loading_chat_logs"); + mMessages.push_back(loading); mPageSpinner = getChild<LLSpinCtrl>("history_page_spin"); mPageSpinner->setCommitCallback(boost::bind(&LLFloaterConversationPreview::onMoreHistoryBtnClick, this)); mPageSpinner->setMinValue(1); - mPageSpinner->setMaxValue(mCurrentPage + 1); - mPageSpinner->set(mCurrentPage + 1); - - std::string total_page_num = llformat("/ %d", mCurrentPage + 1); - getChild<LLTextBox>("page_num_label")->setValue(total_page_num); - + mPageSpinner->set(1); + mPageSpinner->setEnabled(false); + mChatHistoryLoaded = false; + LLLogChat::startChatHistoryThread(file, load_params); return LLFloater::postBuild(); } +void LLFloaterConversationPreview::setPages(std::list<LLSD>& messages,const std::string& file_name) +{ + if(file_name == mChatHistoryFileName) + { + // additional protection to avoid changes of mMessages in setPages() + LLMutexLock lock(&mMutex); + mMessages = messages; + mCurrentPage = (mMessages.size() ? (mMessages.size() - 1) / mPageSize : 0); + + mPageSpinner->setEnabled(true); + mPageSpinner->setMaxValue(mCurrentPage+1); + mPageSpinner->set(mCurrentPage+1); + + std::string total_page_num = llformat("/ %d", mCurrentPage+1); + getChild<LLTextBox>("page_num_label")->setValue(total_page_num); + mChatHistoryLoaded = true; + } +} + void LLFloaterConversationPreview::draw() { + if(mChatHistoryLoaded) + { + showHistory(); + mChatHistoryLoaded = false; + } LLFloater::draw(); } void LLFloaterConversationPreview::onOpen(const LLSD& key) { - showHistory(); + if(mChatHistoryLoaded) + { + showHistory(); + } } void LLFloaterConversationPreview::showHistory() { - if (!mMessages.size()) + // additional protection to avoid changes of mMessages in setPages() + LLMutexLock lock(&mMutex); + + if (!mMessages.size() || mCurrentPage * mPageSize >= mMessages.size()) { return; } mChatHistory->clear(); - std::ostringstream message; std::list<LLSD>::const_iterator iter = mMessages.begin(); + std::advance(iter, mCurrentPage * mPageSize); - int delta = 0; - if (mCurrentPage) - { - int remainder = mMessages.size() % mPageSize; - delta = (remainder == 0) ? 0 : (mPageSize - remainder); - } - - std::advance(iter, (mCurrentPage * mPageSize) - delta); - - for (int msg_num = 0; (iter != mMessages.end() && msg_num < mPageSize); ++iter, ++msg_num) + for (int msg_num = 0; iter != mMessages.end() && msg_num < mPageSize; ++iter, ++msg_num) { LLSD msg = *iter; @@ -171,7 +193,6 @@ void LLFloaterConversationPreview::showHistory() mChatHistory->appendMessage(chat,chat_args); } - } void LLFloaterConversationPreview::onMoreHistoryBtnClick() diff --git a/indra/newview/llfloaterconversationpreview.h b/indra/newview/llfloaterconversationpreview.h index b17ae84b63..f8796127ba 100755 --- a/indra/newview/llfloaterconversationpreview.h +++ b/indra/newview/llfloaterconversationpreview.h @@ -42,6 +42,7 @@ public: virtual ~LLFloaterConversationPreview(){}; virtual BOOL postBuild(); + void setPages(std::list<LLSD>& messages,const std::string& file_name); virtual void draw(); virtual void onOpen(const LLSD& key); @@ -50,6 +51,7 @@ private: void onMoreHistoryBtnClick(); void showHistory(); + LLMutex mMutex; LLSpinCtrl* mPageSpinner; LLChatHistory* mChatHistory; LLUUID mSessionID; @@ -59,6 +61,8 @@ private: std::list<LLSD> mMessages; std::string mAccountName; std::string mCompleteName; + std::string mChatHistoryFileName; + bool mChatHistoryLoaded; }; #endif /* LLFLOATERCONVERSATIONPREVIEW_H_ */ diff --git a/indra/newview/llfloatergotoline.cpp b/indra/newview/llfloatergotoline.cpp new file mode 100644 index 0000000000..d66e418926 --- /dev/null +++ b/indra/newview/llfloatergotoline.cpp @@ -0,0 +1,160 @@ +/** + * @file llfloatergotoline.h + * @author MartinRJ + * @brief LLFloaterGotoLine class implementation + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" +#include "llfloatergotoline.h" +#include "llpreviewscript.h" +#include "llfloaterreg.h" +#include "lllineeditor.h" +#include "llviewertexteditor.h" +#include "llviewerwindow.h" + +LLFloaterGotoLine* LLFloaterGotoLine::sInstance = NULL; + +LLFloaterGotoLine::LLFloaterGotoLine(LLScriptEdCore* editor_core) +: LLFloater(LLSD()), + mGotoBox(NULL), + mEditorCore(editor_core) +{ + buildFromFile("floater_goto_line.xml"); + + sInstance = this; + + // find floater in which script panel is embedded + LLView* viewp = (LLView*)editor_core; + while(viewp) + { + LLFloater* floaterp = dynamic_cast<LLFloater*>(viewp); + if (floaterp) + { + floaterp->addDependentFloater(this); + break; + } + viewp = viewp->getParent(); + } +} + +BOOL LLFloaterGotoLine::postBuild() +{ + mGotoBox = getChild<LLLineEditor>("goto_line"); + mGotoBox->setCommitCallback(boost::bind(&LLFloaterGotoLine::onGotoBoxCommit, this)); + mGotoBox->setCommitOnFocusLost(FALSE); + getChild<LLLineEditor>("goto_line")->setPrevalidate(LLTextValidate::validateNonNegativeS32); + childSetAction("goto_btn", onBtnGoto,this); + setDefaultBtn("goto_btn"); + + return TRUE; +} + +//static +void LLFloaterGotoLine::show(LLScriptEdCore* editor_core) +{ + if (sInstance && sInstance->mEditorCore && sInstance->mEditorCore != editor_core) + { + sInstance->closeFloater(); + delete sInstance; + } + + if (!sInstance) + { + // sInstance will be assigned in the constructor. + new LLFloaterGotoLine(editor_core); + } + + sInstance->openFloater(); +} + +LLFloaterGotoLine::~LLFloaterGotoLine() +{ + sInstance = NULL; +} + +// static +void LLFloaterGotoLine::onBtnGoto(void *userdata) +{ + LLFloaterGotoLine* self = (LLFloaterGotoLine*)userdata; + self->handleBtnGoto(); +} + +void LLFloaterGotoLine::handleBtnGoto() +{ + S32 row = 0; + S32 column = 0; + row = getChild<LLUICtrl>("goto_line")->getValue().asInteger(); + if (row >= 0) + { + if (mEditorCore && mEditorCore->mEditor) + { + mEditorCore->mEditor->deselect(); + mEditorCore->mEditor->setCursor(row, column); + mEditorCore->mEditor->setFocus(TRUE); + } + } +} + +bool LLFloaterGotoLine::hasAccelerators() const +{ + if (mEditorCore) + { + return mEditorCore->hasAccelerators(); + } + return FALSE; +} + +BOOL LLFloaterGotoLine::handleKeyHere(KEY key, MASK mask) +{ + if (mEditorCore) + { + return mEditorCore->handleKeyHere(key, mask); + } + + return FALSE; +} + +void LLFloaterGotoLine::onGotoBoxCommit() +{ + S32 row = 0; + S32 column = 0; + row = getChild<LLUICtrl>("goto_line")->getValue().asInteger(); + if (row >= 0) + { + if (mEditorCore && mEditorCore->mEditor) + { + mEditorCore->mEditor->setCursor(row, column); + + S32 rownew = 0; + S32 columnnew = 0; + mEditorCore->mEditor->getCurrentLineAndColumn( &rownew, &columnnew, FALSE ); // don't include wordwrap + if (rownew == row && columnnew == column) + { + mEditorCore->mEditor->deselect(); + mEditorCore->mEditor->setFocus(TRUE); + sInstance->closeFloater(); + } //else do nothing (if the cursor-position didn't change) + } + } +} diff --git a/indra/newview/llfloatergotoline.h b/indra/newview/llfloatergotoline.h new file mode 100644 index 0000000000..058d601752 --- /dev/null +++ b/indra/newview/llfloatergotoline.h @@ -0,0 +1,66 @@ +/** + * @file llfloatergotoline.h + * @author MartinRJ + * @brief LLFloaterGotoLine class definition + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLFLOATERGOTOLINE_H +#define LL_LLFLOATERGOTOLINE_H + +#include "llfloater.h" +#include "lllineeditor.h" +#include "llpreviewscript.h" + +class LLScriptEdCore; + +class LLFloaterGotoLine : public LLFloater +{ +public: + LLFloaterGotoLine(LLScriptEdCore* editor_core); + ~LLFloaterGotoLine(); + + /*virtual*/ BOOL postBuild(); + static void show(LLScriptEdCore* editor_core); + + static void onBtnGoto(void* userdata); + void handleBtnGoto(); + + LLScriptEdCore* getEditorCore() { return mEditorCore; } + static LLFloaterGotoLine* getInstance() { return sInstance; } + + virtual bool hasAccelerators() const; + virtual BOOL handleKeyHere(KEY key, MASK mask); + +private: + + LLScriptEdCore* mEditorCore; + + static LLFloaterGotoLine* sInstance; + +protected: + LLLineEditor* mGotoBox; + void onGotoBoxCommit(); +}; + +#endif // LL_LLFLOATERGOTOLINE_H diff --git a/indra/newview/llfloaterhardwaresettings.cpp b/indra/newview/llfloaterhardwaresettings.cpp index 116bd241c4..792a2a5d25 100755 --- a/indra/newview/llfloaterhardwaresettings.cpp +++ b/indra/newview/llfloaterhardwaresettings.cpp @@ -89,8 +89,10 @@ void LLFloaterHardwareSettings::refresh() void LLFloaterHardwareSettings::refreshEnabledState() { + F32 mem_multiplier = gSavedSettings.getF32("RenderTextureMemoryMultiple"); + S32 min_tex_mem = LLViewerTextureList::getMinVideoRamSetting(); - S32 max_tex_mem = LLViewerTextureList::getMaxVideoRamSetting(); + S32 max_tex_mem = LLViewerTextureList::getMaxVideoRamSetting(false, mem_multiplier); getChild<LLSliderCtrl>("GraphicsCardTextureMemory")->setMinValue(min_tex_mem); getChild<LLSliderCtrl>("GraphicsCardTextureMemory")->setMaxValue(max_tex_mem); @@ -149,12 +151,17 @@ BOOL LLFloaterHardwareSettings::postBuild() { childSetAction("OK", onBtnOK, this); +// Don't do this on Mac as their braindead GL versioning +// sets this when 8x and 16x are indeed available +// +#if !LL_DARWIN if (gGLManager.mIsIntel || gGLManager.mGLVersion < 3.f) { //remove FSAA settings above "4x" LLComboBox* combo = getChild<LLComboBox>("fsaa"); combo->remove("8x"); combo->remove("16x"); } +#endif refresh(); center(); diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index b40789db9c..2c3b34e128 100755 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -47,6 +47,7 @@ #include "llfloaterpreference.h" #include "llimview.h" #include "llnotificationsutil.h" +#include "lltoolbarview.h" #include "lltransientfloatermgr.h" #include "llviewercontrol.h" #include "llconversationview.h" @@ -54,6 +55,7 @@ #include "llworld.h" #include "llsdserialize.h" #include "llviewerobjectlist.h" +#include "boost/foreach.hpp" // // LLFloaterIMContainer @@ -63,7 +65,8 @@ LLFloaterIMContainer::LLFloaterIMContainer(const LLSD& seed, const Params& param mExpandCollapseBtn(NULL), mConversationsRoot(NULL), mConversationsEventStream("ConversationsEvents"), - mInitialized(false) + mInitialized(false), + mIsFirstLaunch(true) { mEnableCallbackRegistrar.add("IMFloaterContainer.Check", boost::bind(&LLFloaterIMContainer::isActionChecked, this, _2)); mCommitCallbackRegistrar.add("IMFloaterContainer.Action", boost::bind(&LLFloaterIMContainer::onCustomAction, this, _2)); @@ -113,6 +116,10 @@ void LLFloaterIMContainer::sessionAdded(const LLUUID& session_id, const std::str void LLFloaterIMContainer::sessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) { + if(!isInVisibleChain()) + { + setVisibleAndFrontmost(false); + } selectConversationPair(session_id, true); collapseMessagesPane(false); } @@ -204,6 +211,7 @@ BOOL LLFloaterIMContainer::postBuild() // a scroller for folder view LLRect scroller_view_rect = mConversationsListPanel->getRect(); scroller_view_rect.translate(-scroller_view_rect.mLeft, -scroller_view_rect.mBottom); + scroller_view_rect.mBottom += getChild<LLLayoutStack>("conversations_pane_buttons_stack")->getRect().getHeight(); LLScrollContainer::Params scroller_params(LLUICtrlFactory::getDefaultParams<LLFolderViewScrollContainer>()); scroller_params.rect(scroller_view_rect); @@ -221,7 +229,8 @@ BOOL LLFloaterIMContainer::postBuild() mExpandCollapseBtn->setClickedCallback(boost::bind(&LLFloaterIMContainer::onExpandCollapseButtonClicked, this)); mStubCollapseBtn = getChild<LLButton>("stub_collapse_btn"); mStubCollapseBtn->setClickedCallback(boost::bind(&LLFloaterIMContainer::onStubCollapseButtonClicked, this)); - getChild<LLButton>("speak_btn")->setClickedCallback(boost::bind(&LLFloaterIMContainer::onSpeakButtonClicked, this)); + mSpeakBtn = getChild<LLButton>("speak_btn"); + mSpeakBtn->setClickedCallback(boost::bind(&LLFloaterIMContainer::onSpeakButtonClicked, this)); childSetAction("add_btn", boost::bind(&LLFloaterIMContainer::onAddButtonClicked, this)); @@ -258,7 +267,6 @@ BOOL LLFloaterIMContainer::postBuild() void LLFloaterIMContainer::onOpen(const LLSD& key) { LLMultiFloater::onOpen(key); - openNearbyChat(); reSelectConversation(); assignResizeLimits(); } @@ -593,6 +601,7 @@ void LLFloaterIMContainer::setMinimized(BOOL b) //Switching from minimized to un-minimized if(was_minimized && !b) { + gToolBarView->flashCommand(LLCommandId("chat"), false); LLFloaterIMSessionTab* session_floater = LLFloaterIMSessionTab::findConversation(mSelectedSession); if(session_floater && !session_floater->isTornOff()) @@ -621,7 +630,6 @@ void LLFloaterIMContainer::setVisible(BOOL visible) LLFloaterReg::toggleInstanceOrBringToFront(name); selectConversationPair(LLUUID(NULL), false, false); } - openNearbyChat(); flashConversationItemWidget(mSelectedSession,false); LLFloaterIMSessionTab* session_floater = LLFloaterIMSessionTab::findConversation(mSelectedSession); @@ -651,7 +659,11 @@ void LLFloaterIMContainer::setVisible(BOOL visible) LLConversationViewSession* widget = dynamic_cast<LLConversationViewSession*>(widget_it->second); if (widget) { - widget->setVisibleIfDetached(visible); + LLFloater* session_floater = widget->getSessionFloater(); + if (session_floater != nearby_chat) + { + widget->setVisibleIfDetached(visible); + } } } @@ -659,10 +671,42 @@ void LLFloaterIMContainer::setVisible(BOOL visible) LLMultiFloater::setVisible(visible); } +void LLFloaterIMContainer::getDetachedConversationFloaters(floater_list_t& floaters) +{ + typedef conversations_widgets_map::value_type conv_pair; + LLFloaterIMNearbyChat *nearby_chat = LLFloaterReg::findTypedInstance<LLFloaterIMNearbyChat>("nearby_chat"); + + BOOST_FOREACH(conv_pair item, mConversationsWidgets) + { + LLConversationViewSession* widget = dynamic_cast<LLConversationViewSession*>(item.second); + if (widget) + { + LLFloater* session_floater = widget->getSessionFloater(); + + // Exclude nearby chat from output, as it should be handled separately + if (session_floater && session_floater->isDetachedAndNotMinimized() + && session_floater != nearby_chat) + { + floaters.push_back(session_floater); + } + } + } +} + void LLFloaterIMContainer::setVisibleAndFrontmost(BOOL take_focus, const LLSD& key) { LLMultiFloater::setVisibleAndFrontmost(take_focus, key); - selectConversationPair(getSelectedSession(), false, take_focus); + // Do not select "Nearby Chat" conversation, since it will bring its window to front + // Only select other sessions + if (!getSelectedSession().isNull()) + { + selectConversationPair(getSelectedSession(), false, take_focus); + } + if (mInitialized && mIsFirstLaunch) + { + collapseMessagesPane(gSavedPerAccountSettings.getBOOL("ConversationsMessagePaneCollapsed")); + mIsFirstLaunch = false; + } } void LLFloaterIMContainer::updateResizeLimits() @@ -779,13 +823,6 @@ void LLFloaterIMContainer::reshapeFloaterAndSetResizeLimits(bool collapse, S32 d setCanMinimize(at_least_one_panel_is_expanded); assignResizeLimits(); - - // force set correct size for the title after show/hide minimize button - LLRect cur_rect = getRect(); - LLRect force_rect = cur_rect; - force_rect.mRight = cur_rect.mRight + 1; - setRect(force_rect); - setRect(cur_rect); } void LLFloaterIMContainer::assignResizeLimits() @@ -793,15 +830,12 @@ void LLFloaterIMContainer::assignResizeLimits() bool is_conv_pane_expanded = !mConversationsPane->isCollapsed(); bool is_msg_pane_expanded = !mMessagesPane->isCollapsed(); - // With two panels visible number of borders is three, because the borders - // between the panels are merged into one - S32 number_of_visible_borders = llmin((is_conv_pane_expanded? 2 : 0) + (is_msg_pane_expanded? 2 : 0), 3); - S32 summary_width_of_visible_borders = number_of_visible_borders * LLPANEL_BORDER_WIDTH; - S32 conv_pane_target_width = is_conv_pane_expanded? - (is_msg_pane_expanded? - mConversationsPane->getRect().getWidth() - : mConversationsPane->getExpandedMinDim()) - : mConversationsPane->getMinDim(); + S32 summary_width_of_visible_borders = (is_msg_pane_expanded ? mConversationsStack->getPanelSpacing() : 0) + 1; + + S32 conv_pane_target_width = is_conv_pane_expanded + ? ( is_msg_pane_expanded?mConversationsPane->getRect().getWidth():mConversationsPane->getExpandedMinDim() ) + : mConversationsPane->getMinDim(); + S32 msg_pane_min_width = is_msg_pane_expanded ? mMessagesPane->getExpandedMinDim() : 0; S32 new_min_width = conv_pane_target_width + msg_pane_min_width + summary_width_of_visible_borders; @@ -961,11 +995,11 @@ void LLFloaterIMContainer::setSortOrder(const LLConversationSort& order) conversation_floater->setSortOrder(order); } } - + gSavedSettings.setU32("ConversationSortOrder", (U32)order); } -void LLFloaterIMContainer::getSelectedUUIDs(uuid_vec_t& selected_uuids) +void LLFloaterIMContainer::getSelectedUUIDs(uuid_vec_t& selected_uuids, bool participant_uuids/* = true*/) { const std::set<LLFolderViewItem*> selectedItems = mConversationsRoot->getSelectionList(); @@ -978,7 +1012,7 @@ void LLFloaterIMContainer::getSelectedUUIDs(uuid_vec_t& selected_uuids) conversationItem = static_cast<LLConversationItem *>((*it)->getViewModelItem()); //When a one-on-one conversation exists, retrieve the participant id from the conversation floater - if(conversationItem->getType() == LLConversationItem::CONV_SESSION_1_ON_1) + if(conversationItem->getType() == LLConversationItem::CONV_SESSION_1_ON_1 && participant_uuids) { LLFloaterIMSession * conversation_floaterp = LLFloaterIMSession::findInstance(conversationItem->getUUID()); LLUUID participant_id = conversation_floaterp->getOtherParticipantUUID(); @@ -1133,6 +1167,11 @@ void LLFloaterIMContainer::doToSelectedConversation(const std::string& command, { LLFloater::onClickClose(conversationFloater); } + else if("close_selected_conversations" == command) + { + getSelectedUUIDs(selectedIDS,false); + closeSelectedConversations(selectedIDS); + } else if("open_voice_conversation" == command) { gIMMgr->startCall(conversationItem->getUUID()); @@ -1143,7 +1182,7 @@ void LLFloaterIMContainer::doToSelectedConversation(const std::string& command, } else if("chat_history" == command) { - if (selectedIDS.size() > 0) + if (selectedIDS.size() > 0) { LLAvatarActions::viewChatHistory(selectedIDS.front()); } @@ -1156,6 +1195,17 @@ void LLFloaterIMContainer::doToSelectedConversation(const std::string& command, } } } + //if there is no LLFloaterIMSession* instance for selected conversation it might be Nearby chat + else + { + if(conversationItem->getType() == LLConversationItem::CONV_SESSION_NEARBY) + { + if("chat_history" == command) + { + LLFloaterReg::showInstance("preview_conversation", LLSD(LLUUID::null), true); + } + } + } } void LLFloaterIMContainer::doToSelected(const LLSD& userdata) @@ -1185,7 +1235,7 @@ void LLFloaterIMContainer::doToSelectedGroup(const LLSD& userdata) if (action == "group_profile") { - LLGroupActions::show(mSelectedSession); + LLGroupActions::show(mSelectedSession); } else if (action == "activate_group") { @@ -1211,7 +1261,19 @@ bool LLFloaterIMContainer::enableContextMenuItem(const LLSD& userdata) //Enable Chat history item for ad-hoc and group conversations if ("can_chat_history" == item && uuids.size() > 0) { - return LLLogChat::isTranscriptExist(uuids.front()); + //Disable menu item if selected participant is user agent + if(uuids.front() != gAgentID) + { + if (getCurSelectedViewModelItem()->getType() == LLConversationItem::CONV_SESSION_NEARBY) + { + return LLLogChat::isNearbyTranscriptExist(); + } + else + { + bool is_group = (getCurSelectedViewModelItem()->getType() == LLConversationItem::CONV_SESSION_GROUP); + return LLLogChat::isTranscriptExist(uuids.front(),is_group); + } + } } // If nothing is selected(and selected item is not group chat), everything needs to be disabled @@ -1547,7 +1609,7 @@ LLConversationItem* LLFloaterIMContainer::addConversationListItem(const LLUUID& // Create the participants widgets now // Note: usually, we do not get an updated avatar list at that point - if (uuid.isNull() || im_sessionp && !im_sessionp->isP2PSessionType()) + if (uuid.isNull() || (im_sessionp && !im_sessionp->isP2PSessionType())) { LLFolderViewModelItemCommon::child_list_t::const_iterator current_participant_model = item->getChildrenBegin(); LLFolderViewModelItemCommon::child_list_t::const_iterator end_participant_model = item->getChildrenEnd(); @@ -1886,13 +1948,6 @@ void LLFloaterIMContainer::openNearbyChat() } } -void LLFloaterIMContainer::onNearbyChatClosed() -{ - // If nearby chat is the only remaining conversation and it is closed, close whole conversation floater as well - if (mConversationsItems.size() == 1) - closeFloater(); -} - void LLFloaterIMContainer::reSelectConversation() { LLFloaterIMSessionTab* session_floater = LLFloaterIMSessionTab::getConversation(mSelectedSession); @@ -1904,7 +1959,6 @@ void LLFloaterIMContainer::reSelectConversation() void LLFloaterIMContainer::updateSpeakBtnState() { - LLButton* mSpeakBtn = getChild<LLButton>("speak_btn"); mSpeakBtn->setToggleState(LLVoiceClient::getInstance()->getUserPTTState()); mSpeakBtn->setEnabled(LLAgent::isActionAllowed("speak")); } @@ -1925,6 +1979,17 @@ void LLFloaterIMContainer::flashConversationItemWidget(const LLUUID& session_id, } } +void LLFloaterIMContainer::highlightConversationItemWidget(const LLUUID& session_id, bool is_highlighted) +{ + //Finds the conversation line item to highlight using the session_id + LLConversationViewSession * widget = dynamic_cast<LLConversationViewSession *>(get_ptr_in_map(mConversationsWidgets,session_id)); + + if (widget) + { + widget->setHighlightState(is_highlighted); + } +} + bool LLFloaterIMContainer::isScrolledOutOfSight(LLConversationViewSession* conversation_item_widget) { llassert(conversation_item_widget != NULL); @@ -1940,23 +2005,28 @@ bool LLFloaterIMContainer::isScrolledOutOfSight(LLConversationViewSession* conve BOOL LLFloaterIMContainer::handleKeyHere(KEY key, MASK mask ) { + BOOL handled = FALSE; + if(mask == MASK_ALT) { if (KEY_RETURN == key ) { expandConversation(); + handled = TRUE; } if ((KEY_DOWN == key ) || (KEY_RIGHT == key)) { selectNextorPreviousConversation(true); + handled = TRUE; } if ((KEY_UP == key) || (KEY_LEFT == key)) { selectNextorPreviousConversation(false); + handled = TRUE; } } - return TRUE; + return handled; } bool LLFloaterIMContainer::selectAdjacentConversation(bool focus_selected) @@ -2013,7 +2083,22 @@ void LLFloaterIMContainer::expandConversation() } } -void LLFloaterIMContainer::closeFloater(bool app_quitting/* = false*/) +// By default, if torn off session is currently frontmost, LLFloater::isFrontmost() will return FALSE, which can lead to some bugs +// So LLFloater::isFrontmost() is overriden here to check both selected session and the IM floater itself +// Exclude "Nearby Chat" session from the check, as "Nearby Chat" window and "Conversations" floater can be brought +// to front independently +/*virtual*/ +BOOL LLFloaterIMContainer::isFrontmost() +{ + LLFloaterIMSessionTab* selected_session = LLFloaterIMSessionTab::getConversation(mSelectedSession); + LLFloaterIMNearbyChat* nearby_chat = LLFloaterReg::findTypedInstance<LLFloaterIMNearbyChat>("nearby_chat"); + return (selected_session && selected_session->isFrontmost() && (selected_session != nearby_chat)) + || LLFloater::isFrontmost(); +} + +// For conversations, closeFloater() (linked to Ctrl-W) does not actually close the floater but the active conversation. +// This is intentional so it doesn't confuse the user. onClickCloseBtn() closes the whole floater. +void LLFloaterIMContainer::onClickCloseBtn() { // Always unminimize before trying to close. // Most of the time the user will never see this state. @@ -2022,7 +2107,80 @@ void LLFloaterIMContainer::closeFloater(bool app_quitting/* = false*/) LLMultiFloater::setMinimized(FALSE); } - LLFloater::closeFloater(app_quitting); + LLFloater::closeFloater(); +} + +void LLFloaterIMContainer::closeHostedFloater() +{ + onClickCloseBtn(); +} + +void LLFloaterIMContainer::closeAllConversations() +{ + LLDynamicArray<LLUUID> ids; + for (conversations_items_map::iterator it_session = mConversationsItems.begin(); it_session != mConversationsItems.end(); it_session++) + { + LLUUID session_id = it_session->first; + if (session_id != LLUUID()) + { + ids.push_back(session_id); + } + } + + for (LLDynamicArray<LLUUID>::const_iterator it = ids.begin(); it != ids.end(); ++it) + { + LLFloaterIMSession *conversationFloater = LLFloaterIMSession::findInstance(*it); + LLFloater::onClickClose(conversationFloater); + } +} + +void LLFloaterIMContainer::closeSelectedConversations(const uuid_vec_t& ids) +{ + for (uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); ++it) + { + //We don't need to close Nearby chat, so skip it + if (*it != LLUUID()) + { + LLFloaterIMSession *conversationFloater = LLFloaterIMSession::findInstance(*it); + if(conversationFloater) + { + LLFloater::onClickClose(conversationFloater); + } + } + } +} +void LLFloaterIMContainer::closeFloater(bool app_quitting/* = false*/) +{ + if(app_quitting) + { + closeAllConversations(); + onClickCloseBtn(); + } + else + { + // Check for currently active session + LLUUID session_id = getSelectedSession(); + // If current session is Nearby Chat or there is only one session remaining, close the floater + if (mConversationsItems.size() == 1 || session_id == LLUUID() || app_quitting) + { + onClickCloseBtn(); + } + else + { + // Otherwise, close current conversation + LLFloaterIMSessionTab* active_conversation = LLFloaterIMSessionTab::getConversation(session_id); + if (active_conversation) + { + active_conversation->closeFloater(); + } + } + } +} + +void LLFloaterIMContainer::handleReshape(const LLRect& rect, bool by_user) +{ + LLMultiFloater::handleReshape(rect, by_user); + storeRectControl(); } // EOF diff --git a/indra/newview/llfloaterimcontainer.h b/indra/newview/llfloaterimcontainer.h index e39d20ec35..36da457cac 100755 --- a/indra/newview/llfloaterimcontainer.h +++ b/indra/newview/llfloaterimcontainer.h @@ -63,6 +63,8 @@ public: /*virtual*/ void setVisible(BOOL visible); /*virtual*/ void setVisibleAndFrontmost(BOOL take_focus=TRUE, const LLSD& key = LLSD()); /*virtual*/ void updateResizeLimits(); + /*virtual*/ void handleReshape(const LLRect& rect, bool by_user); + void onCloseFloater(LLUUID& id); /*virtual*/ void addFloater(LLFloater* floaterp, @@ -105,8 +107,6 @@ public: LLConversationItem* getSessionModel(const LLUUID& session_id) { return get_ptr_in_map(mConversationsItems,session_id); } LLConversationSort& getSortOrder() { return mConversationViewModel.getSorter(); } - void onNearbyChatClosed(); - // Handling of lists of participants is public so to be common with llfloatersessiontab // *TODO : Find a better place for this. bool checkContextMenuItem(const std::string& item, uuid_vec_t& selectedIDS); @@ -116,6 +116,10 @@ public: void assignResizeLimits(); virtual BOOL handleKeyHere(KEY key, MASK mask ); /*virtual*/ void closeFloater(bool app_quitting = false); + void closeAllConversations(); + void closeSelectedConversations(const uuid_vec_t& ids); + /*virtual*/ BOOL isFrontmost(); + private: typedef std::map<LLUUID,LLFloater*> avatarID_panel_map_t; @@ -130,6 +134,8 @@ private: void onStubCollapseButtonClicked(); void processParticipantsStyleUpdate(); void onSpeakButtonClicked(); + /*virtual*/ void onClickCloseBtn(); + /*virtual*/ void closeHostedFloater(); void collapseConversationsPane(bool collapse, bool save_is_allowed=true); @@ -144,7 +150,7 @@ private: void setSortOrderParticipants(const LLConversationFilter::ESortOrderType order); void setSortOrder(const LLConversationSort& order); - void getSelectedUUIDs(uuid_vec_t& selected_uuids); + void getSelectedUUIDs(uuid_vec_t& selected_uuids, bool participant_uuids = true); const LLConversationItem * getCurSelectedViewModelItem(); void getParticipantUUIDs(uuid_vec_t& selected_uuids); void doToSelected(const LLSD& userdata); @@ -169,6 +175,7 @@ private: LLButton* mExpandCollapseBtn; LLButton* mStubCollapseBtn; + LLButton* mSpeakBtn; LLPanel* mStubPanel; LLTextBox* mStubTextBox; LLLayoutPanel* mMessagesPane; @@ -176,6 +183,7 @@ private: LLLayoutStack* mConversationsStack; bool mInitialized; + bool mIsFirstLaunch; LLUUID mSelectedSession; std::string mGeneralTitle; @@ -190,9 +198,12 @@ public: void updateSpeakBtnState(); static bool isConversationLoggingAllowed(); void flashConversationItemWidget(const LLUUID& session_id, bool is_flashes); + void highlightConversationItemWidget(const LLUUID& session_id, bool is_highlighted); bool isScrolledOutOfSight(LLConversationViewSession* conversation_item_widget); boost::signals2::connection mMicroChangedSignal; S32 getConversationListItemSize() { return mConversationsWidgets.size(); } + typedef std::list<LLFloater*> floater_list_t; + void getDetachedConversationFloaters(floater_list_t& floaters); private: LLConversationViewSession* createConversationItemWidget(LLConversationItem* item); diff --git a/indra/newview/llfloaterimnearbychat.cpp b/indra/newview/llfloaterimnearbychat.cpp index 56b0c15cb9..3d77ea4f0b 100755 --- a/indra/newview/llfloaterimnearbychat.cpp +++ b/indra/newview/llfloaterimnearbychat.cpp @@ -125,7 +125,7 @@ BOOL LLFloaterIMNearbyChat::postBuild() setTitle(LLTrans::getString("NearbyChatTitle")); // obsolete, but may be needed for backward compatibility? - gSavedSettings.declareS32("nearbychat_showicons_and_names", 2, "NearByChat header settings", true); + gSavedSettings.declareS32("nearbychat_showicons_and_names", 2, "NearByChat header settings", LLControlVariable::PERSIST_NONDFT); if (gSavedPerAccountSettings.getBOOL("LogShowHistory")) { @@ -138,19 +138,28 @@ BOOL LLFloaterIMNearbyChat::postBuild() // virtual void LLFloaterIMNearbyChat::closeHostedFloater() { - // Should check how many conversations are ongoing. Close all if 1 only (the Nearby Chat), select next one otherwise + // If detached from conversations window close anyway + if (!getHost()) + { + setVisible(FALSE); + } + + // Should check how many conversations are ongoing. Select next to "Nearby Chat" in case there are some other besides. + // Close conversations window in case "Nearby Chat" is attached and the only conversation LLFloaterIMContainer* floater_container = LLFloaterIMContainer::getInstance(); if (floater_container->getConversationListItemSize() == 1) { - floater_container->closeFloater(); + if (getHost()) + { + floater_container->closeFloater(); + } } else { if (!getHost()) { - setVisible(FALSE); + floater_container->selectNextConversationByID(LLUUID()); } - floater_container->selectNextConversationByID(LLUUID()); } } @@ -262,7 +271,7 @@ void LLFloaterIMNearbyChat::setVisibleAndFrontmost(BOOL take_focus, const LLSD& { LLFloaterIMSessionTab::setVisibleAndFrontmost(take_focus, key); - if(!isTornOff() && matchesKey(key)) + if(matchesKey(key)) { LLFloaterIMContainer::getInstance()->selectConversationPair(mSessionID, true, take_focus); } @@ -296,7 +305,6 @@ void LLFloaterIMNearbyChat::onClose(bool app_quitting) { // Override LLFloaterIMSessionTab::onClose() so that Nearby Chat is not removed from the conversation floater LLFloaterIMSessionTab::restoreFloater(); - onClickCloseBtn(); } // virtual @@ -306,13 +314,7 @@ void LLFloaterIMNearbyChat::onClickCloseBtn() { return; } - LLFloaterIMSessionTab::onTearOffClicked(); - - LLFloaterIMContainer *im_box = LLFloaterIMContainer::findInstance(); - if (im_box) - { - im_box->onNearbyChatClosed(); - } + closeHostedFloater(); } void LLFloaterIMNearbyChat::onChatFontChange(LLFontGL* fontp) @@ -350,11 +352,17 @@ bool LLFloaterIMNearbyChat::isChatVisible() const void LLFloaterIMNearbyChat::showHistory() { openFloater(); + LLFloaterIMContainer::getInstance()->selectConversation(LLUUID(NULL)); + if(!isMessagePaneExpanded()) { restoreFloater(); setFocus(true); } + else + { + LLFloaterIMContainer::getInstance()->setFocus(TRUE); + } setResizeLimits(getMinWidth(), EXPANDED_MIN_HEIGHT); } @@ -568,7 +576,10 @@ void LLFloaterIMNearbyChat::sendChat( EChatType type ) if (0 == channel) { // discard returned "found" boolean - LLGestureMgr::instance().triggerAndReviseString(utf8text, &utf8_revised_text); + if(!LLGestureMgr::instance().triggerAndReviseString(utf8text, &utf8_revised_text)) + { + utf8_revised_text = utf8text; + } } else { @@ -582,7 +593,7 @@ void LLFloaterIMNearbyChat::sendChat( EChatType type ) if (!utf8_revised_text.empty()) { // Chat with animation - sendChatFromViewer(utf8_revised_text, type, TRUE); + sendChatFromViewer(utf8_revised_text, type, gSavedSettings.getBOOL("PlayChatAnim")); } } @@ -636,10 +647,7 @@ void LLFloaterIMNearbyChat::addMessage(const LLChat& chat,bool archive,const LLS void LLFloaterIMNearbyChat::onChatBoxCommit() { - if (mInputEditor->getText().length() > 0) - { - sendChat(CHAT_TYPE_NORMAL); - } + sendChat(CHAT_TYPE_NORMAL); gAgent.stopTyping(); } diff --git a/indra/newview/llfloaterimnearbychathandler.cpp b/indra/newview/llfloaterimnearbychathandler.cpp index 9ce5e12897..a8f815c389 100755 --- a/indra/newview/llfloaterimnearbychathandler.cpp +++ b/indra/newview/llfloaterimnearbychathandler.cpp @@ -187,14 +187,11 @@ void LLFloaterIMNearbyChatScreenChannel::deactivateToast(LLToast* toast) { toast_vec_t::iterator pos = std::find(m_active_toasts.begin(), m_active_toasts.end(), toast->getHandle()); - if (pos == m_active_toasts.end()) + if (pos != m_active_toasts.end()) { - llassert(pos == m_active_toasts.end()); - return; + LL_DEBUGS("NearbyChat") << "Deactivating toast" << llendl; + m_active_toasts.erase(pos); } - - LL_DEBUGS("NearbyChat") << "Deactivating toast" << llendl; - m_active_toasts.erase(pos); } void LLFloaterIMNearbyChatScreenChannel::createOverflowToast(S32 bottom, F32 timer) @@ -210,8 +207,8 @@ void LLFloaterIMNearbyChatScreenChannel::onToastDestroyed(LLToast* toast, bool a { // Viewer is quitting. // Immediately stop processing chat messages (EXT-1419). - mStopProcessing = true; -} + mStopProcessing = true; + } else { // The toast is being closed by user (STORM-192). @@ -606,6 +603,7 @@ void LLFloaterIMNearbyChatHandler::processChat(const LLChat& chat_msg, //Don't show nearby toast, if conversation is visible and selected if ((nearby_chat->hasFocus()) || + (LLFloater::isVisible(nearby_chat) && nearby_chat->isTornOff() && !nearby_chat->isMinimized()) || ((im_box->getSelectedSession().isNull() && ((LLFloater::isVisible(im_box) && !im_box->isMinimized() && im_box->isFrontmost()) || (LLFloater::isVisible(nearby_chat) && !nearby_chat->isMinimized() && nearby_chat->isFrontmost()))))) diff --git a/indra/newview/llfloaterimnearbychatlistener.cpp b/indra/newview/llfloaterimnearbychatlistener.cpp index 14a22bcd84..5a5f6c72c8 100755 --- a/indra/newview/llfloaterimnearbychatlistener.cpp +++ b/indra/newview/llfloaterimnearbychatlistener.cpp @@ -33,7 +33,7 @@ #include "llagent.h" #include "llchat.h" - +#include "llviewercontrol.h" LLFloaterIMNearbyChatListener::LLFloaterIMNearbyChatListener(LLFloaterIMNearbyChat & chatbar) @@ -95,6 +95,6 @@ void LLFloaterIMNearbyChatListener::sendChat(LLSD const & chat_data) const } // Send it as if it was typed in - mChatbar.sendChatFromViewer(chat_to_send, type_o_chat, (BOOL)(channel == 0)); + mChatbar.sendChatFromViewer(chat_to_send, type_o_chat, ((BOOL)(channel == 0)) && gSavedSettings.getBOOL("PlayChatAnim")); } diff --git a/indra/newview/llfloaterimsession.cpp b/indra/newview/llfloaterimsession.cpp index 8ec85e1160..5cb9df5625 100755 --- a/indra/newview/llfloaterimsession.cpp +++ b/indra/newview/llfloaterimsession.cpp @@ -109,18 +109,6 @@ void LLFloaterIMSession::refresh() void LLFloaterIMSession::onTearOffClicked() { LLFloaterIMSessionTab::onTearOffClicked(); - - if(mIsP2PChat) - { - if(isTornOff()) - { - mSpeakingIndicator->setSpeakerId(mOtherParticipantUUID, mSessionID); - } - else - { - mSpeakingIndicator->setSpeakerId(LLUUID::null); - } - } } // virtual @@ -442,8 +430,11 @@ void LLFloaterIMSession::addSessionParticipants(const uuid_vec_t& uuids) } else { - // remember whom we have invited, to notify others later, when the invited ones actually join - mInvitedParticipants.insert(mInvitedParticipants.end(), uuids.begin(), uuids.end()); + if(findInstance(mSessionID)) + { + // remember whom we have invited, to notify others later, when the invited ones actually join + mInvitedParticipants.insert(mInvitedParticipants.end(), uuids.begin(), uuids.end()); + } inviteToSession(uuids); } @@ -469,13 +460,18 @@ void LLFloaterIMSession::addP2PSessionParticipants(const LLSD& notification, con temp_ids.insert(temp_ids.end(), uuids.begin(), uuids.end()); // then we can close the current session - onClose(false); + if(findInstance(mSessionID)) + { + onClose(false); + + // remember whom we have invited, to notify others later, when the invited ones actually join + mInvitedParticipants.insert(mInvitedParticipants.end(), uuids.begin(), uuids.end()); + } // we start a new session so reset the initialization flag mSessionInitialized = false; - // remember whom we have invited, to notify others later, when the invited ones actually join - mInvitedParticipants.insert(mInvitedParticipants.end(), uuids.begin(), uuids.end()); + // Start a new ad hoc voice call if we invite new participants to a P2P call, // or start a text chat otherwise. diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index ce6e639305..0ccfdb9a7b 100755 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -55,7 +55,6 @@ LLFloaterIMSessionTab::LLFloaterIMSessionTab(const LLSD& session_id) , mSessionID(session_id.asUUID()) , mConversationsRoot(NULL) , mScroller(NULL) - , mSpeakingIndicator(NULL) , mChatHistory(NULL) , mInputEditor(NULL) , mInputEditorPad(0) @@ -212,7 +211,7 @@ void LLFloaterIMSessionTab::assignResizeLimits() mRightPartPanel->setIgnoreReshape(is_participants_pane_collapsed); S32 participants_pane_target_width = is_participants_pane_collapsed? - 0 : (mParticipantListPanel->getRect().getWidth() + LLPANEL_BORDER_WIDTH); + 0 : (mParticipantListPanel->getRect().getWidth() + mParticipantListAndHistoryStack->getPanelSpacing()); S32 new_min_width = participants_pane_target_width + mRightPartPanel->getExpandedMinDim() + mFloaterExtraWidth; @@ -241,7 +240,10 @@ BOOL LLFloaterIMSessionTab::postBuild() mTearOffBtn->setCommitCallback(boost::bind(&LLFloaterIMSessionTab::onTearOffClicked, this)); mGearBtn = getChild<LLButton>("gear_btn"); - + mAddBtn = getChild<LLButton>("add_btn"); + mVoiceButton = getChild<LLButton>("voice_call_btn"); + mTranslationCheckBox = getChild<LLUICtrl>("translate_chat_checkbox_lp"); + mParticipantListPanel = getChild<LLLayoutPanel>("speakers_list_panel"); mRightPartPanel = getChild<LLLayoutPanel>("right_part_holder"); @@ -256,8 +258,6 @@ BOOL LLFloaterIMSessionTab::postBuild() scroller_params.rect(scroller_view_rect); mScroller = LLUICtrlFactory::create<LLFolderViewScrollContainer>(scroller_params); mScroller->setFollowsAll(); - - mSpeakingIndicator = getChild<LLOutputMonitorCtrl>("speaking_indicator"); // Insert that scroller into the panel widgets hierarchy mParticipantListPanel->addChild(mScroller); @@ -270,6 +270,7 @@ BOOL LLFloaterIMSessionTab::postBuild() mInputPanels = getChild<LLLayoutStack>("input_panels"); mInputEditor->setTextExpandedCallback(boost::bind(&LLFloaterIMSessionTab::reshapeChatLayoutPanel, this)); + mInputEditor->setMouseUpCallback(boost::bind(&LLFloaterIMSessionTab::onInputEditorClicked, this)); mInputEditor->setCommitOnFocusLost( FALSE ); mInputEditor->setPassDelete(TRUE); mInputEditor->setFont(LLViewerChat::getChatFont()); @@ -372,7 +373,7 @@ void LLFloaterIMSessionTab::draw() void LLFloaterIMSessionTab::enableDisableCallBtn() { - getChildView("voice_call_btn")->setEnabled( + mVoiceButton->setEnabled( mSessionID.notNull() && mSession && mSession->mSessionInitialized @@ -399,6 +400,16 @@ void LLFloaterIMSessionTab::onFocusLost() LLTransientDockableFloater::onFocusLost(); } +void LLFloaterIMSessionTab::onInputEditorClicked() +{ + LLFloaterIMContainer* im_box = LLFloaterIMContainer::findInstance(); + if (im_box) + { + im_box->flashConversationItemWidget(mSessionID,false); + } + gToolBarView->flashCommand(LLCommandId("chat"), false); +} + std::string LLFloaterIMSessionTab::appendTime() { time_t utc_time; @@ -758,7 +769,7 @@ void LLFloaterIMSessionTab::reshapeChatLayoutPanel() void LLFloaterIMSessionTab::showTranslationCheckbox(BOOL show) { - getChild<LLUICtrl>("translate_chat_checkbox_lp")->setVisible(mIsNearbyChat? show : FALSE); + mTranslationCheckBox->setVisible(mIsNearbyChat && show); } // static @@ -805,15 +816,10 @@ void LLFloaterIMSessionTab::reloadEmptyFloaters() void LLFloaterIMSessionTab::updateCallBtnState(bool callIsActive) { - LLButton* voiceButton = getChild<LLButton>("voice_call_btn"); - voiceButton->setImageOverlay( - callIsActive? getString("call_btn_stop") : getString("call_btn_start")); - - voiceButton->setToolTip( - callIsActive? getString("end_call_button_tooltip") : getString("start_call_button_tooltip")); + mVoiceButton->setImageOverlay(callIsActive? getString("call_btn_stop") : getString("call_btn_start")); + mVoiceButton->setToolTip(callIsActive? getString("end_call_button_tooltip") : getString("start_call_button_tooltip")); enableDisableCallBtn(); - } void LLFloaterIMSessionTab::onSlide(LLFloaterIMSessionTab* self) @@ -898,6 +904,7 @@ void LLFloaterIMSessionTab::restoreFloater() mExpandCollapseLineBtn->setImageOverlay(getString("expandline_icon")); setMessagePaneExpanded(true); saveCollapsedState(); + mInputEditor->enableSingleLineMode(false); enableResizeCtrls(true, true, true); } } @@ -953,8 +960,8 @@ void LLFloaterIMSessionTab::updateGearBtn() if(prevVisibility != mGearBtn->getVisible()) { LLRect gear_btn_rect = mGearBtn->getRect(); - LLRect add_btn_rect = getChild<LLButton>("add_btn")->getRect(); - LLRect call_btn_rect = getChild<LLButton>("voice_call_btn")->getRect(); + LLRect add_btn_rect = mAddBtn->getRect(); + LLRect call_btn_rect = mVoiceButton->getRect(); S32 gap_width = call_btn_rect.mLeft - add_btn_rect.mRight; S32 right_shift = gear_btn_rect.getWidth() + gap_width; if(mGearBtn->getVisible()) @@ -968,24 +975,24 @@ void LLFloaterIMSessionTab::updateGearBtn() add_btn_rect.translate(-right_shift,0); call_btn_rect.translate(-right_shift,0); } - getChild<LLButton>("add_btn")->setRect(add_btn_rect); - getChild<LLButton>("voice_call_btn")->setRect(call_btn_rect); + mAddBtn->setRect(add_btn_rect); + mVoiceButton->setRect(call_btn_rect); } } void LLFloaterIMSessionTab::initBtns() { LLRect gear_btn_rect = mGearBtn->getRect(); - LLRect add_btn_rect = getChild<LLButton>("add_btn")->getRect(); - LLRect call_btn_rect = getChild<LLButton>("voice_call_btn")->getRect(); + LLRect add_btn_rect = mAddBtn->getRect(); + LLRect call_btn_rect = mVoiceButton->getRect(); S32 gap_width = call_btn_rect.mLeft - add_btn_rect.mRight; S32 right_shift = gear_btn_rect.getWidth() + gap_width; add_btn_rect.translate(-right_shift,0); call_btn_rect.translate(-right_shift,0); - getChild<LLButton>("add_btn")->setRect(add_btn_rect); - getChild<LLButton>("voice_call_btn")->setRect(call_btn_rect); + mAddBtn->setRect(add_btn_rect); + mVoiceButton->setRect(call_btn_rect); } // static @@ -1083,21 +1090,26 @@ void LLFloaterIMSessionTab::saveCollapsedState() } BOOL LLFloaterIMSessionTab::handleKeyHere(KEY key, MASK mask ) { + BOOL handled = FALSE; + if(mask == MASK_ALT) { LLFloaterIMContainer* floater_container = LLFloaterIMContainer::getInstance(); if (KEY_RETURN == key && !isTornOff()) { floater_container->expandConversation(); + handled = TRUE; } if ((KEY_UP == key) || (KEY_LEFT == key)) { floater_container->selectNextorPreviousConversation(false); + handled = TRUE; } if ((KEY_DOWN == key ) || (KEY_RIGHT == key)) { floater_container->selectNextorPreviousConversation(true); + handled = TRUE; } } - return TRUE; + return handled; } diff --git a/indra/newview/llfloaterimsessiontab.h b/indra/newview/llfloaterimsessiontab.h index 302d5a8066..e7b05a584b 100755 --- a/indra/newview/llfloaterimsessiontab.h +++ b/indra/newview/llfloaterimsessiontab.h @@ -171,8 +171,7 @@ protected: LLFolderView* mConversationsRoot; LLScrollContainer* mScroller; - LLOutputMonitorCtrl* mSpeakingIndicator; - LLChatHistory* mChatHistory; + LLChatHistory* mChatHistory; LLChatEntry* mInputEditor; LLLayoutPanel * mChatLayoutPanel; LLLayoutStack * mInputPanels; @@ -182,6 +181,9 @@ protected: LLButton* mTearOffBtn; LLButton* mCloseBtn; LLButton* mGearBtn; + LLButton* mAddBtn; + LLButton* mVoiceButton; + LLUICtrl* mTranslationCheckBox; private: // Handling selection and contextual menu @@ -201,6 +203,8 @@ private: */ void reshapeChatLayoutPanel(); + void onInputEditorClicked(); + bool checkIfTornOff(); bool mIsHostAttached; bool mHasVisibleBeenInitialized; diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 8290494c22..6ef4d8717d 100755 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -2027,6 +2027,10 @@ void LLPanelLandOptions::refresh() mSnapshotCtrl->setImageAssetID(parcel->getSnapshotID()); mSnapshotCtrl->setEnabled( can_change_identity ); + // find out where we're looking and convert that to an angle in degrees on a regular compass (not the internal representation) + LLVector3 user_look_at = parcel->getUserLookAt(); + U32 user_look_at_angle = ( (U32)( ( atan2(user_look_at[1], -user_look_at[0]) + F_PI * 2 ) * RAD_TO_DEG + 0.5) - 90) % 360; + LLVector3 pos = parcel->getUserLocation(); if (pos.isExactlyZero()) { @@ -2034,10 +2038,11 @@ void LLPanelLandOptions::refresh() } else { - mLocationText->setTextArg("[LANDING]",llformat("%d, %d, %d", + mLocationText->setTextArg("[LANDING]",llformat("%d, %d, %d (%d\xC2\xB0)", llround(pos.mV[VX]), llround(pos.mV[VY]), - llround(pos.mV[VZ]))); + llround(pos.mV[VZ]), + user_look_at_angle)); } mSetBtn->setEnabled( can_change_landing_point ); @@ -2118,7 +2123,7 @@ void LLPanelLandOptions::refreshSearch() bool can_change = LLViewerParcelMgr::isParcelModifiableByAgent( - parcel, GP_LAND_CHANGE_IDENTITY) + parcel, GP_LAND_FIND_PLACES) && region && !(region->getRegionFlag(REGION_FLAGS_BLOCK_PARCEL_SEARCH)); diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 100f1d580b..19cec55837 100755 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -290,6 +290,22 @@ bool ll_is_degenerate(const LLVector4a& a, const LLVector4a& b, const LLVector4a bool validate_face(const LLVolumeFace& face) { + + for (U32 v = 0; v < face.mNumVertices; v++) + { + if(face.mPositions && !face.mPositions[v].isFinite3()) + { + llwarns << "NaN position data in face found!" << llendl; + return false; + } + + if(face.mNormals && !face.mNormals[v].isFinite3()) + { + llwarns << "NaN normal data in face found!" << llendl; + return false; + } + } + for (U32 i = 0; i < face.mNumIndices; ++i) { if (face.mIndices[i] >= face.mNumVertices) @@ -305,8 +321,10 @@ bool validate_face(const LLVolumeFace& face) return false; } + /*const LLVector4a scale(0.5f); + for (U32 i = 0; i < face.mNumIndices; i+=3) { U16 idx1 = face.mIndices[i]; @@ -323,7 +341,6 @@ bool validate_face(const LLVolumeFace& face) return false; } }*/ - return true; } @@ -5921,3 +5938,5 @@ void LLFloaterModelPreview::setPermissonsErrorStatus(U32 status, const std::stri LLNotificationsUtil::add("MeshUploadPermError"); } + + diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 55b03986d0..1969435ba1 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -337,7 +337,7 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) mCommitCallbackRegistrar.add("Pref.HardwareDefaults", boost::bind(&LLFloaterPreference::setHardwareDefaults, this)); mCommitCallbackRegistrar.add("Pref.VertexShaderEnable", boost::bind(&LLFloaterPreference::onVertexShaderEnable, this)); mCommitCallbackRegistrar.add("Pref.WindowedMod", boost::bind(&LLFloaterPreference::onCommitWindowedMode, this)); - mCommitCallbackRegistrar.add("Pref.UpdateSliderText", boost::bind(&LLFloaterPreference::onUpdateSliderText,this, _1,_2)); + mCommitCallbackRegistrar.add("Pref.UpdateSliderText", boost::bind(&LLFloaterPreference::refreshUI,this)); mCommitCallbackRegistrar.add("Pref.QualityPerformance", boost::bind(&LLFloaterPreference::onChangeQuality, this, _2)); mCommitCallbackRegistrar.add("Pref.applyUIColor", boost::bind(&LLFloaterPreference::applyUIColor, this ,_1, _2)); mCommitCallbackRegistrar.add("Pref.getUIColor", boost::bind(&LLFloaterPreference::getUIColor, this ,_1, _2)); @@ -452,6 +452,7 @@ BOOL LLFloaterPreference::postBuild() getChild<LLComboBox>("ConferenceIMOptions")->setCommitCallback(boost::bind(&LLFloaterPreference::onNotificationsChange, this,"ConferenceIMOptions")); getChild<LLComboBox>("GroupChatOptions")->setCommitCallback(boost::bind(&LLFloaterPreference::onNotificationsChange, this,"GroupChatOptions")); getChild<LLComboBox>("NearbyChatOptions")->setCommitCallback(boost::bind(&LLFloaterPreference::onNotificationsChange, this,"NearbyChatOptions")); + getChild<LLComboBox>("ObjectIMOptions")->setCommitCallback(boost::bind(&LLFloaterPreference::onNotificationsChange, this,"ObjectIMOptions")); // if floater is opened before login set default localized do not disturb message if (LLStartUp::getStartupState() < STATE_STARTED) @@ -721,6 +722,7 @@ void LLFloaterPreference::onOpen(const LLSD& key) onNotificationsChange("ConferenceIMOptions"); onNotificationsChange("GroupChatOptions"); onNotificationsChange("NearbyChatOptions"); + onNotificationsChange("ObjectIMOptions"); LLPanelLogin::setAlwaysRefresh(true); refresh(); @@ -928,7 +930,7 @@ void LLFloaterPreference::onNotificationsChange(const std::string& OptionName) bool show_notifications_alert = true; for (notifications_map::iterator it_notification = mNotificationOptions.begin(); it_notification != mNotificationOptions.end(); it_notification++) { - if(it_notification->second != "None") + if(it_notification->second != "No action") { show_notifications_alert = false; break; @@ -1148,6 +1150,8 @@ void LLFloaterPreference::refreshEnabledState() //Deferred/SSAO/Shadows LLCheckBoxCtrl* ctrl_deferred = getChild<LLCheckBoxCtrl>("UseLightShaders"); + LLCheckBoxCtrl* ctrl_deferred2 = getChild<LLCheckBoxCtrl>("UseLightShaders2"); + BOOL enabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") && ((bumpshiny_ctrl && bumpshiny_ctrl->get()) ? TRUE : FALSE) && @@ -1157,11 +1161,13 @@ void LLFloaterPreference::refreshEnabledState() (ctrl_wind_light->get()) ? TRUE : FALSE; ctrl_deferred->setEnabled(enabled); - + ctrl_deferred2->setEnabled(enabled); + LLCheckBoxCtrl* ctrl_ssao = getChild<LLCheckBoxCtrl>("UseSSAO"); LLCheckBoxCtrl* ctrl_dof = getChild<LLCheckBoxCtrl>("UseDoF"); LLComboBox* ctrl_shadow = getChild<LLComboBox>("ShadowDetail"); + // note, okay here to get from ctrl_deferred as it's twin, ctrl_deferred2 will alway match it enabled = enabled && LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferredSSAO") && (ctrl_deferred->get() ? TRUE : FALSE); ctrl_deferred->set(gSavedSettings.getBOOL("RenderDeferred")); @@ -1189,6 +1195,7 @@ void LLFloaterPreference::disableUnavailableSettings() LLCheckBoxCtrl* ctrl_wind_light = getChild<LLCheckBoxCtrl>("WindLightUseAtmosShaders"); LLCheckBoxCtrl* ctrl_avatar_impostors = getChild<LLCheckBoxCtrl>("AvatarImpostors"); LLCheckBoxCtrl* ctrl_deferred = getChild<LLCheckBoxCtrl>("UseLightShaders"); + LLCheckBoxCtrl* ctrl_deferred2 = getChild<LLCheckBoxCtrl>("UseLightShaders2"); LLComboBox* ctrl_shadows = getChild<LLComboBox>("ShadowDetail"); LLCheckBoxCtrl* ctrl_ssao = getChild<LLCheckBoxCtrl>("UseSSAO"); LLCheckBoxCtrl* ctrl_dof = getChild<LLCheckBoxCtrl>("UseDoF"); @@ -1222,6 +1229,8 @@ void LLFloaterPreference::disableUnavailableSettings() ctrl_deferred->setEnabled(FALSE); ctrl_deferred->setValue(FALSE); + ctrl_deferred2->setEnabled(FALSE); + ctrl_deferred2->setValue(FALSE); } // disabled windlight @@ -1242,6 +1251,8 @@ void LLFloaterPreference::disableUnavailableSettings() ctrl_deferred->setEnabled(FALSE); ctrl_deferred->setValue(FALSE); + ctrl_deferred2->setEnabled(FALSE); + ctrl_deferred2->setValue(FALSE); } // disabled deferred @@ -1259,6 +1270,8 @@ void LLFloaterPreference::disableUnavailableSettings() ctrl_deferred->setEnabled(FALSE); ctrl_deferred->setValue(FALSE); + ctrl_deferred2->setEnabled(FALSE); + ctrl_deferred2->setValue(FALSE); } // disabled deferred SSAO @@ -1303,6 +1316,8 @@ void LLFloaterPreference::disableUnavailableSettings() ctrl_deferred->setEnabled(FALSE); ctrl_deferred->setValue(FALSE); + ctrl_deferred2->setEnabled(FALSE); + ctrl_deferred2->setValue(FALSE); } // disabled cloth @@ -1331,6 +1346,7 @@ void LLFloaterPreference::refresh() updateSliderText(getChild<LLSliderCtrl>("FlexibleMeshDetail", true), getChild<LLTextBox>("FlexibleMeshDetailText", true)); updateSliderText(getChild<LLSliderCtrl>("TreeMeshDetail", true), getChild<LLTextBox>("TreeMeshDetailText", true)); updateSliderText(getChild<LLSliderCtrl>("AvatarMeshDetail", true), getChild<LLTextBox>("AvatarMeshDetailText", true)); + updateSliderText(getChild<LLSliderCtrl>("AvatarMeshDetail2", true), getChild<LLTextBox>("AvatarMeshDetailText2", true)); updateSliderText(getChild<LLSliderCtrl>("AvatarPhysicsDetail", true), getChild<LLTextBox>("AvatarPhysicsDetailText", true)); updateSliderText(getChild<LLSliderCtrl>("TerrainMeshDetail", true), getChild<LLTextBox>("TerrainMeshDetailText", true)); updateSliderText(getChild<LLSliderCtrl>("RenderPostProcess", true), getChild<LLTextBox>("PostProcessText", true)); @@ -1582,16 +1598,9 @@ void LLFloaterPreference::setPersonalInfo(const std::string& visibility, bool im getChildView("chat_font_size")->setEnabled(TRUE); } -void LLFloaterPreference::onUpdateSliderText(LLUICtrl* ctrl, const LLSD& name) +void LLFloaterPreference::refreshUI() { - std::string ctrl_name = name.asString(); - - if ((ctrl_name =="" )|| !hasChild(ctrl_name, TRUE)) - return; - - LLTextBox* text_box = getChild<LLTextBox>(name.asString()); - LLSliderCtrl* slider = dynamic_cast<LLSliderCtrl*>(ctrl); - updateSliderText(slider, text_box); + refresh(); } void LLFloaterPreference::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box) diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index 22e80a21cb..cb180f6f1e 100755 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -154,8 +154,7 @@ public: void onChangeQuality(const LLSD& data); void updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box); - void onUpdateSliderText(LLUICtrl* ctrl, const LLSD& name); -// void fractionFromDecimal(F32 decimal_val, S32& numerator, S32& denominator); + void refreshUI(); void onCommitParcelMediaAutoPlayEnable(); void onCommitMediaEnabled(); diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index 14923eec3c..7b25291da7 100755 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -1328,7 +1328,7 @@ void LLFloaterTools::getMediaState() getChildView("media_tex")->setEnabled(bool_has_media && editable); getChildView("edit_media")->setEnabled(bool_has_media && LLFloaterMediaSettings::getInstance()->mIdenticalHasMediaInfo && editable ); getChildView("delete_media")->setEnabled(bool_has_media && editable ); - getChildView("add_media")->setEnabled(( ! bool_has_media ) && editable ); + getChildView("add_media")->setEnabled(editable); // TODO: display a list of all media on the face - use 'identical' flag } else // not all face has media but at least one does. @@ -1358,7 +1358,7 @@ void LLFloaterTools::getMediaState() getChildView("media_tex")->setEnabled(TRUE); getChildView("edit_media")->setEnabled(LLFloaterMediaSettings::getInstance()->mIdenticalHasMediaInfo); getChildView("delete_media")->setEnabled(TRUE); - getChildView("add_media")->setEnabled(FALSE ); + getChildView("add_media")->setEnabled(editable); } media_info->setText(media_title); diff --git a/indra/newview/llfloatertools.h b/indra/newview/llfloatertools.h index ecb0092a6f..189bae46c2 100755 --- a/indra/newview/llfloatertools.h +++ b/indra/newview/llfloatertools.h @@ -109,6 +109,8 @@ public: static void setGridMode(S32 mode); + LLPanelFace* getPanelFace() { return mPanelFace; } + private: void refresh(); void refreshMedia(); diff --git a/indra/newview/llfloaterwebcontent.h b/indra/newview/llfloaterwebcontent.h index cfc87e9015..86b5a5e00b 100755 --- a/indra/newview/llfloaterwebcontent.h +++ b/indra/newview/llfloaterwebcontent.h @@ -43,6 +43,7 @@ class LLFloaterWebContent : public LLInstanceTracker<LLFloaterWebContent, std::string> { public: + typedef LLInstanceTracker<LLFloaterWebContent, std::string> instance_tracker_t; LOG_CLASS(LLFloaterWebContent); diff --git a/indra/newview/llfolderviewmodelinventory.cpp b/indra/newview/llfolderviewmodelinventory.cpp index 586965e5a0..c28657dbcd 100755 --- a/indra/newview/llfolderviewmodelinventory.cpp +++ b/indra/newview/llfolderviewmodelinventory.cpp @@ -74,6 +74,7 @@ void LLFolderViewModelInventory::sort( LLFolderViewFolder* folder ) it != end_it; ++it) { + // Recursive call to sort() on child (CHUI-849) LLFolderViewFolder* child_folderp = *it; sort(child_folderp); @@ -129,12 +130,12 @@ void LLFolderViewModelItemInventory::requestSort() void LLFolderViewModelItemInventory::setPassedFilter(bool passed, S32 filter_generation, std::string::size_type string_offset, std::string::size_type string_size) { LLFolderViewModelItemCommon::setPassedFilter(passed, filter_generation, string_offset, string_size); - - bool passed_filter_before = mPrevPassedAllFilters; + bool before = mPrevPassedAllFilters; mPrevPassedAllFilters = passedFilter(filter_generation); - if (passed_filter_before != mPrevPassedAllFilters) + if (before != mPrevPassedAllFilters) { + // Need to rearrange the folder if the filtered state of the item changed LLFolderViewFolder* parent_folder = mFolderViewItem->getParentFolder(); if (parent_folder) { @@ -150,11 +151,11 @@ bool LLFolderViewModelItemInventory::filterChildItem( LLFolderViewModelItem* ite bool continue_filtering = true; if (item->getLastFilterGeneration() < filter_generation) { - // recursive application of the filter for child items + // Recursive application of the filter for child items (CHUI-849) continue_filtering = item->filter( filter ); } - // track latest generation to pass any child items, for each folder up to root + // Update latest generation to pass filter in parent and propagate up to root if (item->passedFilter()) { LLFolderViewModelItemInventory* view_model = this; @@ -174,53 +175,61 @@ bool LLFolderViewModelItemInventory::filter( LLFolderViewFilter& filter) const S32 filter_generation = filter.getCurrentGeneration(); const S32 must_pass_generation = filter.getFirstRequiredGeneration(); - if (getLastFilterGeneration() >= must_pass_generation + if (getLastFilterGeneration() >= must_pass_generation && getLastFolderFilterGeneration() >= must_pass_generation && !passedFilter(must_pass_generation)) { // failed to pass an earlier filter that was a subset of the current one - // go ahead and flag this item as done + // go ahead and flag this item as not pass setPassedFilter(false, filter_generation); setPassedFolderFilter(false, filter_generation); return true; } - const bool passed_filter_folder = (getInventoryType() == LLInventoryType::IT_CATEGORY) - ? filter.checkFolder(this) - : true; + // *TODO : Revise the logic for fast pass on less restrictive filter case + /* + const S32 sufficient_pass_generation = filter.getFirstSuccessGeneration(); + if (getLastFilterGeneration() >= sufficient_pass_generation + && getLastFolderFilterGeneration() >= sufficient_pass_generation + && passedFilter(sufficient_pass_generation)) + { + // passed an earlier filter that was a superset of the current one + // go ahead and flag this item as pass + setPassedFilter(true, filter_generation); + setPassedFolderFilter(true, filter_generation); + return true; + } + */ + + const bool passed_filter_folder = (getInventoryType() == LLInventoryType::IT_CATEGORY) ? filter.checkFolder(this) : true; setPassedFolderFilter(passed_filter_folder, filter_generation); - if(!mChildren.empty() + bool continue_filtering = true; + + if (!mChildren.empty() && (getLastFilterGeneration() < must_pass_generation // haven't checked descendants against minimum required generation to pass - || descendantsPassedFilter(must_pass_generation))) // or at least one descendant has passed the minimum requirement + || descendantsPassedFilter(must_pass_generation))) // or at least one descendant has passed the minimum requirement { // now query children - for (child_list_t::iterator iter = mChildren.begin(), end_iter = mChildren.end(); - iter != end_iter && filter.getFilterCount() > 0; - ++iter) + for (child_list_t::iterator iter = mChildren.begin(), end_iter = mChildren.end(); iter != end_iter; ++iter) { - if (!filterChildItem((*iter), filter)) + continue_filtering = filterChildItem((*iter), filter); + if (!continue_filtering) { break; } } } - // if we didn't use all filter iterations - // that means we filtered all of our descendants - // so filter ourselves now - if (filter.getFilterCount() > 0) + // If we didn't use all the filter time that means we filtered all of our descendants so we can filter ourselves now + if (continue_filtering) { - filter.decrementFilterCount(); - + // This is where filter check on the item done (CHUI-849) const bool passed_filter = filter.check(this); setPassedFilter(passed_filter, filter_generation, filter.getStringMatchOffset(this), filter.getFilterStringSize()); - return true; - } - else - { - return false; + continue_filtering = !filter.isTimedOut(); } + return continue_filtering; } LLFolderViewModelInventory* LLInventoryPanel::getFolderViewModel() @@ -307,8 +316,8 @@ bool LLInventorySort::operator()(const LLFolderViewModelItemInventory* const& a, } } -LLFolderViewModelItemInventory::LLFolderViewModelItemInventory( class LLFolderViewModelInventory& root_view_model ) - : LLFolderViewModelItemCommon(root_view_model), - mPrevPassedAllFilters(false) +LLFolderViewModelItemInventory::LLFolderViewModelItemInventory( class LLFolderViewModelInventory& root_view_model ) : + LLFolderViewModelItemCommon(root_view_model), + mPrevPassedAllFilters(false) { } diff --git a/indra/newview/llfolderviewmodelinventory.h b/indra/newview/llfolderviewmodelinventory.h index 890d03d1c9..9dcfdfa185 100755 --- a/indra/newview/llfolderviewmodelinventory.h +++ b/indra/newview/llfolderviewmodelinventory.h @@ -59,9 +59,8 @@ public: virtual BOOL startDrag(EDragAndDropType* type, LLUUID* id) const = 0; virtual LLToolDragAndDrop::ESource getDragSource() const = 0; - protected: - bool mPrevPassedAllFilters; + bool mPrevPassedAllFilters; }; class LLInventorySort diff --git a/indra/newview/llgesturemgr.cpp b/indra/newview/llgesturemgr.cpp index 9aa86297fc..b56c34573d 100755 --- a/indra/newview/llgesturemgr.cpp +++ b/indra/newview/llgesturemgr.cpp @@ -166,7 +166,7 @@ void LLGestureMgr::activateGestures(LLViewerInventoryItem::item_array_t& items) continue; } else - { // Make gesture active and persistent through login sessions. -spatters 07-12-06 + { // Make gesture active and persistent through login sessions. -Aura 07-12-06 activateGesture(item->getUUID()); } diff --git a/indra/newview/llgroupactions.cpp b/indra/newview/llgroupactions.cpp index a0f2918bd7..302d21c2e4 100755 --- a/indra/newview/llgroupactions.cpp +++ b/indra/newview/llgroupactions.cpp @@ -116,6 +116,80 @@ public: }; LLGroupHandler gGroupHandler; +// This object represents a pending request for specified group member information +// which is needed to check whether avatar can leave group +class LLFetchGroupMemberData : public LLGroupMgrObserver +{ +public: + LLFetchGroupMemberData(const LLUUID& group_id) : + mGroupId(group_id), + mRequestProcessed(false), + LLGroupMgrObserver(group_id) + { + llinfos << "Sending new group member request for group_id: "<< group_id << llendl; + LLGroupMgr* mgr = LLGroupMgr::getInstance(); + // register ourselves as an observer + mgr->addObserver(this); + // send a request + mgr->sendGroupPropertiesRequest(group_id); + mgr->sendCapGroupMembersRequest(group_id); + } + + ~LLFetchGroupMemberData() + { + if (!mRequestProcessed) + { + // Request is pending + llwarns << "Destroying pending group member request for group_id: " + << mGroupId << llendl; + } + // Remove ourselves as an observer + LLGroupMgr::getInstance()->removeObserver(this); + } + + void changed(LLGroupChange gc) + { + if (gc == GC_MEMBER_DATA && !mRequestProcessed) + { + LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupId); + if (!gdatap) + { + llwarns << "LLGroupMgr::getInstance()->getGroupData() was NULL" << llendl; + } + else if (!gdatap->isMemberDataComplete()) + { + llwarns << "LLGroupMgr::getInstance()->getGroupData()->isMemberDataComplete() was FALSE" << llendl; + } + else + { + processGroupData(); + mRequestProcessed = true; + } + } + } + + LLUUID getGroupId() { return mGroupId; } + virtual void processGroupData() = 0; +protected: + LLUUID mGroupId; +private: + bool mRequestProcessed; +}; + +class LLFetchLeaveGroupData: public LLFetchGroupMemberData +{ +public: + LLFetchLeaveGroupData(const LLUUID& group_id) + : LLFetchGroupMemberData(group_id) + {} + void processGroupData() + { + LLGroupActions::processLeaveGroupDataResponse(mGroupId); + } +}; + +LLFetchLeaveGroupData* gFetchLeaveGroupData = NULL; + // static void LLGroupActions::search() { @@ -208,23 +282,52 @@ bool LLGroupActions::onJoinGroup(const LLSD& notification, const LLSD& response) void LLGroupActions::leave(const LLUUID& group_id) { if (group_id.isNull()) + { return; + } - S32 count = gAgent.mGroups.count(); - S32 i; - for (i = 0; i < count; ++i) + LLGroupData group_data; + if (gAgent.getGroupData(group_id, group_data)) { - if(gAgent.mGroups.get(i).mID == group_id) - break; + LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(group_id); + if (!gdatap || !gdatap->isMemberDataComplete()) + { + if (gFetchLeaveGroupData != NULL) + { + delete gFetchLeaveGroupData; + gFetchLeaveGroupData = NULL; + } + gFetchLeaveGroupData = new LLFetchLeaveGroupData(group_id); + } + else + { + processLeaveGroupDataResponse(group_id); + } } - if (i < count) +} + +//static +void LLGroupActions::processLeaveGroupDataResponse(const LLUUID group_id) +{ + LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(group_id); + LLUUID agent_id = gAgent.getID(); + LLGroupMgrGroupData::member_list_t::iterator mit = gdatap->mMembers.find(agent_id); + //get the member data for the group + if ( mit != gdatap->mMembers.end() ) { - LLSD args; - args["GROUP"] = gAgent.mGroups.get(i).mName; - LLSD payload; - payload["group_id"] = group_id; - LLNotificationsUtil::add("GroupLeaveConfirmMember", args, payload, onLeaveGroup); + LLGroupMemberData* member_data = (*mit).second; + + if ( member_data && member_data->isOwner() && gdatap->mMemberCount == 1) + { + LLNotificationsUtil::add("OwnerCannotLeaveGroup"); + return; + } } + LLSD args; + args["GROUP"] = gdatap->mName; + LLSD payload; + payload["group_id"] = group_id; + LLNotificationsUtil::add("GroupLeaveConfirmMember", args, payload, onLeaveGroup); } // static diff --git a/indra/newview/llgroupactions.h b/indra/newview/llgroupactions.h index 3f9852f194..afc4686dd7 100755 --- a/indra/newview/llgroupactions.h +++ b/indra/newview/llgroupactions.h @@ -114,6 +114,14 @@ public: private: static bool onJoinGroup(const LLSD& notification, const LLSD& response); static bool onLeaveGroup(const LLSD& notification, const LLSD& response); + + /** + * This function is called by LLFetchLeaveGroupData upon receiving a response to a group + * members data request. + */ + static void processLeaveGroupDataResponse(const LLUUID group_id); + + friend class LLFetchLeaveGroupData; }; #endif // LL_LLGROUPACTIONS_H diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 3b72ad3cd9..2e53effcac 100755 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -103,6 +103,7 @@ BOOL LLSessionTimeoutTimer::tick() } +void notify_of_message(const LLSD& msg, bool is_dnd_msg); void process_dnd_im(const LLSD& notification) { @@ -129,15 +130,9 @@ void process_dnd_im(const LLSD& notification) fromID, false, false); //will need slight refactor to retrieve whether offline message or not (assume online for now) + } - LLFloaterIMContainer* im_box = LLFloaterReg::getTypedInstance<LLFloaterIMContainer>("im_container"); - - if (im_box) - { - im_box->flashConversationItemWidget(sessionID, true); - } - - } + notify_of_message(data, true); } @@ -158,75 +153,106 @@ static void on_avatar_name_cache_toast(const LLUUID& agent_id, LLNotificationsUtil::add("IMToast", args, args, boost::bind(&LLFloaterIMContainer::showConversation, LLFloaterIMContainer::getInstance(), msg["session_id"].asUUID())); } -void on_new_message(const LLSD& msg) +void notify_of_message(const LLSD& msg, bool is_dnd_msg) { - std::string user_preferences; - LLUUID participant_id = msg["from_id"].asUUID(); - LLUUID session_id = msg["session_id"].asUUID(); - LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession(session_id); - - // do not show notification which goes from agent - if (gAgent.getID() == participant_id) - { - return; - } + std::string user_preferences; + LLUUID participant_id = msg[is_dnd_msg ? "FROM_ID" : "from_id"].asUUID(); + LLUUID session_id = msg[is_dnd_msg ? "SESSION_ID" : "session_id"].asUUID(); + LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession(session_id); - // determine state of conversations floater - enum {CLOSED, NOT_ON_TOP, ON_TOP, ON_TOP_AND_ITEM_IS_SELECTED} conversations_floater_status; + // do not show notification which goes from agent + if (gAgent.getID() == participant_id) + { + return; + } + // determine state of conversations floater + enum {CLOSED, NOT_ON_TOP, ON_TOP, ON_TOP_AND_ITEM_IS_SELECTED} conversations_floater_status; - LLFloaterIMContainer* im_box = LLFloaterReg::getTypedInstance<LLFloaterIMContainer>("im_container"); + LLFloaterIMContainer* im_box = LLFloaterReg::getTypedInstance<LLFloaterIMContainer>("im_container"); LLFloaterIMSessionTab* session_floater = LLFloaterIMSessionTab::getConversation(session_id); - + bool store_dnd_message = false; // flag storage of a dnd message + bool is_session_focused = session_floater->isTornOff() && session_floater->hasFocus(); if (!LLFloater::isVisible(im_box) || im_box->isMinimized()) { conversations_floater_status = CLOSED; } else if (!im_box->hasFocus() && - !(session_floater && LLFloater::isVisible(session_floater) - && !session_floater->isMinimized() && session_floater->hasFocus())) + !(session_floater && LLFloater::isVisible(session_floater) + && !session_floater->isMinimized() && session_floater->hasFocus())) { conversations_floater_status = NOT_ON_TOP; } else if (im_box->getSelectedSession() != session_id) { conversations_floater_status = ON_TOP; - } + } else { conversations_floater_status = ON_TOP_AND_ITEM_IS_SELECTED; } - // determine user prefs for this session - if (session_id.isNull()) - { - user_preferences = gSavedSettings.getString("NotificationNearbyChatOptions"); - } - else if(session->isP2PSessionType()) - { - if (LLAvatarTracker::instance().isBuddy(participant_id)) - { - user_preferences = gSavedSettings.getString("NotificationFriendIMOptions"); - } - else - { - user_preferences = gSavedSettings.getString("NotificationNonFriendIMOptions"); - } - } - else if(session->isAdHocSessionType()) - { - user_preferences = gSavedSettings.getString("NotificationConferenceIMOptions"); - } - else if(session->isGroupSessionType()) - { - user_preferences = gSavedSettings.getString("NotificationGroupChatOptions"); - } + // determine user prefs for this session + if (session_id.isNull()) + { + if (msg["source_type"].asInteger() == CHAT_SOURCE_OBJECT) + { + user_preferences = gSavedSettings.getString("NotificationObjectIMOptions"); + if (!gAgent.isDoNotDisturb() && (gSavedSettings.getBOOL("PlaySoundObjectIM") == TRUE)) + { + make_ui_sound("UISndNewIncomingIMSession"); + } + } + else + { + user_preferences = gSavedSettings.getString("NotificationNearbyChatOptions"); + if (!gAgent.isDoNotDisturb() && (gSavedSettings.getBOOL("PlaySoundNearbyChatIM") == TRUE)) + { + make_ui_sound("UISndNewIncomingIMSession"); + } + } + } + else if(session->isP2PSessionType()) + { + if (LLAvatarTracker::instance().isBuddy(participant_id)) + { + user_preferences = gSavedSettings.getString("NotificationFriendIMOptions"); + if (!gAgent.isDoNotDisturb() && (gSavedSettings.getBOOL("PlaySoundFriendIM") == TRUE)) + { + make_ui_sound("UISndNewIncomingIMSession"); + } + } + else + { + user_preferences = gSavedSettings.getString("NotificationNonFriendIMOptions"); + if (!gAgent.isDoNotDisturb() && (gSavedSettings.getBOOL("PlaySoundNonFriendIM") == TRUE)) + { + make_ui_sound("UISndNewIncomingIMSession"); + } + } + } + else if(session->isAdHocSessionType()) + { + user_preferences = gSavedSettings.getString("NotificationConferenceIMOptions"); + if (!gAgent.isDoNotDisturb() && (gSavedSettings.getBOOL("PlaySoundConferenceIM") == TRUE)) + { + make_ui_sound("UISndNewIncomingIMSession"); + } + } + else if(session->isGroupSessionType()) + { + user_preferences = gSavedSettings.getString("NotificationGroupChatOptions"); + if (!gAgent.isDoNotDisturb() && (gSavedSettings.getBOOL("PlaySoundGroupChatIM") == TRUE)) + { + make_ui_sound("UISndNewIncomingIMSession"); + } + } - // actions: + // actions: // 0. nothing - exit - if (("none" == user_preferences || + if (("noaction" == user_preferences || ON_TOP_AND_ITEM_IS_SELECTED == conversations_floater_status) && session_floater->isMessagePaneExpanded()) { @@ -261,57 +287,103 @@ void on_new_message(const LLSD& msg) } } } - else - { - //If in DND mode, allow notification to be stored so upon DND exit - //useMostItrusiveIMNotification will be called to notify user a message exists - if(session_id.notNull() - && participant_id.notNull() - && !session_floater->isShown()) - { - LLAvatarNameCache::get(participant_id, boost::bind(&on_avatar_name_cache_toast, _1, _2, msg)); - } - } - } + else + { + store_dnd_message = true; + } - // 2. Flash line item - if ("openconversations" == user_preferences - || ON_TOP == conversations_floater_status - || ("toast" == user_preferences && ON_TOP != conversations_floater_status) - || ("flash" == user_preferences && CLOSED == conversations_floater_status)) - { - if(!LLMuteList::getInstance()->isMuted(participant_id)) - { - im_box->flashConversationItemWidget(session_id, true); - } - } + } - // 3. Flash FUI button - if (("toast" == user_preferences || "flash" == user_preferences) && - (CLOSED == conversations_floater_status - || NOT_ON_TOP == conversations_floater_status)) - { - if(!LLMuteList::getInstance()->isMuted(participant_id) - && !gAgent.isDoNotDisturb()) - { - gToolBarView->flashCommand(LLCommandId("chat"), true); - } - } + // 2. Flash line item + if ("openconversations" == user_preferences + || ON_TOP == conversations_floater_status + || ("toast" == user_preferences && ON_TOP != conversations_floater_status) + || ("flash" == user_preferences && (CLOSED == conversations_floater_status + || NOT_ON_TOP == conversations_floater_status)) + || is_dnd_msg) + { + if(!LLMuteList::getInstance()->isMuted(participant_id)) + { + if(gAgent.isDoNotDisturb()) + { + store_dnd_message = true; + } + else + { + if (is_dnd_msg && (ON_TOP == conversations_floater_status || + NOT_ON_TOP == conversations_floater_status || + CLOSED == conversations_floater_status)) + { + im_box->highlightConversationItemWidget(session_id, true); + } + else + { + im_box->flashConversationItemWidget(session_id, true); + } + } + } + } - // 4. Toast - if ((("toast" == user_preferences) && - (CLOSED == conversations_floater_status - || NOT_ON_TOP == conversations_floater_status)) - || !session_floater->isMessagePaneExpanded()) + // 3. Flash FUI button + if (("toast" == user_preferences || "flash" == user_preferences) && + (CLOSED == conversations_floater_status + || NOT_ON_TOP == conversations_floater_status) + && !is_session_focused + && !is_dnd_msg) //prevent flashing FUI button because the conversation floater will have already opened + { + if(!LLMuteList::getInstance()->isMuted(participant_id)) + { + if(!gAgent.isDoNotDisturb()) + { + gToolBarView->flashCommand(LLCommandId("chat"), true, im_box->isMinimized()); + } + else + { + store_dnd_message = true; + } + } + } - { - //Show IM toasts (upper right toasts) - // Skip toasting for system messages and for nearby chat - if(session_id.notNull() && participant_id.notNull()) - { - LLAvatarNameCache::get(participant_id, boost::bind(&on_avatar_name_cache_toast, _1, _2, msg)); - } - } + // 4. Toast + if ((("toast" == user_preferences) && + (ON_TOP_AND_ITEM_IS_SELECTED != conversations_floater_status) && + (!session_floater->isTornOff() || !LLFloater::isVisible(session_floater))) + || !session_floater->isMessagePaneExpanded()) + + { + //Show IM toasts (upper right toasts) + // Skip toasting for system messages and for nearby chat + if(session_id.notNull() && participant_id.notNull()) + { + if(!is_dnd_msg) + { + if(gAgent.isDoNotDisturb()) + { + store_dnd_message = true; + } + else + { + LLAvatarNameCache::get(participant_id, boost::bind(&on_avatar_name_cache_toast, _1, _2, msg)); + } + } + } + } + if (store_dnd_message) + { + // If in DND mode, allow notification to be stored so upon DND exit + // the user will be notified with some limitations (see 'is_dnd_msg' flag checks) + if(session_id.notNull() + && participant_id.notNull() + && !session_floater->isShown()) + { + LLAvatarNameCache::get(participant_id, boost::bind(&on_avatar_name_cache_toast, _1, _2, msg)); + } + } +} + +void on_new_message(const LLSD& msg) +{ + notify_of_message(msg, false); } LLIMModel::LLIMModel() @@ -2597,6 +2669,14 @@ void LLIMMgr::addMessage( fixed_session_name = session_name; name_is_setted = true; } + bool skip_message = false; + bool from_linden = LLMuteList::getInstance()->isLinden(from); + if (gSavedSettings.getBOOL("VoiceCallsFriendsOnly") && !from_linden) + { + // Evaluate if we need to skip this message when that setting is true (default is false) + skip_message = (LLAvatarTracker::instance().getBuddyInfo(other_participant_id) == NULL); // Skip non friends... + skip_message &= !(other_participant_id == gAgentID); // You are your best friend... Don't skip yourself + } bool new_session = !hasSession(new_session_id); if (new_session) @@ -2608,6 +2688,12 @@ void LLIMMgr::addMessage( } LLIMModel::getInstance()->newSession(new_session_id, fixed_session_name, dialog, other_participant_id, false, is_offline_msg); + LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession(new_session_id); + skip_message &= !session->isGroupSessionType(); // Do not skip group chats... + if(skip_message) + { + gIMMgr->leaveSession(new_session_id); + } // When we get a new IM, and if you are a god, display a bit // of information about the source. This is to help liaisons // when answering questions. @@ -2631,7 +2717,7 @@ void LLIMMgr::addMessage( // Logically it would make more sense to reject the session sooner, in another area of the // code, but the session has to be established inside the server before it can be left. - if (LLMuteList::getInstance()->isMuted(other_participant_id) && !LLMuteList::getInstance()->isLinden(from)) + if (LLMuteList::getInstance()->isMuted(other_participant_id) && !from_linden) { llwarns << "Leaving IM session from initiating muted resident " << from << llendl; if(!gIMMgr->leaveSession(new_session_id)) @@ -2648,23 +2734,13 @@ void LLIMMgr::addMessage( } } - bool skip_message = false; - if (gSavedSettings.getBOOL("VoiceCallsFriendsOnly")) - { - // Evaluate if we need to skip this message when that setting is true (default is false) - LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession(new_session_id); - skip_message = (LLAvatarTracker::instance().getBuddyInfo(other_participant_id) == NULL); // Skip non friends... - skip_message &= !session->isGroupSessionType(); // Do not skip group chats... - skip_message &= !(other_participant_id == gAgentID); // You are your best friend... Don't skip yourself - } - if (!LLMuteList::getInstance()->isMuted(other_participant_id, LLMute::flagTextChat) && !skip_message) { LLIMModel::instance().addMessage(new_session_id, from, other_participant_id, msg); } // Open conversation floater if offline messages are present - if (is_offline_msg) + if (is_offline_msg && !skip_message) { LLFloaterReg::showInstance("im_container"); LLFloaterReg::getTypedInstance<LLFloaterIMContainer>("im_container")-> @@ -2971,10 +3047,9 @@ void LLIMMgr::inviteToSession( { bool isRejectGroupCall = (gSavedSettings.getBOOL("VoiceCallsRejectGroup") && (notify_box_type == "VoiceInviteGroup")); bool isRejectNonFriendCall = (gSavedSettings.getBOOL("VoiceCallsFriendsOnly") && (LLAvatarTracker::instance().getBuddyInfo(caller_id) == NULL)); - bool isRejectDoNotDisturb = (gAgent.isDoNotDisturb() && !hasSession(session_id)); - if (isRejectGroupCall || isRejectNonFriendCall || isRejectDoNotDisturb) + if (isRejectGroupCall || isRejectNonFriendCall || gAgent.isDoNotDisturb()) { - if (isRejectDoNotDisturb && !isRejectGroupCall && !isRejectNonFriendCall) + if (gAgent.isDoNotDisturb() && !isRejectGroupCall && !isRejectNonFriendCall) { LLSD args; addSystemMessage(session_id, "you_auto_rejected_call", args); diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index a5043a30ac..e4fc469bb7 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3444,7 +3444,7 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items } } - //Added by spatters to force inventory pull on right-click to display folder options correctly. 07-17-06 + //Added by aura to force inventory pull on right-click to display folder options correctly. 07-17-06 mCallingCards = mWearables = FALSE; LLIsType is_callingcard(LLAssetType::AT_CALLINGCARD); diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 92f2d33073..3c6974cf6d 100755 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -70,11 +70,8 @@ LLInventoryFilter::LLInventoryFilter(const Params& p) mFilterSubString(p.substring), mCurrentGeneration(0), mFirstRequiredGeneration(0), - mFirstSuccessGeneration(0), - mFilterCount(0) + mFirstSuccessGeneration(0) { - mNextFilterGeneration = mCurrentGeneration + 1; - // copy mFilterOps into mDefaultFilterOps markDefault(); } @@ -92,9 +89,7 @@ bool LLInventoryFilter::check(const LLFolderViewModelItem* item) return passed_clipboard; } - std::string::size_type string_offset = mFilterSubString.size() ? listener->getSearchableName().find(mFilterSubString) : std::string::npos; - - BOOL passed = (mFilterSubString.size() == 0 || string_offset != std::string::npos); + bool passed = (mFilterSubString.size() ? listener->getSearchableName().find(mFilterSubString) != std::string::npos : true); passed = passed && checkAgainstFilterType(listener); passed = passed && checkAgainstPermissions(listener); passed = passed && checkAgainstFilterLinks(listener); @@ -105,17 +100,12 @@ bool LLInventoryFilter::check(const LLFolderViewModelItem* item) bool LLInventoryFilter::check(const LLInventoryItem* item) { - std::string::size_type string_offset = mFilterSubString.size() ? item->getName().find(mFilterSubString) : std::string::npos; - + const bool passed_string = (mFilterSubString.size() ? item->getName().find(mFilterSubString) != std::string::npos : true); const bool passed_filtertype = checkAgainstFilterType(item); const bool passed_permissions = checkAgainstPermissions(item); - const BOOL passed_clipboard = checkAgainstClipboard(item->getUUID()); - const bool passed = (passed_filtertype - && passed_permissions - && passed_clipboard - && (mFilterSubString.size() == 0 || string_offset != std::string::npos)); + const bool passed_clipboard = checkAgainstClipboard(item->getUUID()); - return passed; + return passed_filtertype && passed_permissions && passed_clipboard && passed_string; } bool LLInventoryFilter::checkFolder(const LLFolderViewModelItem* item) const @@ -439,7 +429,7 @@ void LLInventoryFilter::updateFilterTypes(U64 types, U64& current_types) current_types = types; if (more_bits_set && fewer_bits_set) { - // neither less or more restrive, both simultaneously + // neither less or more restrictive, both simultaneously // so we need to filter from scratch setModified(FILTER_RESTART); } @@ -714,7 +704,7 @@ void LLInventoryFilter::resetDefault() void LLInventoryFilter::setModified(EFilterModified behavior) { mFilterText.clear(); - mCurrentGeneration = mNextFilterGeneration++; + mCurrentGeneration++; if (mFilterModified == FILTER_NONE) { @@ -1021,21 +1011,19 @@ LLInventoryFilter::EFolderShow LLInventoryFilter::getShowFolderState() const return mFilterOps.mShowFolderState; } -void LLInventoryFilter::setFilterCount(S32 count) -{ - mFilterCount = count; -} -S32 LLInventoryFilter::getFilterCount() const +bool LLInventoryFilter::isTimedOut() { - return mFilterCount; + return mFilterTime.hasExpired(); } -void LLInventoryFilter::decrementFilterCount() -{ - mFilterCount--; +void LLInventoryFilter::resetTime(S32 timeout) +{ + mFilterTime.reset(); + F32 time_in_sec = (F32)(timeout)/1000.0; + mFilterTime.setTimerExpirySec(time_in_sec); } -S32 LLInventoryFilter::getCurrentGeneration() const +S32 LLInventoryFilter::getCurrentGeneration() const { return mCurrentGeneration; } diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h index 4912b5ca91..ce516af0b9 100755 --- a/indra/newview/llinventoryfilter.h +++ b/indra/newview/llinventoryfilter.h @@ -215,12 +215,11 @@ public: void setModified(EFilterModified behavior = FILTER_RESTART); // +-------------------------------------------------------------------+ - // + Count + // + Time // +-------------------------------------------------------------------+ - void setFilterCount(S32 count); - S32 getFilterCount() const; - void decrementFilterCount(); - + void resetTime(S32 timeout); + bool isTimedOut(); + // +-------------------------------------------------------------------+ // + Default // +-------------------------------------------------------------------+ @@ -262,13 +261,15 @@ private: const std::string mName; S32 mCurrentGeneration; + // The following makes checking for pass/no pass possible even if the item is not checked against the current generation + // Any item that *did not pass* the "required generation" will *not pass* the current one + // Any item that *passes* the "success generation" will *pass* the current one S32 mFirstRequiredGeneration; S32 mFirstSuccessGeneration; - S32 mNextFilterGeneration; - S32 mFilterCount; EFilterModified mFilterModified; - + LLTimer mFilterTime; + std::string mFilterText; std::string mEmptyLookupMessage; }; diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index cf1fd4c0d0..e5b9e11d48 100755 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -192,7 +192,7 @@ LLFolderView * LLInventoryPanel::createFolderRoot(LLUUID root_id ) p.show_item_link_overlays = mShowItemLinkOverlays; p.root = NULL; p.options_menu = "menu_inventory.xml"; - + return LLUICtrlFactory::create<LLFolderView>(p); } @@ -396,6 +396,7 @@ LLInventoryFilter::EFolderShow LLInventoryPanel::getShowFolderState() return getFilter().getShowFolderState(); } +// Called when something changed in the global model (new item, item coming through the wire, rename, move, etc...) (CHUI-849) void LLInventoryPanel::modelChanged(U32 mask) { static LLFastTimer::DeclareTimer FTM_REFRESH("Inventory Refresh"); diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index 2d7454b636..90b169ecd3 100755 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -25,7 +25,7 @@ */ #include "llviewerprecompiledheaders.h" - +#include "llfloaterconversationpreview.h" #include "llagent.h" #include "llagentui.h" #include "llavatarnamecache.h" @@ -206,6 +206,7 @@ private: }; LLLogChat::save_history_signal_t * LLLogChat::sSaveHistorySignal = NULL; +LLLoadHistoryThread::load_end_signal_t * LLLoadHistoryThread::mLoadEndSignal = NULL; //static std::string LLLogChat::makeLogFileName(std::string filename) @@ -336,75 +337,83 @@ void LLLogChat::saveHistory(const std::string& filename, void LLLogChat::loadChatHistory(const std::string& file_name, std::list<LLSD>& messages, const LLSD& load_params) { if (file_name.empty()) - { - llwarns << "Session name is Empty!" << llendl; - return ; - } - - bool load_all_history = load_params.has("load_all_history") ? load_params["load_all_history"].asBoolean() : false; + { + LL_WARNS("LLLogChat::loadChatHistory") << "Session name is Empty!" << LL_ENDL; + return ; + } - LLFILE* fptr = LLFile::fopen(makeLogFileName(file_name), "r");/*Flawfinder: ignore*/ - if (!fptr) - { - fptr = LLFile::fopen(oldLogFileName(file_name), "r");/*Flawfinder: ignore*/ - if (!fptr) - { - return; //No previous conversation with this name. - } - } - - char buffer[LOG_RECALL_SIZE]; /*Flawfinder: ignore*/ - char *bptr; - S32 len; - bool firstline = TRUE; + bool load_all_history = load_params.has("load_all_history") ? load_params["load_all_history"].asBoolean() : false; - if (load_all_history || fseek(fptr, (LOG_RECALL_SIZE - 1) * -1 , SEEK_END)) - { //We need to load the whole historyFile or it's smaller than recall size, so get it all. - firstline = FALSE; - if (fseek(fptr, 0, SEEK_SET)) - { - fclose(fptr); - return; - } - } + LLFILE* fptr = LLFile::fopen(LLLogChat::makeLogFileName(file_name), "r");/*Flawfinder: ignore*/ + if (!fptr) + { + fptr = LLFile::fopen(LLLogChat::oldLogFileName(file_name), "r");/*Flawfinder: ignore*/ + if (!fptr) + { + return; //No previous conversation with this name. + } + } - while (fgets(buffer, LOG_RECALL_SIZE, fptr) && !feof(fptr)) - { - len = strlen(buffer) - 1; /*Flawfinder: ignore*/ - for (bptr = (buffer + len); (*bptr == '\n' || *bptr == '\r') && bptr>buffer; bptr--) *bptr='\0'; - - if (firstline) - { - firstline = FALSE; - continue; - } + char buffer[LOG_RECALL_SIZE]; /*Flawfinder: ignore*/ + char *bptr; + S32 len; + bool firstline = TRUE; + + if (load_all_history || fseek(fptr, (LOG_RECALL_SIZE - 1) * -1 , SEEK_END)) + { //We need to load the whole historyFile or it's smaller than recall size, so get it all. + firstline = FALSE; + if (fseek(fptr, 0, SEEK_SET)) + { + fclose(fptr); + return; + } + } + while (fgets(buffer, LOG_RECALL_SIZE, fptr) && !feof(fptr)) + { + len = strlen(buffer) - 1; /*Flawfinder: ignore*/ + for (bptr = (buffer + len); (*bptr == '\n' || *bptr == '\r') && bptr>buffer; bptr--) *bptr='\0'; + + if (firstline) + { + firstline = FALSE; + continue; + } + + std::string line(buffer); + + //updated 1.23 plain text log format requires a space added before subsequent lines in a multilined message + if (' ' == line[0]) + { + line.erase(0, MULTI_LINE_PREFIX.length()); + append_to_last_message(messages, '\n' + line); + } + else if (0 == len && ('\n' == line[0] || '\r' == line[0])) + { + //to support old format's multilined messages with new lines used to divide paragraphs + append_to_last_message(messages, line); + } + else + { + LLSD item; + if (!LLChatLogParser::parse(line, item, load_params)) + { + item[LL_IM_TEXT] = line; + } + messages.push_back(item); + } + } + fclose(fptr); - std::string line(buffer); - //updated 1.23 plaint text log format requires a space added before subsequent lines in a multilined message - if (' ' == line[0]) - { - line.erase(0, MULTI_LINE_PREFIX.length()); - append_to_last_message(messages, '\n' + line); - } - else if (0 == len && ('\n' == line[0] || '\r' == line[0])) - { - //to support old format's multilined messages with new lines used to divide paragraphs - append_to_last_message(messages, line); - } - else - { - LLSD item; - if (!LLChatLogParser::parse(line, item, load_params)) - { - item[LL_IM_TEXT] = line; - } - messages.push_back(item); - } - } - fclose(fptr); } +void LLLogChat::startChatHistoryThread(const std::string& file_name, const LLSD& load_params) +{ + + LLLoadHistoryThread* mThread = new LLLoadHistoryThread(); + mThread->start(); + mThread->setHistoryParams(file_name, load_params); +} // static std::string LLLogChat::oldLogFileName(std::string filename) { @@ -461,6 +470,13 @@ void LLLogChat::findTranscriptFiles(std::string pattern, std::vector<std::string LLFILE * filep = LLFile::fopen(fullname, "rb"); if (NULL != filep) { + if(makeLogFileName("chat")== fullname) + { + //Add Nearby chat history to the list of transcriptions + list_of_transcriptions.push_back(gDirUtilp->add(dirname, filename)); + LLFile::close(filep); + return; + } char buffer[LOG_RECALL_SIZE]; fseek(filep, 0, SEEK_END); // seek to end of file @@ -631,7 +647,7 @@ void LLLogChat::deleteTranscripts() } // static -bool LLLogChat::isTranscriptExist(const LLUUID& avatar_id) +bool LLLogChat::isTranscriptExist(const LLUUID& avatar_id, bool is_group) { std::vector<std::string> list_of_transcriptions; LLLogChat::getListOfTranscriptFiles(list_of_transcriptions); @@ -641,20 +657,53 @@ bool LLLogChat::isTranscriptExist(const LLUUID& avatar_id) LLAvatarName avatar_name; LLAvatarNameCache::get(avatar_id, &avatar_name); std::string avatar_user_name = avatar_name.getAccountName(); - std::replace(avatar_user_name.begin(), avatar_user_name.end(), '.', '_'); - - BOOST_FOREACH(std::string& transcript_file_name, list_of_transcriptions) + if(!is_group) { - if (std::string::npos != transcript_file_name.find(avatar_user_name)) + std::replace(avatar_user_name.begin(), avatar_user_name.end(), '.', '_'); + BOOST_FOREACH(std::string& transcript_file_name, list_of_transcriptions) { - return true; + if (std::string::npos != transcript_file_name.find(avatar_user_name)) + { + return true; + } } } + else + { + std::string file_name; + gCacheName->getGroupName(avatar_id, file_name); + file_name = makeLogFileName(file_name); + BOOST_FOREACH(std::string& transcript_file_name, list_of_transcriptions) + { + if (transcript_file_name == file_name) + { + return true; + } + } + } + } return false; } +bool LLLogChat::isNearbyTranscriptExist() +{ + std::vector<std::string> list_of_transcriptions; + LLLogChat::getListOfTranscriptFiles(list_of_transcriptions); + + std::string file_name; + file_name = makeLogFileName("chat"); + BOOST_FOREACH(std::string& transcript_file_name, list_of_transcriptions) + { + if (transcript_file_name == file_name) + { + return true; + } + } + return false; +} + //*TODO mark object's names in a special way so that they will be distinguishable form avatar name //which are more strict by its nature (only firstname and secondname) //Example, an object's name can be written like "Object <actual_object's_name>" @@ -795,3 +844,116 @@ bool LLChatLogParser::parse(std::string& raw, LLSD& im, const LLSD& parse_params im[LL_IM_TEXT] = name_and_text[IDX_TEXT]; return true; //parsed name and message text, maybe have a timestamp too } + + + + LLLoadHistoryThread::LLLoadHistoryThread() : LLThread("load chat history") + { + mNewLoad = false; + } + + void LLLoadHistoryThread::run() + { + while (!LLApp::isQuitting()) + { + if(mNewLoad) + { + loadHistory(mFileName,mMessages,mLoadParams); + shutdown(); + } + } + } + void LLLoadHistoryThread::setHistoryParams(const std::string& file_name, const LLSD& load_params) + { + mFileName = file_name; + mLoadParams = load_params; + mNewLoad = true; + } + void LLLoadHistoryThread::loadHistory(const std::string& file_name, std::list<LLSD>& messages, const LLSD& load_params) + { + + if (file_name.empty()) + { + LL_WARNS("LLLogChat::loadHistory") << "Session name is Empty!" << LL_ENDL; + return ; + } + + bool load_all_history = load_params.has("load_all_history") ? load_params["load_all_history"].asBoolean() : false; + + LLFILE* fptr = LLFile::fopen(LLLogChat::makeLogFileName(file_name), "r");/*Flawfinder: ignore*/ + if (!fptr) + { + fptr = LLFile::fopen(LLLogChat::oldLogFileName(file_name), "r");/*Flawfinder: ignore*/ + if (!fptr) + { + mNewLoad = false; + (*mLoadEndSignal)(messages, file_name); + return; //No previous conversation with this name. + } + } + + char buffer[LOG_RECALL_SIZE]; /*Flawfinder: ignore*/ + char *bptr; + S32 len; + bool firstline = TRUE; + + if (load_all_history || fseek(fptr, (LOG_RECALL_SIZE - 1) * -1 , SEEK_END)) + { //We need to load the whole historyFile or it's smaller than recall size, so get it all. + firstline = FALSE; + if (fseek(fptr, 0, SEEK_SET)) + { + fclose(fptr); + mNewLoad = false; + (*mLoadEndSignal)(messages, file_name); + return; + } + } + while (fgets(buffer, LOG_RECALL_SIZE, fptr) && !feof(fptr)) + { + len = strlen(buffer) - 1; /*Flawfinder: ignore*/ + for (bptr = (buffer + len); (*bptr == '\n' || *bptr == '\r') && bptr>buffer; bptr--) *bptr='\0'; + + if (firstline) + { + firstline = FALSE; + continue; + } + + std::string line(buffer); + + //updated 1.23 plaint text log format requires a space added before subsequent lines in a multilined message + if (' ' == line[0]) + { + line.erase(0, MULTI_LINE_PREFIX.length()); + append_to_last_message(messages, '\n' + line); + } + else if (0 == len && ('\n' == line[0] || '\r' == line[0])) + { + //to support old format's multilined messages with new lines used to divide paragraphs + append_to_last_message(messages, line); + } + else + { + LLSD item; + if (!LLChatLogParser::parse(line, item, load_params)) + { + item[LL_IM_TEXT] = line; + } + messages.push_back(item); + } + } + fclose(fptr); + mNewLoad = false; + (*mLoadEndSignal)(messages, file_name); + } + + //static + boost::signals2::connection LLLoadHistoryThread::setLoadEndSignal(const load_end_signal_t::slot_type& cb) + { + if (NULL == mLoadEndSignal) + { + mLoadEndSignal = new load_end_signal_t(); + } + + return mLoadEndSignal->connect(cb); + } diff --git a/indra/newview/lllogchat.h b/indra/newview/lllogchat.h index e819f00dd9..acee99afa2 100755 --- a/indra/newview/lllogchat.h +++ b/indra/newview/lllogchat.h @@ -28,6 +28,24 @@ #define LL_LLLOGCHAT_H class LLChat; +class LLLoadHistoryThread : public LLThread +{ +private: + std::string mFileName; + std::list<LLSD> mMessages; + LLSD mLoadParams; + bool mNewLoad; +public: + LLLoadHistoryThread(); + + void setHistoryParams(const std::string& file_name, const LLSD& load_params); + virtual void loadHistory(const std::string& file_name, std::list<LLSD>& messages, const LLSD& load_params); + virtual void run(); + + typedef boost::signals2::signal<void (std::list<LLSD>& messages,const std::string& file_name)> load_end_signal_t; + static load_end_signal_t * mLoadEndSignal; + static boost::signals2::connection setLoadEndSignal(const load_end_signal_t::slot_type& cb); +}; class LLLogChat { @@ -39,6 +57,7 @@ public: LOG_LLSD, LOG_END }; + static std::string timestamp(bool withdate = false); static std::string makeLogFileName(std::string(filename)); /** @@ -54,6 +73,7 @@ public: static void getListOfTranscriptBackupFiles(std::vector<std::string>& list_of_transcriptions); static void loadChatHistory(const std::string& file_name, std::list<LLSD>& messages, const LLSD& load_params = LLSD()); + static void startChatHistoryThread(const std::string& file_name, const LLSD& load_params); typedef boost::signals2::signal<void ()> save_history_signal_t; static boost::signals2::connection setSaveHistorySignal(const save_history_signal_t::slot_type& cb); @@ -67,7 +87,8 @@ public: std::vector<std::string>& listOfFilesToMove); static void deleteTranscripts(); - static bool isTranscriptExist(const LLUUID& avatar_id); + static bool isTranscriptExist(const LLUUID& avatar_id, bool is_group=false); + static bool isNearbyTranscriptExist(); private: static std::string cleanFileName(std::string filename); @@ -126,6 +147,7 @@ protected: virtual ~LLChatLogParser() {}; }; + // LLSD map lookup constants extern const std::string LL_IM_TIME; //("time"); extern const std::string LL_IM_TEXT; //("message"); diff --git a/indra/newview/llmaniprotate.cpp b/indra/newview/llmaniprotate.cpp index d79f1040bb..4cbdfde868 100755 --- a/indra/newview/llmaniprotate.cpp +++ b/indra/newview/llmaniprotate.cpp @@ -1376,74 +1376,28 @@ LLQuaternion LLManipRotate::dragConstrained( S32 x, S32 y ) BOOL hit = getMousePointOnPlaneAgent(projected_mouse, x, y, snap_plane_center, constraint_axis); projected_mouse -= snap_plane_center; - S32 snap_plane = 0; - - F32 dot = cam_to_snap_plane * constraint_axis; - if (llabs(dot) < 0.01f) - { - // looking at ring edge on, project onto view plane and check if mouse is past ring - getMousePointOnPlaneAgent(projected_mouse, x, y, snap_plane_center, cam_to_snap_plane); - projected_mouse -= snap_plane_center; - dot = projected_mouse * constraint_axis; - if (projected_mouse * constraint_axis > 0) - { - snap_plane = 1; - } - projected_mouse -= dot * constraint_axis; - } - else if (dot > 0.f) - { - // look for mouse position outside and in front of snap circle - if (hit && projected_mouse.magVec() > SNAP_GUIDE_INNER_RADIUS * mRadiusMeters && projected_mouse * cam_to_snap_plane < 0.f) - { - snap_plane = 1; - } - } - else - { - // look for mouse position inside or in back of snap circle - if (projected_mouse.magVec() < SNAP_GUIDE_INNER_RADIUS * mRadiusMeters || projected_mouse * cam_to_snap_plane > 0.f || !hit) - { - snap_plane = 1; - } - } - - if (snap_plane == 0) - { - // try other plane - snap_plane_center = (center - (constraint_axis * mRadiusMeters * 0.5f)); - if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD) - { - cam_to_snap_plane.setVec(1.f, 0.f, 0.f); - } - else - { - cam_to_snap_plane = snap_plane_center - gAgentCamera.getCameraPositionAgent(); - cam_to_snap_plane.normVec(); - } - - hit = getMousePointOnPlaneAgent(projected_mouse, x, y, snap_plane_center, constraint_axis); - projected_mouse -= snap_plane_center; - - dot = cam_to_snap_plane * constraint_axis; + if (gSavedSettings.getBOOL("SnapEnabled")) { + S32 snap_plane = 0; + + F32 dot = cam_to_snap_plane * constraint_axis; if (llabs(dot) < 0.01f) { // looking at ring edge on, project onto view plane and check if mouse is past ring getMousePointOnPlaneAgent(projected_mouse, x, y, snap_plane_center, cam_to_snap_plane); projected_mouse -= snap_plane_center; dot = projected_mouse * constraint_axis; - if (projected_mouse * constraint_axis < 0) + if (projected_mouse * constraint_axis > 0) { - snap_plane = 2; + snap_plane = 1; } projected_mouse -= dot * constraint_axis; } - else if (dot < 0.f) + else if (dot > 0.f) { // look for mouse position outside and in front of snap circle if (hit && projected_mouse.magVec() > SNAP_GUIDE_INNER_RADIUS * mRadiusMeters && projected_mouse * cam_to_snap_plane < 0.f) { - snap_plane = 2; + snap_plane = 1; } } else @@ -1451,78 +1405,136 @@ LLQuaternion LLManipRotate::dragConstrained( S32 x, S32 y ) // look for mouse position inside or in back of snap circle if (projected_mouse.magVec() < SNAP_GUIDE_INNER_RADIUS * mRadiusMeters || projected_mouse * cam_to_snap_plane > 0.f || !hit) { - snap_plane = 2; + snap_plane = 1; } } - } - - if (snap_plane > 0) - { - LLVector3 cam_at_axis; - if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD) - { - cam_at_axis.setVec(1.f, 0.f, 0.f); - } - else - { - cam_at_axis = snap_plane_center - gAgentCamera.getCameraPositionAgent(); - cam_at_axis.normVec(); - } - - // first, project mouse onto screen plane at point tangent to rotation radius. - getMousePointOnPlaneAgent(projected_mouse, x, y, snap_plane_center, cam_at_axis); - // project that point onto rotation plane - projected_mouse -= snap_plane_center; - projected_mouse -= projected_vec(projected_mouse, constraint_axis); - - F32 mouse_lateral_dist = llmin(SNAP_GUIDE_INNER_RADIUS * mRadiusMeters, projected_mouse.magVec()); - F32 mouse_depth = SNAP_GUIDE_INNER_RADIUS * mRadiusMeters; - if (llabs(mouse_lateral_dist) > 0.01f) - { - mouse_depth = sqrtf((SNAP_GUIDE_INNER_RADIUS * mRadiusMeters) * (SNAP_GUIDE_INNER_RADIUS * mRadiusMeters) - - (mouse_lateral_dist * mouse_lateral_dist)); - } - LLVector3 projected_camera_at = cam_at_axis - projected_vec(cam_at_axis, constraint_axis); - projected_mouse -= mouse_depth * projected_camera_at; - - if (!mInSnapRegime) + + if (snap_plane == 0) { - mSmoothRotate = TRUE; + // try other plane + snap_plane_center = (center - (constraint_axis * mRadiusMeters * 0.5f)); + if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD) + { + cam_to_snap_plane.setVec(1.f, 0.f, 0.f); + } + else + { + cam_to_snap_plane = snap_plane_center - gAgentCamera.getCameraPositionAgent(); + cam_to_snap_plane.normVec(); + } + + hit = getMousePointOnPlaneAgent(projected_mouse, x, y, snap_plane_center, constraint_axis); + projected_mouse -= snap_plane_center; + + dot = cam_to_snap_plane * constraint_axis; + if (llabs(dot) < 0.01f) + { + // looking at ring edge on, project onto view plane and check if mouse is past ring + getMousePointOnPlaneAgent(projected_mouse, x, y, snap_plane_center, cam_to_snap_plane); + projected_mouse -= snap_plane_center; + dot = projected_mouse * constraint_axis; + if (projected_mouse * constraint_axis < 0) + { + snap_plane = 2; + } + projected_mouse -= dot * constraint_axis; + } + else if (dot < 0.f) + { + // look for mouse position outside and in front of snap circle + if (hit && projected_mouse.magVec() > SNAP_GUIDE_INNER_RADIUS * mRadiusMeters && projected_mouse * cam_to_snap_plane < 0.f) + { + snap_plane = 2; + } + } + else + { + // look for mouse position inside or in back of snap circle + if (projected_mouse.magVec() < SNAP_GUIDE_INNER_RADIUS * mRadiusMeters || projected_mouse * cam_to_snap_plane > 0.f || !hit) + { + snap_plane = 2; + } + } } - mInSnapRegime = TRUE; - // 0 to 360 deg - F32 mouse_angle = fmodf(atan2(projected_mouse * axis1, projected_mouse * axis2) * RAD_TO_DEG + 360.f, 360.f); - F32 relative_mouse_angle = fmodf(mouse_angle + (SNAP_ANGLE_DETENTE / 2), SNAP_ANGLE_INCREMENT); - //fmodf(llround(mouse_angle * RAD_TO_DEG, 7.5f) + 360.f, 360.f); - - LLVector3 object_axis; - getObjectAxisClosestToMouse(object_axis); - object_axis = object_axis * first_object_node->mSavedRotation; - - // project onto constraint plane - object_axis = object_axis - (object_axis * getConstraintAxis()) * getConstraintAxis(); - object_axis.normVec(); - - if (relative_mouse_angle < SNAP_ANGLE_DETENTE) + if (snap_plane > 0) { - F32 quantized_mouse_angle = mouse_angle - (relative_mouse_angle - (SNAP_ANGLE_DETENTE * 0.5f)); - angle = (quantized_mouse_angle * DEG_TO_RAD) - atan2(object_axis * axis1, object_axis * axis2); + LLVector3 cam_at_axis; + if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD) + { + cam_at_axis.setVec(1.f, 0.f, 0.f); + } + else + { + cam_at_axis = snap_plane_center - gAgentCamera.getCameraPositionAgent(); + cam_at_axis.normVec(); + } + + // first, project mouse onto screen plane at point tangent to rotation radius. + getMousePointOnPlaneAgent(projected_mouse, x, y, snap_plane_center, cam_at_axis); + // project that point onto rotation plane + projected_mouse -= snap_plane_center; + projected_mouse -= projected_vec(projected_mouse, constraint_axis); + + F32 mouse_lateral_dist = llmin(SNAP_GUIDE_INNER_RADIUS * mRadiusMeters, projected_mouse.magVec()); + F32 mouse_depth = SNAP_GUIDE_INNER_RADIUS * mRadiusMeters; + if (llabs(mouse_lateral_dist) > 0.01f) + { + mouse_depth = sqrtf((SNAP_GUIDE_INNER_RADIUS * mRadiusMeters) * (SNAP_GUIDE_INNER_RADIUS * mRadiusMeters) - + (mouse_lateral_dist * mouse_lateral_dist)); + } + LLVector3 projected_camera_at = cam_at_axis - projected_vec(cam_at_axis, constraint_axis); + projected_mouse -= mouse_depth * projected_camera_at; + + if (!mInSnapRegime) + { + mSmoothRotate = TRUE; + } + mInSnapRegime = TRUE; + // 0 to 360 deg + F32 mouse_angle = fmodf(atan2(projected_mouse * axis1, projected_mouse * axis2) * RAD_TO_DEG + 360.f, 360.f); + + F32 relative_mouse_angle = fmodf(mouse_angle + (SNAP_ANGLE_DETENTE / 2), SNAP_ANGLE_INCREMENT); + //fmodf(llround(mouse_angle * RAD_TO_DEG, 7.5f) + 360.f, 360.f); + + LLVector3 object_axis; + getObjectAxisClosestToMouse(object_axis); + object_axis = object_axis * first_object_node->mSavedRotation; + + // project onto constraint plane + object_axis = object_axis - (object_axis * getConstraintAxis()) * getConstraintAxis(); + object_axis.normVec(); + + if (relative_mouse_angle < SNAP_ANGLE_DETENTE) + { + F32 quantized_mouse_angle = mouse_angle - (relative_mouse_angle - (SNAP_ANGLE_DETENTE * 0.5f)); + angle = (quantized_mouse_angle * DEG_TO_RAD) - atan2(object_axis * axis1, object_axis * axis2); + } + else + { + angle = (mouse_angle * DEG_TO_RAD) - atan2(object_axis * axis1, object_axis * axis2); + } + return LLQuaternion( -angle, constraint_axis ); } else { - angle = (mouse_angle * DEG_TO_RAD) - atan2(object_axis * axis1, object_axis * axis2); + if (mInSnapRegime) + { + mSmoothRotate = TRUE; + } + mInSnapRegime = FALSE; } - return LLQuaternion( -angle, constraint_axis ); } - else - { + else { if (mInSnapRegime) { mSmoothRotate = TRUE; } mInSnapRegime = FALSE; - + } + + if (!mInSnapRegime) + { LLVector3 up_from_axis = mCenterToCamNorm % constraint_axis; up_from_axis.normVec(); LLVector3 cur_intersection; diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp index b62db70ec8..06bf294417 100755 --- a/indra/newview/llmaniptranslate.cpp +++ b/indra/newview/llmaniptranslate.cpp @@ -1681,7 +1681,8 @@ void LLManipTranslate::highlightIntersection(LLVector3 normal, gGL.getModelviewMatrix().inverse().mult_vec_matrix(plane); - gClipProgram.uniform4fv("clip_plane", 1, plane.v); + static LLStaticHashedString sClipPlane("clip_plane"); + gClipProgram.uniform4fv(sClipPlane, 1, plane.v); BOOL particles = gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_PARTICLES); BOOL clouds = gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_CLOUDS); diff --git a/indra/newview/llmaterialmgr.cpp b/indra/newview/llmaterialmgr.cpp index 16871adc4d..14d3d4e7a8 100644 --- a/indra/newview/llmaterialmgr.cpp +++ b/indra/newview/llmaterialmgr.cpp @@ -50,6 +50,7 @@ #define MATERIALS_CAP_MATERIAL_FIELD "Material" #define MATERIALS_CAP_OBJECT_ID_FIELD "ID" #define MATERIALS_CAP_MATERIAL_ID_FIELD "MaterialID" +#define SIM_FEATURE_MAX_MATERIALS_PER_TRANSACTION "MaxMaterialsPerTransaction" #define MATERIALS_GET_MAX_ENTRIES 50 #define MATERIALS_GET_TIMEOUT (60.f * 20) @@ -544,11 +545,9 @@ void LLMaterialMgr::onIdle(void*) instancep->processGetAllQueue(); } - static LLFrameTimer mPutTimer; - if ( (!instancep->mPutQueue.empty()) && (mPutTimer.hasExpired()) ) + if (!instancep->mPutQueue.empty()) { instancep->processPutQueue(); - mPutTimer.resetWithExpiry(MATERIALS_PUT_THROTTLE_SECS); } } @@ -565,14 +564,14 @@ void LLMaterialMgr::processGetQueue() continue; } - const LLViewerRegion* regionp = LLWorld::instance().getRegionFromID(region_id); + LLViewerRegion* regionp = LLWorld::instance().getRegionFromID(region_id); if (!regionp) { LL_WARNS("Materials") << "Unknown region with id " << region_id.asString() << LL_ENDL; mGetQueue.erase(itRegionQueue); continue; } - else if (!regionp->capabilitiesReceived()) + else if (!regionp->capabilitiesReceived() || regionp->materialsCapThrottled()) { continue; } @@ -595,8 +594,9 @@ void LLMaterialMgr::processGetQueue() LLSD materialsData = LLSD::emptyArray(); material_queue_t& materials = itRegionQueue->second; + U32 max_entries = regionp->getMaxMaterialsPerTransaction(); material_queue_t::iterator loopMaterial = materials.begin(); - while ( (materials.end() != loopMaterial) && (materialsData.size() <= MATERIALS_GET_MAX_ENTRIES) ) + while ( (materials.end() != loopMaterial) && (materialsData.size() < max_entries) ) { material_queue_t::iterator itMaterial = loopMaterial++; materialsData.append((*itMaterial).asLLSD()); @@ -628,6 +628,7 @@ void LLMaterialMgr::processGetQueue() LL_DEBUGS("Materials") << "POSTing to region '" << regionp->getName() << "' at '"<< capURL << " for " << materialsData.size() << " materials." << "\ndata: " << ll_pretty_print_sd(materialsData) << LL_ENDL; LLHTTPClient::post(capURL, postData, materialsResponder); + regionp->resetMaterialsCapThrottle(); } } @@ -646,7 +647,7 @@ void LLMaterialMgr::processGetAllQueue() clearGetQueues(region_id); // Invalidates region_id continue; } - else if (!regionp->capabilitiesReceived()) + else if (!regionp->capabilitiesReceived() || regionp->materialsCapThrottled()) { continue; } @@ -663,6 +664,7 @@ void LLMaterialMgr::processGetAllQueue() LL_DEBUGS("Materials") << "GET all for region " << region_id << "url " << capURL << LL_ENDL; LLHTTPClient::ResponderPtr materialsResponder = new LLMaterialsResponder("GET", capURL, boost::bind(&LLMaterialMgr::onGetAllResponse, this, _1, _2, *itRegion)); LLHTTPClient::get(capURL, materialsResponder); + regionp->resetMaterialsCapThrottle(); mGetAllPending.insert(std::pair<LLUUID, F64>(region_id, LLFrameTimer::getTotalSeconds())); mGetAllQueue.erase(itRegion); // Invalidates region_id } @@ -670,7 +672,7 @@ void LLMaterialMgr::processGetAllQueue() void LLMaterialMgr::processPutQueue() { - typedef std::map<const LLViewerRegion*, LLSD> regionput_request_map; + typedef std::map<LLViewerRegion*, LLSD> regionput_request_map; regionput_request_map requests; put_queue_t::iterator loopQueue = mPutQueue.begin(); @@ -680,25 +682,27 @@ void LLMaterialMgr::processPutQueue() const LLUUID& object_id = itQueue->first; const LLViewerObject* objectp = gObjectList.findObject(object_id); - if ( (!objectp) || (!objectp->getRegion()) ) + if ( !objectp ) { - LL_WARNS("Materials") << "Object or object region is NULL" << LL_ENDL; - + LL_WARNS("Materials") << "Object is NULL" << LL_ENDL; mPutQueue.erase(itQueue); - continue; } - - const LLViewerRegion* regionp = objectp->getRegion(); - if (!regionp->capabilitiesReceived()) + else { - continue; + LLViewerRegion* regionp = objectp->getRegion(); + if ( !regionp ) + { + LL_WARNS("Materials") << "Object region is NULL" << LL_ENDL; + mPutQueue.erase(itQueue); } - + else if ( regionp->capabilitiesReceived() && !regionp->materialsCapThrottled()) + { LLSD& facesData = requests[regionp]; facematerial_map_t& face_map = itQueue->second; + U32 max_entries = regionp->getMaxMaterialsPerTransaction(); facematerial_map_t::iterator itFace = face_map.begin(); - while ( (face_map.end() != itFace) && (facesData.size() < MATERIALS_GET_MAX_ENTRIES) ) + while ( (face_map.end() != itFace) && (facesData.size() < max_entries) ) { LLSD faceData = LLSD::emptyMap(); faceData[MATERIALS_CAP_FACE_FIELD] = static_cast<LLSD::Integer>(itFace->first); @@ -715,14 +719,17 @@ void LLMaterialMgr::processPutQueue() mPutQueue.erase(itQueue); } } + } + } for (regionput_request_map::const_iterator itRequest = requests.begin(); itRequest != requests.end(); ++itRequest) { - std::string capURL = itRequest->first->getCapability(MATERIALS_CAPABILITY_NAME); + LLViewerRegion* regionp = itRequest->first; + std::string capURL = regionp->getCapability(MATERIALS_CAPABILITY_NAME); if (capURL.empty()) { LL_WARNS("Materials") << "Capability '" << MATERIALS_CAPABILITY_NAME - << "' is not defined on region '" << itRequest->first->getName() << "'" << LL_ENDL; + << "' is not defined on region '" << regionp->getName() << "'" << LL_ENDL; continue; } @@ -745,6 +752,7 @@ void LLMaterialMgr::processPutQueue() LL_DEBUGS("Materials") << "put for " << itRequest->second.size() << " faces to region " << itRequest->first->getName() << LL_ENDL; LLHTTPClient::ResponderPtr materialsResponder = new LLMaterialsResponder("PUT", capURL, boost::bind(&LLMaterialMgr::onPutResponse, this, _1, _2)); LLHTTPClient::put(capURL, putData, materialsResponder); + regionp->resetMaterialsCapThrottle(); } else { @@ -773,7 +781,6 @@ void LLMaterialMgr::clearGetQueues(const LLUUID& region_id) mGetAllPending.erase(region_id); mGetAllCallbacks.erase(region_id); } - void LLMaterialMgr::onRegionRemoved(LLViewerRegion* regionp) { clearGetQueues(regionp->getRegionID()); diff --git a/indra/newview/llmaterialmgr.h b/indra/newview/llmaterialmgr.h index e317a791ad..e83f1f4e01 100644 --- a/indra/newview/llmaterialmgr.h +++ b/indra/newview/llmaterialmgr.h @@ -124,6 +124,8 @@ protected: put_queue_t mPutQueue; material_map_t mMaterials; + + U32 getMaxEntries(const LLViewerRegion* regionp); }; #endif // LL_LLMATERIALMGR_H diff --git a/indra/newview/llmediactrl.h b/indra/newview/llmediactrl.h index 7f2a5e1642..6c38c1fb56 100755 --- a/indra/newview/llmediactrl.h +++ b/indra/newview/llmediactrl.h @@ -46,6 +46,7 @@ class LLMediaCtrl : { LOG_CLASS(LLMediaCtrl); public: + struct Params : public LLInitParam::Block<Params, LLPanel::Params> { Optional<std::string> start_url; diff --git a/indra/newview/llmenuoptionpathfindingrebakenavmesh.cpp b/indra/newview/llmenuoptionpathfindingrebakenavmesh.cpp index 2b92b0b3d1..a567d1217a 100755 --- a/indra/newview/llmenuoptionpathfindingrebakenavmesh.cpp +++ b/indra/newview/llmenuoptionpathfindingrebakenavmesh.cpp @@ -92,7 +92,7 @@ void LLMenuOptionPathfindingRebakeNavmesh::initialize() void LLMenuOptionPathfindingRebakeNavmesh::quit() { - if (mIsInitialized) + if (mIsInitialized) // Quitting from the login screen leaves this uninitialized { if (mNavMeshSlot.connected()) { diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index b47fe9d4b1..2e02805c02 100755 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -1,3 +1,4 @@ + /** * @file llmeshrepository.cpp * @brief Mesh repository implementation. @@ -288,7 +289,14 @@ public: ~LLMeshSkinInfoResponder() { - llassert(mProcessed); + if (!LLApp::isQuitting() && + !mProcessed && + mMeshID.notNull()) + { // Something went wrong, retry + llwarns << "Timeout or service unavailable, retrying loadMeshSkinInfo() for " << mMeshID << llendl; + LLMeshRepository::sHTTPRetryCount++; + gMeshRepo.mThread->loadMeshSkinInfo(mMeshID); + } } virtual void completedRaw(U32 status, const std::string& reason, @@ -313,7 +321,14 @@ public: ~LLMeshDecompositionResponder() { - llassert(mProcessed); + if (!LLApp::isQuitting() && + !mProcessed && + mMeshID.notNull()) + { // Something went wrong, retry + llwarns << "Timeout or service unavailable, retrying loadMeshDecomposition() for " << mMeshID << llendl; + LLMeshRepository::sHTTPRetryCount++; + gMeshRepo.mThread->loadMeshDecomposition(mMeshID); + } } virtual void completedRaw(U32 status, const std::string& reason, @@ -338,7 +353,14 @@ public: ~LLMeshPhysicsShapeResponder() { - llassert(mProcessed); + if (!LLApp::isQuitting() && + !mProcessed && + mMeshID.notNull()) + { // Something went wrong, retry + llwarns << "Timeout or service unavailable, retrying loadMeshPhysicsShape() for " << mMeshID << llendl; + LLMeshRepository::sHTTPRetryCount++; + gMeshRepo.mThread->loadMeshPhysicsShape(mMeshID); + } } virtual void completedRaw(U32 status, const std::string& reason, @@ -588,7 +610,7 @@ void LLMeshRepoThread::run() if (!fetchMeshLOD(req.mMeshParams, req.mLOD, count))//failed, resubmit { mMutex->lock(); - mLODReqQ.push(req) ; + mLODReqQ.push(req); mMutex->unlock(); } } @@ -1200,8 +1222,7 @@ bool LLMeshRepoThread::headerReceived(const LLVolumeParams& mesh_params, U8* dat LLMutexLock lock(mHeaderMutex); mMeshHeaderSize[mesh_id] = header_size; mMeshHeader[mesh_id] = header; - } - + } LLMutexLock lock(mMutex); // make sure only one thread access mPendingLOD at the same time. @@ -1919,7 +1940,7 @@ void LLMeshLODResponder::completedRaw(U32 status, const std::string& reason, if (data_size < mRequestedBytes) { - if (status == 499 || status == 503) + if (status == HTTP_INTERNAL_ERROR || status == HTTP_SERVICE_UNAVAILABLE) { //timeout or service unavailable, try again llwarns << "Timeout or service unavailable, retrying." << llendl; LLMeshRepository::sHTTPRetryCount++; @@ -1927,7 +1948,7 @@ void LLMeshLODResponder::completedRaw(U32 status, const std::string& reason, } else { - llassert(status == 499 || status == 503); //intentionally trigger a breakpoint + llassert(status == HTTP_INTERNAL_ERROR || status == HTTP_SERVICE_UNAVAILABLE); //intentionally trigger a breakpoint llwarns << "Unhandled status " << status << llendl; } return; @@ -1983,15 +2004,15 @@ void LLMeshSkinInfoResponder::completedRaw(U32 status, const std::string& reason if (data_size < mRequestedBytes) { - if (status == 499 || status == 503) + if (status == HTTP_INTERNAL_ERROR || status == HTTP_SERVICE_UNAVAILABLE) { //timeout or service unavailable, try again - llwarns << "Timeout or service unavailable, retrying." << llendl; + llwarns << "Timeout or service unavailable, retrying loadMeshSkinInfo() for " << mMeshID << llendl; LLMeshRepository::sHTTPRetryCount++; gMeshRepo.mThread->loadMeshSkinInfo(mMeshID); } else { - llassert(status == 499 || status == 503); //intentionally trigger a breakpoint + llassert(status == HTTP_INTERNAL_ERROR || status == HTTP_SERVICE_UNAVAILABLE); //intentionally trigger a breakpoint llwarns << "Unhandled status " << status << llendl; } return; @@ -2046,15 +2067,15 @@ void LLMeshDecompositionResponder::completedRaw(U32 status, const std::string& r if (data_size < mRequestedBytes) { - if (status == 499 || status == 503) + if (status == HTTP_INTERNAL_ERROR || status == HTTP_SERVICE_UNAVAILABLE) { //timeout or service unavailable, try again - llwarns << "Timeout or service unavailable, retrying." << llendl; + llwarns << "Timeout or service unavailable, retrying loadMeshDecomposition() for " << mMeshID << llendl; LLMeshRepository::sHTTPRetryCount++; gMeshRepo.mThread->loadMeshDecomposition(mMeshID); } else { - llassert(status == 499 || status == 503); //intentionally trigger a breakpoint + llassert(status == HTTP_INTERNAL_ERROR || status == HTTP_SERVICE_UNAVAILABLE); //intentionally trigger a breakpoint llwarns << "Unhandled status " << status << llendl; } return; @@ -2110,15 +2131,15 @@ void LLMeshPhysicsShapeResponder::completedRaw(U32 status, const std::string& re if (data_size < mRequestedBytes) { - if (status == 499 || status == 503) + if (status == HTTP_INTERNAL_ERROR || status == HTTP_SERVICE_UNAVAILABLE) { //timeout or service unavailable, try again - llwarns << "Timeout or service unavailable, retrying." << llendl; + llwarns << "Timeout or service unavailable, retrying loadMeshPhysicsShape() for " << mMeshID << llendl; LLMeshRepository::sHTTPRetryCount++; gMeshRepo.mThread->loadMeshPhysicsShape(mMeshID); } else { - llassert(status == 499 || status == 503); //intentionally trigger a breakpoint + llassert(status == HTTP_INTERNAL_ERROR || status == HTTP_SERVICE_UNAVAILABLE); //intentionally trigger a breakpoint llwarns << "Unhandled status " << status << llendl; } return; @@ -2171,16 +2192,16 @@ void LLMeshHeaderResponder::completedRaw(U32 status, const std::string& reason, // << "Header responder failed with status: " // << status << ": " << reason << llendl; - // 503 (service unavailable) or 499 (timeout) + // 503 (service unavailable) or 499 (internal Linden-generated error) // can be due to server load and can be retried // TODO*: Add maximum retry logic, exponential backoff // and (somewhat more optional than the others) retries // again after some set period of time - llassert(status == 503 || status == 499); + llassert(status == HTTP_NOT_FOUND || status == HTTP_SERVICE_UNAVAILABLE || status == HTTP_REQUEST_TIME_OUT || status == HTTP_INTERNAL_ERROR); - if (status == 503 || status == 499) + if (status == HTTP_SERVICE_UNAVAILABLE || status == HTTP_REQUEST_TIME_OUT || status == HTTP_INTERNAL_ERROR) { //retry llwarns << "Timeout or service unavailable, retrying." << llendl; LLMeshRepository::sHTTPRetryCount++; @@ -2192,7 +2213,7 @@ void LLMeshHeaderResponder::completedRaw(U32 status, const std::string& reason, } else { - llwarns << "Unhandled status." << llendl; + llwarns << "Unhandled status: " << status << llendl; } } diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index 8602271f84..8eaf691d6f 100755 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -413,7 +413,7 @@ public: void startRequest() { ++mPendingUploads; } void stopRequest() { --mPendingUploads; } - + bool finished() { return mFinished; } virtual void run(); void preStart(); diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp index 7f396b7b7e..7ddd04fed0 100755 --- a/indra/newview/llnamelistctrl.cpp +++ b/indra/newview/llnamelistctrl.cpp @@ -416,9 +416,9 @@ void LLNameListCtrl::onAvatarNameCache(const LLUUID& agent_id, } -void LLNameListCtrl::updateColumns() +void LLNameListCtrl::updateColumns(bool force_update) { - LLScrollListCtrl::updateColumns(); + LLScrollListCtrl::updateColumns(force_update); if (!mNameColumn.empty()) { diff --git a/indra/newview/llnamelistctrl.h b/indra/newview/llnamelistctrl.h index 271802d48a..92e82b672d 100755 --- a/indra/newview/llnamelistctrl.h +++ b/indra/newview/llnamelistctrl.h @@ -67,6 +67,7 @@ class LLNameListCtrl : public LLScrollListCtrl, public LLInstanceTracker<LLNameListCtrl> { public: + typedef enum e_name_type { INDIVIDUAL, @@ -149,7 +150,7 @@ public: void sortByName(BOOL ascending); - /*virtual*/ void updateColumns(); + /*virtual*/ void updateColumns(bool force_update); /*virtual*/ void mouseOverHighlightNthItem( S32 index ); private: diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp index eb4601a469..ef4d735616 100755 --- a/indra/newview/llnotificationhandlerutil.cpp +++ b/indra/newview/llnotificationhandlerutil.cpp @@ -125,24 +125,29 @@ void log_name_callback(const std::string& full_name, const std::string& from_nam // static void LLHandlerUtil::logToIMP2P(const LLNotificationPtr& notification, bool to_file_only) { - LLUUID from_id = notification->getPayload()["from_id"]; + if (!gCacheName) + { + return; + } - if (from_id.isNull()) - { - // Normal behavior for system generated messages, don't spam. - // llwarns << " from_id for notification " << notification->getName() << " is null " << llendl; - return; - } + LLUUID from_id = notification->getPayload()["from_id"]; - if(to_file_only) - { - gCacheName->get(from_id, false, boost::bind(&log_name_callback, _2, "", notification->getMessage(), LLUUID())); - } - else - { - gCacheName->get(from_id, false, boost::bind(&log_name_callback, _2, INTERACTIVE_SYSTEM_FROM, notification->getMessage(), from_id)); - } + if (from_id.isNull()) + { + // Normal behavior for system generated messages, don't spam. + // llwarns << " from_id for notification " << notification->getName() << " is null " << llendl; + return; + } + + if(to_file_only) + { + gCacheName->get(from_id, false, boost::bind(&log_name_callback, _2, "", notification->getMessage(), LLUUID())); } + else + { + gCacheName->get(from_id, false, boost::bind(&log_name_callback, _2, INTERACTIVE_SYSTEM_FROM, notification->getMessage(), from_id)); + } +} // static void LLHandlerUtil::logGroupNoticeToIMGroup( diff --git a/indra/newview/llnotificationstorage.h b/indra/newview/llnotificationstorage.h index 7aabf7d09e..53fd898ea4 100755 --- a/indra/newview/llnotificationstorage.h +++ b/indra/newview/llnotificationstorage.h @@ -44,6 +44,7 @@ public: protected: bool writeNotifications(const LLSD& pNotificationData) const; bool readNotifications(LLSD& pNotificationData) const; + void setFileName(std::string pFileName) {mFileName = pFileName;} LLNotificationResponderInterface* createResponder(const std::string& pNotificationName, const LLSD& pParams) const; diff --git a/indra/newview/llnotificationtiphandler.cpp b/indra/newview/llnotificationtiphandler.cpp index a85335f1ba..4ca961c1f9 100755 --- a/indra/newview/llnotificationtiphandler.cpp +++ b/indra/newview/llnotificationtiphandler.cpp @@ -83,13 +83,6 @@ bool LLTipHandler::processNotification(const LLNotificationPtr& notification) if (notification->canLogToChat()) { LLHandlerUtil::logToNearbyChat(notification, CHAT_SOURCE_SYSTEM); - - // don't show toast if Nearby Chat is opened - LLFloaterIMNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance<LLFloaterIMNearbyChat>("nearby_chat"); - if (nearby_chat->isChatVisible()) - { - return false; - } } std::string session_name = notification->getPayload()["SESSION_NAME"]; diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index 911af9df04..3869219da6 100755 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -66,7 +66,7 @@ #include "llvovolume.h" #include "lluictrlfactory.h" #include "llpluginclassmedia.h" -#include "llviewertexturelist.h" +#include "llviewertexturelist.h"// Update sel manager as to which channel we're editing so it can reflect the correct overlay UI // // Constant definitions for comboboxes @@ -89,6 +89,19 @@ const S32 SHINY_TEXTURE = 4; // use supplied specular map // std::string USE_TEXTURE; +LLRender::eTexIndex LLPanelFace::getTextureChannelToEdit() +{ + LLComboBox* combobox_matmedia = getChild<LLComboBox>("combobox matmedia"); + LLComboBox* combobox_mattype = getChild<LLComboBox>("combobox mattype"); + + LLRender::eTexIndex channel_to_edit = (combobox_matmedia && combobox_matmedia->getCurrentIndex() == MATMEDIA_MATERIAL) ? + (combobox_mattype ? (LLRender::eTexIndex)combobox_mattype->getCurrentIndex() : LLRender::DIFFUSE_MAP) : LLRender::DIFFUSE_MAP; + + channel_to_edit = (channel_to_edit == LLRender::NORMAL_MAP) ? (getCurrentNormalMap().isNull() ? LLRender::DIFFUSE_MAP : channel_to_edit) : channel_to_edit; + channel_to_edit = (channel_to_edit == LLRender::SPECULAR_MAP) ? (getCurrentSpecularMap().isNull() ? LLRender::DIFFUSE_MAP : channel_to_edit) : channel_to_edit; + return channel_to_edit; +} + // Things the UI provides... // LLUUID LLPanelFace::getCurrentNormalMap() { return getChild<LLTextureCtrl>("bumpytexture control")->getImageAssetID(); } @@ -1194,7 +1207,8 @@ void LLPanelFace::updateUI() getChildView("checkbox fullbright")->setEnabled(editable); getChild<LLUICtrl>("checkbox fullbright")->setTentative(!identical_fullbright); } - + + // Repeats per meter { F32 repeats_diff = 1.f; @@ -1218,6 +1232,9 @@ void LLPanelFace::updateUI() F32 repeats = 1.0f; U32 material_type = (combobox_matmedia->getCurrentIndex() == MATMEDIA_MATERIAL) ? combobox_mattype->getCurrentIndex() : MATTYPE_DIFFUSE; + + LLSelectMgr::getInstance()->setTextureChannel(LLRender::eTexIndex(material_type)); + switch (material_type) { default: @@ -1328,18 +1345,6 @@ void LLPanelFace::updateUI() getChild<LLColorSwatchCtrl>("shinycolorswatch")->set(material->getSpecularLightColor(),TRUE); } - // Update sel manager as to which channel we're editing so it can reflect the correct overlay UI - // NORSPEC-103 - LLRender::eTexIndex channel_to_edit = (combobox_matmedia->getCurrentIndex() == MATMEDIA_MATERIAL) ? (LLRender::eTexIndex)combobox_mattype->getCurrentIndex() : LLRender::DIFFUSE_MAP; - - if ( ((channel_to_edit == LLRender::NORMAL_MAP) && material->getNormalID().isNull()) - ||((channel_to_edit == LLRender::SPECULAR_MAP) && material->getSpecularID().isNull())) - { - channel_to_edit = LLRender::DIFFUSE_MAP; - } - - LLSelectMgr::getInstance()->setTextureChannel(channel_to_edit); - // Bumpy (normal) texture_ctrl = getChild<LLTextureCtrl>("bumpytexture control"); texture_ctrl->setImageAssetID(material->getNormalID()); @@ -1365,10 +1370,6 @@ void LLPanelFace::updateUI() updateBumpyControls(!material->getNormalID().isNull(), true); } } - else - { - LLSelectMgr::getInstance()->setTextureChannel(LLRender::DIFFUSE_MAP); - } } // Set variable values for numeric expressions diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h index 42c1f6bd48..b684881225 100755 --- a/indra/newview/llpanelface.h +++ b/indra/newview/llpanelface.h @@ -100,6 +100,19 @@ public: void setMediaURL(const std::string& url); void setMediaType(const std::string& mime_type); + LLMaterialPtr createDefaultMaterial(LLMaterialPtr current_material) + { + LLMaterialPtr new_material(!current_material.isNull() ? new LLMaterial(current_material->asLLSD()) : new LLMaterial()); + llassert_always(new_material); + + // Preserve old diffuse alpha mode or assert correct default blend mode as appropriate for the alpha channel content of the diffuse texture + // + new_material->setDiffuseAlphaMode(current_material.isNull() ? (isAlpha() ? LLMaterial::DIFFUSE_ALPHA_MODE_BLEND : LLMaterial::DIFFUSE_ALPHA_MODE_NONE) : current_material->getDiffuseAlphaMode()); + return new_material; + } + + LLRender::eTexIndex getTextureChannelToEdit(); + protected: void getState(); @@ -178,6 +191,8 @@ protected: static F32 valueGlow(LLViewerObject* object, S32 face); + + private: bool isAlpha() { return mIsAlpha; } @@ -234,17 +249,32 @@ private: { if (_edit) { - LLMaterialPtr new_material(!current_material.isNull() ? new LLMaterial(current_material->asLLSD()) : new LLMaterial()); + LLMaterialPtr new_material = _panel->createDefaultMaterial(current_material); llassert_always(new_material); // Determine correct alpha mode for current diffuse texture // (i.e. does it have an alpha channel that makes alpha mode useful) // - U8 default_alpha_mode = (_panel->isAlpha() ? LLMaterial::DIFFUSE_ALPHA_MODE_BLEND : LLMaterial::DIFFUSE_ALPHA_MODE_NONE); + // _panel->isAlpha() "lies" when one face has alpha and the rest do not (NORSPEC-329) + // need to get per-face answer to this question for sane alpha mode retention on updates. + // + bool is_alpha_face = object->isImageAlphaBlended(face); - // Default to matching expected state of UI + // need to keep this original answer for valid comparisons in logic below // - new_material->setDiffuseAlphaMode(current_material.isNull() ? default_alpha_mode : current_material->getDiffuseAlphaMode()); + U8 original_default_alpha_mode = is_alpha_face ? LLMaterial::DIFFUSE_ALPHA_MODE_BLEND : LLMaterial::DIFFUSE_ALPHA_MODE_NONE; + + U8 default_alpha_mode = original_default_alpha_mode; + + if (!current_material.isNull()) + { + default_alpha_mode = current_material->getDiffuseAlphaMode(); + } + + // Insure we don't inherit the default of blend by accident... + // this will be stomped by a legit request to change the alpha mode by the apply() below + // + new_material->setDiffuseAlphaMode(default_alpha_mode); // Do "It"! // @@ -254,7 +284,13 @@ private: LLUUID new_normal_map_id = new_material->getNormalID(); LLUUID new_spec_map_id = new_material->getSpecularID(); - bool is_default_blend_mode = (new_alpha_mode == default_alpha_mode); + if ((new_alpha_mode == LLMaterial::DIFFUSE_ALPHA_MODE_BLEND) && !is_alpha_face) + { + new_alpha_mode = LLMaterial::DIFFUSE_ALPHA_MODE_NONE; + new_material->setDiffuseAlphaMode(LLMaterial::DIFFUSE_ALPHA_MODE_NONE); + } + + bool is_default_blend_mode = (new_alpha_mode == original_default_alpha_mode); bool is_need_material = !is_default_blend_mode || !new_normal_map_id.isNull() || !new_spec_map_id.isNull(); if (!is_need_material) diff --git a/indra/newview/llpanelgroupinvite.cpp b/indra/newview/llpanelgroupinvite.cpp index 133b269c11..a9a3c686a6 100755 --- a/indra/newview/llpanelgroupinvite.cpp +++ b/indra/newview/llpanelgroupinvite.cpp @@ -85,6 +85,7 @@ public: std::string mAlreadyInGroup; std::string mTooManySelected; bool mConfirmedOwnerInvite; + std::set<LLUUID> mInviteeIDs; void (*mCloseCallback)(void* data); @@ -117,31 +118,30 @@ LLPanelGroupInvite::impl::~impl() } } +const S32 MAX_GROUP_INVITES = 100; // Max invites per request. 100 to match server cap. + void LLPanelGroupInvite::impl::addUsers(const std::vector<std::string>& names, const uuid_vec_t& agent_ids) { std::string name; LLUUID id; + if (names.size() + mInviteeIDs.size() > MAX_GROUP_INVITES) + { + // Fail! Show a warning and don't add any names. + LLSD msg; + msg["MESSAGE"] = mTooManySelected; + LLNotificationsUtil::add("GenericAlert", msg); + return; + } + for (S32 i = 0; i < (S32)names.size(); i++) { name = names[i]; id = agent_ids[i]; // Make sure this agent isn't already in the list. - bool already_in_list = false; - std::vector<LLScrollListItem*> items = mInvitees->getAllData(); - for (std::vector<LLScrollListItem*>::iterator iter = items.begin(); - iter != items.end(); ++iter) - { - LLScrollListItem* item = *iter; - if (item->getUUID() == id) - { - already_in_list = true; - break; - } - } - if (already_in_list) + if (mInviteeIDs.find(id) != mInviteeIDs.end()) { continue; } @@ -152,6 +152,7 @@ void LLPanelGroupInvite::impl::addUsers(const std::vector<std::string>& names, row["columns"][0]["value"] = name; mInvitees->addElement(row); + mInviteeIDs.insert(id); } } @@ -193,7 +194,6 @@ void LLPanelGroupInvite::impl::submitInvitations() role_member_pairs[item->getUUID()] = role_id; } - const S32 MAX_GROUP_INVITES = 100; // Max invites per request. 100 to match server cap. if (role_member_pairs.size() > MAX_GROUP_INVITES) { // Fail! @@ -334,6 +334,12 @@ void LLPanelGroupInvite::impl::handleRemove() mInvitees->getAllSelected(); if (selection.empty()) return; + std::vector<LLScrollListItem*>::iterator iter; + for(iter = selection.begin(); iter != selection.end(); ++iter) + { + mInviteeIDs.erase( (*iter)->getUUID() ); + } + // Remove all selected invitees. mInvitees->deleteSelectedItems(); mRemoveButton->setEnabled(FALSE); @@ -459,6 +465,7 @@ void LLPanelGroupInvite::clear() mImplementation->mRoleNames->clear(); mImplementation->mRoleNames->removeall(); mImplementation->mOKButton->setEnabled(FALSE); + mImplementation->mInviteeIDs.clear(); } void LLPanelGroupInvite::addUsers(uuid_vec_t& agent_ids) diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index cfdac11d26..fdcd1f5ebb 100755 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -1101,27 +1101,61 @@ void LLPanelGroupMembersSubTab::onEjectMembers(void *userdata) } void LLPanelGroupMembersSubTab::handleEjectMembers() -{ - //send down an eject message - uuid_vec_t selected_members; - +{ std::vector<LLScrollListItem*> selection = mMembersList->getAllSelected(); if (selection.empty()) return; - - std::vector<LLScrollListItem*>::iterator itor; - for (itor = selection.begin() ; - itor != selection.end(); ++itor) + + S32 selection_count = selection.size(); + if (selection_count == 1) { - LLUUID member_id = (*itor)->getUUID(); - selected_members.push_back( member_id ); + LLSD args; + LLUUID selected_avatar = mMembersList->getValue().asUUID(); + std::string fullname = LLSLURL("agent", selected_avatar, "inspect").getSLURLString(); + args["AVATAR_NAME"] = fullname; + LLSD payload; + LLNotificationsUtil::add("EjectGroupMemberWarning", + args, + payload, + boost::bind(&LLPanelGroupMembersSubTab::handleEjectCallback, this, _1, _2)); } + else + { + LLSD args; + args["COUNT"] = llformat("%d", selection_count); + LLSD payload; + LLNotificationsUtil::add("EjectGroupMembersWarning", + args, + payload, + boost::bind(&LLPanelGroupMembersSubTab::handleEjectCallback, this, _1, _2)); + } +} - mMembersList->deleteSelectedItems(); - - sendEjectNotifications(mGroupID, selected_members); - - LLGroupMgr::getInstance()->sendGroupMemberEjects(mGroupID, - selected_members); +bool LLPanelGroupMembersSubTab::handleEjectCallback(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (0 == option) // Eject button + { + //send down an eject message + uuid_vec_t selected_members; + + std::vector<LLScrollListItem*> selection = mMembersList->getAllSelected(); + if (selection.empty()) return false; + + std::vector<LLScrollListItem*>::iterator itor; + for (itor = selection.begin() ; + itor != selection.end(); ++itor) + { + LLUUID member_id = (*itor)->getUUID(); + selected_members.push_back( member_id ); + } + + mMembersList->deleteSelectedItems(); + + sendEjectNotifications(mGroupID, selected_members); + + LLGroupMgr::getInstance()->sendGroupMemberEjects(mGroupID, selected_members); + } + return false; } void LLPanelGroupMembersSubTab::sendEjectNotifications(const LLUUID& group_id, const uuid_vec_t& selected_members) diff --git a/indra/newview/llpanelgrouproles.h b/indra/newview/llpanelgrouproles.h index 78bb3c57a1..0cf272f3ee 100755 --- a/indra/newview/llpanelgrouproles.h +++ b/indra/newview/llpanelgrouproles.h @@ -167,6 +167,7 @@ public: static void onEjectMembers(void*); void handleEjectMembers(); void sendEjectNotifications(const LLUUID& group_id, const uuid_vec_t& selected_members); + bool handleEjectCallback(const LLSD& notification, const LLSD& response); static void onRoleCheck(LLUICtrl* check, void* user_data); void handleRoleCheck(const LLUUID& role_id, diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index bcb90bcb56..911ecaad9d 100755 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -82,10 +82,6 @@ const S32 MAX_PASSWORD = 16; LLPanelLogin *LLPanelLogin::sInstance = NULL; BOOL LLPanelLogin::sCapslockDidNotification = FALSE; -// Helper for converting a user name into the canonical "Firstname Lastname" form. -// For new accounts without a last name "Resident" is added as a last name. -static std::string canonicalize_username(const std::string& name); - class LLLoginRefreshHandler : public LLCommandHandler { public: @@ -266,7 +262,6 @@ void LLPanelLogin::addFavoritesToStartLocation() // Load favorites into the combo. std::string user_defined_name = getChild<LLComboBox>("username_combo")->getSimple(); - std::string canonical_user_name = canonicalize_username(user_defined_name); std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites.xml"); LLSD fav_llsd; llifstream file; @@ -279,7 +274,7 @@ void LLPanelLogin::addFavoritesToStartLocation() // The account name in stored_favorites.xml has Resident last name even if user has // a single word account name, so it can be compared case-insensitive with the // user defined "firstname lastname". - S32 res = LLStringUtil::compareInsensitive(canonical_user_name, iter->first); + S32 res = LLStringUtil::compareInsensitive(user_defined_name, iter->first); if (res != 0) { lldebugs << "Skipping favorites for " << iter->first << llendl; @@ -1012,29 +1007,3 @@ void LLPanelLogin::onLocationSLURL() LLStartUp::setStartSLURL(location); // calls onUpdateStartSLURL, above } - - -std::string canonicalize_username(const std::string& name) -{ - std::string cname = name; - LLStringUtil::trim(cname); - - // determine if the username is a first/last form or not. - size_t separator_index = cname.find_first_of(" ._"); - std::string first = cname.substr(0, separator_index); - std::string last; - if (separator_index != cname.npos) - { - last = cname.substr(separator_index+1, cname.npos); - LLStringUtil::trim(last); - } - else - { - // ...on Linden grids, single username users as considered to have - // last name "Resident" - last = "Resident"; - } - - // Username in traditional "firstname lastname" form. - return first + ' ' + last; -} diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index d6535c88e9..53deded2f2 100755 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -130,6 +130,8 @@ BOOL LLPanelMainInventory::postBuild() mFilterTabs = getChild<LLTabContainer>("inventory filter tabs"); mFilterTabs->setCommitCallback(boost::bind(&LLPanelMainInventory::onFilterSelected, this)); + mCounterCtrl = getChild<LLUICtrl>("ItemcountText"); + //panel->getFilter().markDefault(); // Set up the default inv. panel/filter settings. @@ -566,7 +568,7 @@ void LLPanelMainInventory::draw() void LLPanelMainInventory::updateItemcountText() { // *TODO: Calling setlocale() on each frame may be inefficient. - LLLocale locale(LLStringUtil::getLocale()); + //LLLocale locale(LLStringUtil::getLocale()); std::string item_count_string; LLResMgr::getInstance()->getIntegerString(item_count_string, gInventory.getItemCount()); @@ -589,8 +591,7 @@ void LLPanelMainInventory::updateItemcountText() text = getString("ItemcountUnknown"); } - // *TODO: Cache the LLUICtrl* for the ItemcountText control - getChild<LLUICtrl>("ItemcountText")->setValue(text); + mCounterCtrl->setValue(text); } void LLPanelMainInventory::onFocusReceived() diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h index 899931aa89..394b004e20 100755 --- a/indra/newview/llpanelmaininventory.h +++ b/indra/newview/llpanelmaininventory.h @@ -121,6 +121,7 @@ private: LLFilterEditor* mFilterEditor; LLTabContainer* mFilterTabs; + LLUICtrl* mCounterCtrl; LLHandle<LLFloater> mFinderHandle; LLInventoryPanel* mActivePanel; bool mResortActivePanel; diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 4138558bad..d7c634d619 100755 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -76,6 +76,8 @@ static const std::string BLOCKED_TAB_NAME = "blocked_panel"; // blocked avatars static const std::string COLLAPSED_BY_USER = "collapsed_by_user"; +extern S32 gMaxAgentGroups; + /** Comparator for comparing avatar items by last interaction date */ class LLAvatarItemRecentComparator : public LLAvatarItemComparator { @@ -808,6 +810,8 @@ void LLPanelPeople::updateButtons() LLPanel* groups_panel = mTabContainer->getCurrentPanel(); groups_panel->getChildView("minus_btn")->setEnabled(item_selected && selected_id.notNull()); // a real group selected + groups_panel->getChild<LLUICtrl>("groupcount")->setTextArg("[COUNT]", llformat("%d",gAgent.mGroups.count())); + groups_panel->getChild<LLUICtrl>("groupcount")->setTextArg("[REMAINING]", llformat("%d",(gMaxAgentGroups-gAgent.mGroups.count()))); } else { diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index e2e7006773..5acc98904b 100755 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -36,6 +36,8 @@ #include "lltabcontainer.h" #include "llviewercontrol.h" #include "llviewernetwork.h" +#include "llmutelist.h" +#include "llpanelblockedlist.h" static const std::string PANEL_PICKS = "panel_picks"; @@ -137,6 +139,12 @@ public: return true; } + if (verb == "removefriend") + { + LLAvatarActions::removeFriendDialog(avatar_id); + return true; + } + if (verb == "mute") { if (! LLAvatarActions::isBlocked(avatar_id)) @@ -155,6 +163,18 @@ public: return true; } + if (verb == "block") + { + if (params.size() > 2) + { + const std::string object_name = params[2].asString(); + LLMute mute(avatar_id, object_name, LLMute::OBJECT); + LLMuteList::getInstance()->add(mute); + LLPanelBlockedList::showPanelAndSelect(mute.mID); + } + return true; + } + return false; } }; diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp index 02d363d795..a1d60b5b16 100755 --- a/indra/newview/llpanelvolume.cpp +++ b/indra/newview/llpanelvolume.cpp @@ -710,9 +710,19 @@ void LLPanelVolume::onLightCancelColor(const LLSD& data) void LLPanelVolume::onLightCancelTexture(const LLSD& data) { LLTextureCtrl* LightTextureCtrl = getChild<LLTextureCtrl>("light texture control"); + if (LightTextureCtrl) { - LightTextureCtrl->setImageAssetID(mLightSavedTexture); + LightTextureCtrl->setImageAssetID(LLUUID::null); + } + + LLVOVolume *volobjp = (LLVOVolume *) mObject.get(); + if(volobjp) + { + // Cancel the light texture as requested + // NORSPEC-292 + // + volobjp->setLightTextureID(LLUUID::null); } } diff --git a/indra/newview/llpersistentnotificationstorage.cpp b/indra/newview/llpersistentnotificationstorage.cpp index 666f10df96..076c3e0235 100755 --- a/indra/newview/llpersistentnotificationstorage.cpp +++ b/indra/newview/llpersistentnotificationstorage.cpp @@ -38,7 +38,8 @@ LLPersistentNotificationStorage::LLPersistentNotificationStorage() : LLSingleton<LLPersistentNotificationStorage>() - , LLNotificationStorage(gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "open_notifications.xml")) + , LLNotificationStorage("") + , mLoaded(false) { } @@ -89,8 +90,13 @@ void LLPersistentNotificationStorage::loadNotifications() LL_INFOS("LLPersistentNotificationStorage") << "start loading notifications" << LL_ENDL; - LLNotifications::instance().getChannel("Persistent")-> - connectChanged(boost::bind(&LLPersistentNotificationStorage::onPersistentChannelChanged, this, _1)); + if (mLoaded) + { + LL_INFOS("LLPersistentNotificationStorage") << "notifications already loaded, exiting" << LL_ENDL; + return; + } + + mLoaded = true; LLSD input; if (!readNotifications(input) ||input.isUndefined()) @@ -135,8 +141,20 @@ void LLPersistentNotificationStorage::loadNotifications() LL_INFOS("LLPersistentNotificationStorage") << "finished loading notifications" << LL_ENDL; } +void LLPersistentNotificationStorage::initialize() +{ + setFileName(gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "open_notifications.xml")); + LLNotifications::instance().getChannel("Persistent")-> + connectChanged(boost::bind(&LLPersistentNotificationStorage::onPersistentChannelChanged, this, _1)); +} + bool LLPersistentNotificationStorage::onPersistentChannelChanged(const LLSD& payload) { + // In case we received channel changed signal but haven't yet loaded notifications, do it + if (!mLoaded) + { + loadNotifications(); + } // we ignore "load" messages, but rewrite the persistence file on any other const std::string sigtype = payload["sigtype"].asString(); if ("load" != sigtype) diff --git a/indra/newview/llpersistentnotificationstorage.h b/indra/newview/llpersistentnotificationstorage.h index 98a825d2c1..bf0306380e 100755 --- a/indra/newview/llpersistentnotificationstorage.h +++ b/indra/newview/llpersistentnotificationstorage.h @@ -53,10 +53,13 @@ public: void saveNotifications(); void loadNotifications(); + void initialize(); + protected: private: bool onPersistentChannelChanged(const LLSD& payload); + bool mLoaded; }; #endif // LL_LLPERSISTENTNOTIFICATIONSTORAGE_H diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index eac4a752d4..2e9907fcd2 100755 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -84,6 +84,7 @@ #include "lltrans.h" #include "llviewercontrol.h" #include "llappviewer.h" +#include "llfloatergotoline.h" const std::string HELLO_LSL = "default\n" @@ -191,12 +192,17 @@ private: LLScriptEdCore* mEditorCore; static LLFloaterScriptSearch* sInstance; + +protected: + LLLineEditor* mSearchBox; + void onSearchBoxCommit(); }; LLFloaterScriptSearch* LLFloaterScriptSearch::sInstance = NULL; LLFloaterScriptSearch::LLFloaterScriptSearch(LLScriptEdCore* editor_core) : LLFloater(LLSD()), + mSearchBox(NULL), mEditorCore(editor_core) { buildFromFile("floater_script_search.xml"); @@ -219,6 +225,9 @@ LLFloaterScriptSearch::LLFloaterScriptSearch(LLScriptEdCore* editor_core) BOOL LLFloaterScriptSearch::postBuild() { + mSearchBox = getChild<LLLineEditor>("search_text"); + mSearchBox->setCommitCallback(boost::bind(&LLFloaterScriptSearch::onSearchBoxCommit, this)); + mSearchBox->setCommitOnFocusLost(FALSE); childSetAction("search_btn", onBtnSearch,this); childSetAction("replace_btn", onBtnReplace,this); childSetAction("replace_all_btn", onBtnReplaceAll,this); @@ -313,6 +322,15 @@ BOOL LLFloaterScriptSearch::handleKeyHere(KEY key, MASK mask) return FALSE; } +void LLFloaterScriptSearch::onSearchBoxCommit() +{ + if (mEditorCore && mEditorCore->mEditor) + { + LLCheckBoxCtrl* caseChk = getChild<LLCheckBoxCtrl>("case_text"); + mEditorCore->mEditor->selectNext(getChild<LLUICtrl>("search_text")->getValue().asString(), caseChk->get()); + } +} + /// --------------------------------------------------------------------------- /// LLScriptEdCore /// --------------------------------------------------------------------------- @@ -474,6 +492,9 @@ void LLScriptEdCore::initMenu() menuItem = getChild<LLMenuItemCallGL>("Search / Replace..."); menuItem->setClickCallback(boost::bind(&LLFloaterScriptSearch::show, this)); + menuItem = getChild<LLMenuItemCallGL>("Go to line..."); + menuItem->setClickCallback(boost::bind(&LLFloaterGotoLine::show, this)); + menuItem = getChild<LLMenuItemCallGL>("Help..."); menuItem->setClickCallback(boost::bind(&LLScriptEdCore::onBtnHelp, this)); diff --git a/indra/newview/llpreviewscript.h b/indra/newview/llpreviewscript.h index 7563cecd9d..9fb0a4fb63 100755 --- a/indra/newview/llpreviewscript.h +++ b/indra/newview/llpreviewscript.h @@ -34,6 +34,7 @@ #include "llcombobox.h" #include "lliconctrl.h" #include "llframetimer.h" +#include "llfloatergotoline.h" class LLLiveLSLFile; class LLMessageSystem; @@ -49,6 +50,7 @@ class LLKeywordToken; class LLVFS; class LLViewerInventoryItem; class LLScriptEdContainer; +class LLFloaterGotoLine; // Inner, implementation class. LLPreviewScript and LLLiveLSLEditor each own one of these. class LLScriptEdCore : public LLPanel @@ -58,6 +60,7 @@ class LLScriptEdCore : public LLPanel friend class LLLiveLSLEditor; friend class LLFloaterScriptSearch; friend class LLScriptEdContainer; + friend class LLFloaterGotoLine; protected: // Supposed to be invoked only by the container. diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 0cbdbe16a3..7b397d46f3 100755 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -91,7 +91,7 @@ #include "llvovolume.h" #include "pipeline.h" #include "llviewershadermgr.h" - +#include "llpanelface.h" #include "llglheaders.h" LLViewerObject* getSelectedParentObject(LLViewerObject *object) ; @@ -2534,7 +2534,7 @@ void LLSelectMgr::adjustTexturesByScale(BOOL send_to_sim, BOOL stretch) if (tep && !tep->getMaterialParams().isNull()) { LLMaterialPtr orig = tep->getMaterialParams(); - LLMaterialPtr p = new LLMaterial(orig->asLLSD()); + LLMaterialPtr p = gFloaterTools->getPanelFace()->createDefaultMaterial(orig); p->setNormalRepeat(normal_scale_s, normal_scale_t); p->setSpecularRepeat(specular_scale_s, specular_scale_t); @@ -2560,8 +2560,8 @@ void LLSelectMgr::adjustTexturesByScale(BOOL send_to_sim, BOOL stretch) if (tep && !tep->getMaterialParams().isNull()) { LLMaterialPtr orig = tep->getMaterialParams(); + LLMaterialPtr p = gFloaterTools->getPanelFace()->createDefaultMaterial(orig); - LLMaterialPtr p = new LLMaterial(orig->asLLSD()); p->setNormalRepeat(normal_scale_s, normal_scale_t); p->setSpecularRepeat(specular_scale_s, specular_scale_t); diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 78401020a6..d7ae897604 100755 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -1404,7 +1404,9 @@ void LLSpatialGroup::handleDestruction(const TreeNode* node) if (bridge->mAvatar.notNull()) { bridge->mAvatar->mAttachmentGeometryBytes -= mGeometryBytes; + bridge->mAvatar->mAttachmentGeometryBytes = llmax(bridge->mAvatar->mAttachmentGeometryBytes, 0); bridge->mAvatar->mAttachmentSurfaceArea -= mSurfaceArea; + bridge->mAvatar->mAttachmentSurfaceArea = llmax(bridge->mAvatar->mAttachmentSurfaceArea, 0.f); } } @@ -1498,6 +1500,8 @@ BOOL LLSpatialGroup::rebound() if (mOctreeNode->getChildCount() == 1 && mOctreeNode->getElementCount() == 0) { LLSpatialGroup* group = (LLSpatialGroup*) mOctreeNode->getChild(0)->getListener(0); + + //rebound single child group->rebound(); //copy single child's bounding box @@ -1506,10 +1510,11 @@ BOOL LLSpatialGroup::rebound() mExtents[0] = group->mExtents[0]; mExtents[1] = group->mExtents[1]; + //treat this node as a "chute" to a deeper level of the tree group->setState(SKIP_FRUSTUM_CHECK); } else if (mOctreeNode->isLeaf()) - { //copy object bounding box if this is a leaf + { //copy object bounding box if this is a leaf boundObjects(TRUE, mExtents[0], mExtents[1]); mBounds[0] = mObjectBounds[0]; mBounds[1] = mObjectBounds[1]; @@ -1518,14 +1523,17 @@ BOOL LLSpatialGroup::rebound() { LLVector4a& newMin = mExtents[0]; LLVector4a& newMax = mExtents[1]; + + //get bounding box of first child LLSpatialGroup* group = (LLSpatialGroup*) mOctreeNode->getChild(0)->getListener(0); group->clearState(SKIP_FRUSTUM_CHECK); group->rebound(); + //initialize to first child newMin = group->mExtents[0]; newMax = group->mExtents[1]; - //first, rebound children + //rebound remaining children, expanding bounding box to encompass children for (U32 i = 1; i < mOctreeNode->getChildCount(); i++) { group = (LLSpatialGroup*) mOctreeNode->getChild(i)->getListener(0); @@ -2234,6 +2242,18 @@ void drawBox(const LLVector4a& c, const LLVector4a& r) void drawBoxOutline(const LLVector3& pos, const LLVector3& size) { + + llassert(pos.isFinite()); + llassert(size.isFinite()); + + llassert(!llisnan(pos.mV[0])); + llassert(!llisnan(pos.mV[1])); + llassert(!llisnan(pos.mV[2])); + + llassert(!llisnan(size.mV[0])); + llassert(!llisnan(size.mV[1])); + llassert(!llisnan(size.mV[2])); + LLVector3 v1 = size.scaledVec(LLVector3( 1, 1,1)); LLVector3 v2 = size.scaledVec(LLVector3(-1, 1,1)); LLVector3 v3 = size.scaledVec(LLVector3(-1,-1,1)); @@ -2506,7 +2526,7 @@ void pushBufferVerts(LLVertexBuffer* buffer, U32 mask) } } -void pushBufferVerts(LLSpatialGroup* group, U32 mask) +void pushBufferVerts(LLSpatialGroup* group, U32 mask, bool push_alpha = true) { if (group->mSpatialPartition->mRenderByGroup) { @@ -2515,7 +2535,10 @@ void pushBufferVerts(LLSpatialGroup* group, U32 mask) LLDrawInfo* params = *(group->mDrawMap.begin()->second.begin()); LLRenderPass::applyModelMatrix(*params); - pushBufferVerts(group->mVertexBuffer, mask); + if (push_alpha) + { + pushBufferVerts(group->mVertexBuffer, mask); + } for (LLSpatialGroup::buffer_map_t::iterator i = group->mBufferMap.begin(); i != group->mBufferMap.end(); ++i) { @@ -2529,10 +2552,10 @@ void pushBufferVerts(LLSpatialGroup* group, U32 mask) } } } - else + /*else { - drawBox(group->mBounds[0], group->mBounds[1]); - } + //drawBox(group->mBounds[0], group->mBounds[1]); + }*/ } void pushVertsColorCoded(LLSpatialGroup* group, U32 mask) @@ -2705,18 +2728,54 @@ void renderOctree(LLSpatialGroup* group) // drawBoxOutline(LLVector3(node->getCenter()), LLVector3(node->getSize())); } +std::set<LLSpatialGroup*> visible_selected_groups; + void renderVisibility(LLSpatialGroup* group, LLCamera* camera) { - LLGLEnable blend(GL_BLEND); + /*LLGLEnable blend(GL_BLEND); gGL.setSceneBlendType(LLRender::BT_ALPHA); LLGLEnable cull(GL_CULL_FACE); - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); + glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);*/ - BOOL render_objects = (!LLPipeline::sUseOcclusion || !group->isOcclusionState(LLSpatialGroup::OCCLUDED)) && group->isVisible() && + /*BOOL render_objects = (!LLPipeline::sUseOcclusion || !group->isOcclusionState(LLSpatialGroup::OCCLUDED)) && group->isVisible() && !group->isEmpty(); + if (render_objects) { + LLGLDepthTest depth(GL_TRUE, GL_FALSE); + + LLGLDisable blend(GL_BLEND); + gGL.diffuseColor4f(0.f, 0.75f, 0.f,0.5f); + pushBufferVerts(group, LLVertexBuffer::MAP_VERTEX, false); + + glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); + glLineWidth(4.f); + gGL.diffuseColor4f(0.f, 0.5f, 0.f, 1.f); + pushBufferVerts(group, LLVertexBuffer::MAP_VERTEX, false); + glLineWidth(1.f); + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + + bool selected = false; + + for (LLSpatialGroup::element_iter iter = group->getDataBegin(); iter != group->getDataEnd(); ++iter) + { + LLDrawable* drawable = *iter; + if (drawable->getVObj().notNull() && drawable->getVObj()->isSelected()) + { + selected = true; + break; + } + } + + if (selected) + { //store for rendering occlusion volume as overlay + visible_selected_groups.insert(group); + } + }*/ + + /*if (render_objects) + { LLGLDepthTest depth_under(GL_TRUE, GL_FALSE, GL_GREATER); gGL.diffuseColor4f(0, 0.5f, 0, 0.5f); gGL.diffuseColor4f(0, 0.5f, 0, 0.5f); @@ -2740,6 +2799,59 @@ void renderVisibility(LLSpatialGroup* group, LLCamera* camera) gGL.diffuseColor4f(0.f, 0.75f, 0.f,0.5f); gGL.diffuseColor4f(0.f, 0.75f, 0.f, 0.5f); pushBufferVerts(group, LLVertexBuffer::MAP_VERTEX); + + bool selected = false; + + for (LLSpatialGroup::element_iter iter = group->getDataBegin(); iter != group->getDataEnd(); ++iter) + { + LLDrawable* drawable = *iter; + if (drawable->getVObj().notNull() && drawable->getVObj()->isSelected()) + { + selected = true; + break; + } + } + + if (selected) + { //store for rendering occlusion volume as overlay + visible_selected_groups.insert(group); + } + } + }*/ +} + +void renderXRay(LLSpatialGroup* group, LLCamera* camera) +{ + BOOL render_objects = (!LLPipeline::sUseOcclusion || !group->isOcclusionState(LLSpatialGroup::OCCLUDED)) && group->isVisible() && + !group->isEmpty(); + + if (render_objects) + { + pushBufferVerts(group, LLVertexBuffer::MAP_VERTEX, false); + + bool selected = false; + + for (LLSpatialGroup::element_iter iter = group->getDataBegin(); iter != group->getDataEnd(); ++iter) + { + LLDrawable* drawable = *iter; + if (drawable->getVObj().notNull() && drawable->getVObj()->isSelected()) + { + selected = true; + break; + } + } + + if (selected) + { //store for rendering occlusion volume as overlay + + if (!group->mSpatialPartition->isBridge()) + { + visible_selected_groups.insert(group); + } + else + { + visible_selected_groups.insert(group->mSpatialPartition->asBridge()->getSpatialGroup()); + } } } } @@ -2966,20 +3078,23 @@ void renderBoundingBox(LLDrawable* drawable, BOOL set_color = TRUE) const LLVector4a* ext; LLVector4a pos, size; - //render face bounding boxes - for (S32 i = 0; i < drawable->getNumFaces(); i++) + if (drawable->getVOVolume()) { - LLFace* facep = drawable->getFace(i); - if (facep) + //render face bounding boxes + for (S32 i = 0; i < drawable->getNumFaces(); i++) { - ext = facep->mExtents; + LLFace* facep = drawable->getFace(i); + if (facep) + { + ext = facep->mExtents; - pos.setAdd(ext[0], ext[1]); - pos.mul(0.5f); - size.setSub(ext[1], ext[0]); - size.mul(0.5f); + pos.setAdd(ext[0], ext[1]); + pos.mul(0.5f); + size.setSub(ext[1], ext[0]); + size.mul(0.5f); - drawBoxOutline(pos,size); + drawBoxOutline(pos,size); + } } } @@ -3359,7 +3474,7 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume) } else if (type == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::SPHERE) { - /*LLVolumeParams volume_params; + LLVolumeParams volume_params; volume_params.setType( LL_PCODE_PROFILE_CIRCLE_HALF, LL_PCODE_PATH_CIRCLE ); volume_params.setBeginAndEndS( 0.f, 1.f ); volume_params.setBeginAndEndT( 0.f, 1.f ); @@ -3369,7 +3484,7 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume) gGL.diffuseColor4fv(color.mV); pushVerts(sphere); - LLPrimitive::sVolumeManager->unrefVolume(sphere);*/ + LLPrimitive::sVolumeManager->unrefVolume(sphere); } else if (type == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::CYLINDER) { @@ -3447,51 +3562,67 @@ void renderPhysicsShapes(LLSpatialGroup* group) for (LLSpatialGroup::OctreeNode::const_element_iter i = group->getDataBegin(); i != group->getDataEnd(); ++i) { LLDrawable* drawable = *i; - LLVOVolume* volume = drawable->getVOVolume(); - if (volume && !volume->isAttachment() && volume->getPhysicsShapeType() != LLViewerObject::PHYSICS_SHAPE_NONE ) + + if (drawable->isSpatialBridge()) { - if (!group->mSpatialPartition->isBridge()) + LLSpatialBridge* bridge = drawable->asPartition()->asBridge(); + + if (bridge) { gGL.pushMatrix(); - LLVector3 trans = drawable->getRegion()->getOriginAgent(); - gGL.translatef(trans.mV[0], trans.mV[1], trans.mV[2]); - renderPhysicsShape(drawable, volume); + gGL.multMatrix((F32*)bridge->mDrawable->getRenderMatrix().mMatrix); + bridge->renderPhysicsShapes(); gGL.popMatrix(); } - else - { - renderPhysicsShape(drawable, volume); - } } else { - LLViewerObject* object = drawable->getVObj(); - if (object && object->getPCode() == LLViewerObject::LL_VO_SURFACE_PATCH) + LLVOVolume* volume = drawable->getVOVolume(); + if (volume && !volume->isAttachment() && volume->getPhysicsShapeType() != LLViewerObject::PHYSICS_SHAPE_NONE ) { - gGL.pushMatrix(); - gGL.multMatrix((F32*) object->getRegion()->mRenderMatrix.mMatrix); - //push face vertices for terrain - for (S32 i = 0; i < drawable->getNumFaces(); ++i) + if (!group->mSpatialPartition->isBridge()) + { + gGL.pushMatrix(); + LLVector3 trans = drawable->getRegion()->getOriginAgent(); + gGL.translatef(trans.mV[0], trans.mV[1], trans.mV[2]); + renderPhysicsShape(drawable, volume); + gGL.popMatrix(); + } + else + { + renderPhysicsShape(drawable, volume); + } + } + else + { + LLViewerObject* object = drawable->getVObj(); + if (object && object->getPCode() == LLViewerObject::LL_VO_SURFACE_PATCH) { - LLFace* face = drawable->getFace(i); - if (face) + gGL.pushMatrix(); + gGL.multMatrix((F32*) object->getRegion()->mRenderMatrix.mMatrix); + //push face vertices for terrain + for (S32 i = 0; i < drawable->getNumFaces(); ++i) { - LLVertexBuffer* buff = face->getVertexBuffer(); - if (buff) + LLFace* face = drawable->getFace(i); + if (face) { - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); + LLVertexBuffer* buff = face->getVertexBuffer(); + if (buff) + { + glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - buff->setBuffer(LLVertexBuffer::MAP_VERTEX); - gGL.diffuseColor3f(0.2f, 0.5f, 0.3f); - buff->draw(LLRender::TRIANGLES, buff->getNumIndices(), 0); + buff->setBuffer(LLVertexBuffer::MAP_VERTEX); + gGL.diffuseColor3f(0.2f, 0.5f, 0.3f); + buff->draw(LLRender::TRIANGLES, buff->getNumIndices(), 0); - gGL.diffuseColor3f(0.2f, 1.f, 0.3f); - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - buff->draw(LLRender::TRIANGLES, buff->getNumIndices(), 0); + gGL.diffuseColor3f(0.2f, 1.f, 0.3f); + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + buff->draw(LLRender::TRIANGLES, buff->getNumIndices(), 0); + } } } + gGL.popMatrix(); } - gGL.popMatrix(); } } } @@ -4081,6 +4212,10 @@ public: if (!group->isEmpty()) { gGL.diffuseColor3f(0,0,1); + + llassert(group->mObjectBounds[0].isFinite3()); + llassert(group->mObjectBounds[1].isFinite3()); + drawBoxOutline(group->mObjectBounds[0], group->mObjectBounds[1]); } @@ -4210,6 +4345,48 @@ public: } }; +class LLOctreeRenderXRay : public LLOctreeTraveler<LLDrawable> +{ +public: + LLCamera* mCamera; + LLOctreeRenderXRay(LLCamera* camera): mCamera(camera) {} + + virtual void traverse(const LLSpatialGroup::OctreeNode* node) + { + LLSpatialGroup* group = (LLSpatialGroup*) node->getListener(0); + + if (!mCamera || mCamera->AABBInFrustumNoFarClip(group->mBounds[0], group->mBounds[1])) + { + node->accept(this); + stop_glerror(); + + for (U32 i = 0; i < node->getChildCount(); i++) + { + traverse(node->getChild(i)); + stop_glerror(); + } + + //render visibility wireframe + if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_OCCLUSION)) + { + group->rebuildGeom(); + group->rebuildMesh(); + + gGL.flush(); + gGL.pushMatrix(); + gGLLastMatrix = NULL; + gGL.loadMatrix(gGLModelView); + renderXRay(group, mCamera); + stop_glerror(); + gGLLastMatrix = NULL; + gGL.popMatrix(); + } + } + } + + virtual void visit(const LLSpatialGroup::OctreeNode* node) {} + +}; class LLOctreeRenderPhysicsShapes : public LLOctreeTraveler<LLDrawable> { @@ -4437,6 +4614,26 @@ void LLSpatialPartition::renderDebug() LLOctreeRenderNonOccluded render_debug(camera); render_debug.traverse(mOctree); + + if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_OCCLUSION)) + { + { + LLGLEnable cull(GL_CULL_FACE); + + LLGLEnable blend(GL_BLEND); + LLGLDepthTest depth_under(GL_TRUE, GL_FALSE, GL_GREATER); + glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); + gGL.diffuseColor4f(0.5f, 0.0f, 0, 0.25f); + + LLGLEnable offset(GL_POLYGON_OFFSET_LINE); + glPolygonOffset(-1.f, -1.f); + + LLOctreeRenderXRay xray(camera); + xray.traverse(mOctree); + + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + } + } if (LLGLSLShader::sNoFixedFunction) { gDebugProgram.unbind(); @@ -4648,6 +4845,9 @@ LLDrawInfo::LLDrawInfo(U16 start, U16 end, U32 count, U32 offset, mMaterial(NULL), mShaderMask(0), mSpecColor(1.0f, 1.0f, 1.0f, 0.5f), + mBlendFuncSrc(LLRender::BF_SOURCE_ALPHA), + mBlendFuncDst(LLRender::BF_ONE_MINUS_SOURCE_ALPHA), + mHasGlow(FALSE), mEnvIntensity(0.0f), mAlphaMaskCutoff(0.5f), mDiffuseAlphaMode(0) diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h index 9732be90af..f26defd5e1 100755 --- a/indra/newview/llspatialpartition.h +++ b/indra/newview/llspatialpartition.h @@ -70,12 +70,12 @@ protected: public: void* operator new(size_t size) { - return ll_aligned_malloc_16(size); + return ll_aligned_malloc(size,64); } void operator delete(void* ptr) { - ll_aligned_free_16(ptr); + ll_aligned_free(ptr); } @@ -123,6 +123,9 @@ public: LLMaterialPtr mMaterial; // If this is null, the following parameters are unused. LLMaterialID mMaterialID; U32 mShaderMask; + U32 mBlendFuncSrc; + U32 mBlendFuncDst; + BOOL mHasGlow; LLPointer<LLViewerTexture> mSpecularMap; const LLMatrix4* mSpecularMapMatrix; LLPointer<LLViewerTexture> mNormalMap; @@ -752,7 +755,7 @@ class LLVolumeGeometryManager: public LLGeometryManager virtual void rebuildGeom(LLSpatialGroup* group); virtual void rebuildMesh(LLSpatialGroup* group); virtual void getGeometry(LLSpatialGroup* group); - void genDrawInfo(LLSpatialGroup* group, U32 mask, std::vector<LLFace*>& faces, BOOL distance_sort = FALSE, BOOL batch_textures = FALSE, BOOL no_materials = FALSE); + void genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace** faces, U32 face_count, BOOL distance_sort = FALSE, BOOL batch_textures = FALSE, BOOL no_materials = FALSE); void registerFace(LLSpatialGroup* group, LLFace* facep, U32 type); }; diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index cff3a7e02a..67a76460a7 100755 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -51,6 +51,7 @@ #include "lllandmark.h" #include "llcachename.h" #include "lldir.h" +#include "lldonotdisturbnotificationstorage.h" #include "llerrorcontrol.h" #include "llfloaterreg.h" #include "llfocusmgr.h" @@ -68,6 +69,7 @@ #include "llfloaterimnearbychat.h" #include "llnotifications.h" #include "llnotificationsutil.h" +#include "llpersistentnotificationstorage.h" #include "llteleporthistory.h" #include "llregionhandle.h" #include "llsd.h" @@ -900,6 +902,10 @@ bool idle_startup() gDirUtilp->setLindenUserDir(userid); LLFile::mkdir(gDirUtilp->getLindenUserDir()); + // As soon as directories are ready initialize notification storages + LLPersistentNotificationStorage::getInstance()->initialize(); + LLDoNotDisturbNotificationStorage::getInstance()->initialize(); + // Set PerAccountSettingsFile to the default value. gSavedSettings.setString("PerAccountSettingsFile", gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp index e92bd766ca..1a3add2bfb 100755 --- a/indra/newview/llsyswellwindow.cpp +++ b/indra/newview/llsyswellwindow.cpp @@ -423,9 +423,18 @@ void LLNotificationWellWindow::onItemClick(LLSysWellItem* item) void LLNotificationWellWindow::onItemClose(LLSysWellItem* item) { LLUUID id = item->getID(); - removeItemByID(id); + if(mChannel) + { + // removeItemByID() is invoked from killToastByNotificationID() and item will removed; mChannel->killToastByNotificationID(id); + } + else + { + // removeItemByID() should be called one time for each item to remove it from notification well + removeItemByID(id); + } + } void LLNotificationWellWindow::onAdd( LLNotificationPtr notify ) diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index 36a7aeb590..5bc2e971eb 100755 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -1922,10 +1922,10 @@ bool LLTextureCache::writeToFastCache(S32 id, LLPointer<LLImageRaw> raw, S32 dis h >>= i; if(w * h *c > 0) //valid { - LLPointer<LLImageRaw> newraw = new LLImageRaw(raw->getData(), raw->getWidth(), raw->getHeight(), raw->getComponents()); - newraw->scale(w, h) ; - raw = newraw; - + //make a duplicate to keep the original raw image untouched. + raw = raw->duplicate(); + raw->scale(w, h) ; + discardlevel += i ; } } @@ -1935,9 +1935,12 @@ bool LLTextureCache::writeToFastCache(S32 id, LLPointer<LLImageRaw> raw, S32 dis memcpy(mFastCachePadBuffer + sizeof(S32), &h, sizeof(S32)); memcpy(mFastCachePadBuffer + sizeof(S32) * 2, &c, sizeof(S32)); memcpy(mFastCachePadBuffer + sizeof(S32) * 3, &discardlevel, sizeof(S32)); - if(w * h * c > 0) //valid + + S32 copy_size = w * h * c; + if(copy_size > 0) //valid { - memcpy(mFastCachePadBuffer + TEXTURE_FAST_CACHE_ENTRY_OVERHEAD, raw->getData(), w * h * c); + copy_size = llmin(copy_size, TEXTURE_FAST_CACHE_ENTRY_SIZE - TEXTURE_FAST_CACHE_ENTRY_OVERHEAD); + memcpy(mFastCachePadBuffer + TEXTURE_FAST_CACHE_ENTRY_OVERHEAD, raw->getData(), copy_size); } S32 offset = id * TEXTURE_FAST_CACHE_ENTRY_SIZE; diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 4676f7b251..4300cafb6b 100755 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -133,6 +133,7 @@ public: PermissionMask getFilterPermMask(); void updateFilterPermMask(); void commitIfImmediateSet(); + void commitCancel(); void onFilterEdit(const std::string& search_string ); @@ -706,6 +707,14 @@ void LLFloaterTexturePicker::commitIfImmediateSet() } } +void LLFloaterTexturePicker::commitCancel() +{ + if (!mNoCopyTextureSelected && mOwner && mCanApply) + { + mOwner->onFloaterCommit(LLTextureCtrl::TEXTURE_CANCEL); + } +} + // static void LLFloaterTexturePicker::onBtnSetToDefault(void* userdata) { @@ -733,7 +742,7 @@ void LLFloaterTexturePicker::onBtnNone(void* userdata) { LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata; self->setImageID( LLUUID::null ); - self->commitIfImmediateSet(); + self->commitCancel(); } /* diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 6173e76a35..6173e76a35 100755..100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp index 9dfb29b905..d876c9a3f4 100755 --- a/indra/newview/lltoast.cpp +++ b/indra/newview/lltoast.cpp @@ -173,8 +173,20 @@ void LLToast::setHideButtonEnabled(bool enabled) //-------------------------------------------------------------------------- LLToast::~LLToast() -{ - mOnToastDestroyedSignal(this); +{ + if(LLApp::isQuitting()) + { + mOnFadeSignal.disconnect_all_slots(); + mOnDeleteToastSignal.disconnect_all_slots(); + mOnToastDestroyedSignal.disconnect_all_slots(); + mOnToastHoverSignal.disconnect_all_slots(); + mToastMouseEnterSignal.disconnect_all_slots(); + mToastMouseLeaveSignal.disconnect_all_slots(); + } + else + { + mOnToastDestroyedSignal(this); + } } //-------------------------------------------------------------------------- @@ -572,10 +584,34 @@ S32 LLToast::notifyParent(const LLSD& info) //static void LLToast::updateClass() { - for (LLInstanceTracker<LLToast>::instance_iter iter = LLInstanceTracker<LLToast>::beginInstances(); iter != LLInstanceTracker<LLToast>::endInstances(); ) + for (LLInstanceTracker<LLToast>::instance_iter iter = LLInstanceTracker<LLToast>::beginInstances(); + iter != LLInstanceTracker<LLToast>::endInstances(); ) { LLToast& toast = *iter++; toast.updateHoveredState(); } } + +// static +void LLToast::cleanupToasts() +{ + LLToast * toastp = NULL; + + while (LLInstanceTracker<LLToast>::instanceCount() > 0) + { + { // Need to scope iter to allow deletion + LLInstanceTracker<LLToast>::instance_iter iter = LLInstanceTracker<LLToast>::beginInstances(); + toastp = &(*iter); + } + + //llinfos << "Cleaning up toast id " << toastp->getNotificationID() << llendl; + + // LLToast destructor will remove it from the LLInstanceTracker. + if (!toastp) + break; // Don't get stuck in the loop if a null pointer somehow got on the list + + delete toastp; + } +} + diff --git a/indra/newview/lltoast.h b/indra/newview/lltoast.h index ea62f758f8..f02d7c2a1a 100755 --- a/indra/newview/lltoast.h +++ b/indra/newview/lltoast.h @@ -73,6 +73,7 @@ class LLToast : public LLModalDialog, public LLInstanceTracker<LLToast> { friend class LLToastLifeTimer; public: + typedef boost::function<void (LLToast* toast)> toast_callback_t; typedef boost::signals2::signal<void (LLToast* toast)> toast_signal_t; typedef boost::signals2::signal<void (LLToast* toast, bool mouse_enter)> toast_hover_check_signal_t; @@ -105,6 +106,7 @@ public: }; static void updateClass(); + static void cleanupToasts(); LLToast(const LLToast::Params& p); virtual ~LLToast(); diff --git a/indra/newview/lltoastimpanel.cpp b/indra/newview/lltoastimpanel.cpp index 75e6e3d13a..09ab31df36 100755 --- a/indra/newview/lltoastimpanel.cpp +++ b/indra/newview/lltoastimpanel.cpp @@ -28,6 +28,7 @@ #include "lltoastimpanel.h" #include "llagent.h" +#include "llavatarnamecache.h" #include "llfloaterreg.h" #include "llgroupactions.h" #include "llgroupiconctrl.h" @@ -61,6 +62,15 @@ LLToastIMPanel::LLToastIMPanel(LLToastIMPanel::Params &p) : LLToastPanel(p.notif style_params.font.name(font_name); style_params.font.size(font_size); + LLIMModel::LLIMSession* im_session = LLIMModel::getInstance()->findIMSession(p.session_id); + mIsGroupMsg = (im_session && im_session->mSessionType == LLIMModel::LLIMSession::GROUP_SESSION); + if(mIsGroupMsg) + { + mAvatarName->setValue(im_session->mName); + LLAvatarName avatar_name; + LLAvatarNameCache::get(p.avatar_id, &avatar_name); + p.message = "[From " + avatar_name.getDisplayName() + "]\n" + p.message; + } //Handle IRC styled /me messages. std::string prefix = p.message.substr(0, 4); @@ -81,12 +91,17 @@ LLToastIMPanel::LLToastIMPanel(LLToastIMPanel::Params &p) : LLToastPanel(p.notif mMessage->setText(p.message, style_params); } - mAvatarName->setValue(p.from); + if(!mIsGroupMsg) + { + mAvatarName->setValue(p.from); + } mTime->setValue(p.time); mSessionID = p.session_id; mAvatarID = p.avatar_id; mNotification = p.notification; + + initIcon(); S32 maxLinesCount; @@ -147,7 +162,14 @@ void LLToastIMPanel::spawnNameToolTip() LLToolTip::Params params; params.background_visible(false); - params.click_callback(boost::bind(&LLFloaterReg::showInstance, "inspect_avatar", LLSD().with("avatar_id", mAvatarID), FALSE)); + if(!mIsGroupMsg) + { + params.click_callback(boost::bind(&LLFloaterReg::showInstance, "inspect_avatar", LLSD().with("avatar_id", mAvatarID), FALSE)); + } + else + { + params.click_callback(boost::bind(&LLFloaterReg::showInstance, "inspect_group", LLSD().with("group_id", mSessionID), FALSE)); + } params.delay_time(0.0f); // spawn instantly on hover params.image(LLUI::getUIImage("Info_Small")); params.message(""); diff --git a/indra/newview/lltoastimpanel.h b/indra/newview/lltoastimpanel.h index 3eb11fb3bc..767617dabc 100755 --- a/indra/newview/lltoastimpanel.h +++ b/indra/newview/lltoastimpanel.h @@ -73,6 +73,8 @@ private: LLTextBox* mAvatarName; LLTextBox* mTime; LLTextBox* mMessage; + + bool mIsGroupMsg; }; #endif // LLTOASTIMPANEL_H_ diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp index 8bfde2bcf1..94d07b37ef 100755 --- a/indra/newview/lltoastnotifypanel.cpp +++ b/indra/newview/lltoastnotifypanel.cpp @@ -60,7 +60,7 @@ LLToastNotifyPanel::LLToastNotifyPanel(const LLNotificationPtr& notification, co LLInstanceTracker<LLToastNotifyPanel, LLUUID>(notification->getID()) { init(rect, show_images); - } +} void LLToastNotifyPanel::addDefaultButton() { LLSD form_element; diff --git a/indra/newview/lltoolbarview.cpp b/indra/newview/lltoolbarview.cpp index b2318f9158..78a555d67d 100755 --- a/indra/newview/lltoolbarview.cpp +++ b/indra/newview/lltoolbarview.cpp @@ -51,8 +51,6 @@ LLToolBarView* gToolBarView = NULL; static LLDefaultChildRegistry::Register<LLToolBarView> r("toolbar_view"); -void handleLoginToolbarSetup(); - bool isToolDragged() { return (LLToolDragAndDrop::getInstance()->getSource() == LLToolDragAndDrop::SOURCE_VIEWER); @@ -111,8 +109,6 @@ BOOL LLToolBarView::postBuild() mToolbars[i]->setButtonAddCallback(boost::bind(LLToolBarView::onToolBarButtonAdded,_1)); mToolbars[i]->setButtonRemoveCallback(boost::bind(LLToolBarView::onToolBarButtonRemoved,_1)); } - - LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&handleLoginToolbarSetup)); return TRUE; } @@ -180,13 +176,13 @@ S32 LLToolBarView::stopCommandInProgress(const LLCommandId& commandId) return command_location; } -S32 LLToolBarView::flashCommand(const LLCommandId& commandId, bool flash) +S32 LLToolBarView::flashCommand(const LLCommandId& commandId, bool flash, bool force_flashing/* = false */) { S32 command_location = hasCommand(commandId); if (command_location != TOOLBAR_NONE) { - mToolbars[command_location]->flashCommand(commandId, flash); + mToolbars[command_location]->flashCommand(commandId, flash, force_flashing); } return command_location; @@ -696,18 +692,3 @@ bool LLToolBarView::isModified() const } -// -// HACK to bring up destinations guide at startup -// - -void handleLoginToolbarSetup() -{ - // Open the destinations guide by default on first login, per Rhett - if (gSavedPerAccountSettings.getBOOL("DisplayDestinationsOnInitialRun") || gAgent.isFirstLogin()) - { - LLFloaterReg::showInstance("destinations"); - - gSavedPerAccountSettings.setBOOL("DisplayDestinationsOnInitialRun", FALSE); - } -} - diff --git a/indra/newview/lltoolbarview.h b/indra/newview/lltoolbarview.h index 7125dd9990..dcc3862074 100755 --- a/indra/newview/lltoolbarview.h +++ b/indra/newview/lltoolbarview.h @@ -90,7 +90,7 @@ public: S32 removeCommand(const LLCommandId& commandId, int& rank); // Sets the rank the removed command was at, RANK_NONE if not found S32 enableCommand(const LLCommandId& commandId, bool enabled); S32 stopCommandInProgress(const LLCommandId& commandId); - S32 flashCommand(const LLCommandId& commandId, bool flash); + S32 flashCommand(const LLCommandId& commandId, bool flash, bool force_flashing = false); // Loads the toolbars from the existing user or default settings bool loadToolbars(bool force_default = false); // return false if load fails diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index e085834326..ef7d0cd81b 100755 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -58,6 +58,7 @@ #include "llviewerwindow.h" #include "llvoavatarself.h" #include "llworld.h" +#include "llpanelface.h" // syntactic sugar #define callMemberFunction(object,ptrToMember) ((object).*(ptrToMember)) @@ -1163,7 +1164,51 @@ void LLToolDragAndDrop::dropTextureOneFace(LLViewerObject* hit_obj, // update viewer side image in anticipation of update from simulator LLViewerTexture* image = LLViewerTextureManager::getFetchedTexture(asset_id); LLViewerStats::getInstance()->incStat(LLViewerStats::ST_EDIT_TEXTURE_COUNT ); - hit_obj->setTEImage(hit_face, image); + + LLTextureEntry* tep = hit_obj ? (hit_obj->getTE(hit_face)) : NULL; + + LLPanelFace* panel_face = gFloaterTools->getPanelFace(); + + if (gFloaterTools->getVisible() && panel_face) + { + switch (LLSelectMgr::getInstance()->getTextureChannel()) + { + + case 0: + default: + { + hit_obj->setTEImage(hit_face, image); + } + break; + + case 1: + { + LLMaterialPtr old_mat = tep->getMaterialParams(); + LLMaterialPtr new_mat = panel_face->createDefaultMaterial(old_mat); + new_mat->setNormalID(asset_id); + tep->setMaterialParams(new_mat); + hit_obj->setTENormalMap(hit_face, asset_id); + LLMaterialMgr::getInstance()->put(hit_obj->getID(), hit_face, *new_mat); + } + break; + + case 2: + { + LLMaterialPtr old_mat = tep->getMaterialParams(); + LLMaterialPtr new_mat = panel_face->createDefaultMaterial(old_mat); + new_mat->setSpecularID(asset_id); + tep->setMaterialParams(new_mat); + hit_obj->setTESpecularMap(hit_face, asset_id); + LLMaterialMgr::getInstance()->put(hit_obj->getID(), hit_face, *new_mat); + } + break; + } + } + else + { + hit_obj->setTEImage(hit_face, image); + } + dialog_refresh_all(); // send the update to the simulator diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index fc9a316759..1c362c18e0 100755 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -121,7 +121,7 @@ BOOL LLToolPie::handleMouseDown(S32 x, S32 y, MASK mask) BOOL LLToolPie::handleRightMouseDown(S32 x, S32 y, MASK mask) { // don't pick transparent so users can't "pay" transparent objects - mPick = gViewerWindow->pickImmediate(x, y, FALSE); + mPick = gViewerWindow->pickImmediate(x, y, FALSE, TRUE); mPick.mKeyMask = mask; // claim not handled so UI focus stays same @@ -1687,6 +1687,13 @@ BOOL LLToolPie::handleRightClickPick() showVisualContextMenuEffect(); } } + else if (mPick.mParticleOwnerID.notNull()) + { + if (gMenuMuteParticle && mPick.mParticleOwnerID != gAgent.getID()) + { + gMenuMuteParticle->show(x,y); + } + } LLTool::handleRightMouseDown(x, y, mask); // We handled the event. diff --git a/indra/newview/lltoolselect.h b/indra/newview/lltoolselect.h index baa27f6071..74dababe8c 100755 --- a/indra/newview/lltoolselect.h +++ b/indra/newview/lltoolselect.h @@ -34,7 +34,7 @@ class LLObjectSelection; -class LLToolSelect : public LLTool, public LLSingleton<LLToolSelect> +class LLToolSelect : public LLTool { public: LLToolSelect( LLToolComposite* composite ); diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index afbb59e723..744ec4de2b 100755 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -83,7 +83,9 @@ BOOL gHackGodmode = FALSE; #endif - +// Should you contemplate changing the name "Global", please first grep for +// that string literal. There are at least a couple other places in the C++ +// code that assume the LLControlGroup named "Global" is gSavedSettings. LLControlGroup gSavedSettings("Global"); // saved at end of session LLControlGroup gSavedPerAccountSettings("PerAccount"); // saved at end of session LLControlGroup gCrashSettings("CrashSettings"); // saved at end of session diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index b07fe39e37..bbebeea3e0 100755 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -673,6 +673,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) static LLCullResult result; LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_WORLD; + LLPipeline::sUnderWaterRender = LLViewerCamera::getInstance()->cameraUnderWater() ? TRUE : FALSE; gPipeline.updateCull(*LLViewerCamera::getInstance(), result, water_clip); stop_glerror(); @@ -879,7 +880,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) //} LLPipeline::sUnderWaterRender = LLViewerCamera::getInstance()->cameraUnderWater() ? TRUE : FALSE; - + LLGLState::checkStates(); LLGLState::checkClientArrays(); @@ -889,7 +890,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) { gGL.setColorMask(true, true); - if (LLPipeline::sRenderDeferred && !LLPipeline::sUnderWaterRender) + if (LLPipeline::sRenderDeferred) { gPipeline.mDeferredScreen.bindTarget(); glClearColor(1,0,1,1); @@ -938,7 +939,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) gGL.setColorMask(true, false); - if (LLPipeline::sRenderDeferred && !LLPipeline::sUnderWaterRender) + if (LLPipeline::sRenderDeferred) { gPipeline.renderGeomDeferred(*LLViewerCamera::getInstance()); } @@ -975,7 +976,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) if (to_texture) { - if (LLPipeline::sRenderDeferred && !LLPipeline::sUnderWaterRender) + if (LLPipeline::sRenderDeferred) { gPipeline.mDeferredScreen.flush(); if(LLRenderTarget::sUseFBO) @@ -1001,7 +1002,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) } } - if (LLPipeline::sRenderDeferred && !LLPipeline::sUnderWaterRender) + if (LLPipeline::sRenderDeferred) { gPipeline.renderDeferredLighting(); } @@ -1622,3 +1623,4 @@ void display_cleanup() { gDisconnectedImagep = NULL; } + diff --git a/indra/newview/llviewerfoldertype.cpp b/indra/newview/llviewerfoldertype.cpp index a179b61cff..a179b61cff 100755..100644 --- a/indra/newview/llviewerfoldertype.cpp +++ b/indra/newview/llviewerfoldertype.cpp diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp index 4ecdc31e21..2fbb3bf868 100755 --- a/indra/newview/llviewerkeyboard.cpp +++ b/indra/newview/llviewerkeyboard.cpp @@ -534,6 +534,11 @@ void stop_moving( EKeystate s ) void start_chat( EKeystate s ) { + if (LLAppViewer::instance()->quitRequested()) + { + return; // can't talk, gotta go, kthxbye! + } + // start chat LLFloaterIMNearbyChat::startChat(NULL); } @@ -676,6 +681,7 @@ BOOL LLViewerKeyboard::handleKey(KEY translated_key, MASK translated_mask, BOOL if(mKeysSkippedByUI.find(translated_key) != mKeysSkippedByUI.end()) { mKeyHandledByUI[translated_key] = FALSE; + LL_INFOS("Keyboard Handling") << "Key wasn't handled by UI!" << LL_ENDL; } else { diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 5e2f05f468..9468a2d542 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -169,6 +169,7 @@ LLContextMenu *gMenuObject = NULL; LLContextMenu *gMenuAttachmentSelf = NULL; LLContextMenu *gMenuAttachmentOther = NULL; LLContextMenu *gMenuLand = NULL; +LLContextMenu *gMenuMuteParticle = NULL; const std::string SAVE_INTO_TASK_INVENTORY("Save Object Back to Object Contents"); @@ -425,6 +426,9 @@ void init_menus() gMenuLand = LLUICtrlFactory::createFromFile<LLContextMenu>( "menu_land.xml", gMenuHolder, registry); + gMenuMuteParticle = LLUICtrlFactory::createFromFile<LLContextMenu>( + "menu_mute_particle.xml", gMenuHolder, registry); + /// /// set up the colors /// @@ -1069,8 +1073,6 @@ class LLAdvancedCheckInfoDisplay : public view_listener_t U32 info_display = info_display_from_string( userdata.asString() ); bool new_value = false; - LL_INFOS("ViewerMenu") << "check " << userdata.asString() << LL_ENDL; - if ( info_display != 0 ) { new_value = LLPipeline::toggleRenderDebugControl( (void*)info_display ); @@ -2450,6 +2452,9 @@ void cleanup_menus() delete gMenuLand; gMenuLand = NULL; + delete gMenuMuteParticle; + gMenuMuteParticle = NULL; + delete gMenuBarView; gMenuBarView = NULL; @@ -2803,6 +2808,13 @@ bool enable_object_edit() return enable; } +bool enable_mute_particle() +{ + const LLPickInfo& pick = LLToolPie::getInstance()->getPick(); + + return pick.mParticleOwnerID != LLUUID::null && pick.mParticleOwnerID != gAgent.getID(); +} + // mutually exclusive - show either edit option or build in menu bool enable_object_build() { @@ -2916,6 +2928,67 @@ bool enable_object_unmute() } } + +// 0 = normal, 1 = always, 2 = never +class LLAvatarCheckImpostorMode : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); + if (!object) return false; + + LLVOAvatar* avatar = find_avatar_from_object(object); + if (!avatar) return false; + + U32 mode = userdata.asInteger(); + switch (mode) + { + case 0: + return (avatar->getVisualMuteSettings() == LLVOAvatar::VISUAL_MUTE_NOT_SET); + case 1: + return (avatar->getVisualMuteSettings() == LLVOAvatar::ALWAYS_VISUAL_MUTE); + case 2: + return (avatar->getVisualMuteSettings() == LLVOAvatar::NEVER_VISUAL_MUTE); + default: + return false; + } + } // handleEvent() +}; + +// 0 = normal, 1 = always, 2 = never +class LLAvatarSetImpostorMode : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); + if (!object) return false; + + LLVOAvatar* avatar = find_avatar_from_object(object); + if (!avatar) return false; + + U32 mode = userdata.asInteger(); + switch (mode) + { + case 0: + avatar->setVisualMuteSettings(LLVOAvatar::VISUAL_MUTE_NOT_SET); + break; + case 1: + avatar->setVisualMuteSettings(LLVOAvatar::ALWAYS_VISUAL_MUTE); + break; + case 2: + avatar->setVisualMuteSettings(LLVOAvatar::NEVER_VISUAL_MUTE); + break; + default: + return false; + } + + avatar->forceUpdateVisualMuteSettings(); + LLVOAvatar::cullAvatarsByPixelArea(); + return true; + } // handleEvent() +}; + + class LLObjectMute : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -6220,6 +6293,33 @@ class LLLandEdit : public view_listener_t } }; +class LLMuteParticle : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLUUID id = LLToolPie::getInstance()->getPick().mParticleOwnerID; + + if (id.notNull()) + { + std::string name; + gCacheName->getFullName(id, name); + + LLMute mute(id, name, LLMute::AGENT); + if (LLMuteList::getInstance()->isMuted(mute.mID)) + { + LLMuteList::getInstance()->remove(mute); + } + else + { + LLMuteList::getInstance()->add(mute); + LLPanelBlockedList::showPanelAndSelect(mute.mID); + } + } + + return true; + } +}; + class LLWorldEnableBuyLand : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -8640,6 +8740,8 @@ void initialize_menus() view_listener_t::addMenu( new LLCheckPanelPeopleTab(), "SideTray.CheckPanelPeopleTab"); // Avatar pie menu + view_listener_t::addMenu(new LLAvatarCheckImpostorMode(), "Avatar.CheckImpostorMode"); + view_listener_t::addMenu(new LLAvatarSetImpostorMode(), "Avatar.SetImpostorMode"); view_listener_t::addMenu(new LLObjectMute(), "Avatar.Mute"); view_listener_t::addMenu(new LLAvatarAddFriend(), "Avatar.AddFriend"); view_listener_t::addMenu(new LLAvatarAddContact(), "Avatar.AddContact"); @@ -8713,6 +8815,9 @@ void initialize_menus() view_listener_t::addMenu(new LLLandBuyPass(), "Land.BuyPass"); view_listener_t::addMenu(new LLLandEdit(), "Land.Edit"); + // Particle muting + view_listener_t::addMenu(new LLMuteParticle(), "Particle.Mute"); + view_listener_t::addMenu(new LLLandEnableBuyPass(), "Land.EnableBuyPass"); commit.add("Land.Buy", boost::bind(&handle_buy_land)); @@ -8735,6 +8840,7 @@ void initialize_menus() enable.add("EnablePayObject", boost::bind(&enable_pay_object)); enable.add("EnablePayAvatar", boost::bind(&enable_pay_avatar)); enable.add("EnableEdit", boost::bind(&enable_object_edit)); + enable.add("EnableMuteParticle", boost::bind(&enable_mute_particle)); enable.add("VisibleBuild", boost::bind(&enable_object_build)); commit.add("Pathfinding.Linksets.Select", boost::bind(&LLFloaterPathfindingLinksets::openLinksetsWithSelectedObjects)); enable.add("EnableSelectInPathfindingLinksets", boost::bind(&enable_object_select_in_pathfinding_linksets)); diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h index 143420e227..7f09fc2d8f 100755 --- a/indra/newview/llviewermenu.h +++ b/indra/newview/llviewermenu.h @@ -177,6 +177,7 @@ extern LLContextMenu *gMenuObject; extern LLContextMenu *gMenuAttachmentSelf; extern LLContextMenu *gMenuAttachmentOther; extern LLContextMenu *gMenuLand; +extern LLContextMenu *gMenuMuteParticle; // Needed to build menus when attachment site list available extern LLMenuGL* gAttachSubMenu; diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index ace16396db..c38af1f990 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -259,11 +259,15 @@ bool friendship_offer_callback(const LLSD& notification, const LLSD& response) break; } - LLNotificationFormPtr modified_form(new LLNotificationForm(*notification_ptr->getForm())); - modified_form->setElementEnabled("Accept", false); - modified_form->setElementEnabled("Decline", false); - notification_ptr->updateForm(modified_form); - notification_ptr->repost(); + // TODO: this set of calls has undesirable behavior under Windows OS (CHUI-985): + // here appears three additional toasts instead one modified + // need investigation and fix + + // LLNotificationFormPtr modified_form(new LLNotificationForm(*notification_ptr->getForm())); + // modified_form->setElementEnabled("Accept", false); + // modified_form->setElementEnabled("Decline", false); + // notification_ptr->updateForm(modified_form); + // notification_ptr->repost(); } return false; @@ -2357,7 +2361,9 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) BOOL is_owned_by_me = FALSE; BOOL is_friend = (LLAvatarTracker::instance().getBuddyInfo(from_id) == NULL) ? false : true; BOOL accept_im_from_only_friend = gSavedSettings.getBOOL("VoiceCallsFriendsOnly"); - + BOOL is_linden = chat.mSourceType != CHAT_SOURCE_OBJECT && + LLMuteList::getInstance()->isLinden(name); + chat.mMuted = is_muted; chat.mFromID = from_id; chat.mFromName = name; @@ -2457,7 +2463,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) LL_INFOS("Messaging") << "process_improved_im: session_id( " << session_id << " ), from_id( " << from_id << " )" << LL_ENDL; bool mute_im = is_muted; - if(accept_im_from_only_friend&&!is_friend) + if(accept_im_from_only_friend && !is_friend && !is_linden) { if (!gIMMgr->isNonFriendSessionNotified(session_id)) { @@ -2649,7 +2655,8 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) { send_do_not_disturb_message(msg, from_id); } - else + + if (!is_muted) { LL_INFOS("Messaging") << "Received IM_GROUP_INVITATION message." << LL_ENDL; // Read the binary bucket for more information. @@ -3673,6 +3680,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) LLSD msg_notify = LLSD(LLSD::emptyMap()); msg_notify["session_id"] = LLUUID(); msg_notify["from_id"] = chat.mFromID; + msg_notify["source_type"] = chat.mSourceType; on_new_message(msg_notify); } } @@ -4129,7 +4137,7 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) { LLTracker::stopTracking(NULL); } - else if ( is_teleport && !gAgent.getTeleportKeepsLookAt() ) + else if ( is_teleport && !gAgent.getTeleportKeepsLookAt() && look_at.isExactlyZero()) { //look at the beacon LLVector3 global_agent_pos = agent_pos; @@ -4570,7 +4578,6 @@ void process_kill_object(LLMessageSystem *mesgsys, void **user_data) if (id == LLUUID::null) { LL_DEBUGS("Messaging") << "Unknown kill for local " << local_id << LL_ENDL; - gObjectList.mNumUnknownKills++; continue; } else @@ -4594,18 +4601,12 @@ void process_kill_object(LLMessageSystem *mesgsys, void **user_data) // Do the kill gObjectList.killObject(objectp); } - else - { - LL_WARNS("Messaging") << "Object in UUID lookup, but not on object list in kill!" << LL_ENDL; - gObjectList.mNumUnknownKills++; - } } // We should remove the object from selection after it is marked dead by gObjectList to make LLToolGrab, // which is using the object, release the mouse capture correctly when the object dies. // See LLToolGrab::handleHoverActive() and LLToolGrab::handleHoverNonPhysical(). LLSelectMgr::getInstance()->removeObjectFromSelections(id); - } } @@ -5937,6 +5938,15 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem) return true; } } + // HACK -- handle callbacks for specific alerts. + if( notificationID == "HomePositionSet" ) + { + // 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); + } LLNotificationsUtil::add(notificationID, llsdBlock); return true; @@ -5945,19 +5955,42 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem) } +static void process_special_alert_messages(const std::string & message) +{ + // Do special handling for alert messages. This is a legacy hack, and any actual displayed + // text should be altered in the notifications.xml files. + if ( message == "You died and have been teleported to your home location") + { + LLViewerStats::getInstance()->incStat(LLViewerStats::ST_KILLED_COUNT); + } + else if( message == "Home position set." ) + { + // 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); + } +} + + + void process_agent_alert_message(LLMessageSystem* msgsystem, void** user_data) { // make sure the cursor is back to the usual default since the // alert is probably due to some kind of error. gViewerWindow->getWindow()->resetBusyCount(); + std::string message; + msgsystem->getStringFast(_PREHASH_AlertData, _PREHASH_Message, message); + + process_special_alert_messages(message); + if (!attempt_standard_notification(msgsystem)) { BOOL modal = FALSE; msgsystem->getBOOL("AlertData", "Modal", modal); - std::string buffer; - msgsystem->getStringFast(_PREHASH_AlertData, _PREHASH_Message, buffer); - process_alert_core(buffer, modal); + process_alert_core(message, modal); } } @@ -5972,12 +6005,15 @@ void process_alert_message(LLMessageSystem *msgsystem, void **user_data) // alert is probably due to some kind of error. gViewerWindow->getWindow()->resetBusyCount(); + std::string message; + msgsystem->getStringFast(_PREHASH_AlertData, _PREHASH_Message, message); + + process_special_alert_messages(message); + if (!attempt_standard_notification(msgsystem)) { BOOL modal = FALSE; - std::string buffer; - msgsystem->getStringFast(_PREHASH_AlertData, _PREHASH_Message, buffer); - process_alert_core(buffer, modal); + process_alert_core(message, modal); } } @@ -6007,20 +6043,6 @@ bool handle_special_alerts(const std::string &pAlertName) void process_alert_core(const std::string& message, BOOL modal) { - // HACK -- handle callbacks for specific alerts. It also is localized in notifications.xml - if ( message == "You died and have been teleported to your home location") - { - LLViewerStats::getInstance()->incStat(LLViewerStats::ST_KILLED_COUNT); - } - else if( message == "Home position set." ) - { - // 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); - } - const std::string ALERT_PREFIX("ALERT: "); const std::string NOTIFY_PREFIX("NOTIFY: "); if (message.find(ALERT_PREFIX) == 0) @@ -7326,8 +7348,12 @@ void process_script_teleport_request(LLMessageSystem* msg, void**) LLFloaterWorldMap* instance = LLFloaterWorldMap::getInstance(); if(instance) { - instance->trackURL( - sim_name, (S32)pos.mV[VX], (S32)pos.mV[VY], (S32)pos.mV[VZ]); + llinfos << "Object named " << object_name + << " is offering TP to region " + << sim_name << " position " << pos + << llendl; + + instance->trackURL(sim_name, (S32)pos.mV[VX], (S32)pos.mV[VY], (S32)pos.mV[VZ]); LLFloaterReg::showInstance("world_map", "center"); } diff --git a/indra/newview/llviewernetwork.cpp b/indra/newview/llviewernetwork.cpp index 97f4c3e5fe..e7821d4b9e 100755 --- a/indra/newview/llviewernetwork.cpp +++ b/indra/newview/llviewernetwork.cpp @@ -43,6 +43,8 @@ const std::string GRID_LABEL_VALUE = "label"; const std::string GRID_ID_VALUE = "grid_login_id"; /// the url for the login cgi script const std::string GRID_LOGIN_URI_VALUE = "login_uri"; +/// url base for update queries +const std::string GRID_UPDATE_SERVICE_URL = "update_query_url_base"; /// const std::string GRID_HELPER_URI_VALUE = "helper_uri"; /// the splash page url @@ -63,6 +65,8 @@ const std::string DEFAULT_LOGIN_PAGE = "http://viewer-login.agni.lindenlab.com/" const std::string MAIN_GRID_LOGIN_URI = "https://login.agni.lindenlab.com/cgi-bin/login.cgi"; +const std::string SL_UPDATE_QUERY_URL = "https://update.secondlife.com/update"; + const std::string MAIN_GRID_SLURL_BASE = "http://maps.secondlife.com/secondlife/"; const std::string SYSTEM_GRID_APP_SLURL_BASE = "secondlife:///app"; @@ -120,12 +124,14 @@ void LLGridManager::initialize(const std::string& grid_file) MAIN_GRID_LOGIN_URI, "https://secondlife.com/helpers/", DEFAULT_LOGIN_PAGE, + SL_UPDATE_QUERY_URL, "Agni"); addSystemGrid("Second Life Beta Test Grid (Aditi)", "util.aditi.lindenlab.com", "https://login.aditi.lindenlab.com/cgi-bin/login.cgi", "http://aditi-secondlife.webdev.lindenlab.com/helpers/", DEFAULT_LOGIN_PAGE, + SL_UPDATE_QUERY_URL, "Aditi"); LLSD other_grids; @@ -332,6 +338,7 @@ void LLGridManager::addSystemGrid(const std::string& label, const std::string& login_uri, const std::string& helper, const std::string& login_page, + const std::string& update_url_base, const std::string& login_id) { LLSD grid = LLSD::emptyMap(); @@ -341,6 +348,7 @@ void LLGridManager::addSystemGrid(const std::string& label, grid[GRID_LOGIN_URI_VALUE] = LLSD::emptyArray(); grid[GRID_LOGIN_URI_VALUE].append(login_uri); grid[GRID_LOGIN_PAGE_VALUE] = login_page; + grid[GRID_UPDATE_SERVICE_URL] = update_url_base; grid[GRID_IS_SYSTEM_GRID_VALUE] = true; grid[GRID_LOGIN_IDENTIFIER_TYPES] = LLSD::emptyArray(); grid[GRID_LOGIN_IDENTIFIER_TYPES].append(CRED_IDENTIFIER_TYPE_AGENT); @@ -537,6 +545,30 @@ std::string LLGridManager::getGridLoginID() return mGridList[mGrid][GRID_ID_VALUE]; } +std::string LLGridManager::getUpdateServiceURL() +{ + std::string update_url_base = gSavedSettings.getString("CmdLineUpdateService");; + if ( !update_url_base.empty() ) + { + LL_INFOS2("UpdaterService","GridManager") + << "Update URL base overridden from command line: " << update_url_base + << LL_ENDL; + } + else if ( mGridList[mGrid].has(GRID_UPDATE_SERVICE_URL) ) + { + update_url_base = mGridList[mGrid][GRID_UPDATE_SERVICE_URL].asString(); + } + else + { + LL_WARNS2("UpdaterService","GridManager") + << "The grid property '" << GRID_UPDATE_SERVICE_URL + << "' is not defined for the grid '" << mGrid << "'" + << LL_ENDL; + } + + return update_url_base; +} + void LLGridManager::updateIsInProductionGrid() { mIsInProductionGrid = false; diff --git a/indra/newview/llviewernetwork.h b/indra/newview/llviewernetwork.h index 3f56103b2e..8526c0ba7f 100755 --- a/indra/newview/llviewernetwork.h +++ b/indra/newview/llviewernetwork.h @@ -140,6 +140,14 @@ class LLGridManager : public LLSingleton<LLGridManager> */ //@} + /* ================================================================ + * @name Update Related Properties + * @{ + */ + /// Get the update service URL base (host and path) for the selected grid + std::string getUpdateServiceURL(); + + //@} /* ================================================================ * @name URL Construction Properties @@ -207,6 +215,7 @@ class LLGridManager : public LLSingleton<LLGridManager> const std::string& login, const std::string& helper, const std::string& login_page, + const std::string& update_url_base, const std::string& login_id = ""); diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 6f7b2f40e6..7151a0d6ed 100755 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -1578,6 +1578,8 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, dp->setPassFlags(value); dp->unpackUUID(owner_id, "Owner"); + mOwnerID = owner_id; + if (value & 0x80) { dp->unpackVector3(new_angv, "Omega"); @@ -1651,13 +1653,13 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, retval |= checkMediaURL(media_url); // - // Unpack particle system data + // Unpack particle system data (legacy) // if (value & 0x8) { - unpackParticleSource(*dp, owner_id); + unpackParticleSource(*dp, owner_id, true); } - else + else if (!(value & 0x400)) { deleteParticleSource(); } @@ -4410,12 +4412,10 @@ S32 LLViewerObject::setTEMaterialParams(const U8 te, const LLMaterialPtr pMateri void LLViewerObject::refreshMaterials() { - setChanged(ALL_CHANGED); + setChanged(TEXTURE); if (mDrawable.notNull()) { gPipeline.markTextured(mDrawable); - gPipeline.markRebuild(mDrawable,LLDrawable::REBUILD_ALL); - dirtySpatialGroup(TRUE); } } @@ -4519,6 +4519,30 @@ LLViewerTexture *LLViewerObject::getTEImage(const U8 face) const } +bool LLViewerObject::isImageAlphaBlended(const U8 te) const +{ + LLViewerTexture* image = getTEImage(te); + LLGLenum format = image ? image->getPrimaryFormat() : GL_RGB; + switch (format) + { + case GL_RGBA: + case GL_ALPHA: + { + return true; + } + break; + + case GL_RGB: break; + default: + { + llwarns << "Unexpected tex format in LLViewerObject::isImageAlphaBlended...returning no alpha." << llendl; + } + break; + } + + return false; +} + LLViewerTexture *LLViewerObject::getTENormalMap(const U8 face) const { // llassert(mTEImages); @@ -4838,7 +4862,7 @@ void LLViewerObject::unpackParticleSource(const S32 block_num, const LLUUID& own } } -void LLViewerObject::unpackParticleSource(LLDataPacker &dp, const LLUUID& owner_id) +void LLViewerObject::unpackParticleSource(LLDataPacker &dp, const LLUUID& owner_id, bool legacy) { if (!mPartSourcep.isNull() && mPartSourcep->isDead()) { @@ -4847,7 +4871,7 @@ void LLViewerObject::unpackParticleSource(LLDataPacker &dp, const LLUUID& owner_ if (mPartSourcep) { // If we've got one already, just update the existing source (or remove it) - if (!LLViewerPartSourceScript::unpackPSS(this, mPartSourcep, dp)) + if (!LLViewerPartSourceScript::unpackPSS(this, mPartSourcep, dp, legacy)) { mPartSourcep->setDead(); mPartSourcep = NULL; @@ -4855,7 +4879,7 @@ void LLViewerObject::unpackParticleSource(LLDataPacker &dp, const LLUUID& owner_ } else { - LLPointer<LLViewerPartSourceScript> pss = LLViewerPartSourceScript::unpackPSS(this, NULL, dp); + LLPointer<LLViewerPartSourceScript> pss = LLViewerPartSourceScript::unpackPSS(this, NULL, dp, legacy); //If the owner is muted, don't create the system if(LLMuteList::getInstance()->isMuted(owner_id, LLMute::flagParticles)) return; // We need to be able to deal with a particle source that hasn't changed, but still got an update! @@ -5701,6 +5725,11 @@ F32 LLAlphaObject::getPartSize(S32 idx) return 0.f; } +void LLAlphaObject::getBlendFunc(S32 face, U32& src, U32& dst) +{ + +} + // virtual void LLStaticViewerObject::updateDrawable(BOOL force_damped) { diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index ea0d55cda5..b035473c74 100755 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -339,6 +339,8 @@ public: LLViewerTexture *getTENormalMap(const U8 te) const; LLViewerTexture *getTESpecularMap(const U8 te) const; + bool isImageAlphaBlended(const U8 te) const; + void fitFaceTexture(const U8 face); void sendTEUpdate() const; // Sends packed representation of all texture entry information @@ -600,6 +602,7 @@ public: } EPhysicsShapeType; LLUUID mID; + LLUUID mOwnerID; //null if unknown // unique within region, not unique across regions // Local ID = 0 is not used @@ -680,7 +683,7 @@ protected: BOOL isOnMap(); void unpackParticleSource(const S32 block_num, const LLUUID& owner_id); - void unpackParticleSource(LLDataPacker &dp, const LLUUID& owner_id); + void unpackParticleSource(LLDataPacker &dp, const LLUUID& owner_id, bool legacy); void deleteParticleSource(); void setParticleSource(const LLPartSysData& particle_parameters, const LLUUID& owner_id); @@ -845,8 +848,11 @@ public: LLStrider<LLVector3>& normalsp, LLStrider<LLVector2>& texcoordsp, LLStrider<LLColor4U>& colorsp, + LLStrider<LLColor4U>& emissivep, LLStrider<U16>& indicesp) = 0; + virtual void getBlendFunc(S32 face, U32& src, U32& dst); + F32 mDepth; }; diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index caacf26cb3..66615657d8 100755 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -106,7 +106,6 @@ LLViewerObjectList::LLViewerObjectList() mNumNewObjects = 0; mWasPaused = FALSE; mNumDeadObjectUpdates = 0; - mNumUnknownKills = 0; mNumUnknownUpdates = 0; } diff --git a/indra/newview/llviewerobjectlist.h b/indra/newview/llviewerobjectlist.h index 449a4633ff..6518c25d09 100755 --- a/indra/newview/llviewerobjectlist.h +++ b/indra/newview/llviewerobjectlist.h @@ -188,7 +188,6 @@ public: S32 mNumUnknownUpdates; S32 mNumDeadObjectUpdates; - S32 mNumUnknownKills; S32 mNumDeadObjects; protected: std::vector<U64> mOrphanParents; // LocalID/ip,port of orphaned objects diff --git a/indra/newview/llviewerpartsim.cpp b/indra/newview/llviewerpartsim.cpp index 6bd9f66b9c..163c90019f 100755 --- a/indra/newview/llviewerpartsim.cpp +++ b/indra/newview/llviewerpartsim.cpp @@ -80,12 +80,31 @@ LLViewerPart::LLViewerPart() : mImagep(NULL) { mPartSourcep = NULL; - + mParent = NULL; + mChild = NULL; ++LLViewerPartSim::sParticleCount2 ; } LLViewerPart::~LLViewerPart() { + if (mPartSourcep.notNull() && mPartSourcep->mLastPart == this) + { + mPartSourcep->mLastPart = NULL; + } + + //patch up holes in the ribbon + if (mParent) + { + llassert(mParent->mChild == this); + mParent->mChild = mChild; + } + + if (mChild) + { + llassert (mChild->mParent == this); + mChild->mParent = mParent; + } + mPartSourcep = NULL; --LLViewerPartSim::sParticleCount2 ; @@ -141,7 +160,11 @@ LLViewerPartGroup::LLViewerPartGroup(const LLVector3 ¢er_agent, const F32 bo } mVOPartGroupp->setViewerPartGroup(this); mVOPartGroupp->setPositionAgent(getCenterAgent()); + + mBoxSide = box_side; + F32 scale = box_side * 0.5f; + mVOPartGroupp->setScale(LLVector3(scale,scale,scale)); //gPipeline.addObject(mVOPartGroupp); @@ -367,6 +390,9 @@ void LLViewerPartGroup::updateParticles(const F32 lastdt) part->mScale += frac*part->mEndScale; } + // Do glow interpolation + part->mGlow.mV[3] = (U8) llround(lerp(part->mStartGlow, part->mEndGlow, frac)*255.f); + // Set the last update time to now. part->mLastUpdateTime = cur_time; @@ -488,9 +514,13 @@ void LLViewerPartSim::destroyClass() //static BOOL LLViewerPartSim::shouldAddPart() { - if (sParticleCount > PART_THROTTLE_THRESHOLD*sMaxParticleCount) + if (sParticleCount >= MAX_PART_COUNT) { + return FALSE; + } + if (sParticleCount > PART_THROTTLE_THRESHOLD*sMaxParticleCount) + { F32 frac = (F32)sParticleCount/(F32)sMaxParticleCount; frac -= PART_THROTTLE_THRESHOLD; frac *= PART_THROTTLE_RESCALE; @@ -500,7 +530,10 @@ BOOL LLViewerPartSim::shouldAddPart() return FALSE; } } - if (sParticleCount >= MAX_PART_COUNT) + + // Check frame rate, and don't add more if the viewer is really slow + const F32 MIN_FRAME_RATE_FOR_NEW_PARTICLES = 4.f; + if (gFPSClamped < MIN_FRAME_RATE_FOR_NEW_PARTICLES) { return FALSE; } @@ -616,6 +649,9 @@ void LLViewerPartSim::updateSimulation() { static LLFrameTimer update_timer; + //reset VBO cursor + LLVOPartGroup::sVBSlotCursor = 0; + const F32 dt = llmin(update_timer.getElapsedTimeAndResetF32(), 0.1f); if (!(gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_PARTICLES))) diff --git a/indra/newview/llviewerpartsim.h b/indra/newview/llviewerpartsim.h index c91fcf0691..2daa07ed8c 100755 --- a/indra/newview/llviewerpartsim.h +++ b/indra/newview/llviewerpartsim.h @@ -65,15 +65,22 @@ public: LLVPCallback mVPCallback; // Callback function for more complicated behaviors LLPointer<LLViewerPartSource> mPartSourcep; // Particle source used for this object - + + LLViewerPart* mParent; // particle to connect to if this is part of a particle ribbon + LLViewerPart* mChild; // child particle for clean reference destruction // Current particle state (possibly used for rendering) LLPointer<LLViewerTexture> mImagep; LLVector3 mPosAgent; LLVector3 mVelocity; LLVector3 mAccel; + LLVector3 mAxis; LLColor4 mColor; LLVector2 mScale; + F32 mStartGlow; + F32 mEndGlow; + LLColor4U mGlow; + static U32 sNextPartID; }; @@ -98,6 +105,9 @@ public: void shift(const LLVector3 &offset); + F32 getBoxRadius() { return mBoxRadius; } + F32 getBoxSide() { return mBoxSide; } + typedef std::vector<LLViewerPart*> part_list_t; part_list_t mParticles; @@ -118,6 +128,7 @@ public: protected: LLVector3 mCenterAgent; F32 mBoxRadius; + F32 mBoxSide; LLVector3 mMinObjPos; LLVector3 mMaxObjPos; diff --git a/indra/newview/llviewerpartsource.cpp b/indra/newview/llviewerpartsource.cpp index b311f659fb..b6bbd6140d 100755 --- a/indra/newview/llviewerpartsource.cpp +++ b/indra/newview/llviewerpartsource.cpp @@ -52,6 +52,8 @@ LLViewerPartSource::LLViewerPartSource(const U32 type) : static U32 id_seed = 0; mID = ++id_seed; + mLastPart = NULL; + mDelay = 0 ; } @@ -279,6 +281,22 @@ void LLViewerPartSourceScript::update(const F32 dt) { part->mFlags |= LLPartData::LL_PART_HUD; } + + if (part->mFlags & LLPartData::LL_PART_RIBBON_MASK && mLastPart) + { //set previous particle's parent to this particle to chain ribbon together + mLastPart->mParent = part; + part->mChild = mLastPart; + part->mAxis = LLVector3(0,0,1); + + if (mSourceObjectp.notNull()) + { + LLQuaternion rot = mSourceObjectp->getRenderRotation(); + part->mAxis *= rot; + } + } + + mLastPart = part; + part->mMaxAge = mPartSysData.mPartData.mMaxAge; part->mStartColor = mPartSysData.mPartData.mStartColor; part->mEndColor = mPartSysData.mPartData.mEndColor; @@ -290,6 +308,13 @@ void LLViewerPartSourceScript::update(const F32 dt) part->mAccel = mPartSysData.mPartAccel; + part->mBlendFuncDest = mPartSysData.mPartData.mBlendFuncDest; + part->mBlendFuncSource = mPartSysData.mPartData.mBlendFuncSource; + + part->mStartGlow = mPartSysData.mPartData.mStartGlow; + part->mEndGlow = mPartSysData.mPartData.mEndGlow; + part->mGlow = LLColor4U(0, 0, 0, (U8) llround(part->mStartGlow*255.f)); + if (mPartSysData.mPattern & LLPartSysData::LL_PART_SRC_PATTERN_DROP) { part->mPosAgent = mPosAgent; @@ -430,28 +455,51 @@ LLPointer<LLViewerPartSourceScript> LLViewerPartSourceScript::unpackPSS(LLViewer } -LLPointer<LLViewerPartSourceScript> LLViewerPartSourceScript::unpackPSS(LLViewerObject *source_objp, LLPointer<LLViewerPartSourceScript> pssp, LLDataPacker &dp) +LLPointer<LLViewerPartSourceScript> LLViewerPartSourceScript::unpackPSS(LLViewerObject *source_objp, LLPointer<LLViewerPartSourceScript> pssp, LLDataPacker &dp, bool legacy) { if (!pssp) { LLPointer<LLViewerPartSourceScript> new_pssp = new LLViewerPartSourceScript(source_objp); - if (!new_pssp->mPartSysData.unpack(dp)) + if (legacy) { - return NULL; + if (!new_pssp->mPartSysData.unpackLegacy(dp)) + { + return NULL; + } + } + else + { + if (!new_pssp->mPartSysData.unpack(dp)) + { + return NULL; + } } + if (new_pssp->mPartSysData.mTargetUUID.notNull()) { LLViewerObject *target_objp = gObjectList.findObject(new_pssp->mPartSysData.mTargetUUID); new_pssp->setTargetObject(target_objp); } + return new_pssp; } else { - if (!pssp->mPartSysData.unpack(dp)) + if (legacy) { - return NULL; + if (!pssp->mPartSysData.unpackLegacy(dp)) + { + return NULL; + } } + else + { + if (!pssp->mPartSysData.unpack(dp)) + { + return NULL; + } + } + if (pssp->mPartSysData.mTargetUUID.notNull()) { LLViewerObject *target_objp = gObjectList.findObject(pssp->mPartSysData.mTargetUUID); @@ -569,6 +617,11 @@ void LLViewerPartSourceSpiral::update(const F32 dt) part->mScale.mV[0] = 0.25f; part->mScale.mV[1] = 0.25f; part->mParameter = ll_frand(F_TWO_PI); + part->mBlendFuncDest = LLRender::BF_ONE_MINUS_SOURCE_ALPHA; + part->mBlendFuncSource = LLRender::BF_SOURCE_ALPHA; + part->mStartGlow = 0.f; + part->mEndGlow = 0.f; + part->mGlow = LLColor4U(0, 0, 0, 0); LLViewerPartSim::getInstance()->addPart(part); } @@ -721,6 +774,12 @@ void LLViewerPartSourceBeam::update(const F32 dt) part->mPosAgent = mPosAgent; part->mVelocity = mTargetPosAgent - mPosAgent; + part->mBlendFuncDest = LLRender::BF_ONE_MINUS_SOURCE_ALPHA; + part->mBlendFuncSource = LLRender::BF_SOURCE_ALPHA; + part->mStartGlow = 0.f; + part->mEndGlow = 0.f; + part->mGlow = LLColor4U(0, 0, 0, 0); + LLViewerPartSim::getInstance()->addPart(part); } } @@ -825,6 +884,12 @@ void LLViewerPartSourceChat::update(const F32 dt) part->mScale.mV[0] = 0.25f; part->mScale.mV[1] = 0.25f; part->mParameter = ll_frand(F_TWO_PI); + part->mBlendFuncDest = LLRender::BF_ONE_MINUS_SOURCE_ALPHA; + part->mBlendFuncSource = LLRender::BF_SOURCE_ALPHA; + part->mStartGlow = 0.f; + part->mEndGlow = 0.f; + part->mGlow = LLColor4U(0, 0, 0, 0); + LLViewerPartSim::getInstance()->addPart(part); } diff --git a/indra/newview/llviewerpartsource.h b/indra/newview/llviewerpartsource.h index 28702d36a2..12e926173b 100755 --- a/indra/newview/llviewerpartsource.h +++ b/indra/newview/llviewerpartsource.h @@ -76,6 +76,7 @@ public: LLVector3 mLastUpdatePosAgent; LLPointer<LLViewerObject> mSourceObjectp; U32 mID; + LLViewerPart* mLastPart; //last particle emitted (for making particle ribbons) protected: U32 mType; @@ -85,7 +86,6 @@ protected: F32 mLastPartTime; LLUUID mOwnerUUID; LLPointer<LLViewerTexture> mImagep; - // Particle information U32 mPartFlags; // Flags for the particle U32 mDelay ; //delay to start particles @@ -114,7 +114,7 @@ public: // Returns a new particle source to attach to an object... static LLPointer<LLViewerPartSourceScript> unpackPSS(LLViewerObject *source_objp, LLPointer<LLViewerPartSourceScript> pssp, const S32 block_num); - static LLPointer<LLViewerPartSourceScript> unpackPSS(LLViewerObject *source_objp, LLPointer<LLViewerPartSourceScript> pssp, LLDataPacker &dp); + static LLPointer<LLViewerPartSourceScript> unpackPSS(LLViewerObject *source_objp, LLPointer<LLViewerPartSourceScript> pssp, LLDataPacker &dp, bool legacy); static LLPointer<LLViewerPartSourceScript> createPSS(LLViewerObject *source_objp, const LLPartSysData& particle_parameters); LLViewerTexture *getImage() const { return mImagep; } diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 8422708add..678f24fb3c 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -44,6 +44,7 @@ #include "llagent.h" #include "llagentcamera.h" +#include "llavatarrenderinfoaccountant.h" #include "llcallingcard.h" #include "llcaphttpsender.h" #include "llcapabilitylistener.h" @@ -300,12 +301,17 @@ public: if ( regionp->getRegionImpl()->mCapabilities.size() != regionp->getRegionImpl()->mSecondCapabilitiesTracker.size() ) { - llinfos<<"BaseCapabilitiesCompleteTracker "<<"Sim sent duplicate seed caps that differs in size - most likely content."<<llendl; + llinfos << "BaseCapabilitiesCompleteTracker " << "sim " << regionp->getName() + << " sent duplicate seed caps that differs in size - most likely content. " + << (S32) regionp->getRegionImpl()->mCapabilities.size() << " vs " << regionp->getRegionImpl()->mSecondCapabilitiesTracker.size() + << llendl; + //todo#add cap debug versus original check? - /*CapabilityMap::const_iterator iter = regionp->getRegionImpl()->mCapabilities.begin(); + /* + CapabilityMap::const_iterator iter = regionp->getRegionImpl()->mCapabilities.begin(); while (iter!=regionp->getRegionImpl()->mCapabilities.end() ) { - llinfos<<"BaseCapabilitiesCompleteTracker Original "<<iter->first<<" "<< iter->second<<llendl; + llinfos << "BaseCapabilitiesCompleteTracker Original " << iter->first << " " << iter->second<<llendl; ++iter; } */ @@ -393,6 +399,9 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, mImpl->mObjectPartition.push_back(new LLBridgePartition()); //PARTITION_BRIDGE mImpl->mObjectPartition.push_back(new LLHUDParticlePartition());//PARTITION_HUD_PARTICLE mImpl->mObjectPartition.push_back(NULL); //PARTITION_NONE + + mRenderInfoRequestTimer.resetWithExpiry(0.f); // Set timer to be expired + setCapabilitiesReceivedCallback(boost::bind(&LLAvatarRenderInfoAccountant::expireRenderInfoReportTimer, _1)); } @@ -1219,7 +1228,7 @@ void LLViewerRegion::getInfo(LLSD& info) info["Region"]["Handle"]["y"] = (LLSD::Integer)y; } -void LLViewerRegion::getSimulatorFeatures(LLSD& sim_features) +void LLViewerRegion::getSimulatorFeatures(LLSD& sim_features) const { sim_features = mSimulatorFeatures; @@ -1577,6 +1586,7 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames) capabilityNames.append("AgentState"); capabilityNames.append("AttachmentResources"); capabilityNames.append("AvatarPickerSearch"); + capabilityNames.append("AvatarRenderInfo"); capabilityNames.append("CharacterProperties"); capabilityNames.append("ChatSessionRequest"); capabilityNames.append("CopyInventoryFromNotecard"); @@ -1944,3 +1954,47 @@ bool LLViewerRegion::dynamicPathfindingEnabled() const mSimulatorFeatures["DynamicPathfindingEnabled"].asBoolean()); } +void LLViewerRegion::resetMaterialsCapThrottle() +{ + F32 requests_per_sec = 1.0f; // original default; + if ( mSimulatorFeatures.has("RenderMaterialsCapability") + && mSimulatorFeatures["RenderMaterialsCapability"].isReal() ) + { + requests_per_sec = mSimulatorFeatures["RenderMaterialsCapability"].asReal(); + if ( requests_per_sec == 0.0f ) + { + requests_per_sec = 1.0f; + LL_WARNS("Materials") + << "region '" << getName() + << "' returned zero for RenderMaterialsCapability; using default " + << requests_per_sec << " per second" + << LL_ENDL; + } + LL_DEBUGS("Materials") << "region '" << getName() + << "' RenderMaterialsCapability " << requests_per_sec + << LL_ENDL; + } + else + { + LL_DEBUGS("Materials") + << "region '" << getName() + << "' did not return RenderMaterialsCapability, using default " + << requests_per_sec << " per second" + << LL_ENDL; + } + + mMaterialsCapThrottleTimer.resetWithExpiry( 1.0f / requests_per_sec ); +} + +U32 LLViewerRegion::getMaxMaterialsPerTransaction() const +{ + U32 max_entries = 50; // original hard coded default + if ( mSimulatorFeatures.has( "MaxMaterialsPerTransaction" ) + && mSimulatorFeatures[ "MaxMaterialsPerTransaction" ].isInteger()) + { + max_entries = mSimulatorFeatures[ "MaxMaterialsPerTransaction" ].asInteger(); + } + return max_entries; +} + + diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index 56cd0c9ea1..8f8bfa23c1 100755 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -43,6 +43,7 @@ #include "llcapabilityprovider.h" #include "m4math.h" // LLMatrix4 #include "llhttpclient.h" +#include "llframetimer.h" // Surface id's #define LAND 1 @@ -293,7 +294,7 @@ public: bool meshRezEnabled() const; bool meshUploadEnabled() const; - void getSimulatorFeatures(LLSD& info); + void getSimulatorFeatures(LLSD& info) const; void setSimulatorFeatures(const LLSD& info); @@ -343,6 +344,11 @@ public: const LLViewerRegionImpl * getRegionImpl() const { return mImpl; } LLViewerRegionImpl * getRegionImplNC() { return mImpl; } + // implements the materials capability throttle + bool materialsCapThrottled() const { return !mMaterialsCapThrottleTimer.hasExpired(); } + void resetMaterialsCapThrottle(); + + U32 getMaxMaterialsPerTransaction() const; public: struct CompareDistance { @@ -376,6 +382,8 @@ public: LLDynamicArray<U32> mMapAvatars; LLDynamicArray<LLUUID> mMapAvatarIDs; + LLFrameTimer & getRenderInfoRequestTimer() { return mRenderInfoRequestTimer; }; + private: LLViewerRegionImpl * mImpl; @@ -434,6 +442,10 @@ private: BOOL mReleaseNotesRequested; LLSD mSimulatorFeatures; + + // the materials capability throttle + LLFrameTimer mMaterialsCapThrottleTimer; +LLFrameTimer mRenderInfoRequestTimer; }; inline BOOL LLViewerRegion::getRegionProtocol(U64 protocol) const diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index b9e0847935..50f0a5f1af 100755 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -42,28 +42,19 @@ #include "llvosky.h" #include "llrender.h" -#if LL_DARWIN -#include "OpenGL/OpenGL.h" - -// include spec exp clamp to fix older mac rendering artifacts -// -#define SINGLE_FP_PERMUTATION(shader) \ - if (gGLManager.mIsMobileGF) \ - { \ - shader.addPermutation("SINGLE_FP_ONLY","1"); \ - } - - -#else -#define SINGLE_FP_PERMUTATION(shader) -#endif - #ifdef LL_RELEASE_FOR_DOWNLOAD #define UNIFORM_ERRS LL_WARNS_ONCE("Shader") #else #define UNIFORM_ERRS LL_ERRS("Shader") #endif +static LLStaticHashedString sTexture0("texture0"); +static LLStaticHashedString sTexture1("texture1"); +static LLStaticHashedString sTex0("tex0"); +static LLStaticHashedString sTex1("tex1"); +static LLStaticHashedString sGlowMap("glowMap"); +static LLStaticHashedString sScreenMap("screenMap"); + // Lots of STL stuff in here, using namespace std to keep things more readable using std::vector; using std::pair; @@ -93,10 +84,13 @@ LLGLSLShader gTwoTextureAddProgram; LLGLSLShader gOneTextureNoColorProgram; LLGLSLShader gDebugProgram; LLGLSLShader gClipProgram; +LLGLSLShader gDownsampleDepthProgram; +LLGLSLShader gDownsampleDepthRectProgram; LLGLSLShader gAlphaMaskProgram; //object shaders LLGLSLShader gObjectSimpleProgram; +LLGLSLShader gObjectSimpleImpostorProgram; LLGLSLShader gObjectPreviewProgram; LLGLSLShader gObjectSimpleWaterProgram; LLGLSLShader gObjectSimpleAlphaMaskProgram; @@ -182,6 +176,7 @@ LLGLSLShader gPostNightVisionProgram; // Deferred rendering shaders LLGLSLShader gDeferredImpostorProgram; LLGLSLShader gDeferredWaterProgram; +LLGLSLShader gDeferredUnderWaterProgram; LLGLSLShader gDeferredDiffuseProgram; LLGLSLShader gDeferredDiffuseAlphaMaskProgram; LLGLSLShader gDeferredNonIndexedDiffuseProgram; @@ -197,20 +192,26 @@ LLGLSLShader gDeferredTreeShadowProgram; LLGLSLShader gDeferredAvatarProgram; LLGLSLShader gDeferredAvatarAlphaProgram; LLGLSLShader gDeferredLightProgram; -LLGLSLShader gDeferredMultiLightProgram; +LLGLSLShader gDeferredMultiLightProgram[16]; LLGLSLShader gDeferredSpotLightProgram; LLGLSLShader gDeferredMultiSpotLightProgram; LLGLSLShader gDeferredSunProgram; LLGLSLShader gDeferredBlurLightProgram; LLGLSLShader gDeferredSoftenProgram; +LLGLSLShader gDeferredSoftenWaterProgram; LLGLSLShader gDeferredShadowProgram; LLGLSLShader gDeferredShadowCubeProgram; LLGLSLShader gDeferredShadowAlphaMaskProgram; LLGLSLShader gDeferredAvatarShadowProgram; LLGLSLShader gDeferredAttachmentShadowProgram; LLGLSLShader gDeferredAlphaProgram; +LLGLSLShader gDeferredAlphaImpostorProgram; +LLGLSLShader gDeferredAlphaWaterProgram; LLGLSLShader gDeferredAvatarEyesProgram; LLGLSLShader gDeferredFullbrightProgram; +LLGLSLShader gDeferredFullbrightAlphaMaskProgram; +LLGLSLShader gDeferredFullbrightWaterProgram; +LLGLSLShader gDeferredFullbrightAlphaMaskWaterProgram; LLGLSLShader gDeferredEmissiveProgram; LLGLSLShader gDeferredPostProgram; LLGLSLShader gDeferredCoFProgram; @@ -228,6 +229,7 @@ LLGLSLShader gNormalMapGenProgram; // Deferred materials shaders LLGLSLShader gDeferredMaterialProgram[LLMaterial::SHADER_COUNT*2]; +LLGLSLShader gDeferredMaterialWaterProgram[LLMaterial::SHADER_COUNT*2]; LLViewerShaderMgr::LLViewerShaderMgr() : mVertexShaderLevel(SHADER_COUNT, 0), @@ -243,6 +245,7 @@ LLViewerShaderMgr::LLViewerShaderMgr() : mShaderList.push_back(&gWaterProgram); mShaderList.push_back(&gAvatarEyeballProgram); mShaderList.push_back(&gObjectSimpleProgram); + mShaderList.push_back(&gObjectSimpleImpostorProgram); mShaderList.push_back(&gObjectPreviewProgram); mShaderList.push_back(&gImpostorProgram); mShaderList.push_back(&gObjectFullbrightNoColorProgram); @@ -293,6 +296,7 @@ LLViewerShaderMgr::LLViewerShaderMgr() : mShaderList.push_back(&gUnderWaterProgram); mShaderList.push_back(&gDeferredSunProgram); mShaderList.push_back(&gDeferredSoftenProgram); + mShaderList.push_back(&gDeferredSoftenWaterProgram); mShaderList.push_back(&gDeferredMaterialProgram[1]); mShaderList.push_back(&gDeferredMaterialProgram[5]); mShaderList.push_back(&gDeferredMaterialProgram[9]); @@ -301,15 +305,29 @@ LLViewerShaderMgr::LLViewerShaderMgr() : mShaderList.push_back(&gDeferredMaterialProgram[5+LLMaterial::SHADER_COUNT]); mShaderList.push_back(&gDeferredMaterialProgram[9+LLMaterial::SHADER_COUNT]); mShaderList.push_back(&gDeferredMaterialProgram[13+LLMaterial::SHADER_COUNT]); + mShaderList.push_back(&gDeferredMaterialWaterProgram[1]); + mShaderList.push_back(&gDeferredMaterialWaterProgram[5]); + mShaderList.push_back(&gDeferredMaterialWaterProgram[9]); + mShaderList.push_back(&gDeferredMaterialWaterProgram[13]); + mShaderList.push_back(&gDeferredMaterialWaterProgram[1+LLMaterial::SHADER_COUNT]); + mShaderList.push_back(&gDeferredMaterialWaterProgram[5+LLMaterial::SHADER_COUNT]); + mShaderList.push_back(&gDeferredMaterialWaterProgram[9+LLMaterial::SHADER_COUNT]); + mShaderList.push_back(&gDeferredMaterialWaterProgram[13+LLMaterial::SHADER_COUNT]); mShaderList.push_back(&gDeferredAlphaProgram); + mShaderList.push_back(&gDeferredAlphaImpostorProgram); + mShaderList.push_back(&gDeferredAlphaWaterProgram); mShaderList.push_back(&gDeferredSkinnedAlphaProgram); mShaderList.push_back(&gDeferredFullbrightProgram); + mShaderList.push_back(&gDeferredFullbrightAlphaMaskProgram); + mShaderList.push_back(&gDeferredFullbrightWaterProgram); + mShaderList.push_back(&gDeferredFullbrightAlphaMaskWaterProgram); mShaderList.push_back(&gDeferredFullbrightShinyProgram); mShaderList.push_back(&gDeferredSkinnedFullbrightShinyProgram); mShaderList.push_back(&gDeferredSkinnedFullbrightProgram); mShaderList.push_back(&gDeferredEmissiveProgram); mShaderList.push_back(&gDeferredAvatarEyesProgram); mShaderList.push_back(&gDeferredWaterProgram); + mShaderList.push_back(&gDeferredUnderWaterProgram); mShaderList.push_back(&gDeferredAvatarAlphaProgram); mShaderList.push_back(&gDeferredWLSkyProgram); mShaderList.push_back(&gDeferredWLCloudProgram); @@ -337,47 +355,6 @@ void LLViewerShaderMgr::initAttribsAndUniforms(void) if (mReservedAttribs.empty()) { LLShaderMgr::initAttribsAndUniforms(); - - mAvatarUniforms.push_back("matrixPalette"); - mAvatarUniforms.push_back("gWindDir"); - mAvatarUniforms.push_back("gSinWaveParams"); - mAvatarUniforms.push_back("gGravity"); - - mWLUniforms.push_back("camPosLocal"); - - mTerrainUniforms.reserve(5); - mTerrainUniforms.push_back("detail_0"); - mTerrainUniforms.push_back("detail_1"); - mTerrainUniforms.push_back("detail_2"); - mTerrainUniforms.push_back("detail_3"); - mTerrainUniforms.push_back("alpha_ramp"); - - mGlowUniforms.push_back("glowDelta"); - mGlowUniforms.push_back("glowStrength"); - - mGlowExtractUniforms.push_back("minLuminance"); - mGlowExtractUniforms.push_back("maxExtractAlpha"); - mGlowExtractUniforms.push_back("lumWeights"); - mGlowExtractUniforms.push_back("warmthWeights"); - mGlowExtractUniforms.push_back("warmthAmount"); - - mShinyUniforms.push_back("origin"); - - mWaterUniforms.reserve(12); - mWaterUniforms.push_back("screenTex"); - mWaterUniforms.push_back("screenDepth"); - mWaterUniforms.push_back("refTex"); - mWaterUniforms.push_back("eyeVec"); - mWaterUniforms.push_back("time"); - mWaterUniforms.push_back("d1"); - mWaterUniforms.push_back("d2"); - mWaterUniforms.push_back("lightDir"); - mWaterUniforms.push_back("specular"); - mWaterUniforms.push_back("lightExp"); - mWaterUniforms.push_back("fogCol"); - mWaterUniforms.push_back("kd"); - mWaterUniforms.push_back("refScale"); - mWaterUniforms.push_back("waterHeight"); } } @@ -702,6 +679,8 @@ void LLViewerShaderMgr::unloadShaders() gOcclusionCubeProgram.unload(); gDebugProgram.unload(); gClipProgram.unload(); + gDownsampleDepthProgram.unload(); + gDownsampleDepthRectProgram.unload(); gAlphaMaskProgram.unload(); gUIProgram.unload(); gPathfindingProgram.unload(); @@ -717,6 +696,7 @@ void LLViewerShaderMgr::unloadShaders() gObjectFullbrightNoColorProgram.unload(); gObjectFullbrightNoColorWaterProgram.unload(); gObjectSimpleProgram.unload(); + gObjectSimpleImpostorProgram.unload(); gObjectPreviewProgram.unload(); gImpostorProgram.unload(); gObjectSimpleAlphaMaskProgram.unload(); @@ -962,7 +942,7 @@ BOOL LLViewerShaderMgr::loadShadersEnvironment() gTerrainProgram.mShaderFiles.push_back(make_pair("environment/terrainV.glsl", GL_VERTEX_SHADER_ARB)); gTerrainProgram.mShaderFiles.push_back(make_pair("environment/terrainF.glsl", GL_FRAGMENT_SHADER_ARB)); gTerrainProgram.mShaderLevel = mVertexShaderLevel[SHADER_ENVIRONMENT]; - success = gTerrainProgram.createShader(NULL, &mTerrainUniforms); + success = gTerrainProgram.createShader(NULL, NULL); } if (!success) @@ -1000,7 +980,7 @@ BOOL LLViewerShaderMgr::loadShadersWater() gWaterProgram.mShaderFiles.push_back(make_pair("environment/waterV.glsl", GL_VERTEX_SHADER_ARB)); gWaterProgram.mShaderFiles.push_back(make_pair("environment/waterF.glsl", GL_FRAGMENT_SHADER_ARB)); gWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_WATER]; - success = gWaterProgram.createShader(NULL, &mWaterUniforms); + success = gWaterProgram.createShader(NULL, NULL); } if (success) @@ -1014,7 +994,7 @@ BOOL LLViewerShaderMgr::loadShadersWater() gUnderWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_WATER]; gUnderWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; - success = gUnderWaterProgram.createShader(NULL, &mWaterUniforms); + success = gUnderWaterProgram.createShader(NULL, NULL); } if (success) @@ -1032,7 +1012,7 @@ BOOL LLViewerShaderMgr::loadShadersWater() gTerrainWaterProgram.mShaderFiles.push_back(make_pair("environment/terrainWaterF.glsl", GL_FRAGMENT_SHADER_ARB)); gTerrainWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_ENVIRONMENT]; gTerrainWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; - terrainWaterSuccess = gTerrainWaterProgram.createShader(NULL, &mTerrainUniforms); + terrainWaterSuccess = gTerrainWaterProgram.createShader(NULL, NULL); } /// Keep track of water shader levels @@ -1081,7 +1061,7 @@ BOOL LLViewerShaderMgr::loadShadersEffects() gGlowProgram.mShaderFiles.push_back(make_pair("effects/glowV.glsl", GL_VERTEX_SHADER_ARB)); gGlowProgram.mShaderFiles.push_back(make_pair("effects/glowF.glsl", GL_FRAGMENT_SHADER_ARB)); gGlowProgram.mShaderLevel = mVertexShaderLevel[SHADER_EFFECT]; - success = gGlowProgram.createShader(NULL, &mGlowUniforms); + success = gGlowProgram.createShader(NULL, NULL); if (!success) { LLPipeline::sRenderGlow = FALSE; @@ -1095,7 +1075,7 @@ BOOL LLViewerShaderMgr::loadShadersEffects() gGlowExtractProgram.mShaderFiles.push_back(make_pair("effects/glowExtractV.glsl", GL_VERTEX_SHADER_ARB)); gGlowExtractProgram.mShaderFiles.push_back(make_pair("effects/glowExtractF.glsl", GL_FRAGMENT_SHADER_ARB)); gGlowExtractProgram.mShaderLevel = mVertexShaderLevel[SHADER_EFFECT]; - success = gGlowExtractProgram.createShader(NULL, &mGlowExtractUniforms); + success = gGlowExtractProgram.createShader(NULL, NULL); if (!success) { LLPipeline::sRenderGlow = FALSE; @@ -1124,12 +1104,16 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredImpostorProgram.unload(); gDeferredTerrainProgram.unload(); gDeferredLightProgram.unload(); - gDeferredMultiLightProgram.unload(); + for (U32 i = 0; i < LL_DEFERRED_MULTI_LIGHT_COUNT; ++i) + { + gDeferredMultiLightProgram[i].unload(); + } gDeferredSpotLightProgram.unload(); gDeferredMultiSpotLightProgram.unload(); gDeferredSunProgram.unload(); gDeferredBlurLightProgram.unload(); gDeferredSoftenProgram.unload(); + gDeferredSoftenWaterProgram.unload(); gDeferredShadowProgram.unload(); gDeferredShadowCubeProgram.unload(); gDeferredShadowAlphaMaskProgram.unload(); @@ -1138,7 +1122,11 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAvatarProgram.unload(); gDeferredAvatarAlphaProgram.unload(); gDeferredAlphaProgram.unload(); + gDeferredAlphaWaterProgram.unload(); gDeferredFullbrightProgram.unload(); + gDeferredFullbrightAlphaMaskProgram.unload(); + gDeferredFullbrightWaterProgram.unload(); + gDeferredFullbrightAlphaMaskWaterProgram.unload(); gDeferredEmissiveProgram.unload(); gDeferredAvatarEyesProgram.unload(); gDeferredPostProgram.unload(); @@ -1147,6 +1135,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredPostGammaCorrectProgram.unload(); gFXAAProgram.unload(); gDeferredWaterProgram.unload(); + gDeferredUnderWaterProgram.unload(); gDeferredWLSkyProgram.unload(); gDeferredWLCloudProgram.unload(); gDeferredStarProgram.unload(); @@ -1158,6 +1147,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() for (U32 i = 0; i < LLMaterial::SHADER_COUNT*2; ++i) { gDeferredMaterialProgram[i].unload(); + gDeferredMaterialWaterProgram[i].unload(); } return TRUE; } @@ -1242,11 +1232,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() if (success) { gDeferredSkinnedAlphaProgram.mName = "Deferred Skinned Alpha Shader"; - gDeferredSkinnedAlphaProgram.mFeatures.atmosphericHelpers = true; gDeferredSkinnedAlphaProgram.mFeatures.hasObjectSkinning = true; - gDeferredSkinnedAlphaProgram.mFeatures.calculatesAtmospherics = true; - gDeferredSkinnedAlphaProgram.mFeatures.hasGamma = true; - gDeferredSkinnedAlphaProgram.mFeatures.hasAtmospherics = true; gDeferredSkinnedAlphaProgram.mFeatures.calculatesLighting = false; gDeferredSkinnedAlphaProgram.mFeatures.hasLighting = false; gDeferredSkinnedAlphaProgram.mFeatures.isAlphaLighting = true; @@ -1256,8 +1242,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSkinnedAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredSkinnedAlphaProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; gDeferredSkinnedAlphaProgram.addPermutation("USE_DIFFUSE_TEX", "1"); - gDeferredSkinnedAlphaProgram.addPermutation("USE_VERTEX_COLOR", "1"); gDeferredSkinnedAlphaProgram.addPermutation("HAS_SKIN", "1"); + gDeferredSkinnedAlphaProgram.addPermutation("USE_VERTEX_COLOR", "1"); gDeferredSkinnedAlphaProgram.addPermutation("HAS_SHADOW", mVertexShaderLevel[SHADER_DEFERRED] > 1 ? "1" : "0"); success = gDeferredSkinnedAlphaProgram.createShader(NULL, NULL); @@ -1285,6 +1271,15 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredMaterialProgram[9+LLMaterial::SHADER_COUNT].mFeatures.hasLighting = false; gDeferredMaterialProgram[13+LLMaterial::SHADER_COUNT].mFeatures.hasLighting = false; + gDeferredMaterialWaterProgram[1].mFeatures.hasLighting = false; + gDeferredMaterialWaterProgram[5].mFeatures.hasLighting = false; + gDeferredMaterialWaterProgram[9].mFeatures.hasLighting = false; + gDeferredMaterialWaterProgram[13].mFeatures.hasLighting = false; + gDeferredMaterialWaterProgram[1+LLMaterial::SHADER_COUNT].mFeatures.hasLighting = false; + gDeferredMaterialWaterProgram[5+LLMaterial::SHADER_COUNT].mFeatures.hasLighting = false; + gDeferredMaterialWaterProgram[9+LLMaterial::SHADER_COUNT].mFeatures.hasLighting = false; + gDeferredMaterialWaterProgram[13+LLMaterial::SHADER_COUNT].mFeatures.hasLighting = false; + for (U32 i = 0; i < LLMaterial::SHADER_COUNT*2; ++i) { if (success) @@ -1304,8 +1299,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() bool has_skin = i & 0x10; gDeferredMaterialProgram[i].addPermutation("HAS_SKIN",has_skin ? "1" : "0"); - SINGLE_FP_PERMUTATION(gDeferredMaterialProgram[i]); - if (has_skin) { gDeferredMaterialProgram[i].mFeatures.hasObjectSkinning = true; @@ -1313,6 +1306,34 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() success = gDeferredMaterialProgram[i].createShader(NULL, NULL); } + + if (success) + { + gDeferredMaterialWaterProgram[i].mName = llformat("Deferred Underwater Material Shader %d", i); + + U32 alpha_mode = i & 0x3; + + gDeferredMaterialWaterProgram[i].mShaderFiles.clear(); + gDeferredMaterialWaterProgram[i].mShaderFiles.push_back(make_pair("deferred/materialV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredMaterialWaterProgram[i].mShaderFiles.push_back(make_pair("deferred/materialF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredMaterialWaterProgram[i].mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + gDeferredMaterialWaterProgram[i].mShaderGroup = LLGLSLShader::SG_WATER; + + gDeferredMaterialWaterProgram[i].addPermutation("HAS_NORMAL_MAP", i & 0x8? "1" : "0"); + gDeferredMaterialWaterProgram[i].addPermutation("HAS_SPECULAR_MAP", i & 0x4 ? "1" : "0"); + gDeferredMaterialWaterProgram[i].addPermutation("DIFFUSE_ALPHA_MODE", llformat("%d", alpha_mode)); + gDeferredMaterialWaterProgram[i].addPermutation("HAS_SUN_SHADOW", mVertexShaderLevel[SHADER_DEFERRED] > 1 ? "1" : "0"); + bool has_skin = i & 0x10; + gDeferredMaterialWaterProgram[i].addPermutation("HAS_SKIN",has_skin ? "1" : "0"); + gDeferredMaterialWaterProgram[i].addPermutation("WATER_FOG","1"); + + if (has_skin) + { + gDeferredMaterialWaterProgram[i].mFeatures.hasObjectSkinning = true; + } + + success = gDeferredMaterialWaterProgram[i].createShader(NULL, NULL);//&mWLUniforms); + } } gDeferredMaterialProgram[1].mFeatures.hasLighting = true; @@ -1324,6 +1345,14 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredMaterialProgram[9+LLMaterial::SHADER_COUNT].mFeatures.hasLighting = true; gDeferredMaterialProgram[13+LLMaterial::SHADER_COUNT].mFeatures.hasLighting = true; + gDeferredMaterialWaterProgram[1].mFeatures.hasLighting = true; + gDeferredMaterialWaterProgram[5].mFeatures.hasLighting = true; + gDeferredMaterialWaterProgram[9].mFeatures.hasLighting = true; + gDeferredMaterialWaterProgram[13].mFeatures.hasLighting = true; + gDeferredMaterialWaterProgram[1+LLMaterial::SHADER_COUNT].mFeatures.hasLighting = true; + gDeferredMaterialWaterProgram[5+LLMaterial::SHADER_COUNT].mFeatures.hasLighting = true; + gDeferredMaterialWaterProgram[9+LLMaterial::SHADER_COUNT].mFeatures.hasLighting = true; + gDeferredMaterialWaterProgram[13+LLMaterial::SHADER_COUNT].mFeatures.hasLighting = true; if (success) @@ -1364,22 +1393,21 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredLightProgram.mShaderFiles.push_back(make_pair("deferred/pointLightF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredLightProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - SINGLE_FP_PERMUTATION(gDeferredLightProgram); - success = gDeferredLightProgram.createShader(NULL, NULL); } + for (U32 i = 0; i < LL_DEFERRED_MULTI_LIGHT_COUNT; i++) + { if (success) { - gDeferredMultiLightProgram.mName = "Deferred MultiLight Shader"; - gDeferredMultiLightProgram.mShaderFiles.clear(); - gDeferredMultiLightProgram.mShaderFiles.push_back(make_pair("deferred/multiPointLightV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredMultiLightProgram.mShaderFiles.push_back(make_pair("deferred/multiPointLightF.glsl", GL_FRAGMENT_SHADER_ARB)); - gDeferredMultiLightProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - - SINGLE_FP_PERMUTATION(gDeferredMultiLightProgram); - - success = gDeferredMultiLightProgram.createShader(NULL, NULL); + gDeferredMultiLightProgram[i].mName = llformat("Deferred MultiLight Shader %d", i); + gDeferredMultiLightProgram[i].mShaderFiles.clear(); + gDeferredMultiLightProgram[i].mShaderFiles.push_back(make_pair("deferred/multiPointLightV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredMultiLightProgram[i].mShaderFiles.push_back(make_pair("deferred/multiPointLightF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredMultiLightProgram[i].mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + gDeferredMultiLightProgram[i].addPermutation("LIGHT_COUNT", llformat("%d", i+1)); + success = gDeferredMultiLightProgram[i].createShader(NULL, NULL); + } } if (success) @@ -1390,8 +1418,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSpotLightProgram.mShaderFiles.push_back(make_pair("deferred/spotLightF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredSpotLightProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - SINGLE_FP_PERMUTATION(gDeferredSpotLightProgram); - success = gDeferredSpotLightProgram.createShader(NULL, NULL); } @@ -1403,8 +1429,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredMultiSpotLightProgram.mShaderFiles.push_back(make_pair("deferred/multiSpotLightF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredMultiSpotLightProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - SINGLE_FP_PERMUTATION(gDeferredMultiSpotLightProgram); - success = gDeferredMultiSpotLightProgram.createShader(NULL, NULL); } @@ -1432,8 +1456,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSunProgram.mShaderFiles.push_back(make_pair(fragment, GL_FRAGMENT_SHADER_ARB)); gDeferredSunProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - SINGLE_FP_PERMUTATION(gDeferredSunProgram); - success = gDeferredSunProgram.createShader(NULL, NULL); } @@ -1445,19 +1467,14 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredBlurLightProgram.mShaderFiles.push_back(make_pair("deferred/blurLightF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredBlurLightProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - SINGLE_FP_PERMUTATION(gDeferredBlurLightProgram); - success = gDeferredBlurLightProgram.createShader(NULL, NULL); } if (success) { gDeferredAlphaProgram.mName = "Deferred Alpha Shader"; - gDeferredAlphaProgram.mFeatures.atmosphericHelpers = true; + gDeferredAlphaProgram.mFeatures.calculatesLighting = false; - gDeferredAlphaProgram.mFeatures.calculatesAtmospherics = true; - gDeferredAlphaProgram.mFeatures.hasGamma = true; - gDeferredAlphaProgram.mFeatures.hasAtmospherics = true; gDeferredAlphaProgram.mFeatures.hasLighting = false; gDeferredAlphaProgram.mFeatures.isAlphaLighting = true; gDeferredAlphaProgram.mFeatures.disableTextureIndex = true; //hack to disable auto-setup of texture channels @@ -1474,12 +1491,10 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredAlphaProgram.addPermutation("USE_INDEXED_TEX", "1"); - gDeferredAlphaProgram.addPermutation("USE_VERTEX_COLOR", "1"); gDeferredAlphaProgram.addPermutation("HAS_SHADOW", mVertexShaderLevel[SHADER_DEFERRED] > 1 ? "1" : "0"); + gDeferredAlphaProgram.addPermutation("USE_VERTEX_COLOR", "1"); gDeferredAlphaProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - SINGLE_FP_PERMUTATION(gDeferredAlphaProgram); - success = gDeferredAlphaProgram.createShader(NULL, NULL); // Hack @@ -1489,6 +1504,72 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() if (success) { + gDeferredAlphaImpostorProgram.mName = "Deferred Alpha Shader"; + + gDeferredAlphaImpostorProgram.mFeatures.calculatesLighting = false; + gDeferredAlphaImpostorProgram.mFeatures.hasLighting = false; + gDeferredAlphaImpostorProgram.mFeatures.isAlphaLighting = true; + gDeferredAlphaImpostorProgram.mFeatures.disableTextureIndex = true; //hack to disable auto-setup of texture channels + if (mVertexShaderLevel[SHADER_DEFERRED] < 1) + { + gDeferredAlphaImpostorProgram.mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels; + } + else + { //shave off some texture units for shadow maps + gDeferredAlphaImpostorProgram.mFeatures.mIndexedTextureChannels = llmax(LLGLSLShader::sIndexedTextureChannels - 6, 1); + } + + gDeferredAlphaImpostorProgram.mShaderFiles.clear(); + gDeferredAlphaImpostorProgram.mShaderFiles.push_back(make_pair("deferred/alphaV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredAlphaImpostorProgram.mShaderFiles.push_back(make_pair("deferred/alphaF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredAlphaImpostorProgram.addPermutation("USE_INDEXED_TEX", "1"); + gDeferredAlphaImpostorProgram.addPermutation("HAS_SHADOW", mVertexShaderLevel[SHADER_DEFERRED] > 1 ? "1" : "0"); + gDeferredAlphaImpostorProgram.addPermutation("USE_VERTEX_COLOR", "1"); + gDeferredAlphaImpostorProgram.addPermutation("FOR_IMPOSTOR", "1"); + + gDeferredAlphaImpostorProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + + success = gDeferredAlphaImpostorProgram.createShader(NULL, NULL); + + // Hack + gDeferredAlphaImpostorProgram.mFeatures.calculatesLighting = true; + gDeferredAlphaImpostorProgram.mFeatures.hasLighting = true; + } + + if (success) + { + gDeferredAlphaWaterProgram.mName = "Deferred Alpha Underwater Shader"; + gDeferredAlphaWaterProgram.mFeatures.calculatesLighting = false; + gDeferredAlphaWaterProgram.mFeatures.hasLighting = false; + gDeferredAlphaWaterProgram.mFeatures.isAlphaLighting = true; + gDeferredAlphaWaterProgram.mFeatures.disableTextureIndex = true; //hack to disable auto-setup of texture channels + if (mVertexShaderLevel[SHADER_DEFERRED] < 1) + { + gDeferredAlphaWaterProgram.mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels; + } + else + { //shave off some texture units for shadow maps + gDeferredAlphaWaterProgram.mFeatures.mIndexedTextureChannels = llmax(LLGLSLShader::sIndexedTextureChannels - 6, 1); + } + gDeferredAlphaWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; + gDeferredAlphaWaterProgram.mShaderFiles.clear(); + gDeferredAlphaWaterProgram.mShaderFiles.push_back(make_pair("deferred/alphaV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredAlphaWaterProgram.mShaderFiles.push_back(make_pair("deferred/alphaF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredAlphaWaterProgram.addPermutation("USE_INDEXED_TEX", "1"); + gDeferredAlphaWaterProgram.addPermutation("WATER_FOG", "1"); + gDeferredAlphaWaterProgram.addPermutation("USE_VERTEX_COLOR", "1"); + gDeferredAlphaWaterProgram.addPermutation("HAS_SHADOW", mVertexShaderLevel[SHADER_DEFERRED] > 1 ? "1" : "0"); + gDeferredAlphaWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + + success = gDeferredAlphaWaterProgram.createShader(NULL, NULL); + + // Hack + gDeferredAlphaWaterProgram.mFeatures.calculatesLighting = true; + gDeferredAlphaWaterProgram.mFeatures.hasLighting = true; + } + + if (success) + { gDeferredAvatarEyesProgram.mName = "Deferred Avatar Eyes Shader"; gDeferredAvatarEyesProgram.mFeatures.calculatesAtmospherics = true; gDeferredAvatarEyesProgram.mFeatures.hasGamma = true; @@ -1517,6 +1598,54 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() if (success) { + gDeferredFullbrightAlphaMaskProgram.mName = "Deferred Fullbright Alpha Masking Shader"; + gDeferredFullbrightAlphaMaskProgram.mFeatures.calculatesAtmospherics = true; + gDeferredFullbrightAlphaMaskProgram.mFeatures.hasGamma = true; + gDeferredFullbrightAlphaMaskProgram.mFeatures.hasTransport = true; + gDeferredFullbrightAlphaMaskProgram.mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels; + gDeferredFullbrightAlphaMaskProgram.mShaderFiles.clear(); + gDeferredFullbrightAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredFullbrightAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredFullbrightAlphaMaskProgram.addPermutation("HAS_ALPHA_MASK","1"); + gDeferredFullbrightAlphaMaskProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + success = gDeferredFullbrightAlphaMaskProgram.createShader(NULL, NULL); + } + + if (success) + { + gDeferredFullbrightWaterProgram.mName = "Deferred Fullbright Underwater Shader"; + gDeferredFullbrightWaterProgram.mFeatures.calculatesAtmospherics = true; + gDeferredFullbrightWaterProgram.mFeatures.hasGamma = true; + gDeferredFullbrightWaterProgram.mFeatures.hasTransport = true; + gDeferredFullbrightWaterProgram.mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels; + gDeferredFullbrightWaterProgram.mShaderFiles.clear(); + gDeferredFullbrightWaterProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredFullbrightWaterProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredFullbrightWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + gDeferredFullbrightWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; + gDeferredFullbrightWaterProgram.addPermutation("WATER_FOG","1"); + success = gDeferredFullbrightWaterProgram.createShader(NULL, NULL); + } + + if (success) + { + gDeferredFullbrightAlphaMaskWaterProgram.mName = "Deferred Fullbright Underwater Alpha Masking Shader"; + gDeferredFullbrightAlphaMaskWaterProgram.mFeatures.calculatesAtmospherics = true; + gDeferredFullbrightAlphaMaskWaterProgram.mFeatures.hasGamma = true; + gDeferredFullbrightAlphaMaskWaterProgram.mFeatures.hasTransport = true; + gDeferredFullbrightAlphaMaskWaterProgram.mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels; + gDeferredFullbrightAlphaMaskWaterProgram.mShaderFiles.clear(); + gDeferredFullbrightAlphaMaskWaterProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredFullbrightAlphaMaskWaterProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredFullbrightAlphaMaskWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + gDeferredFullbrightAlphaMaskWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; + gDeferredFullbrightAlphaMaskWaterProgram.addPermutation("HAS_ALPHA_MASK","1"); + gDeferredFullbrightAlphaMaskWaterProgram.addPermutation("WATER_FOG","1"); + success = gDeferredFullbrightAlphaMaskWaterProgram.createShader(NULL, NULL); + } + + if (success) + { gDeferredFullbrightShinyProgram.mName = "Deferred FullbrightShiny Shader"; gDeferredFullbrightShinyProgram.mFeatures.calculatesAtmospherics = true; gDeferredFullbrightShinyProgram.mFeatures.hasGamma = true; @@ -1526,7 +1655,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredFullbrightShinyProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightShinyV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredFullbrightShinyProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightShinyF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredFullbrightShinyProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredFullbrightShinyProgram.createShader(NULL, &mShinyUniforms); + success = gDeferredFullbrightShinyProgram.createShader(NULL, NULL); } if (success) @@ -1556,7 +1685,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSkinnedFullbrightShinyProgram.mShaderFiles.push_back(make_pair("objects/fullbrightShinySkinnedV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredSkinnedFullbrightShinyProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightShinyF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredSkinnedFullbrightShinyProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; - success = gDeferredSkinnedFullbrightShinyProgram.createShader(NULL, &mShinyUniforms); + success = gDeferredSkinnedFullbrightShinyProgram.createShader(NULL, NULL); } if (success) @@ -1584,7 +1713,21 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredWaterProgram.mShaderFiles.push_back(make_pair("deferred/waterV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredWaterProgram.mShaderFiles.push_back(make_pair("deferred/waterF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredWaterProgram.createShader(NULL, &mWaterUniforms); + success = gDeferredWaterProgram.createShader(NULL, NULL); + } + + if (success) + { + // load water shader + gDeferredUnderWaterProgram.mName = "Deferred Under Water Shader"; + gDeferredUnderWaterProgram.mFeatures.calculatesAtmospherics = true; + gDeferredUnderWaterProgram.mFeatures.hasGamma = true; + gDeferredUnderWaterProgram.mFeatures.hasTransport = true; + gDeferredUnderWaterProgram.mShaderFiles.clear(); + gDeferredUnderWaterProgram.mShaderFiles.push_back(make_pair("deferred/waterV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredUnderWaterProgram.mShaderFiles.push_back(make_pair("deferred/underWaterF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredUnderWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + success = gDeferredUnderWaterProgram.createShader(NULL, NULL); } if (success) @@ -1596,8 +1739,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSoftenProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - SINGLE_FP_PERMUTATION(gDeferredSoftenProgram); - if (gSavedSettings.getBOOL("RenderDeferredSSAO")) { //if using SSAO, take screen space light map into account as if shadows are enabled gDeferredSoftenProgram.mShaderLevel = llmax(gDeferredSoftenProgram.mShaderLevel, 2); @@ -1608,6 +1749,25 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() if (success) { + gDeferredSoftenWaterProgram.mName = "Deferred Soften Underwater Shader"; + gDeferredSoftenWaterProgram.mShaderFiles.clear(); + gDeferredSoftenWaterProgram.mShaderFiles.push_back(make_pair("deferred/softenLightV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredSoftenWaterProgram.mShaderFiles.push_back(make_pair("deferred/softenLightF.glsl", GL_FRAGMENT_SHADER_ARB)); + + gDeferredSoftenWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + gDeferredSoftenWaterProgram.addPermutation("WATER_FOG", "1"); + gDeferredSoftenWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; + + if (gSavedSettings.getBOOL("RenderDeferredSSAO")) + { //if using SSAO, take screen space light map into account as if shadows are enabled + gDeferredSoftenWaterProgram.mShaderLevel = llmax(gDeferredSoftenWaterProgram.mShaderLevel, 2); + } + + success = gDeferredSoftenWaterProgram.createShader(NULL, NULL); + } + + if (success) + { gDeferredShadowProgram.mName = "Deferred Shadow Shader"; gDeferredShadowProgram.mShaderFiles.clear(); gDeferredShadowProgram.mShaderFiles.push_back(make_pair("deferred/shadowV.glsl", GL_VERTEX_SHADER_ARB)); @@ -1649,7 +1809,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAvatarShadowProgram.mShaderFiles.push_back(make_pair("deferred/avatarShadowF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredAvatarShadowProgram.addPermutation("DEPTH_CLAMP", gGLManager.mHasDepthClamp ? "1" : "0"); gDeferredAvatarShadowProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredAvatarShadowProgram.createShader(NULL, &mAvatarUniforms); + success = gDeferredAvatarShadowProgram.createShader(NULL, NULL); } if (success) @@ -1671,7 +1831,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredTerrainProgram.mShaderFiles.push_back(make_pair("deferred/terrainV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredTerrainProgram.mShaderFiles.push_back(make_pair("deferred/terrainF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredTerrainProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredTerrainProgram.createShader(NULL, &mTerrainUniforms); + success = gDeferredTerrainProgram.createShader(NULL, NULL); } if (success) @@ -1682,18 +1842,14 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAvatarProgram.mShaderFiles.push_back(make_pair("deferred/avatarV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredAvatarProgram.mShaderFiles.push_back(make_pair("deferred/avatarF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredAvatarProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredAvatarProgram.createShader(NULL, &mAvatarUniforms); + success = gDeferredAvatarProgram.createShader(NULL, NULL); } if (success) { gDeferredAvatarAlphaProgram.mName = "Avatar Alpha Shader"; - gDeferredAvatarAlphaProgram.mFeatures.atmosphericHelpers = true; gDeferredAvatarAlphaProgram.mFeatures.hasSkinning = true; gDeferredAvatarAlphaProgram.mFeatures.calculatesLighting = false; - gDeferredAvatarAlphaProgram.mFeatures.calculatesAtmospherics = true; - gDeferredAvatarAlphaProgram.mFeatures.hasGamma = true; - gDeferredAvatarAlphaProgram.mFeatures.hasAtmospherics = true; gDeferredAvatarAlphaProgram.mFeatures.hasLighting = false; gDeferredAvatarAlphaProgram.mFeatures.isAlphaLighting = true; gDeferredAvatarAlphaProgram.mFeatures.disableTextureIndex = true; @@ -1705,7 +1861,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAvatarAlphaProgram.addPermutation("HAS_SHADOW", mVertexShaderLevel[SHADER_DEFERRED] > 1 ? "1" : "0"); gDeferredAvatarAlphaProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredAvatarAlphaProgram.createShader(NULL, &mAvatarUniforms); + success = gDeferredAvatarAlphaProgram.createShader(NULL, NULL); gDeferredAvatarAlphaProgram.mFeatures.calculatesLighting = true; gDeferredAvatarAlphaProgram.mFeatures.hasLighting = true; @@ -1780,7 +1936,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredWLSkyProgram.mShaderFiles.push_back(make_pair("deferred/skyF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredWLSkyProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; gDeferredWLSkyProgram.mShaderGroup = LLGLSLShader::SG_SKY; - success = gDeferredWLSkyProgram.createShader(NULL, &mWLUniforms); + success = gDeferredWLSkyProgram.createShader(NULL, NULL); } if (success) @@ -1791,7 +1947,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredWLCloudProgram.mShaderFiles.push_back(make_pair("deferred/cloudsF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredWLCloudProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; gDeferredWLCloudProgram.mShaderGroup = LLGLSLShader::SG_SKY; - success = gDeferredWLCloudProgram.createShader(NULL, &mWLUniforms); + success = gDeferredWLCloudProgram.createShader(NULL, NULL); } if (success) @@ -1802,7 +1958,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredStarProgram.mShaderFiles.push_back(make_pair("deferred/starsF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredStarProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; gDeferredStarProgram.mShaderGroup = LLGLSLShader::SG_SKY; - success = gDeferredStarProgram.createShader(NULL, &mWLUniforms); + success = gDeferredStarProgram.createShader(NULL, NULL); } if (success) @@ -1832,6 +1988,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectFullbrightNoColorProgram.unload(); gObjectFullbrightNoColorWaterProgram.unload(); gObjectSimpleProgram.unload(); + gObjectSimpleImpostorProgram.unload(); gObjectPreviewProgram.unload(); gImpostorProgram.unload(); gObjectSimpleAlphaMaskProgram.unload(); @@ -2153,7 +2310,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectShinyNonIndexedProgram.mShaderFiles.push_back(make_pair("objects/shinyV.glsl", GL_VERTEX_SHADER_ARB)); gObjectShinyNonIndexedProgram.mShaderFiles.push_back(make_pair("objects/shinyF.glsl", GL_FRAGMENT_SHADER_ARB)); gObjectShinyNonIndexedProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; - success = gObjectShinyNonIndexedProgram.createShader(NULL, &mShinyUniforms); + success = gObjectShinyNonIndexedProgram.createShader(NULL, NULL); } if (success) @@ -2170,7 +2327,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectShinyNonIndexedWaterProgram.mShaderFiles.push_back(make_pair("objects/shinyV.glsl", GL_VERTEX_SHADER_ARB)); gObjectShinyNonIndexedWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; gObjectShinyNonIndexedWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; - success = gObjectShinyNonIndexedWaterProgram.createShader(NULL, &mShinyUniforms); + success = gObjectShinyNonIndexedWaterProgram.createShader(NULL, NULL); } if (success) @@ -2186,7 +2343,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectFullbrightShinyNonIndexedProgram.mShaderFiles.push_back(make_pair("objects/fullbrightShinyV.glsl", GL_VERTEX_SHADER_ARB)); gObjectFullbrightShinyNonIndexedProgram.mShaderFiles.push_back(make_pair("objects/fullbrightShinyF.glsl", GL_FRAGMENT_SHADER_ARB)); gObjectFullbrightShinyNonIndexedProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; - success = gObjectFullbrightShinyNonIndexedProgram.createShader(NULL, &mShinyUniforms); + success = gObjectFullbrightShinyNonIndexedProgram.createShader(NULL, NULL); } if (success) @@ -2204,7 +2361,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectFullbrightShinyNonIndexedWaterProgram.mShaderFiles.push_back(make_pair("objects/fullbrightShinyWaterF.glsl", GL_FRAGMENT_SHADER_ARB)); gObjectFullbrightShinyNonIndexedWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; gObjectFullbrightShinyNonIndexedWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; - success = gObjectFullbrightShinyNonIndexedWaterProgram.createShader(NULL, &mShinyUniforms); + success = gObjectFullbrightShinyNonIndexedWaterProgram.createShader(NULL, NULL); } if (success) @@ -2254,6 +2411,27 @@ BOOL LLViewerShaderMgr::loadShadersObject() if (success) { + gObjectSimpleImpostorProgram.mName = "Simple Impostor Shader"; + gObjectSimpleImpostorProgram.mFeatures.calculatesLighting = true; + gObjectSimpleImpostorProgram.mFeatures.calculatesAtmospherics = true; + gObjectSimpleImpostorProgram.mFeatures.hasGamma = true; + gObjectSimpleImpostorProgram.mFeatures.hasAtmospherics = true; + gObjectSimpleImpostorProgram.mFeatures.hasLighting = true; + gObjectSimpleImpostorProgram.mFeatures.mIndexedTextureChannels = 0; + // force alpha mask version of lighting so we can weed out + // transparent pixels from impostor temp buffer + // + gObjectSimpleImpostorProgram.mFeatures.hasAlphaMask = true; + gObjectSimpleImpostorProgram.mShaderFiles.clear(); + gObjectSimpleImpostorProgram.mShaderFiles.push_back(make_pair("objects/simpleV.glsl", GL_VERTEX_SHADER_ARB)); + gObjectSimpleImpostorProgram.mShaderFiles.push_back(make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectSimpleImpostorProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; + + success = gObjectSimpleImpostorProgram.createShader(NULL, NULL); + } + + if (success) + { gObjectSimpleWaterProgram.mName = "Simple Water Shader"; gObjectSimpleWaterProgram.mFeatures.calculatesLighting = true; gObjectSimpleWaterProgram.mFeatures.calculatesAtmospherics = true; @@ -2283,12 +2461,11 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectBumpProgram.mShaderFiles.push_back(make_pair("objects/bumpF.glsl", GL_FRAGMENT_SHADER_ARB)); gObjectBumpProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; success = gObjectBumpProgram.createShader(NULL, NULL); - if (success) { //lldrawpoolbump assumes "texture0" has channel 0 and "texture1" has channel 1 gObjectBumpProgram.bind(); - gObjectBumpProgram.uniform1i("texture0", 0); - gObjectBumpProgram.uniform1i("texture1", 1); + gObjectBumpProgram.uniform1i(sTexture0, 0); + gObjectBumpProgram.uniform1i(sTexture1, 1); gObjectBumpProgram.unbind(); } } @@ -2437,7 +2614,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectShinyProgram.mShaderFiles.push_back(make_pair("objects/shinyV.glsl", GL_VERTEX_SHADER_ARB)); gObjectShinyProgram.mShaderFiles.push_back(make_pair("objects/shinyF.glsl", GL_FRAGMENT_SHADER_ARB)); gObjectShinyProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; - success = gObjectShinyProgram.createShader(NULL, &mShinyUniforms); + success = gObjectShinyProgram.createShader(NULL, NULL); } if (success) @@ -2454,7 +2631,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectShinyWaterProgram.mShaderFiles.push_back(make_pair("objects/shinyV.glsl", GL_VERTEX_SHADER_ARB)); gObjectShinyWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; gObjectShinyWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; - success = gObjectShinyWaterProgram.createShader(NULL, &mShinyUniforms); + success = gObjectShinyWaterProgram.createShader(NULL, NULL); } if (success) @@ -2470,7 +2647,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectFullbrightShinyProgram.mShaderFiles.push_back(make_pair("objects/fullbrightShinyV.glsl", GL_VERTEX_SHADER_ARB)); gObjectFullbrightShinyProgram.mShaderFiles.push_back(make_pair("objects/fullbrightShinyF.glsl", GL_FRAGMENT_SHADER_ARB)); gObjectFullbrightShinyProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; - success = gObjectFullbrightShinyProgram.createShader(NULL, &mShinyUniforms); + success = gObjectFullbrightShinyProgram.createShader(NULL, NULL); } if (success) @@ -2488,7 +2665,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectFullbrightShinyWaterProgram.mShaderFiles.push_back(make_pair("objects/fullbrightShinyWaterF.glsl", GL_FRAGMENT_SHADER_ARB)); gObjectFullbrightShinyWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; gObjectFullbrightShinyWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; - success = gObjectFullbrightShinyWaterProgram.createShader(NULL, &mShinyUniforms); + success = gObjectFullbrightShinyWaterProgram.createShader(NULL, NULL); } if (mVertexShaderLevel[SHADER_AVATAR] > 0) @@ -2576,7 +2753,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gSkinnedObjectFullbrightShinyProgram.mShaderFiles.push_back(make_pair("objects/fullbrightShinySkinnedV.glsl", GL_VERTEX_SHADER_ARB)); gSkinnedObjectFullbrightShinyProgram.mShaderFiles.push_back(make_pair("objects/fullbrightShinyF.glsl", GL_FRAGMENT_SHADER_ARB)); gSkinnedObjectFullbrightShinyProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; - success = gSkinnedObjectFullbrightShinyProgram.createShader(NULL, &mShinyUniforms); + success = gSkinnedObjectFullbrightShinyProgram.createShader(NULL, NULL); } if (success) @@ -2594,7 +2771,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gSkinnedObjectShinySimpleProgram.mShaderFiles.push_back(make_pair("objects/shinySimpleSkinnedV.glsl", GL_VERTEX_SHADER_ARB)); gSkinnedObjectShinySimpleProgram.mShaderFiles.push_back(make_pair("objects/shinyF.glsl", GL_FRAGMENT_SHADER_ARB)); gSkinnedObjectShinySimpleProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; - success = gSkinnedObjectShinySimpleProgram.createShader(NULL, &mShinyUniforms); + success = gSkinnedObjectShinySimpleProgram.createShader(NULL, NULL); } if (success) @@ -2653,7 +2830,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gSkinnedObjectFullbrightShinyWaterProgram.mShaderFiles.push_back(make_pair("objects/fullbrightShinySkinnedV.glsl", GL_VERTEX_SHADER_ARB)); gSkinnedObjectFullbrightShinyWaterProgram.mShaderFiles.push_back(make_pair("objects/fullbrightShinyWaterF.glsl", GL_FRAGMENT_SHADER_ARB)); gSkinnedObjectFullbrightShinyWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; - success = gSkinnedObjectFullbrightShinyWaterProgram.createShader(NULL, &mShinyUniforms); + success = gSkinnedObjectFullbrightShinyWaterProgram.createShader(NULL, NULL); } if (success) @@ -2673,7 +2850,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gSkinnedObjectShinySimpleWaterProgram.mShaderFiles.push_back(make_pair("objects/shinySimpleSkinnedV.glsl", GL_VERTEX_SHADER_ARB)); gSkinnedObjectShinySimpleWaterProgram.mShaderFiles.push_back(make_pair("objects/shinyWaterF.glsl", GL_FRAGMENT_SHADER_ARB)); gSkinnedObjectShinySimpleWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; - success = gSkinnedObjectShinySimpleWaterProgram.createShader(NULL, &mShinyUniforms); + success = gSkinnedObjectShinySimpleWaterProgram.createShader(NULL, NULL); } } @@ -2714,7 +2891,7 @@ BOOL LLViewerShaderMgr::loadShadersAvatar() gAvatarProgram.mShaderFiles.push_back(make_pair("avatar/avatarV.glsl", GL_VERTEX_SHADER_ARB)); gAvatarProgram.mShaderFiles.push_back(make_pair("avatar/avatarF.glsl", GL_FRAGMENT_SHADER_ARB)); gAvatarProgram.mShaderLevel = mVertexShaderLevel[SHADER_AVATAR]; - success = gAvatarProgram.createShader(NULL, &mAvatarUniforms); + success = gAvatarProgram.createShader(NULL, NULL); if (success) { @@ -2733,7 +2910,7 @@ BOOL LLViewerShaderMgr::loadShadersAvatar() // Note: no cloth under water: gAvatarWaterProgram.mShaderLevel = llmin(mVertexShaderLevel[SHADER_AVATAR], 1); gAvatarWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; - success = gAvatarWaterProgram.createShader(NULL, &mAvatarUniforms); + success = gAvatarWaterProgram.createShader(NULL, NULL); } /// Keep track of avatar levels @@ -2752,7 +2929,7 @@ BOOL LLViewerShaderMgr::loadShadersAvatar() gAvatarPickProgram.mShaderFiles.push_back(make_pair("avatar/pickAvatarV.glsl", GL_VERTEX_SHADER_ARB)); gAvatarPickProgram.mShaderFiles.push_back(make_pair("avatar/pickAvatarF.glsl", GL_FRAGMENT_SHADER_ARB)); gAvatarPickProgram.mShaderLevel = mVertexShaderLevel[SHADER_AVATAR]; - success = gAvatarPickProgram.createShader(NULL, &mAvatarUniforms); + success = gAvatarPickProgram.createShader(NULL, NULL); } if (success) @@ -2874,7 +3051,7 @@ BOOL LLViewerShaderMgr::loadShadersInterface() if (success) { gSplatTextureRectProgram.bind(); - gSplatTextureRectProgram.uniform1i("screenMap", 0); + gSplatTextureRectProgram.uniform1i(sScreenMap, 0); gSplatTextureRectProgram.unbind(); } } @@ -2890,8 +3067,8 @@ BOOL LLViewerShaderMgr::loadShadersInterface() if (success) { gGlowCombineProgram.bind(); - gGlowCombineProgram.uniform1i("glowMap", 0); - gGlowCombineProgram.uniform1i("screenMap", 1); + gGlowCombineProgram.uniform1i(sGlowMap, 0); + gGlowCombineProgram.uniform1i(sScreenMap, 1); gGlowCombineProgram.unbind(); } } @@ -2907,8 +3084,8 @@ BOOL LLViewerShaderMgr::loadShadersInterface() if (success) { gGlowCombineFXAAProgram.bind(); - gGlowCombineFXAAProgram.uniform1i("glowMap", 0); - gGlowCombineFXAAProgram.uniform1i("screenMap", 1); + gGlowCombineFXAAProgram.uniform1i(sGlowMap, 0); + gGlowCombineFXAAProgram.uniform1i(sScreenMap, 1); gGlowCombineFXAAProgram.unbind(); } } @@ -2925,8 +3102,8 @@ BOOL LLViewerShaderMgr::loadShadersInterface() if (success) { gTwoTextureAddProgram.bind(); - gTwoTextureAddProgram.uniform1i("tex0", 0); - gTwoTextureAddProgram.uniform1i("tex1", 1); + gTwoTextureAddProgram.uniform1i(sTex0, 0); + gTwoTextureAddProgram.uniform1i(sTex1, 1); } } @@ -2941,7 +3118,7 @@ BOOL LLViewerShaderMgr::loadShadersInterface() if (success) { gOneTextureNoColorProgram.bind(); - gOneTextureNoColorProgram.uniform1i("tex0", 0); + gOneTextureNoColorProgram.uniform1i(sTex0, 0); } } @@ -2956,7 +3133,7 @@ BOOL LLViewerShaderMgr::loadShadersInterface() if (success) { gSolidColorProgram.bind(); - gSolidColorProgram.uniform1i("tex0", 0); + gSolidColorProgram.uniform1i(sTex0, 0); gSolidColorProgram.unbind(); } } @@ -3003,6 +3180,26 @@ BOOL LLViewerShaderMgr::loadShadersInterface() if (success) { + gDownsampleDepthProgram.mName = "DownsampleDepth Shader"; + gDownsampleDepthProgram.mShaderFiles.clear(); + gDownsampleDepthProgram.mShaderFiles.push_back(make_pair("interface/downsampleDepthV.glsl", GL_VERTEX_SHADER_ARB)); + gDownsampleDepthProgram.mShaderFiles.push_back(make_pair("interface/downsampleDepthF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDownsampleDepthProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; + success = gDownsampleDepthProgram.createShader(NULL, NULL); + } + + if (success) + { + gDownsampleDepthRectProgram.mName = "DownsampleDepthRect Shader"; + gDownsampleDepthRectProgram.mShaderFiles.clear(); + gDownsampleDepthRectProgram.mShaderFiles.push_back(make_pair("interface/downsampleDepthV.glsl", GL_VERTEX_SHADER_ARB)); + gDownsampleDepthRectProgram.mShaderFiles.push_back(make_pair("interface/downsampleDepthRectF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDownsampleDepthRectProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; + success = gDownsampleDepthRectProgram.createShader(NULL, NULL); + } + + if (success) + { gAlphaMaskProgram.mName = "Alpha Mask Shader"; gAlphaMaskProgram.mShaderFiles.clear(); gAlphaMaskProgram.mShaderFiles.push_back(make_pair("interface/alphamaskV.glsl", GL_VERTEX_SHADER_ARB)); @@ -3040,7 +3237,7 @@ BOOL LLViewerShaderMgr::loadShadersWindLight() gWLSkyProgram.mShaderFiles.push_back(make_pair("windlight/skyF.glsl", GL_FRAGMENT_SHADER_ARB)); gWLSkyProgram.mShaderLevel = mVertexShaderLevel[SHADER_WINDLIGHT]; gWLSkyProgram.mShaderGroup = LLGLSLShader::SG_SKY; - success = gWLSkyProgram.createShader(NULL, &mWLUniforms); + success = gWLSkyProgram.createShader(NULL, NULL); } if (success) @@ -3052,7 +3249,7 @@ BOOL LLViewerShaderMgr::loadShadersWindLight() gWLCloudProgram.mShaderFiles.push_back(make_pair("windlight/cloudsF.glsl", GL_FRAGMENT_SHADER_ARB)); gWLCloudProgram.mShaderLevel = mVertexShaderLevel[SHADER_WINDLIGHT]; gWLCloudProgram.mShaderGroup = LLGLSLShader::SG_SKY; - success = gWLCloudProgram.createShader(NULL, &mWLUniforms); + success = gWLCloudProgram.createShader(NULL, NULL); } return success; @@ -3167,3 +3364,4 @@ LLViewerShaderMgr::shader_iter LLViewerShaderMgr::endShaders() const { return mShaderList.end(); } + diff --git a/indra/newview/llviewershadermgr.h b/indra/newview/llviewershadermgr.h index 8c7de05062..3d89f8d20a 100755 --- a/indra/newview/llviewershadermgr.h +++ b/indra/newview/llviewershadermgr.h @@ -30,6 +30,8 @@ #include "llshadermgr.h" #include "llmaterial.h" +#define LL_DEFERRED_MULTI_LIGHT_COUNT 16 + class LLViewerShaderMgr: public LLShaderMgr { public: @@ -75,57 +77,6 @@ public: SHADER_COUNT }; - typedef enum - { - SHINY_ORIGIN = END_RESERVED_UNIFORMS - } eShinyUniforms; - - typedef enum - { - WATER_SCREENTEX = END_RESERVED_UNIFORMS, - WATER_SCREENDEPTH, - WATER_REFTEX, - WATER_EYEVEC, - WATER_TIME, - WATER_WAVE_DIR1, - WATER_WAVE_DIR2, - WATER_LIGHT_DIR, - WATER_SPECULAR, - WATER_SPECULAR_EXP, - WATER_FOGCOLOR, - WATER_FOGDENSITY, - WATER_REFSCALE, - WATER_WATERHEIGHT, - } eWaterUniforms; - - typedef enum - { - WL_CAMPOSLOCAL = END_RESERVED_UNIFORMS, - WL_WATERHEIGHT - } eWLUniforms; - - typedef enum - { - TERRAIN_DETAIL0 = END_RESERVED_UNIFORMS, - TERRAIN_DETAIL1, - TERRAIN_DETAIL2, - TERRAIN_DETAIL3, - TERRAIN_ALPHARAMP - } eTerrainUniforms; - - typedef enum - { - GLOW_DELTA = END_RESERVED_UNIFORMS - } eGlowUniforms; - - typedef enum - { - AVATAR_MATRIX = END_RESERVED_UNIFORMS, - AVATAR_WIND, - AVATAR_SINWAVE, - AVATAR_GRAVITY, - } eAvatarUniforms; - // simple model of forward iterator // http://www.sgi.com/tech/stl/ForwardIterator.html class shader_iter @@ -230,6 +181,8 @@ extern LLGLSLShader gSplatTextureRectProgram; extern LLGLSLShader gGlowCombineFXAAProgram; extern LLGLSLShader gDebugProgram; extern LLGLSLShader gClipProgram; +extern LLGLSLShader gDownsampleDepthProgram; +extern LLGLSLShader gDownsampleDepthRectProgram; //output tex0[tc0] + tex1[tc1] extern LLGLSLShader gTwoTextureAddProgram; @@ -238,6 +191,7 @@ extern LLGLSLShader gOneTextureNoColorProgram; //object shaders extern LLGLSLShader gObjectSimpleProgram; +extern LLGLSLShader gObjectSimpleImpostorProgram; extern LLGLSLShader gObjectPreviewProgram; extern LLGLSLShader gObjectSimpleAlphaMaskProgram; extern LLGLSLShader gObjectSimpleWaterProgram; @@ -322,9 +276,11 @@ extern LLGLSLShader gWLCloudProgram; extern LLGLSLShader gPostColorFilterProgram; extern LLGLSLShader gPostNightVisionProgram; + // Deferred rendering shaders extern LLGLSLShader gDeferredImpostorProgram; extern LLGLSLShader gDeferredWaterProgram; +extern LLGLSLShader gDeferredUnderWaterProgram; extern LLGLSLShader gDeferredDiffuseProgram; extern LLGLSLShader gDeferredDiffuseAlphaMaskProgram; extern LLGLSLShader gDeferredNonIndexedDiffuseAlphaMaskProgram; @@ -338,13 +294,14 @@ extern LLGLSLShader gDeferredTerrainProgram; extern LLGLSLShader gDeferredTreeProgram; extern LLGLSLShader gDeferredTreeShadowProgram; extern LLGLSLShader gDeferredLightProgram; -extern LLGLSLShader gDeferredMultiLightProgram; +extern LLGLSLShader gDeferredMultiLightProgram[LL_DEFERRED_MULTI_LIGHT_COUNT]; extern LLGLSLShader gDeferredSpotLightProgram; extern LLGLSLShader gDeferredMultiSpotLightProgram; extern LLGLSLShader gDeferredSunProgram; extern LLGLSLShader gDeferredBlurLightProgram; extern LLGLSLShader gDeferredAvatarProgram; extern LLGLSLShader gDeferredSoftenProgram; +extern LLGLSLShader gDeferredSoftenWaterProgram; extern LLGLSLShader gDeferredShadowProgram; extern LLGLSLShader gDeferredShadowCubeProgram; extern LLGLSLShader gDeferredShadowAlphaMaskProgram; @@ -357,7 +314,12 @@ extern LLGLSLShader gDeferredPostGammaCorrectProgram; extern LLGLSLShader gDeferredAvatarShadowProgram; extern LLGLSLShader gDeferredAttachmentShadowProgram; extern LLGLSLShader gDeferredAlphaProgram; +extern LLGLSLShader gDeferredAlphaImpostorProgram; extern LLGLSLShader gDeferredFullbrightProgram; +extern LLGLSLShader gDeferredFullbrightAlphaMaskProgram; +extern LLGLSLShader gDeferredAlphaWaterProgram; +extern LLGLSLShader gDeferredFullbrightWaterProgram; +extern LLGLSLShader gDeferredFullbrightAlphaMaskWaterProgram; extern LLGLSLShader gDeferredEmissiveProgram; extern LLGLSLShader gDeferredAvatarEyesProgram; extern LLGLSLShader gDeferredAvatarAlphaProgram; @@ -369,8 +331,7 @@ extern LLGLSLShader gDeferredSkinnedFullbrightShinyProgram; extern LLGLSLShader gDeferredSkinnedFullbrightProgram; extern LLGLSLShader gNormalMapGenProgram; - // Deferred materials shaders extern LLGLSLShader gDeferredMaterialProgram[LLMaterial::SHADER_COUNT*2]; - +extern LLGLSLShader gDeferredMaterialWaterProgram[LLMaterial::SHADER_COUNT*2]; #endif diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 6cc9f4ace1..84f66c359f 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1199,10 +1199,10 @@ void LLViewerFetchedTexture::dump() // ONLY called from LLViewerFetchedTextureList void LLViewerFetchedTexture::destroyTexture() { - //if(LLImageGL::sGlobalTextureMemoryInBytes < sMaxDesiredTextureMemInBytes)//not ready to release unused memory. - //{ - // return ; - //} + if(LLImageGL::sGlobalTextureMemoryInBytes < sMaxDesiredTextureMemInBytes * 0.95f)//not ready to release unused memory. + { + return ; + } if (mNeedsCreateTexture)//return if in the process of generating a new texture. { return ; @@ -1290,7 +1290,12 @@ void LLViewerFetchedTexture::addToCreateTexture() destroyRawImage(); return ; } - mRawImage->scale(w >> i, h >> i) ; + + { + //make a duplicate in case somebody else is using this raw image + mRawImage = mRawImage->duplicate(); + mRawImage->scale(w >> i, h >> i) ; + } } } } @@ -1521,7 +1526,7 @@ F32 LLViewerFetchedTexture::calcDecodePriority() else if (pixel_priority < 0.001f && !have_all_data) { // Not on screen but we might want some data - if (mBoostLevel > BOOST_HIGH) + if (mBoostLevel > BOOST_SELECTED) { // Always want high boosted images priority = 1.f; @@ -2669,7 +2674,11 @@ void LLViewerFetchedTexture::setCachedRawImage() --i ; } - mRawImage->scale(w >> i, h >> i) ; + { + //make a duplicate in case somebody else is using this raw image + mRawImage = mRawImage->duplicate(); + mRawImage->scale(w >> i, h >> i) ; + } } mCachedRawImage = mRawImage ; mRawDiscardLevel += i ; diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index c96f89017f..10101a4b9b 100755 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -101,6 +101,7 @@ public: INVALID_TEXTURE_TYPE }; + typedef std::vector<LLFace*> ll_face_list_t; typedef std::vector<LLVOVolume*> ll_volume_list_t; diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index d9f3548a29..2efe4665fa 100755 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -561,38 +561,62 @@ void LLViewerTextureList::addImageToList(LLViewerFetchedTexture *image) llassert_always(mInitialized) ; llassert(image); if (image->isInImageList()) - { - llerrs << "LLViewerTextureList::addImageToList - Image already in list" << llendl; + { // Flag is already set? + llwarns << "LLViewerTextureList::addImageToList - image " << image->getID() << " already in list" << llendl; } + else + { if((mImageList.insert(image)).second != true) { - llerrs << "Error happens when insert image to mImageList!" << llendl ; + llwarns << "Error happens when insert image " << image->getID() << " into mImageList!" << llendl ; } - image->setInImageList(TRUE) ; } +} void LLViewerTextureList::removeImageFromList(LLViewerFetchedTexture *image) { assert_main_thread(); llassert_always(mInitialized) ; llassert(image); - if (!image->isInImageList()) + + S32 count = 0; + if (image->isInImageList()) { - llinfos << "RefCount: " << image->getNumRefs() << llendl ; + count = mImageList.erase(image) ; + if(count != 1) + { + llinfos << "Image " << image->getID() + << " had mInImageList set but mImageList.erase() returned " << count + << llendl; + } + } + else + { // Something is wrong, image is expected in list or callers should check first + llinfos << "Calling removeImageFromList() for " << image->getID() + << " but doesn't have mInImageList set" + << " ref count is " << image->getNumRefs() + << llendl; uuid_map_t::iterator iter = mUUIDMap.find(image->getID()); - if(iter == mUUIDMap.end() || iter->second != image) + if(iter == mUUIDMap.end()) { - llinfos << "Image is not in mUUIDMap!" << llendl ; + llinfos << "Image " << image->getID() << " is also not in mUUIDMap!" << llendl ; } - llerrs << "LLViewerTextureList::removeImageFromList - Image not in list" << llendl; + else if (iter->second != image) + { + llinfos << "Image " << image->getID() << " was in mUUIDMap but with different pointer" << llendl ; } - - S32 count = mImageList.erase(image) ; - if(count != 1) + else { - llinfos << image->getID() << llendl ; - llerrs << "Error happens when remove image from mImageList: " << count << llendl ; + llinfos << "Image " << image->getID() << " was in mUUIDMap with same pointer" << llendl ; + } + count = mImageList.erase(image) ; + if(count != 0) + { // it was in the list already? + llwarns << "Image " << image->getID() + << " had mInImageList false but mImageList.erase() returned " << count + << llendl; + } } image->setInImageList(FALSE) ; @@ -602,15 +626,15 @@ void LLViewerTextureList::addImage(LLViewerFetchedTexture *new_image) { if (!new_image) { - llwarning("No image to add to image list", 0); return; } + llassert(new_image); LLUUID image_id = new_image->getID(); LLViewerFetchedTexture *image = findImage(image_id); if (image) { - llwarns << "Image with ID " << image_id << " already in list" << llendl; + llinfos << "Image with ID " << image_id << " already in list" << llendl; } sNumImages++; @@ -1237,7 +1261,7 @@ S32 LLViewerTextureList::getMinVideoRamSetting() //static // Returns max setting for TextureMemory (in MB) -S32 LLViewerTextureList::getMaxVideoRamSetting(bool get_recommended) +S32 LLViewerTextureList::getMaxVideoRamSetting(bool get_recommended, float mem_multiplier) { S32 max_texmem; if (gGLManager.mVRAM != 0) @@ -1281,7 +1305,10 @@ S32 LLViewerTextureList::getMaxVideoRamSetting(bool get_recommended) max_texmem = llmin(max_texmem, (S32)(system_ram/2)); else max_texmem = llmin(max_texmem, (S32)(system_ram)); - + + // limit the texture memory to a multiple of the default if we've found some cards to behave poorly otherwise + max_texmem = llmin(max_texmem, (S32) (mem_multiplier * (F32) max_texmem)); + max_texmem = llclamp(max_texmem, getMinVideoRamSetting(), MAX_VIDEO_RAM_IN_MEGA_BYTES); return max_texmem; @@ -1294,7 +1321,7 @@ void LLViewerTextureList::updateMaxResidentTexMem(S32 mem) // Initialize the image pipeline VRAM settings S32 cur_mem = gSavedSettings.getS32("TextureMemory"); F32 mem_multiplier = gSavedSettings.getF32("RenderTextureMemoryMultiple"); - S32 default_mem = getMaxVideoRamSetting(true); // recommended default + S32 default_mem = getMaxVideoRamSetting(true, mem_multiplier); // recommended default if (mem == 0) { mem = cur_mem > 0 ? cur_mem : default_mem; @@ -1304,10 +1331,7 @@ void LLViewerTextureList::updateMaxResidentTexMem(S32 mem) mem = default_mem; } - // limit the texture memory to a multiple of the default if we've found some cards to behave poorly otherwise - mem = llmin(mem, (S32) (mem_multiplier * (F32) default_mem)); - - mem = llclamp(mem, getMinVideoRamSetting(), getMaxVideoRamSetting()); + mem = llclamp(mem, getMinVideoRamSetting(), getMaxVideoRamSetting(false, mem_multiplier)); if (mem != cur_mem) { gSavedSettings.setS32("TextureMemory", mem); diff --git a/indra/newview/llviewertexturelist.h b/indra/newview/llviewertexturelist.h index 136042620d..26dc6dcbe2 100755 --- a/indra/newview/llviewertexturelist.h +++ b/indra/newview/llviewertexturelist.h @@ -114,7 +114,7 @@ public: void setDebugFetching(LLViewerFetchedTexture* tex, S32 debug_level); static S32 getMinVideoRamSetting(); - static S32 getMaxVideoRamSetting(bool get_recommended = false); + static S32 getMaxVideoRamSetting(bool get_recommended, float mem_multiplier); private: void updateImagesDecodePriorities(); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 65a906d3c0..bf11bce3da 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -151,6 +151,7 @@ #include "lltexturecache.h" #include "lltexturefetch.h" #include "lltextureview.h" +#include "lltoast.h" #include "lltool.h" #include "lltoolbarview.h" #include "lltoolcomp.h" @@ -229,7 +230,9 @@ LLFrameTimer gAwayTriggerTimer; BOOL gShowOverlayTitle = FALSE; LLViewerObject* gDebugRaycastObject = NULL; +LLVOPartGroup* gDebugRaycastParticle = NULL; LLVector4a gDebugRaycastIntersection; +LLVector4a gDebugRaycastParticleIntersection; LLVector2 gDebugRaycastTexCoord; LLVector4a gDebugRaycastNormal; LLVector4a gDebugRaycastTangent; @@ -331,9 +334,10 @@ public: mTextColor = LLColor4( 0.86f, 0.86f, 0.86f, 1.f ); // Draw stuff growing up from right lower corner of screen - U32 xpos = mWindow->getWorldViewWidthScaled() - 350; - U32 ypos = 64; - const U32 y_inc = 20; + S32 xpos = mWindow->getWorldViewWidthScaled() - 400; + xpos = llmax(xpos, 0); + S32 ypos = 64; + const S32 y_inc = 20; clearText(); @@ -633,6 +637,42 @@ public: LLVertexBuffer::sSetCount = LLImageGL::sUniqueCount = gPipeline.mNumVisibleNodes = LLPipeline::sVisibleLightCount = 0; } + if (gSavedSettings.getBOOL("DebugShowAvatarRenderInfo")) + { + std::map<std::string, LLVOAvatar*> sorted_avs; + + std::vector<LLCharacter*>::iterator sort_iter = LLCharacter::sInstances.begin(); + while (sort_iter != LLCharacter::sInstances.end()) + { + LLVOAvatar* avatar = dynamic_cast<LLVOAvatar*>(*sort_iter); + if (avatar && + !avatar->isDead()) // Not dead yet + { + // Stuff into a sorted map so the display is ordered + sorted_avs[avatar->getFullname()] = avatar; + } + sort_iter++; + } + + std::string trunc_name; + std::map<std::string, LLVOAvatar*>::reverse_iterator av_iter = sorted_avs.rbegin(); // Put "A" at the top + while (av_iter != sorted_avs.rend()) + { + LLVOAvatar* avatar = av_iter->second; + + avatar->calculateUpdateRenderCost(); // Make sure the numbers are up-to-date + + trunc_name = utf8str_truncate(avatar->getFullname(), 16); + addText(xpos, ypos, llformat("%s : rez %d, weight %d, bytes %d area %.2f", + trunc_name.c_str(), + avatar->getRezzedStatus(), + avatar->getVisualComplexity(), + avatar->getAttachmentGeometryBytes(), + avatar->getAttachmentSurfaceArea())); + ypos += y_inc; + av_iter++; + } + } if (gSavedSettings.getBOOL("DebugShowRenderMatrices")) { addText(xpos, ypos, llformat("%.4f .%4f %.4f %.4f", gGLProjection[12], gGLProjection[13], gGLProjection[14], gGLProjection[15])); @@ -1811,7 +1851,6 @@ void LLViewerWindow::initBase() gFloaterView = main_view->getChild<LLFloaterView>("Floater View"); gFloaterView->setFloaterSnapView(main_view->getChild<LLView>("floater_snap_region")->getHandle()); gSnapshotFloaterView = main_view->getChild<LLSnapshotFloaterView>("Snapshot Floater View"); - // Console llassert( !gConsole ); @@ -1997,6 +2036,9 @@ void LLViewerWindow::shutdownViews() } llinfos << "Global views cleaned." << llendl ; + LLNotificationsUI::LLToast::cleanupToasts(); + llinfos << "Leftover toast cleaned up." << llendl; + // DEV-40930: Clear sModalStack. Otherwise, any LLModalDialog left open // will crump with LL_ERRS. LLModalDialog::shutdownModals(); @@ -2844,6 +2886,8 @@ void LLViewerWindow::updateUI() &gDebugRaycastTangent, &gDebugRaycastStart, &gDebugRaycastEnd); + + gDebugRaycastParticle = gPipeline.lineSegmentIntersectParticle(gDebugRaycastStart, gDebugRaycastEnd, &gDebugRaycastParticleIntersection, NULL); } updateMouseDelta(); @@ -3664,7 +3708,7 @@ void LLViewerWindow::pickAsync(S32 x, S32 y_from_bot, MASK mask, void (*callback pick_transparent = TRUE; } - LLPickInfo pick_info(LLCoordGL(x, y_from_bot), mask, pick_transparent, TRUE, callback); + LLPickInfo pick_info(LLCoordGL(x, y_from_bot), mask, pick_transparent, FALSE, TRUE, callback); schedulePick(pick_info); } @@ -3720,7 +3764,7 @@ void LLViewerWindow::returnEmptyPicks() } // Performs the GL object/land pick. -LLPickInfo LLViewerWindow::pickImmediate(S32 x, S32 y_from_bot, BOOL pick_transparent) +LLPickInfo LLViewerWindow::pickImmediate(S32 x, S32 y_from_bot, BOOL pick_transparent, BOOL pick_particle) { BOOL in_build_mode = LLFloaterReg::instanceVisible("build"); if (in_build_mode || LLDrawPoolAlpha::sShowDebugAlpha) @@ -3729,10 +3773,10 @@ LLPickInfo LLViewerWindow::pickImmediate(S32 x, S32 y_from_bot, BOOL pick_trans // "Show Debug Alpha" means no object actually transparent pick_transparent = TRUE; } - + // shortcut queueing in mPicks and just update mLastPick in place MASK key_mask = gKeyboard->currentMask(TRUE); - mLastPick = LLPickInfo(LLCoordGL(x, y_from_bot), key_mask, pick_transparent, TRUE, NULL); + mLastPick = LLPickInfo(LLCoordGL(x, y_from_bot), key_mask, pick_transparent, pick_particle, TRUE, NULL); mLastPick.fetchResults(); return mLastPick; @@ -4291,7 +4335,8 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei F32 scale_factor = 1.0f ; if (!keep_window_aspect || (image_width > window_width) || (image_height > window_height)) { - if ((image_width > window_width || image_height > window_height) && LLPipeline::sRenderDeferred && !show_ui) + if ((image_width <= gGLManager.mGLMaxTextureSize && image_height <= gGLManager.mGLMaxTextureSize) && + (image_width > window_width || image_height > window_height) && LLPipeline::sRenderDeferred && !show_ui) { if (scratch_space.allocate(image_width, image_height, GL_RGBA, true, true)) { @@ -4306,6 +4351,8 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei snapshot_height = image_height; reset_deferred = true; mWorldViewRectRaw.set(0, image_height, image_width, 0); + LLViewerCamera::getInstance()->setViewHeightInPixels( mWorldViewRectRaw.getHeight() ); + LLViewerCamera::getInstance()->setAspect( getWorldViewAspectRatio() ); scratch_space.bindTarget(); } else @@ -4515,6 +4562,8 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei if (reset_deferred) { mWorldViewRectRaw = window_rect; + LLViewerCamera::getInstance()->setViewHeightInPixels( mWorldViewRectRaw.getHeight() ); + LLViewerCamera::getInstance()->setAspect( getWorldViewAspectRatio() ); scratch_space.flush(); scratch_space.release(); gPipeline.allocateScreenBuffer(original_width, original_height); @@ -5128,13 +5177,15 @@ LLPickInfo::LLPickInfo() mTangent(), mBinormal(), mHUDIcon(NULL), - mPickTransparent(FALSE) + mPickTransparent(FALSE), + mPickParticle(FALSE) { } LLPickInfo::LLPickInfo(const LLCoordGL& mouse_pos, MASK keyboard_mask, BOOL pick_transparent, + BOOL pick_particle, BOOL pick_uv_coords, void (*pick_callback)(const LLPickInfo& pick_info)) : mMousePt(mouse_pos), @@ -5150,7 +5201,8 @@ LLPickInfo::LLPickInfo(const LLCoordGL& mouse_pos, mTangent(), mBinormal(), mHUDIcon(NULL), - mPickTransparent(pick_transparent) + mPickTransparent(pick_transparent), + mPickParticle(pick_particle) { } @@ -5168,6 +5220,10 @@ void LLPickInfo::fetchResults() LLVector4a origin; origin.load3(LLViewerCamera::getInstance()->getOrigin().mV); F32 icon_dist = 0.f; + LLVector4a start; + LLVector4a end; + LLVector4a particle_end; + if (hit_icon) { LLVector4a delta; @@ -5177,14 +5233,24 @@ void LLPickInfo::fetchResults() LLViewerObject* hit_object = gViewerWindow->cursorIntersect(mMousePt.mX, mMousePt.mY, 512.f, NULL, -1, mPickTransparent, &face_hit, - &intersection, &uv, &normal, &tangent); + &intersection, &uv, &normal, &tangent, &start, &end); mPickPt = mMousePt; U32 te_offset = face_hit > -1 ? face_hit : 0; - //unproject relative clicked coordinate from window coordinate using GL - + if (mPickParticle) + { //get the end point of line segement to use for particle raycast + if (hit_object) + { + particle_end = intersection; + } + else + { + particle_end = end; + } + } + LLViewerObject* objectp = hit_object; @@ -5199,6 +5265,7 @@ void LLPickInfo::fetchResults() mHUDIcon = hit_icon; mPickType = PICK_ICON; mPosGlobal = mHUDIcon->getPositionGlobal(); + } else if (objectp) { @@ -5248,6 +5315,18 @@ void LLPickInfo::fetchResults() } } + if (mPickParticle) + { //search for closest particle to click origin out to intersection point + S32 part_face = -1; + + LLVOPartGroup* group = gPipeline.lineSegmentIntersectParticle(start, particle_end, NULL, &part_face); + if (group) + { + mParticleOwnerID = group->getPartOwner(part_face); + mParticleSourceID = group->getPartSource(part_face); + } + } + if (mPickCallback) { mPickCallback(*this); diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index 89f6e3bc26..c16b80b214 100755 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -65,6 +65,7 @@ class LLWindow; class LLRootView; class LLWindowListener; class LLViewerWindowListener; +class LLVOPartGroup; class LLPopupView; #define PICK_HALF_WIDTH 5 @@ -87,7 +88,8 @@ public: LLPickInfo(); LLPickInfo(const LLCoordGL& mouse_pos, MASK keyboard_mask, - BOOL pick_transparent, + BOOL pick_transparent, + BOOL pick_particle, BOOL pick_surface_info, void (*pick_callback)(const LLPickInfo& pick_info)); @@ -108,6 +110,8 @@ public: LLVector3d mPosGlobal; LLVector3 mObjectOffset; LLUUID mObjectID; + LLUUID mParticleOwnerID; + LLUUID mParticleSourceID; S32 mObjectFace; LLHUDIcon* mHUDIcon; LLVector3 mIntersection; @@ -118,6 +122,7 @@ public: LLVector4 mTangent; LLVector3 mBinormal; BOOL mPickTransparent; + BOOL mPickParticle; void getSurfaceInfo(); private: @@ -356,7 +361,7 @@ public: void returnEmptyPicks(); void pickAsync(S32 x, S32 y_from_bot, MASK mask, void (*callback)(const LLPickInfo& pick_info), BOOL pick_transparent = FALSE); - LLPickInfo pickImmediate(S32 x, S32 y, BOOL pick_transparent); + LLPickInfo pickImmediate(S32 x, S32 y, BOOL pick_transparent, BOOL pick_particle = FALSE); LLHUDIcon* cursorIntersectIcon(S32 mouse_x, S32 mouse_y, F32 depth, LLVector4a* intersection); @@ -501,6 +506,8 @@ extern LLFrameTimer gAwayTriggerTimer; // how long the avatar has been away extern LLViewerObject* gDebugRaycastObject; extern LLVector4a gDebugRaycastIntersection; +extern LLVOPartGroup* gDebugRaycastParticle; +extern LLVector4a gDebugRaycastParticleIntersection; extern LLVector2 gDebugRaycastTexCoord; extern LLVector4a gDebugRaycastNormal; extern LLVector4a gDebugRaycastTangent; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 1a050800b4..d449efb7e7 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -58,6 +58,7 @@ #include "llhudmanager.h" #include "llhudnametag.h" #include "llhudtext.h" // for mText/mDebugText +#include "llimview.h" #include "llinitparam.h" #include "llkeyframefallmotion.h" #include "llkeyframestandmotion.h" @@ -666,8 +667,9 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, LLAvatarAppearance(&gAgentWearables), LLViewerObject(id, pcode, regionp), mSpecialRenderMode(0), - mAttachmentGeometryBytes(0), - mAttachmentSurfaceArea(0.f), + mAttachmentGeometryBytes(-1), + mAttachmentSurfaceArea(-1.f), + mReportedVisualComplexity(-1), mTurning(FALSE), mLastSkeletonSerialNum( 0 ), mIsSitting(FALSE), @@ -701,6 +703,8 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mFullyLoaded(FALSE), mPreviousFullyLoaded(FALSE), mFullyLoadedInitialized(FALSE), + mVisualComplexity(0), + mVisualComplexityStale(TRUE), mLoadedCallbacksPaused(FALSE), mHasPelvisOffset( FALSE ), mRenderUnloadedAvatar(LLCachedControl<bool>(gSavedSettings, "RenderUnloadedAvatar")), @@ -769,6 +773,13 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mLastPelvisToFoot = 0.0f; mPelvisFixup = 0.0f; mLastPelvisFixup = 0.0f; + + mCachedVisualMute = !isSelf(); + mCachedVisualMuteUpdateTime = LLFrameTimer::getTotalSeconds() + 5.0; + mVisuallyMuteSetting = VISUAL_MUTE_NOT_SET; + + F32 color_value = (F32) (getID().mData[0]); + mMutedAVColor = calcMutedAVColor(color_value, 0, 256); } std::string LLVOAvatar::avString() const @@ -2972,16 +2983,94 @@ void LLVOAvatar::slamPosition() mRoot->updateWorldMatrixChildren(); } -bool LLVOAvatar::isVisuallyMuted() const +bool LLVOAvatar::isVisuallyMuted() { - static LLCachedControl<U32> max_attachment_bytes(gSavedSettings, "RenderAutoMuteByteLimit"); - static LLCachedControl<F32> max_attachment_area(gSavedSettings, "RenderAutoMuteSurfaceAreaLimit"); - - return LLMuteList::getInstance()->isMuted(getID()) - || (mAttachmentGeometryBytes > max_attachment_bytes && max_attachment_bytes > 0) - || (mAttachmentSurfaceArea > max_attachment_area && max_attachment_area > 0.f); + bool muted = false; + + if (!isSelf()) + { + static LLCachedControl<U32> render_auto_mute_functions(gSavedSettings, "RenderAutoMuteFunctions"); + if (render_auto_mute_functions) // Hacky debug switch for developing feature + { + // Priority order (highest priority first) + // * own avatar is never visually muted + // * if on the "always draw normally" list, draw them normally + // * if on the "always visually mute" list, mute them + // * draw them normally if they meet the following criteria: + // - within the closest N avatars OR on friends list OR in an IM chat + // - AND aren't over the thresholds + // * otherwise visually mute all other avatars + + static LLCachedControl<U32> max_attachment_bytes(gSavedSettings, "RenderAutoMuteByteLimit"); + static LLCachedControl<F32> max_attachment_area(gSavedSettings, "RenderAutoMuteSurfaceAreaLimit"); + static LLCachedControl<U32> max_render_cost(gSavedSettings, "RenderAutoMuteRenderWeightLimit"); + + if (mVisuallyMuteSetting == ALWAYS_VISUAL_MUTE) + { // Always want to see this AV as an impostor + muted = true; + } + else if (mVisuallyMuteSetting == NEVER_VISUAL_MUTE) + { // Never show as impostor + muted = false; + } + else + { + F64 now = LLFrameTimer::getTotalSeconds(); + + if (now < mCachedVisualMuteUpdateTime) + { // Use cached mute value + muted = mCachedVisualMute; + } + else + { // Determine if visually muted or not + + U32 max_cost = (U32) (max_render_cost*(LLVOAvatar::sLODFactor+0.5)); + + muted = LLMuteList::getInstance()->isMuted(getID()) || + (mAttachmentGeometryBytes > max_attachment_bytes && max_attachment_bytes > 0) || + (mAttachmentSurfaceArea > max_attachment_area && max_attachment_area > 0.f) || + (mVisualComplexity > max_cost && max_render_cost > 0); + + // Could be part of the grand || collection above, but yanked out to make the logic visible + if (!muted) + { + if (sMaxVisible > 0) + { // They are above the visibilty rank - mute them + muted = (mVisibilityRank > sMaxVisible); + } + + // Always draw friends or those in IMs. Needs UI? + if ((render_auto_mute_functions & 0x02) && + (muted || sMaxVisible == 0)) // Don't mute friends or IMs + { + muted = !(LLAvatarTracker::instance().isBuddy(getID())); + if (muted) + { // Not a friend, so they are muted ... are they in an IM? + LLUUID session_id = gIMMgr->computeSessionID(IM_NOTHING_SPECIAL,getID()); + muted = !gIMMgr->hasSession(session_id); + } + } + } + + // Save visual mute state and set interval for updating + const F64 SECONDS_BETWEEN_RENDER_AUTO_MUTE_UPDATES = 1.5; + mCachedVisualMuteUpdateTime = now + SECONDS_BETWEEN_RENDER_AUTO_MUTE_UPDATES; + mCachedVisualMute = muted; + } + } + } + } + + return muted; } +void LLVOAvatar::forceUpdateVisualMuteSettings() +{ + // Set the cache time so it's updated ASAP + mCachedVisualMuteUpdateTime = LLFrameTimer::getTotalSeconds() - 1.0; +} + + //------------------------------------------------------------------------ // updateCharacter() // called on both your avatar and other avatars @@ -3077,7 +3166,8 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) // the rest should only be done occasionally for far away avatars //-------------------------------------------------------------------- - if (visible && (!isSelf() || isVisuallyMuted()) && !mIsDummy && sUseImpostors && !mNeedsAnimUpdate && !sFreezeCounter) + bool visually_muted = isVisuallyMuted(); + if (visible && (!isSelf() || visually_muted) && !mIsDummy && sUseImpostors && !mNeedsAnimUpdate && !sFreezeCounter) { const LLVector4a* ext = mDrawable->getSpatialExtents(); LLVector4a size; @@ -3086,8 +3176,8 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) F32 impostor_area = 256.f*512.f*(8.125f - LLVOAvatar::sLODFactor*8.f); - if (isVisuallyMuted()) - { // muted avatars update at 16 hz + if (visually_muted) + { // visually muted avatars update at 16 hz mUpdatePeriod = 16; } else if (mVisibilityRank <= LLVOAvatar::sMaxVisible || @@ -3725,11 +3815,11 @@ U32 LLVOAvatar::renderSkinned(EAvatarRenderPass pass) { //LOD changed or new mesh created, allocate new vertex buffer if needed if (needs_rebuild || mDirtyMesh >= 2 || mVisibilityRank <= 4) { - updateMeshData(); + updateMeshData(); mDirtyMesh = 0; - mNeedsSkin = TRUE; - mDrawable->clearState(LLDrawable::REBUILD_GEOMETRY); - } + mNeedsSkin = TRUE; + mDrawable->clearState(LLDrawable::REBUILD_GEOMETRY); + } } if (LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_AVATAR) <= 0) @@ -3887,9 +3977,11 @@ U32 LLVOAvatar::renderSkinned(EAvatarRenderPass pass) BOOL first_pass = TRUE; if (!LLDrawPoolAvatar::sSkipOpaque) { + bool visually_muted = isVisuallyMuted(); + if (!isSelf() || gAgent.needsRenderHead() || LLPipeline::sShadowRender) { - if (isTextureVisible(TEX_HEAD_BAKED) || mIsDummy) + if (isTextureVisible(TEX_HEAD_BAKED) || mIsDummy || visually_muted) { LLViewerJoint* head_mesh = getViewerJoint(MESH_ID_HEAD); if (head_mesh) @@ -3899,7 +3991,7 @@ U32 LLVOAvatar::renderSkinned(EAvatarRenderPass pass) first_pass = FALSE; } } - if (isTextureVisible(TEX_UPPER_BAKED) || mIsDummy) + if (isTextureVisible(TEX_UPPER_BAKED) || mIsDummy || visually_muted) { LLViewerJoint* upper_mesh = getViewerJoint(MESH_ID_UPPER_BODY); if (upper_mesh) @@ -3909,7 +4001,7 @@ U32 LLVOAvatar::renderSkinned(EAvatarRenderPass pass) first_pass = FALSE; } - if (isTextureVisible(TEX_LOWER_BAKED) || mIsDummy) + if (isTextureVisible(TEX_LOWER_BAKED) || mIsDummy || visually_muted) { LLViewerJoint* lower_mesh = getViewerJoint(MESH_ID_LOWER_BODY); if (lower_mesh) @@ -5481,6 +5573,8 @@ const LLViewerJointAttachment *LLVOAvatar::attachObject(LLViewerObject *viewer_o return 0; } + mVisualComplexityStale = TRUE; + if (viewer_object->isSelected()) { LLSelectMgr::getInstance()->updateSelectionCenter(); @@ -5628,6 +5722,7 @@ BOOL LLVOAvatar::detachObject(LLViewerObject *viewer_object) if (attachment->isObjectAttached(viewer_object)) { + mVisualComplexityStale = TRUE; cleanupAttachedMesh( viewer_object ); attachment->removeObject(viewer_object); lldebugs << "Detaching object " << viewer_object->mID << " from " << attachment->getName() << llendl; @@ -7734,9 +7829,9 @@ void LLVOAvatar::updateImpostors() LLCharacter::sAllowInstancesChange = TRUE ; } -BOOL LLVOAvatar::isImpostor() const +BOOL LLVOAvatar::isImpostor() { - return (isVisuallyMuted() || (sUseImpostors && mUpdatePeriod >= IMPOSTOR_PERIOD)) ? TRUE : FALSE; + return sUseImpostors && (isVisuallyMuted() || (mUpdatePeriod >= IMPOSTOR_PERIOD)) ? TRUE : FALSE; } @@ -7779,135 +7874,181 @@ void LLVOAvatar::getImpostorValues(LLVector4a* extents, LLVector3& angle, F32& d angle.mV[2] = da; } + void LLVOAvatar::idleUpdateRenderCost() { - static const U32 ARC_BODY_PART_COST = 200; + static LLCachedControl<U32> max_render_cost(gSavedSettings, "RenderAutoMuteRenderWeightLimit"); static const U32 ARC_LIMIT = 20000; - static std::set<LLUUID> all_textures; - if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_ATTACHMENT_BYTES)) { //set debug text to attachment geometry bytes here so render cost will override setDebugText(llformat("%.1f KB, %.2f m^2", mAttachmentGeometryBytes/1024.f, mAttachmentSurfaceArea)); } - if (!gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHAME)) + if (!gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHAME) && max_render_cost == 0) { return; } - U32 cost = 0; - LLVOVolume::texture_cost_t textures; + calculateUpdateRenderCost(); // Update mVisualComplexity if needed + + if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHAME)) + { + std::string viz_string = LLVOAvatar::rezStatusToString(getRezzedStatus()); + setDebugText(llformat("%s %d", viz_string.c_str(), mVisualComplexity)); + F32 green = 1.f-llclamp(((F32) mVisualComplexity-(F32)ARC_LIMIT)/(F32)ARC_LIMIT, 0.f, 1.f); + F32 red = llmin((F32) mVisualComplexity/(F32)ARC_LIMIT, 1.f); + mText->setColor(LLColor4(red,green,0,1)); + } +} - for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++) + +// Calculations for mVisualComplexity value +void LLVOAvatar::calculateUpdateRenderCost() +{ + static const U32 ARC_BODY_PART_COST = 200; + + // Diagnostic list of all textures on our avatar + static std::set<LLUUID> all_textures; + + if (mVisualComplexityStale) { - const LLAvatarAppearanceDictionary::BakedEntry *baked_dict = LLAvatarAppearanceDictionary::getInstance()->getBakedTexture((EBakedTextureIndex)baked_index); - ETextureIndex tex_index = baked_dict->mTextureIndex; - if ((tex_index != TEX_SKIRT_BAKED) || (isWearingWearableType(LLWearableType::WT_SKIRT))) + mVisualComplexityStale = FALSE; + U32 cost = 0; + LLVOVolume::texture_cost_t textures; + + for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++) { - if (isTextureVisible(tex_index)) + const LLAvatarAppearanceDictionary::BakedEntry *baked_dict = LLAvatarAppearanceDictionary::getInstance()->getBakedTexture((EBakedTextureIndex)baked_index); + ETextureIndex tex_index = baked_dict->mTextureIndex; + if ((tex_index != TEX_SKIRT_BAKED) || (isWearingWearableType(LLWearableType::WT_SKIRT))) { - cost +=ARC_BODY_PART_COST; + if (isTextureVisible(tex_index)) + { + cost +=ARC_BODY_PART_COST; + } } } - } - for (attachment_map_t::const_iterator iter = mAttachmentPoints.begin(); - iter != mAttachmentPoints.end(); - ++iter) - { - LLViewerJointAttachment* attachment = iter->second; - for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin(); - attachment_iter != attachment->mAttachedObjects.end(); - ++attachment_iter) + for (attachment_map_t::const_iterator iter = mAttachmentPoints.begin(); + iter != mAttachmentPoints.end(); + ++iter) { - const LLViewerObject* attached_object = (*attachment_iter); - if (attached_object && !attached_object->isHUDAttachment()) + LLViewerJointAttachment* attachment = iter->second; + for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin(); + attachment_iter != attachment->mAttachedObjects.end(); + ++attachment_iter) { - textures.clear(); - const LLDrawable* drawable = attached_object->mDrawable; - if (drawable) + const LLViewerObject* attached_object = (*attachment_iter); + if (attached_object && !attached_object->isHUDAttachment()) { - const LLVOVolume* volume = drawable->getVOVolume(); - if (volume) + textures.clear(); + const LLDrawable* drawable = attached_object->mDrawable; + if (drawable) { - 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) + const LLVOVolume* volume = drawable->getVOVolume(); + if (volume) { - LLViewerObject* child_obj = *child_iter; - LLVOVolume *child = dynamic_cast<LLVOVolume*>( child_obj ); - if (child) + 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) { - cost += child->getRenderCost(textures); + LLViewerObject* child_obj = *child_iter; + LLVOVolume *child = dynamic_cast<LLVOVolume*>( child_obj ); + if (child) + { + cost += child->getRenderCost(textures); + } } - } - for (LLVOVolume::texture_cost_t::iterator iter = textures.begin(); iter != textures.end(); ++iter) - { - // add the cost of each individual texture in the linkset - cost += iter->second; + for (LLVOVolume::texture_cost_t::iterator iter = textures.begin(); iter != textures.end(); ++iter) + { + // add the cost of each individual texture in the linkset + cost += iter->second; + } } } } } - } - - } - + } - // Diagnostic output to identify all avatar-related textures. - // Does not affect rendering cost calculation. - // Could be wrapped in a debug option if output becomes problematic. - if (isSelf()) - { - // print any attachment textures we didn't already know about. - for (LLVOVolume::texture_cost_t::iterator it = textures.begin(); it != textures.end(); ++it) + // Diagnostic output to identify all avatar-related textures. + // Does not affect rendering cost calculation. + // Could be wrapped in a debug option if output becomes problematic. + if (isSelf()) { - LLUUID image_id = it->first; - if( image_id.isNull() || image_id == IMG_DEFAULT || image_id == IMG_DEFAULT_AVATAR) - continue; - if (all_textures.find(image_id) == all_textures.end()) + // print any attachment textures we didn't already know about. + for (LLVOVolume::texture_cost_t::iterator it = textures.begin(); it != textures.end(); ++it) { - // attachment texture not previously seen. - llinfos << "attachment_texture: " << image_id.asString() << llendl; - all_textures.insert(image_id); + LLUUID image_id = it->first; + if( image_id.isNull() || image_id == IMG_DEFAULT || image_id == IMG_DEFAULT_AVATAR) + continue; + if (all_textures.find(image_id) == all_textures.end()) + { + // attachment texture not previously seen. + llinfos << "attachment_texture: " << image_id.asString() << llendl; + all_textures.insert(image_id); + } } - } - // print any avatar textures we didn't already know about - for (LLAvatarAppearanceDictionary::Textures::const_iterator iter = LLAvatarAppearanceDictionary::getInstance()->getTextures().begin(); + // print any avatar textures we didn't already know about + for (LLAvatarAppearanceDictionary::Textures::const_iterator iter = LLAvatarAppearanceDictionary::getInstance()->getTextures().begin(); iter != LLAvatarAppearanceDictionary::getInstance()->getTextures().end(); - ++iter) - { - const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = iter->second; - // TODO: MULTI-WEARABLE: handle multiple textures for self - const LLViewerTexture* te_image = getImage(iter->first,0); - if (!te_image) - continue; - LLUUID image_id = te_image->getID(); - if( image_id.isNull() || image_id == IMG_DEFAULT || image_id == IMG_DEFAULT_AVATAR) - continue; - if (all_textures.find(image_id) == all_textures.end()) + ++iter) { - llinfos << "local_texture: " << texture_dict->mName << ": " << image_id << llendl; - all_textures.insert(image_id); + const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = iter->second; + // TODO: MULTI-WEARABLE: handle multiple textures for self + const LLViewerTexture* te_image = getImage(iter->first,0); + if (!te_image) + continue; + LLUUID image_id = te_image->getID(); + if( image_id.isNull() || image_id == IMG_DEFAULT || image_id == IMG_DEFAULT_AVATAR) + continue; + if (all_textures.find(image_id) == all_textures.end()) + { + llinfos << "local_texture: " << texture_dict->mName << ": " << image_id << llendl; + all_textures.insert(image_id); + } } } + + mVisualComplexity = cost; } +} - - std::string viz_string = LLVOAvatar::rezStatusToString(getRezzedStatus()); - setDebugText(llformat("%s %d", viz_string.c_str(), cost)); - mVisualComplexity = cost; - F32 green = 1.f-llclamp(((F32) cost-(F32)ARC_LIMIT)/(F32)ARC_LIMIT, 0.f, 1.f); - F32 red = llmin((F32) cost/(F32)ARC_LIMIT, 1.f); - mText->setColor(LLColor4(red,green,0,1)); + +// static +LLColor4 LLVOAvatar::calcMutedAVColor(F32 value, S32 range_low, S32 range_high) +{ + F32 clamped_value = llmin(value, (F32) range_high); + clamped_value = llmax(value, (F32) range_low); + F32 spectrum = (clamped_value / range_high); // spectrum is between 0 and 1.f + + // Array of colors. These are arranged so only one RGB color changes between each step, + // and it loops back to red so there is an even distribution. It is not a heat map + const S32 NUM_SPECTRUM_COLORS = 7; + static LLColor4 * spectrum_color[NUM_SPECTRUM_COLORS] = { &LLColor4::red, &LLColor4::magenta, &LLColor4::blue, &LLColor4::cyan, &LLColor4::green, &LLColor4::yellow, &LLColor4::red }; + + spectrum = spectrum * (NUM_SPECTRUM_COLORS - 1); // Scale to range of number of colors + S32 spectrum_index_1 = floor(spectrum); // Desired color will be after this index + S32 spectrum_index_2 = spectrum_index_1 + 1; // and before this index (inclusive) + F32 fractBetween = spectrum - (F32)(spectrum_index_1); // distance between the two indexes (0-1) + + LLColor4 new_color = lerp(*spectrum_color[spectrum_index_1], *spectrum_color[spectrum_index_2], fractBetween); + new_color.normalize(); + new_color *= 0.7f; // Tone it down a bit + + //llinfos << "From value " << std::setprecision(3) << value << " returning color " << new_color + // << " using indexes " << spectrum_index_1 << ", " << spectrum_index_2 + // << " and fractBetween " << fractBetween + // << llendl; + + return new_color; } // static diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index b05eed344b..931e65b3ea 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -250,6 +250,20 @@ public: static void invalidateNameTags(); void addNameTagLine(const std::string& line, const LLColor4& color, S32 style, const LLFontGL* font); void idleUpdateRenderCost(); + void calculateUpdateRenderCost(); + void updateVisualComplexity() { mVisualComplexityStale = TRUE; } + + S32 getVisualComplexity() { return mVisualComplexity; }; // Numbers calculated here by rendering AV + S32 getAttachmentGeometryBytes() { return mAttachmentGeometryBytes; }; // number of bytes in attached geometry + F32 getAttachmentSurfaceArea() { return mAttachmentSurfaceArea; }; // estimated surface area of attachments + + S32 getReportedVisualComplexity() { return mReportedVisualComplexity; }; // Numbers as reported by the SL server + void setReportedVisualComplexity(S32 value) { mReportedVisualComplexity = value; }; + + S32 getUpdatePeriod() { return mUpdatePeriod; }; + const LLColor4 & getMutedAVColor() { return mMutedAVColor; }; + + void idleUpdateBelowWater(); //-------------------------------------------------------------------- @@ -303,12 +317,15 @@ public: static void logPendingPhasesAllAvatars(); void logMetricsTimerRecord(const std::string& phase_name, F32 elapsed, bool completed); + static LLColor4 calcMutedAVColor(F32 value, S32 range_low, S32 range_high); + protected: LLViewerStats::PhaseMap& getPhases() { return mPhases; } BOOL updateIsFullyLoaded(); BOOL processFullyLoadedChange(bool loading); void updateRuthTimer(bool loading); F32 calcMorphAmount(); + private: BOOL mFirstFullyVisible; BOOL mFullyLoaded; @@ -316,6 +333,8 @@ private: BOOL mFullyLoadedInitialized; S32 mFullyLoadedFrameCounter; S32 mVisualComplexity; + BOOL mVisualComplexityStale; + LLColor4 mMutedAVColor; LLFrameTimer mFullyLoadedTimer; LLFrameTimer mRuthTimer; @@ -369,7 +388,18 @@ public: public: U32 renderImpostor(LLColor4U color = LLColor4U(255,255,255,255), S32 diffuse_channel = 0); - bool isVisuallyMuted() const; + bool isVisuallyMuted(); + void setCachedVisualMute(bool muted) { mCachedVisualMute = muted; }; + void forceUpdateVisualMuteSettings(); + + enum VisualMuteSettings + { + VISUAL_MUTE_NOT_SET = 0, + ALWAYS_VISUAL_MUTE = 1, + NEVER_VISUAL_MUTE = 2 + }; + void setVisualMuteSettings(VisualMuteSettings set) { mVisuallyMuteSetting = set; }; + VisualMuteSettings getVisualMuteSettings() { return mVisuallyMuteSetting; }; U32 renderRigid(); U32 renderSkinned(EAvatarRenderPass pass); @@ -380,9 +410,11 @@ public: static void destroyGL(); static void restoreGL(); S32 mSpecialRenderMode; // special lighting - U32 mAttachmentGeometryBytes; //number of bytes in attached geometry + S32 mAttachmentGeometryBytes; //number of bytes in attached geometry F32 mAttachmentSurfaceArea; //estimated surface area of attachments + S32 mReportedVisualComplexity; // Numbers as reported by the SL server + private: bool shouldAlphaMask(); @@ -392,6 +424,11 @@ private: S32 mUpdatePeriod; S32 mNumInitFaces; //number of faces generated when creating the avatar drawable, does not inculde splitted faces due to long vertex buffer. + bool mCachedVisualMute; // cached return value for isVisuallyMuted() + F64 mCachedVisualMuteUpdateTime; // Time to update mCachedVisualMute + + VisualMuteSettings mVisuallyMuteSetting; // Always or never visually mute this AV + //-------------------------------------------------------------------- // Morph masks //-------------------------------------------------------------------- @@ -430,7 +467,7 @@ private: // Impostors //-------------------------------------------------------------------- public: - BOOL isImpostor() const; + BOOL isImpostor(); BOOL needsImpostorUpdate() const; const LLVector3& getImpostorOffset() const; const LLVector2& getImpostorDim() const; diff --git a/indra/newview/llvograss.cpp b/indra/newview/llvograss.cpp index cab5c4bc1d..591d5cae0b 100755 --- a/indra/newview/llvograss.cpp +++ b/indra/newview/llvograss.cpp @@ -476,6 +476,7 @@ void LLVOGrass::getGeometry(S32 idx, LLStrider<LLVector3>& normalsp, LLStrider<LLVector2>& texcoordsp, LLStrider<LLColor4U>& colorsp, + LLStrider<LLColor4U>& emissivep, LLStrider<U16>& indicesp) { if(!mNumBlades)//stop rendering grass @@ -708,7 +709,11 @@ void LLGrassPartition::getGeometry(LLSpatialGroup* group) facep->setIndicesIndex(index_count); facep->setVertexBuffer(buffer); facep->setPoolType(LLDrawPool::POOL_ALPHA); - object->getGeometry(facep->getTEOffset(), verticesp, normalsp, texcoordsp, colorsp, indicesp); + + //dummy parameter (unused by this implementation) + LLStrider<LLColor4U> emissivep; + + object->getGeometry(facep->getTEOffset(), verticesp, normalsp, texcoordsp, colorsp, emissivep, indicesp); vertex_count += facep->getGeomCount(); index_count += facep->getIndicesCount(); diff --git a/indra/newview/llvograss.h b/indra/newview/llvograss.h index 122806766d..e54de85412 100755 --- a/indra/newview/llvograss.h +++ b/indra/newview/llvograss.h @@ -63,6 +63,7 @@ public: LLStrider<LLVector3>& normalsp, LLStrider<LLVector2>& texcoordsp, LLStrider<LLColor4U>& colorsp, + LLStrider<LLColor4U>& emissivep, LLStrider<U16>& indicesp); void updateFaceSize(S32 idx) { } diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index b46c55321c..af55c8f741 100755 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -714,14 +714,7 @@ BOOL LLVoiceClient::isParticipantAvatar(const LLUUID& id) BOOL LLVoiceClient::isOnlineSIP(const LLUUID& id) { - if (mVoiceModule) - { - return mVoiceModule->isOnlineSIP(id); - } - else - { return FALSE; - } } BOOL LLVoiceClient::getIsSpeaking(const LLUUID& id) diff --git a/indra/newview/llvoiceclient.h b/indra/newview/llvoiceclient.h index 714dd6a9f2..e17da9cecd 100755 --- a/indra/newview/llvoiceclient.h +++ b/indra/newview/llvoiceclient.h @@ -199,7 +199,6 @@ public: //@{ virtual BOOL getVoiceEnabled(const LLUUID& id)=0; // true if we've received data for this avatar virtual std::string getDisplayName(const LLUUID& id)=0; - virtual BOOL isOnlineSIP(const LLUUID &id)=0; virtual BOOL isParticipantAvatar(const LLUUID &id)=0; virtual BOOL getIsSpeaking(const LLUUID& id)=0; virtual BOOL getIsModeratorMuted(const LLUUID& id)=0; diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 9b5d981aa5..ff73aa5354 100755 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -182,17 +182,10 @@ class LLVivoxVoiceClientMuteListObserver : public LLMuteListObserver /* virtual */ void onChange() { LLVivoxVoiceClient::getInstance()->muteListChanged();} }; -class LLVivoxVoiceClientFriendsObserver : public LLFriendObserver -{ -public: - /* virtual */ void changed(U32 mask) { LLVivoxVoiceClient::getInstance()->updateFriends(mask);} -}; static LLVivoxVoiceClientMuteListObserver mutelist_listener; static bool sMuteListListener_listening = false; -static LLVivoxVoiceClientFriendsObserver *friendslist_listener = NULL; - /////////////////////////////////////////////////////////////////////////////////////////////// class LLVivoxVoiceClientCapResponder : public LLHTTPClient::Responder @@ -390,7 +383,6 @@ void LLVivoxVoiceClient::terminate() void LLVivoxVoiceClient::cleanUp() { deleteAllSessions(); - deleteAllBuddies(); deleteAllVoiceFonts(); deleteVoiceFontTemplates(); } @@ -476,10 +468,10 @@ void LLVivoxVoiceClient::connectorCreate() std::string savedLogLevel = gSavedSettings.getString("VivoxDebugLevel"); - if(savedLogLevel != "-1") + if(savedLogLevel != "-0") { LL_DEBUGS("Voice") << "creating connector with logging enabled" << LL_ENDL; - loglevel = "10"; + loglevel = "0"; } stream @@ -532,25 +524,25 @@ void LLVivoxVoiceClient::requestVoiceAccountProvision(S32 retries) { LLViewerRegion *region = gAgent.getRegion(); - if ( region && (mVoiceEnabled || !mIsInitialized)) + // If we've not received the capability yet, return. + // the password will remain empty, so we'll remain in + // stateIdle + if ( region && + region->capabilitiesReceived() && + (mVoiceEnabled || !mIsInitialized)) { std::string url = region->getCapability("ProvisionVoiceAccountRequest"); - if ( url.empty() ) + if ( !url.empty() ) { - // we've not received the capability yet, so return. - // the password will remain empty, so we'll remain in - // stateIdle - return; - } + LLHTTPClient::post( + url, + LLSD(), + new LLVivoxVoiceAccountProvisionResponder(retries)); - LLHTTPClient::post( - url, - LLSD(), - new LLVivoxVoiceAccountProvisionResponder(retries)); - - setState(stateConnectorStart); + setState(stateConnectorStart); + } } } @@ -792,9 +784,9 @@ void LLVivoxVoiceClient::stateMachine() std::string loglevel = gSavedSettings.getString("VivoxDebugLevel"); if(loglevel.empty()) { - loglevel = "-1"; // turn logging off completely + loglevel = "0"; // turn logging off completely } - + loglevel = "0"; // turn logging off completely params.args.add("-ll"); params.args.add(loglevel); params.cwd = gDirUtilp->getAppRODataDir(); @@ -1202,25 +1194,12 @@ void LLVivoxVoiceClient::stateMachine() setState(stateVoiceFontsReceived); } - // request the current set of block rules (we'll need them when updating the friends list) - accountListBlockRulesSendMessage(); - - // request the current set of auto-accept rules - accountListAutoAcceptRulesSendMessage(); - // Set up the mute list observer if it hasn't been set up already. if((!sMuteListListener_listening)) { LLMuteList::getInstance()->addObserver(&mutelist_listener); sMuteListListener_listening = true; } - - // Set up the friends list observer if it hasn't been set up already. - if(friendslist_listener == NULL) - { - friendslist_listener = new LLVivoxVoiceClientFriendsObserver; - LLAvatarTracker::instance().addObserver(friendslist_listener); - } // Set the initial state of mic mute, local speaker volume, etc. { @@ -1291,9 +1270,7 @@ void LLVivoxVoiceClient::stateMachine() case stateNoChannel: LL_DEBUGS("Voice") << "State No Channel" << LL_ENDL; mSpatialJoiningNum = 0; - // Do this here as well as inside sendPositionalUpdate(). - // Otherwise, if you log in but don't join a proximal channel (such as when your login location has voice disabled), your friends list won't sync. - sendFriendsListUpdates(); + if(mSessionTerminateRequested || (!mVoiceEnabled && mIsInitialized)) { @@ -1490,7 +1467,6 @@ void LLVivoxVoiceClient::stateMachine() mUpdateTimer.setTimerExpirySec(UPDATE_THROTTLE_SECONDS); sendPositionalUpdate(); } - mIsInitialized = true; } break; @@ -1648,7 +1624,7 @@ void LLVivoxVoiceClient::stateMachine() void LLVivoxVoiceClient::closeSocket(void) { mSocket.reset(); - mConnected = false; + mConnected = false; mConnectorHandle.clear(); mAccountHandle.clear(); } @@ -1665,7 +1641,7 @@ void LLVivoxVoiceClient::loginSendMessage() << "<AccountName>" << mAccountName << "</AccountName>" << "<AccountPassword>" << mAccountPassword << "</AccountPassword>" << "<AudioSessionAnswerMode>VerifyAnswer</AudioSessionAnswerMode>" - << "<EnableBuddiesAndPresence>true</EnableBuddiesAndPresence>" + << "<EnableBuddiesAndPresence>false</EnableBuddiesAndPresence>" << "<BuddyManagementMode>Application</BuddyManagementMode>" << "<ParticipantPropertyFrequency>5</ParticipantPropertyFrequency>" << (autoPostCrashDumps?"<AutopostCrashDumps>true</AutopostCrashDumps>":"") @@ -1701,42 +1677,6 @@ void LLVivoxVoiceClient::logoutSendMessage() } } -void LLVivoxVoiceClient::accountListBlockRulesSendMessage() -{ - if(!mAccountHandle.empty()) - { - std::ostringstream stream; - - LL_DEBUGS("Voice") << "requesting block rules" << LL_ENDL; - - stream - << "<Request requestId=\"" << mCommandCookie++ << "\" action=\"Account.ListBlockRules.1\">" - << "<AccountHandle>" << mAccountHandle << "</AccountHandle>" - << "</Request>" - << "\n\n\n"; - - writeString(stream.str()); - } -} - -void LLVivoxVoiceClient::accountListAutoAcceptRulesSendMessage() -{ - if(!mAccountHandle.empty()) - { - std::ostringstream stream; - - LL_DEBUGS("Voice") << "requesting auto-accept rules" << LL_ENDL; - - stream - << "<Request requestId=\"" << mCommandCookie++ << "\" action=\"Account.ListAutoAcceptRules.1\">" - << "<AccountHandle>" << mAccountHandle << "</AccountHandle>" - << "</Request>" - << "\n\n\n"; - - writeString(stream.str()); - } -} - void LLVivoxVoiceClient::sessionGroupCreateSendMessage() { if(!mAccountHandle.empty()) @@ -2568,10 +2508,7 @@ void LLVivoxVoiceClient::sendPositionalUpdate(void) { writeString(stream.str()); } - - // Friends list updates can be huge, especially on the first voice login of an account with lots of friends. - // Batching them all together can choke SLVoice, so send them in separate writes. - sendFriendsListUpdates(); + } void LLVivoxVoiceClient::buildSetCaptureDevice(std::ostringstream &stream) @@ -2669,275 +2606,6 @@ void LLVivoxVoiceClient::buildLocalAudioUpdates(std::ostringstream &stream) } -void LLVivoxVoiceClient::checkFriend(const LLUUID& id) -{ - buddyListEntry *buddy = findBuddy(id); - - // Make sure we don't add a name before it's been looked up in the avatar name cache - LLAvatarName av_name; - if (LLAvatarNameCache::get(id, &av_name)) - { - // *NOTE: We feed legacy names to Vivox because we don't know if their service - // can support a mix of new and old clients with different sorts of names. - std::string name = av_name.getAccountName(); - - if (buddy) - { - // This buddy is already in both lists (vivox buddies and avatar cache). - // Trust the avatar cache more for the display name (vivox display name are notoriously wrong) - buddy->mDisplayName = name; - } - else - { - // This buddy was not in the vivox list, needs to be added. - buddy = addBuddy(sipURIFromID(id), name); - buddy->mUUID = id; - } - - const LLRelationship* relationInfo = LLAvatarTracker::instance().getBuddyInfo(id); - buddy->mCanSeeMeOnline = (relationInfo && relationInfo->isRightGrantedTo(LLRelationship::GRANT_ONLINE_STATUS)); - // In all the above cases, the buddy is in the SL friends list and tha name has been resolved (which is how we got here). - buddy->mNameResolved = true; - buddy->mInSLFriends = true; - } - else - { - // This name hasn't been looked up yet in the avatar cache. Don't do anything with this buddy list entry until it has. - if (buddy) - { - buddy->mNameResolved = false; - } - // Initiate a lookup. - // The "lookup completed" callback will ensure that the friends list is rechecked after it completes. - lookupName(id); - } -} - -void LLVivoxVoiceClient::clearAllLists() -{ - // FOR TESTING ONLY - - // This will send the necessary commands to delete ALL buddies, autoaccept rules, and block rules SLVoice tells us about. - buddyListMap::iterator buddy_it; - for(buddy_it = mBuddyListMap.begin(); buddy_it != mBuddyListMap.end();) - { - buddyListEntry *buddy = buddy_it->second; - buddy_it++; - - std::ostringstream stream; - - if(buddy->mInVivoxBuddies) - { - // delete this entry from the vivox buddy list - buddy->mInVivoxBuddies = false; - LL_DEBUGS("Voice") << "delete " << buddy->mURI << " (" << buddy->mDisplayName << ")" << LL_ENDL; - stream << "<Request requestId=\"" << mCommandCookie++ << "\" action=\"Account.BuddyDelete.1\">" - << "<AccountHandle>" << mAccountHandle << "</AccountHandle>" - << "<BuddyURI>" << buddy->mURI << "</BuddyURI>" - << "</Request>\n\n\n"; - } - - if(buddy->mHasBlockListEntry) - { - // Delete the associated block list entry (so the block list doesn't fill up with junk) - buddy->mHasBlockListEntry = false; - stream << "<Request requestId=\"" << mCommandCookie++ << "\" action=\"Account.DeleteBlockRule.1\">" - << "<AccountHandle>" << mAccountHandle << "</AccountHandle>" - << "<BlockMask>" << buddy->mURI << "</BlockMask>" - << "</Request>\n\n\n"; - } - if(buddy->mHasAutoAcceptListEntry) - { - // Delete the associated auto-accept list entry (so the auto-accept list doesn't fill up with junk) - buddy->mHasAutoAcceptListEntry = false; - stream << "<Request requestId=\"" << mCommandCookie++ << "\" action=\"Account.DeleteAutoAcceptRule.1\">" - << "<AccountHandle>" << mAccountHandle << "</AccountHandle>" - << "<AutoAcceptMask>" << buddy->mURI << "</AutoAcceptMask>" - << "</Request>\n\n\n"; - } - - writeString(stream.str()); - - } -} - -void LLVivoxVoiceClient::sendFriendsListUpdates() -{ - if(mBuddyListMapPopulated && mBlockRulesListReceived && mAutoAcceptRulesListReceived && mFriendsListDirty) - { - mFriendsListDirty = false; - - if(0) - { - // FOR TESTING ONLY -- clear all buddy list, block list, and auto-accept list entries. - clearAllLists(); - return; - } - - LL_INFOS("Voice") << "Checking vivox buddy list against friends list..." << LL_ENDL; - - buddyListMap::iterator buddy_it; - for(buddy_it = mBuddyListMap.begin(); buddy_it != mBuddyListMap.end(); buddy_it++) - { - // reset the temp flags in the local buddy list - buddy_it->second->mInSLFriends = false; - } - - // correlate with the friends list - { - LLCollectAllBuddies collect; - LLAvatarTracker::instance().applyFunctor(collect); - LLCollectAllBuddies::buddy_map_t::const_iterator it = collect.mOnline.begin(); - LLCollectAllBuddies::buddy_map_t::const_iterator end = collect.mOnline.end(); - - for ( ; it != end; ++it) - { - checkFriend(it->second); - } - it = collect.mOffline.begin(); - end = collect.mOffline.end(); - for ( ; it != end; ++it) - { - checkFriend(it->second); - } - } - - LL_INFOS("Voice") << "Sending friend list updates..." << LL_ENDL; - - for(buddy_it = mBuddyListMap.begin(); buddy_it != mBuddyListMap.end();) - { - buddyListEntry *buddy = buddy_it->second; - buddy_it++; - - // Ignore entries that aren't resolved yet. - if(buddy->mNameResolved) - { - std::ostringstream stream; - - if(buddy->mInSLFriends && !buddy->mInVivoxBuddies) - { - if(mNumberOfAliases > 0) - { - // Add (or update) this entry in the vivox buddy list - buddy->mInVivoxBuddies = true; - LL_DEBUGS("Voice") << "add/update " << buddy->mURI << " (" << buddy->mDisplayName << ")" << LL_ENDL; - stream - << "<Request requestId=\"" << mCommandCookie++ << "\" action=\"Account.BuddySet.1\">" - << "<AccountHandle>" << mAccountHandle << "</AccountHandle>" - << "<BuddyURI>" << buddy->mURI << "</BuddyURI>" - << "<DisplayName>" << buddy->mDisplayName << "</DisplayName>" - << "<BuddyData></BuddyData>" // Without this, SLVoice doesn't seem to parse the command. - << "<GroupID>0</GroupID>" - << "</Request>\n\n\n"; - } - } - else if(!buddy->mInSLFriends) - { - // This entry no longer exists in your SL friends list. Remove all traces of it from the Vivox buddy list. - if(buddy->mInVivoxBuddies) - { - // delete this entry from the vivox buddy list - buddy->mInVivoxBuddies = false; - LL_DEBUGS("Voice") << "delete " << buddy->mURI << " (" << buddy->mDisplayName << ")" << LL_ENDL; - stream << "<Request requestId=\"" << mCommandCookie++ << "\" action=\"Account.BuddyDelete.1\">" - << "<AccountHandle>" << mAccountHandle << "</AccountHandle>" - << "<BuddyURI>" << buddy->mURI << "</BuddyURI>" - << "</Request>\n\n\n"; - } - - if(buddy->mHasBlockListEntry) - { - // Delete the associated block list entry, if any - buddy->mHasBlockListEntry = false; - stream << "<Request requestId=\"" << mCommandCookie++ << "\" action=\"Account.DeleteBlockRule.1\">" - << "<AccountHandle>" << mAccountHandle << "</AccountHandle>" - << "<BlockMask>" << buddy->mURI << "</BlockMask>" - << "</Request>\n\n\n"; - } - if(buddy->mHasAutoAcceptListEntry) - { - // Delete the associated auto-accept list entry, if any - buddy->mHasAutoAcceptListEntry = false; - stream << "<Request requestId=\"" << mCommandCookie++ << "\" action=\"Account.DeleteAutoAcceptRule.1\">" - << "<AccountHandle>" << mAccountHandle << "</AccountHandle>" - << "<AutoAcceptMask>" << buddy->mURI << "</AutoAcceptMask>" - << "</Request>\n\n\n"; - } - } - - if(buddy->mInSLFriends) - { - - if(buddy->mCanSeeMeOnline) - { - // Buddy should not be blocked. - - // If this buddy doesn't already have either a block or autoaccept list entry, we'll update their status when we receive a SubscriptionEvent. - - // If the buddy has a block list entry, delete it. - if(buddy->mHasBlockListEntry) - { - buddy->mHasBlockListEntry = false; - stream << "<Request requestId=\"" << mCommandCookie++ << "\" action=\"Account.DeleteBlockRule.1\">" - << "<AccountHandle>" << mAccountHandle << "</AccountHandle>" - << "<BlockMask>" << buddy->mURI << "</BlockMask>" - << "</Request>\n\n\n"; - - - // If we just deleted a block list entry, add an auto-accept entry. - if(!buddy->mHasAutoAcceptListEntry) - { - buddy->mHasAutoAcceptListEntry = true; - stream << "<Request requestId=\"" << mCommandCookie++ << "\" action=\"Account.CreateAutoAcceptRule.1\">" - << "<AccountHandle>" << mAccountHandle << "</AccountHandle>" - << "<AutoAcceptMask>" << buddy->mURI << "</AutoAcceptMask>" - << "<AutoAddAsBuddy>0</AutoAddAsBuddy>" - << "</Request>\n\n\n"; - } - } - } - else - { - // Buddy should be blocked. - - // If this buddy doesn't already have either a block or autoaccept list entry, we'll update their status when we receive a SubscriptionEvent. - - // If this buddy has an autoaccept entry, delete it - if(buddy->mHasAutoAcceptListEntry) - { - buddy->mHasAutoAcceptListEntry = false; - stream << "<Request requestId=\"" << mCommandCookie++ << "\" action=\"Account.DeleteAutoAcceptRule.1\">" - << "<AccountHandle>" << mAccountHandle << "</AccountHandle>" - << "<AutoAcceptMask>" << buddy->mURI << "</AutoAcceptMask>" - << "</Request>\n\n\n"; - - // If we just deleted an auto-accept entry, add a block list entry. - if(!buddy->mHasBlockListEntry) - { - buddy->mHasBlockListEntry = true; - stream << "<Request requestId=\"" << mCommandCookie++ << "\" action=\"Account.CreateBlockRule.1\">" - << "<AccountHandle>" << mAccountHandle << "</AccountHandle>" - << "<BlockMask>" << buddy->mURI << "</BlockMask>" - << "<PresenceOnly>1</PresenceOnly>" - << "</Request>\n\n\n"; - } - } - } - - if(!buddy->mInSLFriends && !buddy->mInVivoxBuddies) - { - // Delete this entry from the local buddy list. This should NOT invalidate the iterator, - // since it has already been incremented to the next entry. - deleteBuddy(buddy->mURI); - } - - } - writeString(stream.str()); - } - } - } -} - ///////////////////////////// // Response/Event handlers @@ -3711,7 +3379,7 @@ void LLVivoxVoiceClient::participantUpdatedEvent( voice participant mIsModeratorMuted is changed after speakers are updated in Speaker Manager and event is not fired. - So, we have to call LLSpeakerMgr::update() here. + So, we have to call LLSpeakerMgr::update() here. */ LLVoiceChannel* voice_cnl = LLVoiceChannel::getCurrentVoiceChannel(); @@ -3743,83 +3411,6 @@ void LLVivoxVoiceClient::participantUpdatedEvent( } } -void LLVivoxVoiceClient::buddyPresenceEvent( - std::string &uriString, - std::string &alias, - std::string &statusString, - std::string &applicationString) -{ - buddyListEntry *buddy = findBuddy(uriString); - - if(buddy) - { - LL_DEBUGS("Voice") << "Presence event for " << buddy->mDisplayName << " status \"" << statusString << "\", application \"" << applicationString << "\""<< LL_ENDL; - LL_DEBUGS("Voice") << "before: mOnlineSL = " << (buddy->mOnlineSL?"true":"false") << ", mOnlineSLim = " << (buddy->mOnlineSLim?"true":"false") << LL_ENDL; - - if(applicationString.empty()) - { - // This presence event is from a client that doesn't set up the Application string. Do things the old-skool way. - // NOTE: this will be needed to support people who aren't on the 3010-class SDK yet. - - if ( stricmp("Unknown", statusString.c_str())== 0) - { - // User went offline with a non-SLim-enabled viewer. - buddy->mOnlineSL = false; - } - else if ( stricmp("Online", statusString.c_str())== 0) - { - // User came online with a non-SLim-enabled viewer. - buddy->mOnlineSL = true; - } - else - { - // If the user is online through SLim, their status will be "Online-slc", "Away", or something else. - // NOTE: we should never see this unless someone is running an OLD version of SLim -- the versions that should be in use now all set the application string. - buddy->mOnlineSLim = true; - } - } - else if(applicationString.find("SecondLifeViewer") != std::string::npos) - { - // This presence event is from a viewer that sets the application string - if ( stricmp("Unknown", statusString.c_str())== 0) - { - // Viewer says they're offline - buddy->mOnlineSL = false; - } - else - { - // Viewer says they're online - buddy->mOnlineSL = true; - } - } - else - { - // This presence event is from something which is NOT the SL viewer (assume it's SLim). - if ( stricmp("Unknown", statusString.c_str())== 0) - { - // SLim says they're offline - buddy->mOnlineSLim = false; - } - else - { - // SLim says they're online - buddy->mOnlineSLim = true; - } - } - - LL_DEBUGS("Voice") << "after: mOnlineSL = " << (buddy->mOnlineSL?"true":"false") << ", mOnlineSLim = " << (buddy->mOnlineSLim?"true":"false") << LL_ENDL; - - // HACK -- increment the internal change serial number in the LLRelationship (without changing the actual status), so the UI notices the change. - LLAvatarTracker::instance().setBuddyOnline(buddy->mUUID,LLAvatarTracker::instance().isBuddyOnline(buddy->mUUID)); - - notifyFriendObservers(); - } - else - { - LL_DEBUGS("Voice") << "Presence for unknown buddy " << uriString << LL_ENDL; - } -} - void LLVivoxVoiceClient::messageEvent( std::string &sessionHandle, std::string &uriString, @@ -4010,70 +3601,12 @@ void LLVivoxVoiceClient::sessionNotificationEvent(std::string &sessionHandle, st } } -void LLVivoxVoiceClient::subscriptionEvent(std::string &buddyURI, std::string &subscriptionHandle, std::string &alias, std::string &displayName, std::string &applicationString, std::string &subscriptionType) -{ - buddyListEntry *buddy = findBuddy(buddyURI); - - if(!buddy) - { - // Couldn't find buddy by URI, try converting the alias... - if(!alias.empty()) - { - LLUUID id; - if(IDFromName(alias, id)) - { - buddy = findBuddy(id); - } - } - } - - if(buddy) - { - std::ostringstream stream; - - if(buddy->mCanSeeMeOnline) - { - // Sending the response will create an auto-accept rule - buddy->mHasAutoAcceptListEntry = true; - } - else - { - // Sending the response will create a block rule - buddy->mHasBlockListEntry = true; - } - - if(buddy->mInSLFriends) - { - buddy->mInVivoxBuddies = true; - } - - stream - << "<Request requestId=\"" << mCommandCookie++ << "\" action=\"Account.SendSubscriptionReply.1\">" - << "<AccountHandle>" << mAccountHandle << "</AccountHandle>" - << "<BuddyURI>" << buddy->mURI << "</BuddyURI>" - << "<RuleType>" << (buddy->mCanSeeMeOnline?"Allow":"Hide") << "</RuleType>" - << "<AutoAccept>"<< (buddy->mInSLFriends?"1":"0")<< "</AutoAccept>" - << "<SubscriptionHandle>" << subscriptionHandle << "</SubscriptionHandle>" - << "</Request>" - << "\n\n\n"; - - writeString(stream.str()); - } -} - void LLVivoxVoiceClient::auxAudioPropertiesEvent(F32 energy) { LL_DEBUGS("Voice") << "got energy " << energy << LL_ENDL; mTuningEnergy = energy; } -void LLVivoxVoiceClient::buddyListChanged() -{ - // This is called after we receive a BuddyAndGroupListChangedEvent. - mBuddyListMapPopulated = true; - mFriendsListDirty = true; -} - void LLVivoxVoiceClient::muteListChanged() { // The user's mute list has been updated. Go through the current participant list and sync it with the mute list. @@ -4092,15 +3625,6 @@ void LLVivoxVoiceClient::muteListChanged() } } -void LLVivoxVoiceClient::updateFriends(U32 mask) -{ - if(mask & (LLFriendObserver::ADD | LLFriendObserver::REMOVE | LLFriendObserver::POWERS)) - { - // Just resend the whole friend list to the daemon - mFriendsListDirty = true; - } -} - ///////////////////////////// // Managing list of participants LLVivoxVoiceClient::participantState::participantState(const std::string &uri) : @@ -4699,34 +4223,6 @@ bool LLVivoxVoiceClient::answerInvite(std::string &sessionHandle) return false; } -BOOL LLVivoxVoiceClient::isOnlineSIP(const LLUUID &id) -{ - bool result = false; - buddyListEntry *buddy = findBuddy(id); - if(buddy) - { - result = buddy->mOnlineSLim; - LL_DEBUGS("Voice") << "Buddy " << buddy->mDisplayName << " is SIP " << (result?"online":"offline") << LL_ENDL; - } - - if(!result) - { - // This user isn't on the buddy list or doesn't show online status through the buddy list, but could be a participant in an existing session if they initiated a text IM. - sessionState *session = findSession(id); - if(session && !session->mHandle.empty()) - { - if((session->mTextStreamState != streamStateUnknown) || (session->mMediaStreamState > streamStateIdle)) - { - LL_DEBUGS("Voice") << "Open session with " << id << " found, returning SIP online state" << LL_ENDL; - // we have a p2p text session open with this user, so by definition they're online. - result = true; - } - } - } - - return result; -} - bool LLVivoxVoiceClient::isVoiceWorking() const { //Added stateSessionTerminated state to avoid problems with call in parcels with disabled voice (EXT-4758) @@ -4783,7 +4279,7 @@ BOOL LLVivoxVoiceClient::isSessionCallBackPossible(const LLUUID &session_id) // Currently this will be false only for PSTN P2P calls. BOOL LLVivoxVoiceClient::isSessionTextIMPossible(const LLUUID &session_id) { - bool result = TRUE; + bool result = TRUE; sessionState *session = findSession(session_id); if(session != NULL) @@ -5832,224 +5328,6 @@ void LLVivoxVoiceClient::verifySessionState(void) } } -LLVivoxVoiceClient::buddyListEntry::buddyListEntry(const std::string &uri) : - mURI(uri) -{ - mOnlineSL = false; - mOnlineSLim = false; - mCanSeeMeOnline = true; - mHasBlockListEntry = false; - mHasAutoAcceptListEntry = false; - mNameResolved = false; - mInVivoxBuddies = false; - mInSLFriends = false; -} - -void LLVivoxVoiceClient::processBuddyListEntry(const std::string &uri, const std::string &displayName) -{ - buddyListEntry *buddy = addBuddy(uri, displayName); - buddy->mInVivoxBuddies = true; -} - -LLVivoxVoiceClient::buddyListEntry *LLVivoxVoiceClient::addBuddy(const std::string &uri) -{ - std::string empty; - buddyListEntry *buddy = addBuddy(uri, empty); - if(buddy->mDisplayName.empty()) - { - buddy->mNameResolved = false; - } - return buddy; -} - -LLVivoxVoiceClient::buddyListEntry *LLVivoxVoiceClient::addBuddy(const std::string &uri, const std::string &displayName) -{ - buddyListEntry *result = NULL; - buddyListMap::iterator iter = mBuddyListMap.find(uri); - - if (iter != mBuddyListMap.end()) - { - // Found a matching buddy already in the map. - LL_DEBUGS("Voice") << "adding existing buddy " << uri << LL_ENDL; - result = iter->second; - } - - if (!result) - { - // participant isn't already in one list or the other. - LL_DEBUGS("Voice") << "adding new buddy " << uri << LL_ENDL; - result = new buddyListEntry(uri); - result->mDisplayName = displayName; - - if (!IDFromName(uri, result->mUUID)) - { - LL_DEBUGS("Voice") << "Couldn't find ID for buddy " << uri << " (\"" << displayName << "\")" << LL_ENDL; - } - - mBuddyListMap.insert(buddyListMap::value_type(result->mURI, result)); - } - - return result; -} - -LLVivoxVoiceClient::buddyListEntry *LLVivoxVoiceClient::findBuddy(const std::string &uri) -{ - buddyListEntry *result = NULL; - buddyListMap::iterator iter = mBuddyListMap.find(uri); - if(iter != mBuddyListMap.end()) - { - result = iter->second; - } - - return result; -} - -LLVivoxVoiceClient::buddyListEntry *LLVivoxVoiceClient::findBuddy(const LLUUID &id) -{ - buddyListEntry *result = NULL; - buddyListMap::iterator iter; - - for(iter = mBuddyListMap.begin(); iter != mBuddyListMap.end(); iter++) - { - if(iter->second->mUUID == id) - { - result = iter->second; - break; - } - } - - return result; -} - -LLVivoxVoiceClient::buddyListEntry *LLVivoxVoiceClient::findBuddyByDisplayName(const std::string &name) -{ - buddyListEntry *result = NULL; - buddyListMap::iterator iter; - - for(iter = mBuddyListMap.begin(); iter != mBuddyListMap.end(); iter++) - { - if(iter->second->mDisplayName == name) - { - result = iter->second; - break; - } - } - - return result; -} - -void LLVivoxVoiceClient::deleteBuddy(const std::string &uri) -{ - buddyListMap::iterator iter = mBuddyListMap.find(uri); - if(iter != mBuddyListMap.end()) - { - LL_DEBUGS("Voice") << "deleting buddy " << uri << LL_ENDL; - buddyListEntry *buddy = iter->second; - mBuddyListMap.erase(iter); - delete buddy; - } - else - { - LL_DEBUGS("Voice") << "attempt to delete nonexistent buddy " << uri << LL_ENDL; - } - -} - -void LLVivoxVoiceClient::deleteAllBuddies(void) -{ - while(!mBuddyListMap.empty()) - { - deleteBuddy(mBuddyListMap.begin()->first); - } - - // Don't want to correlate with friends list when we've emptied the buddy list. - mBuddyListMapPopulated = false; - - // Don't want to correlate with friends list when we've reset the block rules. - mBlockRulesListReceived = false; - mAutoAcceptRulesListReceived = false; -} - -void LLVivoxVoiceClient::deleteAllBlockRules(void) -{ - // Clear the block list entry flags from all local buddy list entries - buddyListMap::iterator buddy_it; - for(buddy_it = mBuddyListMap.begin(); buddy_it != mBuddyListMap.end(); buddy_it++) - { - buddy_it->second->mHasBlockListEntry = false; - } -} - -void LLVivoxVoiceClient::deleteAllAutoAcceptRules(void) -{ - // Clear the auto-accept list entry flags from all local buddy list entries - buddyListMap::iterator buddy_it; - for(buddy_it = mBuddyListMap.begin(); buddy_it != mBuddyListMap.end(); buddy_it++) - { - buddy_it->second->mHasAutoAcceptListEntry = false; - } -} - -void LLVivoxVoiceClient::addBlockRule(const std::string &blockMask, const std::string &presenceOnly) -{ - buddyListEntry *buddy = NULL; - - // blockMask is the SIP URI of a friends list entry - buddyListMap::iterator iter = mBuddyListMap.find(blockMask); - if(iter != mBuddyListMap.end()) - { - LL_DEBUGS("Voice") << "block list entry for " << blockMask << LL_ENDL; - buddy = iter->second; - } - - if(buddy == NULL) - { - LL_DEBUGS("Voice") << "block list entry for unknown buddy " << blockMask << LL_ENDL; - buddy = addBuddy(blockMask); - } - - if(buddy != NULL) - { - buddy->mHasBlockListEntry = true; - } -} - -void LLVivoxVoiceClient::addAutoAcceptRule(const std::string &autoAcceptMask, const std::string &autoAddAsBuddy) -{ - buddyListEntry *buddy = NULL; - - // blockMask is the SIP URI of a friends list entry - buddyListMap::iterator iter = mBuddyListMap.find(autoAcceptMask); - if(iter != mBuddyListMap.end()) - { - LL_DEBUGS("Voice") << "auto-accept list entry for " << autoAcceptMask << LL_ENDL; - buddy = iter->second; - } - - if(buddy == NULL) - { - LL_DEBUGS("Voice") << "auto-accept list entry for unknown buddy " << autoAcceptMask << LL_ENDL; - buddy = addBuddy(autoAcceptMask); - } - - if(buddy != NULL) - { - buddy->mHasAutoAcceptListEntry = true; - } -} - -void LLVivoxVoiceClient::accountListBlockRulesResponse(int statusCode, const std::string &statusString) -{ - // Block list entries were updated via addBlockRule() during parsing. Just flag that we're done. - mBlockRulesListReceived = true; -} - -void LLVivoxVoiceClient::accountListAutoAcceptRulesResponse(int statusCode, const std::string &statusString) -{ - // Block list entries were updated via addBlockRule() during parsing. Just flag that we're done. - mAutoAcceptRulesListReceived = true; -} - void LLVivoxVoiceClient::addObserver(LLVoiceClientParticipantObserver* observer) { mParticipantObservers.insert(observer); @@ -6198,11 +5476,6 @@ void LLVivoxVoiceClient::onAvatarNameCache(const LLUUID& agent_id, void LLVivoxVoiceClient::avatarNameResolved(const LLUUID &id, const std::string &name) { - // If the avatar whose name just resolved is on our friends list, resync the friends list. - if(LLAvatarTracker::instance().getBuddyInfo(id) != NULL) - { - mFriendsListDirty = true; - } // Iterate over all sessions. for(sessionIterator iter = sessionsBegin(); iter != sessionsEnd(); iter++) { @@ -6815,7 +6088,6 @@ void LLVivoxVoiceClient::updateVoiceMorphingMenu() } } } - void LLVivoxVoiceClient::notifyVoiceFontObservers() { LL_DEBUGS("Voice") << "Notifying voice effect observers. Lists changed: " << mVoiceFontListDirty << LL_ENDL; @@ -7205,18 +6477,6 @@ void LLVivoxProtocolParser::StartTag(const char *tag, const char **attr) { deviceString.clear(); } - else if (!stricmp("Buddies", tag)) - { - LLVivoxVoiceClient::getInstance()->deleteAllBuddies(); - } - else if (!stricmp("BlockRules", tag)) - { - LLVivoxVoiceClient::getInstance()->deleteAllBlockRules(); - } - else if (!stricmp("AutoAcceptRules", tag)) - { - LLVivoxVoiceClient::getInstance()->deleteAllAutoAcceptRules(); - } else if (!stricmp("SessionFont", tag)) { id = 0; @@ -7251,7 +6511,7 @@ void LLVivoxProtocolParser::StartTag(const char *tag, const char **attr) void LLVivoxProtocolParser::EndTag(const char *tag) { const std::string& string = textBuffer; - + responseDepth--; if (ignoringTags) @@ -7348,24 +6608,10 @@ void LLVivoxProtocolParser::EndTag(const char *tag) { LLVivoxVoiceClient::getInstance()->addRenderDevice(deviceString); } - else if (!stricmp("Buddy", tag)) - { - // NOTE : Vivox does *not* give reliable display name for Buddy tags - // We don't take those very seriously as a result... - LLVivoxVoiceClient::getInstance()->processBuddyListEntry(uriString, displayNameString); - } - else if (!stricmp("BlockRule", tag)) - { - LLVivoxVoiceClient::getInstance()->addBlockRule(blockMask, presenceOnly); - } else if (!stricmp("BlockMask", tag)) blockMask = string; else if (!stricmp("PresenceOnly", tag)) presenceOnly = string; - else if (!stricmp("AutoAcceptRule", tag)) - { - LLVivoxVoiceClient::getInstance()->addAutoAcceptRule(autoAcceptMask, autoAddAsBuddy); - } else if (!stricmp("AutoAcceptMask", tag)) autoAcceptMask = string; else if (!stricmp("AutoAddAsBuddy", tag)) @@ -7597,16 +6843,6 @@ void LLVivoxProtocolParser::processResponse(std::string tag) LLVivoxVoiceClient::getInstance()->auxAudioPropertiesEvent(energy); } - else if (!stricmp(eventTypeCstr, "BuddyPresenceEvent")) - { - LLVivoxVoiceClient::getInstance()->buddyPresenceEvent(uriString, alias, statusString, applicationString); - } - else if (!stricmp(eventTypeCstr, "BuddyAndGroupListChangedEvent")) - { - // The buddy list was updated during parsing. - // Need to recheck against the friends list. - LLVivoxVoiceClient::getInstance()->buddyListChanged(); - } else if (!stricmp(eventTypeCstr, "BuddyChangedEvent")) { /* @@ -7629,11 +6865,7 @@ void LLVivoxProtocolParser::processResponse(std::string tag) { LLVivoxVoiceClient::getInstance()->sessionNotificationEvent(sessionHandle, uriString, notificationType); } - else if (!stricmp(eventTypeCstr, "SubscriptionEvent")) - { - LLVivoxVoiceClient::getInstance()->subscriptionEvent(uriString, subscriptionHandle, alias, displayNameString, applicationString, subscriptionType); - } - else if (!stricmp(eventTypeCstr, "SessionUpdatedEvent")) + else if (!stricmp(eventTypeCstr, "SessionUpdatedEvent")) { /* <Event type="SessionUpdatedEvent"> @@ -7660,6 +6892,9 @@ void LLVivoxProtocolParser::processResponse(std::string tag) */ // We don't need to process this, but we also shouldn't warn on it, since that confuses people. } + else if (!stricmp(eventTypeCstr, "VoiceServiceConnectionStateChangedEvent")) + { // Yet another ignored event + } else { LL_WARNS("VivoxProtocolParser") << "Unknown event type " << eventTypeString << LL_ENDL; @@ -7696,14 +6931,6 @@ void LLVivoxProtocolParser::processResponse(std::string tag) { LLVivoxVoiceClient::getInstance()->connectorShutdownResponse(statusCode, statusString); } - else if (!stricmp(actionCstr, "Account.ListBlockRules.1")) - { - LLVivoxVoiceClient::getInstance()->accountListBlockRulesResponse(statusCode, statusString); - } - else if (!stricmp(actionCstr, "Account.ListAutoAcceptRules.1")) - { - LLVivoxVoiceClient::getInstance()->accountListAutoAcceptRulesResponse(statusCode, statusString); - } else if (!stricmp(actionCstr, "Session.Set3DPosition.1")) { // We don't need to process these, but they're so spammy we don't want to log them. diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h index a6f40eb3e9..e2d1585c15 100755 --- a/indra/newview/llvoicevivox.h +++ b/indra/newview/llvoicevivox.h @@ -48,7 +48,6 @@ class LLVivoxProtocolParser; class LLAvatarName; class LLVivoxVoiceAccountProvisionResponder; class LLVivoxVoiceClientMuteListObserver; -class LLVivoxVoiceClientFriendsObserver; class LLVivoxVoiceClient : public LLSingleton<LLVivoxVoiceClient>, @@ -181,7 +180,6 @@ public: //@{ virtual BOOL getVoiceEnabled(const LLUUID& id); // true if we've received data for this avatar virtual std::string getDisplayName(const LLUUID& id); - virtual BOOL isOnlineSIP(const LLUUID &id); virtual BOOL isParticipantAvatar(const LLUUID &id); virtual BOOL getIsSpeaking(const LLUUID& id); virtual BOOL getIsModeratorMuted(const LLUUID& id); @@ -490,14 +488,10 @@ protected: void participantRemovedEvent(std::string &sessionHandle, std::string &sessionGroupHandle, std::string &uriString, std::string &alias, std::string &nameString); void participantUpdatedEvent(std::string &sessionHandle, std::string &sessionGroupHandle, std::string &uriString, std::string &alias, bool isModeratorMuted, bool isSpeaking, int volume, F32 energy); void auxAudioPropertiesEvent(F32 energy); - void buddyPresenceEvent(std::string &uriString, std::string &alias, std::string &statusString, std::string &applicationString); void messageEvent(std::string &sessionHandle, std::string &uriString, std::string &alias, std::string &messageHeader, std::string &messageBody, std::string &applicationString); void sessionNotificationEvent(std::string &sessionHandle, std::string &uriString, std::string ¬ificationType); - void subscriptionEvent(std::string &buddyURI, std::string &subscriptionHandle, std::string &alias, std::string &displayName, std::string &applicationString, std::string &subscriptionType); - void buddyListChanged(); void muteListChanged(); - void updateFriends(U32 mask); ///////////////////////////// // Sending updates of current state @@ -588,24 +582,6 @@ protected: typedef std::map<std::string, buddyListEntry*> buddyListMap; - // This should be called when parsing a buddy list entry sent by SLVoice. - void processBuddyListEntry(const std::string &uri, const std::string &displayName); - - buddyListEntry *addBuddy(const std::string &uri); - buddyListEntry *addBuddy(const std::string &uri, const std::string &displayName); - buddyListEntry *findBuddy(const std::string &uri); - buddyListEntry *findBuddy(const LLUUID &id); - buddyListEntry *findBuddyByDisplayName(const std::string &name); - void deleteBuddy(const std::string &uri); - void deleteAllBuddies(void); - - void deleteAllBlockRules(void); - void addBlockRule(const std::string &blockMask, const std::string &presenceOnly); - void deleteAllAutoAcceptRules(void); - void addAutoAcceptRule(const std::string &autoAcceptMask, const std::string &autoAddAsBuddy); - void accountListBlockRulesResponse(int statusCode, const std::string &statusString); - void accountListAutoAcceptRulesResponse(int statusCode, const std::string &statusString); - ///////////////////////////// // session control messages @@ -774,8 +750,7 @@ private: void buildSetCaptureDevice(std::ostringstream &stream); void buildSetRenderDevice(std::ostringstream &stream); - void clearAllLists(); - void checkFriend(const LLUUID& id); + void sendFriendsListUpdates(); // start a text IM session with the specified user diff --git a/indra/newview/llvopartgroup.cpp b/indra/newview/llvopartgroup.cpp index 43a5ddba42..9f4f11b317 100755 --- a/indra/newview/llvopartgroup.cpp +++ b/indra/newview/llvopartgroup.cpp @@ -49,17 +49,11 @@ const F32 MAX_PART_LIFETIME = 120.f; extern U64 gFrameTime; LLPointer<LLVertexBuffer> LLVOPartGroup::sVB = NULL; -S32 LLVOPartGroup::sVBSlotFree[]; -S32* LLVOPartGroup::sVBSlotCursor = NULL; +S32 LLVOPartGroup::sVBSlotCursor = 0; void LLVOPartGroup::initClass() { - for (S32 i = 0; i < LL_MAX_PARTICLE_COUNT; ++i) - { - sVBSlotFree[i] = i; - } - - sVBSlotCursor = sVBSlotFree; + } //static @@ -124,36 +118,33 @@ void LLVOPartGroup::destroyGL() //static S32 LLVOPartGroup::findAvailableVBSlot() { - if (sVBSlotCursor >= sVBSlotFree+LL_MAX_PARTICLE_COUNT) + if (sVBSlotCursor >= LL_MAX_PARTICLE_COUNT) { //no more available slots return -1; } - S32 ret = *sVBSlotCursor; - sVBSlotCursor++; - - return ret; + return sVBSlotCursor++; } bool ll_is_part_idx_allocated(S32 idx, S32* start, S32* end) { - while (start < end) + /*while (start < end) { if (*start == idx) { //not allocated (in free list) return false; } ++start; - } + }*/ //allocated (not in free list) - return true; + return false; } //static void LLVOPartGroup::freeVBSlot(S32 idx) { - llassert(idx < LL_MAX_PARTICLE_COUNT && idx >= 0); + /*llassert(idx < LL_MAX_PARTICLE_COUNT && idx >= 0); //llassert(sVBSlotCursor > sVBSlotFree); //llassert(ll_is_part_idx_allocated(idx, sVBSlotCursor, sVBSlotFree+LL_MAX_PARTICLE_COUNT)); @@ -161,7 +152,7 @@ void LLVOPartGroup::freeVBSlot(S32 idx) { sVBSlotCursor--; *sVBSlotCursor = idx; - } + }*/ } LLVOPartGroup::LLVOPartGroup(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) @@ -185,17 +176,28 @@ BOOL LLVOPartGroup::isActive() const F32 LLVOPartGroup::getBinRadius() { - return mScale.mV[0]*2.f; + return mViewerPartGroupp->getBoxSide(); } void LLVOPartGroup::updateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) { const LLVector3& pos_agent = getPositionAgent(); - newMin.load3( (pos_agent - mScale).mV); - newMax.load3( (pos_agent + mScale).mV); - LLVector4a pos; - pos.load3(pos_agent.mV); - mDrawable->setPositionGroup(pos); + + LLVector4a scale; + LLVector4a p; + + p.load3(pos_agent.mV); + + scale.splat(mScale.mV[0]+mViewerPartGroupp->getBoxSide()*0.5f); + + newMin.setSub(p, scale); + newMax.setAdd(p,scale); + + llassert(newMin.isFinite3()); + llassert(newMax.isFinite3()); + + llassert(p.isFinite3()); + mDrawable->setPositionGroup(p); } void LLVOPartGroup::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) @@ -234,6 +236,37 @@ LLDrawable* LLVOPartGroup::createDrawable(LLPipeline *pipeline) const F32 MAX_PARTICLE_AREA_SCALE = 0.02f; // some tuned constant, limits on how much particle area to draw + LLUUID LLVOPartGroup::getPartOwner(S32 idx) + { + LLUUID ret = LLUUID::null; + + if (idx < (S32) mViewerPartGroupp->mParticles.size()) + { + ret = mViewerPartGroupp->mParticles[idx]->mPartSourcep->getOwnerUUID(); + } + + return ret; + } + + LLUUID LLVOPartGroup::getPartSource(S32 idx) + { + LLUUID ret = LLUUID::null; + + if (idx < (S32) mViewerPartGroupp->mParticles.size()) + { + LLViewerPart* part = mViewerPartGroupp->mParticles[idx]; + if (part && part->mPartSourcep.notNull() && + part->mPartSourcep->mSourceObjectp.notNull()) + { + LLViewerObject* source = part->mPartSourcep->mSourceObjectp; + ret = source->getID(); + } + } + + return ret; + } + + F32 LLVOPartGroup::getPartSize(S32 idx) { if (idx < (S32) mViewerPartGroupp->mParticles.size()) @@ -244,6 +277,16 @@ F32 LLVOPartGroup::getPartSize(S32 idx) return 0.f; } +void LLVOPartGroup::getBlendFunc(S32 idx, U32& src, U32& dst) +{ + if (idx < (S32) mViewerPartGroupp->mParticles.size()) + { + LLViewerPart* part = mViewerPartGroupp->mParticles[idx]; + src = part->mBlendFuncSource; + dst = part->mBlendFuncDest; + } +} + LLVector3 LLVOPartGroup::getCameraPosition() const { return gAgentCamera.getCameraPositionAgent(); @@ -303,19 +346,52 @@ BOOL LLVOPartGroup::updateGeometry(LLDrawable *drawable) mDepth = 0.f; S32 i = 0 ; LLVector3 camera_agent = getCameraPosition(); + + F32 max_scale = 0.f; + + for (i = 0 ; i < (S32)mViewerPartGroupp->mParticles.size(); i++) { const LLViewerPart *part = mViewerPartGroupp->mParticles[i]; + + //remember the largest particle + max_scale = llmax(max_scale, part->mScale.mV[0], part->mScale.mV[1]); + + if (part->mFlags & LLPartData::LL_PART_RIBBON_MASK) + { //include ribbon segment length in scale + const LLVector3* pos_agent = NULL; + if (part->mParent) + { + pos_agent = &(part->mParent->mPosAgent); + } + else if (part->mPartSourcep.notNull()) + { + pos_agent = &(part->mPartSourcep->mPosAgent); + } + + if (pos_agent) + { + F32 dist = (*pos_agent-part->mPosAgent).length(); + + max_scale = llmax(max_scale, dist); + } + } + LLVector3 part_pos_agent(part->mPosAgent); LLVector3 at(part_pos_agent - camera_agent); + F32 camera_dist_squared = at.lengthSquared(); F32 inv_camera_dist_squared; if (camera_dist_squared > 1.f) inv_camera_dist_squared = 1.f / camera_dist_squared; else inv_camera_dist_squared = 1.f; + + llassert(llfinite(inv_camera_dist_squared)); + llassert(!llisnan(inv_camera_dist_squared)); + F32 area = part->mScale.mV[0] * part->mScale.mV[1] * inv_camera_dist_squared; tot_area = llmax(tot_area, area); @@ -382,104 +458,258 @@ BOOL LLVOPartGroup::updateGeometry(LLDrawable *drawable) facep->setSize(0, 0); } + //record max scale (used to stretch bounding box for visibility culling) + + mScale.set(max_scale, max_scale, max_scale); + mDrawable->movePartition(); LLPipeline::sCompiles++; return TRUE; } + +BOOL LLVOPartGroup::lineSegmentIntersect(const LLVector4a& start, const LLVector4a& end, + S32 face, + BOOL pick_transparent, + S32* face_hit, + LLVector4a* intersection, + LLVector2* tex_coord, + LLVector4a* normal, + LLVector4a* bi_normal) +{ + LLVector4a dir; + dir.setSub(end, start); + + F32 closest_t = 2.f; + BOOL ret = FALSE; + + for (U32 idx = 0; idx < mViewerPartGroupp->mParticles.size(); ++idx) + { + const LLViewerPart &part = *((LLViewerPart*) (mViewerPartGroupp->mParticles[idx])); + + LLVector4a v[4]; + LLStrider<LLVector4a> verticesp; + verticesp = v; + + getGeometry(part, verticesp); + + F32 a,b,t; + if (LLTriangleRayIntersect(v[0], v[1], v[2], start, dir, a,b,t) || + LLTriangleRayIntersect(v[1], v[3], v[2], start, dir, a,b,t)) + { + if (t >= 0.f && + t <= 1.f && + t < closest_t) + { + ret = TRUE; + closest_t = t; + if (face_hit) + { + *face_hit = idx; + } + + if (intersection) + { + LLVector4a intersect = dir; + intersect.mul(closest_t); + intersection->setAdd(intersect, start); + } + } + } + } + + return ret; +} + +void LLVOPartGroup::getGeometry(const LLViewerPart& part, + LLStrider<LLVector4a>& verticesp) +{ + if (part.mFlags & LLPartData::LL_PART_RIBBON_MASK) + { + LLVector4a axis, pos, paxis, ppos; + F32 scale, pscale; + + pos.load3(part.mPosAgent.mV); + axis.load3(part.mAxis.mV); + scale = part.mScale.mV[0]; + + if (part.mParent) + { + ppos.load3(part.mParent->mPosAgent.mV); + paxis.load3(part.mParent->mAxis.mV); + pscale = part.mParent->mScale.mV[0]; + } + else + { //use source object as position + + if (part.mPartSourcep->mSourceObjectp.notNull()) + { + LLVector3 v = LLVector3(0,0,1); + v *= part.mPartSourcep->mSourceObjectp->getRenderRotation(); + paxis.load3(v.mV); + ppos.load3(part.mPartSourcep->mPosAgent.mV); + pscale = part.mStartScale.mV[0]; + } + else + { //no source object, no parent, nothing to draw + ppos = pos; + pscale = scale; + paxis = axis; + } + } + + LLVector4a p0, p1, p2, p3; + + scale *= 0.5f; + pscale *= 0.5f; + + axis.mul(scale); + paxis.mul(pscale); + + p0.setAdd(pos, axis); + p1.setSub(pos,axis); + p2.setAdd(ppos, paxis); + p3.setSub(ppos, paxis); + + (*verticesp++) = p2; + (*verticesp++) = p3; + (*verticesp++) = p0; + (*verticesp++) = p1; + } + else + { + LLVector4a part_pos_agent; + part_pos_agent.load3(part.mPosAgent.mV); + LLVector4a camera_agent; + camera_agent.load3(getCameraPosition().mV); + LLVector4a at; + at.setSub(part_pos_agent, camera_agent); + LLVector4a up(0, 0, 1); + LLVector4a right; + + right.setCross3(at, up); + right.normalize3fast(); + + up.setCross3(right, at); + up.normalize3fast(); + + if (part.mFlags & LLPartData::LL_PART_FOLLOW_VELOCITY_MASK) + { + LLVector4a normvel; + normvel.load3(part.mVelocity.mV); + normvel.normalize3fast(); + LLVector2 up_fracs; + up_fracs.mV[0] = normvel.dot3(right).getF32(); + up_fracs.mV[1] = normvel.dot3(up).getF32(); + up_fracs.normalize(); + LLVector4a new_up; + LLVector4a new_right; + + //new_up = up_fracs.mV[0] * right + up_fracs.mV[1]*up; + LLVector4a t = right; + t.mul(up_fracs.mV[0]); + new_up = up; + new_up.mul(up_fracs.mV[1]); + new_up.add(t); + + //new_right = up_fracs.mV[1] * right - up_fracs.mV[0]*up; + t = right; + t.mul(up_fracs.mV[1]); + new_right = up; + new_right.mul(up_fracs.mV[0]); + t.sub(new_right); + + up = new_up; + right = t; + up.normalize3fast(); + right.normalize3fast(); + } + + right.mul(0.5f*part.mScale.mV[0]); + up.mul(0.5f*part.mScale.mV[1]); + + + //HACK -- the verticesp->mV[3] = 0.f here are to set the texture index to 0 (particles don't use texture batching, maybe they should) + // this works because there is actually a 4th float stored after the vertex position which is used as a texture index + // also, somebody please VECTORIZE THIS + + LLVector4a ppapu; + LLVector4a ppamu; + + ppapu.setAdd(part_pos_agent, up); + ppamu.setSub(part_pos_agent, up); + + verticesp->setSub(ppapu, right); + (*verticesp++).getF32ptr()[3] = 0.f; + verticesp->setSub(ppamu, right); + (*verticesp++).getF32ptr()[3] = 0.f; + verticesp->setAdd(ppapu, right); + (*verticesp++).getF32ptr()[3] = 0.f; + verticesp->setAdd(ppamu, right); + (*verticesp++).getF32ptr()[3] = 0.f; + } +} + + + void LLVOPartGroup::getGeometry(S32 idx, LLStrider<LLVector4a>& verticesp, LLStrider<LLVector3>& normalsp, LLStrider<LLVector2>& texcoordsp, LLStrider<LLColor4U>& colorsp, + LLStrider<LLColor4U>& emissivep, LLStrider<U16>& indicesp) { if (idx >= (S32) mViewerPartGroupp->mParticles.size()) { return; } - + const LLViewerPart &part = *((LLViewerPart*) (mViewerPartGroupp->mParticles[idx])); - LLVector4a part_pos_agent; - part_pos_agent.load3(part.mPosAgent.mV); - LLVector4a camera_agent; - camera_agent.load3(getCameraPosition().mV); - LLVector4a at; - at.setSub(part_pos_agent, camera_agent); - LLVector4a up(0, 0, 1); - LLVector4a right; + getGeometry(part, verticesp); - right.setCross3(at, up); - right.normalize3fast(); + LLColor4U pcolor; + LLColor4U color = part.mColor; - up.setCross3(right, at); - up.normalize3fast(); + LLColor4U pglow; - if (part.mFlags & LLPartData::LL_PART_FOLLOW_VELOCITY_MASK) + if (part.mFlags & LLPartData::LL_PART_RIBBON_MASK) + { //make sure color blends properly + if (part.mParent) + { + pglow = part.mParent->mGlow; + pcolor = part.mParent->mColor; + } + else + { + pglow = LLColor4U(0, 0, 0, (U8) llround(255.f*part.mStartGlow)); + pcolor = part.mStartColor; + } + } + else { - LLVector4a normvel; - normvel.load3(part.mVelocity.mV); - normvel.normalize3fast(); - LLVector2 up_fracs; - up_fracs.mV[0] = normvel.dot3(right).getF32(); - up_fracs.mV[1] = normvel.dot3(up).getF32(); - up_fracs.normalize(); - LLVector4a new_up; - LLVector4a new_right; - - //new_up = up_fracs.mV[0] * right + up_fracs.mV[1]*up; - LLVector4a t = right; - t.mul(up_fracs.mV[0]); - new_up = up; - new_up.mul(up_fracs.mV[1]); - new_up.add(t); - - //new_right = up_fracs.mV[1] * right - up_fracs.mV[0]*up; - t = right; - t.mul(up_fracs.mV[1]); - new_right = up; - new_right.mul(up_fracs.mV[0]); - t.sub(new_right); - - up = new_up; - right = t; - up.normalize3fast(); - right.normalize3fast(); + pglow = part.mGlow; + pcolor = color; } - right.mul(0.5f*part.mScale.mV[0]); - up.mul(0.5f*part.mScale.mV[1]); - - - LLVector3 normal = -LLViewerCamera::getInstance()->getXAxis(); - - //HACK -- the verticesp->mV[3] = 0.f here are to set the texture index to 0 (particles don't use texture batching, maybe they should) - // this works because there is actually a 4th float stored after the vertex position which is used as a texture index - // also, somebody please VECTORIZE THIS - - LLVector4a ppapu; - LLVector4a ppamu; - - ppapu.setAdd(part_pos_agent, up); - ppamu.setSub(part_pos_agent, up); - - verticesp->setSub(ppapu, right); - (*verticesp++).getF32ptr()[3] = 0.f; - verticesp->setSub(ppamu, right); - (*verticesp++).getF32ptr()[3] = 0.f; - verticesp->setAdd(ppapu, right); - (*verticesp++).getF32ptr()[3] = 0.f; - verticesp->setAdd(ppamu, right); - (*verticesp++).getF32ptr()[3] = 0.f; + *colorsp++ = pcolor; + *colorsp++ = pcolor; + *colorsp++ = color; + *colorsp++ = color; + + //if (pglow.mV[3] || part.mGlow.mV[3]) + { //only write glow if it is not zero + *emissivep++ = pglow; + *emissivep++ = pglow; + *emissivep++ = part.mGlow; + *emissivep++ = part.mGlow; + } - *colorsp++ = part.mColor; - *colorsp++ = part.mColor; - *colorsp++ = part.mColor; - *colorsp++ = part.mColor; if (!(part.mFlags & LLPartData::LL_PART_EMISSIVE_MASK)) { //not fullbright, needs normal + LLVector3 normal = -LLViewerCamera::getInstance()->getXAxis(); *normalsp++ = normal; *normalsp++ = normal; *normalsp++ = normal; @@ -618,10 +848,13 @@ void LLParticlePartition::getGeometry(LLSpatialGroup* group) LLStrider<LLVector3> normalsp; LLStrider<LLVector2> texcoordsp; LLStrider<LLColor4U> colorsp; + LLStrider<LLColor4U> emissivep; buffer->getVertexStrider(verticesp); buffer->getNormalStrider(normalsp); buffer->getColorStrider(colorsp); + buffer->getEmissiveStrider(emissivep); + LLSpatialGroup::drawmap_elem_t& draw_vec = group->mDrawMap[mRenderPass]; @@ -630,7 +863,7 @@ void LLParticlePartition::getGeometry(LLSpatialGroup* group) LLFace* facep = *i; LLAlphaObject* object = (LLAlphaObject*) facep->getViewerObject(); - if (!facep->isState(LLFace::PARTICLE)) + //if (!facep->isState(LLFace::PARTICLE)) { //set the indices of this face S32 idx = LLVOPartGroup::findAvailableVBSlot(); if (idx >= 0) @@ -639,7 +872,7 @@ void LLParticlePartition::getGeometry(LLSpatialGroup* group) facep->setIndicesIndex(idx*6); facep->setVertexBuffer(LLVOPartGroup::sVB); facep->setPoolType(LLDrawPool::POOL_ALPHA); - facep->setState(LLFace::PARTICLE); + //facep->setState(LLFace::PARTICLE); } else { @@ -654,9 +887,19 @@ void LLParticlePartition::getGeometry(LLSpatialGroup* group) LLStrider<LLVector3> cur_norm = normalsp + geom_idx; LLStrider<LLVector2> cur_tc = texcoordsp + geom_idx; LLStrider<LLColor4U> cur_col = colorsp + geom_idx; + LLStrider<LLColor4U> cur_glow = emissivep + geom_idx; + + LLColor4U* start_glow = cur_glow.get(); - object->getGeometry(facep->getTEOffset(), cur_vert, cur_norm, cur_tc, cur_col, cur_idx); + object->getGeometry(facep->getTEOffset(), cur_vert, cur_norm, cur_tc, cur_col, cur_glow, cur_idx); + BOOL has_glow = FALSE; + + if (cur_glow.get() != start_glow) + { + has_glow = TRUE; + } + llassert(facep->getGeomCount() == 4); llassert(facep->getIndicesCount() == 6); @@ -671,24 +914,37 @@ void LLParticlePartition::getGeometry(LLSpatialGroup* group) bool batched = false; - if (idx >= 0 && - draw_vec[idx]->mTexture == facep->getTexture() && - draw_vec[idx]->mFullbright == fullbright) + U32 bf_src = LLRender::BF_SOURCE_ALPHA; + U32 bf_dst = LLRender::BF_ONE_MINUS_SOURCE_ALPHA; + + object->getBlendFunc(facep->getTEOffset(), bf_src, bf_dst); + + + if (idx >= 0) { - if (draw_vec[idx]->mEnd == facep->getGeomIndex()-1) - { - batched = true; - draw_vec[idx]->mCount += facep->getIndicesCount(); - draw_vec[idx]->mEnd += facep->getGeomCount(); - draw_vec[idx]->mVSize = llmax(draw_vec[idx]->mVSize, vsize); - } - else if (draw_vec[idx]->mStart == facep->getGeomIndex()+facep->getGeomCount()+1) + LLDrawInfo* info = draw_vec[idx]; + + if (info->mTexture == facep->getTexture() && + info->mHasGlow == has_glow && + info->mFullbright == fullbright && + info->mBlendFuncDst == bf_dst && + info->mBlendFuncSrc == bf_src) { - batched = true; - draw_vec[idx]->mCount += facep->getIndicesCount(); - draw_vec[idx]->mStart -= facep->getGeomCount(); - draw_vec[idx]->mOffset = facep->getIndicesStart(); - draw_vec[idx]->mVSize = llmax(draw_vec[idx]->mVSize, vsize); + if (draw_vec[idx]->mEnd == facep->getGeomIndex()-1) + { + batched = true; + info->mCount += facep->getIndicesCount(); + info->mEnd += facep->getGeomCount(); + info->mVSize = llmax(draw_vec[idx]->mVSize, vsize); + } + else if (draw_vec[idx]->mStart == facep->getGeomIndex()+facep->getGeomCount()+1) + { + batched = true; + info->mCount += facep->getIndicesCount(); + info->mStart -= facep->getGeomCount(); + info->mOffset = facep->getIndicesStart(); + info->mVSize = llmax(draw_vec[idx]->mVSize, vsize); + } } } @@ -705,6 +961,10 @@ void LLParticlePartition::getGeometry(LLSpatialGroup* group) info->mExtents[0] = group->mObjectExtents[0]; info->mExtents[1] = group->mObjectExtents[1]; info->mVSize = vsize; + info->mBlendFuncDst = bf_dst; + info->mBlendFuncSrc = bf_src; + info->mHasGlow = has_glow; + info->mParticle = TRUE; draw_vec.push_back(info); //for alpha sorting facep->setDrawInfo(info); diff --git a/indra/newview/llvopartgroup.h b/indra/newview/llvopartgroup.h index 42c1252d01..724e915d02 100755 --- a/indra/newview/llvopartgroup.h +++ b/indra/newview/llvopartgroup.h @@ -42,8 +42,7 @@ public: //vertex buffer for holding all particles static LLPointer<LLVertexBuffer> sVB; - static S32 sVBSlotFree[LL_MAX_PARTICLE_COUNT]; - static S32* sVBSlotCursor; + static S32 sVBSlotCursor; static void initClass(); static void restoreGL(); @@ -57,6 +56,7 @@ public: LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_COLOR | + LLVertexBuffer::MAP_EMISSIVE | LLVertexBuffer::MAP_TEXTURE_INDEX }; @@ -69,20 +69,37 @@ public: virtual void updateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax); virtual U32 getPartitionType() const; + /*virtual*/ BOOL lineSegmentIntersect(const LLVector4a& start, const LLVector4a& end, + S32 face, + BOOL pick_transparent, + S32* face_hit, + LLVector4a* intersection, + LLVector2* tex_coord, + LLVector4a* normal, + LLVector4a* tangent); + /*virtual*/ void setPixelAreaAndAngle(LLAgent &agent); /*virtual*/ void updateTextures(); /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline); /*virtual*/ BOOL updateGeometry(LLDrawable *drawable); + void getGeometry(const LLViewerPart& part, + LLStrider<LLVector4a>& verticesp); + void getGeometry(S32 idx, LLStrider<LLVector4a>& verticesp, LLStrider<LLVector3>& normalsp, LLStrider<LLVector2>& texcoordsp, LLStrider<LLColor4U>& colorsp, + LLStrider<LLColor4U>& emissivep, LLStrider<U16>& indicesp); void updateFaceSize(S32 idx) { } F32 getPartSize(S32 idx); + void getBlendFunc(S32 idx, U32& src, U32& dst); + LLUUID getPartOwner(S32 idx); + LLUUID getPartSource(S32 idx); + void setViewerPartGroup(LLViewerPartGroup *part_groupp) { mViewerPartGroupp = part_groupp; } LLViewerPartGroup* getViewerPartGroup() { return mViewerPartGroupp; } diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 007c2b9003..d9efd23b43 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -101,6 +101,8 @@ static LLFastTimer::DeclareTimer FTM_GEN_TRIANGLES("Generate Triangles"); static LLFastTimer::DeclareTimer FTM_GEN_VOLUME("Generate Volumes"); static LLFastTimer::DeclareTimer FTM_VOLUME_TEXTURES("Volume Textures"); +extern BOOL gGLDebugLoggingEnabled; + // Implementation class of LLMediaDataClientObject. See llmediadataclient.h class LLMediaDataClientObjectImpl : public LLMediaDataClientObject { @@ -384,7 +386,6 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys, } else { - // CORY TO DO: Figure out how to get the value here if (update_type != OUT_TERSE_IMPROVED) { LLVolumeParams volume_params; @@ -453,6 +454,11 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys, mFaceMappingChanged = TRUE; mTexAnimMode = 0; } + + if (value & 0x400) + { //particle system (new) + unpackParticleSource(*dp, mOwnerID, false); + } } else { @@ -1096,6 +1102,12 @@ void LLVOVolume::notifyMeshLoaded() { mSculptChanged = TRUE; gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_GEOMETRY, TRUE); + + LLVOAvatar* avatar = getAvatar(); + if (avatar) + { + avatar->updateVisualComplexity(); + } } // sculpt replaces generate() for sculpted surfaces @@ -1113,33 +1125,49 @@ void LLVOVolume::sculpt() S32 max_discard = mSculptTexture->getMaxDiscardLevel(); if (discard_level > max_discard) - discard_level = max_discard; // clamp to the best we can do + { + discard_level = max_discard; // clamp to the best we can do + } + if(discard_level > MAX_DISCARD_LEVEL) + { + return; //we think data is not ready yet. + } S32 current_discard = getVolume()->getSculptLevel() ; if(current_discard < -2) { - static S32 low_sculpty_discard_warning_count = 100; - if (++low_sculpty_discard_warning_count >= 100) - { // Log first time, then every 100 afterwards otherwise this can flood the logs + static S32 low_sculpty_discard_warning_count = 1; + S32 exponent = llmax(1, llfloor( log10((F64) low_sculpty_discard_warning_count) )); + S32 interval = pow(10.0, exponent); + if ( low_sculpty_discard_warning_count < 10 || + (low_sculpty_discard_warning_count % interval) == 0) + { // Log first 10 time, then decreasing intervals afterwards otherwise this can flood the logs llwarns << "WARNING!!: Current discard for sculpty " << mSculptTexture->getID() << " at " << current_discard - << " is less than -2." << llendl; - low_sculpty_discard_warning_count = 0; + << " is less than -2." + << " Hit this " << low_sculpty_discard_warning_count << " times" + << llendl; } + low_sculpty_discard_warning_count++; // corrupted volume... don't update the sculpty return; } else if (current_discard > MAX_DISCARD_LEVEL) { - static S32 high_sculpty_discard_warning_count = 100; - if (++high_sculpty_discard_warning_count >= 100) - { // Log first time, then every 100 afterwards otherwise this can flood the logs + static S32 high_sculpty_discard_warning_count = 1; + S32 exponent = llmax(1, llfloor( log10((F64) high_sculpty_discard_warning_count) )); + S32 interval = pow(10.0, exponent); + if ( high_sculpty_discard_warning_count < 10 || + (high_sculpty_discard_warning_count % interval) == 0) + { // Log first 10 time, then decreasing intervals afterwards otherwise this can flood the logs llwarns << "WARNING!!: Current discard for sculpty " << mSculptTexture->getID() << " at " << current_discard - << " is more than than allowed max of " << MAX_DISCARD_LEVEL << llendl; - high_sculpty_discard_warning_count = 0; + << " is more than than allowed max of " << MAX_DISCARD_LEVEL + << ". Hit this " << high_sculpty_discard_warning_count << " times" + << llendl; } + high_sculpty_discard_warning_count++; // corrupted volume... don't update the sculpty return; @@ -1232,7 +1260,7 @@ BOOL LLVOVolume::calcLOD() else { distance = mDrawable->mDistanceWRTCamera; - radius = getVolume()->mLODScaleBias.scaledVec(getScale()).length(); + radius = getVolume() ? getVolume()->mLODScaleBias.scaledVec(getScale()).length() : getScale().length(); } //hold onto unmodified distance for debugging @@ -1262,7 +1290,7 @@ BOOL LLVOVolume::calcLOD() { //setDebugText(llformat("%.2f:%.2f, %d", debug_distance, radius, cur_detail)); - setDebugText(llformat("%d", mDrawable->getFace(0)->getTextureIndex())); + //setDebugText(llformat("%d", mDrawable->getFace(0)->getTextureIndex())); } if (cur_detail != mLOD) @@ -1452,7 +1480,7 @@ BOOL LLVOVolume::genBBoxes(BOOL force_global) continue; } res &= face->genVolumeBBoxes(*volume, i, - mRelativeXform, mRelativeXformInvTrans, + mRelativeXform, (mVolumeImpl && mVolumeImpl->isVolumeGlobal()) || force_global); if (rebuild) @@ -2590,6 +2618,7 @@ void LLVOVolume::setLightTextureID(LLUUID id) if (hasLightTexture()) { setParameterEntryInUse(LLNetworkData::PARAMS_LIGHT_IMAGE, FALSE, true); + parameterChanged(LLNetworkData::PARAMS_LIGHT_IMAGE, true); mLightTexture = NULL; } } @@ -2607,7 +2636,8 @@ void LLVOVolume::setSpotLightParams(LLVector3 params) void LLVOVolume::setIsLight(BOOL is_light) { - if (is_light != getIsLight()) + BOOL was_light = getIsLight(); + if (is_light != was_light) { if (is_light) { @@ -2792,7 +2822,7 @@ void LLVOVolume::updateSpotLightPriority() bool LLVOVolume::isLightSpotlight() const { LLLightImageParams* params = (LLLightImageParams*) getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE); - if (params) + if (params && getParameterEntryInUse(LLNetworkData::PARAMS_LIGHT_IMAGE)) { return params->isLightSpotlight(); } @@ -3015,7 +3045,7 @@ void LLVOVolume::generateSilhouette(LLSelectNode* nodep, const LLVector3& view_p //transform view vector into volume space view_vector -= getRenderPosition(); - mDrawable->mDistanceWRTCamera = view_vector.length(); + //mDrawable->mDistanceWRTCamera = view_vector.length(); LLQuaternion worldRot = getRenderRotation(); view_vector = view_vector * ~worldRot; if (!isVolumeGlobal()) @@ -3517,7 +3547,12 @@ F32 LLVOVolume::getBinRadius() } else if (mDrawable->isStatic()) { - radius = llmax((S32) mDrawable->getRadius(), 1)*size_factor; + F32 szf = size_factor; + + radius = llmax(mDrawable->getRadius(), szf); + + radius = powf(radius, 1.f+szf/radius); + radius *= 1.f + mDrawable->mDistanceWRTCamera * distance_factor[1]; radius += mDrawable->mDistanceWRTCamera * distance_factor[0]; } @@ -3717,8 +3752,30 @@ BOOL LLVOVolume::lineSegmentIntersect(const LLVector4a& start, const LLVector4a& { LLFace* face = mDrawable->getFace(face_hit); + bool ignore_alpha = false; + + const LLTextureEntry* te = face->getTextureEntry(); + if (te) + { + LLMaterial* mat = te->getMaterialParams(); + if (mat) + { + U8 mode = mat->getDiffuseAlphaMode(); + + if (mode == LLMaterial::DIFFUSE_ALPHA_MODE_EMISSIVE || + mode == LLMaterial::DIFFUSE_ALPHA_MODE_NONE) + { + ignore_alpha = true; + } + } + } + if (face && - (pick_transparent || !face->getTexture() || !face->getTexture()->hasGLTexture() || face->getTexture()->getMask(face->surfaceToTexture(tc, p, n)))) + (ignore_alpha || + pick_transparent || + !face->getTexture() || + !face->getTexture()->hasGLTexture() || + face->getTexture()->getMask(face->surfaceToTexture(tc, p, n)))) { local_end = p; if (face_hitp != NULL) @@ -3884,10 +3941,13 @@ void LLRiggedVolume::update(const LLMeshSkinInfo* skin, LLVOAvatar* avatar, cons } //build matrix palette - LLMatrix4a mp[64]; + static const size_t kMaxJoints = 64; + + LLMatrix4a mp[kMaxJoints]; LLMatrix4* mat = (LLMatrix4*) mp; - for (U32 j = 0; j < skin->mJointNames.size(); ++j) + U32 maxJoints = llmin(skin->mJointNames.size(), kMaxJoints); + for (U32 j = 0; j < maxJoints; ++j) { LLJoint* joint = avatar->getJoint(skin->mJointNames[j]); if (joint) @@ -3942,8 +4002,10 @@ void LLRiggedVolume::update(const LLMeshSkinInfo* skin, LLVOAvatar* avatar, cons F32 w = wght[k]; LLMatrix4a src; - src.setMul(mp[idx[k]], w); - + // Insure ref'd bone is in our clamped array of mats + llassert(idx[k] < kMaxJoints); + // clamp k to kMaxJoints to avoid reading garbage off stack in release + src.setMul(mp[idx[(k < kMaxJoints) ? k : 0]], w); final_mat.add(src); } @@ -4354,7 +4416,9 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) if (pAvatarVO) { pAvatarVO->mAttachmentGeometryBytes -= group->mGeometryBytes; + pAvatarVO->mAttachmentGeometryBytes = llmax(pAvatarVO->mAttachmentGeometryBytes, 0); pAvatarVO->mAttachmentSurfaceArea -= group->mSurfaceArea; + pAvatarVO->mAttachmentSurfaceArea = llmax(pAvatarVO->mAttachmentSurfaceArea, 0.f); } group->mGeometryBytes = 0; @@ -4367,14 +4431,25 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) mFaceList.clear(); - std::vector<LLFace*> fullbright_faces; - std::vector<LLFace*> bump_faces; - std::vector<LLFace*> norm_faces; - std::vector<LLFace*> spec_faces; - std::vector<LLFace*> normspec_faces; - std::vector<LLFace*> simple_faces; + const U32 MAX_FACE_COUNT = 4096; + + static LLFace** fullbright_faces = (LLFace**) ll_aligned_malloc(MAX_FACE_COUNT*sizeof(LLFace*),64); + static LLFace** bump_faces = (LLFace**) ll_aligned_malloc(MAX_FACE_COUNT*sizeof(LLFace*),64); + static LLFace** simple_faces = (LLFace**) ll_aligned_malloc(MAX_FACE_COUNT*sizeof(LLFace*),64); + static LLFace** norm_faces = (LLFace**) ll_aligned_malloc(MAX_FACE_COUNT*sizeof(LLFace*), 64); + static LLFace** spec_faces = (LLFace**) ll_aligned_malloc(MAX_FACE_COUNT*sizeof(LLFace*), 64); + static LLFace** normspec_faces = (LLFace**) ll_aligned_malloc(MAX_FACE_COUNT*sizeof(LLFace*), 64); + static LLFace** alpha_faces = (LLFace**) ll_aligned_malloc(MAX_FACE_COUNT*sizeof(LLFace*),64); + + U32 fullbright_count = 0; + U32 bump_count = 0; + U32 simple_count = 0; + U32 alpha_count = 0; + U32 norm_count = 0; + U32 spec_count = 0; + U32 normspec_count = 0; + - std::vector<LLFace*> alpha_faces; U32 useage = group->mSpatialPartition->mBufferUsage; U32 max_vertices = (gSavedSettings.getS32("RenderMaxVBOSize")*1024)/LLVertexBuffer::calcVertexSize(group->mSpatialPartition->mVertexDataMask); @@ -4743,7 +4818,10 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) { if (facep->canRenderAsMask()) { //can be treated as alpha mask - simple_faces.push_back(facep); + if (simple_count < MAX_FACE_COUNT) + { + simple_faces[simple_count++] = facep; + } } else { @@ -4751,7 +4829,10 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) { //only treat as alpha in the pipeline if < 100% transparent drawablep->setState(LLDrawable::HAS_ALPHA); } - alpha_faces.push_back(facep); + if (alpha_count < MAX_FACE_COUNT) + { + alpha_faces[alpha_count++] = facep; + } } } else @@ -4771,51 +4852,81 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) { if (mat->getSpecularID().notNull()) { //has normal and specular maps (needs texcoord1, texcoord2, and tangent) - normspec_faces.push_back(facep); + if (normspec_count < MAX_FACE_COUNT) + { + normspec_faces[normspec_count++] = facep; + } } else { //has normal map (needs texcoord1 and tangent) - norm_faces.push_back(facep); + if (norm_count < MAX_FACE_COUNT) + { + norm_faces[norm_count++] = facep; + } } } else if (mat->getSpecularID().notNull()) { //has specular map but no normal map, needs texcoord2 - spec_faces.push_back(facep); + if (spec_count < MAX_FACE_COUNT) + { + spec_faces[spec_count++] = facep; + } } else { //has neither specular map nor normal map, only needs texcoord0 - simple_faces.push_back(facep); + if (simple_count < MAX_FACE_COUNT) + { + simple_faces[simple_count++] = facep; + } } } else if (te->getBumpmap()) { //needs normal + tangent - bump_faces.push_back(facep); + if (bump_count < MAX_FACE_COUNT) + { + bump_faces[bump_count++] = facep; + } } else if (te->getShiny() || !te->getFullbright()) { //needs normal - simple_faces.push_back(facep); + if (simple_count < MAX_FACE_COUNT) + { + simple_faces[simple_count++] = facep; + } } else { //doesn't need normal facep->setState(LLFace::FULLBRIGHT); - fullbright_faces.push_back(facep); + if (fullbright_count < MAX_FACE_COUNT) + { + fullbright_faces[fullbright_count++] = facep; + } } } else { if (te->getBumpmap() && LLPipeline::sRenderBump) { //needs normal + tangent - bump_faces.push_back(facep); + if (bump_count < MAX_FACE_COUNT) + { + bump_faces[bump_count++] = facep; + } } else if ((te->getShiny() && LLPipeline::sRenderBump) || !(te->getFullbright() || bake_sunlight)) { //needs normal - simple_faces.push_back(facep); + if (simple_count < MAX_FACE_COUNT) + { + simple_faces[simple_count++] = facep; + } } else { //doesn't need normal facep->setState(LLFace::FULLBRIGHT); - fullbright_faces.push_back(facep); + if (fullbright_count < MAX_FACE_COUNT) + { + fullbright_faces[fullbright_count++] = facep; + } } } } @@ -4828,7 +4939,14 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) if (is_rigged) { - drawablep->setState(LLDrawable::RIGGED); + if (!drawablep->isState(LLDrawable::RIGGED)) + { + drawablep->setState(LLDrawable::RIGGED); + + //first time this is drawable is being marked as rigged, + // do another LoD update to use avatar bounding box + vobj->updateLOD(); + } } else { @@ -4870,13 +4988,13 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) fullbright_mask = fullbright_mask | LLVertexBuffer::MAP_TEXTURE_INDEX; } - genDrawInfo(group, simple_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, simple_faces, FALSE, batch_textures, FALSE); - genDrawInfo(group, fullbright_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, fullbright_faces, FALSE, batch_textures); - genDrawInfo(group, alpha_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, alpha_faces, TRUE, batch_textures); - genDrawInfo(group, bump_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, bump_faces, FALSE, FALSE); - genDrawInfo(group, norm_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, norm_faces, FALSE, FALSE); - genDrawInfo(group, spec_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, spec_faces, FALSE, FALSE); - genDrawInfo(group, normspec_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, normspec_faces, FALSE, FALSE); + genDrawInfo(group, simple_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, simple_faces, simple_count, FALSE, batch_textures, FALSE); + genDrawInfo(group, fullbright_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, fullbright_faces, fullbright_count, FALSE, batch_textures); + genDrawInfo(group, alpha_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, alpha_faces, alpha_count, TRUE, batch_textures); + genDrawInfo(group, bump_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, bump_faces, bump_count, FALSE, FALSE); + genDrawInfo(group, norm_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, norm_faces, norm_count, FALSE, FALSE); + genDrawInfo(group, spec_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, spec_faces, spec_count, FALSE, FALSE); + genDrawInfo(group, normspec_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, normspec_faces, normspec_count, FALSE, FALSE); if (!LLPipeline::sDelayVBUpdate) { @@ -4901,11 +5019,26 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) if (pAvatarVO) { + if (pAvatarVO->mAttachmentGeometryBytes < 0) + { // First time through value is -1 + pAvatarVO->mAttachmentGeometryBytes = group->mGeometryBytes; + } + else + { pAvatarVO->mAttachmentGeometryBytes += group->mGeometryBytes; + } + if (pAvatarVO->mAttachmentSurfaceArea < 0.f) + { // First time through value is -1 + pAvatarVO->mAttachmentSurfaceArea = group->mSurfaceArea; + } + else + { pAvatarVO->mAttachmentSurfaceArea += group->mSurfaceArea; } } +} +static LLFastTimer::DeclareTimer FTM_REBUILD_MESH_FLUSH("Flush Mesh"); void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group) { @@ -4915,11 +5048,14 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group) LLFastTimer ftm(FTM_REBUILD_VOLUME_VB); LLFastTimer t(FTM_REBUILD_VOLUME_GEN_DRAW_INFO); //make sure getgeometryvolume shows up in the right place in timers - S32 num_mapped_veretx_buffer = LLVertexBuffer::sMappedCount ; - group->mBuilt = 1.f; - std::set<LLVertexBuffer*> mapped_buffers; + S32 num_mapped_vertex_buffer = LLVertexBuffer::sMappedCount ; + + const U32 MAX_BUFFER_COUNT = 4096; + LLVertexBuffer* locked_buffer[MAX_BUFFER_COUNT]; + + U32 buffer_count = 0; for (LLSpatialGroup::element_iter drawable_iter = group->getDataBegin(); drawable_iter != group->getDataEnd(); ++drawable_iter) { @@ -4954,9 +5090,9 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group) } - if (buff->isLocked()) + if (buff->isLocked() && buffer_count < MAX_BUFFER_COUNT) { - mapped_buffers.insert(buff); + locked_buffer[buffer_count++] = buff; } } } @@ -4972,7 +5108,9 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group) } } - for (std::set<LLVertexBuffer*>::iterator iter = mapped_buffers.begin(); iter != mapped_buffers.end(); ++iter) + { + LLFastTimer t(FTM_REBUILD_MESH_FLUSH); + for (LLVertexBuffer** iter = locked_buffer, ** end_iter = locked_buffer+buffer_count; iter != end_iter; ++iter) { (*iter)->flush(); } @@ -4984,9 +5122,10 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group) { group->mVertexBuffer->flush(); } + } //if not all buffers are unmapped - if(num_mapped_veretx_buffer != LLVertexBuffer::sMappedCount) + if(num_mapped_vertex_buffer != LLVertexBuffer::sMappedCount) { llwarns << "Not all mapped vertex buffers are unmapped!" << llendl ; for (LLSpatialGroup::element_iter drawable_iter = group->getDataBegin(); drawable_iter != group->getDataEnd(); ++drawable_iter) @@ -5053,12 +5192,22 @@ static LLFastTimer::DeclareTimer FTM_GEN_DRAW_INFO_RESIZE_VB("Resize VB"); -void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::vector<LLFace*>& faces, BOOL distance_sort, BOOL batch_textures, BOOL no_materials) +void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace** faces, U32 face_count, BOOL distance_sort, BOOL batch_textures, BOOL no_materials) { LLFastTimer t(FTM_REBUILD_VOLUME_GEN_DRAW_INFO); U32 buffer_usage = group->mBufferUsage; + static LLCachedControl<bool> use_transform_feedback(gSavedSettings, "RenderUseTransformFeedback"); + + if (use_transform_feedback && + gTransformPositionProgram.mProgramObject && //transform shaders are loaded + buffer_usage == GL_DYNAMIC_DRAW_ARB && //target buffer is in VRAM + !(mask & LLVertexBuffer::MAP_WEIGHT4)) //TODO: add support for weights + { + buffer_usage = GL_DYNAMIC_COPY_ARB; + } + #if LL_DARWIN // HACK from Leslie: // Disable VBO usage for alpha on Mac OS X because it kills the framerate @@ -5079,17 +5228,18 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: if (!distance_sort) { //sort faces by things that break batches - std::sort(faces.begin(), faces.end(), CompareBatchBreakerModified()); + std::sort(faces, faces+face_count, CompareBatchBreakerModified()); } else { //sort faces by distance - std::sort(faces.begin(), faces.end(), LLFace::CompareDistanceGreater()); + std::sort(faces, faces+face_count, LLFace::CompareDistanceGreater()); } } bool hud_group = group->isHUDGroup() ; - std::vector<LLFace*>::iterator face_iter = faces.begin(); + LLFace** face_iter = faces; + LLFace** end_faces = faces+face_count; LLSpatialGroup::buffer_map_t buffer_map; @@ -5118,7 +5268,9 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: //NEVER use more than 16 texture index channels (workaround for prevalent driver bug) texture_index_channels = llmin(texture_index_channels, 16); - while (face_iter != faces.end()) + bool flexi = false; + + while (face_iter != end_faces) { //pull off next face LLFace* facep = *face_iter; @@ -5145,11 +5297,16 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: U32 index_count = facep->getIndicesCount(); U32 geom_count = facep->getGeomCount(); + flexi = flexi || facep->getViewerObject()->getVolume()->isUnique(); + //sum up vertices needed for this render batch - std::vector<LLFace*>::iterator i = face_iter; + LLFace** i = face_iter; ++i; - std::vector<LLViewerTexture*> texture_list; + const U32 MAX_TEXTURE_COUNT = 32; + LLViewerTexture* texture_list[MAX_TEXTURE_COUNT]; + + U32 texture_count = 0; { LLFastTimer t(FTM_GEN_DRAW_INFO_FACE_SIZE); @@ -5157,12 +5314,15 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: { U8 cur_tex = 0; facep->setTextureIndex(cur_tex); - texture_list.push_back(tex); + if (texture_count < MAX_TEXTURE_COUNT) + { + texture_list[texture_count++] = tex; + } if (can_batch_texture(facep)) { //populate texture_list with any textures that can be batched //move i to the next unbatchable face - while (i != faces.end()) + while (i != end_faces) { facep = *i; @@ -5178,7 +5338,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: if (distance_sort) { //textures might be out of order, see if texture exists in current batch bool found = false; - for (U32 tex_idx = 0; tex_idx < texture_list.size(); ++tex_idx) + for (U32 tex_idx = 0; tex_idx < texture_count; ++tex_idx) { if (facep->getTexture() == texture_list[tex_idx]) { @@ -5190,7 +5350,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: if (!found) { - cur_tex = texture_list.size(); + cur_tex = texture_count; } } else @@ -5205,7 +5365,10 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: tex = facep->getTexture(); - texture_list.push_back(tex); + if (texture_count < MAX_TEXTURE_COUNT) + { + texture_list[texture_count++] = tex; + } } if (geom_count + facep->getGeomCount() > max_vertices) @@ -5214,6 +5377,9 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: } ++i; + + flexi = flexi || facep->getViewerObject()->getVolume()->isUnique(); + index_count += facep->getIndicesCount(); geom_count += facep->getGeomCount(); @@ -5229,7 +5395,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: } else { - while (i != faces.end() && + while (i != end_faces && (LLPipeline::sTextureBindTest || (distance_sort || ((*i)->getTexture() == tex && @@ -5250,8 +5416,16 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: ++i; index_count += facep->getIndicesCount(); geom_count += facep->getGeomCount(); + + flexi = flexi || facep->getViewerObject()->getVolume()->isUnique(); + } } } + + + if (flexi && buffer_usage && buffer_usage != GL_STREAM_DRAW_ARB) + { + buffer_usage = GL_STREAM_DRAW_ARB; } //create vertex buffer @@ -5349,19 +5523,24 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: mode == LLMaterial::DIFFUSE_ALPHA_MODE_EMISSIVE; } - bool use_legacy_bump = te->getBumpmap() && (!mat || mat->getNormalID().isNull()); + bool use_legacy_bump = te->getBumpmap() && (te->getBumpmap() < 18) && (!mat || mat->getNormalID().isNull()); + bool opaque = te->getColor().mV[3] >= 0.999f; if (mat && LLPipeline::sRenderDeferred && !hud_group) { bool material_pass = false; - if (fullbright) + // do NOT use 'fullbright' for this logic or you risk sending + // things without normals down the materials pipeline and will + // render poorly if not crash NORSPEC-240,314 + // + if (te->getFullbright()) { if (mat->getDiffuseAlphaMode() == LLMaterial::DIFFUSE_ALPHA_MODE_MASK) { - if (te->getColor().mV[3] >= 0.999f) + if (opaque) { - material_pass = true; + registerFace(group, facep, LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK); } else { diff --git a/indra/newview/llwaterparammanager.cpp b/indra/newview/llwaterparammanager.cpp index 4f52ff9778..72d628fb88 100755 --- a/indra/newview/llwaterparammanager.cpp +++ b/indra/newview/llwaterparammanager.cpp @@ -188,13 +188,12 @@ void LLWaterParamManager::updateShaderUniforms(LLGLSLShader * shader) if (shader->mShaderGroup == LLGLSLShader::SG_WATER) { shader->uniform4fv(LLViewerShaderMgr::LIGHTNORM, 1, LLWLParamManager::getInstance()->getRotatedLightDir().mV); - shader->uniform3fv("camPosLocal", 1, LLViewerCamera::getInstance()->getOrigin().mV); - shader->uniform4fv("waterFogColor", 1, LLDrawPoolWater::sWaterFogColor.mV); - shader->uniform1f("waterFogEnd", LLDrawPoolWater::sWaterFogEnd); - shader->uniform4fv("waterPlane", 1, mWaterPlane.mV); - shader->uniform1f("waterFogDensity", getFogDensity()); - shader->uniform1f("waterFogKS", mWaterFogKS); - shader->uniform1f("distance_multiplier", 0); +shader->uniform3fv(LLShaderMgr::WL_CAMPOSLOCAL, 1, LLViewerCamera::getInstance()->getOrigin().mV); + shader->uniform4fv(LLShaderMgr::WATER_FOGCOLOR, 1, LLDrawPoolWater::sWaterFogColor.mV); + shader->uniform4fv(LLShaderMgr::WATER_WATERPLANE, 1, mWaterPlane.mV); + shader->uniform1f(LLShaderMgr::WATER_FOGDENSITY, getFogDensity()); + shader->uniform1f(LLShaderMgr::WATER_FOGKS, mWaterFogKS); + shader->uniform1f(LLViewerShaderMgr::DISTANCE_MULTIPLIER, 0); } } diff --git a/indra/newview/llwaterparamset.h b/indra/newview/llwaterparamset.h index b28585af59..368cb0ccba 100755 --- a/indra/newview/llwaterparamset.h +++ b/indra/newview/llwaterparamset.h @@ -33,6 +33,7 @@ #include "v4math.h" #include "v4color.h" #include "llviewershadermgr.h" +#include "llstringtable.h" class LLWaterParamSet; @@ -47,6 +48,9 @@ public: private: LLSD mParamValues; + std::vector<LLStaticHashedString> mParamHashedNames; + + void updateHashedNames(); public: @@ -140,6 +144,17 @@ inline void LLWaterParamSet::setAll(const LLSD& val) mParamValues[mIt->first] = mIt->second; } } + updateHashedNames(); +} + +inline void LLWaterParamSet::updateHashedNames() +{ + mParamHashedNames.clear(); + // Iterate through values + for(LLSD::map_iterator iter = mParamValues.beginMap(); iter != mParamValues.endMap(); ++iter) + { + mParamHashedNames.push_back(LLStaticHashedString(iter->first)); + } } inline const LLSD& LLWaterParamSet::getAll() diff --git a/indra/newview/llwlanimator.h b/indra/newview/llwlanimator.h index 5223b45343..810f4cf7e5 100755 --- a/indra/newview/llwlanimator.h +++ b/indra/newview/llwlanimator.h @@ -137,3 +137,4 @@ private: }; #endif // LL_WL_ANIMATOR_H + diff --git a/indra/newview/llwlparammanager.cpp b/indra/newview/llwlparammanager.cpp index 6077208799..ce9f61c0af 100755 --- a/indra/newview/llwlparammanager.cpp +++ b/indra/newview/llwlparammanager.cpp @@ -351,8 +351,8 @@ void LLWLParamManager::updateShaderUniforms(LLGLSLShader * shader) if (shader->mShaderGroup == LLGLSLShader::SG_DEFAULT) { - shader->uniform4fv(LLViewerShaderMgr::LIGHTNORM, 1, mRotatedLightDir.mV); - shader->uniform3fv("camPosLocal", 1, LLViewerCamera::getInstance()->getOrigin().mV); + shader->uniform4fv(LLShaderMgr::LIGHTNORM, 1, mRotatedLightDir.mV); + shader->uniform3fv(LLShaderMgr::WL_CAMPOSLOCAL, 1, LLViewerCamera::getInstance()->getOrigin().mV); } else if (shader->mShaderGroup == LLGLSLShader::SG_SKY) @@ -360,7 +360,7 @@ void LLWLParamManager::updateShaderUniforms(LLGLSLShader * shader) shader->uniform4fv(LLViewerShaderMgr::LIGHTNORM, 1, mClampedLightDir.mV); } - shader->uniform1f("scene_light_strength", mSceneLightStrength); + shader->uniform1f(LLShaderMgr::SCENE_LIGHT_STRENGTH, mSceneLightStrength); } diff --git a/indra/newview/llwlparammanager.h b/indra/newview/llwlparammanager.h index 72422500fc..e13aed98ed 100755 --- a/indra/newview/llwlparammanager.h +++ b/indra/newview/llwlparammanager.h @@ -412,3 +412,4 @@ inline LLVector4 LLWLParamManager::getRotatedLightDir(void) const } #endif + diff --git a/indra/newview/llwlparamset.cpp b/indra/newview/llwlparamset.cpp index dba3970635..8529a4614b 100755 --- a/indra/newview/llwlparamset.cpp +++ b/indra/newview/llwlparamset.cpp @@ -39,6 +39,22 @@ #include <sstream> +static LLStaticHashedString sStarBrightness("star_brightness"); +static LLStaticHashedString sPresetNum("preset_num"); +static LLStaticHashedString sSunAngle("sun_angle"); +static LLStaticHashedString sEastAngle("east_angle"); +static LLStaticHashedString sEnableCloudScroll("enable_cloud_scroll"); +static LLStaticHashedString sCloudScrollRate("cloud_scroll_rate"); +static LLStaticHashedString sLightNorm("lightnorm"); +static LLStaticHashedString sCloudDensity("cloud_pos_density1"); +static LLStaticHashedString sCloudScale("cloud_scale"); +static LLStaticHashedString sCloudShadow("cloud_shadow"); +static LLStaticHashedString sDensityMultiplier("density_multiplier"); +static LLStaticHashedString sDistanceMultiplier("distance_multiplier"); +static LLStaticHashedString sHazeDensity("haze_density"); +static LLStaticHashedString sHazeHorizon("haze_horizon"); +static LLStaticHashedString sMaxY("max_y"); + LLWLParamSet::LLWLParamSet(void) : mName("Unnamed Preset"), mCloudScrollXOffset(0.f), mCloudScrollYOffset(0.f) @@ -49,21 +65,24 @@ static LLFastTimer::DeclareTimer FTM_WL_PARAM_UPDATE("WL Param Update"); void LLWLParamSet::update(LLGLSLShader * shader) const { LLFastTimer t(FTM_WL_PARAM_UPDATE); - - for(LLSD::map_const_iterator i = mParamValues.beginMap(); - i != mParamValues.endMap(); - ++i) + LLSD::map_const_iterator i = mParamValues.beginMap(); + std::vector<LLStaticHashedString>::const_iterator n = mParamHashedNames.begin(); + for(;(i != mParamValues.endMap()) && (n != mParamHashedNames.end());++i, n++) { - const std::string& param = i->first; + const LLStaticHashedString& param = *n; - if (param == "star_brightness" || param == "preset_num" || param == "sun_angle" || - param == "east_angle" || param == "enable_cloud_scroll" || - param == "cloud_scroll_rate" || param == "lightnorm" ) + // check that our pre-hashed names are still tracking the mParamValues map correctly + // + llassert(param.String() == i->first); + + if (param == sStarBrightness || param == sPresetNum || param == sSunAngle || + param == sEastAngle || param == sEnableCloudScroll || + param == sCloudScrollRate || param == sLightNorm ) { continue; } - if (param == "cloud_pos_density1") + if (param == sCloudDensity) { LLVector4 val; val.mV[0] = F32(i->second[0].asReal()) + mCloudScrollXOffset; @@ -75,10 +94,10 @@ void LLWLParamSet::update(LLGLSLShader * shader) const shader->uniform4fv(param, 1, val.mV); stop_glerror(); } - else if (param == "cloud_scale" || param == "cloud_shadow" || - param == "density_multiplier" || param == "distance_multiplier" || - param == "haze_density" || param == "haze_horizon" || - param == "max_y" ) + else if (param == sCloudScale || param == sCloudShadow || + param == sDensityMultiplier || param == sDistanceMultiplier || + param == sHazeDensity || param == sHazeHorizon || + param == sMaxY ) { F32 val = (F32) i->second[0].asReal(); @@ -386,3 +405,14 @@ void LLWLParamSet::updateCloudScrolling(void) mCloudScrollYOffset += F32(delta_t * (getCloudScrollY() - 10.f) / 100.f); } } + +void LLWLParamSet::updateHashedNames() +{ + mParamHashedNames.clear(); + // Iterate through values + for(LLSD::map_iterator iter = mParamValues.beginMap(); iter != mParamValues.endMap(); ++iter) + { + mParamHashedNames.push_back(LLStaticHashedString(iter->first)); + } +} + diff --git a/indra/newview/llwlparamset.h b/indra/newview/llwlparamset.h index b087119dd5..6e5f1d3a4b 100755 --- a/indra/newview/llwlparamset.h +++ b/indra/newview/llwlparamset.h @@ -29,9 +29,11 @@ #include <string> #include <map> +#include <vector> #include "v4math.h" #include "v4color.h" +#include "llstaticstringtable.h" class LLWLParamSet; class LLGLSLShader; @@ -47,9 +49,12 @@ public: private: LLSD mParamValues; - + std::vector<LLStaticHashedString> mParamHashedNames; + float mCloudScrollXOffset, mCloudScrollYOffset; + void updateHashedNames(); + public: LLWLParamSet(); @@ -177,6 +182,8 @@ inline void LLWLParamSet::setAll(const LLSD& val) if(val.isMap()) { mParamValues = val; } + + updateHashedNames(); } inline const LLSD& LLWLParamSet::getAll() @@ -236,3 +243,4 @@ inline F32 LLWLParamSet::getCloudScrollY() { #endif // LL_WLPARAM_SET_H + diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index 1940cf541e..ae334d4bd2 100755 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -1792,3 +1792,5 @@ BOOL LLWorldMapView::handleDoubleClick( S32 x, S32 y, MASK mask ) } return FALSE; } + + diff --git a/indra/newview/macutil_Prefix.h b/indra/newview/macutil_Prefix.h index b54a764a62..b8df961cac 100755 --- a/indra/newview/macutil_Prefix.h +++ b/indra/newview/macutil_Prefix.h @@ -32,7 +32,6 @@ * */ -#include <Carbon/Carbon.h> #include "fix_macros.h" #undef verify diff --git a/indra/newview/noise.h b/indra/newview/noise.h index 0923bffcf2..b3efad73c5 100755 --- a/indra/newview/noise.h +++ b/indra/newview/noise.h @@ -310,6 +310,8 @@ static void normalize3(F32 v[3]) static void init(void) { + // we want repeatable noise (e.g. for stable terrain texturing), so seed with known value + srand(42); int i, j, k; for (i = 0 ; i < B ; i++) { @@ -340,6 +342,9 @@ static void init(void) for (j = 0 ; j < 3 ; j++) g3[B + i][j] = g3[i][j]; } + + // reintroduce entropy + srand(time(NULL)); // Flawfinder: ignore } #undef B diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index ebf6be4e36..b0c73d0304 100755 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -111,6 +111,8 @@ #include "llpathinglib.h" #include "llfloaterpathfindingconsole.h" #include "llfloaterpathfindingcharacters.h" +#include "llfloatertools.h" +#include "llpanelface.h" #include "llpathfindingpathtool.h" #ifdef _DEBUG @@ -120,6 +122,10 @@ //#define DEBUG_INDICES #endif +// Expensive and currently broken +// +#define MATERIALS_IN_REFLECTIONS 0 + bool gShiftFrame = false; //cached settings @@ -163,6 +169,7 @@ S32 LLPipeline::RenderGlowIterations; F32 LLPipeline::RenderGlowWidth; F32 LLPipeline::RenderGlowStrength; BOOL LLPipeline::RenderDepthOfField; +BOOL LLPipeline::RenderDepthOfFieldInEditMode; F32 LLPipeline::CameraFocusTransitionTime; F32 LLPipeline::CameraFNumber; F32 LLPipeline::CameraFocalLength; @@ -254,6 +261,17 @@ LLFastTimer::DeclareTimer FTM_RENDER_DEFERRED("Deferred Shading"); static LLFastTimer::DeclareTimer FTM_STATESORT_DRAWABLE("Sort Drawables"); static LLFastTimer::DeclareTimer FTM_STATESORT_POSTSORT("Post Sort"); +static LLStaticHashedString sTint("tint"); +static LLStaticHashedString sAmbiance("ambiance"); +static LLStaticHashedString sAlphaScale("alpha_scale"); +static LLStaticHashedString sNormMat("norm_mat"); +static LLStaticHashedString sOffset("offset"); +static LLStaticHashedString sScreenRes("screenRes"); +static LLStaticHashedString sDelta("delta"); +static LLStaticHashedString sDistFactor("dist_factor"); +static LLStaticHashedString sKern("kern"); +static LLStaticHashedString sKernScale("kern_scale"); + //---------------------------------------- std::string gPoolNames[] = { @@ -279,7 +297,7 @@ std::string gPoolNames[] = "POOL_ALPHA" }; -void drawBox(const LLVector3& c, const LLVector3& r); +void drawBox(const LLVector4a& c, const LLVector4a& r); void drawBoxOutline(const LLVector3& pos, const LLVector3& size); U32 nhpo2(U32 v); LLVertexBuffer* ll_create_cube_vb(U32 type_mask, U32 usage); @@ -373,6 +391,7 @@ BOOL LLPipeline::sWaterReflections = FALSE; BOOL LLPipeline::sRenderGlow = FALSE; BOOL LLPipeline::sReflectionRender = FALSE; BOOL LLPipeline::sImpostorRender = FALSE; +BOOL LLPipeline::sImpostorRenderAlphaDepthPass = FALSE; BOOL LLPipeline::sUnderWaterRender = FALSE; BOOL LLPipeline::sTextureBindTest = FALSE; BOOL LLPipeline::sRenderFrameTest = FALSE; @@ -615,6 +634,7 @@ void LLPipeline::init() connectRefreshCachedSettingsSafe("RenderGlowWidth"); connectRefreshCachedSettingsSafe("RenderGlowStrength"); connectRefreshCachedSettingsSafe("RenderDepthOfField"); + connectRefreshCachedSettingsSafe("RenderDepthOfFieldInEditMode"); connectRefreshCachedSettingsSafe("CameraFocusTransitionTime"); connectRefreshCachedSettingsSafe("CameraFNumber"); connectRefreshCachedSettingsSafe("CameraFocalLength"); @@ -787,14 +807,22 @@ void LLPipeline::resizeScreenTexture() GLuint resX = gViewerWindow->getWorldViewWidthRaw(); GLuint resY = gViewerWindow->getWorldViewHeightRaw(); + if ((resX != mScreen.getWidth()) || (resY != mScreen.getHeight())) + { + releaseScreenBuffers(); if (!allocateScreenBuffer(resX,resY)) - { //FAILSAFE: screen buffer allocation failed, disable deferred rendering if it's enabled + { +#if PROBABLE_FALSE_DISABLES_OF_ALM_HERE + //FAILSAFE: screen buffer allocation failed, disable deferred rendering if it's enabled //NOTE: if the session closes successfully after this call, deferred rendering will be // disabled on future sessions if (LLPipeline::sRenderDeferred) { gSavedSettings.setBOOL("RenderDeferred", FALSE); LLPipeline::refreshCachedSettings(); + + } +#endif } } } @@ -929,9 +957,12 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples) S32 shadow_detail = RenderShadowDetail; BOOL ssao = RenderDeferredSSAO; + const U32 occlusion_divisor = 3; + //allocate deferred rendering color buffers if (!mDeferredScreen.allocate(resX, resY, GL_SRGB8_ALPHA8, TRUE, TRUE, LLTexUnit::TT_RECT_TEXTURE, FALSE, samples)) return false; if (!mDeferredDepth.allocate(resX, resY, 0, TRUE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE, samples)) return false; + if (!mOcclusionDepth.allocate(resX/occlusion_divisor, resY/occlusion_divisor, 0, TRUE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE, samples)) return false; if (!addDeferredAttachments(mDeferredScreen)) return false; GLuint screenFormat = GL_RGBA16; @@ -944,7 +975,7 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples) { screenFormat = GL_RGBA16F_ARB; } - + if (!mScreen.allocate(resX, resY, screenFormat, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE, samples)) return false; if (samples > 0) { @@ -972,6 +1003,7 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples) for (U32 i = 0; i < 4; i++) { if (!mShadow[i].allocate(sun_shadow_map_width,U32(resY*scale), 0, TRUE, FALSE, LLTexUnit::TT_TEXTURE)) return false; + if (!mShadowOcclusion[i].allocate(mShadow[i].getWidth()/occlusion_divisor, mShadow[i].getHeight()/occlusion_divisor, 0, TRUE, FALSE, LLTexUnit::TT_TEXTURE)) return false; } } else @@ -979,6 +1011,7 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples) for (U32 i = 0; i < 4; i++) { mShadow[i].release(); + mShadowOcclusion[i].release(); } } @@ -991,6 +1024,7 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples) for (U32 i = 4; i < 6; i++) { if (!mShadow[i].allocate(spot_shadow_map_width, height, 0, TRUE, FALSE)) return false; + if (!mShadowOcclusion[i].allocate(mShadow[i].getWidth()/occlusion_divisor, mShadow[i].getHeight()/occlusion_divisor, 0, TRUE, FALSE)) return false; } } else @@ -998,6 +1032,7 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples) for (U32 i = 4; i < 6; i++) { mShadow[i].release(); + mShadowOcclusion[i].release(); } } @@ -1014,11 +1049,13 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples) for (U32 i = 0; i < 6; i++) { mShadow[i].release(); + mShadowOcclusion[i].release(); } mFXAABuffer.release(); mScreen.release(); mDeferredScreen.release(); //make sure to release any render targets that share a depth buffer with mDeferredScreen first mDeferredDepth.release(); + mOcclusionDepth.release(); if (!mScreen.allocate(resX, resY, GL_RGBA, TRUE, TRUE, LLTexUnit::TT_RECT_TEXTURE, FALSE)) return false; } @@ -1116,6 +1153,7 @@ void LLPipeline::refreshCachedSettings() RenderGlowWidth = gSavedSettings.getF32("RenderGlowWidth"); RenderGlowStrength = gSavedSettings.getF32("RenderGlowStrength"); RenderDepthOfField = gSavedSettings.getBOOL("RenderDepthOfField"); + RenderDepthOfFieldInEditMode = gSavedSettings.getBOOL("RenderDepthOfFieldInEditMode"); CameraFocusTransitionTime = gSavedSettings.getF32("CameraFocusTransitionTime"); CameraFNumber = gSavedSettings.getF32("CameraFNumber"); CameraFocalLength = gSavedSettings.getF32("CameraFocalLength"); @@ -1174,6 +1212,7 @@ void LLPipeline::releaseGLBuffers() mWaterRef.release(); mWaterDis.release(); + mHighlight.release(); for (U32 i = 0; i < 3; i++) { @@ -1204,12 +1243,12 @@ void LLPipeline::releaseScreenBuffers() mDeferredScreen.release(); mDeferredDepth.release(); mDeferredLight.release(); - - mHighlight.release(); + mOcclusionDepth.release(); for (U32 i = 0; i < 6; i++) { mShadow[i].release(); + mShadowOcclusion[i].release(); } } @@ -1221,14 +1260,31 @@ void LLPipeline::createGLBuffers() updateRenderDeferred(); + bool materials_in_water = false; + +#if MATERIALS_IN_REFLECTIONS + materials_in_water = gSavedSettings.getS32("RenderWaterMaterials"); +#endif + if (LLPipeline::sWaterReflections) { //water reflection texture U32 res = (U32) llmax(gSavedSettings.getS32("RenderWaterRefResolution"), 512); + // Set up SRGB targets if we're doing deferred-path reflection rendering + // + if (LLPipeline::sRenderDeferred && materials_in_water) + { + mWaterRef.allocate(res,res,GL_SRGB8_ALPHA8,TRUE,FALSE); + //always use FBO for mWaterDis so it can be used for avatar texture bakes + mWaterDis.allocate(res,res,GL_SRGB8_ALPHA8,TRUE,FALSE,LLTexUnit::TT_TEXTURE, true); + } + else + { mWaterRef.allocate(res,res,GL_RGBA,TRUE,FALSE); //always use FBO for mWaterDis so it can be used for avatar texture bakes mWaterDis.allocate(res,res,GL_RGBA,TRUE,FALSE,LLTexUnit::TT_TEXTURE, true); } + } mHighlight.allocate(256,256,GL_RGBA, FALSE, FALSE); @@ -1390,12 +1446,20 @@ void LLPipeline::createLUTBuffers() } } - LLImageGL::generateTextures(LLTexUnit::TT_TEXTURE, GL_R16F, 1, &mLightFunc); + U32 pix_format = GL_R16F; +#if LL_DARWIN + // Need to work around limited precision with 10.6.8 and older drivers + // + pix_format = GL_R32F; +#endif + LLImageGL::generateTextures(LLTexUnit::TT_TEXTURE, pix_format, 1, &mLightFunc); gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, mLightFunc); - LLImageGL::setManualImage(LLTexUnit::getInternalType(LLTexUnit::TT_TEXTURE), 0, GL_R16F, lightResX, lightResY, GL_RED, GL_FLOAT, ls, false); + LLImageGL::setManualImage(LLTexUnit::getInternalType(LLTexUnit::TT_TEXTURE), 0, pix_format, lightResX, lightResY, GL_RED, GL_FLOAT, ls, false); //LLImageGL::setManualImage(LLTexUnit::getInternalType(LLTexUnit::TT_TEXTURE), 0, GL_UNSIGNED_BYTE, lightResX, lightResY, GL_RED, GL_UNSIGNED_BYTE, ls, false); gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_CLAMP); gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_TRILINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); delete [] ls; } @@ -2429,7 +2493,14 @@ void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, S32 water_cl if (to_texture) { - mScreen.bindTarget(); + if (LLPipeline::sRenderDeferred) + { + mOcclusionDepth.bindTarget(); + } + else + { + mScreen.bindTarget(); + } } if (sUseOcclusion > 1) @@ -2567,7 +2638,14 @@ void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, S32 water_cl if (to_texture) { - mScreen.flush(); + if (LLPipeline::sRenderDeferred) + { + mOcclusionDepth.flush(); + } + else + { + mScreen.flush(); + } } } @@ -2635,6 +2713,73 @@ void LLPipeline::markOccluder(LLSpatialGroup* group) } } +void LLPipeline::downsampleDepthBuffer(LLRenderTarget& source, LLRenderTarget& dest, LLRenderTarget* scratch_space) +{ + LLGLSLShader* last_shader = LLGLSLShader::sCurBoundShaderPtr; + + LLGLSLShader* shader = NULL; + + if (scratch_space) + { + scratch_space->copyContents(source, + 0, 0, source.getWidth(), source.getHeight(), + 0, 0, scratch_space->getWidth(), scratch_space->getHeight(), GL_DEPTH_BUFFER_BIT, GL_NEAREST); + } + + dest.bindTarget(); + dest.clear(GL_DEPTH_BUFFER_BIT); + + LLStrider<LLVector3> vert; + mDeferredVB->getVertexStrider(vert); + LLStrider<LLVector2> tc0; + + vert[0].set(-1,1,0); + vert[1].set(-1,-3,0); + vert[2].set(3,1,0); + + if (source.getUsage() == LLTexUnit::TT_RECT_TEXTURE) + { + shader = &gDownsampleDepthRectProgram; + shader->bind(); + shader->uniform2f(sDelta, 1.f, 1.f); + shader->uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, source.getWidth(), source.getHeight()); + } + else + { + shader = &gDownsampleDepthProgram; + shader->bind(); + shader->uniform2f(sDelta, 1.f/source.getWidth(), 1.f/source.getHeight()); + shader->uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, 1.f, 1.f); + } + + gGL.getTexUnit(0)->bind(scratch_space ? scratch_space : &source, TRUE); + + { + LLGLDepthTest depth(GL_TRUE, GL_TRUE, GL_ALWAYS); + mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX); + mDeferredVB->drawArrays(LLRender::TRIANGLES, 0, 3); + } + + dest.flush(); + + if (last_shader) + { + last_shader->bind(); + } + else + { + shader->unbind(); + } +} + +void LLPipeline::doOcclusion(LLCamera& camera, LLRenderTarget& source, LLRenderTarget& dest, LLRenderTarget* scratch_space) +{ + downsampleDepthBuffer(source, dest, scratch_space); + dest.bindTarget(); + doOcclusion(camera); + dest.flush(); +} + void LLPipeline::doOcclusion(LLCamera& camera) { if (LLPipeline::sUseOcclusion > 1 && sCull->hasOcclusionGroups()) @@ -2978,7 +3123,7 @@ void LLPipeline::markVisible(LLDrawable *drawablep, LLCamera& camera) llassert(vobj); // trying to catch a bad assumption if (vobj) // this test may not be needed, see above { - const LLVOAvatar* av = vobj->asAvatar(); + LLVOAvatar* av = vobj->asAvatar(); if (av && av->isImpostor()) { return; @@ -3864,7 +4009,7 @@ void LLPipeline::postSort(LLCamera& camera) { mSelectedFaces.clear(); - LLPipeline::setRenderHighlightTextureChannel(LLSelectMgr::getInstance()->getTextureChannel()); + LLPipeline::setRenderHighlightTextureChannel(gFloaterTools->getPanelFace()->getTextureChannelToEdit()); // Draw face highlights for selected faces. if (LLSelectMgr::getInstance()->getTEMode()) @@ -4547,7 +4692,7 @@ void LLPipeline::renderGeomDeferred(LLCamera& camera) gGL.setColorMask(true, false); } -void LLPipeline::renderGeomPostDeferred(LLCamera& camera) +void LLPipeline::renderGeomPostDeferred(LLCamera& camera, bool do_occlusion) { LLFastTimer t(FTM_POST_DEFERRED_POOLS); U32 cur_type = 0; @@ -4562,7 +4707,7 @@ void LLPipeline::renderGeomPostDeferred(LLCamera& camera) gGL.setColorMask(true, false); pool_set_t::iterator iter1 = mPools.begin(); - BOOL occlude = LLPipeline::sUseOcclusion > 1; + BOOL occlude = LLPipeline::sUseOcclusion > 1 && do_occlusion; while ( iter1 != mPools.end() ) { @@ -4576,7 +4721,7 @@ void LLPipeline::renderGeomPostDeferred(LLCamera& camera) gGLLastMatrix = NULL; gGL.loadMatrix(gGLModelView); LLGLSLShader::bindNoShader(); - doOcclusion(camera); + doOcclusion(camera, mScreen, mOcclusionDepth, &mDeferredDepth); gGL.setColorMask(true, false); } @@ -4772,18 +4917,6 @@ void LLPipeline::renderPhysicsDisplay() } } - for (LLCullResult::bridge_iterator i = sCull->beginVisibleBridge(); i != sCull->endVisibleBridge(); ++i) - { - LLSpatialBridge* bridge = *i; - if (!bridge->isDead() && hasRenderType(bridge->mDrawableType)) - { - gGL.pushMatrix(); - gGL.multMatrix((F32*)bridge->mDrawable->getRenderMatrix().mMatrix); - bridge->renderPhysicsShapes(); - gGL.popMatrix(); - } - } - gGL.flush(); if (LLGLSLShader::sNoFixedFunction) @@ -4794,6 +4927,7 @@ void LLPipeline::renderPhysicsDisplay() mPhysicsDisplay.flush(); } +extern std::set<LLSpatialGroup*> visible_selected_groups; void LLPipeline::renderDebug() { @@ -4819,9 +4953,9 @@ void LLPipeline::renderDebug() if (LLGLSLShader::sNoFixedFunction) { gPathfindingProgram.bind(); - gPathfindingProgram.uniform1f("tint", 1.f); - gPathfindingProgram.uniform1f("ambiance", 1.f); - gPathfindingProgram.uniform1f("alpha_scale", 1.f); + gPathfindingProgram.uniform1f(sTint, 1.f); + gPathfindingProgram.uniform1f(sAmbiance, 1.f); + gPathfindingProgram.uniform1f(sAlphaScale, 1.f); } //Requried character physics capsule render parameters @@ -4838,7 +4972,7 @@ void LLPipeline::renderDebug() llPathingLibInstance->renderSimpleShapeCapsuleID( gGL, id, pos, rot ); gGL.setColorMask(true, false); LLGLEnable blend(GL_BLEND); - gPathfindingProgram.uniform1f("alpha_scale", 0.90f); + gPathfindingProgram.uniform1f(sAlphaScale, 0.90f); llPathingLibInstance->renderSimpleShapeCapsuleID( gGL, id, pos, rot ); gPathfindingProgram.bind(); } @@ -4865,9 +4999,9 @@ void LLPipeline::renderDebug() { gPathfindingProgram.bind(); - gPathfindingProgram.uniform1f("tint", 1.f); - gPathfindingProgram.uniform1f("ambiance", ambiance); - gPathfindingProgram.uniform1f("alpha_scale", 1.f); + gPathfindingProgram.uniform1f(sTint, 1.f); + gPathfindingProgram.uniform1f(sAmbiance, ambiance); + gPathfindingProgram.uniform1f(sAlphaScale, 1.f); } if ( !pathfindingConsole->isRenderWorld() ) @@ -4891,7 +5025,7 @@ void LLPipeline::renderDebug() if ( pathfindingConsole->isRenderWorld() ) { LLGLEnable blend(GL_BLEND); - gPathfindingProgram.uniform1f("alpha_scale", 0.66f); + gPathfindingProgram.uniform1f(sAlphaScale, 0.66f); llPathingLibInstance->renderNavMesh(); } else @@ -4903,8 +5037,8 @@ void LLPipeline::renderDebug() if (LLGLSLShader::sNoFixedFunction) { gPathfindingNoNormalsProgram.bind(); - gPathfindingNoNormalsProgram.uniform1f("tint", 1.f); - gPathfindingNoNormalsProgram.uniform1f("alpha_scale", 1.f); + gPathfindingNoNormalsProgram.uniform1f(sTint, 1.f); + gPathfindingNoNormalsProgram.uniform1f(sAlphaScale, 1.f); llPathingLibInstance->renderNavMeshEdges(); gPathfindingProgram.bind(); } @@ -4944,7 +5078,7 @@ void LLPipeline::renderDebug() gGL.setColorMask(true, false); //render the bookends LLGLEnable blend(GL_BLEND); - gPathfindingProgram.uniform1f("alpha_scale", 0.90f); + gPathfindingProgram.uniform1f(sAlphaScale, 0.90f); llPathingLibInstance->renderPathBookend( gGL, LLPathingLib::LLPL_START ); llPathingLibInstance->renderPathBookend( gGL, LLPathingLib::LLPL_END ); gPathfindingProgram.bind(); @@ -4962,7 +5096,7 @@ void LLPipeline::renderDebug() if (LLGLSLShader::sNoFixedFunction) { LLGLEnable blend(GL_BLEND); - gPathfindingProgram.uniform1f("alpha_scale", 0.90f); + gPathfindingProgram.uniform1f(sAlphaScale, 0.90f); llPathingLibInstance->renderSimpleShapes( gGL, gAgent.getRegion()->getWaterHeight() ); } else @@ -5010,7 +5144,7 @@ void LLPipeline::renderDebug() LLGLEnable blend(GL_BLEND); { - gPathfindingProgram.uniform1f("ambiance", ambiance); + gPathfindingProgram.uniform1f(sAmbiance, ambiance); { //draw solid overlay LLGLDepthTest depth(GL_TRUE, GL_FALSE, GL_LEQUAL); @@ -5025,8 +5159,8 @@ void LLPipeline::renderDebug() if (pathfindingConsole->isRenderXRay()) { - gPathfindingProgram.uniform1f("tint", gSavedSettings.getF32("PathfindingXRayTint")); - gPathfindingProgram.uniform1f("alpha_scale", gSavedSettings.getF32("PathfindingXRayOpacity")); + gPathfindingProgram.uniform1f(sTint, gSavedSettings.getF32("PathfindingXRayTint")); + gPathfindingProgram.uniform1f(sAlphaScale, gSavedSettings.getF32("PathfindingXRayOpacity")); LLGLEnable blend(GL_BLEND); LLGLDepthTest depth(GL_TRUE, GL_FALSE, GL_GREATER); @@ -5034,13 +5168,13 @@ void LLPipeline::renderDebug() if (gSavedSettings.getBOOL("PathfindingXRayWireframe")) { //draw hidden wireframe as darker and less opaque - gPathfindingProgram.uniform1f("ambiance", 1.f); + gPathfindingProgram.uniform1f(sAmbiance, 1.f); llPathingLibInstance->renderNavMeshShapesVBO( render_order[i] ); } else { glPolygonMode( GL_FRONT_AND_BACK, GL_FILL ); - gPathfindingProgram.uniform1f("ambiance", ambiance); + gPathfindingProgram.uniform1f(sAmbiance, ambiance); llPathingLibInstance->renderNavMeshShapesVBO( render_order[i] ); glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); } @@ -5048,9 +5182,9 @@ void LLPipeline::renderDebug() { //draw visible wireframe as brighter, thicker and more opaque glPolygonOffset(offset, offset); - gPathfindingProgram.uniform1f("ambiance", 1.f); - gPathfindingProgram.uniform1f("tint", 1.f); - gPathfindingProgram.uniform1f("alpha_scale", 1.f); + gPathfindingProgram.uniform1f(sAmbiance, 1.f); + gPathfindingProgram.uniform1f(sTint, 1.f); + gPathfindingProgram.uniform1f(sAlphaScale, 1.f); glLineWidth(gSavedSettings.getF32("PathfindingLineWidth")); LLGLDisable blendOut(GL_BLEND); @@ -5082,19 +5216,19 @@ void LLPipeline::renderDebug() glLineWidth(2.0f); LLGLEnable cull(GL_CULL_FACE); - gPathfindingProgram.uniform1f("tint", gSavedSettings.getF32("PathfindingXRayTint")); - gPathfindingProgram.uniform1f("alpha_scale", gSavedSettings.getF32("PathfindingXRayOpacity")); + gPathfindingProgram.uniform1f(sTint, gSavedSettings.getF32("PathfindingXRayTint")); + gPathfindingProgram.uniform1f(sAlphaScale, gSavedSettings.getF32("PathfindingXRayOpacity")); if (gSavedSettings.getBOOL("PathfindingXRayWireframe")) { //draw hidden wireframe as darker and less opaque glPolygonMode( GL_FRONT_AND_BACK, GL_LINE ); - gPathfindingProgram.uniform1f("ambiance", 1.f); + gPathfindingProgram.uniform1f(sAmbiance, 1.f); llPathingLibInstance->renderNavMesh(); glPolygonMode( GL_FRONT_AND_BACK, GL_FILL ); } else { - gPathfindingProgram.uniform1f("ambiance", ambiance); + gPathfindingProgram.uniform1f(sAmbiance, ambiance); llPathingLibInstance->renderNavMesh(); } @@ -5102,8 +5236,8 @@ void LLPipeline::renderDebug() if (LLGLSLShader::sNoFixedFunction) { gPathfindingNoNormalsProgram.bind(); - gPathfindingNoNormalsProgram.uniform1f("tint", gSavedSettings.getF32("PathfindingXRayTint")); - gPathfindingNoNormalsProgram.uniform1f("alpha_scale", gSavedSettings.getF32("PathfindingXRayOpacity")); + gPathfindingNoNormalsProgram.uniform1f(sTint, gSavedSettings.getF32("PathfindingXRayTint")); + gPathfindingNoNormalsProgram.uniform1f(sAlphaScale, gSavedSettings.getF32("PathfindingXRayOpacity")); llPathingLibInstance->renderNavMeshEdges(); gPathfindingProgram.bind(); } @@ -5204,11 +5338,68 @@ void LLPipeline::renderDebug() } } + if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_OCCLUSION) && LLGLSLShader::sNoFixedFunction) + { //render visible selected group occlusion geometry + gDebugProgram.bind(); + LLGLDepthTest depth(GL_TRUE, GL_FALSE); + gGL.diffuseColor3f(1,0,1); + for (std::set<LLSpatialGroup*>::iterator iter = visible_selected_groups.begin(); iter != visible_selected_groups.end(); ++iter) + { + LLSpatialGroup* group = *iter; + + LLVector4a fudge; + fudge.splat(0.25f); //SG_OCCLUSION_FUDGE + + LLVector4a size; + size.setAdd(fudge, group->mBounds[1]); + + drawBox(group->mBounds[0], size); + } + } + + visible_selected_groups.clear(); + if (LLGLSLShader::sNoFixedFunction) { gUIProgram.bind(); } + if (hasRenderDebugMask(LLPipeline::RENDER_DEBUG_RAYCAST) && !hud_only) + { //draw crosshairs on particle intersection + if (gDebugRaycastParticle) + { + if (LLGLSLShader::sNoFixedFunction) + { //this debug display requires shaders + gDebugProgram.bind(); + + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + + LLVector3 center(gDebugRaycastParticleIntersection.getF32ptr()); + LLVector3 size(0.1f, 0.1f, 0.1f); + + LLVector3 p[6]; + + p[0] = center + size.scaledVec(LLVector3(1,0,0)); + p[1] = center + size.scaledVec(LLVector3(-1,0,0)); + p[2] = center + size.scaledVec(LLVector3(0,1,0)); + p[3] = center + size.scaledVec(LLVector3(0,-1,0)); + p[4] = center + size.scaledVec(LLVector3(0,0,1)); + p[5] = center + size.scaledVec(LLVector3(0,0,-1)); + + gGL.begin(LLRender::LINES); + gGL.diffuseColor3f(1.f, 1.f, 0.f); + for (U32 i = 0; i < 6; i++) + { + gGL.vertex3fv(p[i].mV); + } + gGL.end(); + gGL.flush(); + + gDebugProgram.unbind(); + } + } + } + if (hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHADOW_FRUSTA)) { LLVertexBuffer::unbind(); @@ -5242,7 +5433,7 @@ void LLPipeline::renderDebug() if (i > 3) { //render shadow frusta as volumes if (mShadowFrustPoints[i-4].empty()) - { + { continue; } @@ -5822,9 +6013,9 @@ void LLPipeline::setupAvatarLights(BOOL for_edit) if (LLPipeline::sRenderDeferred) { - diffuse.mV[0] = powf(diffuse.mV[0], 2.2f); + /*diffuse.mV[0] = powf(diffuse.mV[0], 2.2f); diffuse.mV[1] = powf(diffuse.mV[1], 2.2f); - diffuse.mV[2] = powf(diffuse.mV[2], 2.2f); + diffuse.mV[2] = powf(diffuse.mV[2], 2.2f);*/ } mHWLightColors[1] = diffuse; @@ -5869,9 +6060,9 @@ void LLPipeline::setupAvatarLights(BOOL for_edit) if (LLPipeline::sRenderDeferred) { - backlight_diffuse.mV[0] = powf(backlight_diffuse.mV[0], 2.2f); + /*backlight_diffuse.mV[0] = powf(backlight_diffuse.mV[0], 2.2f); backlight_diffuse.mV[1] = powf(backlight_diffuse.mV[1], 2.2f); - backlight_diffuse.mV[2] = powf(backlight_diffuse.mV[2], 2.2f); + backlight_diffuse.mV[2] = powf(backlight_diffuse.mV[2], 2.2f);*/ } mHWLightColors[1] = backlight_diffuse; @@ -6083,9 +6274,9 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) if (LLPipeline::sRenderDeferred) { - light_diffuse.mV[0] = powf(light_diffuse.mV[0], 2.2f); + /*light_diffuse.mV[0] = powf(light_diffuse.mV[0], 2.2f); light_diffuse.mV[1] = powf(light_diffuse.mV[1], 2.2f); - light_diffuse.mV[2] = powf(light_diffuse.mV[2], 2.2f); + light_diffuse.mV[2] = powf(light_diffuse.mV[2], 2.2f);*/ } mHWLightColors[0] = light_diffuse; @@ -6156,13 +6347,6 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) F32 x = (3.f * (1.f + light->getLightFalloff())); // why this magic? probably trying to match a historic behavior. float linatten = x / (light_radius); // % of brightness at radius - if (LLPipeline::sRenderDeferred) - { - light_color.mV[0] = powf(light_color.mV[0], 2.2f); - light_color.mV[1] = powf(light_color.mV[1], 2.2f); - light_color.mV[2] = powf(light_color.mV[2], 2.2f); - } - mHWLightColors[cur_light] = light_color; LLLightState* light_state = gGL.getLight(cur_light); @@ -6173,7 +6357,7 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) if (sRenderDeferred) { F32 size = light_radius*1.5f; - light_state->setLinearAttenuation(size*size); + light_state->setLinearAttenuation(size); light_state->setQuadraticAttenuation(light->getLightFalloff()*0.5f+1.f); } else @@ -6238,9 +6422,9 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) if (LLPipeline::sRenderDeferred) { - light_color.mV[0] = powf(light_color.mV[0], 2.2f); + /*light_color.mV[0] = powf(light_color.mV[0], 2.2f); light_color.mV[1] = powf(light_color.mV[1], 2.2f); - light_color.mV[2] = powf(light_color.mV[2], 2.2f); + light_color.mV[2] = powf(light_color.mV[2], 2.2f);*/ } mHWLightColors[2] = light_color; @@ -6889,6 +7073,48 @@ void LLPipeline::setRenderHighlightTextureChannel(LLRender::eTexIndex channel) sRenderHighlightTextureChannel = channel; } +LLVOPartGroup* LLPipeline::lineSegmentIntersectParticle(const LLVector4a& start, const LLVector4a& end, LLVector4a* intersection, + S32* face_hit) +{ + LLVector4a local_end = end; + + LLVector4a position; + + LLDrawable* drawable = NULL; + + for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); + iter != LLWorld::getInstance()->getRegionList().end(); ++iter) + { + LLViewerRegion* region = *iter; + + LLSpatialPartition* part = region->getSpatialPartition(LLViewerRegion::PARTITION_PARTICLE); + if (part && hasRenderType(part->mDrawableType)) + { + LLDrawable* hit = part->lineSegmentIntersect(start, local_end, TRUE, face_hit, &position, NULL, NULL, NULL); + if (hit) + { + drawable = hit; + local_end = position; + } + } + } + + LLVOPartGroup* ret = NULL; + if (drawable) + { + //make sure we're returning an LLVOPartGroup + llassert(drawable->getVObj()->getPCode() == LLViewerObject::LL_VO_PART_GROUP); + ret = (LLVOPartGroup*) drawable->getVObj().get(); + } + + if (intersection) + { + *intersection = position; + } + + return ret; +} + LLViewerObject* LLPipeline::lineSegmentIntersectInWorld(const LLVector4a& start, const LLVector4a& end, BOOL pick_transparent, S32* face_hit, @@ -7448,7 +7674,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) { bool dof_enabled = !LLViewerCamera::getInstance()->cameraUnderWater() && - !LLToolMgr::getInstance()->inBuildMode() && + (RenderDepthOfFieldInEditMode || !LLToolMgr::getInstance()->inBuildMode()) && RenderDepthOfField; @@ -7502,7 +7728,11 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) else { //focus on alt-zoom target - focus_point = LLVector3(gAgentCamera.getFocusGlobal()-gAgent.getRegion()->getOriginGlobal()); + LLViewerRegion* region = gAgent.getRegion(); + if (region) + { + focus_point = LLVector3(gAgentCamera.getFocusGlobal()-region->getOriginGlobal()); + } } } @@ -8125,10 +8355,10 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index, U32 n shader.uniform1f(LLShaderMgr::DEFERRED_NORM_CUTOFF, RenderEdgeNormCutoff); - if (shader.getUniformLocation("norm_mat") >= 0) + if (shader.getUniformLocation(LLShaderMgr::DEFERRED_NORM_MATRIX) >= 0) { glh::matrix4f norm_mat = glh_get_current_modelview().inverse().transpose(); - shader.uniformMatrix4fv("norm_mat", 1, FALSE, norm_mat.m); + shader.uniformMatrix4fv(LLShaderMgr::DEFERRED_NORM_MATRIX, 1, FALSE, norm_mat.m); } } @@ -8201,11 +8431,7 @@ void LLPipeline::renderDeferredLighting() LLStrider<LLVector3> vert; mDeferredVB->getVertexStrider(vert); - LLStrider<LLVector2> tc0; - LLStrider<LLVector2> tc1; - mDeferredVB->getTexCoord0Strider(tc0); - mDeferredVB->getTexCoord1Strider(tc1); - + vert[0].set(-1,1,0); vert[1].set(-1,-3,0); vert[2].set(3,1,0); @@ -8254,8 +8480,8 @@ void LLPipeline::renderDeferredLighting() } } - gDeferredSunProgram.uniform3fv("offset", slice, offset); - gDeferredSunProgram.uniform2f("screenRes", mDeferredLight.getWidth(), mDeferredLight.getHeight()); + gDeferredSunProgram.uniform3fv(sOffset, slice, offset); + gDeferredSunProgram.uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, mDeferredLight.getWidth(), mDeferredLight.getHeight()); { LLGLDisable blend(GL_BLEND); @@ -8299,10 +8525,10 @@ void LLPipeline::renderDeferredLighting() x += 1.f; } - gDeferredBlurLightProgram.uniform2f("delta", 1.f, 0.f); - gDeferredBlurLightProgram.uniform1f("dist_factor", dist_factor); - gDeferredBlurLightProgram.uniform3fv("kern", kern_length, gauss[0].mV); - gDeferredBlurLightProgram.uniform1f("kern_scale", blur_size * (kern_length/2.f - 0.5f)); + gDeferredBlurLightProgram.uniform2f(sDelta, 1.f, 0.f); + gDeferredBlurLightProgram.uniform1f(sDistFactor, dist_factor); + gDeferredBlurLightProgram.uniform3fv(sKern, kern_length, gauss[0].mV); + gDeferredBlurLightProgram.uniform1f(sKernScale, blur_size * (kern_length/2.f - 0.5f)); { LLGLDisable blend(GL_BLEND); @@ -8319,7 +8545,7 @@ void LLPipeline::renderDeferredLighting() mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX); mDeferredLight.bindTarget(); - gDeferredBlurLightProgram.uniform2f("delta", 0.f, 1.f); + gDeferredBlurLightProgram.uniform2f(sDelta, 0.f, 1.f); { LLGLDisable blend(GL_BLEND); @@ -8348,7 +8574,7 @@ void LLPipeline::renderDeferredLighting() if (RenderDeferredAtmospheric) { //apply sunlight contribution LLFastTimer ftm(FTM_ATMOSPHERICS); - bindDeferredShader(gDeferredSoftenProgram); + bindDeferredShader(LLPipeline::sUnderWaterRender ? gDeferredSoftenWaterProgram : gDeferredSoftenProgram); { LLGLDepthTest depth(GL_FALSE); LLGLDisable blend(GL_BLEND); @@ -8370,7 +8596,7 @@ void LLPipeline::renderDeferredLighting() gGL.popMatrix(); } - unbindDeferredShader(gDeferredSoftenProgram); + unbindDeferredShader(LLPipeline::sUnderWaterRender ? gDeferredSoftenWaterProgram : gDeferredSoftenProgram); } { //render non-deferred geometry (fullbright, alpha, etc) @@ -8386,7 +8612,7 @@ void LLPipeline::renderDeferredLighting() LLPipeline::END_RENDER_TYPES); - renderGeomPostDeferred(*LLViewerCamera::getInstance()); + renderGeomPostDeferred(*LLViewerCamera::getInstance(), false); gPipeline.popRenderTypeMask(); } @@ -8480,13 +8706,13 @@ void LLPipeline::renderDeferredLighting() continue; } - col.mV[0] = powf(col.mV[0], 2.2f); + /*col.mV[0] = powf(col.mV[0], 2.2f); col.mV[1] = powf(col.mV[1], 2.2f); - col.mV[2] = powf(col.mV[2], 2.2f); + col.mV[2] = powf(col.mV[2], 2.2f);*/ LLFastTimer ftm(FTM_LOCAL_LIGHTS); gDeferredLightProgram.uniform3fv(LLShaderMgr::LIGHT_CENTER, 1, c); - gDeferredLightProgram.uniform1f(LLShaderMgr::LIGHT_SIZE, s*s); + gDeferredLightProgram.uniform1f(LLShaderMgr::LIGHT_SIZE, s); gDeferredLightProgram.uniform3fv(LLShaderMgr::DIFFUSE_COLOR, 1, col.mV); gDeferredLightProgram.uniform1f(LLShaderMgr::LIGHT_FALLOFF, volume->getLightFalloff()*0.5f); gGL.syncMatrices(); @@ -8507,7 +8733,7 @@ void LLPipeline::renderDeferredLighting() glh::vec3f tc(c); mat.mult_matrix_vec(tc); - fullscreen_lights.push_back(LLVector4(tc.v[0], tc.v[1], tc.v[2], s*s)); + fullscreen_lights.push_back(LLVector4(tc.v[0], tc.v[1], tc.v[2], s)); light_colors.push_back(LLVector4(col.mV[0], col.mV[1], col.mV[2], volume->getLightFalloff()*0.5f)); } } @@ -8540,12 +8766,12 @@ void LLPipeline::renderDeferredLighting() setupSpotLight(gDeferredSpotLightProgram, drawablep); LLColor3 col = volume->getLightColor(); - col.mV[0] = powf(col.mV[0], 2.2f); + /*col.mV[0] = powf(col.mV[0], 2.2f); col.mV[1] = powf(col.mV[1], 2.2f); - col.mV[2] = powf(col.mV[2], 2.2f); + col.mV[2] = powf(col.mV[2], 2.2f);*/ gDeferredSpotLightProgram.uniform3fv(LLShaderMgr::LIGHT_CENTER, 1, c); - gDeferredSpotLightProgram.uniform1f(LLShaderMgr::LIGHT_SIZE, s*s); + gDeferredSpotLightProgram.uniform1f(LLShaderMgr::LIGHT_SIZE, s); gDeferredSpotLightProgram.uniform3fv(LLShaderMgr::DIFFUSE_COLOR, 1, col.mV); gDeferredSpotLightProgram.uniform1f(LLShaderMgr::LIGHT_FALLOFF, volume->getLightFalloff()*0.5f); gGL.syncMatrices(); @@ -8563,10 +8789,6 @@ void LLPipeline::renderDeferredLighting() vert[2].set(3,1,0); { - bindDeferredShader(gDeferredMultiLightProgram); - - mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX); - LLGLDepthTest depth(GL_FALSE); //full screen blit @@ -8578,7 +8800,7 @@ void LLPipeline::renderDeferredLighting() U32 count = 0; - const U32 max_count = 8; + const U32 max_count = LL_DEFERRED_MULTI_LIGHT_COUNT; LLVector4 light[max_count]; LLVector4 col[max_count]; @@ -8592,27 +8814,29 @@ void LLPipeline::renderDeferredLighting() col[count] = light_colors.front(); light_colors.pop_front(); - col[count].mV[0] = powf(col[count].mV[0], 2.2f); + /*col[count].mV[0] = powf(col[count].mV[0], 2.2f); col[count].mV[1] = powf(col[count].mV[1], 2.2f); - col[count].mV[2] = powf(col[count].mV[2], 2.2f); + col[count].mV[2] = powf(col[count].mV[2], 2.2f);*/ - far_z = llmin(light[count].mV[2]-sqrtf(light[count].mV[3]), far_z); + far_z = llmin(light[count].mV[2]-light[count].mV[3], far_z); //col[count] = pow4fsrgb(col[count], 2.2f); count++; if (count == max_count || fullscreen_lights.empty()) { - gDeferredMultiLightProgram.uniform1i(LLShaderMgr::MULTI_LIGHT_COUNT, count); - gDeferredMultiLightProgram.uniform4fv(LLShaderMgr::MULTI_LIGHT, count, (GLfloat*) light); - gDeferredMultiLightProgram.uniform4fv(LLShaderMgr::MULTI_LIGHT_COL, count, (GLfloat*) col); - gDeferredMultiLightProgram.uniform1f(LLShaderMgr::MULTI_LIGHT_FAR_Z, far_z); + U32 idx = count-1; + bindDeferredShader(gDeferredMultiLightProgram[idx]); + gDeferredMultiLightProgram[idx].uniform1i(LLShaderMgr::MULTI_LIGHT_COUNT, count); + gDeferredMultiLightProgram[idx].uniform4fv(LLShaderMgr::MULTI_LIGHT, count, (GLfloat*) light); + gDeferredMultiLightProgram[idx].uniform4fv(LLShaderMgr::MULTI_LIGHT_COL, count, (GLfloat*) col); + gDeferredMultiLightProgram[idx].uniform1f(LLShaderMgr::MULTI_LIGHT_FAR_Z, far_z); far_z = 0.f; count = 0; + mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX); mDeferredVB->drawArrays(LLRender::TRIANGLES, 0, 3); + unbindDeferredShader(gDeferredMultiLightProgram[idx]); } } - unbindDeferredShader(gDeferredMultiLightProgram); - bindDeferredShader(gDeferredMultiSpotLightProgram); gDeferredMultiSpotLightProgram.enableTexture(LLShaderMgr::DEFERRED_PROJECTION); @@ -8639,12 +8863,12 @@ void LLPipeline::renderDeferredLighting() LLColor3 col = volume->getLightColor(); - col.mV[0] = powf(col.mV[0], 2.2f); + /*col.mV[0] = powf(col.mV[0], 2.2f); col.mV[1] = powf(col.mV[1], 2.2f); - col.mV[2] = powf(col.mV[2], 2.2f); + col.mV[2] = powf(col.mV[2], 2.2f);*/ gDeferredMultiSpotLightProgram.uniform3fv(LLShaderMgr::LIGHT_CENTER, 1, tc.v); - gDeferredMultiSpotLightProgram.uniform1f(LLShaderMgr::LIGHT_SIZE, s*s); + gDeferredMultiSpotLightProgram.uniform1f(LLShaderMgr::LIGHT_SIZE, s); gDeferredMultiSpotLightProgram.uniform3fv(LLShaderMgr::DIFFUSE_COLOR, 1, col.mV); gDeferredMultiSpotLightProgram.uniform1f(LLShaderMgr::LIGHT_FALLOFF, volume->getLightFalloff()*0.5f); mDeferredVB->drawArrays(LLRender::TRIANGLES, 0, 3); @@ -8693,9 +8917,9 @@ void LLPipeline::renderDeferredLighting() gDeferredPostGammaCorrectProgram.uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, mScreen.getWidth(), mScreen.getHeight()); - F32 gamma = 1.0/2.2; + F32 gamma = gSavedSettings.getF32("RenderDeferredDisplayGamma"); - gDeferredPostGammaCorrectProgram.uniform1f(LLShaderMgr::TEXTURE_GAMMA, gamma); + gDeferredPostGammaCorrectProgram.uniform1f(LLShaderMgr::DISPLAY_GAMMA, (gamma > 0.1f) ? 1.0f / gamma : (1.0f/2.2f)); gGL.begin(LLRender::TRIANGLE_STRIP); gGL.texCoord2f(tc1.mV[0], tc1.mV[1]); @@ -8774,6 +8998,537 @@ void LLPipeline::renderDeferredLighting() } +void LLPipeline::renderDeferredLightingToRT(LLRenderTarget* target) +{ + if (!sCull) + { + return; + } + + { + LLFastTimer ftm(FTM_RENDER_DEFERRED); + + LLViewerCamera* camera = LLViewerCamera::getInstance(); + + { + LLGLDepthTest depth(GL_TRUE); + mDeferredDepth.copyContents(mDeferredScreen, 0, 0, mDeferredScreen.getWidth(), mDeferredScreen.getHeight(), + 0, 0, mDeferredDepth.getWidth(), mDeferredDepth.getHeight(), GL_DEPTH_BUFFER_BIT, GL_NEAREST); + } + + LLGLEnable multisample(RenderFSAASamples > 0 ? GL_MULTISAMPLE_ARB : 0); + + if (gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_HUD)) + { + gPipeline.toggleRenderType(LLPipeline::RENDER_TYPE_HUD); + } + + //ati doesn't seem to love actually using the stencil buffer on FBO's + LLGLDisable stencil(GL_STENCIL_TEST); + //glStencilFunc(GL_EQUAL, 1, 0xFFFFFFFF); + //glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP); + + gGL.setColorMask(true, true); + + //draw a cube around every light + LLVertexBuffer::unbind(); + + LLGLEnable cull(GL_CULL_FACE); + LLGLEnable blend(GL_BLEND); + + glh::matrix4f mat = glh_copy_matrix(gGLModelView); + + LLStrider<LLVector3> vert; + mDeferredVB->getVertexStrider(vert); + + vert[0].set(-1,1,0); + vert[1].set(-1,-3,0); + vert[2].set(3,1,0); + + { + setupHWLights(NULL); //to set mSunDir; + LLVector4 dir(mSunDir, 0.f); + glh::vec4f tc(dir.mV); + mat.mult_matrix_vec(tc); + mTransformedSunDir.set(tc.v); + } + + gGL.pushMatrix(); + gGL.loadIdentity(); + gGL.matrixMode(LLRender::MM_PROJECTION); + gGL.pushMatrix(); + gGL.loadIdentity(); + + if (RenderDeferredSSAO || RenderShadowDetail > 0) + { + mDeferredLight.bindTarget(); + { //paint shadow/SSAO light map (direct lighting lightmap) + LLFastTimer ftm(FTM_SUN_SHADOW); + bindDeferredShader(gDeferredSunProgram); + mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX); + glClearColor(1,1,1,1); + mDeferredLight.clear(GL_COLOR_BUFFER_BIT); + glClearColor(0,0,0,0); + + glh::matrix4f inv_trans = glh_get_current_modelview().inverse().transpose(); + + const U32 slice = 32; + F32 offset[slice*3]; + for (U32 i = 0; i < 4; i++) + { + for (U32 j = 0; j < 8; j++) + { + glh::vec3f v; + v.set_value(sinf(6.284f/8*j), cosf(6.284f/8*j), -(F32) i); + v.normalize(); + inv_trans.mult_matrix_vec(v); + v.normalize(); + offset[(i*8+j)*3+0] = v.v[0]; + offset[(i*8+j)*3+1] = v.v[2]; + offset[(i*8+j)*3+2] = v.v[1]; + } + } + + gDeferredSunProgram.uniform3fv(LLShaderMgr::DEFERRED_SHADOW_OFFSET, slice, offset); + gDeferredSunProgram.uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, mDeferredLight.getWidth(), mDeferredLight.getHeight()); + + { + LLGLDisable blend(GL_BLEND); + LLGLDepthTest depth(GL_TRUE, GL_FALSE, GL_ALWAYS); + stop_glerror(); + mDeferredVB->drawArrays(LLRender::TRIANGLES, 0, 3); + stop_glerror(); + } + + unbindDeferredShader(gDeferredSunProgram); + } + mDeferredLight.flush(); + } + + stop_glerror(); + gGL.popMatrix(); + stop_glerror(); + gGL.matrixMode(LLRender::MM_MODELVIEW); + stop_glerror(); + gGL.popMatrix(); + stop_glerror(); + + target->bindTarget(); + + //clear color buffer here - zeroing alpha (glow) is important or it will accumulate against sky + glClearColor(0,0,0,0); + target->clear(GL_COLOR_BUFFER_BIT); + + if (RenderDeferredAtmospheric) + { //apply sunlight contribution + LLFastTimer ftm(FTM_ATMOSPHERICS); + bindDeferredShader(gDeferredSoftenProgram); + { + LLGLDepthTest depth(GL_FALSE); + LLGLDisable blend(GL_BLEND); + LLGLDisable test(GL_ALPHA_TEST); + + //full screen blit + gGL.pushMatrix(); + gGL.loadIdentity(); + gGL.matrixMode(LLRender::MM_PROJECTION); + gGL.pushMatrix(); + gGL.loadIdentity(); + + mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX); + + mDeferredVB->drawArrays(LLRender::TRIANGLES, 0, 3); + + gGL.popMatrix(); + gGL.matrixMode(LLRender::MM_MODELVIEW); + gGL.popMatrix(); + } + + unbindDeferredShader(gDeferredSoftenProgram); + } + + { //render non-deferred geometry (fullbright, alpha, etc) + LLGLDisable blend(GL_BLEND); + LLGLDisable stencil(GL_STENCIL_TEST); + gGL.setSceneBlendType(LLRender::BT_ALPHA); + + gPipeline.pushRenderTypeMask(); + + gPipeline.andRenderTypeMask(LLPipeline::RENDER_TYPE_SKY, + LLPipeline::RENDER_TYPE_CLOUDS, + LLPipeline::RENDER_TYPE_WL_SKY, + LLPipeline::END_RENDER_TYPES); + + + renderGeomPostDeferred(*LLViewerCamera::getInstance(), false); + gPipeline.popRenderTypeMask(); + } + + BOOL render_local = RenderLocalLights; + + if (render_local) + { + gGL.setSceneBlendType(LLRender::BT_ADD); + std::list<LLVector4> fullscreen_lights; + LLDrawable::drawable_list_t spot_lights; + LLDrawable::drawable_list_t fullscreen_spot_lights; + + for (U32 i = 0; i < 2; i++) + { + mTargetShadowSpotLight[i] = NULL; + } + + std::list<LLVector4> light_colors; + + LLVertexBuffer::unbind(); + + { + bindDeferredShader(gDeferredLightProgram); + + if (mCubeVB.isNull()) + { + mCubeVB = ll_create_cube_vb(LLVertexBuffer::MAP_VERTEX, GL_STATIC_DRAW_ARB); + } + + mCubeVB->setBuffer(LLVertexBuffer::MAP_VERTEX); + + LLGLDepthTest depth(GL_TRUE, GL_FALSE); + for (LLDrawable::drawable_set_t::iterator iter = mLights.begin(); iter != mLights.end(); ++iter) + { + LLDrawable* drawablep = *iter; + + LLVOVolume* volume = drawablep->getVOVolume(); + if (!volume) + { + continue; + } + + if (volume->isAttachment()) + { + if (!sRenderAttachedLights) + { + continue; + } + } + + + LLVector4a center; + center.load3(drawablep->getPositionAgent().mV); + const F32* c = center.getF32ptr(); + F32 s = volume->getLightRadius()*1.5f; + + LLColor3 col = volume->getLightColor(); + + if (col.magVecSquared() < 0.001f) + { + continue; + } + + if (s <= 0.001f) + { + continue; + } + + LLVector4a sa; + sa.splat(s); + if (camera->AABBInFrustumNoFarClip(center, sa) == 0) + { + continue; + } + + sVisibleLightCount++; + + if (camera->getOrigin().mV[0] > c[0] + s + 0.2f || + camera->getOrigin().mV[0] < c[0] - s - 0.2f || + camera->getOrigin().mV[1] > c[1] + s + 0.2f || + camera->getOrigin().mV[1] < c[1] - s - 0.2f || + camera->getOrigin().mV[2] > c[2] + s + 0.2f || + camera->getOrigin().mV[2] < c[2] - s - 0.2f) + { //draw box if camera is outside box + if (render_local) + { + if (volume->isLightSpotlight()) + { + drawablep->getVOVolume()->updateSpotLightPriority(); + spot_lights.push_back(drawablep); + continue; + } + + /*col.mV[0] = powf(col.mV[0], 2.2f); + col.mV[1] = powf(col.mV[1], 2.2f); + col.mV[2] = powf(col.mV[2], 2.2f);*/ + + LLFastTimer ftm(FTM_LOCAL_LIGHTS); + gDeferredLightProgram.uniform3fv(LLShaderMgr::LIGHT_CENTER, 1, c); + gDeferredLightProgram.uniform1f(LLShaderMgr::LIGHT_SIZE, s); + gDeferredLightProgram.uniform3fv(LLShaderMgr::DIFFUSE_COLOR, 1, col.mV); + gDeferredLightProgram.uniform1f(LLShaderMgr::LIGHT_FALLOFF, volume->getLightFalloff()*0.5f); + gGL.syncMatrices(); + + mCubeVB->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, get_box_fan_indices(camera, center)); + stop_glerror(); + } + } + else + { + if (volume->isLightSpotlight()) + { + drawablep->getVOVolume()->updateSpotLightPriority(); + fullscreen_spot_lights.push_back(drawablep); + continue; + } + + glh::vec3f tc(c); + mat.mult_matrix_vec(tc); + + fullscreen_lights.push_back(LLVector4(tc.v[0], tc.v[1], tc.v[2], s)); + light_colors.push_back(LLVector4(col.mV[0], col.mV[1], col.mV[2], volume->getLightFalloff()*0.5f)); + } + } + unbindDeferredShader(gDeferredLightProgram); + } + + if (!spot_lights.empty()) + { + LLGLDepthTest depth(GL_TRUE, GL_FALSE); + bindDeferredShader(gDeferredSpotLightProgram); + + mCubeVB->setBuffer(LLVertexBuffer::MAP_VERTEX); + + gDeferredSpotLightProgram.enableTexture(LLShaderMgr::DEFERRED_PROJECTION); + + for (LLDrawable::drawable_list_t::iterator iter = spot_lights.begin(); iter != spot_lights.end(); ++iter) + { + LLFastTimer ftm(FTM_PROJECTORS); + LLDrawable* drawablep = *iter; + + LLVOVolume* volume = drawablep->getVOVolume(); + + LLVector4a center; + center.load3(drawablep->getPositionAgent().mV); + const F32* c = center.getF32ptr(); + F32 s = volume->getLightRadius()*1.5f; + + sVisibleLightCount++; + + setupSpotLight(gDeferredSpotLightProgram, drawablep); + + LLColor3 col = volume->getLightColor(); + /*col.mV[0] = powf(col.mV[0], 2.2f); + col.mV[1] = powf(col.mV[1], 2.2f); + col.mV[2] = powf(col.mV[2], 2.2f);*/ + + gDeferredSpotLightProgram.uniform3fv(LLShaderMgr::LIGHT_CENTER, 1, c); + gDeferredSpotLightProgram.uniform1f(LLShaderMgr::LIGHT_SIZE, s); + gDeferredSpotLightProgram.uniform3fv(LLShaderMgr::DIFFUSE_COLOR, 1, col.mV); + gDeferredSpotLightProgram.uniform1f(LLShaderMgr::LIGHT_FALLOFF, volume->getLightFalloff()*0.5f); + gGL.syncMatrices(); + + mCubeVB->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, get_box_fan_indices(camera, center)); + } + gDeferredSpotLightProgram.disableTexture(LLShaderMgr::DEFERRED_PROJECTION); + unbindDeferredShader(gDeferredSpotLightProgram); + } + + //reset mDeferredVB to fullscreen triangle + mDeferredVB->getVertexStrider(vert); + vert[0].set(-1,1,0); + vert[1].set(-1,-3,0); + vert[2].set(3,1,0); + + { + LLGLDepthTest depth(GL_FALSE); + + //full screen blit + gGL.pushMatrix(); + gGL.loadIdentity(); + gGL.matrixMode(LLRender::MM_PROJECTION); + gGL.pushMatrix(); + gGL.loadIdentity(); + + U32 count = 0; + + const U32 max_count = LL_DEFERRED_MULTI_LIGHT_COUNT; + LLVector4 light[max_count]; + LLVector4 col[max_count]; + + F32 far_z = 0.f; + + while (!fullscreen_lights.empty()) + { + LLFastTimer ftm(FTM_FULLSCREEN_LIGHTS); + light[count] = fullscreen_lights.front(); + fullscreen_lights.pop_front(); + col[count] = light_colors.front(); + light_colors.pop_front(); + + /*col[count].mV[0] = powf(col[count].mV[0], 2.2f); + col[count].mV[1] = powf(col[count].mV[1], 2.2f); + col[count].mV[2] = powf(col[count].mV[2], 2.2f);*/ + + far_z = llmin(light[count].mV[2]-light[count].mV[3], far_z); + //col[count] = pow4fsrgb(col[count], 2.2f); + count++; + if (count == max_count || fullscreen_lights.empty()) + { + U32 idx = count-1; + bindDeferredShader(gDeferredMultiLightProgram[idx]); + gDeferredMultiLightProgram[idx].uniform1i(LLShaderMgr::MULTI_LIGHT_COUNT, count); + gDeferredMultiLightProgram[idx].uniform4fv(LLShaderMgr::MULTI_LIGHT, count, (GLfloat*) light); + gDeferredMultiLightProgram[idx].uniform4fv(LLShaderMgr::MULTI_LIGHT_COL, count, (GLfloat*) col); + gDeferredMultiLightProgram[idx].uniform1f(LLShaderMgr::MULTI_LIGHT_FAR_Z, far_z); + far_z = 0.f; + count = 0; + mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX); + mDeferredVB->drawArrays(LLRender::TRIANGLES, 0, 3); + } + } + + unbindDeferredShader(gDeferredMultiLightProgram[0]); + + bindDeferredShader(gDeferredMultiSpotLightProgram); + + gDeferredMultiSpotLightProgram.enableTexture(LLShaderMgr::DEFERRED_PROJECTION); + + mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX); + + for (LLDrawable::drawable_list_t::iterator iter = fullscreen_spot_lights.begin(); iter != fullscreen_spot_lights.end(); ++iter) + { + LLFastTimer ftm(FTM_PROJECTORS); + LLDrawable* drawablep = *iter; + + LLVOVolume* volume = drawablep->getVOVolume(); + + LLVector3 center = drawablep->getPositionAgent(); + F32* c = center.mV; + F32 s = volume->getLightRadius()*1.5f; + + sVisibleLightCount++; + + glh::vec3f tc(c); + mat.mult_matrix_vec(tc); + + setupSpotLight(gDeferredMultiSpotLightProgram, drawablep); + + LLColor3 col = volume->getLightColor(); + + /*col.mV[0] = powf(col.mV[0], 2.2f); + col.mV[1] = powf(col.mV[1], 2.2f); + col.mV[2] = powf(col.mV[2], 2.2f);*/ + + gDeferredMultiSpotLightProgram.uniform3fv(LLShaderMgr::LIGHT_CENTER, 1, tc.v); + gDeferredMultiSpotLightProgram.uniform1f(LLShaderMgr::LIGHT_SIZE, s); + gDeferredMultiSpotLightProgram.uniform3fv(LLShaderMgr::DIFFUSE_COLOR, 1, col.mV); + gDeferredMultiSpotLightProgram.uniform1f(LLShaderMgr::LIGHT_FALLOFF, volume->getLightFalloff()*0.5f); + mDeferredVB->drawArrays(LLRender::TRIANGLES, 0, 3); + } + + gDeferredMultiSpotLightProgram.disableTexture(LLShaderMgr::DEFERRED_PROJECTION); + unbindDeferredShader(gDeferredMultiSpotLightProgram); + + gGL.popMatrix(); + gGL.matrixMode(LLRender::MM_MODELVIEW); + gGL.popMatrix(); + } + } + + gGL.setColorMask(true, true); + } + + /*target->flush(); + + //gamma correct lighting + gGL.matrixMode(LLRender::MM_PROJECTION); + gGL.pushMatrix(); + gGL.loadIdentity(); + gGL.matrixMode(LLRender::MM_MODELVIEW); + gGL.pushMatrix(); + gGL.loadIdentity(); + + { + LLGLDepthTest depth(GL_FALSE, GL_FALSE); + + LLVector2 tc1(0,0); + LLVector2 tc2((F32) target->getWidth()*2, + (F32) target->getHeight()*2); + + target->bindTarget(); + // Apply gamma correction to the frame here. + gDeferredPostGammaCorrectProgram.bind(); + //mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX); + S32 channel = 0; + channel = gDeferredPostGammaCorrectProgram.enableTexture(LLShaderMgr::DEFERRED_DIFFUSE, target->getUsage()); + if (channel > -1) + { + target->bindTexture(0,channel); + gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_POINT); + } + + gDeferredPostGammaCorrectProgram.uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, target->getWidth(), target->getHeight()); + + F32 gamma = gSavedSettings.getF32("RenderDeferredDisplayGamma"); + + gDeferredPostGammaCorrectProgram.uniform1f(LLShaderMgr::DISPLAY_GAMMA, (gamma > 0.1f) ? 1.0f / gamma : (1.0f/2.2f)); + + gGL.begin(LLRender::TRIANGLE_STRIP); + gGL.texCoord2f(tc1.mV[0], tc1.mV[1]); + gGL.vertex2f(-1,-1); + + gGL.texCoord2f(tc1.mV[0], tc2.mV[1]); + gGL.vertex2f(-1,3); + + gGL.texCoord2f(tc2.mV[0], tc1.mV[1]); + gGL.vertex2f(3,-1); + + gGL.end(); + + gGL.getTexUnit(channel)->unbind(target->getUsage()); + gDeferredPostGammaCorrectProgram.unbind(); + target->flush(); + } + + gGL.matrixMode(LLRender::MM_PROJECTION); + gGL.popMatrix(); + gGL.matrixMode(LLRender::MM_MODELVIEW); + gGL.popMatrix(); + + target->bindTarget();*/ + + { //render non-deferred geometry (alpha, fullbright, glow) + LLGLDisable blend(GL_BLEND); + LLGLDisable stencil(GL_STENCIL_TEST); + + pushRenderTypeMask(); + andRenderTypeMask(LLPipeline::RENDER_TYPE_ALPHA, + LLPipeline::RENDER_TYPE_FULLBRIGHT, + LLPipeline::RENDER_TYPE_VOLUME, + LLPipeline::RENDER_TYPE_GLOW, + LLPipeline::RENDER_TYPE_BUMP, + LLPipeline::RENDER_TYPE_PASS_SIMPLE, + LLPipeline::RENDER_TYPE_PASS_ALPHA, + LLPipeline::RENDER_TYPE_PASS_ALPHA_MASK, + LLPipeline::RENDER_TYPE_PASS_BUMP, + LLPipeline::RENDER_TYPE_PASS_POST_BUMP, + LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT, + LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT_ALPHA_MASK, + LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT_SHINY, + LLPipeline::RENDER_TYPE_PASS_GLOW, + LLPipeline::RENDER_TYPE_PASS_GRASS, + LLPipeline::RENDER_TYPE_PASS_SHINY, + LLPipeline::RENDER_TYPE_PASS_INVISIBLE, + LLPipeline::RENDER_TYPE_PASS_INVISI_SHINY, + LLPipeline::RENDER_TYPE_AVATAR, + LLPipeline::RENDER_TYPE_ALPHA_MASK, + LLPipeline::RENDER_TYPE_FULLBRIGHT_ALPHA_MASK, + END_RENDER_TYPES); + + renderGeomPostDeferred(*LLViewerCamera::getInstance()); + popRenderTypeMask(); + } + + //target->flush(); +} + void LLPipeline::setupSpotLight(LLGLSLShader& shader, LLDrawable* drawablep) { //construct frustum @@ -9020,6 +9775,12 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) water_clip = 1; } + bool materials_in_water = false; + +#if MATERIALS_IN_REFLECTIONS + materials_in_water = gSavedSettings.getS32("RenderWaterMaterials"); +#endif + if (!LLViewerCamera::getInstance()->cameraUnderWater()) { //generate planar reflection map @@ -9028,7 +9789,9 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) LLPipeline::sUseOcclusion = 0; gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); glClearColor(0,0,0,0); + mWaterRef.bindTarget(); + LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_WATER0; gGL.setColorMask(true, true); mWaterRef.clear(); @@ -9077,11 +9840,27 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) updateCull(camera, result); stateSort(camera, result); + if (LLPipeline::sRenderDeferred && materials_in_water) + { + mWaterRef.flush(); + + gPipeline.grabReferences(result); + gPipeline.mDeferredScreen.bindTarget(); + gGL.setColorMask(true, true); + glClearColor(0,0,0,0); + gPipeline.mDeferredScreen.clear(); + + renderGeomDeferred(camera); + } + else + { renderGeom(camera, TRUE); + } gPipeline.popRenderTypeMask(); } + gGL.setColorMask(true, false); gPipeline.pushRenderTypeMask(); clearRenderTypeMask(LLPipeline::RENDER_TYPE_WATER, @@ -9119,9 +9898,23 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) { gPipeline.grabReferences(ref_result); LLGLUserClipPlane clip_plane(plane, mat, projection); + + if (LLPipeline::sRenderDeferred && materials_in_water) + { + renderGeomDeferred(camera); + } + else + { renderGeom(camera); } } + } + + if (LLPipeline::sRenderDeferred && materials_in_water) + { + gPipeline.mDeferredScreen.flush(); + renderDeferredLightingToRT(&mWaterRef); + } gPipeline.popRenderTypeMask(); } @@ -9157,10 +9950,12 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) LLViewerCamera::updateFrustumPlanes(camera); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + LLColor4& col = LLDrawPoolWater::sWaterFogColor; glClearColor(col.mV[0], col.mV[1], col.mV[2], 0.f); mWaterDis.bindTarget(); LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_WATER1; + mWaterDis.getViewport(gGLViewport); if (!LLPipeline::sUnderWaterRender || LLDrawPoolWater::sNeedsReflectionUpdate) @@ -9176,14 +9971,36 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) gGL.setColorMask(true, true); mWaterDis.clear(); + + gGL.setColorMask(true, false); + + if (LLPipeline::sRenderDeferred && materials_in_water) + { + mWaterDis.flush(); + gPipeline.mDeferredScreen.bindTarget(); + gGL.setColorMask(true, true); + glClearColor(0,0,0,0); + gPipeline.mDeferredScreen.clear(); + gPipeline.grabReferences(result); + renderGeomDeferred(camera); + } + else + { renderGeom(camera); + } + if (LLPipeline::sRenderDeferred && materials_in_water) + { + gPipeline.mDeferredScreen.flush(); + renderDeferredLightingToRT(&mWaterDis); + } } - LLPipeline::sUnderWaterRender = FALSE; mWaterDis.flush(); + LLPipeline::sUnderWaterRender = FALSE; + } last_update = LLDrawPoolWater::sNeedsReflectionUpdate && LLDrawPoolWater::sNeedsDistortionUpdate; @@ -9320,9 +10137,15 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera gDeferredShadowCubeProgram.bind(); } + LLRenderTarget& occlusion_target = mShadowOcclusion[LLViewerCamera::sCurCameraID-1]; + + occlusion_target.bindTarget(); updateCull(shadow_cam, result); + occlusion_target.flush(); + stateSort(shadow_cam, result); + //generate shadow map gGL.matrixMode(LLRender::MM_PROJECTION); gGL.pushMatrix(); @@ -9410,7 +10233,10 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera gDeferredShadowCubeProgram.bind(); gGLLastMatrix = NULL; gGL.loadMatrix(gGLModelView); - doOcclusion(shadow_cam); + + LLRenderTarget& occlusion_source = mShadow[LLViewerCamera::sCurCameraID-1]; + + doOcclusion(shadow_cam, occlusion_source, occlusion_target); if (use_shader) { @@ -9463,7 +10289,7 @@ BOOL LLPipeline::getVisiblePointCloud(LLCamera& camera, LLVector3& min, LLVector pp.push_back(LLVector3(max.mV[0], max.mV[1], max.mV[2])); //add corners of camera frustum - for (U32 i = 0; i < 8; i++) + for (U32 i = 0; i < LLCamera::AGENT_FRUSTRUM_NUM; i++) { pp.push_back(camera.mAgentFrustum[i]); } @@ -9490,7 +10316,7 @@ BOOL LLPipeline::getVisiblePointCloud(LLCamera& camera, LLVector3& min, LLVector for (U32 i = 0; i < 12; i++) { //for each line segment in bounding box - for (U32 j = 0; j < 6; j++) + for (U32 j = 0; j < LLCamera::AGENT_PLANE_NO_USER_CLIP_NUM; j++) { //for each plane in camera frustum const LLPlane& cp = camera.getAgentPlane(j); const LLVector3& v1 = pp[bs[i*2+0]]; @@ -9576,19 +10402,19 @@ BOOL LLPipeline::getVisiblePointCloud(LLCamera& camera, LLVector3& min, LLVector } } - for (U32 j = 0; j < 6; ++j) + for (U32 j = 0; j < LLCamera::AGENT_PLANE_NO_USER_CLIP_NUM; ++j) { const LLPlane& cp = camera.getAgentPlane(j); F32 dist = cp.dist(pp[i]); if (dist > 0.05f) //point is above some plane, not contained - { + { found = false; break; - } - } + } + } - if (found) - { + if (found) + { fp.push_back(pp[i]); } } @@ -10490,39 +11316,47 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) assertInitialized(); - bool muted = avatar->isVisuallyMuted(); + bool visually_muted = avatar->isVisuallyMuted(); pushRenderTypeMask(); - if (muted) + if (visually_muted) { andRenderTypeMask(LLPipeline::RENDER_TYPE_AVATAR, END_RENDER_TYPES); } else { - andRenderTypeMask(LLPipeline::RENDER_TYPE_VOLUME, - LLPipeline::RENDER_TYPE_AVATAR, + andRenderTypeMask(LLPipeline::RENDER_TYPE_ALPHA, + LLPipeline::RENDER_TYPE_FULLBRIGHT, + LLPipeline::RENDER_TYPE_VOLUME, + LLPipeline::RENDER_TYPE_GLOW, LLPipeline::RENDER_TYPE_BUMP, - LLPipeline::RENDER_TYPE_GRASS, - LLPipeline::RENDER_TYPE_SIMPLE, - LLPipeline::RENDER_TYPE_FULLBRIGHT, - LLPipeline::RENDER_TYPE_ALPHA, - LLPipeline::RENDER_TYPE_INVISIBLE, LLPipeline::RENDER_TYPE_PASS_SIMPLE, LLPipeline::RENDER_TYPE_PASS_ALPHA, LLPipeline::RENDER_TYPE_PASS_ALPHA_MASK, + LLPipeline::RENDER_TYPE_PASS_BUMP, + LLPipeline::RENDER_TYPE_PASS_POST_BUMP, LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT, LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT_ALPHA_MASK, LLPipeline::RENDER_TYPE_PASS_FULLBRIGHT_SHINY, + LLPipeline::RENDER_TYPE_PASS_GLOW, + LLPipeline::RENDER_TYPE_PASS_GRASS, LLPipeline::RENDER_TYPE_PASS_SHINY, LLPipeline::RENDER_TYPE_PASS_INVISIBLE, LLPipeline::RENDER_TYPE_PASS_INVISI_SHINY, + LLPipeline::RENDER_TYPE_AVATAR, + LLPipeline::RENDER_TYPE_ALPHA_MASK, + LLPipeline::RENDER_TYPE_FULLBRIGHT_ALPHA_MASK, + LLPipeline::RENDER_TYPE_INVISIBLE, + LLPipeline::RENDER_TYPE_SIMPLE, END_RENDER_TYPES); } S32 occlusion = sUseOcclusion; sUseOcclusion = 0; + sReflectionRender = sRenderDeferred ? FALSE : TRUE; + sShadowRender = TRUE; sImpostorRender = TRUE; @@ -10617,32 +11451,59 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) if (!avatar->mImpostor.isComplete()) { LLFastTimer t(FTM_IMPOSTOR_ALLOCATE); - avatar->mImpostor.allocate(resX,resY,GL_RGBA,TRUE,FALSE); + if (LLPipeline::sRenderDeferred) { + avatar->mImpostor.allocate(resX,resY,GL_SRGB8_ALPHA8,TRUE,FALSE); addDeferredAttachments(avatar->mImpostor); } + else + { + avatar->mImpostor.allocate(resX,resY,GL_RGBA,TRUE,FALSE); + } gGL.getTexUnit(0)->bind(&avatar->mImpostor); gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_POINT); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); } - else if(resX != avatar->mImpostor.getWidth() || - resY != avatar->mImpostor.getHeight()) + else if(resX != avatar->mImpostor.getWidth() || resY != avatar->mImpostor.getHeight()) { LLFastTimer t(FTM_IMPOSTOR_RESIZE); - avatar->mImpostor.resize(resX,resY,GL_RGBA); + avatar->mImpostor.resize(resX,resY); } avatar->mImpostor.bindTarget(); } + F32 old_alpha = LLDrawPoolAvatar::sMinimumAlpha; + + if (visually_muted) + { //disable alpha masking for muted avatars (get whole skin silhouette) + LLDrawPoolAvatar::sMinimumAlpha = 0.f; + } + if (LLPipeline::sRenderDeferred) { avatar->mImpostor.clear(); renderGeomDeferred(camera); + + renderGeomPostDeferred(camera); + + // Shameless hack time: render it all again, + // this time writing the depth + // values we need to generate the alpha mask below + // while preserving the alpha-sorted color rendering + // from the previous pass + // + sImpostorRenderAlphaDepthPass = true; + // depth-only here... + // + gGL.setColorMask(false,false); renderGeomPostDeferred(camera); + + sImpostorRenderAlphaDepthPass = false; + } else { @@ -10650,10 +11511,28 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) glScissor(0, 0, resX, resY); avatar->mImpostor.clear(); renderGeom(camera); + + // Shameless hack time: render it all again, + // this time writing the depth + // values we need to generate the alpha mask below + // while preserving the alpha-sorted color rendering + // from the previous pass + // + sImpostorRenderAlphaDepthPass = true; + + // depth-only here... + // + gGL.setColorMask(false,false); + renderGeom(camera); + + sImpostorRenderAlphaDepthPass = false; } - + + LLDrawPoolAvatar::sMinimumAlpha = old_alpha; + { //create alpha mask based on depth buffer (grey out if muted) LLFastTimer t(FTM_IMPOSTOR_BACKGROUND); + if (LLPipeline::sRenderDeferred) { GLuint buff = GL_COLOR_ATTACHMENT0; @@ -10662,7 +11541,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) LLGLDisable blend(GL_BLEND); - if (muted) + if (visually_muted) { gGL.setColorMask(true, true); } @@ -10687,10 +11566,20 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) if (LLGLSLShader::sNoFixedFunction) { - gUIProgram.bind(); + gDebugProgram.bind(); + } + + + if (LLMuteList::getInstance()->isMuted(avatar->getID())) + { //grey muted avatar + gGL.diffuseColor4ub(64,64,64,255); + } + else + { // Visually muted avatar + gGL.diffuseColor4fv( avatar->getMutedAVColor().mV ); } - gGL.color4ub(64,64,64,255); + { gGL.begin(LLRender::QUADS); gGL.vertex3f(-1, -1, clip_plane); gGL.vertex3f(1, -1, clip_plane); @@ -10698,10 +11587,11 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) gGL.vertex3f(-1, 1, clip_plane); gGL.end(); gGL.flush(); + } if (LLGLSLShader::sNoFixedFunction) { - gUIProgram.unbind(); + gDebugProgram.unbind(); } gGL.popMatrix(); @@ -11038,6 +11928,3 @@ void LLPipeline::restoreHiddenObject( const LLUUID& id ) } } - - - diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 2c023a6f70..9aeb2d4978 100755 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -58,6 +58,7 @@ class LLRenderFunc; class LLCubeMap; class LLCullResult; class LLVOAvatar; +class LLVOPartGroup; class LLGLSLShader; class LLCurlRequest; class LLDrawPoolAlpha; @@ -176,6 +177,12 @@ public: // Object related methods void markVisible(LLDrawable *drawablep, LLCamera& camera); void markOccluder(LLSpatialGroup* group); + + //downsample source to dest, taking the maximum depth value per pixel in source and writing to dest + // if source's depth buffer cannot be bound for reading, a scratch space depth buffer must be provided + void downsampleDepthBuffer(LLRenderTarget& source, LLRenderTarget& dest, LLRenderTarget* scratch_space = NULL); + + void doOcclusion(LLCamera& camera, LLRenderTarget& source, LLRenderTarget& dest, LLRenderTarget* scratch_space = NULL); void doOcclusion(LLCamera& camera); void markNotCulled(LLSpatialGroup* group, LLCamera &camera); void markMoved(LLDrawable *drawablep, BOOL damped_motion = FALSE); @@ -196,6 +203,12 @@ public: LLVector4a* normal = NULL, // return the surface normal at the intersection point LLVector4a* tangent = NULL // return the surface tangent at the intersection point ); + + //get the closest particle to start between start and end, returns the LLVOPartGroup and particle index + LLVOPartGroup* lineSegmentIntersectParticle(const LLVector4a& start, const LLVector4a& end, LLVector4a* intersection, + S32* face_hit); + + LLViewerObject* lineSegmentIntersectInHUD(const LLVector4a& start, const LLVector4a& end, BOOL pick_transparent, S32* face_hit, // return the face hit @@ -275,13 +288,14 @@ public: void renderGeom(LLCamera& camera, BOOL forceVBOUpdate = FALSE); void renderGeomDeferred(LLCamera& camera); - void renderGeomPostDeferred(LLCamera& camera); + void renderGeomPostDeferred(LLCamera& camera, bool do_occlusion=true); void renderGeomShadow(LLCamera& camera); void bindDeferredShader(LLGLSLShader& shader, U32 light_index = 0, U32 noise_map = 0xFFFFFFFF); void setupSpotLight(LLGLSLShader& shader, LLDrawable* drawablep); void unbindDeferredShader(LLGLSLShader& shader); void renderDeferredLighting(); + void renderDeferredLightingToRT(LLRenderTarget* target); void generateWaterReflection(LLCamera& camera); void generateSunShadow(LLCamera& camera); @@ -581,6 +595,7 @@ public: static BOOL sPickAvatar; static BOOL sReflectionRender; static BOOL sImpostorRender; + static BOOL sImpostorRenderAlphaDepthPass; static BOOL sUnderWaterRender; static BOOL sRenderGlow; static BOOL sTextureBindTest; @@ -603,6 +618,7 @@ public: LLRenderTarget mFXAABuffer; LLRenderTarget mEdgeMap; LLRenderTarget mDeferredDepth; + LLRenderTarget mOcclusionDepth; LLRenderTarget mDeferredLight; LLRenderTarget mHighlight; LLRenderTarget mPhysicsDisplay; @@ -615,6 +631,7 @@ public: //sun shadow map LLRenderTarget mShadow[6]; + LLRenderTarget mShadowOcclusion[6]; std::vector<LLVector3> mShadowFrustPoints[4]; LLVector4 mShadowError; LLVector4 mShadowFOV; @@ -902,6 +919,7 @@ public: static F32 RenderGlowWidth; static F32 RenderGlowStrength; static BOOL RenderDepthOfField; + static BOOL RenderDepthOfFieldInEditMode; static F32 CameraFocusTransitionTime; static F32 CameraFNumber; static F32 CameraFocalLength; diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index fe794c18c5..d01e228638 100755 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -885,6 +885,20 @@ name="blue" value="0 0 1 1"/> + <!--Resize bar colors --> + + <color + name="ResizebarBorderLight" + value="0.231 0.231 0.231 1"/> + + <color + name="ResizebarBorderDark" + value="0.133 0.133 0.133 1"/> + + <color + name="ResizebarBody" + value="0.208 0.208 0.208 1"/> + <!-- syntax highlighting (LSL Scripts) --> <color name="SyntaxLslComment1Sided" @@ -899,6 +913,9 @@ name="SyntaxLslConstantInteger" value=".1 .1 .5 1.0" /> <color + name="ResizebarBody" + value="0.208 0.208 0.208 1"/> + name="SyntaxLslConstantKey" value=".1 .3 .5 1.0" /> <color diff --git a/indra/newview/skins/default/textures/icons/Conv_toolbar_add_person.png b/indra/newview/skins/default/textures/icons/Conv_toolbar_add_person.png Binary files differindex 0631f16f3b..0631f16f3b 100755..100644 --- a/indra/newview/skins/default/textures/icons/Conv_toolbar_add_person.png +++ b/indra/newview/skins/default/textures/icons/Conv_toolbar_add_person.png diff --git a/indra/newview/skins/default/textures/icons/Conv_toolbar_arrow_ne.png b/indra/newview/skins/default/textures/icons/Conv_toolbar_arrow_ne.png Binary files differindex 578482f5ed..578482f5ed 100755..100644 --- a/indra/newview/skins/default/textures/icons/Conv_toolbar_arrow_ne.png +++ b/indra/newview/skins/default/textures/icons/Conv_toolbar_arrow_ne.png diff --git a/indra/newview/skins/default/textures/icons/Conv_toolbar_arrow_sw.png b/indra/newview/skins/default/textures/icons/Conv_toolbar_arrow_sw.png Binary files differindex 7676131790..7676131790 100755..100644 --- a/indra/newview/skins/default/textures/icons/Conv_toolbar_arrow_sw.png +++ b/indra/newview/skins/default/textures/icons/Conv_toolbar_arrow_sw.png diff --git a/indra/newview/skins/default/textures/icons/Conv_toolbar_call_log.png b/indra/newview/skins/default/textures/icons/Conv_toolbar_call_log.png Binary files differindex 2880eb766a..2880eb766a 100755..100644 --- a/indra/newview/skins/default/textures/icons/Conv_toolbar_call_log.png +++ b/indra/newview/skins/default/textures/icons/Conv_toolbar_call_log.png diff --git a/indra/newview/skins/default/textures/icons/Conv_toolbar_close.png b/indra/newview/skins/default/textures/icons/Conv_toolbar_close.png Binary files differindex d009c8f446..d009c8f446 100755..100644 --- a/indra/newview/skins/default/textures/icons/Conv_toolbar_close.png +++ b/indra/newview/skins/default/textures/icons/Conv_toolbar_close.png diff --git a/indra/newview/skins/default/textures/icons/Conv_toolbar_collapse.png b/indra/newview/skins/default/textures/icons/Conv_toolbar_collapse.png Binary files differindex 8d82960e28..8d82960e28 100755..100644 --- a/indra/newview/skins/default/textures/icons/Conv_toolbar_collapse.png +++ b/indra/newview/skins/default/textures/icons/Conv_toolbar_collapse.png diff --git a/indra/newview/skins/default/textures/icons/Conv_toolbar_expand.png b/indra/newview/skins/default/textures/icons/Conv_toolbar_expand.png Binary files differindex f718d3fc60..f718d3fc60 100755..100644 --- a/indra/newview/skins/default/textures/icons/Conv_toolbar_expand.png +++ b/indra/newview/skins/default/textures/icons/Conv_toolbar_expand.png diff --git a/indra/newview/skins/default/textures/icons/Conv_toolbar_hang_up.png b/indra/newview/skins/default/textures/icons/Conv_toolbar_hang_up.png Binary files differindex 315e2c581a..315e2c581a 100755..100644 --- a/indra/newview/skins/default/textures/icons/Conv_toolbar_hang_up.png +++ b/indra/newview/skins/default/textures/icons/Conv_toolbar_hang_up.png diff --git a/indra/newview/skins/default/textures/icons/Conv_toolbar_open_call.png b/indra/newview/skins/default/textures/icons/Conv_toolbar_open_call.png Binary files differindex 732ab02a20..732ab02a20 100755..100644 --- a/indra/newview/skins/default/textures/icons/Conv_toolbar_open_call.png +++ b/indra/newview/skins/default/textures/icons/Conv_toolbar_open_call.png diff --git a/indra/newview/skins/default/textures/icons/Conv_toolbar_plus.png b/indra/newview/skins/default/textures/icons/Conv_toolbar_plus.png Binary files differindex 25a32cb2ba..25a32cb2ba 100755..100644 --- a/indra/newview/skins/default/textures/icons/Conv_toolbar_plus.png +++ b/indra/newview/skins/default/textures/icons/Conv_toolbar_plus.png diff --git a/indra/newview/skins/default/textures/icons/Conv_toolbar_sort.png b/indra/newview/skins/default/textures/icons/Conv_toolbar_sort.png Binary files differindex 08debeb91f..08debeb91f 100755..100644 --- a/indra/newview/skins/default/textures/icons/Conv_toolbar_sort.png +++ b/indra/newview/skins/default/textures/icons/Conv_toolbar_sort.png diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index b0e4b71d21..54f60f4441 100755 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -774,4 +774,7 @@ with the same filename but different name <texture name="Popup_Caution" file_name="icons/pop_up_caution.png"/> <texture name="Camera_Drag_Dot" file_name="world/CameraDragDot.png"/> <texture name="NavBar Separator" file_name="navbar/separator.png"/> + + <texture name="Horizontal Drag Handle" file_name="widgets/horizontal_drag_handle.png"/> + <texture name="Vertical Drag Handle" file_name="widgets/vertical_drag_handle.png"/> </textures> diff --git a/indra/newview/skins/default/textures/widgets/horizontal_drag_handle.png b/indra/newview/skins/default/textures/widgets/horizontal_drag_handle.png Binary files differnew file mode 100644 index 0000000000..642eac4065 --- /dev/null +++ b/indra/newview/skins/default/textures/widgets/horizontal_drag_handle.png diff --git a/indra/newview/skins/default/textures/widgets/vertical_drag_handle.png b/indra/newview/skins/default/textures/widgets/vertical_drag_handle.png Binary files differnew file mode 100644 index 0000000000..b06b70cf36 --- /dev/null +++ b/indra/newview/skins/default/textures/widgets/vertical_drag_handle.png diff --git a/indra/newview/skins/default/xui/da/floater_about.xml b/indra/newview/skins/default/xui/da/floater_about.xml index fc8bc33096..9206690c8f 100755 --- a/indra/newview/skins/default/xui/da/floater_about.xml +++ b/indra/newview/skins/default/xui/da/floater_about.xml @@ -8,7 +8,7 @@ Bygget med [COMPILER] version [COMPILER_VERSION] </floater.string> <floater.string name="AboutPosition"> - Du er ved [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1] i regionen [REGION] lokaliseret ved <nolink>[HOSTNAME]</nolink> ([HOSTIP]) + Du er ved [POSITION_LOCAL_0,number,1], [POSITION_LOCAL_1,number,1], [POSITION_LOCAL_2,number,1] i regionen [REGION] lokaliseret ved <nolink>[HOSTNAME]</nolink> ([HOSTIP]) [SERVER_VERSION] [SERVER_RELEASE_NOTES_URL] </floater.string> diff --git a/indra/newview/skins/default/xui/de/floater_about.xml b/indra/newview/skins/default/xui/de/floater_about.xml index 4387a61963..bc0eae7c5d 100755 --- a/indra/newview/skins/default/xui/de/floater_about.xml +++ b/indra/newview/skins/default/xui/de/floater_about.xml @@ -8,7 +8,9 @@ Kompiliert mit [COMPILER] version [COMPILER_VERSION] </floater.string> <floater.string name="AboutPosition"> - Sie befinden sich in [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1] in [REGION] auf <nolink>[HOSTNAME]</nolink> ([HOSTIP]) + Sie befinden sich an [POSITION_LOCAL_0,number,1], [POSITION_LOCAL_1,number,1], [POSITION_LOCAL_2,number,1] in [REGION] auf <nolink>[HOSTNAME]</nolink> ([HOSTIP]) +SLURL: <nolink>[SLURL]</nolink> +(globale Koordinaten [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1]) [SERVER_VERSION] [SERVER_RELEASE_NOTES_URL] </floater.string> diff --git a/indra/newview/skins/default/xui/de/floater_bulk_perms.xml b/indra/newview/skins/default/xui/de/floater_bulk_perms.xml index 8f99fc933c..27a74c874e 100755 --- a/indra/newview/skins/default/xui/de/floater_bulk_perms.xml +++ b/indra/newview/skins/default/xui/de/floater_bulk_perms.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="floaterbulkperms" title="BERECHTIGUNGEN BEARBEITEN"> +<floater name="floaterbulkperms" title="INHALTSBERECHTIGUNGEN ÄNDERN"> <floater.string name="nothing_to_modify_text"> Auswahl enthält keinen Inhalt, der bearbeitet werden kann. </floater.string> @@ -33,7 +33,7 @@ <button label="√ Alle" label_selected="Alle" name="check_all"/> <button label="Löschen" label_selected="Keine" name="check_none"/> <text name="newperms"> - Neue Inhalts-Berechtigungen + Inhaltsberechtigungen ändern in </text> <text name="GroupLabel"> Gruppe: @@ -49,6 +49,7 @@ <check_box label="Bearbeiten" name="next_owner_modify"/> <check_box label="Kopieren" name="next_owner_copy"/> <check_box initial_value="true" label="Transferieren" name="next_owner_transfer" tool_tip="Nächster Eigentümer kann dieses Objekt weitergeben oder -verkaufen"/> - <button label="OK" name="apply"/> + <button label="OK" name="ok"/> + <button label="Anwenden" name="apply"/> <button label="Abbrechen" name="close"/> </floater> diff --git a/indra/newview/skins/default/xui/de/floater_goto_line.xml b/indra/newview/skins/default/xui/de/floater_goto_line.xml new file mode 100644 index 0000000000..02550ec398 --- /dev/null +++ b/indra/newview/skins/default/xui/de/floater_goto_line.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="script goto" title="GEHE ZU ZEILE"> + <button label="OK" label_selected="OK" name="goto_btn"/> + <text name="txt"> + Gehe zu Zeile + </text> +</floater> diff --git a/indra/newview/skins/default/xui/de/floater_im_session.xml b/indra/newview/skins/default/xui/de/floater_im_session.xml index f96eb72cb1..b07b74bf4a 100755 --- a/indra/newview/skins/default/xui/de/floater_im_session.xml +++ b/indra/newview/skins/default/xui/de/floater_im_session.xml @@ -34,13 +34,11 @@ <layout_panel name="body_panel"> <layout_stack name="im_panels"> <layout_panel name="right_part_holder"> - <panel name="trnsAndChat_panel"> - <layout_stack name="translate_and_chat_stack"> - <layout_panel name="translate_chat_checkbox_lp"> - <check_box label="Chat übersetzen" name="translate_chat_checkbox"/> - </layout_panel> - </layout_stack> - </panel> + <layout_stack name="translate_and_chat_stack"> + <layout_panel name="translate_chat_checkbox_lp"> + <check_box label="Chat übersetzen" name="translate_chat_checkbox"/> + </layout_panel> + </layout_stack> </layout_panel> </layout_stack> </layout_panel> diff --git a/indra/newview/skins/default/xui/de/floater_pathfinding_console.xml b/indra/newview/skins/default/xui/de/floater_pathfinding_console.xml index 88e9f53a4c..ebf8f01632 100755 --- a/indra/newview/skins/default/xui/de/floater_pathfinding_console.xml +++ b/indra/newview/skins/default/xui/de/floater_pathfinding_console.xml @@ -71,7 +71,7 @@ <text name="show_label"> Anzeigen: </text> - <check_box label="Test" name="show_world"/> + <check_box label="Welt" name="show_world"/> <check_box label="Nur bewegliche Objekte" name="show_world_movables_only"/> <check_box label="Navmesh" name="show_navmesh"/> <text name="show_walkability_label"> diff --git a/indra/newview/skins/default/xui/de/menu_attachment_other.xml b/indra/newview/skins/default/xui/de/menu_attachment_other.xml index 237c92f7d2..4c125c8b5d 100755 --- a/indra/newview/skins/default/xui/de/menu_attachment_other.xml +++ b/indra/newview/skins/default/xui/de/menu_attachment_other.xml @@ -11,7 +11,9 @@ <menu_item_call label="Einfrieren" name="Freeze..."/> <menu_item_call label="Hinauswerfen" name="Eject..."/> <menu_item_call label="Fehler in Texturen beseitigen" name="Debug..."/> + <menu_item_call label="XML ausgeben" name="Dump XML"/> <menu_item_call label="Hineinzoomen" name="Zoom In"/> <menu_item_call label="Bezahlen" name="Pay..."/> <menu_item_call label="Objektprofil" name="Object Inspect"/> + <menu_item_call label="Partikeleigentümer blockieren" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/de/menu_attachment_self.xml b/indra/newview/skins/default/xui/de/menu_attachment_self.xml index 325d52a22e..7888c7b0a1 100755 --- a/indra/newview/skins/default/xui/de/menu_attachment_self.xml +++ b/indra/newview/skins/default/xui/de/menu_attachment_self.xml @@ -12,5 +12,7 @@ <menu_item_call label="Meine Gruppen" name="Groups..."/> <menu_item_call label="Mein Profil" name="Profile..."/> <menu_item_call label="Fehler in Texturen beseitigen" name="Debug..."/> + <menu_item_call label="XML ausgeben" name="Dump XML"/> <menu_item_call label="Fallen lassen" name="Drop"/> + <menu_item_call label="Partikeleigentümer blockieren" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/de/menu_avatar_other.xml b/indra/newview/skins/default/xui/de/menu_avatar_other.xml index 8aee0be3d2..65dc054ed5 100755 --- a/indra/newview/skins/default/xui/de/menu_avatar_other.xml +++ b/indra/newview/skins/default/xui/de/menu_avatar_other.xml @@ -11,6 +11,8 @@ <menu_item_call label="Einfrieren" name="Freeze..."/> <menu_item_call label="Hinauswerfen" name="Eject..."/> <menu_item_call label="Fehler in Texturen beseitigen" name="Debug..."/> + <menu_item_call label="XML ausgeben" name="Dump XML"/> <menu_item_call label="Hineinzoomen" name="Zoom In"/> <menu_item_call label="Bezahlen" name="Pay..."/> + <menu_item_call label="Partikeleigentümer blockieren" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/de/menu_avatar_self.xml b/indra/newview/skins/default/xui/de/menu_avatar_self.xml index c49f4b198b..022cd8c3ca 100755 --- a/indra/newview/skins/default/xui/de/menu_avatar_self.xml +++ b/indra/newview/skins/default/xui/de/menu_avatar_self.xml @@ -29,4 +29,6 @@ <menu_item_call label="Meine Gruppen" name="Groups..."/> <menu_item_call label="Mein Profil" name="Profile..."/> <menu_item_call label="Fehler in Texturen beseitigen" name="Debug..."/> + <menu_item_call label="XML ausgeben" name="Dump XML"/> + <menu_item_call label="Partikeleigentümer blockieren" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/de/menu_conversation.xml b/indra/newview/skins/default/xui/de/menu_conversation.xml index 30d3ab79e1..bdfa66c23b 100644 --- a/indra/newview/skins/default/xui/de/menu_conversation.xml +++ b/indra/newview/skins/default/xui/de/menu_conversation.xml @@ -3,6 +3,7 @@ <menu_item_call label="Unterhaltung schließen" name="close_conversation"/> <menu_item_call label="Unterhaltung öffnen" name="open_voice_conversation"/> <menu_item_call label="Voice-Verbindung trennen" name="disconnect_from_voice"/> + <menu_item_call label="Ausgewählte schließen" name="close_selected_conversations"/> <menu_item_call label="Profil anzeigen" name="view_profile"/> <menu_item_call label="IM" name="im"/> <menu_item_call label="Teleport anbieten" name="offer_teleport"/> diff --git a/indra/newview/skins/default/xui/de/menu_land.xml b/indra/newview/skins/default/xui/de/menu_land.xml index de679da3d8..0bbf8c666e 100755 --- a/indra/newview/skins/default/xui/de/menu_land.xml +++ b/indra/newview/skins/default/xui/de/menu_land.xml @@ -6,4 +6,5 @@ <menu_item_call label="Pass kaufen" name="Land Buy Pass"/> <menu_item_call label="Bauen" name="Create"/> <menu_item_call label="Land bearbeiten" name="Edit Terrain"/> + <menu_item_call label="Partikeleigentümer blockieren" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/de/menu_login.xml b/indra/newview/skins/default/xui/de/menu_login.xml index b43b41a5dc..62358cc5a8 100755 --- a/indra/newview/skins/default/xui/de/menu_login.xml +++ b/indra/newview/skins/default/xui/de/menu_login.xml @@ -18,7 +18,13 @@ <menu_item_call label="Servicebedingungen anzeigen" name="TOS"/> <menu_item_call label="Wichtige Meldung anzeigen" name="Critical"/> <menu_item_call label="Web Content Floater Debug Test" name="Web Content Floater Debug Test"/> - <menu label="Protokollierungsstufe festlegen" name="Set Logging Level"/> + <menu label="Protokollierungsstufe festlegen" name="Set Logging Level"> + <menu_item_check label="Debug" name="Debug"/> + <menu_item_check label="Info" name="Info"/> + <menu_item_check label="Warnung" name="Warning"/> + <menu_item_check label="Fehler" name="Error"/> + <menu_item_check label="Keine" name="None"/> + </menu> <menu_item_check label="Grid-Auswahl anzeigen" name="Show Grid Picker"/> <menu_item_call label="Benachrichtigungs-Konsole anzeigen" name="Show Notifications Console"/> </menu> diff --git a/indra/newview/skins/default/xui/de/menu_mute_particle.xml b/indra/newview/skins/default/xui/de/menu_mute_particle.xml new file mode 100644 index 0000000000..ea8ae03ee0 --- /dev/null +++ b/indra/newview/skins/default/xui/de/menu_mute_particle.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<!-- *NOTE: See also menu_attachment_other.xml --> +<context_menu name="Mute Particle Pie"> + <menu_item_call label="Partikeleigentümer blockieren" name="Mute Particle"/> +</context_menu> diff --git a/indra/newview/skins/default/xui/de/menu_object.xml b/indra/newview/skins/default/xui/de/menu_object.xml index 9f44ced928..de2b409678 100755 --- a/indra/newview/skins/default/xui/de/menu_object.xml +++ b/indra/newview/skins/default/xui/de/menu_object.xml @@ -5,13 +5,13 @@ </menu_item_call> <menu_item_call label="Bearbeiten" name="Edit..."/> <menu_item_call label="Bauen" name="Build"/> - <menu_item_call label="In Linksets anzeigen" name="show_in_linksets"/> - <menu_item_call label="In Figuren anzeigen" name="show_in_characters"/> <menu_item_call label="Öffnen" name="Open"/> <menu_item_call label="Hier sitzen" name="Object Sit"/> <menu_item_call label="Aufstehen" name="Object Stand Up"/> <menu_item_call label="Objektprofil" name="Object Inspect"/> <menu_item_call label="Hineinzoomen" name="Zoom In"/> + <menu_item_call label="In Linksets anzeigen" name="show_in_linksets"/> + <menu_item_call label="In Figuren anzeigen" name="show_in_characters"/> <context_menu label="Anziehen" name="Put On"> <menu_item_call label="Anziehen" name="Wear"/> <menu_item_call label="Hinzufügen" name="Add"/> @@ -28,4 +28,5 @@ <menu_item_call label="Bezahlen" name="Pay..."/> <menu_item_call label="Kaufen" name="Buy..."/> <menu_item_call label="Löschen" name="Delete"/> + <menu_item_call label="Partikeleigentümer blockieren" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/de/menu_url_agent.xml b/indra/newview/skins/default/xui/de/menu_url_agent.xml index c61ebb0eae..ddb072ba8f 100755 --- a/indra/newview/skins/default/xui/de/menu_url_agent.xml +++ b/indra/newview/skins/default/xui/de/menu_url_agent.xml @@ -3,6 +3,7 @@ <menu_item_call label="Profil anzeigen" name="show_agent"/> <menu_item_call label="IM senden..." name="send_im"/> <menu_item_call label="Freund hinzufügen..." name="add_friend"/> + <menu_item_call label="Freund entfernen..." name="remove_friend"/> <menu_item_call label="Name in Zwischenablage kopieren" name="url_copy_label"/> <menu_item_call label="SLurl in die Zwischenablage kopieren" name="url_copy"/> </context_menu> diff --git a/indra/newview/skins/default/xui/de/menu_url_objectim.xml b/indra/newview/skins/default/xui/de/menu_url_objectim.xml index 77b7004e44..fc01ea8444 100755 --- a/indra/newview/skins/default/xui/de/menu_url_objectim.xml +++ b/indra/newview/skins/default/xui/de/menu_url_objectim.xml @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <context_menu name="Url Popup"> <menu_item_call label="Objektprofil..." name="show_object"/> + <menu_item_call label="Blockieren..." name="block_object"/> <menu_item_call label="Auf Karte zeigen" name="show_on_map"/> <menu_item_call label="Zu Objekt-Position teleportieren" name="teleport_to_object"/> <menu_item_call label="Objektname in Zwischenablage kopieren" name="url_copy_label"/> diff --git a/indra/newview/skins/default/xui/de/menu_viewer.xml b/indra/newview/skins/default/xui/de/menu_viewer.xml index 47d9fec352..be5d4891d7 100755 --- a/indra/newview/skins/default/xui/de/menu_viewer.xml +++ b/indra/newview/skins/default/xui/de/menu_viewer.xml @@ -16,7 +16,10 @@ <menu_item_call label="Animation meines Avatars stoppen" name="Stop Animating My Avatar"/> <menu_item_call label="Gehen/Rennen/Fliegen..." name="Walk / run / fly"/> </menu> - <menu label="Status" name="Status"/> + <menu label="Status" name="Status"> + <menu_item_check label="Abwesend" name="Away"/> + <menu_item_check label="Nicht stören" name="Do Not Disturb"/> + </menu> <menu_item_call label="L$ kaufen..." name="Buy and Sell L$"/> <menu_item_call label="Händler-Outbox..." name="MerchantOutbox"/> <menu_item_call label="Kontoübersicht..." name="Manage My Account"> @@ -32,6 +35,7 @@ <menu_item_check label="Unterhaltungen..." name="Conversations"/> <menu_item_check label="Chat in der Nähe..." name="Nearby Chat"/> <menu_item_check label="Sprechen" name="Speak"/> + <menu_item_check label="Unterhaltungsprotokoll..." name="Conversation Log..."/> <menu label="Voice-Morphing" name="VoiceMorphing"> <menu_item_check label="Kein Voice-Morphing" name="NoVoiceMorphing"/> <menu_item_check label="Vorschau..." name="Preview"/> @@ -42,6 +46,7 @@ <menu_item_check label="Gruppen" name="My Groups"/> <menu_item_check label="Leute in der Nähe" name="Active Speakers"/> <menu_item_call label="Blockierliste" name="Block List"/> + <menu_item_check label="Nicht stören" name="Do Not Disturb"/> </menu> <menu label="Welt" name="World"> <menu_item_call label="Landmarke für diesen Ort setzen" name="Create Landmark Here"/> @@ -110,6 +115,7 @@ <menu_item_call label="Nächsten Teil mit einsschließen" name="Include Next Part"/> <menu_item_call label="Vorherige Teile mit einschließen" name="Include Previous Part"/> </menu> + <menu_item_call label="Linksets..." name="pathfinding_linkset_menu_item"/> <menu_item_call label="Fokus auf Auswahl" name="Focus on Selection"/> <menu_item_call label="Auf Auswahl zoomen" name="Zoom to Selection"/> <menu label="Objekt" name="Object"> @@ -279,6 +285,7 @@ <menu_item_check label="Framerate randomisieren" name="Randomize Framerate"/> <menu_item_check label="Periodic Slow Frame" name="Periodic Slow Frame"/> <menu_item_check label="Frame-Test" name="Frame Test"/> + <menu_item_call label="Rahmenprofil" name="Frame Profile"/> </menu> <menu label="Metadaten darstellen" name="Render Metadata"> <menu_item_check label="Bonding Boxes" name="Bounding Boxes"/> @@ -313,9 +320,10 @@ <menu_item_check label="Achsen" name="Axes"/> <menu_item_check label="Tangentenbasis" name="Tangent Basis"/> <menu_item_call label="Texturinfo für ausgewähltes Objekt" name="Selected Texture Info Basis"/> + <menu_item_call label="Ausgewählte Materialinfos" name="Selected Material Info"/> <menu_item_check label="Wireframe" name="Wireframe"/> <menu_item_check label="Objekt-Objekt Okklusion" name="Object-Object Occlusion"/> - <menu_item_check label="Uber Licht Modell" name="Advanced Lighting Model"/> + <menu_item_check label="Erweitertes Beleuchtungsmodell" name="Advanced Lighting Model"/> <menu_item_check label="Schatten von Sonne-/Mond-Projektoren" name="Shadows from Sun/Moon/Projectors"/> <menu_item_check label="SSAO und Schattenglättung" name="SSAO and Shadow Smoothing"/> <menu_item_check label="Fehler in GL beseitigen" name="Debug GL"/> @@ -325,7 +333,6 @@ <menu_item_check label="Animationstexturen" name="Animation Textures"/> <menu_item_check label="Texturen deaktivieren" name="Disable Textures"/> <menu_item_check label="Voll-Res-Texturen" name="Rull Res Textures"/> - <menu_item_check label="Textur-Atlas (experimentell)" name="Texture Atlas"/> <menu_item_check label="Angehängte Lichter rendern" name="Render Attached Lights"/> <menu_item_check label="Angehängte Partikel rendern" name="Render Attached Particles"/> <menu_item_check label="Leucht-Objekte schweben lassen" name="Hover Glow Objects"/> @@ -361,7 +368,6 @@ <menu_item_call label="Fokus ausgeben" name="Dump Focus Holder"/> <menu_item_call label="Ausgewählte Objektinfo drucken" name="Print Selected Object Info"/> <menu_item_call label="Agent-Info drucken" name="Print Agent Info"/> - <menu_item_call label="Speicher-Stats" name="Memory Stats"/> <menu_item_check label="Regions-Debug-Konsole" name="Region Debug Console"/> <menu_item_check label="Fehler in SelectMgr beseitigen" name="Debug SelectMgr"/> <menu_item_check label="Fehler in Klicks beseitigen" name="Debug Clicks"/> @@ -395,7 +401,6 @@ </menu> <menu_item_call label="Param auf Standard erzwingen" name="Force Params to Default"/> <menu_item_check label="Animations-Info" name="Animation Info"/> - <menu_item_check label="Zeitlupen-Animationen" name="Slow Motion Animations"/> <menu_item_check label="Kamerafokus anzeigen" name="Show Look At"/> <menu_item_check label="Klickpunkt anzeigen??" name="Show Point At"/> <menu_item_check label="Fehler in Landaktualisierung beseitigen" name="Debug Joint Updates"/> diff --git a/indra/newview/skins/default/xui/de/notifications.xml b/indra/newview/skins/default/xui/de/notifications.xml index dc0d7dc6b4..b3ae98f633 100755 --- a/indra/newview/skins/default/xui/de/notifications.xml +++ b/indra/newview/skins/default/xui/de/notifications.xml @@ -146,7 +146,7 @@ Wählen Sie ein einzelnes Objekt aus und versuchen Sie es erneut. <usetemplate canceltext="Abbrechen" name="yesnocancelbuttons" notext="Nicht speichern" yestext="Alles speichern"/> </notification> <notification name="FriendsAndGroupsOnly"> - Leute, die nicht auf Ihrer Freundesliste stehen, werden nicht wissen, dass Sie deren Anrufe oder Sofortnachrichten ignoriert haben. + Personen, die nicht auf Ihrer Freundesliste stehen, werden nicht informiert, dass Sie ihre Anrufe und Instant Messages ignorieren. <usetemplate name="okbutton" yestext="Ja"/> </notification> <notification name="FavoritesOnLogin"> @@ -216,6 +216,14 @@ Der Rolle „[ROLE_NAME]“ diese Fähigkeit zuweisen? Der Rolle „[ROLE_NAME]“ diese Fähigkeit zuweisen? <usetemplate name="okcancelbuttons" notext="Nein" yestext="Ja"/> </notification> + <notification name="EjectGroupMemberWarning"> + Sie sind dabei, [AVATAR_NAME] aus der Gruppe hinauszuwerfen. + <usetemplate ignoretext="Hinauswerfen eines einzelnen Gruppenmitglieds bestätigen" name="okcancelignore" notext="Abbrechen" yestext="Hinauswerfen"/> + </notification> + <notification name="EjectGroupMembersWarning"> + Sie sind dabei, [COUNT] Mitglieder aus der Gruppe hinauszuwerfen. + <usetemplate ignoretext="Hinauswerfen mehrerer Gruppenmitglieder bestätigen" name="okcancelignore" notext="Abbrechen" yestext="Hinauswerfen"/> + </notification> <notification name="AttachmentDrop"> Sie möchten Ihren Anhang wirklich fallen lassen? Möchten Sie fortfahren? @@ -1124,7 +1132,7 @@ auf ALLEN LÄNDERN in diesem Sim LÖSCHEN? Geben sie einen höheren Betrag ein. </notification> <notification name="ConfirmItemDeleteHasLinks"> - Mindestens eines Ihrer ausgewählten Objekte verfügt über verknüpfte Objekte. Wenn Sie dieses Objekt löschen, funktionieren die Verknüpfungen nicht mehr. Wir empfehlen Ihnen daher, diese Verknüpfungen zuerst zu löschen. + Auf mindestens eines der Objekte wird über Verknüpfungen Bezug genommen. Wenn Sie dieses Objekt löschen, funktionieren die Verknüpfungen nicht mehr. Wir empfehlen daher, diese Verknüpfungen zuerst zu löschen. Möchten Sie diese Objekte wirklich löschen? <usetemplate name="okcancelbuttons" notext="Abbrechen" yestext="OK"/> @@ -1142,9 +1150,9 @@ Möchten Sie diese Objekte löschen? <usetemplate name="okcancelbuttons" notext="Abbrechen" yestext="OK"/> </notification> <notification name="ConfirmObjectDeleteNoOwn"> - Mindestens eines der ausgewählten Objekt gehört nicht Ihnen. + Mindestens eines der ausgewählten Objekte gehört nicht Ihnen. -Möchten Sie diese Objekte löschen? +Möchten Sie diese Objekte wirklich löschen? <usetemplate name="okcancelbuttons" notext="Abbrechen" yestext="OK"/> </notification> <notification name="ConfirmObjectDeleteLockNoCopy"> @@ -1158,14 +1166,14 @@ Möchten Sie diese Objekte löschen? Mindestens ein Objekt ist gesperrt. Mindestens ein Objekt gehört nicht Ihnen. -Möchten Sie diese Objekte löschen? +Möchten Sie diese Objekte wirklich löschen? <usetemplate name="okcancelbuttons" notext="Abbrechen" yestext="OK"/> </notification> <notification name="ConfirmObjectDeleteNoCopyNoOwn"> Mindestens ein Objekt kann nicht kopiert werden. Mindestens ein Objekt gehört nicht Ihnen. -Möchten Sie diese Objekte löschen? +Möchten Sie diese Objekte wirklich löschen? <usetemplate name="okcancelbuttons" notext="Abbrechen" yestext="OK"/> </notification> <notification name="ConfirmObjectDeleteLockNoCopyNoOwn"> @@ -1173,7 +1181,7 @@ Möchten Sie diese Objekte löschen? Mindestens ein Objekt kann nicht kopiert werden. Mindestens ein Objekt gehört nicht Ihnen. -Möchten Sie diese Objekte löschen? +Möchten Sie diese Objekte wirklich löschen? <usetemplate name="okcancelbuttons" notext="Abbrechen" yestext="OK"/> </notification> <notification name="ConfirmObjectTakeLock"> @@ -1492,13 +1500,43 @@ Version [VERSION] [[RELEASE_NOTES_FULL_URL] Informationen zu diesem Update] </notification> <notification name="RequiredUpdateDownloadedVerboseDialog"> Ein erforderliches Softwareupdate wurde heruntergeladen. -Version [VERSION] +Version [VERSION] [[INFO_URL] Infos zu diesem Update] Zur Installation des Updates muss [APP_NAME] neu gestartet werden. <usetemplate name="okbutton" yestext="OK"/> </notification> <notification name="RequiredUpdateDownloadedDialog"> Zur Installation des Updates muss [APP_NAME] neu gestartet werden. +[[INFO_URL] Infos zu diesem Update] + <usetemplate name="okbutton" yestext="OK"/> + </notification> + <notification name="OtherChannelDownloadBackgroundTip"> + Für Ihre [APP_NAME]-Installation wurde ein Update heruntergeladen. +Version [VERSION] +Dieser experimentelle Viewer wurde durch einen [NEW_CHANNEL] Viewer ersetzt; +weitere Details zu diesem Update finden Sie [[INFO_URL] hier]. + <usetemplate name="okcancelbuttons" notext="Später..." yestext="Jetzt installieren und [APP_NAME] neu starten"/> + </notification> + <notification name="OtherChannelDownloadBackgroundDialog"> + Für Ihre [APP_NAME]-Installation wurde ein Update heruntergeladen. +Version [VERSION] +Dieser experimentelle Viewer wurde durch einen [NEW_CHANNEL] Viewer ersetzt; +weitere Infos zu diesem Update finden Sie [[INFO_URL] hier]. + <usetemplate name="okcancelbuttons" notext="Später..." yestext="Jetzt installieren und [APP_NAME] neu starten"/> + </notification> + <notification name="OtherChannelRequiredUpdateDownloadedVerboseDialog"> + Ein erforderliches Softwareupdate wurde heruntergeladen. +Version [VERSION] +Dieser experimentelle Viewer wurde durch einen [NEW_CHANNEL] Viewer ersetzt; +weitere Infos zu diesem Update finden Sie [[INFO_URL] hier]. + +Zur Installation des Updates muss [APP_NAME] neu gestartet werden. + <usetemplate name="okbutton" yestext="OK"/> + </notification> + <notification name="OtherChannelRequiredUpdateDownloadedDialog"> + Zur Installation des Updates muss [APP_NAME] neu gestartet werden. +Dieser experimentelle Viewer wurde durch einen [NEW_CHANNEL] Viewer ersetzt; +weitere Infos zu diesem Update finden Sie [[INFO_URL] hier]. <usetemplate name="okbutton" yestext="OK"/> </notification> <notification name="DeedObjectToGroup"> @@ -1549,6 +1587,10 @@ Zur Installation des Updates muss [APP_NAME] neu gestartet werden. Diese Gruppe verlassen? <usetemplate name="okcancelbuttons" notext="Abbrechen" yestext="OK"/> </notification> + <notification name="OwnerCannotLeaveGroup"> + Sie können die Gruppe nicht verlassen, da Sie der letzte Besitzer der Gruppe sind. Weisen Sie die Besitzerrolle zuerst einem anderen Mitglied zu. + <usetemplate name="okbutton" yestext="OK"/> + </notification> <notification name="ConfirmKick"> Möchten Sie WIRKLICH alle Benutzer aus dem Grid werfen? <usetemplate name="okcancelbuttons" notext="Abbrechen" yestext="Alle Benutzer hinauswerfen"/> @@ -2410,9 +2452,7 @@ Wählen Sie ein einzelnes Objekt aus. „Teleportieren“ wählen.) </notification> <notification name="TeleportToPerson"> - Um Einwohner wie „[NAME]“ zu kontaktieren, klicken Sie auf die Schaltfläche „Leute“, wählen Sie eingeblendeten Fenster einen Einwohner aus - und klicken Sie unten im Fenster auf „IM“. - (Sie können auch auf den Namen doppelklicken bzw. ihn mit der rechten Maustaste anklicken und dann „IM“ wählen.) + Um eine private Unterhaltung zu beginnen, klicken Sie mit der rechten Maustaste auf den gewünschten Avatar und wählen Sie im Menü „IM“ aus. </notification> <notification name="CantSelectLandFromMultipleRegions"> Land kann nicht über Servergrenzen hinweg ausgewählt werden. @@ -2786,6 +2826,15 @@ Gewähren Sie dem Objekt nur dann Zugriff, wenn Sie genau verstehen, wieso ein s <button name="Deny" text="Verweigern"/> </form> </notification> + <notification name="UnknownScriptQuestion"> + Die Runtime-Skript-Berechtigung, die von „<nolink>[OBJECTNAME]</nolink>“ (Besitzer: „[NAME]“) angefordert wurde, wird vom Viewer nicht erkannt und kann nicht gewährt werden. + +Um diese Berechtigung zu gewähren, laden Sie die neueste Version des Viewers von [DOWNLOADURL] herunter. + <form name="form"> + <button name="Deny" text="OK"/> + <button name="Mute" text="Blockieren"/> + </form> + </notification> <notification name="ScriptDialog"> „<nolink>[TITLE]</nolink>“ von [NAME] [MESSAGE] diff --git a/indra/newview/skins/default/xui/de/panel_people.xml b/indra/newview/skins/default/xui/de/panel_people.xml index 8c05ca2c24..2d56d6b7d2 100755 --- a/indra/newview/skins/default/xui/de/panel_people.xml +++ b/indra/newview/skins/default/xui/de/panel_people.xml @@ -49,6 +49,9 @@ Sie suchen nach Leuten? Verwenden Sie die [secondlife:///app/worldmap Karte]. <menu_button name="plus_btn" tool_tip="Gruppe beitreten/Neue Gruppe erstellen"/> <dnd_button name="minus_btn" tool_tip="Ausgewählte Gruppe verlassen"/> </panel> + <text name="groupcount"> + Sie gehören [COUNT] Gruppen an und können [REMAINING] weiteren beitreten. + </text> </panel> <panel label="AKTUELL" name="recent_panel"> <panel label="bottom_panel" name="recent_buttons_panel"> diff --git a/indra/newview/skins/default/xui/de/panel_preferences_chat.xml b/indra/newview/skins/default/xui/de/panel_preferences_chat.xml index 8193fd42c1..8eb815fd1b 100755 --- a/indra/newview/skins/default/xui/de/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/de/panel_preferences_chat.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <panel label="Text-Chat" name="chat"> - <panel> + <panel name="general_chat_settings"> <check_box initial_value="true" label="Beim Chatten Tippanimation abspielen" name="play_typing_animation"/> - <check_box label="IMs per Email zuschicken, wenn ich offline bin" name="send_im_to_email"/> + <check_box label="IMs per E-Mail zustellen, wenn ich offline bin" name="send_im_to_email"/> <check_box label="Nur IMs und Anrufe von Freunden oder Gruppen durchstellen" name="voice_call_friends_only_check"/> <text name="font_size"> Schriftgröße: @@ -14,10 +14,7 @@ </combo_box> <check_box label="Blasen-Chat" name="bubble_text_chat"/> </panel> - <panel> - <text name="notifications"> - Benachrichtigungen - </text> + <panel name="im_notification_settings"> <text name="friend_ims"> IMs von Freunden: </text> @@ -25,8 +22,9 @@ <item label="Unterhaltungsfenster öffnen" name="OpenConversationsWindow" value="openconversations"/> <item label="Nachricht in Popup anzeigen" name="PopUpMessage" value="toast"/> <item label="Flash-Symbolleistenschaltfläche" name="FlashToolbarButton" value="flash"/> - <item label="None" name="None" value="none"/> + <item label="Keine Aktion" name="NoAction" value="noaction"/> </combo_box> + <check_box label="Sound abspielen" name="play_sound_friend_im"/> <text name="non_friend_ims"> IMs von anderen: </text> @@ -34,8 +32,9 @@ <item label="Unterhaltungsfenster öffnen" name="OpenConversationsWindow" value="openconversations"/> <item label="Nachricht in Popup anzeigen" name="PopUpMessage" value="toast"/> <item label="Flash-Symbolleistenschaltfläche" name="FlashToolbarButton" value="flash"/> - <item label="None" name="None" value="none"/> + <item label="Keine Aktion" name="NoAction" value="noaction"/> </combo_box> + <check_box label="Sound abspielen" name="play_sound_non_friend_im"/> <text name="conference_ims"> Konferenz-IMs: </text> @@ -43,8 +42,9 @@ <item label="Unterhaltungsfenster öffnen" name="OpenConversationsWindow" value="openconversations"/> <item label="Nachricht in Popup anzeigen" name="PopUpMessage" value="toast"/> <item label="Flash-Symbolleistenschaltfläche" name="FlashToolbarButton" value="flash"/> - <item label="None" name="None" value="none"/> + <item label="Keine Aktion" name="NoAction" value="noaction"/> </combo_box> + <check_box label="Sound abspielen" name="play_sound_conference_im"/> <text name="group_chat"> Gruppen-Chat: </text> @@ -52,8 +52,9 @@ <item label="Unterhaltungsfenster öffnen" name="OpenConversationsWindow" value="openconversations"/> <item label="Nachricht in Popup anzeigen" name="PopUpMessage" value="toast"/> <item label="Flash-Symbolleistenschaltfläche" name="FlashToolbarButton" value="flash"/> - <item label="None" name="None" value="none"/> + <item label="Keine Aktion" name="NoAction" value="noaction"/> </combo_box> + <check_box label="Sound abspielen" name="play_sound_group_chat_im"/> <text name="nearby_chat"> Chat in der Nähe: </text> @@ -61,25 +62,36 @@ <item label="Unterhaltungsfenster öffnen" name="OpenConversationsWindow" value="openconversations"/> <item label="Nachricht in Popup anzeigen" name="PopUpMessage" value="toast"/> <item label="Flash-Symbolleistenschaltfläche" name="FlashToolBarButton" value="flash"/> - <item label="None" name="None" value="none"/> + <item label="Keine Aktion" name="NoAction" value="noaction"/> + </combo_box> + <check_box label="Sound abspielen" name="play_sound_nearby_chat_im"/> + <text name="object_ims"> + IMs von Objekten: + </text> + <combo_box name="ObjectIMOptions"> + <item label="Unterhaltungsfenster öffnen" name="OpenConversationsWindow" value="openconversations"/> + <item label="Nachricht in Popup anzeigen" name="PopUpMessage" value="toast"/> + <item label="Flash-Symbolleistenschaltfläche" name="FlashToolBarButton" value="flash"/> + <item label="Keine Aktion" name="NoAction" value="noaction"/> </combo_box> + <check_box label="Sound abspielen" name="play_sound_object_im"/> <text name="notifications_alert"> Um vorübergehend alle Benachrichtigungen zu stoppen, wählen Sie „Unterhalten“ > „Nicht stören“. </text> </panel> - <panel> + <panel name="play_sound_settings"> <text name="play_sound"> Sound abspielen: </text> <check_box label="Neue Unterhaltung" name="new_conversation"/> - <check_box label="Eingehender Anruf..." name="incoming_voice_call"/> + <check_box label="Eingehender Anruf" name="incoming_voice_call"/> <check_box label="Teleport-Angebot" name="teleport_offer"/> <check_box label="Inventarangebot" name="inventory_offer"/> </panel> - <panel> + <panel name="log_settings"> <button label="Protokoll löschen..." name="clear_log"/> - <button label="Protokolle löschen..." name="delete_transcripts"/> - <button label="Durchsuchen..." label_selected="Durchsuchen" name="log_path_button"/> + <button label="Transkripte löschen..." name="delete_transcripts"/> + <button label="Durchsuchen..." label_selected="Durchblättern" name="log_path_button"/> </panel> <button label="Ãœbersetzen..." name="ok_btn"/> <button label="Automatisch ersetzen..." name="autoreplace_showgui"/> diff --git a/indra/newview/skins/default/xui/de/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/de/panel_preferences_graphics1.xml index 9175ea0bae..f3746a7c82 100755 --- a/indra/newview/skins/default/xui/de/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/de/panel_preferences_graphics1.xml @@ -30,7 +30,7 @@ <check_box initial_value="true" label="Lokale Lichtquellen" name="LocalLights"/> <check_box initial_value="true" label="Einfache Shader" name="BasicShaders" tool_tip="Deaktivieren Sie diese Option, wenn der Grafikkartentreiber Abstürze verursacht"/> <check_box initial_value="true" label="Atmosphären-Shader" name="WindLightUseAtmosShaders"/> - <check_box initial_value="true" label="Licht und Schatten" name="UseLightShaders"/> + <check_box initial_value="true" label="Erweitertes Beleuchtungsmodell" name="UseLightShaders"/> <check_box initial_value="true" label="Ambient Occlusion" name="UseSSAO"/> <check_box initial_value="true" label="Schärfentiefe" name="UseDoF"/> <text name="shadows_label"> diff --git a/indra/newview/skins/default/xui/de/panel_preferences_setup.xml b/indra/newview/skins/default/xui/de/panel_preferences_setup.xml index 8c7ea688d7..24e5033bfc 100755 --- a/indra/newview/skins/default/xui/de/panel_preferences_setup.xml +++ b/indra/newview/skins/default/xui/de/panel_preferences_setup.xml @@ -29,6 +29,7 @@ <combo_box.item label="Automatisch installieren" name="Install_automatically"/> <combo_box.item label="Updates manuell herunterladen und installieren" name="Install_manual"/> </combo_box> + <check_box label="Bereit, Release-Kandidaten zu verwenden" name="update_willing_to_test"/> <text name="Proxy Settings:"> Proxy-Einstellungen: </text> diff --git a/indra/newview/skins/default/xui/de/panel_script_ed.xml b/indra/newview/skins/default/xui/de/panel_script_ed.xml index 7e03aeff15..d688bedd5c 100755 --- a/indra/newview/skins/default/xui/de/panel_script_ed.xml +++ b/indra/newview/skins/default/xui/de/panel_script_ed.xml @@ -34,6 +34,7 @@ <menu_item_call label="Alle auswählen" name="Select All"/> <menu_item_call label="Auswahl aufheben" name="Deselect"/> <menu_item_call label="Suchen / Ersetzen..." name="Search / Replace..."/> + <menu_item_call label="Gehe zu Zeile..." name="Go to line..."/> </menu> <menu label="Hilfe" name="Help"> <menu_item_call label="Hilfe..." name="Help..."/> diff --git a/indra/newview/skins/default/xui/de/panel_tools_texture.xml b/indra/newview/skins/default/xui/de/panel_tools_texture.xml new file mode 100644 index 0000000000..18517d7a7d --- /dev/null +++ b/indra/newview/skins/default/xui/de/panel_tools_texture.xml @@ -0,0 +1,116 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<panel label="Textur" name="Texture"> + <panel.string name="string repeats per meter"> + Wiederholungen pro Meter + </panel.string> + <panel.string name="string repeats per face"> + Wiederholungen pro Fläche + </panel.string> + <text name="color label"> + Farbe + </text> + <color_swatch label="" name="colorswatch" tool_tip="Klicken Sie hier, um die Farbauswahl zu öffnen"/> + <text name="color trans"> + Transparenz % + </text> + <text name="glow label"> + Leuchten + </text> + <check_box label="Ganz hell" name="checkbox fullbright"/> + <combo_box name="combobox matmedia"> + <combo_box.item label="Material" name="Materials"/> + <combo_box.item label="Medien" name="Media"/> + </combo_box> + <combo_box name="combobox mattype"> + <combo_box.item label="Textur (diffus)" name="Texture (diffuse)"/> + <combo_box.item label="Unebenheit (normal)" name="Bumpiness (normal)"/> + <combo_box.item label="Glanzlicht (Spiegel)" name="Shininess (specular)"/> + </combo_box> + <texture_picker label="Textur" name="texture control" tool_tip="Klicken, um ein Bild zu wählen"/> + <text name="label alphamode"> + Alpha-Modus + </text> + <combo_box name="combobox alphamode"> + <combo_box.item label="Keiner" name="None"/> + <combo_box.item label="Alpha-Mischung" name="Alpha blending"/> + <combo_box.item label="Alpha-Maske" name="Alpha masking"/> + <combo_box.item label="Selbststrahlende Maske" name="Emissive mask"/> + </combo_box> + <text name="label maskcutoff"> + Maskenabgrenzung + </text> + <texture_picker label="Textur" name="bumpytexture control" tool_tip="Klicken, um ein Bild auszuwählen"/> + <text name="label bumpiness"> + Unebenheit + </text> + <combo_box name="combobox bumpiness"> + <combo_box.item label="Keine" name="None"/> + <combo_box.item label="Helligkeit" name="Brightness"/> + <combo_box.item label="Dunkelheit" name="Darkness"/> + <combo_box.item label="Holzmaserung" name="woodgrain"/> + <combo_box.item label="Rinde" name="bark"/> + <combo_box.item label="Backsteine" name="bricks"/> + <combo_box.item label="Schachbrett" name="checker"/> + <combo_box.item label="Beton" name="concrete"/> + <combo_box.item label="Rostkachel" name="crustytile"/> + <combo_box.item label="Steinfliesen" name="cutstone"/> + <combo_box.item label="Scheiben" name="discs"/> + <combo_box.item label="Kies" name="gravel"/> + <combo_box.item label="Petrischale" name="petridish"/> + <combo_box.item label="Verkleidung" name="siding"/> + <combo_box.item label="Steinkachel" name="stonetile"/> + <combo_box.item label="Stuck" name="stucco"/> + <combo_box.item label="Saugkraft" name="suction"/> + <combo_box.item label="Gewebe" name="weave"/> + </combo_box> + <texture_picker label="Textur" name="shinytexture control" tool_tip="Klicken, um ein Bild auszuwählen"/> + <text name="label shininess"> + Glanz + </text> + <combo_box name="combobox shininess"> + <combo_box.item label="Keiner" name="None"/> + <combo_box.item label="Niedrig" name="Low"/> + <combo_box.item label="Mittel" name="Medium"/> + <combo_box.item label="Hoch" name="High"/> + </combo_box> + <text name="label glossiness"> + Glanz + </text> + <text name="label environment"> + Umgebung + </text> + <text name="label shinycolor"> + Farbe + </text> + <color_swatch label="" name="shinycolorswatch" tool_tip="Klicken Sie hier, um die Farbauswahl zu öffnen"/> + <text name="media_info"> + URL der ausgewählten Medien ggf. hier angeben + </text> + <button label="Auswählen..." name="add_media" tool_tip="Medien hinzufügen"/> + <button label="Entfernen" name="delete_media" tool_tip="Diese Medientextur löschen"/> + <button label="Ausrichten" label_selected="Medien ausrichten" name="button align" tool_tip="Medientextur ausrichten (muss zuerst geladen werden)"/> + <text name="tex gen"> + Zuordnung + </text> + <combo_box name="combobox texgen"> + <combo_box.item label="Standard" name="Default"/> + <combo_box.item label="Planar" name="Planar"/> + </combo_box> + <spinner label="Horizontale Skalierung" name="TexScaleU"/> + <spinner label="Vertikale Skalierung" name="TexScaleV"/> + <spinner label="Wiederholungen pro Meter" name="rptctrl"/> + <spinner label="Drehung (Grad)" name="TexRot"/> + <spinner label="Horizontaler Versatz" name="TexOffsetU"/> + <spinner label="Vertikaler Versatz" name="TexOffsetV"/> + <spinner label="Horizontale Skalierung" name="bumpyScaleU"/> + <spinner label="Vertikale Skalierung" name="bumpyScaleV"/> + <spinner label="Drehung (Grad)" name="bumpyRot"/> + <spinner label="Horizontaler Versatz" name="bumpyOffsetU"/> + <spinner label="Vertikaler Versatz" name="bumpyOffsetV"/> + <spinner label="Horizontale Skalierung" name="shinyScaleU"/> + <spinner label="Vertikale Skalierung" name="shinyScaleV"/> + <spinner label="Drehung (Grad)" name="shinyRot"/> + <spinner label="Horizontaler Versatz" name="shinyOffsetU"/> + <spinner label="Vertikaler Versatz" name="shinyOffsetV"/> + <check_box initial_value="false" label="Planare Flächen ausrichten" name="checkbox planar align" tool_tip="Texturen auf allen ausgewählten Flächen an der zuletzt ausgewählten Fläche ausrichten. Erfordert planares Texture Mapping."/> +</panel> diff --git a/indra/newview/skins/default/xui/de/role_actions.xml b/indra/newview/skins/default/xui/de/role_actions.xml index 5d9dcacd51..3e9d406e5f 100755 --- a/indra/newview/skins/default/xui/de/role_actions.xml +++ b/indra/newview/skins/default/xui/de/role_actions.xml @@ -25,7 +25,7 @@ </action_set> <action_set description="Diese Fähigkeiten ermöglichen es, den Parzellennamen und die Veröffentlichungseinstellungen sowie die Anzeige des Suchverzeichnisses, den Landepunkt und die TP-Routenoptionen festzulegen." name="Parcel Identity"> <action description="„Ort in Suche anzeigen" ein-/ausschalten und Kategorie festlegen." longdescription="Auf der Registerkarte „Optionen“ unter „Land-Info“ können Sie „Ort in Suche anzeigen“ ein- und ausschalten und die Parzellenkategorie festlegen." name="land find places" value="17"/> - <action description="Parzellenname, Beschreibung und Einstellung für „Ort in Suche anzeigen" ändern" longdescription="Parzellenname, Beschreibung und Einstellung für „Ort in Suche anzeigen" ändern Diese Einstellungen finden Sie unter „Land-Info“ > Registerkarte „Optionen“." name="land change identity" value="18"/> + <action description="Parzellenname, Beschreibung und Einstelllungen für „Moderater Inhalt“ ändern" longdescription="Parzellenname, Beschreibung und Einstelllungen für „Moderater Inhalt“ ändern. Diese Einstellungen finden Sie unter „Land-Info“ > Registerkarte „Optionen“." name="land change identity" value="18"/> <action description="Landepunkt und Teleport-Route festlegen" longdescription="Mitglieder in einer Rolle mit dieser Fähigkeit können auf einer gruppeneigenen Parzelle einen Landepunkt für ankommende Teleports und Teleport-Routen festlegen. Diese Einstellungen finden Sie unter „Land-Info“ > „Optionen“." name="land set landing point" value="19"/> </action_set> <action_set description="Diese Fähigkeiten ermöglichen es, Parzellenoptionen wie „Objekte erstellen“, „Terrain bearbeiten“ sowie Musik- und Medieneinstellungen zu ändern." name="Parcel Settings"> diff --git a/indra/newview/skins/default/xui/de/strings.xml b/indra/newview/skins/default/xui/de/strings.xml index e142cb8029..c8c20424e1 100755 --- a/indra/newview/skins/default/xui/de/strings.xml +++ b/indra/newview/skins/default/xui/de/strings.xml @@ -139,6 +139,9 @@ <string name="create_account_url"> http://join.secondlife.com/?sourceid=[sourceid] </string> + <string name="ViewerDownloadURL"> + http://secondlife.com/download + </string> <string name="LoginFailedViewerNotPermitted"> Mit dem von Ihnen verwendeten Viewer ist der Zugriff auf Second Life nicht mehr möglich. Laden Sie von den folgenden Seite einen neuen Viewer herunter: http://secondlife.com/download @@ -448,6 +451,9 @@ Warten Sie kurz und versuchen Sie dann noch einmal, sich anzumelden. <string name="SLappAgentRequestFriend"> Freundschaftsangebot </string> + <string name="SLappAgentRemoveFriend"> + Entfernen von Freunden + </string> <string name="BUTTON_CLOSE_DARWIN"> Schließen (⌘W) </string> @@ -838,6 +844,9 @@ Warten Sie kurz und versuchen Sie dann noch einmal, sich anzumelden. <string name="multiple_textures"> Mehrfach </string> + <string name="use_texture"> + Textur verwenden + </string> <string name="texture_loading"> Wird geladen... </string> @@ -937,6 +946,21 @@ Warten Sie kurz und versuchen Sie dann noch einmal, sich anzumelden. <string name="TeleportYourAgent"> Sie teleportieren </string> + <string name="JoinAnExperience"> + Bei einem Erlebnis mitmachen + </string> + <string name="SilentlyManageEstateAccess"> + Beim Verwalten von Grundbesitzzugangslisten Warnhinweise unterdrücken + </string> + <string name="OverrideYourAnimations"> + Ihre Standardanimationen ersetzen + </string> + <string name="ScriptReturnObjects"> + Objekte in Ihrem Namen zurückgeben + </string> + <string name="UnknownScriptPermission"> + (unbekannt) + </string> <string name="SIM_ACCESS_PG"> Generell </string> @@ -1968,6 +1992,12 @@ Warten Sie kurz und versuchen Sie dann noch einmal, sich anzumelden. <string name="ATTACH_HUD_BOTTOM_RIGHT"> HUD unten rechts </string> + <string name="ATTACH_NECK"> + Hals + </string> + <string name="ATTACH_AVATAR_CENTER"> + Avatar-Mitte + </string> <string name="CursorPos"> Zeile [LINE], Spalte [COLUMN] </string> @@ -2997,6 +3027,9 @@ Falls diese Meldung weiterhin angezeigt wird, wenden Sie sich bitte an [SUPPORT_ <string name="Hip Width"> Breite der Hüfte </string> + <string name="Hover"> + Schweben + </string> <string name="In"> In </string> @@ -5081,4 +5114,7 @@ Setzen Sie den Editorpfad in Anführungszeichen <string name="logging_calls_enabled_log_empty"> Keine protokollierten Unterhaltungen verfügbar. Hier erscheint ein Protokolleintrag, wenn Sie eine Person kontaktieren oder von einer Person kontaktiert werden. </string> + <string name="loading_chat_logs"> + Laden... + </string> </strings> diff --git a/indra/newview/skins/default/xui/en/floater_about.xml b/indra/newview/skins/default/xui/en/floater_about.xml index 63eb87f27a..703015af20 100755 --- a/indra/newview/skins/default/xui/en/floater_about.xml +++ b/indra/newview/skins/default/xui/en/floater_about.xml @@ -22,7 +22,9 @@ Built with [COMPILER] version [COMPILER_VERSION] </floater.string> <floater.string name="AboutPosition"> -You are at [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1] in [REGION] located at <nolink>[HOSTNAME]</nolink> ([HOSTIP]) +You are at [POSITION_LOCAL_0,number,1], [POSITION_LOCAL_1,number,1], [POSITION_LOCAL_2,number,1] in [REGION] located at <nolink>[HOSTNAME]</nolink> ([HOSTIP]) +SLURL: <nolink>[SLURL]</nolink> +(global coordinates [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1]) [SERVER_VERSION] [SERVER_RELEASE_NOTES_URL] diff --git a/indra/newview/skins/default/xui/en/floater_bulk_perms.xml b/indra/newview/skins/default/xui/en/floater_bulk_perms.xml index 4e0cfb0cd4..e7ab3cacdc 100755 --- a/indra/newview/skins/default/xui/en/floater_bulk_perms.xml +++ b/indra/newview/skins/default/xui/en/floater_bulk_perms.xml @@ -6,7 +6,7 @@ layout="topleft" name="floaterbulkperms" help_topic="floaterbulkperms" - title="EDIT CONTENT PERMISSIONS" + title="ADJUST CONTENT PERMISSIONS" width="410"> <floater.string name="nothing_to_modify_text"> @@ -192,7 +192,7 @@ name="newperms" top="90" width="250"> - New Content Permissions + Adjust Content Permissions To </text> <text type="string" @@ -292,11 +292,22 @@ height="23" label="OK" layout="topleft" - left="205" - name="apply" + left="110" + name="ok" top_pad="10" width="90"> <button.commit_callback + function="BulkPermission.Ok"/> + </button> + <button + follows="left|top" + height="23" + label="Apply" + layout="topleft" + left_pad="5" + name="apply" + width="90"> + <button.commit_callback function="BulkPermission.Apply"/> </button> <button diff --git a/indra/newview/skins/default/xui/en/floater_goto_line.xml b/indra/newview/skins/default/xui/en/floater_goto_line.xml new file mode 100644 index 0000000000..b236888219 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_goto_line.xml @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + legacy_header_height="18" + default_tab_group="1" + height="90" + layout="topleft" + name="script goto" + help_topic="script_goto" + title="GO TO LINE" + width="200"> + <button + height="24" + label="OK" + label_selected="OK" + layout="topleft" + left="55" + name="goto_btn" + top="53" + width="90" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="10" + name="txt" + top="21" + width="65"> + Go to line + </text> + <line_editor + border_style="line" + border_thickness="1" + follows="left|top" + height="16" + layout="topleft" + left="75" + max_length_bytes="9" + name="goto_line" + tab_group="1" + top="21" + width="85" /> +</floater>
\ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/floater_im_container.xml b/indra/newview/skins/default/xui/en/floater_im_container.xml index 65f623a47e..1215efb7f9 100755 --- a/indra/newview/skins/default/xui/en/floater_im_container.xml +++ b/indra/newview/skins/default/xui/en/floater_im_container.xml @@ -4,6 +4,7 @@ can_minimize="true" can_resize="true" height="210" + min_height="210" layout="topleft" name="floater_im_box" help_topic="floater_im_box" @@ -24,24 +25,28 @@ value="Conv_toolbar_expand"/> <layout_stack animate="true" - bottom="-1" + bottom="-5" + drag_handle_gap="6" + drag_handle_first_indent="27" + drag_handle_second_indent="10" follows="all" layout="topleft" left="0" name="conversations_stack" orientation="horizontal" right="-1" + show_drag_handle="true" top="0"> <layout_panel auto_resize="false" user_resize="true" name="conversations_layout_panel" min_dim="38" - expanded_min_dim="156"> + expanded_min_dim="136"> <layout_stack animate="false" follows="left|top|right" - height="35" + height="27" layout="topleft" left="0" name="conversations_pane_buttons_stack" @@ -50,7 +55,6 @@ top="0"> <layout_panel auto_resize="true" - height="35" name="conversations_pane_buttons_expanded"> <menu_button follows="top|left" @@ -64,7 +68,7 @@ left="5" name="sort_btn" tool_tip="View/sort options" - top="5" + top="1" width="31" /> <button follows="top|left" @@ -74,7 +78,7 @@ image_selected="Toolbar_Middle_Selected" image_unselected="Toolbar_Middle_Off" layout="topleft" - top="5" + top="1" left_pad="2" name="add_btn" tool_tip="Start a new conversation" @@ -87,7 +91,7 @@ image_selected="Toolbar_Middle_Selected" image_unselected="Toolbar_Middle_Off" layout="topleft" - top="5" + top="1" left_pad="2" name="speak_btn" tool_tip="Speak with people using your microphone" @@ -95,9 +99,8 @@ </layout_panel> <layout_panel auto_resize="false" - height="35" name="conversations_pane_buttons_collapsed" - width="41"> + width="31"> <button follows="right|top" height="25" @@ -106,8 +109,8 @@ image_selected="Toolbar_Middle_Selected" image_unselected="Toolbar_Middle_Off" layout="topleft" - top="5" - left="1" + top="1" + left="0" name="expand_collapse_btn" tool_tip="Collapse/Expand this list" width="31" /> @@ -119,7 +122,7 @@ layout="topleft" name="conversations_list_panel" opaque="true" - top="35" + top_pad="0" left="5" right="-1"/> </layout_panel> @@ -127,7 +130,7 @@ auto_resize="true" user_resize="true" name="messages_layout_panel" - expanded_min_dim="222"> + expanded_min_dim="212"> <panel_container bottom="-1" follows="all" @@ -136,44 +139,44 @@ name="im_box_tab_container" right="-1" top="0"> - <panel - bottom="-1" - follows="all" - layout="topleft" - name="stub_panel" - opaque="true" - top_pad="0" - left="0" - right="-1"> - <button - follows="right|top" - height="25" - image_hover_unselected="Toolbar_Middle_Over" - image_overlay="Conv_toolbar_collapse" - image_selected="Toolbar_Middle_Selected" - image_unselected="Toolbar_Middle_Off" + <panel + bottom="-1" + follows="all" layout="topleft" - top="5" - right="-10" - name="stub_collapse_btn" - tool_tip="Collapse this pane" - width="31" /> - <text - type="string" - clip_partial="false" - follows="left|top|right" - layout="topleft" - left="15" - right="-15" - name="stub_textbox" - top="25" - height="40" - valign="center" - parse_urls="true" - wrap="true"> - This conversation is in a separate window. [secondlife:/// Bring it back.] - </text> - </panel> + name="stub_panel" + opaque="true" + top_pad="0" + left="0" + right="-1"> + <button + follows="right|top" + height="25" + image_hover_unselected="Toolbar_Middle_Over" + image_overlay="Conv_toolbar_collapse" + image_selected="Toolbar_Middle_Selected" + image_unselected="Toolbar_Middle_Off" + layout="topleft" + top="1" + right="-10" + name="stub_collapse_btn" + tool_tip="Collapse this pane" + width="31" /> + <text + type="string" + clip_partial="false" + follows="left|top|right" + layout="topleft" + left="15" + right="-15" + name="stub_textbox" + top="25" + height="40" + valign="center" + parse_urls="true" + wrap="true"> + This conversation is in a separate window. [secondlife:/// Bring it back.] + </text> + </panel> </panel_container> </layout_panel> </layout_stack> diff --git a/indra/newview/skins/default/xui/en/floater_im_session.xml b/indra/newview/skins/default/xui/en/floater_im_session.xml index 2152a9f6e9..43d0f2fb18 100755 --- a/indra/newview/skins/default/xui/en/floater_im_session.xml +++ b/indra/newview/skins/default/xui/en/floater_im_session.xml @@ -70,26 +70,23 @@ top="0" left="0" right="-1" - bottom="-3"> + bottom="-1"> <layout_stack animate="false" + bottom="-1" default_tab_group="2" follows="all" - right="-5" - bottom="-1" - top="0" - left="5" - border_size="0" + left="3" layout="topleft" - orientation="vertical" name="main_stack" - tab_group="1"> + right="-3" + orientation="vertical" + tab_group="1" + top="0"> <layout_panel auto_resize="false" name="toolbar_panel" - height="35" - right="-1" - left="1"> + height="25"> <menu_button menu_filename="menu_im_session_showmodes.xml" follows="top|left" @@ -102,7 +99,7 @@ left="5" name="view_options_btn" tool_tip="View/sort options" - top="5" + top="1" width="31" /> <menu_button menu_filename="menu_im_conversation.xml" @@ -113,7 +110,7 @@ image_selected="Toolbar_Middle_Selected" image_unselected="Toolbar_Middle_Off" layout="topleft" - top="5" + top="1" left_pad="2" name="gear_btn" visible="false" @@ -128,7 +125,7 @@ image_selected="Toolbar_Middle_Selected" image_unselected="Toolbar_Middle_Off" layout="topleft" - top="5" + top="1" left_pad="2" name="add_btn" tool_tip="Add someone to this conversation" @@ -141,23 +138,11 @@ image_selected="Toolbar_Middle_Selected" image_unselected="Toolbar_Middle_Off" layout="topleft" - top="5" + top="1" left_pad="2" name="voice_call_btn" tool_tip="Open voice connection" - width="31"/> - <output_monitor - auto_update="true" - follows="top|left" - draw_border="false" - height="16" - layout="topleft" - top="10" - left_pad="10" - mouse_opaque="true" - name="speaking_indicator" - visible="false" - width="20" /> + width="31"/> <button follows="right|top" height="25" @@ -166,8 +151,8 @@ image_selected="Toolbar_Middle_Selected" image_unselected="Toolbar_Middle_Off" layout="topleft" - top="5" - right="-67" + top="1" + right="-70" name="close_btn" tool_tip="End this conversation" width="31" /> @@ -179,7 +164,7 @@ image_selected="Toolbar_Middle_Selected" image_unselected="Toolbar_Middle_Off" layout="topleft" - top="5" + top="1" left_pad="2" name="expand_collapse_btn" tool_tip="Collapse/Expand this pane" @@ -194,18 +179,21 @@ layout="topleft" left_pad="2" name="tear_off_btn" - top="5" + top="1" width="31" /> </layout_panel> <layout_panel name="body_panel" - top="1" - bottom="-1"> + height="235"> <layout_stack default_tab_group="2" + drag_handle_gap="6" + drag_handle_first_indent="0" + drag_handle_second_indent="1" follows="all" orientation="horizontal" name="im_panels" + show_drag_handle="true" tab_group="1" top="0" right="-1" @@ -217,14 +205,12 @@ min_dim="0" width="150" user_resize="true" - auto_resize="false" - bottom="-1" /> + auto_resize="false" /> <layout_panel default_tab_group="3" tab_group="2" name="right_part_holder" - min_width="221" - bottom="-1"> + min_width="172"> <layout_stack animate="true" default_tab_group="2" @@ -233,7 +219,7 @@ name="translate_and_chat_stack" tab_group="1" top="0" - left="0" + left="1" right="-1" bottom="-1"> <layout_panel @@ -259,7 +245,7 @@ parse_highlights="true" parse_urls="true" right="-1" - left="5" + left="0" top="0" bottom="-1" /> </layout_panel> @@ -268,10 +254,7 @@ </layout_stack> </layout_panel> <layout_panel - top_delta="0" - top="0" - height="26" - bottom="-1" + height="35" auto_resize="false" name="chat_layout_panel"> <layout_stack @@ -281,15 +264,11 @@ orientation="horizontal" name="input_panels" top="0" - bottom="-2" + bottom="-1" left="0" right="-1"> <layout_panel - name="input_editor_layout_panel" - auto_resize="true" - user_resize="false" - top="0" - bottom="-1"> + name="input_editor_layout_panel"> <chat_editor layout="topleft" expand_lines_count="5" @@ -302,32 +281,27 @@ max_length="1023" spellcheck="true" tab_group="3" - top="1" - bottom="-2" - left="4" - right="-4" + bottom="-8" + left="5" + right="-5" wrap="true" /> </layout_panel> <layout_panel auto_resize="false" - user_resize="false" name="input_button_layout_panel" - width="30" - top="0" - bottom="-1"> + width="32"> <button - layout="topleft" left="1" - right="-1" - top="1" - height="22" + top="4" + height="25" follows="left|right|top" image_hover_unselected="Toolbar_Middle_Over" image_overlay="Conv_expand_one_line" image_selected="Toolbar_Middle_Selected" image_unselected="Toolbar_Middle_Off" name="minz_btn" - tool_tip="Shows/hides message panel" /> + tool_tip="Shows/hides message panel" + width="28" /> </layout_panel> </layout_stack> </layout_panel> diff --git a/indra/newview/skins/default/xui/en/menu_attachment_other.xml b/indra/newview/skins/default/xui/en/menu_attachment_other.xml index 46ba4bd29d..ba91b0b5d9 100755 --- a/indra/newview/skins/default/xui/en/menu_attachment_other.xml +++ b/indra/newview/skins/default/xui/en/menu_attachment_other.xml @@ -112,4 +112,50 @@ <menu_item_call.on_enable function="Object.EnableInspect" /> </menu_item_call> + + <menu_item_separator /> + + <menu_item_check + name="Normal" + label="Normal Rendering"> + <menu_item_check.on_check + function="Avatar.CheckImpostorMode" + parameter="0" /> + <menu_item_check.on_click + function="Avatar.SetImpostorMode" + parameter="0" /> + </menu_item_check> + <menu_item_check + name="Always use impostor" + label="Always use impostor"> + <menu_item_check.on_check + function="Avatar.CheckImpostorMode" + parameter="1" /> + <menu_item_check.on_click + function="Avatar.SetImpostorMode" + parameter="1" /> + </menu_item_check> + <menu_item_check + name="Never use impostor" + label="Never use impostor"> + <menu_item_check.on_check + function="Avatar.CheckImpostorMode" + parameter="2" /> + <menu_item_check.on_click + function="Avatar.SetImpostorMode" + parameter="2" /> + </menu_item_check> + + <menu_item_separator + layout="topleft" name="Impostor seperator"/> + + <menu_item_call + enabled="false" + label="Block Particle Owner" + name="Mute Particle"> + <menu_item_call.on_click + function="Particle.Mute" /> + <menu_item_call.on_enable + function="EnableMuteParticle" /> + </menu_item_call> </context_menu> diff --git a/indra/newview/skins/default/xui/en/menu_attachment_self.xml b/indra/newview/skins/default/xui/en/menu_attachment_self.xml index 28e032ce5f..bcbc8d5b86 100755 --- a/indra/newview/skins/default/xui/en/menu_attachment_self.xml +++ b/indra/newview/skins/default/xui/en/menu_attachment_self.xml @@ -143,4 +143,15 @@ name="Edit Outfit"> <menu_item_call.on_enable function="Attachment.EnableDrop" /> </menu_item_call> + <menu_item_separator + layout="topleft" /> + <menu_item_call + enabled="false" + label="Block Particle Owner" + name="Mute Particle"> + <menu_item_call.on_click + function="Particle.Mute" /> + <menu_item_call.on_enable + function="EnableMuteParticle" /> + </menu_item_call> </context_menu> diff --git a/indra/newview/skins/default/xui/en/menu_avatar_other.xml b/indra/newview/skins/default/xui/en/menu_avatar_other.xml index e7c2b80da2..8bd013f14b 100755 --- a/indra/newview/skins/default/xui/en/menu_avatar_other.xml +++ b/indra/newview/skins/default/xui/en/menu_avatar_other.xml @@ -39,8 +39,10 @@ <menu_item_call.on_click function="Avatar.InviteToGroup" /> </menu_item_call> + <menu_item_separator /> - <menu_item_call + + <menu_item_call enabled="false" label="Block" name="Avatar Mute"> @@ -103,4 +105,50 @@ <menu_item_call.on_enable function="EnablePayAvatar" /> </menu_item_call> + + <menu_item_separator /> + + <menu_item_check + name="Normal" + label="Normal Rendering"> + <menu_item_check.on_check + function="Avatar.CheckImpostorMode" + parameter="0" /> + <menu_item_check.on_click + function="Avatar.SetImpostorMode" + parameter="0" /> + </menu_item_check> + <menu_item_check + name="Always use impostor" + label="Always use impostor"> + <menu_item_check.on_check + function="Avatar.CheckImpostorMode" + parameter="1" /> + <menu_item_check.on_click + function="Avatar.SetImpostorMode" + parameter="1" /> + </menu_item_check> + <menu_item_check + name="Never use impostor" + label="Never use impostor"> + <menu_item_check.on_check + function="Avatar.CheckImpostorMode" + parameter="2" /> + <menu_item_check.on_click + function="Avatar.SetImpostorMode" + parameter="2" /> + </menu_item_check> + + <menu_item_separator + layout="topleft" name="Impostor seperator"/> + + <menu_item_call + enabled="false" + label="Block Particle Owner" + name="Mute Particle"> + <menu_item_call.on_click + function="Particle.Mute" /> + <menu_item_call.on_enable + function="EnableMuteParticle" /> + </menu_item_call> </context_menu> diff --git a/indra/newview/skins/default/xui/en/menu_avatar_self.xml b/indra/newview/skins/default/xui/en/menu_avatar_self.xml index c1ff026a74..ca0c9bd5e4 100755 --- a/indra/newview/skins/default/xui/en/menu_avatar_self.xml +++ b/indra/newview/skins/default/xui/en/menu_avatar_self.xml @@ -269,4 +269,16 @@ <menu_item_call.on_visible function="Advanced.EnableAppearanceToXML"/> </menu_item_call> + <menu_item_separator + layout="topleft" /> + <menu_item_call + enabled="false" + label="Block Particle Owner" + name="Mute Particle"> + <menu_item_call.on_click + function="Particle.Mute" /> + + <menu_item_call.on_enable + function="EnableMuteParticle" /> + </menu_item_call> </context_menu> diff --git a/indra/newview/skins/default/xui/en/menu_conversation.xml b/indra/newview/skins/default/xui/en/menu_conversation.xml index 5a13ef0a59..b3d28788da 100755 --- a/indra/newview/skins/default/xui/en/menu_conversation.xml +++ b/indra/newview/skins/default/xui/en/menu_conversation.xml @@ -11,7 +11,7 @@ layout="topleft" name="close_conversation"> <on_click function="Avatar.DoToSelected" parameter="close_conversation"/> - </menu_item_call> + </menu_item_call> <menu_item_call label="Open voice conversation" layout="topleft" @@ -25,6 +25,12 @@ <on_click function="Avatar.DoToSelected" parameter="disconnect_from_voice"/> </menu_item_call> <menu_item_separator layout="topleft" name="separator_disconnect_from_voice"/> + <menu_item_call + label="Close Selected" + layout="topleft" + name="close_selected_conversations"> + <on_click function="Avatar.DoToSelected" parameter="close_selected_conversations"/> + </menu_item_call> <menu_item_call label="View Profile" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/menu_land.xml b/indra/newview/skins/default/xui/en/menu_land.xml index cc6d8ad9c1..2ad5cbbe95 100755 --- a/indra/newview/skins/default/xui/en/menu_land.xml +++ b/indra/newview/skins/default/xui/en/menu_land.xml @@ -61,4 +61,15 @@ <menu_item_call.on_enable function="EnableEdit" /> </menu_item_call> + <menu_item_separator + layout="topleft" /> + <menu_item_call + enabled="false" + label="Block Particle Owner" + name="Mute Particle"> + <menu_item_call.on_click + function="Particle.Mute" /> + <menu_item_call.on_enable + function="EnableMuteParticle" /> + </menu_item_call> </context_menu> diff --git a/indra/newview/skins/default/xui/en/menu_mute_particle.xml b/indra/newview/skins/default/xui/en/menu_mute_particle.xml new file mode 100644 index 0000000000..a4261bf39e --- /dev/null +++ b/indra/newview/skins/default/xui/en/menu_mute_particle.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<!-- *NOTE: See also menu_attachment_other.xml --> +<context_menu + layout="topleft" + name="Mute Particle Pie"> + <menu_item_call + enabled="false" + label="Block Particle Owner" + name="Mute Particle"> + <menu_item_call.on_click + function="Particle.Mute" /> + <menu_item_call.on_enable + function="EnableMuteParticle" /> + </menu_item_call> +</context_menu> diff --git a/indra/newview/skins/default/xui/en/menu_object.xml b/indra/newview/skins/default/xui/en/menu_object.xml index f6004621a6..52ab7da515 100755 --- a/indra/newview/skins/default/xui/en/menu_object.xml +++ b/indra/newview/skins/default/xui/en/menu_object.xml @@ -196,4 +196,15 @@ <menu_item_call.on_enable function="Object.EnableDelete" /> </menu_item_call> + <menu_item_separator + layout="topleft" /> + <menu_item_call + enabled="false" + label="Block Particle Owner" + name="Mute Particle"> + <menu_item_call.on_click + function="Particle.Mute" /> + <menu_item_call.on_enable + function="EnableMuteParticle" /> + </menu_item_call> </context_menu> diff --git a/indra/newview/skins/default/xui/en/menu_people_friends_view.xml b/indra/newview/skins/default/xui/en/menu_people_friends_view.xml index dde9432867..8790fde7c5 100755 --- a/indra/newview/skins/default/xui/en/menu_people_friends_view.xml +++ b/indra/newview/skins/default/xui/en/menu_people_friends_view.xml @@ -44,6 +44,8 @@ <menu_item_check.on_check function="Floater.Visible" parameter="conversation" /> + <menu_item_check.on_enable + function="Conversation.IsConversationLoggingAllowed" /> <menu_item_check.on_click function="Floater.Toggle" parameter="conversation" /> diff --git a/indra/newview/skins/default/xui/en/menu_url_agent.xml b/indra/newview/skins/default/xui/en/menu_url_agent.xml index 7cd56f257a..e8b6116026 100755 --- a/indra/newview/skins/default/xui/en/menu_url_agent.xml +++ b/indra/newview/skins/default/xui/en/menu_url_agent.xml @@ -21,8 +21,15 @@ layout="topleft" name="add_friend"> <menu_item_call.on_click - function="Url.AddFriend" /> + function="Url.AddFriend" /> </menu_item_call> + <menu_item_call + label="Remove Friend..." + layout="topleft" + name="remove_friend"> + <menu_item_call.on_click + function="Url.RemoveFriend" /> + </menu_item_call> <menu_item_separator layout="topleft" /> <menu_item_call diff --git a/indra/newview/skins/default/xui/en/menu_url_objectim.xml b/indra/newview/skins/default/xui/en/menu_url_objectim.xml index 87ab58e622..b9d003b841 100755 --- a/indra/newview/skins/default/xui/en/menu_url_objectim.xml +++ b/indra/newview/skins/default/xui/en/menu_url_objectim.xml @@ -9,6 +9,13 @@ <menu_item_call.on_click function="Url.Execute" /> </menu_item_call> + <menu_item_call + label="Block..." + layout="topleft" + name="block_object"> + <menu_item_call.on_click + function="Url.Block" /> + </menu_item_call> <menu_item_separator layout="topleft" /> <menu_item_call diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index b01c3067ff..2d65052def 100755 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -93,7 +93,7 @@ <menu_item_check label="Fly" name="Fly" - shortcut="Home"> + shortcut="HOME"> <menu_item_check.on_check function="Agent.getFlying" /> <menu_item_check.on_click @@ -101,6 +101,15 @@ <menu_item_check.on_enable function="Agent.enableFlying" /> </menu_item_check> + <menu_item_call + label="Stop flying" + name="Stop flying" + shortcut="HOME"> + <menu_item_call.on_click + function="Agent.toggleFlying" /> + <menu_item_call.on_enable + function="Agent.getFlying" /> + </menu_item_call> <menu_item_check label="Always Run" name="Always Run" @@ -874,6 +883,15 @@ function="Tools.EnableSelectNextPart" /> </menu_item_call> </menu> + <menu_item_call + label="Linksets..." + name="pathfinding_linkset_menu_item"> + <menu_item_call.on_click + function="Floater.ToggleOrBringToFront" + parameter="pathfinding_linksets" /> + <menu_item_call.on_enable + function="Tools.EnablePathfinding" /> + </menu_item_call> <menu_item_separator/> <menu_item_call @@ -896,7 +914,7 @@ <menu_item_call.on_enable function="Tools.SomethingSelectedNoHUD" /> </menu_item_call> - + <menu_item_separator/> <menu @@ -2197,6 +2215,16 @@ function="ToggleControl" parameter="DebugShowRenderInfo" /> </menu_item_check> + <menu_item_check + label="Show Avatar Render Info" + name="Show Avatar Render Info"> + <menu_item_check.on_check + function="CheckControl" + parameter="DebugShowAvatarRenderInfo" /> + <menu_item_check.on_click + function="ToggleControl" + parameter="DebugShowAvatarRenderInfo" /> + </menu_item_check> <menu_item_check label="Show Texture Info" name="Show Texture Info"> diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 9e582cf0de..69b7fe5a75 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -506,6 +506,33 @@ Add this Ability to '[ROLE_NAME]'? notext="No" yestext="Yes"/> </notification> + + <notification + icon="alertmodal.tga" + name="EjectGroupMemberWarning" + type="alertmodal"> + You are about to eject [AVATAR_NAME] from the group. + <tag>group</tag> + <tag>confirm</tag> + <usetemplate + ignoretext="Confirm ejecting a participant from group" + name="okcancelignore" + notext="Cancel" + yestext="Eject"/> + </notification> + <notification + icon="alertmodal.tga" + name="EjectGroupMembersWarning" + type="alertmodal"> + You are about to eject [COUNT] members from the group. + <tag>group</tag> + <tag>confirm</tag> + <usetemplate + ignoretext="Confirm ejecting multiple members from group" + name="okcancelignore" + notext="Cancel" + yestext="Eject"/> + </notification> <notification icon="alertmodal.tga" @@ -2682,7 +2709,7 @@ Please enter a higher price. icon="alertmodal.tga" name="ConfirmItemDeleteHasLinks" type="alertmodal"> -At least one of the items you has link items that point to it. If you delete this item, its links will permanently stop working. It is strongly advised to delete the links first. +At least one of the items has links that point to it. If you delete this item, its links will permanently stop working. It is strongly advised to delete the links first. Are you sure you want to delete these items? <tag>confirm</tag> @@ -2724,7 +2751,7 @@ Are you sure you want to delete these items? icon="alertmodal.tga" name="ConfirmObjectDeleteNoOwn" type="alertmodal"> -You do not own least one of the items you have selected. +You do not own at least one of the items you have selected. Are you sure you want to delete these items? <tag>confirm</tag> @@ -2754,7 +2781,7 @@ Are you sure you want to delete these items? name="ConfirmObjectDeleteLockNoOwn" type="alertmodal"> At least one object is locked. -You do not own least one object. +You do not own at least one object. Are you sure you want to delete these items? <tag>confirm</tag> @@ -2769,7 +2796,7 @@ Are you sure you want to delete these items? name="ConfirmObjectDeleteNoCopyNoOwn" type="alertmodal"> At least one object is not copyable. -You do not own least one object. +You do not own at least one object. Are you sure you want to delete these items? <tag>confirm</tag> @@ -2785,13 +2812,13 @@ Are you sure you want to delete these items? type="alertmodal"> At least one object is locked. At least one object is not copyable. -You do not own least one object. +You do not own at least one object. Are you sure you want to delete these items? <tag>confirm</tag> <usetemplate name="okcancelbuttons" - notext="cancel" + notext="Cancel" yestext="OK"/> </notification> @@ -3709,6 +3736,17 @@ Leave Group? </notification> <notification + icon="alertmodal.tga" + name="OwnerCannotLeaveGroup" + type="alertmodal"> + Unable to leave group. You cannot leave the group because you are the last owner of the group. Please assign another member to the owner role first. + <tag>group</tag> + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> + + <notification icon="alert.tga" name="ConfirmKick" type="alert"> @@ -5943,9 +5981,7 @@ Your calling card was declined. icon="notifytip.tga" name="TeleportToPerson" type="notifytip"> - To contact Residents like '[NAME]', click on the "People" button , select a Resident from the window that opens, then click 'IM' at the - bottom of the window. - (You can also double-click on their name in the list, or right-click and choose 'IM'). + To open a private conversation with someone, right-click on their avatar and choose 'IM' from the menu. </notification> <notification @@ -6573,7 +6609,7 @@ Your object named <nolink>[OBJECTFROMNAME]</nolink> has given you th icon="notify.tga" name="JoinGroup" persist="true" - type="notify"> + type="offer"> <tag>group</tag> [MESSAGE] <form name="form"> @@ -6804,7 +6840,6 @@ This will add a bookmark in your inventory so you can quickly IM this Resident. name="RegionRestartMinutes" priority="high" sound="UISndAlert" - persist="true" type="notify"> This region will restart in [MINUTES] minutes. If you stay in this region you will be logged out. @@ -6815,7 +6850,6 @@ If you stay in this region you will be logged out. name="RegionRestartSeconds" priority="high" sound="UISndAlert" - persist="true" type="notify"> This region will restart in [SECONDS] seconds. If you stay in this region you will be logged out. @@ -10075,7 +10109,7 @@ An internal error prevented us from properly updating your viewer. The L$ balan <tag>fail</tag> Cannot create large prims that intersect other players. Please re-try when other players have moved. </notification> - + <notification icon="alertmodal.tga" name="PreferenceChatClearLog" diff --git a/indra/newview/skins/default/xui/en/panel_group_notices.xml b/indra/newview/skins/default/xui/en/panel_group_notices.xml index 6d5fb51e85..c8ce5cdebf 100755 --- a/indra/newview/skins/default/xui/en/panel_group_notices.xml +++ b/indra/newview/skins/default/xui/en/panel_group_notices.xml @@ -202,14 +202,14 @@ Maximum 200 per group daily Drag and drop item here to attach it: </text> <icon - height="72" + height="48" image_name="DropTarget" layout="topleft" left_pad="10" mouse_opaque="true" name="drop_icon" top_delta="-10" - width="72" /> + width="110" /> <button follows="left|top" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index 7ce2627be9..ed274d0233 100755 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -480,10 +480,22 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M function="People.Group.Minus" /> </dnd_button> </panel> + <text + type="string" + length="1" + follows="all" + height="14" + layout="topleft" + right="-10" + top_pad="4" + left="3" + name="groupcount"> + You belong to [COUNT] groups, and can join [REMAINING] more. + </text> <group_list allow_select="true" follows="all" - height="406" + height="388" layout="topleft" left="3" name="group_list" diff --git a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml index 2cc9d9c1b0..50fd57494f 100755 --- a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml @@ -138,7 +138,7 @@ initial_value="1" layout="topleft" left_pad="0" - max_val="1.4" + max_val="1.5" min_val="0.75" name="ui_scale_slider" top_pad="-14" diff --git a/indra/newview/skins/default/xui/en/panel_preferences_chat.xml b/indra/newview/skins/default/xui/en/panel_preferences_chat.xml index bd096ebb88..8e867259c5 100755 --- a/indra/newview/skins/default/xui/en/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_chat.xml @@ -14,6 +14,7 @@ border="false" height="60" layout="topleft" + name="general_chat_settings" top="10" left="13" width="517"> @@ -97,20 +98,13 @@ border="false" height="165" layout="topleft" + name="im_notification_settings" left="13" width="517"> <text layout="topleft" height="12" - name="notifications" - left="0" - width="120"> - Notifications - </text> - <text - layout="topleft" - height="12" name="friend_ims" width="145" left="0" @@ -138,17 +132,27 @@ name="FlashToolbarButton" value="flash"/> <item - label="None" - name="None" - value="none"/> + label="No action" + name="NoAction" + value="noaction"/> </combo_box> + <check_box + control_name="PlaySoundFriendIM" + height="23" + label="Play sound" + layout="topleft" + name="play_sound_friend_im" + left_pad="7" + top_delta="-3" + width="28"> + </check_box> <text layout="topleft" height="12" name="non_friend_ims" width="145" left="0" - top_pad="9"> + top_pad="11"> Non-friend IMs: </text> <combo_box @@ -172,17 +176,27 @@ name="FlashToolbarButton" value="flash"/> <item - label="None" - name="None" - value="none"/> + label="No action" + name="NoAction" + value="noaction"/> </combo_box> + <check_box + control_name="PlaySoundNonFriendIM" + height="23" + label="Play sound" + layout="topleft" + name="play_sound_non_friend_im" + left_pad="7" + top_delta="-3" + width="28"> + </check_box> <text layout="topleft" left="0" height="13" name="conference_ims" width="145" - top_pad="9"> + top_pad="11"> Conference IMs: </text> <combo_box @@ -206,17 +220,27 @@ name="FlashToolbarButton" value="flash"/> <item - label="None" - name="None" - value="none"/> + label="No action" + name="NoAction" + value="noaction"/> </combo_box> + <check_box + control_name="PlaySoundConferenceIM" + height="23" + label="Play sound" + layout="topleft" + name="play_sound_conference_im" + left_pad="7" + top_delta="-3" + width="28"> + </check_box> <text layout="topleft" left="0" height="13" name="group_chat" width="145" - top_pad="9"> + top_pad="11"> Group chat: </text> <combo_box @@ -240,17 +264,27 @@ name="FlashToolbarButton" value="flash"/> <item - label="None" - name="None" - value="none"/> + label="No action" + name="NoAction" + value="noaction"/> </combo_box> + <check_box + control_name="PlaySoundGroupChatIM" + height="23" + label="Play sound" + layout="topleft" + name="play_sound_group_chat_im" + left_pad="7" + top_delta="-3" + width="28"> + </check_box> <text layout="topleft" left="0" height="12" name="nearby_chat" width="145" - top_pad="9"> + top_pad="11"> Nearby chat: </text> <combo_box @@ -274,10 +308,64 @@ name="FlashToolBarButton" value="flash"/> <item - label="None" - name="None" - value="none"/> + label="No action" + name="NoAction" + value="noaction"/> </combo_box> + <check_box + control_name="PlaySoundNearbyChatIM" + height="23" + label="Play sound" + layout="topleft" + name="play_sound_nearby_chat_im" + left_pad="7" + top_delta="-3" + width="28"> + </check_box> + <text + layout="topleft" + left="0" + height="12" + name="object_ims" + width="145" + top_pad="11"> + Object IMs: + </text> + <combo_box + control_name="NotificationObjectIMOptions" + height="23" + layout="topleft" + left_pad="5" + top_delta="-6" + name="ObjectIMOptions" + width="223"> + <item + label="Open Conversations window" + name="OpenConversationsWindow" + value="openconversations"/> + <item + label="Pop up the message" + name="PopUpMessage" + value="toast"/> + <item + label="Flash toolbar button" + name="FlashToolBarButton" + value="flash"/> + <item + label="No action" + name="NoAction" + value="noaction"/> + </combo_box> + <check_box + control_name="PlaySoundObjectIM" + height="23" + label="Play sound" + layout="topleft" + name="play_sound_object_im" + left_pad="7" + top_delta="-3" + width="28"> + </check_box> <text layout="topleft" left="0" @@ -296,6 +384,7 @@ border="false" height="50" layout="topleft" + name="play_sound_settings" left="13" top_pad="10" width="517"> @@ -358,6 +447,7 @@ <panel height="50" layout="topleft" + name="log_settings" left="13" top_pad="10" width="505"> diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml index d7db7caf66..6c485c0595 100755 --- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml @@ -47,7 +47,7 @@ Better </text> <icon - color="0.12 0.12 0.12 1" + color="DkGray" height="14" image_name="Rounded_Square" layout="topleft" @@ -56,16 +56,15 @@ top_delta="-2" width="2" /> <icon - color="0.12 0.12 0.12 1" + color="DkGray" height="14" image_name="Rounded_Square" layout="topleft" left_pad="41" - name="LowMidraphicsDivet" - top_delta="-2" + name="LowMidGraphicsDivet" width="2" /> <icon - color="0.12 0.12 0.12 1" + color="DkGray" height="14" image_name="Rounded_Square" layout="topleft" @@ -74,7 +73,7 @@ top_delta="0" width="2" /> <icon - color="0.12 0.12 0.12 1" + color="DkGray" height="14" image_name="Rounded_Square" layout="topleft" @@ -83,7 +82,7 @@ top_delta="0" width="2" /> <icon - color="0.12 0.12 0.12 1" + color="DkGray" height="14" image_name="Rounded_Square" layout="topleft" @@ -92,7 +91,7 @@ top_delta="0" width="2" /> <icon - color="0.12 0.12 0.12 1" + color="DkGray" height="14" image_name="Rounded_Square" layout="topleft" @@ -101,7 +100,7 @@ top_delta="0" width="2" /> <icon - color="0.12 0.12 0.12 1" + color="DkGray" height="14" image_name="Rounded_Square" layout="topleft" @@ -178,10 +177,86 @@ width="80"> Ultra </text> + <slider + control_name="RenderAvatarLODFactor" + invisiblity_control="ShowAdvancedGraphicsSettings" + follows="left|top" + height="16" + increment="0.125" + initial_value="160" + label="Avatar detail:" + label_width="90" + layout="topleft" + left="30" + name="AvatarMeshDetail2" + show_text="false" + top="72" + width="300"> + <slider.commit_callback + function="Pref.UpdateSliderText" + parameter="AvatarMeshDetailText2" /> + </slider> + <text + type="string" + invisiblity_control="ShowAdvancedGraphicsSettings" + length="1" + follows="left|top" + height="12" + layout="topleft" + name="AvatarMeshDetailText2" + top_delta="0" + left_delta="304" + width="128"> + Low + </text> + <slider + control_name="RenderFarClip" + invisiblity_control="ShowAdvancedGraphicsSettings" + decimal_digits="0" + follows="left|top" + height="16" + increment="8" + initial_value="160" + label="Draw distance:" + label_width="90" + layout="topleft" + left="30" + max_val="512" + min_val="64" + name="DrawDistance" + top="110" + width="330" /> + <text + type="string" + invisiblity_control="ShowAdvancedGraphicsSettings" + length="1" + follows="left|top" + height="12" + layout="topleft" + left_delta="330" + name="DrawDistanceMeterText2" + top_delta="0" + width="128"> + m + </text> + <check_box + control_name="RenderDeferred" + invisiblity_control="ShowAdvancedGraphicsSettings" + height="16" + initial_value="true" + label="Advanced Lighting Model" + layout="topleft" + left="30" + name="UseLightShaders2" + top="148" + width="256"> + <check_box.commit_callback + function="Pref.VertexShaderEnable" /> + </check_box> <panel - visiblity_control="ShowAdvancedGraphicsSettings" + visiblity_control="ShowAdvancedGraphicsSettings" border="false" - follows="top|left" + follows="top|left" height="300" label="CustomGraphics" layout="topleft" @@ -225,13 +300,13 @@ function="Pref.VertexShaderEnable" /> </check_box> <check_box - control_name="RenderLocalLights" - height="16" - initial_value="true" - label="Local Lights" - layout="topleft" - left_delta="0" - name="LocalLights" + control_name="RenderLocalLights" + height="16" + initial_value="true" + label="Local Lights" + layout="topleft" + left_delta="0" + name="LocalLights" top_pad="1" width="256" /> <check_box diff --git a/indra/newview/skins/default/xui/en/panel_script_ed.xml b/indra/newview/skins/default/xui/en/panel_script_ed.xml index 765b07ed8b..bcdef96138 100755 --- a/indra/newview/skins/default/xui/en/panel_script_ed.xml +++ b/indra/newview/skins/default/xui/en/panel_script_ed.xml @@ -125,6 +125,10 @@ label="Search / Replace..." layout="topleft" name="Search / Replace..." /> + <menu_item_call + label="Go to line..." + layout="topleft" + name="Go to line..." /> </menu> <menu top="0" diff --git a/indra/newview/skins/default/xui/en/panel_tools_texture.xml b/indra/newview/skins/default/xui/en/panel_tools_texture.xml index 5ac2ec2b20..426c0c4915 100644 --- a/indra/newview/skins/default/xui/en/panel_tools_texture.xml +++ b/indra/newview/skins/default/xui/en/panel_tools_texture.xml @@ -663,7 +663,7 @@ label_width="205" layout="topleft" left="10" - min_val="-1" + min_val="0" name="bumpyOffsetU" width="265" /> <spinner @@ -674,7 +674,7 @@ label_width="205" layout="topleft" left="10" - min_val="-1" + min_val="0" name="bumpyOffsetV" width="265" /> <spinner @@ -726,7 +726,7 @@ label_width="205" layout="topleft" left="10" - min_val="-1" + min_val="0" name="shinyOffsetU" width="265" /> <spinner @@ -737,7 +737,7 @@ label_width="205" layout="topleft" left="10" - min_val="-1" + min_val="0" name="shinyOffsetV" width="265" /> <check_box diff --git a/indra/newview/skins/default/xui/en/role_actions.xml b/indra/newview/skins/default/xui/en/role_actions.xml index 89aef57cca..0eeccbeac5 100755 --- a/indra/newview/skins/default/xui/en/role_actions.xml +++ b/indra/newview/skins/default/xui/en/role_actions.xml @@ -70,8 +70,8 @@ longdescription="Toggle 'Show Place in Search' and setting a parcel's category in About Land > Options tab." name="land find places" value="17" /> <action - description="Change parcel name, description, and 'Show Place in Search' settings" - longdescription="Change parcel name, description, and 'Show Place in Search' settings. This is done in About Land > Options tab." + description="Change parcel name, description, and 'Moderate Content' settings" + longdescription="Change parcel name, description, and 'Moderate Content' settings. This is done in About Land > Options tab." name="land change identity" value="18" /> <action description="Set landing point and set teleport routing" longdescription="On a group-owned parcel, Members in a Role with this Ability can set a landing point to specify where incoming teleports arrive, and also set teleport routing for further control. This is done in About Land > Options tab." diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index f7b33b0a4a..1c46cec479 100755 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -209,7 +209,8 @@ Please try logging in again in a minute.</string> <string name="SLappAgentIM">IM</string> <string name="SLappAgentPay">Pay</string> <string name="SLappAgentOfferTeleport">Offer Teleport to </string> - <string name="SLappAgentRequestFriend">Friend Request </string> + <string name="SLappAgentRequestFriend">Friend Request</string> + <string name="SLappAgentRemoveFriend">Friend Removal</string> <!-- ButtonToolTips, llfloater.cpp --> <string name="BUTTON_CLOSE_DARWIN">Close (⌘W)</string> @@ -409,10 +410,13 @@ Please try logging in again in a minute.</string> <string name="AddAndRemoveJoints">Add and remove joints with other objects</string> <string name="ChangePermissions">Change its permissions</string> <string name="TrackYourCamera">Track your camera</string> - <string name="ControlYourCamera">Control your camera</string> + <string name="ControlYourCamera">Control your camera</string> + <string name="TeleportYourAgent">Teleport you</string> + <string name="ManageEstateSilently">Manage your estates silently</string> + <string name="ChangeYourDefaultAnimations">Change your default animations</string> + <string name="NotConnected">Not Connected</string> <string name="AgentNameSubst">(You)</string> <!-- Substitution for agent name --> - <string name="TeleportYourAgent">Teleport you</string> <string name="JoinAnExperience">Join an experience</string> <!-- not used --> <string name="SilentlyManageEstateAccess">Suppress alerts when managing estate access lists</string> <string name="OverrideYourAnimations">Replace your default animations</string> @@ -643,11 +647,11 @@ Returns the wind velocity at the object position + offset </string> <string name="LSLTipText_llSetStatus" translate="false"> llSetStatus(integer status, integer value) -Sets status (STATUS_PHYSICS, STATUS_PHANTOM, STATUS_BLOCK_GRAB, STATUS_ROTATE_X, STATUS_ROTATE_Y, and/or STATUS_ROTATE_Z) to value +Sets status (STATUS_PHYSICS, STATUS_PHANTOM, STATUS_BLOCK_GRAB, STATUS_BLOCK_GRAB_OBJECT, STATUS_ROTATE_X, STATUS_ROTATE_Y, and/or STATUS_ROTATE_Z) to value </string> <string name="LSLTipText_llGetStatus" translate="false"> integer llGetStatus(integer status) -Returns value of status (STATUS_PHYSICS, STATUS_PHANTOM, STATUS_BLOCK_GRAB, STATUS_ROTATE_X, STATUS_ROTATE_Y, and/or STATUS_ROTATE_Z) +Returns the boolean value of status (STATUS_PHYSICS, STATUS_PHANTOM, STATUS_BLOCK_GRAB, STATUS_BLOCK_GRAB_OBJECT, STATUS_ROTATE_X, STATUS_ROTATE_Y, or STATUS_ROTATE_Z) </string> <string name="LSLTipText_llSetScale" translate="false"> llSetScale(vector scale) @@ -2515,6 +2519,8 @@ Drag folders to this area and click "Send to Marketplace" to list them for sale <string name="ATTACH_HUD_BOTTOM_LEFT">HUD Bottom Left</string> <string name="ATTACH_HUD_BOTTOM">HUD Bottom</string> <string name="ATTACH_HUD_BOTTOM_RIGHT">HUD Bottom Right</string> + <string name="ATTACH_NECK">Neck</string> + <string name="ATTACH_AVATAR_CENTER">Avatar Center</string> <!-- script editor --> <string name="CursorPos">Line [LINE], Column [COLUMN]</string> @@ -3927,5 +3933,8 @@ Try enclosing path to the editor with double quotes. <string name="logging_calls_enabled_log_empty"> There are no logged conversations. After you contact someone, or someone contacts you, a log entry will be shown here. </string> + <string name="loading_chat_logs"> + Loading... + </string> </strings> diff --git a/indra/newview/skins/default/xui/en/widgets/conversation_view_participant.xml b/indra/newview/skins/default/xui/en/widgets/conversation_view_participant.xml index b83d9122f7..b83d9122f7 100755..100644 --- a/indra/newview/skins/default/xui/en/widgets/conversation_view_participant.xml +++ b/indra/newview/skins/default/xui/en/widgets/conversation_view_participant.xml diff --git a/indra/newview/skins/default/xui/es/floater_about.xml b/indra/newview/skins/default/xui/es/floater_about.xml index 3696c7e12c..e0a2375067 100755 --- a/indra/newview/skins/default/xui/es/floater_about.xml +++ b/indra/newview/skins/default/xui/es/floater_about.xml @@ -8,7 +8,9 @@ Compilado con [COMPILER], versión [COMPILER_VERSION] </floater.string> <floater.string name="AboutPosition"> - Estás en la posición [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1], de [REGION], alojada en <nolink>[HOSTNAME]</nolink> ([HOSTIP]) + Estás en la posición [POSITION_LOCAL_0,number,1], [POSITION_LOCAL_1,number,1], [POSITION_LOCAL_2,number,1] de [REGION], alojada en <nolink>[HOSTNAME]</nolink> ([HOSTIP]) +SLURL: <nolink>[SLURL]</nolink> +(coordenadas globales [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1]) [SERVER_VERSION] [SERVER_RELEASE_NOTES_URL] </floater.string> diff --git a/indra/newview/skins/default/xui/es/floater_bulk_perms.xml b/indra/newview/skins/default/xui/es/floater_bulk_perms.xml index f1948220b4..5cd8b3c01f 100755 --- a/indra/newview/skins/default/xui/es/floater_bulk_perms.xml +++ b/indra/newview/skins/default/xui/es/floater_bulk_perms.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="floaterbulkperms" title="EDITAR LOS PERMISOS DEL CONTENIDO"> +<floater name="floaterbulkperms" title="AJUSTAR LOS PERMISOS DEL CONTENIDO"> <floater.string name="nothing_to_modify_text"> Lo seleccionado tiene contenidos no editables. </floater.string> @@ -33,7 +33,7 @@ <button label="√ Todos" label_selected="Todo" name="check_all"/> <button label="Limpiar" label_selected="Ninguno" name="check_none"/> <text name="newperms"> - Permisos nuevos del contenido + Ajustar los permisos del contenido a </text> <text name="GroupLabel"> Grupo: @@ -49,6 +49,7 @@ <check_box label="Modificarlo" name="next_owner_modify"/> <check_box label="Copiarlo" name="next_owner_copy"/> <check_box initial_value="true" label="Transferirlo" name="next_owner_transfer" tool_tip="El próximo propietario puede dar o revender este objeto"/> - <button label="OK" name="apply"/> + <button label="OK" name="ok"/> + <button label="Aplicar" name="apply"/> <button label="Cancelar" name="close"/> </floater> diff --git a/indra/newview/skins/default/xui/es/floater_goto_line.xml b/indra/newview/skins/default/xui/es/floater_goto_line.xml new file mode 100644 index 0000000000..ef3ed80fcb --- /dev/null +++ b/indra/newview/skins/default/xui/es/floater_goto_line.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="script goto" title="IR A LA LÃNEA"> + <button label="OK" label_selected="OK" name="goto_btn"/> + <text name="txt"> + Ir a la lÃnea + </text> +</floater> diff --git a/indra/newview/skins/default/xui/es/floater_im_session.xml b/indra/newview/skins/default/xui/es/floater_im_session.xml index 5f38fbd615..e5f48e3fd5 100755 --- a/indra/newview/skins/default/xui/es/floater_im_session.xml +++ b/indra/newview/skins/default/xui/es/floater_im_session.xml @@ -34,13 +34,11 @@ <layout_panel name="body_panel"> <layout_stack name="im_panels"> <layout_panel name="right_part_holder"> - <panel name="trnsAndChat_panel"> - <layout_stack name="translate_and_chat_stack"> - <layout_panel name="translate_chat_checkbox_lp"> - <check_box label="Traducir el chat" name="translate_chat_checkbox"/> - </layout_panel> - </layout_stack> - </panel> + <layout_stack name="translate_and_chat_stack"> + <layout_panel name="translate_chat_checkbox_lp"> + <check_box label="Traducir el chat" name="translate_chat_checkbox"/> + </layout_panel> + </layout_stack> </layout_panel> </layout_stack> </layout_panel> diff --git a/indra/newview/skins/default/xui/es/floater_pathfinding_console.xml b/indra/newview/skins/default/xui/es/floater_pathfinding_console.xml index 3602270e5a..e93ecc9e10 100755 --- a/indra/newview/skins/default/xui/es/floater_pathfinding_console.xml +++ b/indra/newview/skins/default/xui/es/floater_pathfinding_console.xml @@ -71,7 +71,7 @@ <text name="show_label"> Mostrar: </text> - <check_box label="Prueba" name="show_world"/> + <check_box label="Mundo virtual" name="show_world"/> <check_box label="Solamente los objetos movibles" name="show_world_movables_only"/> <check_box label="Navmesh" name="show_navmesh"/> <text name="show_walkability_label"> diff --git a/indra/newview/skins/default/xui/es/menu_attachment_other.xml b/indra/newview/skins/default/xui/es/menu_attachment_other.xml index 00bdb74881..7698348c00 100755 --- a/indra/newview/skins/default/xui/es/menu_attachment_other.xml +++ b/indra/newview/skins/default/xui/es/menu_attachment_other.xml @@ -11,7 +11,9 @@ <menu_item_call label="Congelar" name="Freeze..."/> <menu_item_call label="Expulsar" name="Eject..."/> <menu_item_call label="Depurar las texturas" name="Debug..."/> + <menu_item_call label="Volcar XML" name="Dump XML"/> <menu_item_call label="Acercar el zoom" name="Zoom In"/> <menu_item_call label="Pagar" name="Pay..."/> <menu_item_call label="Perfil del objeto" name="Object Inspect"/> + <menu_item_call label="Ignorar al propietario de la partÃcula" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/es/menu_attachment_self.xml b/indra/newview/skins/default/xui/es/menu_attachment_self.xml index 0ba39378bb..5acd0c327a 100755 --- a/indra/newview/skins/default/xui/es/menu_attachment_self.xml +++ b/indra/newview/skins/default/xui/es/menu_attachment_self.xml @@ -12,5 +12,7 @@ <menu_item_call label="Mis grupos" name="Groups..."/> <menu_item_call label="Mi perfil" name="Profile..."/> <menu_item_call label="Depurar las texturas" name="Debug..."/> + <menu_item_call label="Volcar XML" name="Dump XML"/> <menu_item_call label="Soltar" name="Drop"/> + <menu_item_call label="Ignorar al propietario de la partÃcula" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/es/menu_avatar_other.xml b/indra/newview/skins/default/xui/es/menu_avatar_other.xml index 7df2d7c4e0..244099214a 100755 --- a/indra/newview/skins/default/xui/es/menu_avatar_other.xml +++ b/indra/newview/skins/default/xui/es/menu_avatar_other.xml @@ -11,6 +11,8 @@ <menu_item_call label="Congelar" name="Freeze..."/> <menu_item_call label="Expulsar" name="Eject..."/> <menu_item_call label="Depurar las texturas" name="Debug..."/> + <menu_item_call label="Volcar XML" name="Dump XML"/> <menu_item_call label="Acercar el zoom" name="Zoom In"/> <menu_item_call label="Pagar" name="Pay..."/> + <menu_item_call label="Ignorar al propietario de la partÃcula" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/es/menu_avatar_self.xml b/indra/newview/skins/default/xui/es/menu_avatar_self.xml index 268d6f70ab..717b46ac74 100755 --- a/indra/newview/skins/default/xui/es/menu_avatar_self.xml +++ b/indra/newview/skins/default/xui/es/menu_avatar_self.xml @@ -29,4 +29,6 @@ <menu_item_call label="Mis grupos" name="Groups..."/> <menu_item_call label="Mi perfil" name="Profile..."/> <menu_item_call label="Depurar las texturas" name="Debug..."/> + <menu_item_call label="Volcar XML" name="Dump XML"/> + <menu_item_call label="Ignorar al propietario de la partÃcula" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/es/menu_conversation.xml b/indra/newview/skins/default/xui/es/menu_conversation.xml index e4e9a0bf63..b63711589d 100644 --- a/indra/newview/skins/default/xui/es/menu_conversation.xml +++ b/indra/newview/skins/default/xui/es/menu_conversation.xml @@ -3,6 +3,7 @@ <menu_item_call label="Cerrar conversación" name="close_conversation"/> <menu_item_call label="Abrir conversación de voz" name="open_voice_conversation"/> <menu_item_call label="Desconectar de voz" name="disconnect_from_voice"/> + <menu_item_call label="Cerrar seleccionados" name="close_selected_conversations"/> <menu_item_call label="Ver el perfil" name="view_profile"/> <menu_item_call label="MI" name="im"/> <menu_item_call label="Ofrecer teleporte" name="offer_teleport"/> diff --git a/indra/newview/skins/default/xui/es/menu_land.xml b/indra/newview/skins/default/xui/es/menu_land.xml index b0f15be1b6..2097628356 100755 --- a/indra/newview/skins/default/xui/es/menu_land.xml +++ b/indra/newview/skins/default/xui/es/menu_land.xml @@ -6,4 +6,5 @@ <menu_item_call label="Comprar un pase" name="Land Buy Pass"/> <menu_item_call label="Construir" name="Create"/> <menu_item_call label="Modificar el terreno" name="Edit Terrain"/> + <menu_item_call label="Ignorar al propietario de la partÃcula" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/es/menu_login.xml b/indra/newview/skins/default/xui/es/menu_login.xml index 289ac3f075..2286d0527a 100755 --- a/indra/newview/skins/default/xui/es/menu_login.xml +++ b/indra/newview/skins/default/xui/es/menu_login.xml @@ -17,7 +17,13 @@ <menu_item_call label="Mostrar los 'TOS'" name="TOS"/> <menu_item_call label="Mostrar mensaje crÃtico" name="Critical"/> <menu_item_call label="Prueba de depuración de ventanas de contenido web" name="Web Content Floater Debug Test"/> - <menu label="Configurar el nivel de registro" name="Set Logging Level"/> + <menu label="Configurar el nivel de registro" name="Set Logging Level"> + <menu_item_check label="Depurar" name="Debug"/> + <menu_item_check label="Información" name="Info"/> + <menu_item_check label="¡Atención!" name="Warning"/> + <menu_item_check label="Error" name="Error"/> + <menu_item_check label="Ninguno" name="None"/> + </menu> <menu_item_check label="Mostrar el selector de Grid" name="Show Grid Picker"/> <menu_item_call label="Mostrar la consola de notificaciones" name="Show Notifications Console"/> </menu> diff --git a/indra/newview/skins/default/xui/es/menu_mute_particle.xml b/indra/newview/skins/default/xui/es/menu_mute_particle.xml new file mode 100644 index 0000000000..daddf982de --- /dev/null +++ b/indra/newview/skins/default/xui/es/menu_mute_particle.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<!-- *NOTE: See also menu_attachment_other.xml --> +<context_menu name="Mute Particle Pie"> + <menu_item_call label="Ignorar al propietario de la partÃcula" name="Mute Particle"/> +</context_menu> diff --git a/indra/newview/skins/default/xui/es/menu_object.xml b/indra/newview/skins/default/xui/es/menu_object.xml index 33ea8c88d8..e75c7283af 100755 --- a/indra/newview/skins/default/xui/es/menu_object.xml +++ b/indra/newview/skins/default/xui/es/menu_object.xml @@ -5,13 +5,13 @@ </menu_item_call> <menu_item_call label="Editar" name="Edit..."/> <menu_item_call label="Construir" name="Build"/> - <menu_item_call label="Mostrar en linksets" name="show_in_linksets"/> - <menu_item_call label="Mostrar en personajes" name="show_in_characters"/> <menu_item_call label="Abrir" name="Open"/> <menu_item_call label="Sentarme aquÃ" name="Object Sit"/> <menu_item_call label="Levantarme" name="Object Stand Up"/> <menu_item_call label="Perfil del objeto" name="Object Inspect"/> <menu_item_call label="Acercar el zoom" name="Zoom In"/> + <menu_item_call label="Mostrar en linksets" name="show_in_linksets"/> + <menu_item_call label="Mostrar en personajes" name="show_in_characters"/> <context_menu label="Ponerme" name="Put On"> <menu_item_call label="Ponerme" name="Wear"/> <menu_item_call label="Añadir" name="Add"/> @@ -28,4 +28,5 @@ <menu_item_call label="Pagar" name="Pay..."/> <menu_item_call label="Comprar" name="Buy..."/> <menu_item_call label="Borrar" name="Delete"/> + <menu_item_call label="Ignorar al propietario de la partÃcula" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/es/menu_url_agent.xml b/indra/newview/skins/default/xui/es/menu_url_agent.xml index 69a03671ab..610d65465d 100755 --- a/indra/newview/skins/default/xui/es/menu_url_agent.xml +++ b/indra/newview/skins/default/xui/es/menu_url_agent.xml @@ -3,6 +3,7 @@ <menu_item_call label="Ver el perfil" name="show_agent"/> <menu_item_call label="Enviar un MI..." name="send_im"/> <menu_item_call label="Añadir como amigo..." name="add_friend"/> + <menu_item_call label="Quitar de los amigos..." name="remove_friend"/> <menu_item_call label="Copiar el nombre al portapapeles" name="url_copy_label"/> <menu_item_call label="Copiar la SLurl al portapapeles" name="url_copy"/> </context_menu> diff --git a/indra/newview/skins/default/xui/es/menu_url_objectim.xml b/indra/newview/skins/default/xui/es/menu_url_objectim.xml index e78fdec558..c3c8439ea2 100755 --- a/indra/newview/skins/default/xui/es/menu_url_objectim.xml +++ b/indra/newview/skins/default/xui/es/menu_url_objectim.xml @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <context_menu name="Url Popup"> <menu_item_call label="Perfil del objeto..." name="show_object"/> + <menu_item_call label="Ignorar..." name="block_object"/> <menu_item_call label="Mostrar en el mapa" name="show_on_map"/> <menu_item_call label="Teleportarse a la posición del objeto" name="teleport_to_object"/> <menu_item_call label="Copiar el nombre del objeto al portapapeles" name="url_copy_label"/> diff --git a/indra/newview/skins/default/xui/es/menu_viewer.xml b/indra/newview/skins/default/xui/es/menu_viewer.xml index 1e0ceb2220..e4fe871683 100755 --- a/indra/newview/skins/default/xui/es/menu_viewer.xml +++ b/indra/newview/skins/default/xui/es/menu_viewer.xml @@ -16,7 +16,10 @@ <menu_item_call label="Parar mis animaciones" name="Stop Animating My Avatar"/> <menu_item_call label="Caminar / Correr / Volar..." name="Walk / run / fly"/> </menu> - <menu label="Estado" name="Status"/> + <menu label="Estado" name="Status"> + <menu_item_check label="Ausente" name="Away"/> + <menu_item_check label="No molestar" name="Do Not Disturb"/> + </menu> <menu_item_call label="Comprar L$..." name="Buy and Sell L$"/> <menu_item_call label="Panel de control de la cuenta..." name="Manage My Account"> <menu_item_call.on_click name="ManageMyAccount_url" parameter="WebLaunchJoinNow,http://secondlife.com/account/index.php?lang=es"/> @@ -31,6 +34,7 @@ <menu_item_check label="Conversaciones..." name="Conversations"/> <menu_item_check label="Chat..." name="Nearby Chat"/> <menu_item_check label="Hablar" name="Speak"/> + <menu_item_check label="Registro de conversación..." name="Conversation Log..."/> <menu label="Transformación de voz" name="VoiceMorphing"> <menu_item_check label="Sin transformación de voz" name="NoVoiceMorphing"/> <menu_item_check label="Probar..." name="Preview"/> @@ -41,6 +45,7 @@ <menu_item_check label="Grupos" name="My Groups"/> <menu_item_check label="Gente cerca" name="Active Speakers"/> <menu_item_call label="Lista de ignorados" name="Block List"/> + <menu_item_check label="No molestar" name="Do Not Disturb"/> </menu> <menu label="Mundo" name="World"> <menu_item_call label="Crear un hito de este sitio" name="Create Landmark Here"/> @@ -109,6 +114,7 @@ <menu_item_call label="Incluir la parte siguiente" name="Include Next Part"/> <menu_item_call label="Incluir la parte previa" name="Include Previous Part"/> </menu> + <menu_item_call label="Linksets..." name="pathfinding_linkset_menu_item"/> <menu_item_call label="Visión en lo seleccionado" name="Focus on Selection"/> <menu_item_call label="Zoom en lo seleccionado" name="Zoom to Selection"/> <menu label="Objeto" name="Object"> @@ -272,6 +278,7 @@ <menu_item_check label="Camera Offset" name="Camera Offset"/> <menu_item_check label="Randomize Framerate" name="Randomize Framerate"/> <menu_item_check label="Frame Test" name="Frame Test"/> + <menu_item_call label="Perfil del fotograma" name="Frame Profile"/> </menu> <menu label="Render Metadata" name="Render Metadata"> <menu_item_check label="Normales" name="Normals"/> @@ -292,15 +299,15 @@ </menu> <menu label="Rendering" name="Rendering"> <menu_item_check label="Axes" name="Axes"/> + <menu_item_call label="Información sobre el material seleccionado" name="Selected Material Info"/> <menu_item_check label="Wireframe" name="Wireframe"/> - <menu_item_check label="Luces y sombras" name="Advanced Lighting Model"/> + <menu_item_check label="Modelo de iluminación avanzado" name="Advanced Lighting Model"/> <menu_item_check label="Sombras del sol/la luna/proyectores" name="Shadows from Sun/Moon/Projectors"/> <menu_item_check label="SSAO y sombras suavizadas" name="SSAO and Shadow Smoothing"/> <menu_item_check label="Capas alfa automáticas (deferidas)" name="Automatic Alpha Masks (deferred)"/> <menu_item_check label="Capas alfa automáticas (no deferidas)" name="Automatic Alpha Masks (non-deferred)"/> <menu_item_check label="Animation Textures" name="Animation Textures"/> <menu_item_check label="Disable Textures" name="Disable Textures"/> - <menu_item_check label="Atlas de texturas (experimental)" name="Texture Atlas"/> <menu_item_check label="Render Attached Lights" name="Render Attached Lights"/> <menu_item_check label="Render Attached Particles" name="Render Attached Particles"/> <menu_item_check label="Hover Glow Objects" name="Hover Glow Objects"/> @@ -319,7 +326,6 @@ <menu_item_call label="Prueba de navegadores de medios" name="Web Browser Test"/> <menu_item_call label="Navegador de contenido web" name="Web Content Browser"/> <menu_item_call label="Print Selected Object Info" name="Print Selected Object Info"/> - <menu_item_call label="Memory Stats" name="Memory Stats"/> <menu_item_check label="Consola de depuración de región" name="Region Debug Console"/> <menu_item_check label="Debug Clicks" name="Debug Clicks"/> <menu_item_check label="Debug Mouse Events" name="Debug Mouse Events"/> diff --git a/indra/newview/skins/default/xui/es/notifications.xml b/indra/newview/skins/default/xui/es/notifications.xml index 05455f54c3..d4451ad251 100755 --- a/indra/newview/skins/default/xui/es/notifications.xml +++ b/indra/newview/skins/default/xui/es/notifications.xml @@ -206,6 +206,14 @@ No podrás removérseles de ese rol, sino que deberán renunciar a él por sà m ¿Añadir esta capacidad a '[ROLE_NAME]'? <usetemplate name="okcancelbuttons" notext="No" yestext="SÃ"/> </notification> + <notification name="EjectGroupMemberWarning"> + Estás a punto de expulsar a [AVATAR_NAME] del grupo. + <usetemplate ignoretext="Confirmar la expulsión de un miembro del grupo" name="okcancelignore" notext="Cancelar" yestext="Expulsar"/> + </notification> + <notification name="EjectGroupMembersWarning"> + Estás a punto de expulsar a [COUNT] miembros del grupo. + <usetemplate ignoretext="Confirmar la expulsión de varios miembros del grupo" name="okcancelignore" notext="Cancelar" yestext="Expulsar"/> + </notification> <notification name="AttachmentDrop"> Vas a soltar tu anexado. ¿Estás seguro de que quieres continuar? @@ -1113,7 +1121,7 @@ en TODO EL TERRENO de este sim? Por favor, elige un pago mayor. </notification> <notification name="ConfirmItemDeleteHasLinks"> - Por lo menos uno de los elementos seleccionados contiene vÃnculos que le señalan. Si eliminas este elemento, los vÃnculos dejarán de funcionar permanentemente. Lo más recomendable es eliminar primero los vÃnculos. + Por lo menos uno de los elementos contiene vÃnculos que lo señalan. Si eliminas este elemento, los vÃnculos dejarán de funcionar permanentemente. Lo más recomendable es eliminar primero los vÃnculos. ¿Estás seguro de que quieres eliminar los elementos? <usetemplate name="okcancelbuttons" notext="Cancelar" yestext="OK"/> @@ -1131,9 +1139,9 @@ Por favor, elige un pago mayor. <usetemplate name="okcancelbuttons" notext="Cancelar" yestext="OK"/> </notification> <notification name="ConfirmObjectDeleteNoOwn"> - No eres el propietario de, al menos, uno de los Ãtems que has seleccionado. + Uno o más de los elementos seleccionados no son tuyos. -¿Estás seguro de que quieres borrar estos Ãtems? +¿Estás seguro de que quieres eliminar los elementos? <usetemplate name="okcancelbuttons" notext="Cancelar" yestext="OK"/> </notification> <notification name="ConfirmObjectDeleteLockNoCopy"> @@ -1144,25 +1152,25 @@ Al menos un objeto no es copiable. <usetemplate name="okcancelbuttons" notext="Cancelar" yestext="OK"/> </notification> <notification name="ConfirmObjectDeleteLockNoOwn"> - Al menos un objeto está bloqueado. -No eres propietario de, al menos, un objeto. + Hay un objeto bloqueado como mÃnimo. +No eres propietario de al menos un objeto. -¿Estás seguro de que quieres borrar estos Ãtems? +¿Estás seguro de que quieres eliminar los elementos? <usetemplate name="okcancelbuttons" notext="Cancelar" yestext="OK"/> </notification> <notification name="ConfirmObjectDeleteNoCopyNoOwn"> - Al menos un objeto no es copiable. -No eres propietario de, al menos, un objeto. + No se puede copiar un objeto como mÃnimo. +No eres propietario de al menos un objeto. -¿Estás seguro de que quieres borrar estos Ãtems? +¿Estás seguro de que quieres eliminar los elementos? <usetemplate name="okcancelbuttons" notext="Cancelar" yestext="OK"/> </notification> <notification name="ConfirmObjectDeleteLockNoCopyNoOwn"> - Al menos un objeto está bloqueado. -Al menos un objeto no es copiable. -No eres propietario de, al menos, un objeto. + Hay un objeto bloqueado como mÃnimo. +No se puede copiar un objeto como mÃnimo. +No eres propietario de al menos un objeto. -¿Estás seguro de que quieres borrar estos Ãtems? +¿Estás seguro de que quieres eliminar los elementos? <usetemplate name="okcancelbuttons" notext="Cancelar" yestext="OK"/> </notification> <notification name="ConfirmObjectTakeLock"> @@ -1486,13 +1494,43 @@ Versión [VERSION] [[RELEASE_NOTES_FULL_URL]; información acerca de esta actual </notification> <notification name="RequiredUpdateDownloadedVerboseDialog"> Hemos descargado una actualización de software necesaria. -Versión [VERSION] +Versión [VERSION] [[INFO_URL] Información sobre esta actualización] -Debemos reiniciar [APP_NAME] para instalar la actualización. +Para instalar la actualización, hay que reiniciar [APP_NAME]. <usetemplate name="okbutton" yestext="OK"/> </notification> <notification name="RequiredUpdateDownloadedDialog"> - Debemos reiniciar [APP_NAME] para instalar la actualización. + Para instalar la actualización, hay que reiniciar [APP_NAME]. +[[INFO_URL] Información sobre esta actualización] + <usetemplate name="okbutton" yestext="OK"/> + </notification> + <notification name="OtherChannelDownloadBackgroundTip"> + Hemos descargado una actualización aplicable a tu instalación de [APP_NAME]. +Versión [VERSION] +Este visor experimental se ha sustituido por un visor de [NEW_CHANNEL]. +Consulta [[INFO_URL] para informarte sobre esta actualización.] + <usetemplate name="okcancelbuttons" notext="Más tarde..." yestext="Instalar ahora y reiniciar [APP_NAME]"/> + </notification> + <notification name="OtherChannelDownloadBackgroundDialog"> + Hemos descargado una actualización aplicable a tu instalación de [APP_NAME]. +Versión [VERSION] +Este visor experimental se ha sustituido por un visor de [NEW_CHANNEL]. +Consulta [[INFO_URL] Información sobre esta actualización]. + <usetemplate name="okcancelbuttons" notext="Más tarde..." yestext="Instalar ahora y reiniciar [APP_NAME]"/> + </notification> + <notification name="OtherChannelRequiredUpdateDownloadedVerboseDialog"> + Hemos descargado una actualización de software necesaria. +Versión [VERSION] +Este visor experimental se ha sustituido por un visor de [NEW_CHANNEL]. +Consulta [[INFO_URL] Información sobre esta actualización]. + +Para instalar la actualización, hay que reiniciar [APP_NAME]. + <usetemplate name="okbutton" yestext="OK"/> + </notification> + <notification name="OtherChannelRequiredUpdateDownloadedDialog"> + Para instalar la actualización, hay que reiniciar [APP_NAME]. +Este visor experimental se ha sustituido por un visor de [NEW_CHANNEL]. +Consulta [[INFO_URL] Información sobre esta actualización]. <usetemplate name="okbutton" yestext="OK"/> </notification> <notification name="DeedObjectToGroup"> @@ -1543,6 +1581,10 @@ Debemos reiniciar [APP_NAME] para instalar la actualización. ¿Deseas abandonar el grupo? <usetemplate name="okcancelbuttons" notext="Cancelar" yestext="OK"/> </notification> + <notification name="OwnerCannotLeaveGroup"> + No es posible abandonar el grupo. No puedes abandonarlo porque eres su último propietario. Antes tienes que asignar el papel de propietario a otro miembro. + <usetemplate name="okbutton" yestext="OK"/> + </notification> <notification name="ConfirmKick"> ¿Quieres realmente expulsar a todos los residentes de la cuadrÃcula? <usetemplate name="okcancelbuttons" notext="Cancelar" yestext="Expulsar a todos los Residentes"/> @@ -2404,9 +2446,7 @@ Por favor, selecciona un sólo objeto. elegir 'Teleportar'.) </notification> <notification name="TeleportToPerson"> - Para ponerte en contacto con Residentes como '[NAME]', pulsa el botón "Gente", selecciona un Residente en la ventana que se abre y después pulsa en 'MI' en - la parte inferior de la ventana. - (También puedes pulsar dos veces en su nombre o pulsarlo con el botón derecho y elegir 'MI'). + Para abrir una conversación privada con alguien, pulsa con el botón derecho en su avatar y selecciona 'MI' en el menú. </notification> <notification name="CantSelectLandFromMultipleRegions"> No puedes seleccionar un terreno que cruce las fronteras entre servidores. @@ -2780,6 +2820,15 @@ No autorices el acceso a tu cuenta si no conoces cuál es la razón exacta. <button name="Deny" text="Denegar"/> </form> </notification> + <notification name="UnknownScriptQuestion"> + '<nolink>[OBJECTNAME]</nolink>', un objeto propiedad de '[NAME]', ha solicitado un permiso de script en tiempo de ejecución que el visor no reconoce ni puede conceder. + +Para obtener el permiso, descárgate aquà la última versión: [DOWNLOADURL]. + <form name="form"> + <button name="Deny" text="Aceptar"/> + <button name="Mute" text="Ignorar"/> + </form> + </notification> <notification name="ScriptDialog"> '<nolink>[TITLE]</nolink>' de [NAME] [MESSAGE] diff --git a/indra/newview/skins/default/xui/es/panel_people.xml b/indra/newview/skins/default/xui/es/panel_people.xml index 7a7dfca0b8..06150f7619 100755 --- a/indra/newview/skins/default/xui/es/panel_people.xml +++ b/indra/newview/skins/default/xui/es/panel_people.xml @@ -49,6 +49,9 @@ <menu_button name="plus_btn" tool_tip="Entrar en un grupo o crear uno"/> <dnd_button name="minus_btn" tool_tip="Dejar el grupo seleccionado"/> </panel> + <text name="groupcount"> + Formas parte de [COUNT] grupos y puedes unirte a [REMAINING] más. + </text> </panel> <panel label="RECIENTE" name="recent_panel"> <panel label="bottom_panel" name="recent_buttons_panel"> diff --git a/indra/newview/skins/default/xui/es/panel_preferences_chat.xml b/indra/newview/skins/default/xui/es/panel_preferences_chat.xml index 28bc98f988..7feff9005c 100755 --- a/indra/newview/skins/default/xui/es/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/es/panel_preferences_chat.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <panel label="Chat de texto" name="chat"> - <panel> + <panel name="general_chat_settings"> <check_box initial_value="true" label="Ejecutar la animación de escribir al hacerlo en el chat" name="play_typing_animation"/> <check_box label="Cuando estoy desconectado, enviarme los MI al correo-e" name="send_im_to_email"/> <check_box label="Sólo pueden llamarme o mandarme un MI mis amigos y grupos" name="voice_call_friends_only_check"/> @@ -8,66 +8,78 @@ Tamaño de la fuente: </text> <combo_box name="chat_font_size"> - <item label="Pequeña" name="Small" value="0"/> - <item label="Mediana" name="Medium" value="1"/> + <item label="Pequeño" name="Small" value="0"/> + <item label="Medio" name="Medium" value="1"/> <item label="Grande" name="Large" value="2"/> </combo_box> <check_box label="Bocadillos del chat" name="bubble_text_chat"/> </panel> - <panel> - <text name="notifications"> - Notificaciones - </text> + <panel name="im_notification_settings"> <text name="friend_ims"> MI de amigos: </text> <combo_box name="FriendIMOptions"> - <item label="Ventana Conversaciones abiertas" name="OpenConversationsWindow" value="openconversations"/> - <item label="Mensaje en ventana emergente" name="PopUpMessage" value="toast"/> + <item label="Abrir ventana de conversaciones" name="OpenConversationsWindow" value="openconversations"/> + <item label="Abrir el mensaje en una ventana emergente" name="PopUpMessage" value="toast"/> <item label="Botón de la barra de herramientas de Flash" name="FlashToolbarButton" value="flash"/> - <item label="Ninguno" name="None" value="ninguno"/> + <item label="Ninguna acción" name="NoAction" value="noaction"/> </combo_box> + <check_box label="Reproducir sonido" name="play_sound_friend_im"/> <text name="non_friend_ims"> MI de no amigos: </text> <combo_box name="NonFriendIMOptions"> - <item label="Ventana Conversaciones abiertas" name="OpenConversationsWindow" value="openconversations"/> - <item label="Mensaje en ventana emergente" name="PopUpMessage" value="toast"/> + <item label="Abrir ventana de conversaciones" name="OpenConversationsWindow" value="openconversations"/> + <item label="Abrir el mensaje en una ventana emergente" name="PopUpMessage" value="toast"/> <item label="Botón de la barra de herramientas de Flash" name="FlashToolbarButton" value="flash"/> - <item label="Ninguno" name="None" value="ninguno"/> + <item label="Ninguna acción" name="NoAction" value="noaction"/> </combo_box> + <check_box label="Reproducir sonido" name="play_sound_non_friend_im"/> <text name="conference_ims"> - MI de conferencia: + MI de conferencias: </text> <combo_box name="ConferenceIMOptions"> - <item label="Ventana Conversaciones abiertas" name="OpenConversationsWindow" value="openconversations"/> - <item label="Mensaje en ventana emergente" name="PopUpMessage" value="toast"/> + <item label="Abrir ventana de conversaciones" name="OpenConversationsWindow" value="openconversations"/> + <item label="Abrir el mensaje en una ventana emergente" name="PopUpMessage" value="toast"/> <item label="Botón de la barra de herramientas de Flash" name="FlashToolbarButton" value="flash"/> - <item label="Ninguno" name="None" value="ninguno"/> + <item label="Ninguna acción" name="NoAction" value="noaction"/> </combo_box> + <check_box label="Reproducir sonido" name="play_sound_conference_im"/> <text name="group_chat"> Chat de grupo: </text> <combo_box name="GroupChatOptions"> - <item label="Ventana Conversaciones abiertas" name="OpenConversationsWindow" value="openconversations"/> - <item label="Mensaje en ventana emergente" name="PopUpMessage" value="toast"/> + <item label="Abrir ventana de conversaciones" name="OpenConversationsWindow" value="openconversations"/> + <item label="Abrir el mensaje en una ventana emergente" name="PopUpMessage" value="toast"/> <item label="Botón de la barra de herramientas de Flash" name="FlashToolbarButton" value="flash"/> - <item label="Ninguno" name="None" value="ninguno"/> + <item label="Ninguna acción" name="NoAction" value="noaction"/> </combo_box> + <check_box label="Reproducir sonido" name="play_sound_group_chat_im"/> <text name="nearby_chat"> - Chat: + Chat con gente cercana: </text> <combo_box name="NearbyChatOptions"> - <item label="Ventana Conversaciones abiertas" name="OpenConversationsWindow" value="openconversations"/> - <item label="Mensaje en ventana emergente" name="PopUpMessage" value="toast"/> + <item label="Abrir ventana de conversaciones" name="OpenConversationsWindow" value="openconversations"/> + <item label="Abrir el mensaje en una ventana emergente" name="PopUpMessage" value="toast"/> + <item label="Botón de la barra de herramientas de Flash" name="FlashToolBarButton" value="flash"/> + <item label="Ninguna acción" name="NoAction" value="noaction"/> + </combo_box> + <check_box label="Reproducir sonido" name="play_sound_nearby_chat_im"/> + <text name="object_ims"> + MI de objetos: + </text> + <combo_box name="ObjectIMOptions"> + <item label="Abrir ventana de conversaciones" name="OpenConversationsWindow" value="openconversations"/> + <item label="Abrir el mensaje en una ventana emergente" name="PopUpMessage" value="toast"/> <item label="Botón de la barra de herramientas de Flash" name="FlashToolBarButton" value="flash"/> - <item label="Ninguno" name="None" value="ninguno"/> + <item label="Ninguna acción" name="NoAction" value="noaction"/> </combo_box> + <check_box label="Reproducir sonido" name="play_sound_object_im"/> <text name="notifications_alert"> - Para suspender provisionalmente todas las notificaciones, usa Comunicarme > No molestar. + Para dejar de recibir avisos durante un tiempo, usa Comunicarme > No molestar. </text> </panel> - <panel> + <panel name="play_sound_settings"> <text name="play_sound"> Reproducir sonido: </text> @@ -76,9 +88,9 @@ <check_box label="Oferta de teleporte" name="teleport_offer"/> <check_box label="Oferta de inventario" name="inventory_offer"/> </panel> - <panel> - <button label="Limpiar el registro..." name="clear_log"/> - <button label="Eliminar transcripciones..." name="delete_transcripts"/> + <panel name="log_settings"> + <button label="Borrar registro..." name="clear_log"/> + <button label="Borrar grabaciones..." name="delete_transcripts"/> <button label="Examinar..." label_selected="Examinar" name="log_path_button"/> </panel> <button label="Traducción…" name="ok_btn"/> diff --git a/indra/newview/skins/default/xui/es/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/es/panel_preferences_graphics1.xml index 281b871fed..9362f76708 100755 --- a/indra/newview/skins/default/xui/es/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/es/panel_preferences_graphics1.xml @@ -30,7 +30,7 @@ <check_box initial_value="verdadero" label="Luces locales" name="LocalLights"/> <check_box initial_value="true" label="Shaders básicos" name="BasicShaders" tool_tip="Desactivando esta opción puede prevenir fallos en algunos controladores de la tarjeta gráfica."/> <check_box initial_value="true" label="Shaders de la atmósfera" name="WindLightUseAtmosShaders"/> - <check_box initial_value="verdadero" label="Luces y sombras" name="UseLightShaders"/> + <check_box initial_value="verdadero" label="Modelo de iluminación avanzado" name="UseLightShaders"/> <check_box initial_value="verdadero" label="Oclusión del ambiente" name="UseSSAO"/> <check_box initial_value="verdadero" label="Profundidad del campo" name="UseDoF"/> <text name="shadows_label"> diff --git a/indra/newview/skins/default/xui/es/panel_preferences_setup.xml b/indra/newview/skins/default/xui/es/panel_preferences_setup.xml index 81a29dae5a..f7eaa03d63 100755 --- a/indra/newview/skins/default/xui/es/panel_preferences_setup.xml +++ b/indra/newview/skins/default/xui/es/panel_preferences_setup.xml @@ -29,6 +29,7 @@ <combo_box.item label="Instalar automáticamente" name="Install_automatically"/> <combo_box.item label="Descargar e instalar actualizaciones manualmente" name="Install_manual"/> </combo_box> + <check_box label="Admitir candidatos a la versión comercial a la hora de realizar actualizaciones" name="update_willing_to_test"/> <text name="Proxy Settings:"> Configuración de proxy: </text> diff --git a/indra/newview/skins/default/xui/es/panel_script_ed.xml b/indra/newview/skins/default/xui/es/panel_script_ed.xml index 4c4077b96f..87314820a6 100755 --- a/indra/newview/skins/default/xui/es/panel_script_ed.xml +++ b/indra/newview/skins/default/xui/es/panel_script_ed.xml @@ -34,6 +34,7 @@ <menu_item_call label="Seleccionar todo" name="Select All"/> <menu_item_call label="Deseleccionar" name="Deselect"/> <menu_item_call label="Buscar / Reemplazar..." name="Search / Replace..."/> + <menu_item_call label="Ir a la lÃnea..." name="Go to line..."/> </menu> <menu label="Ayuda" name="Help"> <menu_item_call label="Ayuda..." name="Help..."/> diff --git a/indra/newview/skins/default/xui/es/panel_tools_texture.xml b/indra/newview/skins/default/xui/es/panel_tools_texture.xml new file mode 100644 index 0000000000..7199905a1c --- /dev/null +++ b/indra/newview/skins/default/xui/es/panel_tools_texture.xml @@ -0,0 +1,116 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<panel label="Textura" name="Texture"> + <panel.string name="string repeats per meter"> + Repeticiones por metro + </panel.string> + <panel.string name="string repeats per face"> + Repeticiones por cara + </panel.string> + <text name="color label"> + Color + </text> + <color_swatch label="" name="colorswatch" tool_tip="Pulsa para abrir el selector de color"/> + <text name="color trans"> + Porcentaje de transparencia + </text> + <text name="glow label"> + Resplandor + </text> + <check_box label="Brillo total" name="checkbox fullbright"/> + <combo_box name="combobox matmedia"> + <combo_box.item label="Materiales" name="Materials"/> + <combo_box.item label="Media" name="Media"/> + </combo_box> + <combo_box name="combobox mattype"> + <combo_box.item label="Textura (difuminar)" name="Texture (diffuse)"/> + <combo_box.item label="Rugosidad (normal)" name="Bumpiness (normal)"/> + <combo_box.item label="Brillo (efecto espejo)" name="Shininess (specular)"/> + </combo_box> + <texture_picker label="Textura" name="texture control" tool_tip="Pulsa para elegir una imagen"/> + <text name="label alphamode"> + Modo alfa + </text> + <combo_box name="combobox alphamode"> + <combo_box.item label="Ninguno" name="None"/> + <combo_box.item label="Mezclado alfa" name="Alpha blending"/> + <combo_box.item label="Máscara alfa" name="Alpha masking"/> + <combo_box.item label="Máscara de emisión lumÃnica" name="Emissive mask"/> + </combo_box> + <text name="label maskcutoff"> + LÃmite de máscara + </text> + <texture_picker label="Textura" name="bumpytexture control" tool_tip="Pulsa para elegir una imagen"/> + <text name="label bumpiness"> + Rugosidad + </text> + <combo_box name="combobox bumpiness"> + <combo_box.item label="Ninguna" name="None"/> + <combo_box.item label="Claridad" name="Brightness"/> + <combo_box.item label="Oscuridad" name="Darkness"/> + <combo_box.item label="madera" name="woodgrain"/> + <combo_box.item label="corteza" name="bark"/> + <combo_box.item label="ladrillos" name="bricks"/> + <combo_box.item label="cuadrÃcula" name="checker"/> + <combo_box.item label="hormigón" name="concrete"/> + <combo_box.item label="azulejo" name="crustytile"/> + <combo_box.item label="piedralabrada" name="cutstone"/> + <combo_box.item label="discos" name="discs"/> + <combo_box.item label="gravilla" name="gravel"/> + <combo_box.item label="placadepetri" name="petridish"/> + <combo_box.item label="revestimiento" name="siding"/> + <combo_box.item label="baldosa" name="stonetile"/> + <combo_box.item label="estuco" name="stucco"/> + <combo_box.item label="succión" name="suction"/> + <combo_box.item label="tejido" name="weave"/> + </combo_box> + <texture_picker label="Textura" name="shinytexture control" tool_tip="Pulsa para elegir una imagen"/> + <text name="label shininess"> + Brillo + </text> + <combo_box name="combobox shininess"> + <combo_box.item label="Ninguno" name="None"/> + <combo_box.item label="Bajo" name="Low"/> + <combo_box.item label="Medio" name="Medium"/> + <combo_box.item label="Alto" name="High"/> + </combo_box> + <text name="label glossiness"> + Efecto pulido + </text> + <text name="label environment"> + Entorno + </text> + <text name="label shinycolor"> + Color + </text> + <color_swatch label="" name="shinycolorswatch" tool_tip="Pulsa para abrir el selector de color"/> + <text name="media_info"> + Espacio para la URL del media elegido, si procede + </text> + <button label="Elegir..." name="add_media" tool_tip="Añadir un media"/> + <button label="Eliminar" name="delete_media" tool_tip="Borrar esta textura para media"/> + <button label="Centrar" label_selected="Centrar los media" name="button align" tool_tip="Centrar esta textura para media (primero debe cargarse)"/> + <text name="tex gen"> + Representación + </text> + <combo_box name="combobox texgen"> + <combo_box.item label="Por defecto" name="Default"/> + <combo_box.item label="En el plano" name="Planar"/> + </combo_box> + <spinner label="Escala horizontal" name="TexScaleU"/> + <spinner label="Escala vertical" name="TexScaleV"/> + <spinner label="Repeticiones por metro" name="rptctrl"/> + <spinner label="Grados de rotación" name="TexRot"/> + <spinner label="Desplazamiento horizontal" name="TexOffsetU"/> + <spinner label="Desplazamiento vertical" name="TexOffsetV"/> + <spinner label="Escala horizontal" name="bumpyScaleU"/> + <spinner label="Escala vertical" name="bumpyScaleV"/> + <spinner label="Grados de rotación" name="bumpyRot"/> + <spinner label="Desplazamiento horizontal" name="bumpyOffsetU"/> + <spinner label="Desplazamiento vertical" name="bumpyOffsetV"/> + <spinner label="Escala horizontal" name="shinyScaleU"/> + <spinner label="Escala vertical" name="shinyScaleV"/> + <spinner label="Grados de rotación" name="shinyRot"/> + <spinner label="Desplazamiento horizontal" name="shinyOffsetU"/> + <spinner label="Desplazamiento vertical" name="shinyOffsetV"/> + <check_box initial_value="falso" label="Alinear caras del plano" name="checkbox planar align" tool_tip="Alinear texturas en todas las caras seleccionadas con la última cara seleccionada. Requiere la representación de texturas en el plano."/> +</panel> diff --git a/indra/newview/skins/default/xui/es/role_actions.xml b/indra/newview/skins/default/xui/es/role_actions.xml index 660293b02c..902ed4df52 100755 --- a/indra/newview/skins/default/xui/es/role_actions.xml +++ b/indra/newview/skins/default/xui/es/role_actions.xml @@ -25,7 +25,7 @@ </action_set> <action_set description="Estas capacidades incluyen poder cambiar el nombre de la parcela y su configuración, asà como si se muestra en Buscar y las opciones del punto de llegada y el de teleporte." name="Parcel Identity"> <action description="Cambiar 'Mostrar el sitio en Buscar' y configurar la categorÃa" longdescription="Cambia 'Mostrar el sitio en Buscar' y el configurar la categorÃa de una parcela en Acerca del terreno > pestaña Opciones." name="land find places" value="17"/> - <action description="Cambiar el nombre de la parcela, su descripción, y la configuración de 'Mostrar el sitio en Buscar'" longdescription="Cambia el nombre de la parcela, su descripción, y la configuración de 'Mostrar el sitio en Buscar'. Se hace en Acerca del terreno > pestaña Opciones." name="land change identity" value="18"/> + <action description="Cambia el nombre de la parcela, su descripción y la configuración de 'Contenido moderado'." longdescription="Cambia el nombre de la parcela, su descripción y la configuración de 'Contenido moderado'. Se hace en Acerca del terreno > pestaña Opciones." name="land change identity" value="18"/> <action description="Definir los puntos de llegada y teleporte" longdescription="En una parcela perteneciente al grupo, los miembros con un rol que tenga esta capacidad pueden precisar el punto de llegada o el de teleporte. Se hace en Acerca del terreno > pestaña Opciones." name="land set landing point" value="19"/> </action_set> <action_set description="Estas capacidades incluyen poderes que afectan a las opciones de la parcela, como 'Crear objetos', 'Editar el terreno' y las configuraciones de la música y los media." name="Parcel Settings"> diff --git a/indra/newview/skins/default/xui/es/strings.xml b/indra/newview/skins/default/xui/es/strings.xml index 937433e210..4686d1ed3a 100755 --- a/indra/newview/skins/default/xui/es/strings.xml +++ b/indra/newview/skins/default/xui/es/strings.xml @@ -130,6 +130,9 @@ <string name="create_account_url"> http://join.secondlife.com/?sourceid=[sourceid] </string> + <string name="ViewerDownloadURL"> + http://secondlife.com/download. + </string> <string name="LoginFailedViewerNotPermitted"> Ya no puedes acceder a Second Life con el visor que estás utilizando. Visita la siguiente página para descargar un nuevo visor: http://secondlife.com/download. @@ -439,6 +442,9 @@ Intenta iniciar sesión de nuevo en unos instantes. <string name="SLappAgentRequestFriend"> Petición de amistad </string> + <string name="SLappAgentRemoveFriend"> + Eliminación de amigos + </string> <string name="BUTTON_CLOSE_DARWIN"> Cerrar (⌘W) </string> @@ -823,6 +829,9 @@ Intenta iniciar sesión de nuevo en unos instantes. <string name="anim_yes_head"> Sà </string> + <string name="use_texture"> + Usar textura + </string> <string name="texture_loading"> Cargando... </string> @@ -919,6 +928,21 @@ Intenta iniciar sesión de nuevo en unos instantes. <string name="TeleportYourAgent"> Teleportarte </string> + <string name="JoinAnExperience"> + Únete a una experiencia + </string> + <string name="SilentlyManageEstateAccess"> + Suprimir alertas al gestionar las listas de acceso a un estado + </string> + <string name="OverrideYourAnimations"> + Reemplazar tus animaciones predeterminadas + </string> + <string name="ScriptReturnObjects"> + Devolver objetos en tu nombre + </string> + <string name="UnknownScriptPermission"> + (desconocido) + </string> <string name="SIM_ACCESS_PG"> General </string> @@ -1944,6 +1968,12 @@ Intenta iniciar sesión de nuevo en unos instantes. <string name="ATTACH_HUD_BOTTOM_RIGHT"> HUD: abajo der. </string> + <string name="ATTACH_NECK"> + Cuello + </string> + <string name="ATTACH_AVATAR_CENTER"> + Centro del avatar + </string> <string name="CursorPos"> LÃnea [LINE], Columna [COLUMN] </string> @@ -2931,6 +2961,9 @@ Si sigues recibiendo este mensaje, contacta con [SUPPORT_SITE]. <string name="Hip Width"> Cadera: ancho </string> + <string name="Hover"> + Pasa el cursor + </string> <string name="In"> Pegadas </string> @@ -4991,4 +5024,7 @@ Inténtalo incluyendo la ruta de acceso al editor entre comillas <string name="logging_calls_enabled_log_empty"> No hay conversaciones grabadas. Después de contactar con una persona, o de que alguien contacte contigo, aquà se mostrará una entrada de registro. </string> + <string name="loading_chat_logs"> + Cargando... + </string> </strings> diff --git a/indra/newview/skins/default/xui/fr/floater_about.xml b/indra/newview/skins/default/xui/fr/floater_about.xml index a659cb4245..384966354e 100755 --- a/indra/newview/skins/default/xui/fr/floater_about.xml +++ b/indra/newview/skins/default/xui/fr/floater_about.xml @@ -8,7 +8,9 @@ Compilé avec [COMPILER] version [COMPILER_VERSION] </floater.string> <floater.string name="AboutPosition"> - Vous êtes à [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1] dans [REGION], se trouvant à <nolink>[HOSTNAME]</nolink> ([HOSTIP]) + Vous êtes à [POSITION_LOCAL_0,number,1], [POSITION_LOCAL_1,number,1], [POSITION_LOCAL_2,number,1] dans [REGION], se trouvant à <nolink>[HOSTNAME]</nolink> ([HOSTIP]) +SLURL : <nolink>[SLURL]</nolink> +(coordonnées globales [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1]) [SERVER_VERSION] [SERVER_RELEASE_NOTES_URL] </floater.string> diff --git a/indra/newview/skins/default/xui/fr/floater_bulk_perms.xml b/indra/newview/skins/default/xui/fr/floater_bulk_perms.xml index ab68ce166b..7ee4441758 100755 --- a/indra/newview/skins/default/xui/fr/floater_bulk_perms.xml +++ b/indra/newview/skins/default/xui/fr/floater_bulk_perms.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="floaterbulkperms" title="MODIFIER LES DROITS"> +<floater name="floaterbulkperms" title="MODIFIER LES DROITS RELATIFS AU CONTENU"> <floater.string name="nothing_to_modify_text"> Certains contenus sont non modifiables. </floater.string> @@ -33,7 +33,7 @@ <button label="√ Tout" label_selected="Tout" name="check_all"/> <button label="Effacer" label_selected="Aucun" name="check_none"/> <text name="newperms"> - Nouveaux droits + Modifier les droits relatifs au contenu et remplacer par </text> <text name="GroupLabel"> Groupe : @@ -49,6 +49,7 @@ <check_box label="Modifier" name="next_owner_modify"/> <check_box label="Copier" name="next_owner_copy"/> <check_box initial_value="true" label="Transférer" name="next_owner_transfer" tool_tip="Le prochain propriétaire peut donner ou revendre cet objet"/> - <button label="OK" name="apply"/> + <button label="OK" name="ok"/> + <button label="Appliquer" name="apply"/> <button label="Annuler" name="close"/> </floater> diff --git a/indra/newview/skins/default/xui/fr/floater_goto_line.xml b/indra/newview/skins/default/xui/fr/floater_goto_line.xml new file mode 100644 index 0000000000..fdc800b40b --- /dev/null +++ b/indra/newview/skins/default/xui/fr/floater_goto_line.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="script goto" title="ALLER À LA LIGNE"> + <button label="OK" label_selected="OK" name="goto_btn"/> + <text name="txt"> + Aller à la ligne + </text> +</floater> diff --git a/indra/newview/skins/default/xui/fr/floater_im_session.xml b/indra/newview/skins/default/xui/fr/floater_im_session.xml index 8ab98b8e4e..6d98f0a846 100755 --- a/indra/newview/skins/default/xui/fr/floater_im_session.xml +++ b/indra/newview/skins/default/xui/fr/floater_im_session.xml @@ -34,13 +34,11 @@ <layout_panel name="body_panel"> <layout_stack name="im_panels"> <layout_panel name="right_part_holder"> - <panel name="trnsAndChat_panel"> - <layout_stack name="translate_and_chat_stack"> - <layout_panel name="translate_chat_checkbox_lp"> - <check_box label="Traduire le chat" name="translate_chat_checkbox"/> - </layout_panel> - </layout_stack> - </panel> + <layout_stack name="translate_and_chat_stack"> + <layout_panel name="translate_chat_checkbox_lp"> + <check_box label="Traduire le chat" name="translate_chat_checkbox"/> + </layout_panel> + </layout_stack> </layout_panel> </layout_stack> </layout_panel> diff --git a/indra/newview/skins/default/xui/fr/floater_pathfinding_console.xml b/indra/newview/skins/default/xui/fr/floater_pathfinding_console.xml index 0bcf55aba5..02d969dc08 100755 --- a/indra/newview/skins/default/xui/fr/floater_pathfinding_console.xml +++ b/indra/newview/skins/default/xui/fr/floater_pathfinding_console.xml @@ -71,7 +71,7 @@ <text name="show_label"> Afficher : </text> - <check_box label="Test" name="show_world"/> + <check_box label="Monde" name="show_world"/> <check_box label="Mobiles uniquement" name="show_world_movables_only"/> <check_box label="Maillage de navigation" name="show_navmesh"/> <text name="show_walkability_label"> diff --git a/indra/newview/skins/default/xui/fr/menu_attachment_other.xml b/indra/newview/skins/default/xui/fr/menu_attachment_other.xml index f48513eb2b..0450be28e0 100755 --- a/indra/newview/skins/default/xui/fr/menu_attachment_other.xml +++ b/indra/newview/skins/default/xui/fr/menu_attachment_other.xml @@ -11,7 +11,9 @@ <menu_item_call label="Figer" name="Freeze..."/> <menu_item_call label="Expulser" name="Eject..."/> <menu_item_call label="Déboguer les textures" name="Debug..."/> + <menu_item_call label="Dump XML" name="Dump XML"/> <menu_item_call label="Zoomer en avant" name="Zoom In"/> <menu_item_call label="Payer" name="Pay..."/> <menu_item_call label="Profil de l'objet" name="Object Inspect"/> + <menu_item_call label="Ignorer le propriétaire des particules" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/fr/menu_attachment_self.xml b/indra/newview/skins/default/xui/fr/menu_attachment_self.xml index 6af2064e44..f2e7928c24 100755 --- a/indra/newview/skins/default/xui/fr/menu_attachment_self.xml +++ b/indra/newview/skins/default/xui/fr/menu_attachment_self.xml @@ -12,5 +12,7 @@ <menu_item_call label="Mes groupes" name="Groups..."/> <menu_item_call label="Mon profil" name="Profile..."/> <menu_item_call label="Déboguer les textures" name="Debug..."/> + <menu_item_call label="Dump XML" name="Dump XML"/> <menu_item_call label="Lâcher" name="Drop"/> + <menu_item_call label="Ignorer le propriétaire des particules" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/fr/menu_avatar_other.xml b/indra/newview/skins/default/xui/fr/menu_avatar_other.xml index 08d1a20361..1f5c1724f8 100755 --- a/indra/newview/skins/default/xui/fr/menu_avatar_other.xml +++ b/indra/newview/skins/default/xui/fr/menu_avatar_other.xml @@ -11,6 +11,8 @@ <menu_item_call label="Figer" name="Freeze..."/> <menu_item_call label="Expulser" name="Eject..."/> <menu_item_call label="Déboguer les textures" name="Debug..."/> + <menu_item_call label="Dump XML" name="Dump XML"/> <menu_item_call label="Zoomer en avant" name="Zoom In"/> <menu_item_call label="Payer" name="Pay..."/> + <menu_item_call label="Ignorer le propriétaire des particules" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/fr/menu_avatar_self.xml b/indra/newview/skins/default/xui/fr/menu_avatar_self.xml index 6310a2177a..4815ad0676 100755 --- a/indra/newview/skins/default/xui/fr/menu_avatar_self.xml +++ b/indra/newview/skins/default/xui/fr/menu_avatar_self.xml @@ -29,4 +29,6 @@ <menu_item_call label="Mes groupes" name="Groups..."/> <menu_item_call label="Mon profil" name="Profile..."/> <menu_item_call label="Déboguer les textures" name="Debug..."/> + <menu_item_call label="Dump XML" name="Dump XML"/> + <menu_item_call label="Ignorer le propriétaire des particules" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/fr/menu_conversation.xml b/indra/newview/skins/default/xui/fr/menu_conversation.xml index 857ead603b..09109f4555 100644 --- a/indra/newview/skins/default/xui/fr/menu_conversation.xml +++ b/indra/newview/skins/default/xui/fr/menu_conversation.xml @@ -3,6 +3,7 @@ <menu_item_call label="Fermer la conversation" name="close_conversation"/> <menu_item_call label="Ouvrir une conversation vocale" name="open_voice_conversation"/> <menu_item_call label="Se déconnecter de la conversation et du canal vocal" name="disconnect_from_voice"/> + <menu_item_call label="Fermer la sélection" name="close_selected_conversations"/> <menu_item_call label="Voir le profil" name="view_profile"/> <menu_item_call label="IM" name="im"/> <menu_item_call label="Proposer une téléportation." name="offer_teleport"/> diff --git a/indra/newview/skins/default/xui/fr/menu_land.xml b/indra/newview/skins/default/xui/fr/menu_land.xml index b84daee3ae..7beaf00c58 100755 --- a/indra/newview/skins/default/xui/fr/menu_land.xml +++ b/indra/newview/skins/default/xui/fr/menu_land.xml @@ -6,4 +6,5 @@ <menu_item_call label="Acheter un pass" name="Land Buy Pass"/> <menu_item_call label="Construire" name="Create"/> <menu_item_call label="Modifier le terrain" name="Edit Terrain"/> + <menu_item_call label="Ignorer le propriétaire des particules" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/fr/menu_login.xml b/indra/newview/skins/default/xui/fr/menu_login.xml index dc6b2793ca..7b1e106474 100755 --- a/indra/newview/skins/default/xui/fr/menu_login.xml +++ b/indra/newview/skins/default/xui/fr/menu_login.xml @@ -18,7 +18,13 @@ <menu_item_call label="Afficher les conditions d'utilisation" name="TOS"/> <menu_item_call label="Afficher le message critique" name="Critical"/> <menu_item_call label="Test de débogage de la fenêtre flottante du contenu Web" name="Web Content Floater Debug Test"/> - <menu label="Définir le niveau de connexion" name="Set Logging Level"/> + <menu label="Définir le niveau de connexion" name="Set Logging Level"> + <menu_item_check label="Débogage" name="Debug"/> + <menu_item_check label="Infos" name="Info"/> + <menu_item_check label="Avertissement" name="Warning"/> + <menu_item_check label="Erreur" name="Error"/> + <menu_item_check label="Aucun" name="None"/> + </menu> <menu_item_check label="Afficher le sélecteur de grille" name="Show Grid Picker"/> <menu_item_call label="Afficher la console des notifications" name="Show Notifications Console"/> </menu> diff --git a/indra/newview/skins/default/xui/fr/menu_mute_particle.xml b/indra/newview/skins/default/xui/fr/menu_mute_particle.xml new file mode 100644 index 0000000000..5f5e4c8b08 --- /dev/null +++ b/indra/newview/skins/default/xui/fr/menu_mute_particle.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<!-- *NOTE: See also menu_attachment_other.xml --> +<context_menu name="Mute Particle Pie"> + <menu_item_call label="Ignorer le propriétaire des particules" name="Mute Particle"/> +</context_menu> diff --git a/indra/newview/skins/default/xui/fr/menu_object.xml b/indra/newview/skins/default/xui/fr/menu_object.xml index 573b6da582..d7b69e495a 100755 --- a/indra/newview/skins/default/xui/fr/menu_object.xml +++ b/indra/newview/skins/default/xui/fr/menu_object.xml @@ -5,13 +5,13 @@ </menu_item_call> <menu_item_call label="Modifier" name="Edit..."/> <menu_item_call label="Construire" name="Build"/> - <menu_item_call label="Voir parmi les groupes de liens" name="show_in_linksets"/> - <menu_item_call label="Voir parmi les personnages" name="show_in_characters"/> <menu_item_call label="Ouvrir" name="Open"/> <menu_item_call label="M'asseoir ici" name="Object Sit"/> <menu_item_call label="Me lever" name="Object Stand Up"/> <menu_item_call label="Profil de l'objet" name="Object Inspect"/> <menu_item_call label="Zoomer en avant" name="Zoom In"/> + <menu_item_call label="Voir parmi les groupes de liens" name="show_in_linksets"/> + <menu_item_call label="Voir parmi les personnages" name="show_in_characters"/> <context_menu label="Porter" name="Put On"> <menu_item_call label="Porter" name="Wear"/> <menu_item_call label="Ajouter" name="Add"/> @@ -28,4 +28,5 @@ <menu_item_call label="Payer" name="Pay..."/> <menu_item_call label="Acheter" name="Buy..."/> <menu_item_call label="Supprimer" name="Delete"/> + <menu_item_call label="Ignorer le propriétaire des particules" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/fr/menu_url_agent.xml b/indra/newview/skins/default/xui/fr/menu_url_agent.xml index d701b3a414..2c7443c6ca 100755 --- a/indra/newview/skins/default/xui/fr/menu_url_agent.xml +++ b/indra/newview/skins/default/xui/fr/menu_url_agent.xml @@ -3,6 +3,7 @@ <menu_item_call label="Voir le profil" name="show_agent"/> <menu_item_call label="Envoyer IM..." name="send_im"/> <menu_item_call label="Devenir amis..." name="add_friend"/> + <menu_item_call label="Supprimer cet ami..." name="remove_friend"/> <menu_item_call label="Copier le nom dans le presse-papiers" name="url_copy_label"/> <menu_item_call label="Copier la SLurl dans le presse-papiers" name="url_copy"/> </context_menu> diff --git a/indra/newview/skins/default/xui/fr/menu_url_objectim.xml b/indra/newview/skins/default/xui/fr/menu_url_objectim.xml index 0a934d3e69..5d745ef5f8 100755 --- a/indra/newview/skins/default/xui/fr/menu_url_objectim.xml +++ b/indra/newview/skins/default/xui/fr/menu_url_objectim.xml @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <context_menu name="Url Popup"> <menu_item_call label="Profil de l'objet…" name="show_object"/> + <menu_item_call label="Ignorer…" name="block_object"/> <menu_item_call label="Voir sur la carte" name="show_on_map"/> <menu_item_call label="Me téléporter à l'emplacement de l'objet" name="teleport_to_object"/> <menu_item_call label="Copier le nom de l'objet dans le presse-papiers" name="url_copy_label"/> diff --git a/indra/newview/skins/default/xui/fr/menu_viewer.xml b/indra/newview/skins/default/xui/fr/menu_viewer.xml index 548f144742..5d0026ace0 100755 --- a/indra/newview/skins/default/xui/fr/menu_viewer.xml +++ b/indra/newview/skins/default/xui/fr/menu_viewer.xml @@ -16,7 +16,10 @@ <menu_item_call label="Arrêter mon animation" name="Stop Animating My Avatar"/> <menu_item_call label="Marcher / Courir / Voler..." name="Walk / run / fly"/> </menu> - <menu label="Statut" name="Status"/> + <menu label="Statut" name="Status"> + <menu_item_check label="Absent" name="Away"/> + <menu_item_check label="Ne pas déranger" name="Do Not Disturb"/> + </menu> <menu_item_call label="Acheter des L$..." name="Buy and Sell L$"/> <menu_item_call label="Boîte d'envoi vendeur..." name="MerchantOutbox"/> <menu_item_call label="Page d'accueil du compte..." name="Manage My Account"> @@ -32,6 +35,7 @@ <menu_item_check label="Conversations..." name="Conversations"/> <menu_item_check label="Chat près de moi..." name="Nearby Chat"/> <menu_item_check label="Parler" name="Speak"/> + <menu_item_check label="Journal des conversations..." name="Conversation Log..."/> <menu label="Effet de voix" name="VoiceMorphing"> <menu_item_check label="Aucun effet de voix" name="NoVoiceMorphing"/> <menu_item_check label="Aperçu..." name="Preview"/> @@ -42,6 +46,7 @@ <menu_item_check label="Groupes" name="My Groups"/> <menu_item_check label="Personnes près de vous" name="Active Speakers"/> <menu_item_call label="Liste des ignorés" name="Block List"/> + <menu_item_check label="Ne pas déranger" name="Do Not Disturb"/> </menu> <menu label="Monde" name="World"> <menu_item_call label="Créer un repère pour ce lieu" name="Create Landmark Here"/> @@ -110,6 +115,7 @@ <menu_item_call label="Inclure la partie suivante" name="Include Next Part"/> <menu_item_call label="Inclure la partie précédente" name="Include Previous Part"/> </menu> + <menu_item_call label="Groupes de liens..." name="pathfinding_linkset_menu_item"/> <menu_item_call label="Point central sur la sélection" name="Focus on Selection"/> <menu_item_call label="Zoomer sur la sélection" name="Zoom to Selection"/> <menu label="Objet" name="Object"> @@ -279,6 +285,7 @@ <menu_item_check label="Taux de défilement aléatoire" name="Randomize Framerate"/> <menu_item_check label="Cadre lent périodique" name="Periodic Slow Frame"/> <menu_item_check label="Test cadre" name="Frame Test"/> + <menu_item_call label="Profil du cadre" name="Frame Profile"/> </menu> <menu label="Métadonnées de rendu" name="Render Metadata"> <menu_item_check label="Cadres" name="Bounding Boxes"/> @@ -313,9 +320,10 @@ <menu_item_check label="Axes" name="Axes"/> <menu_item_check label="Tangente" name="Tangent Basis"/> <menu_item_call label="Base des infos de la texture sélectionnée" name="Selected Texture Info Basis"/> + <menu_item_call label="Infos sur les matériaux sélectionnés" name="Selected Material Info"/> <menu_item_check label="Filaire" name="Wireframe"/> <menu_item_check label="Occlusion objet-objet" name="Object-Object Occlusion"/> - <menu_item_check label="Éclairage et ombres" name="Advanced Lighting Model"/> + <menu_item_check label="Modèle d'éclairage avancé" name="Advanced Lighting Model"/> <menu_item_check label="Ombres du soleil/de la lune/des projecteurs" name="Shadows from Sun/Moon/Projectors"/> <menu_item_check label="SSAO et lissage des ombres" name="SSAO and Shadow Smoothing"/> <menu_item_check label="Débogage GL" name="Debug GL"/> @@ -325,7 +333,6 @@ <menu_item_check label="Textures d'animation" name="Animation Textures"/> <menu_item_check label="Désactiver les textures" name="Disable Textures"/> <menu_item_check label="Textures pleine résolution" name="Rull Res Textures"/> - <menu_item_check label="Atlas des textures (expérimental)" name="Texture Atlas"/> <menu_item_check label="Rendu des lumières jointes" name="Render Attached Lights"/> <menu_item_check label="Rendu des particules jointes" name="Render Attached Particles"/> <menu_item_check label="Objets en surbrillance avec le pointeur" name="Hover Glow Objects"/> @@ -361,7 +368,6 @@ <menu_item_call label="Dump Focus Holder" name="Dump Focus Holder"/> <menu_item_call label="Imprimer les infos sur l'objet sélectionné" name="Print Selected Object Info"/> <menu_item_call label="Imprimer les infos sur l'avatar" name="Print Agent Info"/> - <menu_item_call label="Statistiques de mémoire" name="Memory Stats"/> <menu_item_check label="Console de débogage de région" name="Region Debug Console"/> <menu_item_check label="Débogage SelectMgr" name="Debug SelectMgr"/> <menu_item_check label="Débogage clics" name="Debug Clicks"/> diff --git a/indra/newview/skins/default/xui/fr/notifications.xml b/indra/newview/skins/default/xui/fr/notifications.xml index e73cc6e6e0..c295a6f5a7 100755 --- a/indra/newview/skins/default/xui/fr/notifications.xml +++ b/indra/newview/skins/default/xui/fr/notifications.xml @@ -209,6 +209,14 @@ Ajouter ce pouvoir à « [ROLE_NAME] » ? Ajouter ce pouvoir à « [ROLE_NAME] » ? <usetemplate name="okcancelbuttons" notext="Non" yestext="Oui"/> </notification> + <notification name="EjectGroupMemberWarning"> + Vous allez expulser [AVATAR_NAME] du groupe. + <usetemplate ignoretext="Confirmer l'expulsion d'un membre du groupe" name="okcancelignore" notext="Annuler" yestext="Expulser"/> + </notification> + <notification name="EjectGroupMembersWarning"> + Vous allez expulser [COUNT] membres du groupe. + <usetemplate ignoretext="Confirmer l'expulsion de plusieurs membres du groupe" name="okcancelignore" notext="Annuler" yestext="Expulser"/> + </notification> <notification name="AttachmentDrop"> Vous êtes sur le point d'abandonner l'élément joint. Voulez-vous vraiment continuer ? @@ -1106,7 +1114,7 @@ Voir https://wiki.secondlife.com/wiki/Adding_Spelling_Dictionaries Veuillez saisir un montant plus élevé. </notification> <notification name="ConfirmItemDeleteHasLinks"> - Des articles liés pointent vers au moins un article sélectionné. Les liens arrêteront définitivement de fonctionner si vous supprimez cet article. Il est vivement conseillé de supprimer d'abord ces liens. + Des liens pointent vers au moins un article sélectionné. Les liens arrêteront définitivement de fonctionner si vous supprimez cet article. Il est vivement conseillé de supprimer d'abord ces liens. Voulez-vous vraiment supprimer ces articles ? <usetemplate name="okcancelbuttons" notext="Annuler" yestext="OK"/> @@ -1126,7 +1134,7 @@ Voulez-vous vraiment supprimer ces articles ? <notification name="ConfirmObjectDeleteNoOwn"> Au moins un des objets que vous avez sélectionnés ne vous appartient pas. -Êtes-vous certain de vouloir supprimer ces objets ? +Voulez-vous vraiment supprimer ces articles ? <usetemplate name="okcancelbuttons" notext="Annuler" yestext="OK"/> </notification> <notification name="ConfirmObjectDeleteLockNoCopy"> @@ -1140,23 +1148,23 @@ Au moins un des objets n'est pas copiable. Au moins un des objets est verrouillé. Au moins un des objets ne vous appartient pas. -Êtes-vous certain de vouloir supprimer ces objets ? +Voulez-vous vraiment supprimer ces articles ? <usetemplate name="okcancelbuttons" notext="Annuler" yestext="OK"/> </notification> <notification name="ConfirmObjectDeleteNoCopyNoOwn"> - Au moins un des objets n'est pas copiable. + Au moins un des objets n'est pas reproductible. Au moins un des objets ne vous appartient pas. -Êtes-vous certain de vouloir supprimer ces objets ? +Voulez-vous vraiment supprimer ces articles ? <usetemplate name="okcancelbuttons" notext="Annuler" yestext="OK"/> </notification> <notification name="ConfirmObjectDeleteLockNoCopyNoOwn"> Au moins un des objets est verrouillé. -Au moins un des objets n'est pas copiable. +Au moins un des objets n'est pas reproductible. Au moins un des objets ne vous appartient pas. -Êtes-vous certain de vouloir supprimer ces objets ? - <usetemplate name="okcancelbuttons" notext="annuler" yestext="OK"/> +Voulez-vous vraiment supprimer ces articles ? + <usetemplate name="okcancelbuttons" notext="Annuler" yestext="OK"/> </notification> <notification name="ConfirmObjectTakeLock"> Au moins un des objets est verrouillé. @@ -1477,13 +1485,43 @@ Version [VERSION] [[RELEASE_NOTES_FULL_URL] Informations relatives à cette mise </notification> <notification name="RequiredUpdateDownloadedVerboseDialog"> Nous avons téléchargé une mise à jour logicielle requise. -Version [VERSION] +Version [VERSION] [Informations au sujet de cette mise à jour [INFO_URL]] [APP_NAME] doit être redémarré pour que la mise à jour soit installée. <usetemplate name="okbutton" yestext="OK"/> </notification> <notification name="RequiredUpdateDownloadedDialog"> [APP_NAME] doit être redémarré pour que la mise à jour soit installée. +[Informations au sujet de cette mise à jour [INFO_URL]] + <usetemplate name="okbutton" yestext="OK"/> + </notification> + <notification name="OtherChannelDownloadBackgroundTip"> + Nous avons téléchargé une mise à jour de votre installation [APP_NAME]. +Version [VERSION] +Le client expérimental a été remplacé par un nouveau client [NEW_CHANNEL] ; +consultez [[INFO_URL] pour en savoir plus sur cette mise à jour] + <usetemplate name="okcancelbuttons" notext="Ultérieurement..." yestext="Installer maintenant et redémarrer [APP_NAME]"/> + </notification> + <notification name="OtherChannelDownloadBackgroundDialog"> + Nous avons téléchargé une mise à jour de votre installation [APP_NAME]. +Version [VERSION] +Le client expérimental a été remplacé par un nouveau client [NEW_CHANNEL] ; +consultez [Informations au sujet de cette mise à jour [INFO_URL]] + <usetemplate name="okcancelbuttons" notext="Ultérieurement..." yestext="Installer maintenant et redémarrer [APP_NAME]"/> + </notification> + <notification name="OtherChannelRequiredUpdateDownloadedVerboseDialog"> + Nous avons téléchargé une mise à jour logicielle requise. +Version [VERSION] +Le client expérimental a été remplacé par un nouveau client [NEW_CHANNEL] ; +consultez [Informations au sujet de cette mise à jour [INFO_URL]] + +[APP_NAME] doit être redémarré pour que la mise à jour soit installée. + <usetemplate name="okbutton" yestext="OK"/> + </notification> + <notification name="OtherChannelRequiredUpdateDownloadedDialog"> + [APP_NAME] doit être redémarré pour que la mise à jour soit installée. +Le client expérimental a été remplacé par un nouveau client [NEW_CHANNEL] ; +consultez [Informations au sujet de cette mise à jour [INFO_URL]] <usetemplate name="okbutton" yestext="OK"/> </notification> <notification name="DeedObjectToGroup"> @@ -1534,6 +1572,10 @@ Version [VERSION] Quitter le groupe ? <usetemplate name="okcancelbuttons" notext="Annuler" yestext="OK"/> </notification> + <notification name="OwnerCannotLeaveGroup"> + Impossible de quitter le groupe. Vous ne pouvez pas quitter le groupe car vous en êtes le dernier propriétaire. Vous devez d'abord affecter le rôle de propriétaire à un autre membre. + <usetemplate name="okbutton" yestext="OK"/> + </notification> <notification name="ConfirmKick"> Souhaitez-vous vraiment éjecter tous les résidents de la grille ? <usetemplate name="okcancelbuttons" notext="Annuler" yestext="Éjecter tous les résidents"/> @@ -2396,9 +2438,7 @@ Veuillez sélectionner un seul objet. choisir Téléportation). </notification> <notification name="TeleportToPerson"> - Pour contacter un résident tel que [NAME], cliquez sur le bouton Personnes, sélectionnez le résident dans la fenêtre qui s'ouvre, puis cliquez sur IM en - bas de la fenêtre. - (Vous pouvez aussi double-cliquer sur le nom du résident dans la liste ou cliquer-droit dessus et choisir IM.) + Pour ouvrir une conversation privée avec une autre personne, cliquez-droit sur son avatar et choisissez IM dans le menu. </notification> <notification name="CantSelectLandFromMultipleRegions"> Vous ne pouvez pas sélectionner de terrain en dehors des limites du serveur. @@ -2772,6 +2812,15 @@ N'autorisez pas cet accès si vous ne comprenez pas entièrement pourquoi l <button name="Deny" text="Refuser"/> </form> </notification> + <notification name="UnknownScriptQuestion"> + Le client ne reconnaît pas le droit de script à l'exécution demandé par <nolink>[OBJECTNAME]</nolink>, objet appartenant à [NAME], et ne peut donc pas l'accorder. + +Pour accorder ce droit, mettez votre client à jour pour passer à la version la plus récente, à partir de [DOWNLOADURL]. + <form name="form"> + <button name="Deny" text="OK"/> + <button name="Mute" text="Ignorer"/> + </form> + </notification> <notification name="ScriptDialog"> <nolink>[TITLE]</nolink> de [NAME] [MESSAGE] diff --git a/indra/newview/skins/default/xui/fr/panel_people.xml b/indra/newview/skins/default/xui/fr/panel_people.xml index 227ce26df7..e306a00183 100755 --- a/indra/newview/skins/default/xui/fr/panel_people.xml +++ b/indra/newview/skins/default/xui/fr/panel_people.xml @@ -49,6 +49,9 @@ Pour rechercher des résidents avec qui passer du temps, utilisez [secondlife:// <menu_button name="plus_btn" tool_tip="Rejoindre/créer un nouveau groupe"/> <dnd_button name="minus_btn" tool_tip="Quitter le groupe sélectionné"/> </panel> + <text name="groupcount"> + Vous appartenez à [COUNT] groupes, et pouvez en rejoindre [REMAINING] autres. + </text> </panel> <panel label="RÉCENT" name="recent_panel"> <panel label="bottom_panel" name="recent_buttons_panel"> diff --git a/indra/newview/skins/default/xui/fr/panel_preferences_chat.xml b/indra/newview/skins/default/xui/fr/panel_preferences_chat.xml index 972190dc15..52c6ed24b9 100755 --- a/indra/newview/skins/default/xui/fr/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/fr/panel_preferences_chat.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <panel label="Chat écrit" name="chat"> - <panel> + <panel name="general_chat_settings"> <check_box initial_value="true" label="Exécuter l'animation clavier quand vous écrivez" name="play_typing_animation"/> <check_box label="M'envoyer les IM par e-mail une fois déconnecté" name="send_im_to_email"/> <check_box label="Seuls mes amis et groupes peuvent m'appeler ou m'envoyer un IM" name="voice_call_friends_only_check"/> @@ -14,60 +14,72 @@ </combo_box> <check_box label="Bulles de chat" name="bubble_text_chat"/> </panel> - <panel> - <text name="notifications"> - Notifications - </text> + <panel name="im_notification_settings"> <text name="friend_ims"> IM amis : </text> <combo_box name="FriendIMOptions"> <item label="Ouvrir la fenêtre Conversation" name="OpenConversationsWindow" value="openconversations"/> <item label="Afficher le message dans une fenêtre popup" name="PopUpMessage" value="toast"/> - <item label="Bouton de la barre d'outils Flash" name="FlashToolbarButton" value="clignote"/> - <item label="Aucun(e)" name="None" value="aucun(e)"/> + <item label="Bouton de la barre d'outils Flash" name="FlashToolbarButton" value="flash"/> + <item label="Aucune action" name="NoAction" value="noaction"/> </combo_box> + <check_box label="Écouter le son" name="play_sound_friend_im"/> <text name="non_friend_ims"> IM non amis : </text> <combo_box name="NonFriendIMOptions"> <item label="Ouvrir la fenêtre Conversation" name="OpenConversationsWindow" value="openconversations"/> <item label="Afficher le message dans une fenêtre popup" name="PopUpMessage" value="toast"/> - <item label="Bouton de la barre d'outils Flash" name="FlashToolbarButton" value="clignote"/> - <item label="Aucun(e)" name="None" value="aucun(e)"/> + <item label="Bouton de la barre d'outils Flash" name="FlashToolbarButton" value="flash"/> + <item label="Aucune action" name="NoAction" value="noaction"/> </combo_box> + <check_box label="Écouter le son" name="play_sound_non_friend_im"/> <text name="conference_ims"> IM conférence : </text> <combo_box name="ConferenceIMOptions"> <item label="Ouvrir la fenêtre Conversation" name="OpenConversationsWindow" value="openconversations"/> <item label="Afficher le message dans une fenêtre popup" name="PopUpMessage" value="toast"/> - <item label="Bouton de la barre d'outils Flash" name="FlashToolbarButton" value="clignote"/> - <item label="Aucun(e)" name="None" value="aucun(e)"/> + <item label="Bouton de la barre d'outils Flash" name="FlashToolbarButton" value="flash"/> + <item label="Aucune action" name="NoAction" value="noaction"/> </combo_box> + <check_box label="Écouter le son" name="play_sound_conference_im"/> <text name="group_chat"> Chat de groupe : </text> <combo_box name="GroupChatOptions"> <item label="Ouvrir la fenêtre Conversation" name="OpenConversationsWindow" value="openconversations"/> <item label="Afficher le message dans une fenêtre popup" name="PopUpMessage" value="toast"/> - <item label="Bouton de la barre d'outils Flash" name="FlashToolbarButton" value="clignote"/> - <item label="Aucun(e)" name="None" value="aucun(e)"/> + <item label="Bouton de la barre d'outils Flash" name="FlashToolbarButton" value="flash"/> + <item label="Aucune action" name="NoAction" value="noaction"/> </combo_box> + <check_box label="Écouter le son" name="play_sound_group_chat_im"/> <text name="nearby_chat"> Chat près de moi : </text> <combo_box name="NearbyChatOptions"> <item label="Ouvrir la fenêtre Conversation" name="OpenConversationsWindow" value="openconversations"/> <item label="Afficher le message dans une fenêtre popup" name="PopUpMessage" value="toast"/> - <item label="Bouton de la barre d'outils Flash" name="FlashToolBarButton" value="clignote"/> - <item label="Aucun(e)" name="None" value="aucun(e)"/> + <item label="Bouton de la barre d'outils Flash" name="FlashToolBarButton" value="flash"/> + <item label="Aucune action" name="NoAction" value="noaction"/> + </combo_box> + <check_box label="Écouter le son" name="play_sound_nearby_chat_im"/> + <text name="object_ims"> + IM objet : + </text> + <combo_box name="ObjectIMOptions"> + <item label="Ouvrir la fenêtre Conversation" name="OpenConversationsWindow" value="openconversations"/> + <item label="Afficher le message dans une fenêtre popup" name="PopUpMessage" value="toast"/> + <item label="Bouton de la barre d'outils Flash" name="FlashToolBarButton" value="flash"/> + <item label="Aucune action" name="NoAction" value="noaction"/> </combo_box> + <check_box label="Écouter le son" name="play_sound_object_im"/> <text name="notifications_alert"> Pour suspendre temporairement toutes les notifications, utilisez Communication > Ne pas déranger. </text> </panel> - <panel> + <panel name="play_sound_settings"> <text name="play_sound"> Écouter le son : </text> @@ -76,7 +88,7 @@ <check_box label="Offre de téléportation" name="teleport_offer"/> <check_box label="Offre d'inventaire" name="inventory_offer"/> </panel> - <panel> + <panel name="log_settings"> <button label="Effacer le journal..." name="clear_log"/> <button label="Supprimer les transcriptions..." name="delete_transcripts"/> <button label="Parcourir..." label_selected="Parcourir" name="log_path_button"/> diff --git a/indra/newview/skins/default/xui/fr/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/fr/panel_preferences_graphics1.xml index a738b2d43f..4946b09814 100755 --- a/indra/newview/skins/default/xui/fr/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/fr/panel_preferences_graphics1.xml @@ -30,7 +30,7 @@ <check_box initial_value="true" label="Lumières locales" name="LocalLights"/> <check_box initial_value="true" label="Effets de base" name="BasicShaders" tool_tip="La désactivation de cette option peut éviter le plantage de certains pilotes de cartes graphiques"/> <check_box initial_value="true" label="Effets atmosphériques" name="WindLightUseAtmosShaders"/> - <check_box initial_value="true" label="Éclairage et ombres" name="UseLightShaders"/> + <check_box initial_value="true" label="Modèle d'éclairage avancé" name="UseLightShaders"/> <check_box initial_value="true" label="Occlusion ambiante" name="UseSSAO"/> <check_box initial_value="true" label="Profondeur de champ" name="UseDoF"/> <text name="shadows_label"> diff --git a/indra/newview/skins/default/xui/fr/panel_preferences_setup.xml b/indra/newview/skins/default/xui/fr/panel_preferences_setup.xml index 83303950dc..50f4a49bd0 100755 --- a/indra/newview/skins/default/xui/fr/panel_preferences_setup.xml +++ b/indra/newview/skins/default/xui/fr/panel_preferences_setup.xml @@ -29,6 +29,7 @@ <combo_box.item label="Installation automatique" name="Install_automatically"/> <combo_box.item label="Téléchargement et installation manuels" name="Install_manual"/> </combo_box> + <check_box label="Accepte de passer aux versions avant sortie officielle" name="update_willing_to_test"/> <text name="Proxy Settings:"> Paramètres de proxy : </text> diff --git a/indra/newview/skins/default/xui/fr/panel_script_ed.xml b/indra/newview/skins/default/xui/fr/panel_script_ed.xml index 29fbe3c7e7..38e5cbe1f1 100755 --- a/indra/newview/skins/default/xui/fr/panel_script_ed.xml +++ b/indra/newview/skins/default/xui/fr/panel_script_ed.xml @@ -34,6 +34,7 @@ <menu_item_call label="Tout sélectionner" name="Select All"/> <menu_item_call label="Désélectionner" name="Deselect"/> <menu_item_call label="Rechercher / Remplacer..." name="Search / Replace..."/> + <menu_item_call label="Aller à la ligne..." name="Go to line..."/> </menu> <menu label="Aide" name="Help"> <menu_item_call label="Aide..." name="Help..."/> diff --git a/indra/newview/skins/default/xui/fr/panel_tools_texture.xml b/indra/newview/skins/default/xui/fr/panel_tools_texture.xml new file mode 100644 index 0000000000..c69cb61a92 --- /dev/null +++ b/indra/newview/skins/default/xui/fr/panel_tools_texture.xml @@ -0,0 +1,116 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<panel label="Texture" name="Texture"> + <panel.string name="string repeats per meter"> + Répétitions au mètre + </panel.string> + <panel.string name="string repeats per face"> + Répétitions par face + </panel.string> + <text name="color label"> + Couleur + </text> + <color_swatch label="" name="colorswatch" tool_tip="Cliquez pour ouvrir le sélecteur de couleurs"/> + <text name="color trans"> + % de transparence + </text> + <text name="glow label"> + Rayonnement + </text> + <check_box label="Lumineux" name="checkbox fullbright"/> + <combo_box name="combobox matmedia"> + <combo_box.item label="Matériaux" name="Materials"/> + <combo_box.item label="Médias" name="Media"/> + </combo_box> + <combo_box name="combobox mattype"> + <combo_box.item label="Texture (diffuse)" name="Texture (diffuse)"/> + <combo_box.item label="Relief (normal)" name="Bumpiness (normal)"/> + <combo_box.item label="Brillance (spéculaire)" name="Shininess (specular)"/> + </combo_box> + <texture_picker label="Texture" name="texture control" tool_tip="Cliquer pour sélectionner une image."/> + <text name="label alphamode"> + Mode alpha + </text> + <combo_box name="combobox alphamode"> + <combo_box.item label="Aucun" name="None"/> + <combo_box.item label="Fusion alpha" name="Alpha blending"/> + <combo_box.item label="Masquage alpha" name="Alpha masking"/> + <combo_box.item label="Masque émissif" name="Emissive mask"/> + </combo_box> + <text name="label maskcutoff"> + Coupe du masque + </text> + <texture_picker label="Texture" name="bumpytexture control" tool_tip="Cliquer pour sélectionner une image."/> + <text name="label bumpiness"> + Relief + </text> + <combo_box name="combobox bumpiness"> + <combo_box.item label="Aucun" name="None"/> + <combo_box.item label="Luminosité" name="Brightness"/> + <combo_box.item label="Obscurité" name="Darkness"/> + <combo_box.item label="aggloméré" name="woodgrain"/> + <combo_box.item label="écorce" name="bark"/> + <combo_box.item label="briques" name="bricks"/> + <combo_box.item label="damier" name="checker"/> + <combo_box.item label="béton" name="concrete"/> + <combo_box.item label="carrelage" name="crustytile"/> + <combo_box.item label="pierre de taille" name="cutstone"/> + <combo_box.item label="disques" name="discs"/> + <combo_box.item label="gravier" name="gravel"/> + <combo_box.item label="boîte de Petri" name="petridish"/> + <combo_box.item label="lattes" name="siding"/> + <combo_box.item label="carreaux" name="stonetile"/> + <combo_box.item label="stuc" name="stucco"/> + <combo_box.item label="ventouses" name="suction"/> + <combo_box.item label="tissage" name="weave"/> + </combo_box> + <texture_picker label="Texture" name="shinytexture control" tool_tip="Cliquer pour sélectionner une image."/> + <text name="label shininess"> + Brillance + </text> + <combo_box name="combobox shininess"> + <combo_box.item label="Aucune" name="None"/> + <combo_box.item label="Faible" name="Low"/> + <combo_box.item label="Moyenne" name="Medium"/> + <combo_box.item label="Élevée" name="High"/> + </combo_box> + <text name="label glossiness"> + Lustrage + </text> + <text name="label environment"> + Environnement + </text> + <text name="label shinycolor"> + Couleur + </text> + <color_swatch label="" name="shinycolorswatch" tool_tip="Cliquez pour ouvrir le sélecteur de couleurs"/> + <text name="media_info"> + L'URL du média choisi, le cas échéant, se place ici. + </text> + <button label="Choisir..." name="add_media" tool_tip="Ajouter un média"/> + <button label="Supprimer" name="delete_media" tool_tip="Supprimer cette texture de média"/> + <button label="Aligner" label_selected="Aligner le média" name="button align" tool_tip="Ajuster la texture du média (le chargement doit d’abord se terminer)"/> + <text name="tex gen"> + Application + </text> + <combo_box name="combobox texgen"> + <combo_box.item label="Valeur par défaut" name="Default"/> + <combo_box.item label="Plan" name="Planar"/> + </combo_box> + <spinner label="Échelle horizontale" name="TexScaleU"/> + <spinner label="Échelle verticale" name="TexScaleV"/> + <spinner label="Répétitions au mètre" name="rptctrl"/> + <spinner label="Degrés de rotation" name="TexRot"/> + <spinner label="Décalage horizontal" name="TexOffsetU"/> + <spinner label="Décalage vertical" name="TexOffsetV"/> + <spinner label="Échelle horizontale" name="bumpyScaleU"/> + <spinner label="Échelle verticale" name="bumpyScaleV"/> + <spinner label="Degrés de rotation" name="bumpyRot"/> + <spinner label="Décalage horizontal" name="bumpyOffsetU"/> + <spinner label="Décalage vertical" name="bumpyOffsetV"/> + <spinner label="Échelle horizontale" name="shinyScaleU"/> + <spinner label="Échelle verticale" name="shinyScaleV"/> + <spinner label="Degrés de rotation" name="shinyRot"/> + <spinner label="Décalage horizontal" name="shinyOffsetU"/> + <spinner label="Décalage vertical" name="shinyOffsetV"/> + <check_box initial_value="false" label="Aligner les faces Plan" name="checkbox planar align" tool_tip="Aligner les textures sur toutes les faces sélectionnées avec la dernière face sélectionnée. Application de la texture Plan requise."/> +</panel> diff --git a/indra/newview/skins/default/xui/fr/role_actions.xml b/indra/newview/skins/default/xui/fr/role_actions.xml index 7187de8760..2a68ca0ddb 100755 --- a/indra/newview/skins/default/xui/fr/role_actions.xml +++ b/indra/newview/skins/default/xui/fr/role_actions.xml @@ -25,7 +25,7 @@ </action_set> <action_set description="Ces pouvoirs permettent de modifier le nom de la parcelle, son référencement dans la recherche et le lieu de téléportation." name="Parcel Identity"> <action description="Activer Afficher le lieu dans la recherche et définir la catégorie" longdescription="Activez Afficher le lieu dans la recherche et définissez la catégorie d'une parcelle dans l'onglet À propos du terrain > Options." name="land find places" value="17"/> - <action description="Modifier le nom et la description de la parcelle, ainsi que les paramètres d'affichage du lieu dans la recherche" longdescription="Modifiez le nom et la description de la parcelle, ainsi que les paramètres d'affichage du lieu dans la recherche. Pour ce faire, utilisez l'onglet À propos du terrain > Options." name="land change identity" value="18"/> + <action description="Changer le nom de la parcelle, la description et les paramètres de contenu modéré" longdescription="Changez le nom de la parcelle, la description et les paramètres de contenu modéré. Pour ce faire, utilisez l'onglet À propos du terrain > Options." name="land change identity" value="18"/> <action description="Définir le lieu d'arrivée et le routage des téléportations" longdescription="Définissez le lieu d'arrivée des téléportations et le routage à partir du menu À propos du terrain > Options." name="land set landing point" value="19"/> </action_set> <action_set description="Ces pouvoirs permettent de définir les options de la parcelle concernant la musique, les médias, la création d'objets et le relief." name="Parcel Settings"> diff --git a/indra/newview/skins/default/xui/fr/strings.xml b/indra/newview/skins/default/xui/fr/strings.xml index 69ed20f376..346fa62351 100755 --- a/indra/newview/skins/default/xui/fr/strings.xml +++ b/indra/newview/skins/default/xui/fr/strings.xml @@ -139,6 +139,9 @@ <string name="create_account_url"> http://join.secondlife.com/?sourceid=[sourceid] </string> + <string name="ViewerDownloadURL"> + http://secondlife.com/download + </string> <string name="LoginFailedViewerNotPermitted"> Le client que vous utilisez ne permet plus d'accéder à Second Life. Téléchargez un nouveau client à la page suivante : http://secondlife.com/download @@ -448,6 +451,9 @@ Veuillez réessayer de vous connecter dans une minute. <string name="SLappAgentRequestFriend"> Demande d'amitié </string> + <string name="SLappAgentRemoveFriend"> + Suppression d'un ami + </string> <string name="BUTTON_CLOSE_DARWIN"> Fermer (⌘W) </string> @@ -838,6 +844,9 @@ Veuillez réessayer de vous connecter dans une minute. <string name="multiple_textures"> Multiples </string> + <string name="use_texture"> + Utiliser la texture + </string> <string name="texture_loading"> Chargement... </string> @@ -937,6 +946,21 @@ Veuillez réessayer de vous connecter dans une minute. <string name="TeleportYourAgent"> Vous téléporter </string> + <string name="JoinAnExperience"> + Rejoindre une expérience + </string> + <string name="SilentlyManageEstateAccess"> + Supprimer les alertes lors de la gestion des listes d'accès aux domaines + </string> + <string name="OverrideYourAnimations"> + Remplacer vos animations par défaut + </string> + <string name="ScriptReturnObjects"> + Renvoyer les objets de votre part + </string> + <string name="UnknownScriptPermission"> + (inconnu) + </string> <string name="SIM_ACCESS_PG"> Général </string> @@ -1968,6 +1992,12 @@ Veuillez réessayer de vous connecter dans une minute. <string name="ATTACH_HUD_BOTTOM_RIGHT"> HUD en bas à droite </string> + <string name="ATTACH_NECK"> + Cou + </string> + <string name="ATTACH_AVATAR_CENTER"> + Centre de l'avatar + </string> <string name="CursorPos"> Ligne [LINE], colonne [COLUMN] </string> @@ -2997,6 +3027,9 @@ Si ce message persiste, veuillez aller sur la page [SUPPORT_SITE]. <string name="Hip Width"> Largeur hanche </string> + <string name="Hover"> + Survol + </string> <string name="In"> Rentré </string> @@ -5081,4 +5114,7 @@ Essayez avec le chemin d'accès à l'éditeur entre guillemets doubles <string name="logging_calls_enabled_log_empty"> Il n'y a aucune conversation enregistrée. Quand quelqu'un vous contacte ou quand vous contactez quelqu'un, une entrée de journal s'affiche ici. </string> + <string name="loading_chat_logs"> + Chargement... + </string> </strings> diff --git a/indra/newview/skins/default/xui/it/floater_about.xml b/indra/newview/skins/default/xui/it/floater_about.xml index c672511fc5..6f09eca90c 100755 --- a/indra/newview/skins/default/xui/it/floater_about.xml +++ b/indra/newview/skins/default/xui/it/floater_about.xml @@ -8,7 +8,9 @@ Generato con [COMPILER] versione [COMPILER_VERSION] </floater.string> <floater.string name="AboutPosition"> - Tu sei [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1] in [REGION] che si trova a <nolink>[HOSTNAME]</nolink> ([HOSTIP]) + Tu sei a [POSITION_LOCAL_0,number,1], [POSITION_LOCAL_1,number,1], [POSITION_LOCAL_2,number,1] in [REGION] che si trova a <nolink>[HOSTNAME]</nolink> ([HOSTIP]) +SLURL: <nolink>[SLURL]</nolink> +(coordinate globali [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1]) [SERVER_VERSION] [SERVER_RELEASE_NOTES_URL] </floater.string> diff --git a/indra/newview/skins/default/xui/it/floater_bulk_perms.xml b/indra/newview/skins/default/xui/it/floater_bulk_perms.xml index 89f4a0cb71..399eb15802 100755 --- a/indra/newview/skins/default/xui/it/floater_bulk_perms.xml +++ b/indra/newview/skins/default/xui/it/floater_bulk_perms.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="floaterbulkperms" title="MODIFICA PERMESSI DEL CONTENUTO"> +<floater name="floaterbulkperms" title="CAMBIA I PERMESSI DEL CONTENUTO"> <floater.string name="nothing_to_modify_text"> La selezione non contiene nessun contenuto modificabile. </floater.string> @@ -33,7 +33,7 @@ <button label="√ Tutti" label_selected="Tutti" name="check_all"/> <button label="Cancella" label_selected="Nessuno" name="check_none"/> <text name="newperms"> - Nuovi permessi del contenuto + Cambia i permessi del contenuto a </text> <text name="GroupLabel"> Gruppo: @@ -49,6 +49,7 @@ <check_box label="Modificare" name="next_owner_modify"/> <check_box label="Copiare" name="next_owner_copy"/> <check_box initial_value="true" label="Trasferisci" name="next_owner_transfer" tool_tip="Il prossimo proprietario può regalare o rivendere questo oggetto"/> - <button label="OK" name="apply"/> + <button label="OK" name="ok"/> + <button label="Applica" name="apply"/> <button label="Annulla" name="close"/> </floater> diff --git a/indra/newview/skins/default/xui/it/floater_goto_line.xml b/indra/newview/skins/default/xui/it/floater_goto_line.xml new file mode 100644 index 0000000000..29a4aabb99 --- /dev/null +++ b/indra/newview/skins/default/xui/it/floater_goto_line.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="script goto" title="PASSA ALLA RIGA"> + <button label="OK" label_selected="OK" name="goto_btn"/> + <text name="txt"> + Passa alla riga + </text> +</floater> diff --git a/indra/newview/skins/default/xui/it/floater_im_session.xml b/indra/newview/skins/default/xui/it/floater_im_session.xml index d38ec7a5fe..71f90accde 100755 --- a/indra/newview/skins/default/xui/it/floater_im_session.xml +++ b/indra/newview/skins/default/xui/it/floater_im_session.xml @@ -34,13 +34,11 @@ <layout_panel name="body_panel"> <layout_stack name="im_panels"> <layout_panel name="right_part_holder"> - <panel name="trnsAndChat_panel"> - <layout_stack name="translate_and_chat_stack"> - <layout_panel name="translate_chat_checkbox_lp"> - <check_box label="Traduci chat" name="translate_chat_checkbox"/> - </layout_panel> - </layout_stack> - </panel> + <layout_stack name="translate_and_chat_stack"> + <layout_panel name="translate_chat_checkbox_lp"> + <check_box label="Traduci chat" name="translate_chat_checkbox"/> + </layout_panel> + </layout_stack> </layout_panel> </layout_stack> </layout_panel> diff --git a/indra/newview/skins/default/xui/it/floater_pathfinding_console.xml b/indra/newview/skins/default/xui/it/floater_pathfinding_console.xml index 7777444161..77be220a2a 100755 --- a/indra/newview/skins/default/xui/it/floater_pathfinding_console.xml +++ b/indra/newview/skins/default/xui/it/floater_pathfinding_console.xml @@ -71,7 +71,7 @@ <text name="show_label"> Mostra: </text> - <check_box label="Test" name="show_world"/> + <check_box label="Mondo" name="show_world"/> <check_box label="Solo elementi spostabili" name="show_world_movables_only"/> <check_box label="Navmesh" name="show_navmesh"/> <text name="show_walkability_label"> diff --git a/indra/newview/skins/default/xui/it/menu_attachment_other.xml b/indra/newview/skins/default/xui/it/menu_attachment_other.xml index d4d6fd68d0..d4ce25e6a5 100755 --- a/indra/newview/skins/default/xui/it/menu_attachment_other.xml +++ b/indra/newview/skins/default/xui/it/menu_attachment_other.xml @@ -11,7 +11,9 @@ <menu_item_call label="Congela" name="Freeze..."/> <menu_item_call label="Espelli" name="Eject..."/> <menu_item_call label="Debug delle texture" name="Debug..."/> + <menu_item_call label="Dump XML" name="Dump XML"/> <menu_item_call label="Zoom avanti" name="Zoom In"/> <menu_item_call label="Paga" name="Pay..."/> <menu_item_call label="Profilo dell'oggetto" name="Object Inspect"/> + <menu_item_call label="Blocca proprietario particella" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/it/menu_attachment_self.xml b/indra/newview/skins/default/xui/it/menu_attachment_self.xml index 0b841d591f..b28137262f 100755 --- a/indra/newview/skins/default/xui/it/menu_attachment_self.xml +++ b/indra/newview/skins/default/xui/it/menu_attachment_self.xml @@ -12,5 +12,7 @@ <menu_item_call label="I miei gruppi" name="Groups..."/> <menu_item_call label="Il mio profilo" name="Profile..."/> <menu_item_call label="Debug delle texture" name="Debug..."/> + <menu_item_call label="Dump XML" name="Dump XML"/> <menu_item_call label="Lascia" name="Drop"/> + <menu_item_call label="Blocca proprietario particella" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/it/menu_avatar_other.xml b/indra/newview/skins/default/xui/it/menu_avatar_other.xml index c2edc32a49..a2b864b3e1 100755 --- a/indra/newview/skins/default/xui/it/menu_avatar_other.xml +++ b/indra/newview/skins/default/xui/it/menu_avatar_other.xml @@ -11,6 +11,8 @@ <menu_item_call label="Congela" name="Freeze..."/> <menu_item_call label="Espelli" name="Eject..."/> <menu_item_call label="Debug delle texture" name="Debug..."/> + <menu_item_call label="Dump XML" name="Dump XML"/> <menu_item_call label="Zoom avanti" name="Zoom In"/> <menu_item_call label="Paga" name="Pay..."/> + <menu_item_call label="Blocca proprietario particella" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/it/menu_avatar_self.xml b/indra/newview/skins/default/xui/it/menu_avatar_self.xml index a4dafd7b5f..3666571065 100755 --- a/indra/newview/skins/default/xui/it/menu_avatar_self.xml +++ b/indra/newview/skins/default/xui/it/menu_avatar_self.xml @@ -29,4 +29,6 @@ <menu_item_call label="I miei gruppi" name="Groups..."/> <menu_item_call label="Il mio profilo" name="Profile..."/> <menu_item_call label="Debug delle texture" name="Debug..."/> + <menu_item_call label="Dump XML" name="Dump XML"/> + <menu_item_call label="Blocca proprietario particella" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/it/menu_conversation.xml b/indra/newview/skins/default/xui/it/menu_conversation.xml index 46ced93f1d..24486f2af2 100644 --- a/indra/newview/skins/default/xui/it/menu_conversation.xml +++ b/indra/newview/skins/default/xui/it/menu_conversation.xml @@ -3,6 +3,7 @@ <menu_item_call label="Chiudi la conversazione" name="close_conversation"/> <menu_item_call label="Apri conversazione a voce" name="open_voice_conversation"/> <menu_item_call label="Interrompi collegamento a voce" name="disconnect_from_voice"/> + <menu_item_call label="Chiudi selezionato" name="close_selected_conversations"/> <menu_item_call label="Vedi profilo" name="view_profile"/> <menu_item_call label="IM" name="im"/> <menu_item_call label="Offri teleport" name="offer_teleport"/> diff --git a/indra/newview/skins/default/xui/it/menu_land.xml b/indra/newview/skins/default/xui/it/menu_land.xml index f510078e14..816849a7b5 100755 --- a/indra/newview/skins/default/xui/it/menu_land.xml +++ b/indra/newview/skins/default/xui/it/menu_land.xml @@ -6,4 +6,5 @@ <menu_item_call label="Acquista Permesso" name="Land Buy Pass"/> <menu_item_call label="Costruisci" name="Create"/> <menu_item_call label="Modifica terreno" name="Edit Terrain"/> + <menu_item_call label="Blocca proprietario particella" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/it/menu_login.xml b/indra/newview/skins/default/xui/it/menu_login.xml index 7b060e6565..35053ec499 100755 --- a/indra/newview/skins/default/xui/it/menu_login.xml +++ b/indra/newview/skins/default/xui/it/menu_login.xml @@ -17,7 +17,13 @@ <menu_item_call label="Mostra i Termini del servizio (TOS)" name="TOS"/> <menu_item_call label="Mostra messaggio critico" name="Critical"/> <menu_item_call label="Test debug finestra contenuti Web" name="Web Content Floater Debug Test"/> - <menu label="Imposta livello di registrazione" name="Set Logging Level"/> + <menu label="Imposta livello di registrazione" name="Set Logging Level"> + <menu_item_check label="Debug" name="Debug"/> + <menu_item_check label="Info" name="Info"/> + <menu_item_check label="Attenzione" name="Warning"/> + <menu_item_check label="Errore" name="Error"/> + <menu_item_check label="Nessuno" name="None"/> + </menu> <menu_item_check label="Mostra selettore griglia" name="Show Grid Picker"/> <menu_item_call label="Mostra Console notifiche" name="Show Notifications Console"/> </menu> diff --git a/indra/newview/skins/default/xui/it/menu_mute_particle.xml b/indra/newview/skins/default/xui/it/menu_mute_particle.xml new file mode 100644 index 0000000000..7eb4b09495 --- /dev/null +++ b/indra/newview/skins/default/xui/it/menu_mute_particle.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<!-- *NOTE: See also menu_attachment_other.xml --> +<context_menu name="Mute Particle Pie"> + <menu_item_call label="Blocca proprietario particella" name="Mute Particle"/> +</context_menu> diff --git a/indra/newview/skins/default/xui/it/menu_object.xml b/indra/newview/skins/default/xui/it/menu_object.xml index 7f41e8937f..9bcc0879d2 100755 --- a/indra/newview/skins/default/xui/it/menu_object.xml +++ b/indra/newview/skins/default/xui/it/menu_object.xml @@ -5,13 +5,13 @@ </menu_item_call> <menu_item_call label="Modifica" name="Edit..."/> <menu_item_call label="Costruisci" name="Build"/> - <menu_item_call label="Mostra nei set collegati" name="show_in_linksets"/> - <menu_item_call label="Mostra nei personaggi" name="show_in_characters"/> <menu_item_call label="Apri" name="Open"/> <menu_item_call label="Siediti qui" name="Object Sit"/> <menu_item_call label="Alzati" name="Object Stand Up"/> <menu_item_call label="Profilo dell'oggetto" name="Object Inspect"/> <menu_item_call label="Zoom avanti" name="Zoom In"/> + <menu_item_call label="Mostra nei set collegati" name="show_in_linksets"/> + <menu_item_call label="Mostra nei personaggi" name="show_in_characters"/> <context_menu label="Metti" name="Put On"> <menu_item_call label="Indossa" name="Wear"/> <menu_item_call label="Aggiungi" name="Add"/> @@ -28,4 +28,5 @@ <menu_item_call label="Paga" name="Pay..."/> <menu_item_call label="Acquista" name="Buy..."/> <menu_item_call label="Elimina" name="Delete"/> + <menu_item_call label="Blocca proprietario particella" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/it/menu_url_agent.xml b/indra/newview/skins/default/xui/it/menu_url_agent.xml index abfbab35a3..e5c20fb9e9 100755 --- a/indra/newview/skins/default/xui/it/menu_url_agent.xml +++ b/indra/newview/skins/default/xui/it/menu_url_agent.xml @@ -3,6 +3,7 @@ <menu_item_call label="Vedi profilo" name="show_agent"/> <menu_item_call label="Manda IM..." name="send_im"/> <menu_item_call label="Aggiungi come amico..." name="add_friend"/> + <menu_item_call label="Togli amicizia..." name="remove_friend"/> <menu_item_call label="Copia nome negli Appunti" name="url_copy_label"/> <menu_item_call label="Copia SLurl negli Appunti" name="url_copy"/> </context_menu> diff --git a/indra/newview/skins/default/xui/it/menu_url_objectim.xml b/indra/newview/skins/default/xui/it/menu_url_objectim.xml index 8456d14b63..116b652172 100755 --- a/indra/newview/skins/default/xui/it/menu_url_objectim.xml +++ b/indra/newview/skins/default/xui/it/menu_url_objectim.xml @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <context_menu name="Url Popup"> <menu_item_call label="Profilo oggetto..." name="show_object"/> + <menu_item_call label="Blocca..." name="block_object"/> <menu_item_call label="Mostra sulla mappa" name="show_on_map"/> <menu_item_call label="Teleport sul luogo dell'oggetto" name="teleport_to_object"/> <menu_item_call label="Copia nome oggetto negli Appunti" name="url_copy_label"/> diff --git a/indra/newview/skins/default/xui/it/menu_viewer.xml b/indra/newview/skins/default/xui/it/menu_viewer.xml index 2b7bc71df7..52247d6c9c 100755 --- a/indra/newview/skins/default/xui/it/menu_viewer.xml +++ b/indra/newview/skins/default/xui/it/menu_viewer.xml @@ -16,7 +16,10 @@ <menu_item_call label="Ferma animazione" name="Stop Animating My Avatar"/> <menu_item_call label="Cammina / corri / vola..." name="Walk / run / fly"/> </menu> - <menu label="Stato" name="Status"/> + <menu label="Stato" name="Status"> + <menu_item_check label="Assente" name="Away"/> + <menu_item_check label="Non disturbare" name="Do Not Disturb"/> + </menu> <menu_item_call label="Acquista L$..." name="Buy and Sell L$"/> <menu_item_call label="Casella venditore in uscita..." name="MerchantOutbox"/> <menu_item_call label="Dashboard dell'account..." name="Manage My Account"> @@ -32,6 +35,7 @@ <menu_item_check label="Conversazioni..." name="Conversations"/> <menu_item_check label="Chat nei dintorni..." name="Nearby Chat"/> <menu_item_check label="Parla" name="Speak"/> + <menu_item_check label="Registro conversazioni..." name="Conversation Log..."/> <menu label="Manipolazione voce" name="VoiceMorphing"> <menu_item_check label="Nessuna manipolazione voce" name="NoVoiceMorphing"/> <menu_item_check label="Anteprima..." name="Preview"/> @@ -42,6 +46,7 @@ <menu_item_check label="Gruppi" name="My Groups"/> <menu_item_check label="Persone vicine" name="Active Speakers"/> <menu_item_call label="Blocca lista" name="Block List"/> + <menu_item_check label="Non disturbare" name="Do Not Disturb"/> </menu> <menu label="Mondo" name="World"> <menu_item_call label="Crea punto di riferimento per questo luogo" name="Create Landmark Here"/> @@ -110,6 +115,7 @@ <menu_item_call label="Includi parte successiva" name="Include Next Part"/> <menu_item_call label="Includi parte precedente" name="Include Previous Part"/> </menu> + <menu_item_call label="Set collegati..." name="pathfinding_linkset_menu_item"/> <menu_item_call label="Ingrandisci selezione" name="Focus on Selection"/> <menu_item_call label="Zoom sulla selezione" name="Zoom to Selection"/> <menu label="Oggetto" name="Object"> @@ -273,6 +279,7 @@ <menu_item_check label="Spostamento fotocamera" name="Camera Offset"/> <menu_item_check label="Veloc. di visualizzazione casuale" name="Randomize Framerate"/> <menu_item_check label="Test frame" name="Frame Test"/> + <menu_item_call label="Profilo frame" name="Frame Profile"/> </menu> <menu label="Render Metadata" name="Render Metadata"> <menu_item_check label="Normali" name="Normals"/> @@ -293,15 +300,15 @@ </menu> <menu label="Rendering" name="Rendering"> <menu_item_check label="Assi" name="Axes"/> + <menu_item_call label="Info materiale selezionato" name="Selected Material Info"/> <menu_item_check label="Wireframe" name="Wireframe"/> - <menu_item_check label="Luci e ombre" name="Advanced Lighting Model"/> + <menu_item_check label="Modello illuminazione avanzato" name="Advanced Lighting Model"/> <menu_item_check label="Ombra dal sole, dalla luna e dai proiettori" name="Shadows from Sun/Moon/Projectors"/> <menu_item_check label="SSAO e ombre fluide" name="SSAO and Shadow Smoothing"/> <menu_item_check label="Maschera alfa automatica (differita)" name="Automatic Alpha Masks (deferred)"/> <menu_item_check label="Maschera alfa automatica (non differita)" name="Automatic Alpha Masks (non-deferred)"/> <menu_item_check label="Texture delle animazioni" name="Animation Textures"/> <menu_item_check label="Disabilita texture" name="Disable Textures"/> - <menu_item_check label="Atlante tessitura (sperimentale)" name="Texture Atlas"/> <menu_item_check label="Rendering delle luci unite" name="Render Attached Lights"/> <menu_item_check label="Rendering particelle unite" name="Render Attached Particles"/> <menu_item_check label="Gli oggetti brillano quando sono sotto il cursore" name="Hover Glow Objects"/> @@ -320,7 +327,6 @@ <menu_item_call label="Test browser multimedia" name="Web Browser Test"/> <menu_item_call label="Browser contenuto Web" name="Web Content Browser"/> <menu_item_call label="Stampa informazioni oggetto selezionato" name="Print Selected Object Info"/> - <menu_item_call label="Statistiche memoria" name="Memory Stats"/> <menu_item_check label="Console di debug regione" name="Region Debug Console"/> <menu_item_check label="Debug clic" name="Debug Clicks"/> <menu_item_check label="Debug eventi mouse" name="Debug Mouse Events"/> diff --git a/indra/newview/skins/default/xui/it/notifications.xml b/indra/newview/skins/default/xui/it/notifications.xml index 8adbebb62a..96b8c96595 100755 --- a/indra/newview/skins/default/xui/it/notifications.xml +++ b/indra/newview/skins/default/xui/it/notifications.xml @@ -210,6 +210,14 @@ Aggiungi questo potere a '[ROLE_NAME]'? Aggiungi questo potere a '[ROLE_NAME]'? <usetemplate name="okcancelbuttons" notext="No" yestext="Si"/> </notification> + <notification name="EjectGroupMemberWarning"> + Stai per espellere [AVATAR_NAME] dal gruppo. + <usetemplate ignoretext="Conferma l'espulsione di un partecipante dal gruppo" name="okcancelignore" notext="Annulla" yestext="Espelli"/> + </notification> + <notification name="EjectGroupMembersWarning"> + Stai per espellere [COUNT] membri dal gruppo. + <usetemplate ignoretext="Conferma l'espulsione di vari partecipanti dal gruppo" name="okcancelignore" notext="Annulla" yestext="Espelli"/> + </notification> <notification name="AttachmentDrop"> Stai per abbandonare il tuo accessorio. Vuoi continuare? @@ -1110,7 +1118,7 @@ su TUTTI I TERRENI di questa sim? Introduci un prezzo più alto. </notification> <notification name="ConfirmItemDeleteHasLinks"> - Almeno uno degli oggetti selezionati è collegato tramite link ad altri oggetti. Se elimini l'oggetto, i relativi link non funzioneranno più. Pertanto si consiglia vivamente di eliminare prima i link. + Almeno uno degli oggetti è collegato tramite link ad altri oggetti. Se elimini l'oggetto, i relativi link non funzioneranno più. Si consiglia vivamente di eliminare prima i link. Sei sicuro di volere eliminare gli oggetti? <usetemplate name="okcancelbuttons" notext="Annulla" yestext="OK"/> @@ -1128,9 +1136,9 @@ Confermi di voler cancellare questi elementi? <usetemplate name="okcancelbuttons" notext="Annulla" yestext="OK"/> </notification> <notification name="ConfirmObjectDeleteNoOwn"> - Non possiedi neanche uno degli oggetti selezionati. + Non possiedi almeno uno degli oggetti selezionati. -Confermi di voler cancellare questi elementi? +Sei sicuro di volere eliminare gli oggetti? <usetemplate name="okcancelbuttons" notext="Annulla" yestext="OK"/> </notification> <notification name="ConfirmObjectDeleteLockNoCopy"> @@ -1142,24 +1150,24 @@ Confermi di voler cancellare questi elementi? </notification> <notification name="ConfirmObjectDeleteLockNoOwn"> Almeno un oggetto è bloccato. -Non possiedi neanche un oggetto. +Non possiedi almeno uno degli oggetti. -Confermi di voler cancellare questi elementi? +Sei sicuro di volere eliminare gli oggetti? <usetemplate name="okcancelbuttons" notext="Cancella" yestext="OK"/> </notification> <notification name="ConfirmObjectDeleteNoCopyNoOwn"> - Almeno un oggetto non è copiabile. -Non possiedi neanche un oggetto. + Almeno un oggetto non può essere copiato. +Non possiedi almeno uno degli oggetti. -Confermi di voler cancellare questi elementi? +Sei sicuro di volere eliminare gli oggetti? <usetemplate name="okcancelbuttons" notext="Annulla" yestext="OK"/> </notification> <notification name="ConfirmObjectDeleteLockNoCopyNoOwn"> Almeno un oggetto è bloccato. -Almeno un oggetto è non copiabile. -Non possiedi neanche un oggetto. +Almeno un oggetto non può essere copiato. +Non possiedi almeno uno degli oggetti. -Confermi di voler cancellare questi elementi? +Sei sicuro di volere eliminare gli oggetti? <usetemplate name="okcancelbuttons" notext="Annulla" yestext="OK"/> </notification> <notification name="ConfirmObjectTakeLock"> @@ -1481,13 +1489,43 @@ Versione [VERSION] [[RELEASE_NOTES_FULL_URL] Informazioni su questo aggiornament </notification> <notification name="RequiredUpdateDownloadedVerboseDialog"> È stato scaricato un aggiornamento obbligatorio del software. -Versione [VERSION] +Versione [VERSION] [[INFO_URL] Informazioni su questo aggiornamento] Per installare l'aggiornamento è necessario riavviare [APP_NAME]. <usetemplate name="okbutton" yestext="OK"/> </notification> <notification name="RequiredUpdateDownloadedDialog"> Per installare l'aggiornamento è necessario riavviare [APP_NAME]. +[[INFO_URL] Informazioni su questo aggiornamento] + <usetemplate name="okbutton" yestext="OK"/> + </notification> + <notification name="OtherChannelDownloadBackgroundTip"> + È stato scaricato un aggiornamento dell'installazione di [APP_NAME]. +Versione [VERSION] +Questo viewer sperimentale è stato sostituito con un viewer [NEW_CHANNEL]; +vedi [[INFO_URL] per informazioni su queesto aggiornamento] + <usetemplate name="okcancelbuttons" notext="Più tardi..." yestext="Installa ora e riavvia [APP_NAME]"/> + </notification> + <notification name="OtherChannelDownloadBackgroundDialog"> + È stato scaricato un aggiornamento dell'installazione di [APP_NAME]. +Versione [VERSION] +Questo viewer sperimentale è stato sostituito con un viewer [NEW_CHANNEL]; +vedi [[INFO_URL] Informazioni su questo aggiornamento] + <usetemplate name="okcancelbuttons" notext="Più tardi..." yestext="Installa ora e riavvia [APP_NAME]"/> + </notification> + <notification name="OtherChannelRequiredUpdateDownloadedVerboseDialog"> + È stato scaricato un aggiornamento obbligatorio del software. +Versione [VERSION] +Questo viewer sperimentale è stato sostituito con un viewer [NEW_CHANNEL]; +vedi [[INFO_URL] Informazioni su questo aggiornamento] + +Per installare l'aggiornamento è necessario riavviare [APP_NAME]. + <usetemplate name="okbutton" yestext="OK"/> + </notification> + <notification name="OtherChannelRequiredUpdateDownloadedDialog"> + Per installare l'aggiornamento è necessario riavviare [APP_NAME]. +Questo viewer sperimentale è stato sostituito con un viewer [NEW_CHANNEL]; +vedi [[INFO_URL] Informazioni su questo aggiornamento] <usetemplate name="okbutton" yestext="OK"/> </notification> <notification name="DeedObjectToGroup"> @@ -1538,6 +1576,10 @@ Per installare l'aggiornamento è necessario riavviare [APP_NAME]. Lasciare il gruppo? <usetemplate name="okcancelbuttons" notext="Annulla" yestext="OK"/> </notification> + <notification name="OwnerCannotLeaveGroup"> + Impossibile abbandonare il gruppo. Non puoi abbandonare il gruppo perché sei l'ultimo proprietario del gruppo. Devi prima assegnare a un altro membro il ruolo di proprietario. + <usetemplate name="okbutton" yestext="OK"/> + </notification> <notification name="ConfirmKick"> Vuoi veramente espellere tutti i residenti dalla griglia? <usetemplate name="okcancelbuttons" notext="Annulla" yestext="Espelli tutti i residenti"/> @@ -2401,9 +2443,7 @@ Seleziona solo un oggetto. scegliere Teleport.) </notification> <notification name="TeleportToPerson"> - Per contattare Residenti come '[NAME]', clicca sul pulsante "Persone", seleziona un Residente nel pannello che viene aperto, quindi clicca su 'IM' in - basso nel pannello. - (Puoi anche fare doppio clic sul nome nell'elenco oppure fare clic con il pulsante destro del mouse e selezionare 'IM'). + Per avviare una conversazione privata con un'altra persona, fai clic con il tasto destro sull'avatar e seleziona 'IM' dal menu. </notification> <notification name="CantSelectLandFromMultipleRegions"> Non è possibile selezionare il terreno attraverso i confini del server. @@ -2777,6 +2817,15 @@ Non consentire l'accesso se non comprendi perfettamente il motivo per cui d <button name="Deny" text="Nega"/> </form> </notification> + <notification name="UnknownScriptQuestion"> + L'autorizzazione per script runtime richiesta da '<nolink>[OBJECTNAME]</nolink>', un oggetto di proprietà di '[NAME]', non è stata riconosciuta nel viewer e non può essere concessa. + +Per concedere questa autorizzazione è necessario che il viewer venga aggiornato alla versione più recente da [DOWNLOADURL]. + <form name="form"> + <button name="Deny" text="Ok"/> + <button name="Mute" text="Blocca"/> + </form> + </notification> <notification name="ScriptDialog"> '<nolink>[TITLE]</nolink>' di [NAME] [MESSAGE] diff --git a/indra/newview/skins/default/xui/it/panel_people.xml b/indra/newview/skins/default/xui/it/panel_people.xml index e1468db76e..2f40d4bdc4 100755 --- a/indra/newview/skins/default/xui/it/panel_people.xml +++ b/indra/newview/skins/default/xui/it/panel_people.xml @@ -49,6 +49,9 @@ Stai cercando persone da frequentare? Prova la [secondlife:///app/worldmap Mappa <menu_button name="plus_btn" tool_tip="Aderisci al gruppo/Crea nuovo gruppo"/> <dnd_button name="minus_btn" tool_tip="Lascia il gruppo selezionato"/> </panel> + <text name="groupcount"> + Fai parte di [COUNT] gruppi e puoi iscriverti a [REMAINING] altri. + </text> </panel> <panel label="RECENTE" name="recent_panel"> <panel label="bottom_panel" name="recent_buttons_panel"> diff --git a/indra/newview/skins/default/xui/it/panel_preferences_chat.xml b/indra/newview/skins/default/xui/it/panel_preferences_chat.xml index c2ac6e97a9..09d7c96370 100755 --- a/indra/newview/skins/default/xui/it/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/it/panel_preferences_chat.xml @@ -1,11 +1,11 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <panel label="Text Chat" name="chat"> - <panel> - <check_box initial_value="true" label="Simula la battitura tasti quando scrivi" name="play_typing_animation"/> + <panel name="general_chat_settings"> + <check_box initial_value="true" label="Simula la battitura tasti quando sei in chat" name="play_typing_animation"/> <check_box label="Quando sono OFF-LINE, spediscimi gli IM in una e-mail" name="send_im_to_email"/> <check_box label="Solo amici e gruppi possono chiamarmi o mandarmi IM" name="voice_call_friends_only_check"/> <text name="font_size"> - Dimensioni caratteri: + Dimensioni carattere: </text> <combo_box name="chat_font_size"> <item label="Piccolo" name="Small" value="0"/> @@ -14,10 +14,7 @@ </combo_box> <check_box label="Chat a vignetta" name="bubble_text_chat"/> </panel> - <panel> - <text name="notifications"> - Notifiche - </text> + <panel name="im_notification_settings"> <text name="friend_ims"> IM degli amici: </text> @@ -25,8 +22,9 @@ <item label="Apri finestra Conversazioni" name="OpenConversationsWindow" value="openconversations"/> <item label="Mostra il messaggio in una finestra pop-up" name="PopUpMessage" value="toast"/> <item label="Pulsante barra strumenti Flash" name="FlashToolbarButton" value="flash"/> - <item label="Nessuno" name="None" value="none"/> + <item label="Nessuna azione" name="NoAction" value="noaction"/> </combo_box> + <check_box label="Riproduci suono" name="play_sound_friend_im"/> <text name="non_friend_ims"> IM non di amici: </text> @@ -34,8 +32,9 @@ <item label="Apri finestra Conversazioni" name="OpenConversationsWindow" value="openconversations"/> <item label="Mostra il messaggio in una finestra pop-up" name="PopUpMessage" value="toast"/> <item label="Pulsante barra strumenti Flash" name="FlashToolbarButton" value="flash"/> - <item label="Nessuno" name="None" value="none"/> + <item label="Nessuna azione" name="NoAction" value="noaction"/> </combo_box> + <check_box label="Riproduci suono" name="play_sound_non_friend_im"/> <text name="conference_ims"> IM conferenza: </text> @@ -43,8 +42,9 @@ <item label="Apri finestra Conversazioni" name="OpenConversationsWindow" value="openconversations"/> <item label="Mostra il messaggio in una finestra pop-up" name="PopUpMessage" value="toast"/> <item label="Pulsante barra strumenti Flash" name="FlashToolbarButton" value="flash"/> - <item label="Nessuno" name="None" value="none"/> + <item label="Nessuna azione" name="NoAction" value="noaction"/> </combo_box> + <check_box label="Riproduci suono" name="play_sound_conference_im"/> <text name="group_chat"> Chat di gruppo: </text> @@ -52,8 +52,9 @@ <item label="Apri finestra Conversazioni" name="OpenConversationsWindow" value="openconversations"/> <item label="Mostra il messaggio in una finestra pop-up" name="PopUpMessage" value="toast"/> <item label="Pulsante barra strumenti Flash" name="FlashToolbarButton" value="flash"/> - <item label="Nessuno" name="None" value="none"/> + <item label="Nessuna azione" name="NoAction" value="noaction"/> </combo_box> + <check_box label="Riproduci suono" name="play_sound_group_chat_im"/> <text name="nearby_chat"> Chat nei dintorni: </text> @@ -61,13 +62,24 @@ <item label="Apri finestra Conversazioni" name="OpenConversationsWindow" value="openconversations"/> <item label="Mostra il messaggio in una finestra pop-up" name="PopUpMessage" value="toast"/> <item label="Pulsante barra strumenti Flash" name="FlashToolBarButton" value="flash"/> - <item label="Nessuno" name="None" value="none"/> + <item label="Nessuna azione" name="NoAction" value="noaction"/> + </combo_box> + <check_box label="Riproduci suono" name="play_sound_nearby_chat_im"/> + <text name="object_ims"> + IM di oggetti: + </text> + <combo_box name="ObjectIMOptions"> + <item label="Apri finestra Conversazioni" name="OpenConversationsWindow" value="openconversations"/> + <item label="Mostra il messaggio in una finestra pop-up" name="PopUpMessage" value="toast"/> + <item label="Pulsante barra strumenti Flash" name="FlashToolBarButton" value="flash"/> + <item label="Nessuna azione" name="NoAction" value="noaction"/> </combo_box> + <check_box label="Riproduci suono" name="play_sound_object_im"/> <text name="notifications_alert"> Per interrompere temporaneamente le notifiche, usa Comunica > Non disturbare. </text> </panel> - <panel> + <panel name="play_sound_settings"> <text name="play_sound"> Riproduci suono: </text> @@ -76,7 +88,7 @@ <check_box label="Offerta di Teleport" name="teleport_offer"/> <check_box label="Offerta inventario" name="inventory_offer"/> </panel> - <panel> + <panel name="log_settings"> <button label="Cancella registro..." name="clear_log"/> <button label="Cancella trascrizioni..." name="delete_transcripts"/> <button label="Sfoglia..." label_selected="Sfoglia" name="log_path_button"/> diff --git a/indra/newview/skins/default/xui/it/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/it/panel_preferences_graphics1.xml index 1f2b97af45..e7483b1ba5 100755 --- a/indra/newview/skins/default/xui/it/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/it/panel_preferences_graphics1.xml @@ -30,7 +30,7 @@ <check_box initial_value="true" label="Luci locali" name="LocalLights"/> <check_box initial_value="true" label="Effetti grafici base" name="BasicShaders" tool_tip="Disabilitare questa opzione può evitare che qualche scheda grafica vada in crash."/> <check_box initial_value="true" label="Effetti grafici atmosferici" name="WindLightUseAtmosShaders"/> - <check_box initial_value="true" label="Luci e ombre" name="UseLightShaders"/> + <check_box initial_value="true" label="Modello illuminazione avanzato" name="UseLightShaders"/> <check_box initial_value="true" label="Occlusione ambientale" name="UseSSAO"/> <check_box initial_value="true" label="Profondità di campo" name="UseDoF"/> <text name="shadows_label"> diff --git a/indra/newview/skins/default/xui/it/panel_preferences_setup.xml b/indra/newview/skins/default/xui/it/panel_preferences_setup.xml index 0189d47f45..4c190197b4 100755 --- a/indra/newview/skins/default/xui/it/panel_preferences_setup.xml +++ b/indra/newview/skins/default/xui/it/panel_preferences_setup.xml @@ -29,6 +29,7 @@ <combo_box.item label="Installa automaticamente" name="Install_automatically"/> <combo_box.item label="Scarica e installa manualmente gli aggiornamenti" name="Install_manual"/> </combo_box> + <check_box label="Disponibile agli aggiornamenti con versioni non rilasciate" name="update_willing_to_test"/> <text name="Proxy Settings:"> Impostazioni proxy: </text> diff --git a/indra/newview/skins/default/xui/it/panel_script_ed.xml b/indra/newview/skins/default/xui/it/panel_script_ed.xml index d7ee8230b3..feee8b1927 100755 --- a/indra/newview/skins/default/xui/it/panel_script_ed.xml +++ b/indra/newview/skins/default/xui/it/panel_script_ed.xml @@ -34,6 +34,7 @@ <menu_item_call label="Seleziona tutto" name="Select All"/> <menu_item_call label="Deseleziona" name="Deselect"/> <menu_item_call label="Cerca / Sostituisci..." name="Search / Replace..."/> + <menu_item_call label="Passa alla riga..." name="Go to line..."/> </menu> <menu label="Guida" name="Help"> <menu_item_call label="Aiuto..." name="Help..."/> diff --git a/indra/newview/skins/default/xui/it/panel_tools_texture.xml b/indra/newview/skins/default/xui/it/panel_tools_texture.xml new file mode 100644 index 0000000000..4e515563ac --- /dev/null +++ b/indra/newview/skins/default/xui/it/panel_tools_texture.xml @@ -0,0 +1,116 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<panel label="Texture" name="Texture"> + <panel.string name="string repeats per meter"> + Ripetizioni al metro + </panel.string> + <panel.string name="string repeats per face"> + Ripetizioni per faccia + </panel.string> + <text name="color label"> + Colore + </text> + <color_swatch label="" name="colorswatch" tool_tip="Clicca per aprire il selettore dei colori"/> + <text name="color trans"> + Trasparenza % + </text> + <text name="glow label"> + Bagliore + </text> + <check_box label="Luminosità massima" name="checkbox fullbright"/> + <combo_box name="combobox matmedia"> + <combo_box.item label="Materiali" name="Materials"/> + <combo_box.item label="Multimedia" name="Media"/> + </combo_box> + <combo_box name="combobox mattype"> + <combo_box.item label="Texture (diffusa)" name="Texture (diffuse)"/> + <combo_box.item label="Irregolarità (normale)" name="Bumpiness (normal)"/> + <combo_box.item label="Lucentezza (speculare)" name="Shininess (specular)"/> + </combo_box> + <texture_picker label="Texture" name="texture control" tool_tip="Clicca per scegliere una fotografia"/> + <text name="label alphamode"> + Modalità Alfa + </text> + <combo_box name="combobox alphamode"> + <combo_box.item label="Nessuno" name="None"/> + <combo_box.item label="Miscelazione Alfa" name="Alpha blending"/> + <combo_box.item label="Mascheratura Alfa" name="Alpha masking"/> + <combo_box.item label="Mascheratura emissiva" name="Emissive mask"/> + </combo_box> + <text name="label maskcutoff"> + Limite mascheratura + </text> + <texture_picker label="Texture" name="bumpytexture control" tool_tip="Clicca per scegliere una fotografia"/> + <text name="label bumpiness"> + Irregolarità + </text> + <combo_box name="combobox bumpiness"> + <combo_box.item label="Nessuno" name="None"/> + <combo_box.item label="Luminosità " name="Brightness"/> + <combo_box.item label="Oscurità " name="Darkness"/> + <combo_box.item label="venatura" name="woodgrain"/> + <combo_box.item label="corteccia" name="bark"/> + <combo_box.item label="mattoni" name="bricks"/> + <combo_box.item label="scacchiera" name="checker"/> + <combo_box.item label="cemento" name="concrete"/> + <combo_box.item label="incrostatura" name="crustytile"/> + <combo_box.item label="gemma" name="cutstone"/> + <combo_box.item label="dischi" name="discs"/> + <combo_box.item label="ciottoli" name="gravel"/> + <combo_box.item label="batteri" name="petridish"/> + <combo_box.item label="rivestimento" name="siding"/> + <combo_box.item label="lastricato" name="stonetile"/> + <combo_box.item label="stucco" name="stucco"/> + <combo_box.item label="suzione" name="suction"/> + <combo_box.item label="trama" name="weave"/> + </combo_box> + <texture_picker label="Texture" name="shinytexture control" tool_tip="Clicca per scegliere una fotografia"/> + <text name="label shininess"> + Lucentezza + </text> + <combo_box name="combobox shininess"> + <combo_box.item label="Nessuna" name="None"/> + <combo_box.item label="Bassa" name="Low"/> + <combo_box.item label="Media" name="Medium"/> + <combo_box.item label="Alta" name="High"/> + </combo_box> + <text name="label glossiness"> + Patinatura + </text> + <text name="label environment"> + Ambiente + </text> + <text name="label shinycolor"> + Colore + </text> + <color_swatch label="" name="shinycolorswatch" tool_tip="Clicca per aprire il selettore dei colori"/> + <text name="media_info"> + L'URL dell'eventuale elemento multimediale selezionato va qui + </text> + <button label="Scegli..." name="add_media" tool_tip="Aggiungi elemento multimediale"/> + <button label="Rimuovi" name="delete_media" tool_tip="Cancella questa texture dell'elemento multimediale"/> + <button label="Alllinea" label_selected="Allinea elmento multimediale" name="button align" tool_tip="Allinea texture dell'elemento multimediale (il caricamento deve prima essere completato)"/> + <text name="tex gen"> + Mappatura + </text> + <combo_box name="combobox texgen"> + <combo_box.item label="Predefinita" name="Default"/> + <combo_box.item label="Planare" name="Planar"/> + </combo_box> + <spinner label="Scala orizzontale" name="TexScaleU"/> + <spinner label="Scala veritcale" name="TexScaleV"/> + <spinner label="Ripetizioni al metro" name="rptctrl"/> + <spinner label="Gradi di rotazione" name="TexRot"/> + <spinner label="Spostamento orizzontale" name="TexOffsetU"/> + <spinner label="Spostamento verticale" name="TexOffsetV"/> + <spinner label="Scala orizzontale" name="bumpyScaleU"/> + <spinner label="Scala veritcale" name="bumpyScaleV"/> + <spinner label="Gradi di rotazione" name="bumpyRot"/> + <spinner label="Spostamento orizzontale" name="bumpyOffsetU"/> + <spinner label="Spostamento verticale" name="bumpyOffsetV"/> + <spinner label="Scala orizzontale" name="shinyScaleU"/> + <spinner label="Scala veritcale" name="shinyScaleV"/> + <spinner label="Gradi di rotazione" name="shinyRot"/> + <spinner label="Spostamento orizzontale" name="shinyOffsetU"/> + <spinner label="Spostamento verticale" name="shinyOffsetV"/> + <check_box initial_value="falso" label="Allinea facce planari" name="checkbox planar align" tool_tip="Allinea le texture su tutte le facce selezionate con l’ultima faccia selezionata. È richiesta la mappatura planare delle texture."/> +</panel> diff --git a/indra/newview/skins/default/xui/it/role_actions.xml b/indra/newview/skins/default/xui/it/role_actions.xml index 300e6cf721..3ccb674ed0 100755 --- a/indra/newview/skins/default/xui/it/role_actions.xml +++ b/indra/newview/skins/default/xui/it/role_actions.xml @@ -25,7 +25,7 @@ </action_set> <action_set description="Queste abilità permettono di cambiare il nome del lotto, le impostazioni di pubblicazione, la visibilità negli elenchi e il punto di arrivo, nonché opzioni di indirizzamento del Teleport." name="Parcel Identity"> <action description="Premi Mostra luogo nella ricerca e seleziona una categoria" longdescription="Premi Mostra luogo nella ricerca e seleziona una categoria di lotto in Informazioni sul terreno > scheda Opzioni." name="land find places" value="17"/> - <action description="Cambia il nome del lotto, la descrizione e le impostazioni di Mostra luogo nella ricerca" longdescription="Cambia il nome del lotto, la descrizione e le impostazioni di Mostra luogo nella ricerca. Ciò viene fatto in Informazioni sul terreno > scheda Opzioni." name="land change identity" value="18"/> + <action description="Cambia il nome, la descrizione e le impostazioni 'Contenuto Moderato' per il lotto" longdescription="Cambia il nome, la descrizione e le impostazioni 'Contenuto Moderato' per il lotto. Ciò viene fatto in Informazioni sul terreno > scheda Opzioni." name="land change identity" value="18"/> <action description="Impostare il punto di arrivo e l'indirizzamento del Teleport" longdescription="In un lotto di proprietà di un gruppo, i membri con questo ruolo e abilità possono impostare un punto di arrivo per i teleport entranti e impostare anche l'indirizzamento del teleport per ulteriore precisione. Viene fatto in Informazioni sul terreno > Opzioni." name="land set landing point" value="19"/> </action_set> <action_set description="Queste abilità hanno poteri relativi alle opzioni dei lotti, come la creazione di oggetti, la modifica del terreno e le impostazioni per la musica e gli elementi multimediali." name="Parcel Settings"> diff --git a/indra/newview/skins/default/xui/it/strings.xml b/indra/newview/skins/default/xui/it/strings.xml index f95318542b..160df911d3 100755 --- a/indra/newview/skins/default/xui/it/strings.xml +++ b/indra/newview/skins/default/xui/it/strings.xml @@ -136,6 +136,9 @@ <string name="create_account_url"> http://join.secondlife.com/?sourceid=[sourceid] </string> + <string name="ViewerDownloadURL"> + http://secondlife.com/download. + </string> <string name="LoginFailedViewerNotPermitted"> Il viewer utilizzato non è più in grado di accedere a Second Life. Visita la parina seguente per scaricare un nuovo viewer: http://secondlife.com/download. @@ -445,6 +448,9 @@ Prova ad accedere nuovamente tra un minuto. <string name="SLappAgentRequestFriend"> Richiesta di amicizia </string> + <string name="SLappAgentRemoveFriend"> + Rimozione amico + </string> <string name="BUTTON_CLOSE_DARWIN"> Chiudi (⌘W) </string> @@ -832,6 +838,9 @@ Prova ad accedere nuovamente tra un minuto. <string name="multiple_textures"> Multiple </string> + <string name="use_texture"> + Usa texture + </string> <string name="texture_loading"> Caricamento in corso... </string> @@ -928,6 +937,21 @@ Prova ad accedere nuovamente tra un minuto. <string name="TeleportYourAgent"> Teleportarti </string> + <string name="JoinAnExperience"> + Partecipa a un'esperienza + </string> + <string name="SilentlyManageEstateAccess"> + Omette gli avvisi durante la gestione degli elenchi di accesso alle proprietà immobiliari + </string> + <string name="OverrideYourAnimations"> + Sostituisce le animazioni predefinite + </string> + <string name="ScriptReturnObjects"> + Restituisce oggetti per conto tuo + </string> + <string name="UnknownScriptPermission"> + (sconosciuto)! + </string> <string name="SIM_ACCESS_PG"> Generale </string> @@ -1953,6 +1977,12 @@ Prova ad accedere nuovamente tra un minuto. <string name="ATTACH_HUD_BOTTOM_RIGHT"> HUD basso a destra </string> + <string name="ATTACH_NECK"> + Collo + </string> + <string name="ATTACH_AVATAR_CENTER"> + Centro avatar + </string> <string name="CursorPos"> Riga [LINE], Colonna [COLUMN] </string> @@ -2940,6 +2970,9 @@ Se il messaggio persiste, contatta [SUPPORT_SITE]. <string name="Hip Width"> Larghezza bacino </string> + <string name="Hover"> + Muovi sopra + </string> <string name="In"> Dentro </string> @@ -4994,4 +5027,7 @@ Prova a racchiudere il percorso dell'editor in doppie virgolette. <string name="logging_calls_enabled_log_empty"> Nessuna conversazione in registro. Dopo che hai contattato qualcuno o se qualcuno ti contatta, una voce del registro verrà mostrata qui. </string> + <string name="loading_chat_logs"> + Caricamento in corso... + </string> </strings> diff --git a/indra/newview/skins/default/xui/ja/floater_about.xml b/indra/newview/skins/default/xui/ja/floater_about.xml index 6d5df75645..63a4e69c10 100755 --- a/indra/newview/skins/default/xui/ja/floater_about.xml +++ b/indra/newview/skins/default/xui/ja/floater_about.xml @@ -8,7 +8,9 @@ コンパイラー [COMPILER] [COMPILER_VERSION] ãƒãƒ¼ã‚¸ãƒ§ãƒ³ </floater.string> <floater.string name="AboutPosition"> - ã‚ãªãŸã®ç¾åœ¨åœ°ã¯ã€[POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1] ã® [REGION] ã§ã™ã€‚ä½ç½®ã¯ <nolink>[HOSTNAME]</nolink> ã§ã™ã€‚([HOSTIP]) + ã‚ãªãŸã®ç¾åœ¨åœ°ã¯ã€[POSITION_LOCAL_0,number,1]ã€[POSITION_LOCAL_1,number,1]ã€[POSITION_LOCAL_2,number,1] ã® [REGION] ã§ã™ã€‚ä½ç½®ã¯ <nolink>[HOSTNAME]</nolink> ã§ã™ã€‚([HOSTIP]) +SLURL:<nolink>[SLURL]</nolink> +(ã‚°ãƒãƒ¼ãƒãƒ«åº§æ¨™ [POSITION_0,number,1]ã€[POSITION_1,number,1]ã€[POSITION_2,number,1]) [SERVER_VERSION] [SERVER_RELEASE_NOTES_URL] </floater.string> diff --git a/indra/newview/skins/default/xui/ja/floater_bulk_perms.xml b/indra/newview/skins/default/xui/ja/floater_bulk_perms.xml index d8d0164618..1b5a745cc4 100755 --- a/indra/newview/skins/default/xui/ja/floater_bulk_perms.xml +++ b/indra/newview/skins/default/xui/ja/floater_bulk_perms.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="floaterbulkperms" title="ä¸èº«ã®æ¨©é™ã®ç·¨é›†"> +<floater name="floaterbulkperms" title="コンテンツ権é™ã‚’調整"> <floater.string name="nothing_to_modify_text"> é¸æŠžã—ãŸä¸ã«ç·¨é›†ã§ããªã„ã‚‚ã®ãŒå«ã¾ã‚Œã¦ã„ã¾ã™ </floater.string> @@ -33,7 +33,7 @@ <button label="ã™ã¹ã¦ã« √" label_selected="å…¨ã¦" name="check_all"/> <button label="クリア" label_selected="ãªã—" name="check_none"/> <text name="newperms"> - æ–°ã—ã„ä¸èº«ã®æ¨©é™ + コンテンツ権é™ã‚’以下ã«èª¿æ•´ </text> <text name="GroupLabel"> グループ: @@ -49,6 +49,7 @@ <check_box label="ä¿®æ£" name="next_owner_modify"/> <check_box label="コピー" name="next_owner_copy"/> <check_box initial_value="true" label="å†è²©ãƒ»ãƒ—レゼント" name="next_owner_transfer" tool_tip="次ã®æ‰€æœ‰è€…ã¯ã“ã®ã‚ªãƒ–ジェクトを他人ã«ã‚ã’ãŸã‚Šå†è²©ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™"/> - <button label="OK" name="apply"/> + <button label="OK" name="ok"/> + <button label="é©ç”¨" name="apply"/> <button label="ã‚ャンセル" name="close"/> </floater> diff --git a/indra/newview/skins/default/xui/ja/floater_goto_line.xml b/indra/newview/skins/default/xui/ja/floater_goto_line.xml new file mode 100644 index 0000000000..5f2717ace5 --- /dev/null +++ b/indra/newview/skins/default/xui/ja/floater_goto_line.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="script goto" title="è¡Œã«ç§»å‹•"> + <button label="OK" label_selected="OK" name="goto_btn"/> + <text name="txt"> + è¡Œã«ç§»å‹• + </text> +</floater> diff --git a/indra/newview/skins/default/xui/ja/floater_im_session.xml b/indra/newview/skins/default/xui/ja/floater_im_session.xml index a44c843df7..7ed46f7f01 100755 --- a/indra/newview/skins/default/xui/ja/floater_im_session.xml +++ b/indra/newview/skins/default/xui/ja/floater_im_session.xml @@ -34,13 +34,11 @@ <layout_panel name="body_panel"> <layout_stack name="im_panels"> <layout_panel name="right_part_holder"> - <panel name="trnsAndChat_panel"> - <layout_stack name="translate_and_chat_stack"> - <layout_panel name="translate_chat_checkbox_lp"> - <check_box label="ãƒãƒ£ãƒƒãƒˆã‚’翻訳" name="translate_chat_checkbox"/> - </layout_panel> - </layout_stack> - </panel> + <layout_stack name="translate_and_chat_stack"> + <layout_panel name="translate_chat_checkbox_lp"> + <check_box label="ãƒãƒ£ãƒƒãƒˆã‚’翻訳" name="translate_chat_checkbox"/> + </layout_panel> + </layout_stack> </layout_panel> </layout_stack> </layout_panel> diff --git a/indra/newview/skins/default/xui/ja/floater_pathfinding_console.xml b/indra/newview/skins/default/xui/ja/floater_pathfinding_console.xml index 9733c61918..ec107f3e6b 100755 --- a/indra/newview/skins/default/xui/ja/floater_pathfinding_console.xml +++ b/indra/newview/skins/default/xui/ja/floater_pathfinding_console.xml @@ -71,7 +71,7 @@ <text name="show_label"> 表示: </text> - <check_box label="テスト" name="show_world"/> + <check_box label="世界" name="show_world"/> <check_box label="å¯å‹•ç‰©ã®ã¿" name="show_world_movables_only"/> <check_box label="ナビメッシュ" name="show_navmesh"/> <text name="show_walkability_label"> diff --git a/indra/newview/skins/default/xui/ja/menu_attachment_other.xml b/indra/newview/skins/default/xui/ja/menu_attachment_other.xml index 5adf0b3745..930af10692 100755 --- a/indra/newview/skins/default/xui/ja/menu_attachment_other.xml +++ b/indra/newview/skins/default/xui/ja/menu_attachment_other.xml @@ -11,7 +11,9 @@ <menu_item_call label="フリーズ" name="Freeze..."/> <menu_item_call label="追放" name="Eject..."/> <menu_item_call label="テクスãƒãƒ£ã®ãƒ‡ãƒãƒƒã‚°" name="Debug..."/> + <menu_item_call label="ダンプ XML" name="Dump XML"/> <menu_item_call label="ズームイン" name="Zoom In"/> <menu_item_call label="支払ã†" name="Pay..."/> <menu_item_call label="オブジェクトã®ãƒ—ãƒãƒ•ã‚£ãƒ¼ãƒ«" name="Object Inspect"/> + <menu_item_call label="パーティクル所有者をブãƒãƒƒã‚¯" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/ja/menu_attachment_self.xml b/indra/newview/skins/default/xui/ja/menu_attachment_self.xml index 6036e1075e..d87ef8e2a0 100755 --- a/indra/newview/skins/default/xui/ja/menu_attachment_self.xml +++ b/indra/newview/skins/default/xui/ja/menu_attachment_self.xml @@ -12,5 +12,7 @@ <menu_item_call label="グループ" name="Groups..."/> <menu_item_call label="プãƒãƒ•ã‚£ãƒ¼ãƒ«" name="Profile..."/> <menu_item_call label="テクスãƒãƒ£ã®ãƒ‡ãƒãƒƒã‚°" name="Debug..."/> + <menu_item_call label="ダンプ XML" name="Dump XML"/> <menu_item_call label="下ã«è½ã¨ã™" name="Drop"/> + <menu_item_call label="パーティクル所有者をブãƒãƒƒã‚¯" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/ja/menu_avatar_other.xml b/indra/newview/skins/default/xui/ja/menu_avatar_other.xml index 54dd96f5ef..f9cadc36ac 100755 --- a/indra/newview/skins/default/xui/ja/menu_avatar_other.xml +++ b/indra/newview/skins/default/xui/ja/menu_avatar_other.xml @@ -11,6 +11,8 @@ <menu_item_call label="フリーズ" name="Freeze..."/> <menu_item_call label="追放" name="Eject..."/> <menu_item_call label="テクスãƒãƒ£ã®ãƒ‡ãƒãƒƒã‚°" name="Debug..."/> + <menu_item_call label="ダンプ XML" name="Dump XML"/> <menu_item_call label="ズームイン" name="Zoom In"/> <menu_item_call label="支払ã†" name="Pay..."/> + <menu_item_call label="パーティクル所有者をブãƒãƒƒã‚¯" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/ja/menu_avatar_self.xml b/indra/newview/skins/default/xui/ja/menu_avatar_self.xml index 4709522665..eb8e98059a 100755 --- a/indra/newview/skins/default/xui/ja/menu_avatar_self.xml +++ b/indra/newview/skins/default/xui/ja/menu_avatar_self.xml @@ -29,4 +29,6 @@ <menu_item_call label="グループ" name="Groups..."/> <menu_item_call label="プãƒãƒ•ã‚£ãƒ¼ãƒ«" name="Profile..."/> <menu_item_call label="テクスãƒãƒ£ã®ãƒ‡ãƒãƒƒã‚°" name="Debug..."/> + <menu_item_call label="ダンプ XML" name="Dump XML"/> + <menu_item_call label="パーティクル所有者をブãƒãƒƒã‚¯" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/ja/menu_conversation.xml b/indra/newview/skins/default/xui/ja/menu_conversation.xml index c7df20d252..66940471da 100644 --- a/indra/newview/skins/default/xui/ja/menu_conversation.xml +++ b/indra/newview/skins/default/xui/ja/menu_conversation.xml @@ -3,6 +3,7 @@ <menu_item_call label="会話を終ãˆã‚‹" name="close_conversation"/> <menu_item_call label="ボイスãƒãƒ£ãƒƒãƒˆã‚’始ã‚ã‚‹" name="open_voice_conversation"/> <menu_item_call label="ボイスãƒãƒ£ãƒƒãƒˆã‚’切æ–ã™ã‚‹" name="disconnect_from_voice"/> + <menu_item_call label="é¸æŠžã—ãŸé …目を閉ã˜ã‚‹" name="close_selected_conversations"/> <menu_item_call label="プãƒãƒ•ã‚£ãƒ¼ãƒ«ã‚’表示" name="view_profile"/> <menu_item_call label="IM" name="im"/> <menu_item_call label="テレãƒãƒ¼ãƒˆã‚’é€ã‚‹" name="offer_teleport"/> diff --git a/indra/newview/skins/default/xui/ja/menu_land.xml b/indra/newview/skins/default/xui/ja/menu_land.xml index 89c122f14f..3754bd7fa4 100755 --- a/indra/newview/skins/default/xui/ja/menu_land.xml +++ b/indra/newview/skins/default/xui/ja/menu_land.xml @@ -6,4 +6,5 @@ <menu_item_call label="å…¥å ´è¨±å¯ã‚’購入" name="Land Buy Pass"/> <menu_item_call label="制作" name="Create"/> <menu_item_call label="地形を編集" name="Edit Terrain"/> + <menu_item_call label="パーティクル所有者をブãƒãƒƒã‚¯" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/ja/menu_login.xml b/indra/newview/skins/default/xui/ja/menu_login.xml index ab6d9e3546..3918732fa8 100755 --- a/indra/newview/skins/default/xui/ja/menu_login.xml +++ b/indra/newview/skins/default/xui/ja/menu_login.xml @@ -18,7 +18,13 @@ <menu_item_call label="利用è¦ç´„を表示" name="TOS"/> <menu_item_call label="クリティカルメッセージを表示" name="Critical"/> <menu_item_call label="Web コンテンツフãƒãƒ¼ã‚¿ãƒ¼ã®ãƒ‡ãƒãƒƒã‚°ãƒ†ã‚¹ãƒˆ" name="Web Content Floater Debug Test"/> - <menu label="ãƒã‚°ãƒ¬ãƒ™ãƒ«ã‚’è¨å®š" name="Set Logging Level"/> + <menu label="ãƒã‚°ãƒ¬ãƒ™ãƒ«ã‚’è¨å®š" name="Set Logging Level"> + <menu_item_check label="デãƒãƒƒã‚°" name="Debug"/> + <menu_item_check label="æƒ…å ±" name="Info"/> + <menu_item_check label="è¦å‘Š" name="Warning"/> + <menu_item_check label="エラー" name="Error"/> + <menu_item_check label="ãªã—" name="None"/> + </menu> <menu_item_check label="グリッドピッカーを表示ã™ã‚‹" name="Show Grid Picker"/> <menu_item_call label="通知コンソールを表示ã™ã‚‹" name="Show Notifications Console"/> </menu> diff --git a/indra/newview/skins/default/xui/ja/menu_mute_particle.xml b/indra/newview/skins/default/xui/ja/menu_mute_particle.xml new file mode 100644 index 0000000000..8dab025309 --- /dev/null +++ b/indra/newview/skins/default/xui/ja/menu_mute_particle.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<!-- *NOTE: See also menu_attachment_other.xml --> +<context_menu name="Mute Particle Pie"> + <menu_item_call label="パーティクル所有者をブãƒãƒƒã‚¯" name="Mute Particle"/> +</context_menu> diff --git a/indra/newview/skins/default/xui/ja/menu_object.xml b/indra/newview/skins/default/xui/ja/menu_object.xml index 01436ad12b..39c32bc41e 100755 --- a/indra/newview/skins/default/xui/ja/menu_object.xml +++ b/indra/newview/skins/default/xui/ja/menu_object.xml @@ -5,13 +5,13 @@ </menu_item_call> <menu_item_call label="編集" name="Edit..."/> <menu_item_call label="制作" name="Build"/> - <menu_item_call label="リンクセットã§è¡¨ç¤º" name="show_in_linksets"/> - <menu_item_call label="ã‚ャラクターã§è¡¨ç¤º" name="show_in_characters"/> <menu_item_call label="é–‹ã" name="Open"/> <menu_item_call label="ã“ã“ã«åº§ã‚‹" name="Object Sit"/> <menu_item_call label="ç«‹ã¡ä¸ŠãŒã‚‹" name="Object Stand Up"/> <menu_item_call label="オブジェクトã®ãƒ—ãƒãƒ•ã‚£ãƒ¼ãƒ«" name="Object Inspect"/> <menu_item_call label="ズームイン" name="Zoom In"/> + <menu_item_call label="リンクセットã§è¡¨ç¤º" name="show_in_linksets"/> + <menu_item_call label="ã‚ャラクターã§è¡¨ç¤º" name="show_in_characters"/> <context_menu label="装ç€" name="Put On"> <menu_item_call label="装ç€" name="Wear"/> <menu_item_call label="è¿½åŠ " name="Add"/> @@ -28,4 +28,5 @@ <menu_item_call label="支払ã†" name="Pay..."/> <menu_item_call label="è²·ã†" name="Buy..."/> <menu_item_call label="削除" name="Delete"/> + <menu_item_call label="パーティクル所有者をブãƒãƒƒã‚¯" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/ja/menu_url_agent.xml b/indra/newview/skins/default/xui/ja/menu_url_agent.xml index 72722db7cc..639602ce3c 100755 --- a/indra/newview/skins/default/xui/ja/menu_url_agent.xml +++ b/indra/newview/skins/default/xui/ja/menu_url_agent.xml @@ -3,6 +3,7 @@ <menu_item_call label="プãƒãƒ•ã‚£ãƒ¼ãƒ«ã‚’表示" name="show_agent"/> <menu_item_call label="IM ã‚’é€ä¿¡..." name="send_im"/> <menu_item_call label="ãƒ•ãƒ¬ãƒ³ãƒ‰ã‚’è¿½åŠ ..." name="add_friend"/> + <menu_item_call label="フレンドを削除..." name="remove_friend"/> <menu_item_call label="åå‰ã‚’クリップボードã«ã‚³ãƒ”ー" name="url_copy_label"/> <menu_item_call label="SLurl をクリップボードã«ã‚³ãƒ”ー" name="url_copy"/> </context_menu> diff --git a/indra/newview/skins/default/xui/ja/menu_url_objectim.xml b/indra/newview/skins/default/xui/ja/menu_url_objectim.xml index 9e340e3239..a02ca8415d 100755 --- a/indra/newview/skins/default/xui/ja/menu_url_objectim.xml +++ b/indra/newview/skins/default/xui/ja/menu_url_objectim.xml @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <context_menu name="Url Popup"> <menu_item_call label="オブジェクトã®ãƒ—ãƒãƒ•ã‚£ãƒ¼ãƒ«..." name="show_object"/> + <menu_item_call label="ブãƒãƒƒã‚¯..." name="block_object"/> <menu_item_call label="地図ã«è¡¨ç¤º" name="show_on_map"/> <menu_item_call label="オブジェクトã®å ´æ‰€ã«ãƒ†ãƒ¬ãƒãƒ¼ãƒˆ" name="teleport_to_object"/> <menu_item_call label="オブジェクトåをクリップボードã«ã‚³ãƒ”ー" name="url_copy_label"/> diff --git a/indra/newview/skins/default/xui/ja/menu_viewer.xml b/indra/newview/skins/default/xui/ja/menu_viewer.xml index 89f58d3bac..b1ec62115c 100755 --- a/indra/newview/skins/default/xui/ja/menu_viewer.xml +++ b/indra/newview/skins/default/xui/ja/menu_viewer.xml @@ -16,7 +16,10 @@ <menu_item_call label="ç§ã®ã‚¢ãƒ‹ãƒ¡ãƒ¼ã‚·ãƒ§ãƒ³ã‚’åœæ¢ã™ã‚‹" name="Stop Animating My Avatar"/> <menu_item_call label="æ©è¡Œï¼èµ°è¡Œï¼é£›è¡Œ..." name="Walk / run / fly"/> </menu> - <menu label="ãƒã‚°ã‚¤ãƒ³" name="Status"/> + <menu label="ãƒã‚°ã‚¤ãƒ³" name="Status"> + <menu_item_check label="一時退å¸ä¸" name="Away"/> + <menu_item_check label="ç€ä¿¡æ‹’å¦" name="Do Not Disturb"/> + </menu> <menu_item_call label="L$ ã®è³¼å…¥..." name="Buy and Sell L$"/> <menu_item_call label="マーãƒãƒ£ãƒ³ãƒˆã‚¢ã‚¦ãƒˆãƒœãƒƒã‚¯ã‚¹..." name="MerchantOutbox"/> <menu_item_call label="マイアカウント..." name="Manage My Account"> @@ -32,6 +35,7 @@ <menu_item_check label="会話..." name="Conversations"/> <menu_item_check label="è¿‘ãã®ãƒãƒ£ãƒƒãƒˆ..." name="Nearby Chat"/> <menu_item_check label="話ã™" name="Speak"/> + <menu_item_check label="会話ãƒã‚°..." name="Conversation Log..."/> <menu label="ボイスモーフィング" name="VoiceMorphing"> <menu_item_check label="ボイスモーフィングãªã—" name="NoVoiceMorphing"/> <menu_item_check label="プレビュー..." name="Preview"/> @@ -42,6 +46,7 @@ <menu_item_check label="グループ" name="My Groups"/> <menu_item_check label="è¿‘ãã«ã„る人" name="Active Speakers"/> <menu_item_call label="リストをブãƒãƒƒã‚¯" name="Block List"/> + <menu_item_check label="ç€ä¿¡æ‹’å¦" name="Do Not Disturb"/> </menu> <menu label="世界" name="World"> <menu_item_call label="ç¾åœ¨åœ°ã‚’ランドマーク" name="Create Landmark Here"/> @@ -110,6 +115,7 @@ <menu_item_call label="次ã®éƒ¨åˆ†ã‚’å«ã‚ã‚‹" name="Include Next Part"/> <menu_item_call label="å‰å›žã®éƒ¨åˆ†ã‚’å«ã‚ã‚‹" name="Include Previous Part"/> </menu> + <menu_item_call label="リンクセット..." name="pathfinding_linkset_menu_item"/> <menu_item_call label="é¸æŠžã—ãŸã‚‚ã®ã«ç„¦ç‚¹ã‚’åˆã‚ã›ã‚‹" name="Focus on Selection"/> <menu_item_call label="é¸æŠžã—ãŸã‚‚ã®ã‚’ズームã™ã‚‹" name="Zoom to Selection"/> <menu label="オブジェクト" name="Object"> @@ -279,6 +285,7 @@ <menu_item_check label="フレームレートをランダム化" name="Randomize Framerate"/> <menu_item_check label="定期的ã«é…ã„フレームを挿入ã™ã‚‹" name="Periodic Slow Frame"/> <menu_item_check label="フレームテスト" name="Frame Test"/> + <menu_item_call label="フレームプãƒãƒ•ã‚£ãƒ¼ãƒ«" name="Frame Profile"/> </menu> <menu label="メタデータã®ãƒ¬ãƒ³ãƒ€ãƒ¼" name="Render Metadata"> <menu_item_check label="ãƒã‚¦ãƒ³ãƒ‡ã‚£ãƒ³ã‚°ãƒœãƒƒã‚¯ã‚¹" name="Bounding Boxes"/> @@ -313,9 +320,10 @@ <menu_item_check label="軸" name="Axes"/> <menu_item_check label="接線基底" name="Tangent Basis"/> <menu_item_call label="é¸æŠžã—ãŸãƒ†ã‚¯ã‚¹ãƒãƒ£æƒ…å ±åŸºåº•" name="Selected Texture Info Basis"/> + <menu_item_call label="é¸æŠžã—ãŸãƒžãƒ†ãƒªã‚¢ãƒ«æƒ…å ±" name="Selected Material Info"/> <menu_item_check label="ワイヤーフレーム" name="Wireframe"/> <menu_item_check label="オブジェクト間オクルージョン" name="Object-Object Occlusion"/> - <menu_item_check label="å…‰ã¨å½±" name="Advanced Lighting Model"/> + <menu_item_check label="高度ãªãƒ©ã‚¤ãƒ†ã‚£ãƒ³ã‚°ãƒ¢ãƒ‡ãƒ«" name="Advanced Lighting Model"/> <menu_item_check label="太陽・月・プãƒã‚¸ã‚§ã‚¯ã‚¿ã‹ã‚‰ã®å½±" name="Shadows from Sun/Moon/Projectors"/> <menu_item_check label="SSAO ã¨å½±ã®å¹³æ»‘化" name="SSAO and Shadow Smoothing"/> <menu_item_check label="GL デãƒãƒƒã‚°" name="Debug GL"/> @@ -325,7 +333,6 @@ <menu_item_check label="アニメーションテクスãƒãƒ£" name="Animation Textures"/> <menu_item_check label="テクスãƒãƒ£ã‚’無効ã«ã™ã‚‹" name="Disable Textures"/> <menu_item_check label="フル解åƒåº¦ãƒ†ã‚¯ã‚¹ãƒãƒ£" name="Rull Res Textures"/> - <menu_item_check label="テクスãƒãƒ£ã‚¢ãƒˆãƒ©ã‚¹ï¼ˆè©¦é¨“段階)" name="Texture Atlas"/> <menu_item_check label="装ç€ã•ã‚ŒãŸå…‰æºã‚’æç”»ã™ã‚‹" name="Render Attached Lights"/> <menu_item_check label="å–り付ã‘られãŸãƒ‘ーティクルをæç”»ã™ã‚‹" name="Render Attached Particles"/> <menu_item_check label="マウスオーãƒãƒ¼ã§å¼·èª¿è¡¨ç¤ºã™ã‚‹" name="Hover Glow Objects"/> @@ -361,7 +368,6 @@ <menu_item_call label="フォーカスホールダーをダンプ" name="Dump Focus Holder"/> <menu_item_call label="é¸æŠžã—ãŸã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆæƒ…å ±ã‚’ãƒ—ãƒªãƒ³ãƒˆ" name="Print Selected Object Info"/> <menu_item_call label="ã‚¨ãƒ¼ã‚¸ã‚§ãƒ³ãƒˆæƒ…å ±ã‚’ãƒ—ãƒªãƒ³ãƒˆ" name="Print Agent Info"/> - <menu_item_call label="メモリ使用状æ³" name="Memory Stats"/> <menu_item_check label="地域デãƒãƒƒã‚°ã‚³ãƒ³ã‚½ãƒ¼ãƒ«" name="Region Debug Console"/> <menu_item_check label="SelectMgr ã®ãƒ‡ãƒãƒƒã‚°" name="Debug SelectMgr"/> <menu_item_check label="ダブルクリック" name="Debug Clicks"/> diff --git a/indra/newview/skins/default/xui/ja/notifications.xml b/indra/newview/skins/default/xui/ja/notifications.xml index 356506f191..f1c916bf53 100755 --- a/indra/newview/skins/default/xui/ja/notifications.xml +++ b/indra/newview/skins/default/xui/ja/notifications.xml @@ -150,7 +150,7 @@ <usetemplate canceltext="å–り消ã—" name="yesnocancelbuttons" notext="ä¿å˜ã—ãªã„" yestext="ã™ã¹ã¦ä¿å˜"/> </notification> <notification name="FriendsAndGroupsOnly"> - フレンド以外ã‹ã‚‰ã®ã‚³ãƒ¼ãƒ«ã‚„インスタントメッセージを無視ã™ã‚‹è¨å®šã«ã—ãŸã“ã¨ã‚’ã€ç›¸æ‰‹ã«çŸ¥ã‚‰ã‚Œã‚‹ã“ã¨ã¯ã‚ã‚Šã¾ã›ã‚“。 + フレンド以外ã®äººã‹ã‚‰ã®ã‚³ãƒ¼ãƒ«ã‚„ã€ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ãƒˆãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ã‚’無視ã™ã‚‹è¨å®šã«ã—ãŸã“ã¨ã‚’ã€ç›¸æ‰‹ã«çŸ¥ã‚‰ã‚Œã‚‹ã“ã¨ã¯ã‚ã‚Šã¾ã›ã‚“。 <usetemplate name="okbutton" yestext="OK"/> </notification> <notification name="FavoritesOnLogin"> @@ -221,6 +221,14 @@ ã“ã®èƒ½åŠ›ã‚’ [ROLE_NAME] ã«å‰²ã‚Šå½“ã¦ã¾ã™ã‹ï¼Ÿ <usetemplate name="okcancelbuttons" notext="ã„ã„ãˆ" yestext="ã¯ã„"/> </notification> + <notification name="EjectGroupMemberWarning"> + [AVATAR_NAME] をグループã‹ã‚‰è¿½æ”¾ã—よã†ã¨ã—ã¦ã„ã¾ã™ã€‚ + <usetemplate ignoretext="グループã‹ã‚‰ã®å‚åŠ è€…ã®è¿½æ”¾ã‚’確èªã—ã¾ã™" name="okcancelignore" notext="å–り消ã—" yestext="追放"/> + </notification> + <notification name="EjectGroupMembersWarning"> + [COUNT] åã®ãƒ¡ãƒ³ãƒãƒ¼ã‚’グループã‹ã‚‰è¿½æ”¾ã—よã†ã¨ã—ã¦ã„ã¾ã™ã€‚ + <usetemplate ignoretext="グループã‹ã‚‰ã®è¤‡æ•°ã®ãƒ¡ãƒ³ãƒãƒ¼ã®è¿½æ”¾ã‚’確èªã—ã¾ã™" name="okcancelignore" notext="å–り消ã—" yestext="追放"/> + </notification> <notification name="AttachmentDrop"> アタッãƒãƒ¡ãƒ³ãƒˆã‚’下ã«ç½®ã“ã†ã¨ã—ã¦ã„ã¾ã™ã€‚ 続ã‘ã¾ã™ã‹ï¼Ÿ @@ -1139,7 +1147,7 @@ https://wiki.secondlife.com/wiki/Adding_Spelling_Dictionaries ã‚’å‚ç…§ã—ã¦ã 金é¡ã‚’増やã—ã¦ãã ã•ã„。 </notification> <notification name="ConfirmItemDeleteHasLinks"> - ã“ã“ã«ãƒªãƒ³ã‚¯ã•ã‚ŒãŸã‚¢ã‚¤ãƒ†ãƒ ãŒå°‘ãªãã¨ã‚‚1ã¤ã‚ã‚Šã¾ã™ã€‚ ã“ã®ã‚¢ã‚¤ãƒ†ãƒ を削除ã™ã‚‹ã¨ã“ã“ã«ãƒªãƒ³ã‚¯ã•ã‚ŒãŸã‚‚ã®ãŒæ©Ÿèƒ½ã—ãªããªã‚Šã¾ã™ã€‚ リンクを先ã«å‰Šé™¤ã™ã‚‹ã“ã¨ã‚’å¼·ããŠå‹§ã‚ã—ã¾ã™ã€‚ + 1 ã¤ä»¥ä¸Šã®ã‚¢ã‚¤ãƒ†ãƒ ã«ãƒã‚¤ãƒ³ãƒˆã™ã‚‹ãƒªãƒ³ã‚¯ãŒã‚ã‚Šã¾ã™ã€‚ã“ã®ã‚¢ã‚¤ãƒ†ãƒ を削除ã™ã‚‹å ´åˆã€ãã®ãƒªãƒ³ã‚¯ã¯æ°¸ä¹…ã«æ©Ÿèƒ½ã—ãªããªã‚Šã¾ã™ã€‚ã¾ãšæœ€åˆã«ãƒªãƒ³ã‚¯ã‚’削除ã™ã‚‹ã“ã¨ã‚’å¼·ããŠå‹§ã‚ã—ã¾ã™ã€‚ ã“れらã®ã‚¢ã‚¤ãƒ†ãƒ を削除ã—ã¾ã™ã‹ï¼Ÿ <usetemplate name="okcancelbuttons" notext="ã‚ャンセル" yestext="OK"/> @@ -1157,9 +1165,9 @@ https://wiki.secondlife.com/wiki/Adding_Spelling_Dictionaries ã‚’å‚ç…§ã—ã¦ã <usetemplate name="okcancelbuttons" notext="ã‚ャンセル" yestext="OK"/> </notification> <notification name="ConfirmObjectDeleteNoOwn"> - é¸æŠžã—ãŸã‚¢ã‚¤ãƒ†ãƒ ã®ã†ã¡ã€å°‘ãªãã¨ã‚‚ 1 ã¤ãŒã‚ãªãŸã®æ‰€æœ‰ç‰©ã§ã¯ã‚ã‚Šã¾ã›ã‚“。 + é¸æŠžã—ãŸã‚¢ã‚¤ãƒ†ãƒ ã® 1 ã¤ä»¥ä¸Šã‚’所有ã—ã¦ã„ã¾ã›ã‚“。 -本当ã«å‰Šé™¤ã—ã¾ã™ã‹ï¼Ÿ +ã“れらã®ã‚¢ã‚¤ãƒ†ãƒ を削除ã—ã¾ã™ã‹ï¼Ÿ <usetemplate name="okcancelbuttons" notext="ã‚ャンセル" yestext="OK"/> </notification> <notification name="ConfirmObjectDeleteLockNoCopy"> @@ -1170,26 +1178,26 @@ https://wiki.secondlife.com/wiki/Adding_Spelling_Dictionaries ã‚’å‚ç…§ã—ã¦ã <usetemplate name="okcancelbuttons" notext="ã‚ャンセル" yestext="OK"/> </notification> <notification name="ConfirmObjectDeleteLockNoOwn"> - å°‘ãªãã¨ã‚‚ 1 ã¤ã®ã‚ªãƒ–ジェクトãŒãƒãƒƒã‚¯ã•ã‚Œã¦ã„ã¾ã™ã€‚ -å°‘ãªãã¨ã‚‚ 1 ã¤ã®ã‚ªãƒ–ジェクトãŒã€ã‚ãªãŸã®æ‰€æœ‰ç‰©ã§ã¯ã‚ã‚Šã¾ã›ã‚“。 + 1 ã¤ä»¥ä¸Šã®ã‚ªãƒ–ジェクトãŒãƒãƒƒã‚¯ã•ã‚Œã¾ã—ãŸã€‚ +1 ã¤ä»¥ä¸Šã®ã‚ªãƒ–ジェクトを所有ã—ã¦ã„ã¾ã›ã‚“。 -本当ã«å‰Šé™¤ã—ã¾ã™ã‹ï¼Ÿ +ã“れらã®ã‚¢ã‚¤ãƒ†ãƒ を削除ã—ã¾ã™ã‹ï¼Ÿ <usetemplate name="okcancelbuttons" notext="ã‚ャンセル" yestext="OK"/> </notification> <notification name="ConfirmObjectDeleteNoCopyNoOwn"> - å°‘ãªãã¨ã‚‚ 1 ã¤ã®ã‚ªãƒ–ジェクトãŒã‚³ãƒ”ーã§ãã¾ã›ã‚“。 -å°‘ãªãã¨ã‚‚ 1 ã¤ã®ã‚ªãƒ–ジェクトãŒã€ã‚ãªãŸã®æ‰€æœ‰ç‰©ã§ã¯ã‚ã‚Šã¾ã›ã‚“。 + 1 ã¤ä»¥ä¸Šã®ã‚ªãƒ–ジェクトãŒã‚³ãƒ”ーã§ãã¾ã›ã‚“。 +1 ã¤ä»¥ä¸Šã®ã‚ªãƒ–ジェクトを所有ã—ã¦ã„ã¾ã›ã‚“。 -本当ã«å‰Šé™¤ã—ã¾ã™ã‹ï¼Ÿ +ã“れらã®ã‚¢ã‚¤ãƒ†ãƒ を削除ã—ã¾ã™ã‹ï¼Ÿ <usetemplate name="okcancelbuttons" notext="ã‚ャンセル" yestext="OK"/> </notification> <notification name="ConfirmObjectDeleteLockNoCopyNoOwn"> - å°‘ãªãã¨ã‚‚ 1 ã¤ã®ã‚ªãƒ–ジェクトãŒãƒãƒƒã‚¯ã•ã‚Œã¦ã„ã¾ã™ã€‚ -å°‘ãªãã¨ã‚‚ 1 ã¤ã®ã‚ªãƒ–ジェクトãŒã‚³ãƒ”ーã§ãã¾ã›ã‚“。 -å°‘ãªãã¨ã‚‚ 1 ã¤ã®ã‚ªãƒ–ジェクトãŒã€ã‚ãªãŸã®æ‰€æœ‰ç‰©ã§ã¯ã‚ã‚Šã¾ã›ã‚“。 + 1 ã¤ä»¥ä¸Šã®ã‚ªãƒ–ジェクトãŒãƒãƒƒã‚¯ã•ã‚Œã¦ã„ã¾ã™ã€‚ +1 ã¤ä»¥ä¸Šã®ã‚ªãƒ–ジェクトãŒã‚³ãƒ”ーã§ãã¾ã›ã‚“。 +1 ã¤ä»¥ä¸Šã®ã‚ªãƒ–ジェクトを所有ã—ã¦ã„ã¾ã›ã‚“。 -本当ã«å‰Šé™¤ã—ã¾ã™ã‹ï¼Ÿ - <usetemplate name="okcancelbuttons" notext="ã‚ャンセル" yestext="OK"/> +ã“れらã®ã‚¢ã‚¤ãƒ†ãƒ を削除ã—ã¾ã™ã‹ï¼Ÿ + <usetemplate name="okcancelbuttons" notext="å–り消ã—" yestext="OK"/> </notification> <notification name="ConfirmObjectTakeLock"> å°‘ãªãã¨ã‚‚ 1 ã¤ã®ã‚ªãƒ–ジェクトãŒãƒãƒƒã‚¯ã•ã‚Œã¦ã„ã¾ã™ã€‚ @@ -1513,13 +1521,43 @@ http://secondlife.com/download ã‹ã‚‰æœ€æ–°ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã‚’ダウンãƒãƒ¼ãƒ‰ã </notification> <notification name="RequiredUpdateDownloadedVerboseDialog"> å¿…è¦ãªã‚½ãƒ•ãƒˆã‚¦ã‚§ã‚¢ã®ã‚¢ãƒƒãƒ—デートをダウンãƒãƒ¼ãƒ‰ã—ã¾ã—ãŸã€‚ -ãƒãƒ¼ã‚¸ãƒ§ãƒ³ [VERSION] +ãƒãƒ¼ã‚¸ãƒ§ãƒ³ [VERSION] [[INFO_URL] ã“ã®ã‚¢ãƒƒãƒ—デートã«é–¢ã™ã‚‹æƒ…å ±] アップデートをインストールã™ã‚‹ã«ã¯ [APP_NAME] ã‚’å†èµ·å‹•ã™ã‚‹å¿…è¦ãŒã‚ã‚Šã¾ã™ã€‚ <usetemplate name="okbutton" yestext="OK"/> </notification> <notification name="RequiredUpdateDownloadedDialog"> アップデートをインストールã™ã‚‹ã«ã¯ [APP_NAME] ã‚’å†èµ·å‹•ã™ã‚‹å¿…è¦ãŒã‚ã‚Šã¾ã™ã€‚ +[[INFO_URL] ã“ã®ã‚¢ãƒƒãƒ—デートã«é–¢ã™ã‚‹æƒ…å ±] + <usetemplate name="okbutton" yestext="OK"/> + </notification> + <notification name="OtherChannelDownloadBackgroundTip"> + ãŠä½¿ã„ã® [APP_NAME] ã«å¿…è¦ãªã‚¢ãƒƒãƒ—デートをダウンãƒãƒ¼ãƒ‰ã—ã¾ã—ãŸã€‚ +ãƒãƒ¼ã‚¸ãƒ§ãƒ³ [VERSION] +ã“ã®è©¦é¨“çš„ãªãƒ“ューア㌠[NEW_CHANNEL] ビューアã«ç½®ãæ›ãˆã‚‰ã‚Œã¦ã„ã¾ã™; +ã“ã®ã‚¢ãƒƒãƒ—デートã®è©³ç´°ã«ã¤ã„ã¦ã¯ã€[[INFO_URL] ã‚’å‚ç…§ã—ã¦ãã ã•ã„] + <usetemplate name="okcancelbuttons" notext="後ã§å®Ÿè¡Œ" yestext="今ã™ãインストールã—㦠[APP_NAME] ã‚’å†èµ·å‹•"/> + </notification> + <notification name="OtherChannelDownloadBackgroundDialog"> + ãŠä½¿ã„ã® [APP_NAME] ã«å¿…è¦ãªã‚¢ãƒƒãƒ—デートをダウンãƒãƒ¼ãƒ‰ã—ã¾ã—ãŸã€‚ +ãƒãƒ¼ã‚¸ãƒ§ãƒ³ [VERSION] +ã“ã®è©¦é¨“çš„ãªãƒ“ューア㌠[NEW_CHANNEL] ビューアã«ç½®ãæ›ãˆã‚‰ã‚Œã¦ã„ã¾ã™; +[[INFO_URL] ã“ã®ã‚¢ãƒƒãƒ—デートã«é–¢ã™ã‚‹æƒ…å ±] ã‚’å‚ç…§ + <usetemplate name="okcancelbuttons" notext="後ã§å®Ÿè¡Œ" yestext="今ã™ãインストールã—㦠[APP_NAME] ã‚’å†èµ·å‹•"/> + </notification> + <notification name="OtherChannelRequiredUpdateDownloadedVerboseDialog"> + å¿…è¦ãªã‚½ãƒ•ãƒˆã‚¦ã‚§ã‚¢ã®ã‚¢ãƒƒãƒ—デートをダウンãƒãƒ¼ãƒ‰ã—ã¾ã—ãŸã€‚ +ãƒãƒ¼ã‚¸ãƒ§ãƒ³ [VERSION] +ã“ã®è©¦é¨“çš„ãªãƒ“ューア㌠[NEW_CHANNEL] ビューアã«ç½®ãæ›ãˆã‚‰ã‚Œã¦ã„ã¾ã™; +[[INFO_URL] ã“ã®ã‚¢ãƒƒãƒ—デートã«é–¢ã™ã‚‹æƒ…å ±] ã‚’å‚ç…§ + +アップデートをインストールã™ã‚‹ã«ã¯ [APP_NAME] ã‚’å†èµ·å‹•ã™ã‚‹å¿…è¦ãŒã‚ã‚Šã¾ã™ã€‚ + <usetemplate name="okbutton" yestext="OK"/> + </notification> + <notification name="OtherChannelRequiredUpdateDownloadedDialog"> + アップデートをインストールã™ã‚‹ã«ã¯ [APP_NAME] ã‚’å†èµ·å‹•ã™ã‚‹å¿…è¦ãŒã‚ã‚Šã¾ã™ã€‚ +ã“ã®è©¦é¨“çš„ãªãƒ“ューア㌠[NEW_CHANNEL] ビューアã«ç½®ãæ›ãˆã‚‰ã‚Œã¦ã„ã¾ã™; +[[INFO_URL] ã“ã®ã‚¢ãƒƒãƒ—デートã«é–¢ã™ã‚‹æƒ…å ±] ã‚’å‚ç…§ <usetemplate name="okbutton" yestext="OK"/> </notification> <notification name="DeedObjectToGroup"> @@ -1572,6 +1610,10 @@ http://secondlife.com/download ã‹ã‚‰æœ€æ–°ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã‚’ダウンãƒãƒ¼ãƒ‰ã グループã‹ã‚‰è„±é€€ã—ã¾ã™ã‹ï¼Ÿ <usetemplate name="okcancelbuttons" notext="å–り消ã—" yestext="OK"/> </notification> + <notification name="OwnerCannotLeaveGroup"> + グループを抜ã‘ã‚‹ã“ã¨ãŒã§ãã¾ã›ã‚“。グループã®æœ€å¾Œã®ã‚ªãƒ¼ãƒŠãƒ¼ã§ã‚ã‚‹ãŸã‚ã€ã‚°ãƒ«ãƒ¼ãƒ—を抜ã‘ã‚‹ã“ã¨ãŒã§ãã¾ã›ã‚“。最åˆã«ã€åˆ¥ã®ãƒ¡ãƒ³ãƒãƒ¼ã‚’オーナーã®å½¹å‰²ã«å‰²ã‚Šå½“ã¦ã¦ãã ã•ã„。 + <usetemplate name="okbutton" yestext="OK"/> + </notification> <notification name="ConfirmKick"> 本当ã«ä½äººå…¨å“¡ã‚’グリッドã‹ã‚‰è¿½ã„出ã—ã¾ã™ã‹ï¼Ÿ <usetemplate name="okcancelbuttons" notext="ã‚ャンセル" yestext="ä½äººå…¨å“¡ã‚’追ã„出ã™"/> @@ -2443,9 +2485,7 @@ Web ページã«ãƒªãƒ³ã‚¯ã™ã‚‹ã¨ã€ä»–人ãŒã“ã®å ´æ‰€ã«ç°¡å˜ã«ã‚¢ã‚¯ã‚»ã 「テレãƒãƒ¼ãƒˆã€ã‚’é¸æŠžã—ã¦å®Ÿè¡Œã™ã‚‹ã“ã¨ã‚‚ã§ãã¾ã™ã€‚) </notification> <notification name="TeleportToPerson"> - [NAME] ã®ã‚ˆã†ãªä½äººã«é€£çµ¡ã‚’ã¨ã‚‹ã«ã¯ã€ã€Œäººã€ãƒœã‚¿ãƒ³ã‚’クリックã—ã€è¡¨ç¤ºã•ã‚Œã‚‹ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã§ã€Œä½äººã€ã‚’é¸æŠžã—ã¦ã‹ã‚‰ã€ -ウィンドウ下部ã«ã‚る「IMã€ã‚’クリックã—ã¾ã™ã€‚ -(リストã®åå‰ã‚’ダブルクリックã€ã¾ãŸã¯å³ã‚¯ãƒªãƒƒã‚¯ã—ã¦ã€ŒIMã€ã‚’é¸ã‚“ã§ã‚‚åŒã˜ã§ã™ã€‚) + 誰ã‹ã¨ã®ãƒ—ライベートãªä¼šè©±ã‚’é–‹ãã«ã¯ã€ç›¸æ‰‹ã®ã‚¢ãƒã‚¿ãƒ¼ã‚’クリックã—ã¦ã€ãƒ¡ãƒ‹ãƒ¥ãƒ¼ã‹ã‚‰ã€ŒIMã€ã‚’é¸æŠžã—ã¾ã™ã€‚ </notification> <notification name="CantSelectLandFromMultipleRegions"> サーãƒãƒ¼ã®å¢ƒç•Œã‚’越ãˆã¦åœŸåœ°ã‚’é¸æŠžã™ã‚‹ã“ã¨ã§ãã¾ã›ã‚“。 @@ -2820,6 +2860,15 @@ Web ページã«ãƒªãƒ³ã‚¯ã™ã‚‹ã¨ã€ä»–人ãŒã“ã®å ´æ‰€ã«ç°¡å˜ã«ã‚¢ã‚¯ã‚»ã <button name="Deny" text="æ‹’å¦"/> </form> </notification> + <notification name="UnknownScriptQuestion"> + '[NAME]' ãŒæ‰€æœ‰ã™ã‚‹ '<nolink>[OBJECTNAME]</nolink>' ã«ã‚ˆã£ã¦ãƒªã‚¯ã‚¨ã‚¹ãƒˆã•ã‚ŒãŸãƒ©ãƒ³ã‚¿ã‚¤ãƒ スクリプト権é™ãŒãƒ“ューアã«ã‚ˆã£ã¦èªè˜ã•ã‚Œãªã„ãŸã‚ã€è¨±å¯ã§ãã¾ã›ã‚“。 + +ã“ã®æ¨©é™ã‚’許å¯ã™ã‚‹ã«ã¯ã€ãƒ“ューアを [DOWNLOADURL] ã‹ã‚‰ã®æœ€æ–°ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã«ã‚¢ãƒƒãƒ—デートã—ã¦ãã ã•ã„。 + <form name="form"> + <button name="Deny" text="Ok"/> + <button name="Mute" text="ブãƒãƒƒã‚¯"/> + </form> + </notification> <notification name="ScriptDialog"> [NAME] ã®ã€Œ<nolink>[TITLE]</nolink>〠[MESSAGE] diff --git a/indra/newview/skins/default/xui/ja/panel_people.xml b/indra/newview/skins/default/xui/ja/panel_people.xml index 03ce87537a..dd8fd41681 100755 --- a/indra/newview/skins/default/xui/ja/panel_people.xml +++ b/indra/newview/skins/default/xui/ja/panel_people.xml @@ -49,6 +49,9 @@ <menu_button name="plus_btn" tool_tip="グループã«å‚åŠ / æ–°è¦ã‚°ãƒ«ãƒ¼ãƒ—を作æˆã—ã¾ã™"/> <dnd_button name="minus_btn" tool_tip="é¸æŠžã—ãŸã‚°ãƒ«ãƒ¼ãƒ—ã‹ã‚‰è„±é€€"/> </panel> + <text name="groupcount"> + ã‚ãªãŸã¯[COUNT]グループã«å±žã—ã¦ã„ã‚‹ã®ã§ã€ã¾ã [REMAINING]å‚åŠ ã§ãã¾ã™ã€‚ + </text> </panel> <panel label="最新" name="recent_panel"> <panel label="bottom_panel" name="recent_buttons_panel"> diff --git a/indra/newview/skins/default/xui/ja/panel_preferences_chat.xml b/indra/newview/skins/default/xui/ja/panel_preferences_chat.xml index ae5391c7bd..1c3204ea04 100755 --- a/indra/newview/skins/default/xui/ja/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/ja/panel_preferences_chat.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <panel label="ãƒãƒ£ãƒƒãƒˆ" name="chat"> - <panel> + <panel name="general_chat_settings"> <check_box initial_value="true" label="ãƒãƒ£ãƒƒãƒˆä¸ã«ã‚¿ã‚¤ãƒ”ング動作ã®ã‚¢ãƒ‹ãƒ¡ãƒ¼ã‚·ãƒ§ãƒ³ã‚’å†ç”Ÿ" name="play_typing_animation"/> <check_box label="オフライン時ã«å—ã‘å–ã£ãŸ IM をメールã§å—ä¿¡" name="send_im_to_email"/> <check_box label="フレンドã¨ã‚°ãƒ«ãƒ¼ãƒ—以外ã‹ã‚‰ã¯ã‚³ãƒ¼ãƒ«ã¨ IM ã‚’å—ä¿¡ã—ãªã„" name="voice_call_friends_only_check"/> @@ -14,71 +14,83 @@ </combo_box> <check_box label="å¹ã出ã—ãƒãƒ£ãƒƒãƒˆ" name="bubble_text_chat"/> </panel> - <panel> - <text name="notifications"> - 通知 - </text> + <panel name="im_notification_settings"> <text name="friend_ims"> フレンド IM: </text> <combo_box name="FriendIMOptions"> - <item label="会話ウィンドウを開ã" name="OpenConversationsWindow" value="openconversations"/> - <item label="メッセージã®ãƒãƒƒãƒ—アップ" name="PopUpMessage" value="toast"/> - <item label="Flash ツールãƒãƒ¼ãƒœã‚¿ãƒ³" name="FlashToolbarButton" value="flash"/> - <item label="フィルターãªã—" name="None" value="none"/> + <item label="é–‹ã„ã¦ã„る会話ウィンドウ" name="OpenConversationsWindow" value="openconversations"/> + <item label="メッセージをãƒãƒƒãƒ—アップ表示" name="PopUpMessage" value="トースト"/> + <item label="フラッシュ ツールãƒãƒ¼ ボタン" name="FlashToolbarButton" value="フラッシュ"/> + <item label="動作ãªã—" name="NoAction" value="noaction"/> </combo_box> + <check_box label="サウンドをå†ç”Ÿ" name="play_sound_friend_im"/> <text name="non_friend_ims"> - éžãƒ•ãƒ¬ãƒ³ãƒ‰ IM: + フレンドã®ã„ãªã„ IM: </text> <combo_box name="NonFriendIMOptions"> - <item label="会話ウィンドウを開ã" name="OpenConversationsWindow" value="openconversations"/> - <item label="メッセージã®ãƒãƒƒãƒ—アップ" name="PopUpMessage" value="toast"/> - <item label="Flash ツールãƒãƒ¼ãƒœã‚¿ãƒ³" name="FlashToolbarButton" value="flash"/> - <item label="フィルターãªã—" name="None" value="none"/> + <item label="é–‹ã„ã¦ã„る会話ウィンドウ" name="OpenConversationsWindow" value="openconversations"/> + <item label="メッセージをãƒãƒƒãƒ—アップ表示" name="PopUpMessage" value="トースト"/> + <item label="フラッシュ ツールãƒãƒ¼ ボタン" name="FlashToolbarButton" value="フラッシュ"/> + <item label="動作ãªã—" name="NoAction" value="noaction"/> </combo_box> + <check_box label="サウンドをå†ç”Ÿ" name="play_sound_non_friend_im"/> <text name="conference_ims"> - コンファレンス IM: + ä¼šè° IM: </text> <combo_box name="ConferenceIMOptions"> - <item label="会話ウィンドウを開ã" name="OpenConversationsWindow" value="openconversations"/> - <item label="メッセージã®ãƒãƒƒãƒ—アップ" name="PopUpMessage" value="toast"/> - <item label="Flashツールãƒãƒ¼ãƒœã‚¿ãƒ³" name="FlashToolbarButton" value="flash"/> - <item label="フィルターãªã—" name="None" value="none"/> + <item label="é–‹ã„ã¦ã„る会話ウィンドウ" name="OpenConversationsWindow" value="openconversations"/> + <item label="メッセージをãƒãƒƒãƒ—アップ表示" name="PopUpMessage" value="トースト"/> + <item label="フラッシュ ツールãƒãƒ¼ ボタン" name="FlashToolbarButton" value="フラッシュ"/> + <item label="動作ãªã—" name="NoAction" value="noaction"/> </combo_box> + <check_box label="サウンドをå†ç”Ÿ" name="play_sound_conference_im"/> <text name="group_chat"> グループãƒãƒ£ãƒƒãƒˆ: </text> <combo_box name="GroupChatOptions"> - <item label="会話ウィンドウを開ã" name="OpenConversationsWindow" value="openconversations"/> - <item label="メッセージã®ãƒãƒƒãƒ—アップ" name="PopUpMessage" value="toast"/> - <item label="Flash ツールãƒãƒ¼ãƒœã‚¿ãƒ³" name="FlashToolbarButton" value="flash"/> - <item label="ãªã—" name="None" value="none"/> + <item label="é–‹ã„ã¦ã„る会話ウィンドウ" name="OpenConversationsWindow" value="openconversations"/> + <item label="メッセージをãƒãƒƒãƒ—アップ表示" name="PopUpMessage" value="トースト"/> + <item label="フラッシュ ツールãƒãƒ¼ ボタン" name="FlashToolbarButton" value="フラッシュ"/> + <item label="動作ãªã—" name="NoAction" value="noaction"/> </combo_box> + <check_box label="サウンドをå†ç”Ÿ" name="play_sound_group_chat_im"/> <text name="nearby_chat"> è¿‘ãã®ãƒãƒ£ãƒƒãƒˆ: </text> <combo_box name="NearbyChatOptions"> - <item label="会話ウィンドウを開ã" name="OpenConversationsWindow" value="openconversations"/> - <item label="メッセージã®ãƒãƒƒãƒ—アップ" name="PopUpMessage" value="toast"/> - <item label="Flash ツールãƒãƒ¼ãƒœã‚¿ãƒ³" name="FlashToolBarButton" value="flash"/> - <item label="フィルターãªã—" name="None" value="none"/> + <item label="é–‹ã„ã¦ã„る会話ウィンドウ" name="OpenConversationsWindow" value="openconversations"/> + <item label="メッセージをãƒãƒƒãƒ—アップ表示" name="PopUpMessage" value="トースト"/> + <item label="フラッシュ ツールãƒãƒ¼ ボタン" name="FlashToolBarButton" value="フラッシュ"/> + <item label="動作ãªã—" name="NoAction" value="noaction"/> + </combo_box> + <check_box label="サウンドをå†ç”Ÿ" name="play_sound_nearby_chat_im"/> + <text name="object_ims"> + オブジェクト IM: + </text> + <combo_box name="ObjectIMOptions"> + <item label="é–‹ã„ã¦ã„る会話ウィンドウ" name="OpenConversationsWindow" value="openconversations"/> + <item label="メッセージをãƒãƒƒãƒ—アップ表示" name="PopUpMessage" value="トースト"/> + <item label="フラッシュ ツールãƒãƒ¼ ボタン" name="FlashToolBarButton" value="フラッシュ"/> + <item label="動作ãªã—" name="NoAction" value="noaction"/> </combo_box> + <check_box label="サウンドをå†ç”Ÿ" name="play_sound_object_im"/> <text name="notifications_alert"> - ã™ã¹ã¦ã®é€šçŸ¥ã‚’一時的ã«å—ã‘付ã‘ãªã„よã†ã«ã™ã‚‹ã«ã¯ã€ã€Œã‚³ãƒŸãƒ¥ãƒ‹ã‚±ãƒ¼ãƒˆã€>「通知をå—ã‘ãªã„ã€ã‚’使用ã—ã¾ã™ã€‚ + 一時的ã«ã™ã¹ã¦ã®é€šçŸ¥ã‚’åœæ¢ã™ã‚‹ã«ã¯ã€ã€Œã‚³ãƒŸãƒ¥ãƒ‹ã‚±ãƒ¼ã‚·ãƒ§ãƒ³ã€ > 「ç€ä¿¡æ‹’å¦]を使用ã—ã¾ã™ã€‚ </text> </panel> - <panel> + <panel name="play_sound_settings"> <text name="play_sound"> - 音ã®å†ç”Ÿ: + サウンドをå†ç”Ÿ: </text> <check_box label="æ–°ã—ã„会話" name="new_conversation"/> - <check_box label="ボイスコールã®ç€ä¿¡" name="incoming_voice_call"/> - <check_box label="テレãƒãƒ¼ãƒˆã‚’渡ã™" name="teleport_offer"/> - <check_box label="アイテムã®ã‚ªãƒ•ã‚¡ãƒ¼" name="inventory_offer"/> + <check_box label="å—信音声コール" name="incoming_voice_call"/> + <check_box label="テレãƒãƒ¼ãƒˆã‚’é€ã‚‹" name="teleport_offer"/> + <check_box label="インベントリをé€ã‚‹" name="inventory_offer"/> </panel> - <panel> - <button label="ãƒã‚°ã®ã‚¯ãƒªã‚¢..." name="clear_log"/> - <button label="テã‚ストã®å‰Šé™¤..." name="delete_transcripts"/> + <panel name="log_settings"> + <button label="ãƒã‚°ã‚’消去..." name="clear_log"/> + <button label="テã‚ストãƒãƒ£ãƒƒãƒˆã‚’削除..." name="delete_transcripts"/> <button label="å‚ç…§..." label_selected="å‚ç…§" name="log_path_button"/> </panel> <button label="ä»–ã®è¨€èªž..." name="ok_btn"/> diff --git a/indra/newview/skins/default/xui/ja/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/ja/panel_preferences_graphics1.xml index 1786b4befc..15017e330e 100755 --- a/indra/newview/skins/default/xui/ja/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/ja/panel_preferences_graphics1.xml @@ -30,7 +30,7 @@ <check_box initial_value="true" label="è¿‘ãã®å…‰" name="LocalLights"/> <check_box initial_value="true" label="基本シェーダー" name="BasicShaders" tool_tip="ã“ã®ã‚ªãƒ—ションを無効ã«ã™ã‚‹ã¨ã€ã‚°ãƒ©ãƒ•ã‚£ãƒƒã‚¯ã‚«ãƒ¼ãƒ‰ã®ãƒ‰ãƒ©ã‚¤ãƒã®ç¨®é¡žã«ã‚ˆã£ã¦ã¯ã€ã‚¯ãƒ©ãƒƒã‚·ãƒ¥ã™ã‚‹ã®ã‚’防ãŽã¾ã™ã€‚"/> <check_box initial_value="true" label="周囲(大気)シェーダー" name="WindLightUseAtmosShaders"/> - <check_box initial_value="true" label="å…‰ã¨å½±" name="UseLightShaders"/> + <check_box initial_value="true" label="高度ãªãƒ©ã‚¤ãƒ†ã‚£ãƒ³ã‚°ãƒ¢ãƒ‡ãƒ«" name="UseLightShaders"/> <check_box initial_value="true" label="アンビエントオクルージョン" name="UseSSAO"/> <check_box initial_value="true" label="フィールドã®é è¿‘æ„Ÿ" name="UseDoF"/> <text name="shadows_label"> diff --git a/indra/newview/skins/default/xui/ja/panel_preferences_setup.xml b/indra/newview/skins/default/xui/ja/panel_preferences_setup.xml index d90a1632ab..2c0359cb15 100755 --- a/indra/newview/skins/default/xui/ja/panel_preferences_setup.xml +++ b/indra/newview/skins/default/xui/ja/panel_preferences_setup.xml @@ -29,6 +29,7 @@ <combo_box.item label="自動的ã«ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«" name="Install_automatically"/> <combo_box.item label="手動ã§ã‚¢ãƒƒãƒ—デートをダウンãƒãƒ¼ãƒ‰&インストール" name="Install_manual"/> </combo_box> + <check_box label="release candidate ã«ã‚¢ãƒƒãƒ—グレードã—ã¾ã™" name="update_willing_to_test"/> <text name="Proxy Settings:"> プãƒã‚ã‚·è¨å®šï¼š </text> diff --git a/indra/newview/skins/default/xui/ja/panel_script_ed.xml b/indra/newview/skins/default/xui/ja/panel_script_ed.xml index 14d55002a3..b6d51085eb 100755 --- a/indra/newview/skins/default/xui/ja/panel_script_ed.xml +++ b/indra/newview/skins/default/xui/ja/panel_script_ed.xml @@ -34,6 +34,7 @@ <menu_item_call label="ã™ã¹ã¦é¸æŠž" name="Select All"/> <menu_item_call label="é¸æŠžè§£é™¤" name="Deselect"/> <menu_item_call label="検索 / å†é…ç½®..." name="Search / Replace..."/> + <menu_item_call label="è¡Œã«ç§»å‹•..." name="Go to line..."/> </menu> <menu label="ヘルプ" name="Help"> <menu_item_call label="ヘルプ..." name="Help..."/> diff --git a/indra/newview/skins/default/xui/ja/panel_tools_texture.xml b/indra/newview/skins/default/xui/ja/panel_tools_texture.xml new file mode 100644 index 0000000000..34763f78c1 --- /dev/null +++ b/indra/newview/skins/default/xui/ja/panel_tools_texture.xml @@ -0,0 +1,116 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<panel label="テクスãƒãƒ£" name="Texture"> + <panel.string name="string repeats per meter"> + メーターã”ã¨ã«ç¹°ã‚Šè¿”ã™ + </panel.string> + <panel.string name="string repeats per face"> + é¢ã”ã¨ã«ç¹°ã‚Šè¿”ã™ + </panel.string> + <text name="color label"> + 色 + </text> + <color_swatch label="" name="colorswatch" tool_tip="クリックã—ã¦ã‚«ãƒ©ãƒ¼ãƒ”ッカーを開ãã¾ã™"/> + <text name="color trans"> + é€éŽåº¦ % + </text> + <text name="glow label"> + ã‚°ãƒãƒ¼ + </text> + <check_box label="明るã•å…¨é–‹" name="checkbox fullbright"/> + <combo_box name="combobox matmedia"> + <combo_box.item label="æ質" name="Materials"/> + <combo_box.item label="メディア" name="Media"/> + </combo_box> + <combo_box name="combobox mattype"> + <combo_box.item label="テクスãƒãƒ£ (æ‹¡æ•£)" name="Texture (diffuse)"/> + <combo_box.item label="凹凸 (標準)" name="Bumpiness (normal)"/> + <combo_box.item label="è¼ã (åå°„)" name="Shininess (specular)"/> + </combo_box> + <texture_picker label="テクスãƒãƒ£" name="texture control" tool_tip="クリックã—ã¦å†™çœŸã‚’é¸æŠžã—ã¾ã™"/> + <text name="label alphamode"> + アルファモード + </text> + <combo_box name="combobox alphamode"> + <combo_box.item label="ãªã—" name="None"/> + <combo_box.item label="アルファブレンディング" name="Alpha blending"/> + <combo_box.item label="アルファマスã‚ング" name="Alpha masking"/> + <combo_box.item label="放射状マスク" name="Emissive mask"/> + </combo_box> + <text name="label maskcutoff"> + マスクカットオフ + </text> + <texture_picker label="テクスãƒãƒ£" name="bumpytexture control" tool_tip="クリックã—ã¦å†™çœŸã‚’é¸æŠžã—ã¾ã™"/> + <text name="label bumpiness"> + 凹凸 + </text> + <combo_box name="combobox bumpiness"> + <combo_box.item label="ãªã—" name="None"/> + <combo_box.item label="明るã•" name="Brightness"/> + <combo_box.item label="æš—ã•" name="Darkness"/> + <combo_box.item label="木目調" name="woodgrain"/> + <combo_box.item label="ãƒãƒ¼ã‚¯" name="bark"/> + <combo_box.item label="レンガ" name="bricks"/> + <combo_box.item label="市æ¾æ¨¡æ§˜" name="checker"/> + <combo_box.item label="コンクリート" name="concrete"/> + <combo_box.item label="å …ã„タイル" name="crustytile"/> + <combo_box.item label="カットストーン" name="cutstone"/> + <combo_box.item label="円æ¿" name="discs"/> + <combo_box.item label="å°çŸ³" name="gravel"/> + <combo_box.item label="ペトリ皿" name="petridish"/> + <combo_box.item label="サイディング" name="siding"/> + <combo_box.item label="ストーンタイル" name="stonetile"/> + <combo_box.item label="化粧ã—ã£ãã„" name="stucco"/> + <combo_box.item label="サクション" name="suction"/> + <combo_box.item label="ウィーブ" name="weave"/> + </combo_box> + <texture_picker label="テクスãƒãƒ£" name="shinytexture control" tool_tip="クリックã—ã¦å†™çœŸã‚’é¸æŠžã—ã¾ã™"/> + <text name="label shininess"> + è¼ã + </text> + <combo_box name="combobox shininess"> + <combo_box.item label="ãªã—" name="None"/> + <combo_box.item label="低" name="Low"/> + <combo_box.item label="ä¸" name="Medium"/> + <combo_box.item label="高" name="High"/> + </combo_box> + <text name="label glossiness"> + 光沢度 + </text> + <text name="label environment"> + 環境 + </text> + <text name="label shinycolor"> + 色 + </text> + <color_swatch label="" name="shinycolorswatch" tool_tip="クリックã—ã¦ã‚«ãƒ©ãƒ¼ãƒ”ッカーを開ãã¾ã™"/> + <text name="media_info"> + é¸æŠžã—ãŸãƒ¡ãƒ‡ã‚£ã‚¢ã® URL ãŒã‚‚ã—ã‚ã‚Œã°ã€ã“ã“ã«å…¥ã‚Šã¾ã™ + </text> + <button label="é¸æŠž..." name="add_media" tool_tip="ãƒ¡ãƒ‡ã‚£ã‚¢ã‚’è¿½åŠ ã—ã¾ã™"/> + <button label="削除" name="delete_media" tool_tip="ã“ã®ãƒ¡ãƒ‡ã‚£ã‚¢ãƒ†ã‚¯ã‚¹ãƒãƒ£ã‚’削除ã—ã¾ã™"/> + <button label="æƒãˆã‚‹" label_selected="メディアを一列ã«æƒãˆã¾ã™" name="button align" tool_tip="メディアテクスãƒãƒ£ã‚’一列ã«æƒãˆã‚‹ï¼ˆæœ€åˆã«èªã¿è¾¼ã‚€å¿…è¦ãŒã‚ã‚Šã¾ã™ï¼‰"/> + <text name="tex gen"> + マッピング + </text> + <combo_box name="combobox texgen"> + <combo_box.item label="デフォルト" name="Default"/> + <combo_box.item label="å¹³é¢" name="Planar"/> + </combo_box> + <spinner label="水平スケール" name="TexScaleU"/> + <spinner label="垂直スケール" name="TexScaleV"/> + <spinner label="メーターã”ã¨ã«ç¹°ã‚Šè¿”ã™" name="rptctrl"/> + <spinner label="回転度" name="TexRot"/> + <spinner label="水平オフセット" name="TexOffsetU"/> + <spinner label="垂直オフセット" name="TexOffsetV"/> + <spinner label="水平スケール" name="bumpyScaleU"/> + <spinner label="垂直スケール" name="bumpyScaleV"/> + <spinner label="回転度" name="bumpyRot"/> + <spinner label="水平オフセット" name="bumpyOffsetU"/> + <spinner label="垂直オフセット" name="bumpyOffsetV"/> + <spinner label="水平スケール" name="shinyScaleU"/> + <spinner label="垂直スケール" name="shinyScaleV"/> + <spinner label="回転度" name="shinyRot"/> + <spinner label="水平オフセット" name="shinyOffsetU"/> + <spinner label="垂直オフセット" name="shinyOffsetV"/> + <check_box initial_value="false" label="å¹³é¢ã‚’æƒãˆã‚‹" name="checkbox planar align" tool_tip="é¸æŠžé¢å…¨ã¦ã®ãƒ†ã‚¯ã‚¹ãƒãƒ£ã‚’ã€æœ€å¾Œã«é¸æŠžã•ã‚ŒãŸé¢ã«æƒãˆã¾ã™ã€‚å¹³é¢ãƒ†ã‚¯ã‚¹ãƒãƒ£ã®ãƒžãƒƒãƒ”ングãŒå¿…è¦ã§ã™ã€‚"/> +</panel> diff --git a/indra/newview/skins/default/xui/ja/role_actions.xml b/indra/newview/skins/default/xui/ja/role_actions.xml index 896ed556ae..5c2e18df03 100755 --- a/indra/newview/skins/default/xui/ja/role_actions.xml +++ b/indra/newview/skins/default/xui/ja/role_actions.xml @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<?xml version="1.0" encoding="utf-8" standalone="yes"?> <role_actions> <action_set description="ã“れらã®èƒ½åŠ›ã«ã¯ã€ã‚°ãƒ«ãƒ¼ãƒ—メンãƒãƒ¼ã‚’è¿½åŠ ã€æŽ’除ã—ã€æ‹›å¾…状ãªã—ã«æ–°ãƒ¡ãƒ³ãƒãƒ¼ã®å‚åŠ ã‚’èªã‚る権é™ãŒå«ã¾ã‚Œã¾ã™ã€‚" name="Membership"> <action description="ã“ã®ã‚°ãƒ«ãƒ¼ãƒ—ã«äººã‚’招待" longdescription="「役割ã€ã‚»ã‚¯ã‚·ãƒ§ãƒ³ã®ã€Œãƒ¡ãƒ³ãƒãƒ¼ã€ã‚¿ãƒ–内ã«ã‚る「招待ã€ãƒœã‚¿ãƒ³ã‚’押ã—ã¦ã€ã“ã®ã‚°ãƒ«ãƒ¼ãƒ—ã«ãƒ¡ãƒ³ãƒãƒ¼ã‚’招待ã—ã¾ã™ã€‚" name="member invite" value="1"/> @@ -25,7 +25,7 @@ </action_set> <action_set description="ã“れらã®èƒ½åŠ›ã«ã¯ã€åŒºç”»åã€å…¬é–‹è¨å®šã€æ¤œç´¢ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã¸ã®ç™»éŒ²ã€ç€åœ°ç‚¹ãªã‚‰ã³ã« TP ルートã®ã‚ªãƒ—ションを変更ã™ã‚‹æ¨©é™ãŒå«ã¾ã‚Œã¾ã™ã€‚" name="Parcel Identity"> <action description="ã€Œå ´æ‰€æ¤œç´¢ã«è¡¨ç¤ºã€ã‚’切り替ãˆã‚«ãƒ†ã‚´ãƒªã‚’è¨å®š" longdescription="ã€Œå ´æ‰€æ¤œç´¢ã«è¡¨ç¤ºã€ã«åˆ‡ã‚Šæ›¿ãˆã€ã€ŒåœŸåœ°æƒ…å ±ã€ > 「オプションã€ã‚¿ãƒ–ã§åŒºç”»ã®ã‚«ãƒ†ã‚´ãƒªã‚’è¨å®šã—ã¾ã™ã€‚" name="land find places" value="17"/> - <action description="区画åã€èª¬æ˜Žã€ã€Œå ´æ‰€æ¤œç´¢ã«è¡¨ç¤ºã€ã®è¨å®šã‚’変更" longdescription="区画åã€èª¬æ˜Žã€ã€Œå ´æ‰€æ¤œç´¢ã«è¡¨ç¤ºã€ã®è¨å®šã‚’変更ã—ã¾ã™ã€‚ ã€ŒåœŸåœ°æƒ…å ±ã€ > 「オプションã€ã‚¿ãƒ–ã§è¡Œã„ã¾ã™ã€‚" name="land change identity" value="18"/> + <action description="区画åã€èª¬æ˜Žã€ãŠã‚ˆã³ã€ŒModerate コンテンツã€è¨å®šã‚’変更" longdescription="区画åã€èª¬æ˜Žã€ãŠã‚ˆã³ã€ŒModerate コンテンツã€è¨å®šã‚’変更ã—ã¾ã™ã€‚ã€ŒåœŸåœ°æƒ…å ±ã€ > 「オプションã€ã‚¿ãƒ–ã§è¡Œã„ã¾ã™ã€‚" name="land change identity" value="18"/> <action description="ç€åœ°ç‚¹ãŠã‚ˆã³ãƒ†ãƒ¬ãƒãƒ¼ãƒˆãƒ«ãƒ¼ãƒˆã‚’è¨å®š" longdescription="ã“ã®èƒ½åŠ›ã‚’æŒã¤å½¹å‰²ã®ãƒ¡ãƒ³ãƒãƒ¼ã¯ã€ã‚°ãƒ«ãƒ¼ãƒ—所有ã®åŒºç”»ä¸Šã§ç€åœ°ç‚¹ã‚’è¨å®šã™ã‚‹ã“ã¨ã«ã‚ˆã‚Šå¤–部ã‹ã‚‰ã®ãƒ†ãƒ¬ãƒãƒ¼ãƒˆã®åˆ°ç€ä½ç½®ã‚’指定ã§ãã‚‹ã¨å…±ã«ã€ãƒ†ãƒ¬ãƒãƒ¼ãƒˆãƒ«ãƒ¼ãƒˆã‚’è¨å®šã—ã¦ç´°ã‹ã制御ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚ ã“ã®æ“作ã¯ã€ã€ŒåœŸåœ°æƒ…å ±ã€ï¼žã€Œã‚ªãƒ—ションã€ã‚¿ãƒ–ã§è¡Œã„ã¾ã™ã€‚" name="land set landing point" value="19"/> </action_set> <action_set description="ã“れらã®èƒ½åŠ›ã«ã¯ã€ã€Œã‚ªãƒ–ジェクトを作æˆã€ã€ã€Œåœ°å½¢ã‚’編集ã€ã€éŸ³æ¥½ã¨ãƒ¡ãƒ‡ã‚£ã‚¢ã®è¨å®šãªã©ã€åŒºç”»ã®ã‚ªãƒ—ションã«é–¢é€£ã™ã‚‹æ¨©é™ãŒå«ã¾ã‚Œã¾ã™ã€‚" name="Parcel Settings"> diff --git a/indra/newview/skins/default/xui/ja/strings.xml b/indra/newview/skins/default/xui/ja/strings.xml index b27904c4d7..ab2fd461ab 100755 --- a/indra/newview/skins/default/xui/ja/strings.xml +++ b/indra/newview/skins/default/xui/ja/strings.xml @@ -139,6 +139,9 @@ <string name="create_account_url"> http://join.secondlife.com/?sourceid=[sourceid] </string> + <string name="ViewerDownloadURL"> + http://secondlife.com/download + </string> <string name="LoginFailedViewerNotPermitted"> ãŠä½¿ã„ã®å¤ã„ビューワã§ã¯ Second Life ã«ã‚¢ã‚¯ã‚»ã‚¹ã§ãã¾ã›ã‚“。以下ã®ãƒšãƒ¼ã‚¸ã‹ã‚‰æ–°ã—ã„ビューワをダウンãƒãƒ¼ãƒ‰ã—ã¦ãã ã•ã„: http://secondlife.com/download @@ -448,6 +451,9 @@ support@secondlife.com ã«ãŠå•ã„åˆã‚ã›ãã ã•ã„。 <string name="SLappAgentRequestFriend"> フレンド登録リクエスト </string> + <string name="SLappAgentRemoveFriend"> + フレンドã®å‰Šé™¤ + </string> <string name="BUTTON_CLOSE_DARWIN"> é–‰ã˜ã‚‹ (⌘W) </string> @@ -838,6 +844,9 @@ support@secondlife.com ã«ãŠå•ã„åˆã‚ã›ãã ã•ã„。 <string name="multiple_textures"> 複数 </string> + <string name="use_texture"> + テクスãƒãƒ£ã‚’使用 + </string> <string name="texture_loading"> ãƒãƒ¼ãƒ‡ã‚£ãƒ³ã‚°... </string> @@ -937,6 +946,21 @@ support@secondlife.com ã«ãŠå•ã„åˆã‚ã›ãã ã•ã„。 <string name="TeleportYourAgent"> ã‚ãªãŸã‚’テレãƒãƒ¼ãƒˆ </string> + <string name="JoinAnExperience"> + 体験ã«å‚åŠ ã™ã‚‹ + </string> + <string name="SilentlyManageEstateAccess"> + 土地ã®ã‚¢ã‚¯ã‚»ã‚¹ãƒªã‚¹ãƒˆã‚’管ç†ã™ã‚‹ã¨ãã«ã‚¢ãƒ©ãƒ¼ãƒˆã‚’表示ã—ãªã„ + </string> + <string name="OverrideYourAnimations"> + デフォルトã®ã‚¢ãƒ‹ãƒ¡ãƒ¼ã‚·ãƒ§ãƒ³ã‚’ç½®ãæ›ãˆ + </string> + <string name="ScriptReturnObjects"> + ã‚ãªãŸã®ä»£ã‚ã‚Šã«ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆã‚’è¿”å´ + </string> + <string name="UnknownScriptPermission"> + (ä¸æ˜Ž)! + </string> <string name="SIM_ACCESS_PG"> General </string> @@ -1968,6 +1992,12 @@ support@secondlife.com ã«ãŠå•ã„åˆã‚ã›ãã ã•ã„。 <string name="ATTACH_HUD_BOTTOM_RIGHT"> HUD(å³ä¸‹ï¼‰ </string> + <string name="ATTACH_NECK"> + 首 + </string> + <string name="ATTACH_AVATAR_CENTER"> + ã‚¢ãƒã‚¿ãƒ¼ã®ä¸å¤® + </string> <string name="CursorPos"> [LINE] 行目ã€[COLUMN] 列目 </string> @@ -2997,6 +3027,9 @@ www.secondlife.com ã‹ã‚‰æœ€æ–°ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã‚’ダウンãƒãƒ¼ãƒ‰ã—ã¦ãã ã <string name="Hip Width"> è…°ã®å¹… </string> + <string name="Hover"> + ホãƒãƒ¼ + </string> <string name="In"> 内å‘ã </string> @@ -5081,4 +5114,7 @@ www.secondlife.com ã‹ã‚‰æœ€æ–°ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã‚’ダウンãƒãƒ¼ãƒ‰ã—ã¦ãã ã <string name="logging_calls_enabled_log_empty"> ãƒã‚°ã‚¤ãƒ³æ™‚ã®ä¼šè©±ã¯ã‚ã‚Šã¾ã›ã‚“。誰ã‹ã«ã”連絡ã—ãŸå¾Œã€ã¾ãŸã¯èª°ã‹ãŒã‚ãªãŸã«é€£çµ¡ã—ãŸå¾Œã€ãƒã‚°ã‚¨ãƒ³ãƒˆãƒªãŒã“ã“ã«è¡¨ç¤ºã•ã‚Œã¾ã™ã€‚ </string> + <string name="loading_chat_logs"> + ãƒãƒ¼ãƒ‰ä¸... + </string> </strings> diff --git a/indra/newview/skins/default/xui/pl/floater_about.xml b/indra/newview/skins/default/xui/pl/floater_about.xml index 409429ffaa..61a72ff27d 100755 --- a/indra/newview/skins/default/xui/pl/floater_about.xml +++ b/indra/newview/skins/default/xui/pl/floater_about.xml @@ -8,7 +8,7 @@ Buduj z [COMPILER] wersjÄ… [COMPILER_VERSION] </floater.string> <floater.string name="AboutPosition"> - PoÅ‚ożenie [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1] w [REGION] zlokalizowanym w <nolink>[HOSTNAME]</nolink> ([HOSTIP]) + PoÅ‚ożenie [POSITION_LOCAL_0,number,1], [POSITION_LOCAL_1,number,1], [POSITION_LOCAL_2,number,1] w [REGION] zlokalizowanym w <nolink>[HOSTNAME]</nolink> ([HOSTIP]) [SERVER_VERSION] [SERVER_RELEASE_NOTES_URL] </floater.string> diff --git a/indra/newview/skins/default/xui/pt/floater_about.xml b/indra/newview/skins/default/xui/pt/floater_about.xml index 299f88b22a..47975a6386 100755 --- a/indra/newview/skins/default/xui/pt/floater_about.xml +++ b/indra/newview/skins/default/xui/pt/floater_about.xml @@ -7,7 +7,9 @@ ConstruÃdo com [COMPILER] versão [COMPILER_VERSION] </floater.string> <floater.string name="AboutPosition"> - Você está em [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1] em [REGION] localizado em [HOSTNAME]</nolink>([HOSTIP]) + Você está em [POSITION_LOCAL_0,number,1], [POSITION_LOCAL_1,number,1], [POSITION_LOCAL_2,number,1] em [REGION] localizado em <nolink>[HOSTNAME]</nolink> ([HOSTIP]) +SLURL: <nolink>[SLURL]</nolink> +(coordenadas globais [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1]) [SERVER_VERSION] [SERVER_RELEASE_NOTES_URL] </floater.string> diff --git a/indra/newview/skins/default/xui/pt/floater_bulk_perms.xml b/indra/newview/skins/default/xui/pt/floater_bulk_perms.xml index 8823d04b62..998fa8b2d6 100755 --- a/indra/newview/skins/default/xui/pt/floater_bulk_perms.xml +++ b/indra/newview/skins/default/xui/pt/floater_bulk_perms.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="floaterbulkperms" title="EDITAR AUTORIZAÇÕES DE CONTEÚDO"> +<floater name="floaterbulkperms" title="AJUSTAR PERMISSÕES DE CONTEÚDO"> <floater.string name="nothing_to_modify_text"> A seleção não contém nenhum conteúdo editável. </floater.string> @@ -33,7 +33,7 @@ <button label="Tudo" label_selected="Todas" name="check_all"/> <button label="Limpar" label_selected="Nenhuma" name="check_none"/> <text name="newperms"> - Novas autorizações de conteúdo + Ajustar permissões de conteúdo para </text> <text name="GroupLabel"> Grupo: @@ -49,6 +49,7 @@ <check_box label="Modificar" name="next_owner_modify"/> <check_box label="Copiar" name="next_owner_copy"/> <check_box initial_value="true" label="Transferir" name="next_owner_transfer" tool_tip="O próximo dono poderá revender ou dar este objeto"/> - <button label="OK" name="apply"/> + <button label="OK" name="ok"/> + <button label="Aplicar" name="apply"/> <button label="Cancelar" name="close"/> </floater> diff --git a/indra/newview/skins/default/xui/pt/floater_goto_line.xml b/indra/newview/skins/default/xui/pt/floater_goto_line.xml new file mode 100644 index 0000000000..f2ef825ba0 --- /dev/null +++ b/indra/newview/skins/default/xui/pt/floater_goto_line.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="script goto" title="IR PARA A LINHA"> + <button label="OK" label_selected="OK" name="goto_btn"/> + <text name="txt"> + Ir para a linha + </text> +</floater> diff --git a/indra/newview/skins/default/xui/pt/floater_im_session.xml b/indra/newview/skins/default/xui/pt/floater_im_session.xml index 9f6a7a06ad..e592b14fa7 100755 --- a/indra/newview/skins/default/xui/pt/floater_im_session.xml +++ b/indra/newview/skins/default/xui/pt/floater_im_session.xml @@ -34,13 +34,11 @@ <layout_panel name="body_panel"> <layout_stack name="im_panels"> <layout_panel name="right_part_holder"> - <panel name="trnsAndChat_panel"> - <layout_stack name="translate_and_chat_stack"> - <layout_panel name="translate_chat_checkbox_lp"> - <check_box label="Traduzir bate-papo" name="translate_chat_checkbox"/> - </layout_panel> - </layout_stack> - </panel> + <layout_stack name="translate_and_chat_stack"> + <layout_panel name="translate_chat_checkbox_lp"> + <check_box label="Traduzir conversa" name="translate_chat_checkbox"/> + </layout_panel> + </layout_stack> </layout_panel> </layout_stack> </layout_panel> diff --git a/indra/newview/skins/default/xui/pt/floater_pathfinding_console.xml b/indra/newview/skins/default/xui/pt/floater_pathfinding_console.xml index d04cf2a173..182f2513e0 100755 --- a/indra/newview/skins/default/xui/pt/floater_pathfinding_console.xml +++ b/indra/newview/skins/default/xui/pt/floater_pathfinding_console.xml @@ -71,7 +71,7 @@ <text name="show_label"> Exibir: </text> - <check_box label="Testar" name="show_world"/> + <check_box label="Mundo" name="show_world"/> <check_box label="Apenas móveis" name="show_world_movables_only"/> <check_box label="Navmesh" name="show_navmesh"/> <text name="show_walkability_label"> diff --git a/indra/newview/skins/default/xui/pt/menu_attachment_other.xml b/indra/newview/skins/default/xui/pt/menu_attachment_other.xml index cfd69158bc..61953f9f78 100755 --- a/indra/newview/skins/default/xui/pt/menu_attachment_other.xml +++ b/indra/newview/skins/default/xui/pt/menu_attachment_other.xml @@ -11,7 +11,9 @@ <menu_item_call label="Congelar" name="Freeze..."/> <menu_item_call label="Ejetar" name="Eject..."/> <menu_item_call label="Depurar texturas" name="Debug..."/> + <menu_item_call label="Descartar XML" name="Dump XML"/> <menu_item_call label="Mais zoom" name="Zoom In"/> <menu_item_call label="Pagar" name="Pay..."/> <menu_item_call label="Perfil do objeto" name="Object Inspect"/> + <menu_item_call label="Bloquear proprietário da partÃcula" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/pt/menu_attachment_self.xml b/indra/newview/skins/default/xui/pt/menu_attachment_self.xml index 5b32784c32..2d4cd670e6 100755 --- a/indra/newview/skins/default/xui/pt/menu_attachment_self.xml +++ b/indra/newview/skins/default/xui/pt/menu_attachment_self.xml @@ -12,5 +12,7 @@ <menu_item_call label="Meus grupos" name="Groups..."/> <menu_item_call label="Meu perfil" name="Profile..."/> <menu_item_call label="Depurar texturas" name="Debug..."/> + <menu_item_call label="Descartar XML" name="Dump XML"/> <menu_item_call label="Largar" name="Drop"/> + <menu_item_call label="Bloquear proprietário da partÃcula" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/pt/menu_avatar_other.xml b/indra/newview/skins/default/xui/pt/menu_avatar_other.xml index a4a26144c7..1af8d64438 100755 --- a/indra/newview/skins/default/xui/pt/menu_avatar_other.xml +++ b/indra/newview/skins/default/xui/pt/menu_avatar_other.xml @@ -11,6 +11,8 @@ <menu_item_call label="Congelar" name="Freeze..."/> <menu_item_call label="Ejetar" name="Eject..."/> <menu_item_call label="Depurar texturas" name="Debug..."/> + <menu_item_call label="Descartar XML" name="Dump XML"/> <menu_item_call label="Mais zoom" name="Zoom In"/> <menu_item_call label="Pagar" name="Pay..."/> + <menu_item_call label="Bloquear proprietário da partÃcula" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/pt/menu_avatar_self.xml b/indra/newview/skins/default/xui/pt/menu_avatar_self.xml index e84dcb093d..447b77657b 100755 --- a/indra/newview/skins/default/xui/pt/menu_avatar_self.xml +++ b/indra/newview/skins/default/xui/pt/menu_avatar_self.xml @@ -29,4 +29,6 @@ <menu_item_call label="Meus grupos" name="Groups..."/> <menu_item_call label="Meu perfil" name="Profile..."/> <menu_item_call label="Depurar texturas" name="Debug..."/> + <menu_item_call label="Descartar XML" name="Dump XML"/> + <menu_item_call label="Bloquear proprietário da partÃcula" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/pt/menu_conversation.xml b/indra/newview/skins/default/xui/pt/menu_conversation.xml index 01316b887d..2dd150a61e 100644 --- a/indra/newview/skins/default/xui/pt/menu_conversation.xml +++ b/indra/newview/skins/default/xui/pt/menu_conversation.xml @@ -3,6 +3,7 @@ <menu_item_call label="Encerrar conversa" name="close_conversation"/> <menu_item_call label="Abrir conversa de voz" name="open_voice_conversation"/> <menu_item_call label="Desconectar de voz" name="disconnect_from_voice"/> + <menu_item_call label="Fechar selecionados" name="close_selected_conversations"/> <menu_item_call label="Exibir perfil" name="view_profile"/> <menu_item_call label="MI" name="im"/> <menu_item_call label="Oferecer teletransporte" name="offer_teleport"/> diff --git a/indra/newview/skins/default/xui/pt/menu_land.xml b/indra/newview/skins/default/xui/pt/menu_land.xml index 9182ce321a..2ebe85df6e 100755 --- a/indra/newview/skins/default/xui/pt/menu_land.xml +++ b/indra/newview/skins/default/xui/pt/menu_land.xml @@ -6,4 +6,5 @@ <menu_item_call label="Comprar passe" name="Land Buy Pass"/> <menu_item_call label="Construir" name="Create"/> <menu_item_call label="Editar a topografia" name="Edit Terrain"/> + <menu_item_call label="Bloquear proprietário da partÃcula" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/pt/menu_login.xml b/indra/newview/skins/default/xui/pt/menu_login.xml index be94ad49db..cd840f3137 100755 --- a/indra/newview/skins/default/xui/pt/menu_login.xml +++ b/indra/newview/skins/default/xui/pt/menu_login.xml @@ -17,7 +17,13 @@ <menu_item_call label="Mostrar TOS" name="TOS"/> <menu_item_call label="Mostrar mensagem crÃtica" name="Critical"/> <menu_item_call label="Test de Bugs de Conteúdo Web" name="Web Content Floater Debug Test"/> - <menu label="Configurar nÃvel de registro em log" name="Set Logging Level"/> + <menu label="Configurar nÃvel de registro em log" name="Set Logging Level"> + <menu_item_check label="Depurar" name="Debug"/> + <menu_item_check label="Info" name="Info"/> + <menu_item_check label="Aviso" name="Warning"/> + <menu_item_check label="Erro" name="Error"/> + <menu_item_check label="Nenhum" name="None"/> + </menu> <menu_item_check label="Exibir seletor da grade" name="Show Grid Picker"/> <menu_item_call label="Exibir painel de notificações" name="Show Notifications Console"/> </menu> diff --git a/indra/newview/skins/default/xui/pt/menu_mute_particle.xml b/indra/newview/skins/default/xui/pt/menu_mute_particle.xml new file mode 100644 index 0000000000..be13c66d7a --- /dev/null +++ b/indra/newview/skins/default/xui/pt/menu_mute_particle.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<!-- *NOTE: See also menu_attachment_other.xml --> +<context_menu name="Mute Particle Pie"> + <menu_item_call label="Bloquear proprietário da partÃcula" name="Mute Particle"/> +</context_menu> diff --git a/indra/newview/skins/default/xui/pt/menu_object.xml b/indra/newview/skins/default/xui/pt/menu_object.xml index 28dd9febe2..a552a5de5a 100755 --- a/indra/newview/skins/default/xui/pt/menu_object.xml +++ b/indra/newview/skins/default/xui/pt/menu_object.xml @@ -5,13 +5,13 @@ </menu_item_call> <menu_item_call label="Editar" name="Edit..."/> <menu_item_call label="Construir" name="Build"/> - <menu_item_call label="Exibir em linksets" name="show_in_linksets"/> - <menu_item_call label="Exibir em personagens" name="show_in_characters"/> <menu_item_call label="Abrir" name="Open"/> <menu_item_call label="Sentar aqui" name="Object Sit"/> <menu_item_call label="Ficar de pé" name="Object Stand Up"/> <menu_item_call label="Perfil do objeto" name="Object Inspect"/> <menu_item_call label="Mais zoom" name="Zoom In"/> + <menu_item_call label="Exibir em linksets" name="show_in_linksets"/> + <menu_item_call label="Exibir em personagens" name="show_in_characters"/> <context_menu label="Colocar no(a)" name="Put On"> <menu_item_call label="Vestir" name="Wear"/> <menu_item_call label="Adicionar" name="Add"/> @@ -28,4 +28,5 @@ <menu_item_call label="Pagar" name="Pay..."/> <menu_item_call label="Comprar" name="Buy..."/> <menu_item_call label="Excluir" name="Delete"/> + <menu_item_call label="Bloquear proprietário da partÃcula" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/pt/menu_url_agent.xml b/indra/newview/skins/default/xui/pt/menu_url_agent.xml index aa0a426405..102df18b28 100755 --- a/indra/newview/skins/default/xui/pt/menu_url_agent.xml +++ b/indra/newview/skins/default/xui/pt/menu_url_agent.xml @@ -3,6 +3,7 @@ <menu_item_call label="Exibir perfil" name="show_agent"/> <menu_item_call label="Enviar MI..." name="send_im"/> <menu_item_call label="Adicionar amigo..." name="add_friend"/> + <menu_item_call label="Remover amigo..." name="remove_friend"/> <menu_item_call label="Copiar nome para área de transferência" name="url_copy_label"/> <menu_item_call label="Copiar SLurl para área de transferência" name="url_copy"/> </context_menu> diff --git a/indra/newview/skins/default/xui/pt/menu_url_objectim.xml b/indra/newview/skins/default/xui/pt/menu_url_objectim.xml index 247a92567a..2cd0f52ef3 100755 --- a/indra/newview/skins/default/xui/pt/menu_url_objectim.xml +++ b/indra/newview/skins/default/xui/pt/menu_url_objectim.xml @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <context_menu name="Url Popup"> <menu_item_call label="Perfil do objeto..." name="show_object"/> + <menu_item_call label="Bloquear..." name="block_object"/> <menu_item_call label="Mostrar no mapa" name="show_on_map"/> <menu_item_call label="Teletransportar para lugar do objeto" name="teleport_to_object"/> <menu_item_call label="Copiar nome do objeto para área de transferência" name="url_copy_label"/> diff --git a/indra/newview/skins/default/xui/pt/menu_viewer.xml b/indra/newview/skins/default/xui/pt/menu_viewer.xml index 15814fed4c..e6eceb5f2f 100755 --- a/indra/newview/skins/default/xui/pt/menu_viewer.xml +++ b/indra/newview/skins/default/xui/pt/menu_viewer.xml @@ -16,7 +16,10 @@ <menu_item_call label="Parar minha animação" name="Stop Animating My Avatar"/> <menu_item_call label="Andar/correr/voar..." name="Walk / run / fly"/> </menu> - <menu label="Status" name="Status"/> + <menu label="Status" name="Status"> + <menu_item_check label="Ausente" name="Away"/> + <menu_item_check label="Não perturbe" name="Do Not Disturb"/> + </menu> <menu_item_call label="Comprar L$..." name="Buy and Sell L$"/> <menu_item_call label="Caixa de saÃda do lojista..." name="MerchantOutbox"/> <menu_item_call label="Painel da conta..." name="Manage My Account"> @@ -32,6 +35,7 @@ <menu_item_check label="Conversas..." name="Conversations"/> <menu_item_check label="Bate-papo local..." name="Nearby Chat"/> <menu_item_check label="Falar" name="Speak"/> + <menu_item_check label="Registro de conversas..." name="Conversation Log..."/> <menu label="Distorção de voz" name="VoiceMorphing"> <menu_item_check label="Não distorcer voz" name="NoVoiceMorphing"/> <menu_item_check label="Visualizar..." name="Preview"/> @@ -42,6 +46,7 @@ <menu_item_check label="Grupos" name="My Groups"/> <menu_item_check label="Pessoas próximas" name="Active Speakers"/> <menu_item_call label="Lista de bloqueados" name="Block List"/> + <menu_item_check label="Não perturbe" name="Do Not Disturb"/> </menu> <menu label="Mundo" name="World"> <menu_item_call label="Criar marco deste lugar" name="Create Landmark Here"/> @@ -110,6 +115,7 @@ <menu_item_call label="Incluir próxima parte" name="Include Next Part"/> <menu_item_call label="Incluir parte anterior" name="Include Previous Part"/> </menu> + <menu_item_call label="Linksets..." name="pathfinding_linkset_menu_item"/> <menu_item_call label="Enfocar seleção" name="Focus on Selection"/> <menu_item_call label="Ampliar seleção" name="Zoom to Selection"/> <menu label="Objeto:" name="Object"> @@ -273,6 +279,7 @@ <menu_item_check label="Camera Offset" name="Camera Offset"/> <menu_item_check label="Taxa de quadros aleatória" name="Randomize Framerate"/> <menu_item_check label="Frame Test" name="Frame Test"/> + <menu_item_call label="Perfil do quadro" name="Frame Profile"/> </menu> <menu label="Render Metadata" name="Render Metadata"> <menu_item_check label="Normais" name="Normals"/> @@ -293,15 +300,15 @@ </menu> <menu label="Rendering" name="Rendering"> <menu_item_check label="Axes" name="Axes"/> + <menu_item_call label="Informações sobre o material selecionado" name="Selected Material Info"/> <menu_item_check label="Wireframe" name="Wireframe"/> - <menu_item_check label="Iluminação e sombras" name="Advanced Lighting Model"/> + <menu_item_check label="Modelo avançado de luzes" name="Advanced Lighting Model"/> <menu_item_check label="Sombras da projeção do sol/lua" name="Shadows from Sun/Moon/Projectors"/> <menu_item_check label="SSAO e sombra suave" name="SSAO and Shadow Smoothing"/> <menu_item_check label="Máscaras alpha automáticas (adiadas)" name="Automatic Alpha Masks (deferred)"/> <menu_item_check label="Máscaras alpha automáticas (sem adiar)" name="Automatic Alpha Masks (non-deferred)"/> <menu_item_check label="Texturas de animação" name="Animation Textures"/> <menu_item_check label="Desativar texturas" name="Disable Textures"/> - <menu_item_check label="Atlas texturizado (fase experimental)" name="Texture Atlas"/> <menu_item_check label="Render Attached Lights" name="Render Attached Lights"/> <menu_item_check label="Render Attached Particles" name="Render Attached Particles"/> <menu_item_check label="Objetos iridescentes" name="Hover Glow Objects"/> @@ -320,7 +327,6 @@ <menu_item_call label="Teste de mÃdia do navegador" name="Web Browser Test"/> <menu_item_call label="Navegador de conteúdo web" name="Web Content Browser"/> <menu_item_call label="Print Selected Object Info" name="Print Selected Object Info"/> - <menu_item_call label="Dados de memória" name="Memory Stats"/> <menu_item_check label="Console de depuração de região" name="Region Debug Console"/> <menu_item_check label="Debug Clicks" name="Debug Clicks"/> <menu_item_check label="Debug Mouse Events" name="Debug Mouse Events"/> diff --git a/indra/newview/skins/default/xui/pt/notifications.xml b/indra/newview/skins/default/xui/pt/notifications.xml index d9f5e48745..d5096ec858 100755 --- a/indra/newview/skins/default/xui/pt/notifications.xml +++ b/indra/newview/skins/default/xui/pt/notifications.xml @@ -209,6 +209,14 @@ Qualquer membro numa função com esta habilidade, pode atribuir a sà mesmo -- Adicionar esta habilidade a '[ROLE_NAME]'? <usetemplate name="okcancelbuttons" notext="Não" yestext="Sim"/> </notification> + <notification name="EjectGroupMemberWarning"> + Você está prestes a expulsar [AVATAR_NAME] do grupo. + <usetemplate ignoretext="Confirmar expulsão de um participante do grupo" name="okcancelignore" notext="Cancelar" yestext="Expulsar"/> + </notification> + <notification name="EjectGroupMembersWarning"> + Você está prestes a expulsar [COUNT] membros do grupo. + <usetemplate ignoretext="Confirmar expulsão de diversos membros do grupo" name="okcancelignore" notext="Cancelar" yestext="Expulsar"/> + </notification> <notification name="AttachmentDrop"> Você está prestes a largar seu anexo. Tem certeza de que quer prosseguir? @@ -1105,9 +1113,9 @@ em TODOS OS TERRENOS deste sim? Por favor, insira um valor maior. </notification> <notification name="ConfirmItemDeleteHasLinks"> - Pelo menos um dos itens possui links que levam a ele. Ao excluir o item, os links não funcionarão mais. Por isso, recomendamos excluir os links primeiro. + Pelo menos um dos itens possui links que levam a ele. Ao excluir o item, os links não funcionarão mais. Por isso, recomendamos excluir os links primeiro. -Tem certeza de que quer excluir estes items? +Tem certeza de que quer excluir estes itens? <usetemplate name="okcancelbuttons" notext="Cancelar" yestext="OK"/> </notification> <notification name="ConfirmObjectDeleteLock"> @@ -1123,9 +1131,9 @@ Tem certeza de que deseja apagar estes itens? <usetemplate name="okcancelbuttons" notext="Não" yestext="Sim"/> </notification> <notification name="ConfirmObjectDeleteNoOwn"> - Você não é proprietário de pelo menos um dos itens selecionados. + Ao menos um dos itens selecionados não é seu. -Tem certeza de que deseja apagar estes itens? +Tem certeza de que quer excluir estes itens? <usetemplate name="okcancelbuttons" notext="Não" yestext="Sim"/> </notification> <notification name="ConfirmObjectDeleteLockNoCopy"> @@ -1135,22 +1143,26 @@ Tem certeza de que deseja apagar estes itens? <usetemplate name="okcancelbuttons" notext="Não" yestext="Sim"/> </notification> <notification name="ConfirmObjectDeleteLockNoOwn"> - Pelo menos um dos objetos está trancado ou não é de sua posse. + Ao menos um objeto está bloqueado. +Ao menos um objeto não é seu. -Tem certeza de que deseja apagar estes itens? +Tem certeza de que quer excluir estes itens? <usetemplate name="okcancelbuttons" notext="Não" yestext="Sim"/> </notification> <notification name="ConfirmObjectDeleteNoCopyNoOwn"> - Pelo menos um dos objetos não é copiável ou não é de sua posse. + Ao menos um objeto não é copiável. +Ao menos um objeto não é seu. -Tem certeza de que deseja apagar estes itens? +Tem certeza de que quer excluir estes itens? <usetemplate name="okcancelbuttons" notext="Não" yestext="Sim"/> </notification> <notification name="ConfirmObjectDeleteLockNoCopyNoOwn"> - Pelo menos um dos objetos está trancado, não é copiável ou você não o possui. + Ao menos um objeto está bloqueado. +Ao menos um objeto não é copiável. +Ao menos um objeto não é seu. -Tem certeza de que deseja apagar estes itens? - <usetemplate name="okcancelbuttons" notext="Não" yestext="Sim"/> +Tem certeza de que quer excluir estes itens? + <usetemplate name="okcancelbuttons" notext="Cancelar" yestext="Sim"/> </notification> <notification name="ConfirmObjectTakeLock"> Pelo menos um dos objetos está trancado. @@ -1468,13 +1480,43 @@ Versão [VERSION] [[RELEASE_NOTES_FULL_URL] sobre esta atualização] </notification> <notification name="RequiredUpdateDownloadedVerboseDialog"> O software requer uma atualização que já foi baixada. -Versão [VERSION] +Versão [VERSION] Informação [[INFO_URL] sobre essa atualização] Para instalar a atualização, será preciso reiniciar o [APP_NAME]. <usetemplate name="okbutton" yestext="OK"/> </notification> <notification name="RequiredUpdateDownloadedDialog"> Para instalar a atualização, será preciso reiniciar o [APP_NAME]. +Informação [[INFO_URL] sobre essa atualização] + <usetemplate name="okbutton" yestext="OK"/> + </notification> + <notification name="OtherChannelDownloadBackgroundTip"> + Baixamos uma atualização para a instalação do [APP_NAME]. +Versão [VERSION] +O visualizador experimental foi substituÃdo por um visualizador [NEW_CHANNEL]; +consulte [[INFO_URL] para obter mais detalhes sobre essa atualização] + <usetemplate name="okcancelbuttons" notext="Depois..." yestext="Instalar agora e reiniciar o [APP_NAME]"/> + </notification> + <notification name="OtherChannelDownloadBackgroundDialog"> + Baixamos uma atualização para a instalação do [APP_NAME]. +Versão [VERSION] +O visualizador experimental foi substituÃdo por um visualizador [NEW_CHANNEL]; +consulte a informação [[INFO_URL] sobre essa atualização] + <usetemplate name="okcancelbuttons" notext="Depois..." yestext="Instalar agora e reiniciar o [APP_NAME]"/> + </notification> + <notification name="OtherChannelRequiredUpdateDownloadedVerboseDialog"> + O software requer uma atualização que já foi baixada. +Versão [VERSION] +O visualizador experimental foi substituÃdo por um visualizador [NEW_CHANNEL]; +consulte a informação [[INFO_URL] sobre essa atualização] + +Para instalar a atualização, será preciso reiniciar o [APP_NAME]. + <usetemplate name="okbutton" yestext="OK"/> + </notification> + <notification name="OtherChannelRequiredUpdateDownloadedDialog"> + Para instalar a atualização, será preciso reiniciar o [APP_NAME]. +O visualizador experimental foi substituÃdo por um visualizador [NEW_CHANNEL]; +consulte a informação [[INFO_URL] sobre essa atualização] <usetemplate name="okbutton" yestext="OK"/> </notification> <notification name="DeedObjectToGroup"> @@ -1524,6 +1566,10 @@ Para instalar a atualização, será preciso reiniciar o [APP_NAME]. Você é atualmente um membro do grupo <usetemplate name="okcancelbuttons" notext="Cancelar" yestext="Sair"/> </notification> + <notification name="OwnerCannotLeaveGroup"> + Não foi possÃvel deixar o grupo. Você não pode deixar o grupo pois é o último proprietário dele. Primeiramente, atribua outro membro à função de proprietário. + <usetemplate name="okbutton" yestext="OK"/> + </notification> <notification name="ConfirmKick"> Tem CERTEZA de que deseja expulsar todos os residentes do grid? <usetemplate name="okcancelbuttons" notext="Cancelar" yestext="Chutar todos"/> @@ -2384,9 +2430,7 @@ Selecione só um objeto. e selecionar 'Teletransportar'.) </notification> <notification name="TeleportToPerson"> - Para entrar em contato com residentes como '[NAME]', clique no botão "Pessoas", selecione um residente na janela que é exibida e clique em 'MI' na - parte inferior da janela. - (Também é possÃvel clicar duas vezes no nome, ou clicar no nome com o botão direito e selecionar 'MI'.) + Para iniciar uma conversa particular com alguém, clique com o botão direito no avatar e selecione "MI" no menu. </notification> <notification name="CantSelectLandFromMultipleRegions"> ImpossÃvel selecionar terra nas fronteiras do servidor. Tente selecionar um pedaço menor de terra. @@ -2757,6 +2801,15 @@ Não conceda acesso se você não entender completamente por que ele deseja aces <button name="Deny" text="Negar"/> </form> </notification> + <notification name="UnknownScriptQuestion"> + A permissão de script de tempo de execução solicitada por '<nolink>[OBJECTNAME]</nolink>', um objeto de '[NAME]', não é reconhecida pelo visualizador e não pode ser concedida. + +Para conceder essa permissão, atualize seu visualizador para a versão mais recente em [DOWNLOADURL]. + <form name="form"> + <button name="Deny" text="Ok"/> + <button name="Mute" text="Bloquear"/> + </form> + </notification> <notification name="ScriptDialog"> '<nolink>[TITLE]</nolink>' de [NAME] [MESSAGE] diff --git a/indra/newview/skins/default/xui/pt/panel_people.xml b/indra/newview/skins/default/xui/pt/panel_people.xml index babb48c208..205fd6b97d 100755 --- a/indra/newview/skins/default/xui/pt/panel_people.xml +++ b/indra/newview/skins/default/xui/pt/panel_people.xml @@ -49,6 +49,9 @@ Em busca de alguém para conversar? Procure no [secondlife:///app/worldmap Mapa- <menu_button name="plus_btn" tool_tip="Entrar em um grupo/Criar novo grupo"/> <dnd_button name="minus_btn" tool_tip="Sair do grupo selecionado"/> </panel> + <text name="groupcount"> + Você pertence a [COUNT] grupos e pode entrar em mais [REMAINING]. + </text> </panel> <panel label="RECENTE" name="recent_panel"> <panel label="bottom_panel" name="recent_buttons_panel"> diff --git a/indra/newview/skins/default/xui/pt/panel_preferences_chat.xml b/indra/newview/skins/default/xui/pt/panel_preferences_chat.xml index baf14c2c23..89f1e07647 100755 --- a/indra/newview/skins/default/xui/pt/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/pt/panel_preferences_chat.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <panel label="Chat" name="chat"> - <panel> - <check_box initial_value="true" label="Executar animação digitada quando estiver conversando" name="play_typing_animation"/> - <check_box label="Enviar MIs por email se estiver desconectado" name="send_im_to_email"/> + <panel name="general_chat_settings"> + <check_box initial_value="true" label="Executar animação de digitação durante o bate-papo" name="play_typing_animation"/> + <check_box label="Envie MIs por email quando eu estiver desconectado" name="send_im_to_email"/> <check_box label="Apenas amigos e grupos podem me ligar ou enviar MIs" name="voice_call_friends_only_check"/> <text name="font_size"> Tamanho da fonte: @@ -12,62 +12,74 @@ <item label="Médio" name="Medium" value="1"/> <item label="Grande" name="Large" value="2"/> </combo_box> - <check_box label="Balão de bate-papo" name="bubble_text_chat"/> + <check_box label="Balão de conversa" name="bubble_text_chat"/> </panel> - <panel> - <text name="notifications"> - Notificações - </text> + <panel name="im_notification_settings"> <text name="friend_ims"> MIs de amigos: </text> <combo_box name="FriendIMOptions"> <item label="Abrir janela Conversas" name="OpenConversationsWindow" value="openconversations"/> - <item label="Abrir pop up com mensagem" name="PopUpMessage" value="toast"/> - <item label="Piscar botão da barra de ferramentas" name="FlashToolbarButton" value="flash"/> - <item label="Nenhum" name="None" value="none"/> + <item label="Abrir pop up com mensagem" name="PopUpMessage" value="avisos"/> + <item label="Piscar botão da barra de ferramentas" name="FlashToolbarButton" value="piscar"/> + <item label="Nenhuma ação" name="NoAction" value="noaction"/> </combo_box> + <check_box label="Executar som" name="play_sound_friend_im"/> <text name="non_friend_ims"> MIs de não amigos: </text> <combo_box name="NonFriendIMOptions"> <item label="Abrir janela Conversas" name="OpenConversationsWindow" value="openconversations"/> - <item label="Abrir pop up com mensagem" name="PopUpMessage" value="toast"/> - <item label="Piscar botão da barra de ferramentas" name="FlashToolbarButton" value="flash"/> - <item label="Nenhum" name="None" value="none"/> + <item label="Abrir pop up com mensagem" name="PopUpMessage" value="avisos"/> + <item label="Piscar botão da barra de ferramentas" name="FlashToolbarButton" value="piscar"/> + <item label="Nenhuma ação" name="NoAction" value="noaction"/> </combo_box> + <check_box label="Executar som" name="play_sound_non_friend_im"/> <text name="conference_ims"> MIs de conferências: </text> <combo_box name="ConferenceIMOptions"> <item label="Abrir janela Conversas" name="OpenConversationsWindow" value="openconversations"/> - <item label="Abrir pop up com mensagem" name="PopUpMessage" value="toast"/> - <item label="Piscar botão da barra de ferramentas" name="FlashToolbarButton" value="flash"/> - <item label="Nenhum" name="None" value="none"/> + <item label="Abrir pop up com mensagem" name="PopUpMessage" value="avisos"/> + <item label="Piscar botão da barra de ferramentas" name="FlashToolbarButton" value="piscar"/> + <item label="Nenhuma ação" name="NoAction" value="noaction"/> </combo_box> + <check_box label="Executar som" name="play_sound_conference_im"/> <text name="group_chat"> - Bate-papo de grupo: + Conversa em grupo: </text> <combo_box name="GroupChatOptions"> <item label="Abrir janela Conversas" name="OpenConversationsWindow" value="openconversations"/> - <item label="Abrir pop up com mensagem" name="PopUpMessage" value="toast"/> - <item label="Piscar botão da barra de ferramentas" name="FlashToolbarButton" value="flash"/> - <item label="Nenhum" name="None" value="none"/> + <item label="Abrir pop up com mensagem" name="PopUpMessage" value="avisos"/> + <item label="Piscar botão da barra de ferramentas" name="FlashToolbarButton" value="piscar"/> + <item label="Nenhuma ação" name="NoAction" value="noaction"/> </combo_box> + <check_box label="Executar som" name="play_sound_group_chat_im"/> <text name="nearby_chat"> - Bate-papo local: + Conversa local: </text> <combo_box name="NearbyChatOptions"> <item label="Abrir janela Conversas" name="OpenConversationsWindow" value="openconversations"/> - <item label="Abrir pop up com mensagem" name="PopUpMessage" value="toast"/> - <item label="Piscar botão da barra de ferramentas" name="FlashToolBarButton" value="flash"/> - <item label="Nenhum" name="None" value="none"/> + <item label="Abrir pop up com mensagem" name="PopUpMessage" value="avisos"/> + <item label="Piscar botão da barra de ferramentas" name="FlashToolBarButton" value="piscar"/> + <item label="Nenhuma ação" name="NoAction" value="noaction"/> + </combo_box> + <check_box label="Executar som" name="play_sound_nearby_chat_im"/> + <text name="object_ims"> + MIs de objetos: + </text> + <combo_box name="ObjectIMOptions"> + <item label="Abrir janela Conversas" name="OpenConversationsWindow" value="openconversations"/> + <item label="Abrir pop up com mensagem" name="PopUpMessage" value="avisos"/> + <item label="Piscar botão da barra de ferramentas" name="FlashToolBarButton" value="piscar"/> + <item label="Nenhuma ação" name="NoAction" value="noaction"/> </combo_box> + <check_box label="Executar som" name="play_sound_object_im"/> <text name="notifications_alert"> Para interromper temporariamente todas as notificações, use Comunicar > Não perturbe. </text> </panel> - <panel> + <panel name="play_sound_settings"> <text name="play_sound"> Executar som: </text> @@ -76,7 +88,7 @@ <check_box label="Oferta de teletransporte" name="teleport_offer"/> <check_box label="Oferta de inventário" name="inventory_offer"/> </panel> - <panel> + <panel name="log_settings"> <button label="Limpar registro..." name="clear_log"/> <button label="Excluir transcrições..." name="delete_transcripts"/> <button label="Procurar..." label_selected="Procurar" name="log_path_button"/> diff --git a/indra/newview/skins/default/xui/pt/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/pt/panel_preferences_graphics1.xml index 28e7184326..37e8838bf4 100755 --- a/indra/newview/skins/default/xui/pt/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/pt/panel_preferences_graphics1.xml @@ -31,7 +31,7 @@ rápido <check_box initial_value="verdadeiro" label="Luzes locais" name="LocalLights"/> <check_box initial_value="true" label="Sombreadores básicos" name="BasicShaders" tool_tip="Desabilitar esta opção poderá impedir que alguns drivers de placa de vÃdeo a travem."/> <check_box initial_value="true" label="Sombreadores Atmosféricos" name="WindLightUseAtmosShaders"/> - <check_box initial_value="verdadeiro" label="Iluminação e sombras" name="UseLightShaders"/> + <check_box initial_value="verdadeiro" label="Modelo avançado de luzes" name="UseLightShaders"/> <check_box initial_value="verdadeiro" label="Oclusão ambiental" name="UseSSAO"/> <check_box initial_value="verdadeiro" label="Profundidade" name="UseDoF"/> <text name="shadows_label"> diff --git a/indra/newview/skins/default/xui/pt/panel_preferences_setup.xml b/indra/newview/skins/default/xui/pt/panel_preferences_setup.xml index ebbd63138a..887d0cfe98 100755 --- a/indra/newview/skins/default/xui/pt/panel_preferences_setup.xml +++ b/indra/newview/skins/default/xui/pt/panel_preferences_setup.xml @@ -29,6 +29,7 @@ <combo_box.item label="Instalar automaticamente" name="Install_automatically"/> <combo_box.item label="Baixar e instalar atualizações manualmente" name="Install_manual"/> </combo_box> + <check_box label="Disposto a atualizar para candidatos da versão" name="update_willing_to_test"/> <text name="Proxy Settings:"> Configurações de proxy: </text> diff --git a/indra/newview/skins/default/xui/pt/panel_script_ed.xml b/indra/newview/skins/default/xui/pt/panel_script_ed.xml index de02aafe2f..39bb5edc75 100755 --- a/indra/newview/skins/default/xui/pt/panel_script_ed.xml +++ b/indra/newview/skins/default/xui/pt/panel_script_ed.xml @@ -34,6 +34,7 @@ <menu_item_call label="Selecionar tudo" name="Select All"/> <menu_item_call label="Desmarcar" name="Deselect"/> <menu_item_call label="Buscar / Substituir..." name="Search / Replace..."/> + <menu_item_call label="Ir para a linha..." name="Go to line..."/> </menu> <menu label="Ajuda" name="Help"> <menu_item_call label="ajuda..." name="Help..."/> diff --git a/indra/newview/skins/default/xui/pt/panel_tools_texture.xml b/indra/newview/skins/default/xui/pt/panel_tools_texture.xml new file mode 100644 index 0000000000..03da89dd3b --- /dev/null +++ b/indra/newview/skins/default/xui/pt/panel_tools_texture.xml @@ -0,0 +1,116 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<panel label="Textura" name="Texture"> + <panel.string name="string repeats per meter"> + Repetições por metro + </panel.string> + <panel.string name="string repeats per face"> + Repetições por face + </panel.string> + <text name="color label"> + Cor + </text> + <color_swatch label="" name="colorswatch" tool_tip="Selecionar a cor"/> + <text name="color trans"> + % de transparência + </text> + <text name="glow label"> + Brilho + </text> + <check_box label="Completamente luminoso" name="checkbox fullbright"/> + <combo_box name="combobox matmedia"> + <combo_box.item label="Materiais" name="Materials"/> + <combo_box.item label="MÃdia" name="Media"/> + </combo_box> + <combo_box name="combobox mattype"> + <combo_box.item label="Textura (difusa)" name="Texture (diffuse)"/> + <combo_box.item label="Relevo (normal)" name="Bumpiness (normal)"/> + <combo_box.item label="Brilho (especular)" name="Shininess (specular)"/> + </combo_box> + <texture_picker label="Textura" name="texture control" tool_tip="Selecionar imagem"/> + <text name="label alphamode"> + Modo alpha + </text> + <combo_box name="combobox alphamode"> + <combo_box.item label="Nenhum" name="None"/> + <combo_box.item label="Mistura alpha" name="Alpha blending"/> + <combo_box.item label="Máscara alpha" name="Alpha masking"/> + <combo_box.item label="Máscara emissiva" name="Emissive mask"/> + </combo_box> + <text name="label maskcutoff"> + Corte da máscara + </text> + <texture_picker label="Textura" name="bumpytexture control" tool_tip="Selecionar imagem"/> + <text name="label bumpiness"> + Relevo + </text> + <combo_box name="combobox bumpiness"> + <combo_box.item label="Nenhum" name="None"/> + <combo_box.item label="Luminosidade" name="Brightness"/> + <combo_box.item label="Escuridão" name="Darkness"/> + <combo_box.item label="grão de madeira" name="woodgrain"/> + <combo_box.item label="casca de árvore" name="bark"/> + <combo_box.item label="tijolos" name="bricks"/> + <combo_box.item label="quadriculado" name="checker"/> + <combo_box.item label="concreto" name="concrete"/> + <combo_box.item label="ladrilho rÃspido" name="crustytile"/> + <combo_box.item label="pedra talhada" name="cutstone"/> + <combo_box.item label="discos" name="discs"/> + <combo_box.item label="cascalho" name="gravel"/> + <combo_box.item label="placa de petri" name="petridish"/> + <combo_box.item label="desvio" name="siding"/> + <combo_box.item label="ladrilho de pedra" name="stonetile"/> + <combo_box.item label="estuque" name="stucco"/> + <combo_box.item label="sucção" name="suction"/> + <combo_box.item label="tecelagem" name="weave"/> + </combo_box> + <texture_picker label="Textura" name="shinytexture control" tool_tip="Selecionar imagem"/> + <text name="label shininess"> + Brilho + </text> + <combo_box name="combobox shininess"> + <combo_box.item label="Nenhum" name="None"/> + <combo_box.item label="Baixo" name="Low"/> + <combo_box.item label="Médio" name="Medium"/> + <combo_box.item label="Alto" name="High"/> + </combo_box> + <text name="label glossiness"> + Acetinação + </text> + <text name="label environment"> + Ambiente + </text> + <text name="label shinycolor"> + Cor + </text> + <color_swatch label="" name="shinycolorswatch" tool_tip="Selecionar a cor"/> + <text name="media_info"> + A URL da mÃdia escolhida, caso haja, é inserida aqui + </text> + <button label="Selecionar..." name="add_media" tool_tip="Adicionar mÃdia"/> + <button label="Remover" name="delete_media" tool_tip="Excluir esta textura de mÃdia"/> + <button label="Alinhar" label_selected="Alinhar mÃdia" name="button align" tool_tip="Alinhar texturas de mÃdia (após carregar mÃdia)"/> + <text name="tex gen"> + Mapeamento + </text> + <combo_box name="combobox texgen"> + <combo_box.item label="Padrão" name="Default"/> + <combo_box.item label="Planar" name="Planar"/> + </combo_box> + <spinner label="Escala horizontal" name="TexScaleU"/> + <spinner label="Escala vertical" name="TexScaleV"/> + <spinner label="Repetições por metro" name="rptctrl"/> + <spinner label="Graus de rotação" name="TexRot"/> + <spinner label="Offset horizontal" name="TexOffsetU"/> + <spinner label="Offset vertical" name="TexOffsetV"/> + <spinner label="Escala horizontal" name="bumpyScaleU"/> + <spinner label="Escala vertical" name="bumpyScaleV"/> + <spinner label="Graus de rotação" name="bumpyRot"/> + <spinner label="Offset horizontal" name="bumpyOffsetU"/> + <spinner label="Offset vertical" name="bumpyOffsetV"/> + <spinner label="Escala horizontal" name="shinyScaleU"/> + <spinner label="Escala vertical" name="shinyScaleV"/> + <spinner label="Graus de rotação" name="shinyRot"/> + <spinner label="Offset horizontal" name="shinyOffsetU"/> + <spinner label="Offset vertical" name="shinyOffsetV"/> + <check_box initial_value="false" label="Alinhar planos planares" name="checkbox planar align" tool_tip="Alinhar texturas de todos os planos selecionados com o plano selecionado por último. Requer mapeamento de textura planar."/> +</panel> diff --git a/indra/newview/skins/default/xui/pt/role_actions.xml b/indra/newview/skins/default/xui/pt/role_actions.xml index 21b085431e..e45a3bd21f 100755 --- a/indra/newview/skins/default/xui/pt/role_actions.xml +++ b/indra/newview/skins/default/xui/pt/role_actions.xml @@ -25,7 +25,7 @@ </action_set> <action_set description="Estas habilidades incluem poderes para mudar o nome da parcelas e configurações de publicação, visibilidade da busca de diretório e ponto de aterrissagem & opções de rota de TP." name="Parcel Identity"> <action description="Alternar 'Exibir nos resultados de busca' e selecionar a categoria" longdescription="Alterne entre 'Exibir nos resultados de busca' ou não, e selecione a categoria do terreno em 'Sobre o terreno'." name="land find places" value="17"/> - <action description="Mude o nome, a descrição e a exibição do terreno nos resultados de busca." longdescription="Mude o nome, a descrição e a exibição do terreno nos resultados de busca. Veja essas opções em Sobre o terreno > guia Opções." name="land change identity" value="18"/> + <action description="Alterar nome da parcela, descrição e configurações de "Conteúdo moderado"" longdescription="Altere o nome da parcela, descrição e configurações de "Conteúdo moderado". Isso é feito em Sobre o terreno > guia Opções." name="land change identity" value="18"/> <action description="Definir ponto de aterrissagem e rota de teletransporte" longdescription="Em uma parcela pertencente ao grupo, membros em uma função com esta habilidade podem definir um ponto de aterrissagem para especificar onde os teletransportes chegam e também definir a rota do teletransporte para um maior controle. É feito em Sobre o terreno > aba Opções." name="land set landing point" value="19"/> </action_set> <action_set description="Estas habilidade incluem poderes que afetam opções de parcela, como 'Criar objetos', 'Editar terreno' e música & configurações de mÃdia." name="Parcel Settings"> diff --git a/indra/newview/skins/default/xui/pt/strings.xml b/indra/newview/skins/default/xui/pt/strings.xml index 4bf18aab70..adc3ee14e0 100755 --- a/indra/newview/skins/default/xui/pt/strings.xml +++ b/indra/newview/skins/default/xui/pt/strings.xml @@ -130,6 +130,9 @@ <string name="create_account_url"> http://join.secondlife.com/?sourceid=[sourceid] </string> + <string name="ViewerDownloadURL"> + http://secondlife.com/download + </string> <string name="LoginFailedViewerNotPermitted"> O visualizador utilizado já não é compatÃvel com o Second Life. Visite a página abaixo para baixar uma versão atual: http://secondlife.com/download @@ -400,6 +403,9 @@ Pessoas com contas gratuitas não poderão acessar o Second Life no momento para <string name="SLappAgentRequestFriend"> Pedido de amizade </string> + <string name="SLappAgentRemoveFriend"> + Remoção de amigo + </string> <string name="BUTTON_CLOSE_DARWIN"> Fechar (⌘W) </string> @@ -787,6 +793,9 @@ Pessoas com contas gratuitas não poderão acessar o Second Life no momento para <string name="multiple_textures"> Múltiplo </string> + <string name="use_texture"> + Usar textura + </string> <string name="texture_loading"> Carregando... </string> @@ -883,6 +892,21 @@ Pessoas com contas gratuitas não poderão acessar o Second Life no momento para <string name="TeleportYourAgent"> Teletransportá-lo </string> + <string name="JoinAnExperience"> + Participar de uma experiência + </string> + <string name="SilentlyManageEstateAccess"> + Suprimir alertas ao gerenciar listas de acesso ao terreno + </string> + <string name="OverrideYourAnimations"> + Substituir suas animações padrão + </string> + <string name="ScriptReturnObjects"> + Retornar objetos em seu nome + </string> + <string name="UnknownScriptPermission"> + (desconhecido)! + </string> <string name="SIM_ACCESS_PG"> Público geral </string> @@ -1908,6 +1932,12 @@ Pessoas com contas gratuitas não poderão acessar o Second Life no momento para <string name="ATTACH_HUD_BOTTOM_RIGHT"> HUD direito inferior </string> + <string name="ATTACH_NECK"> + Pescoço + </string> + <string name="ATTACH_AVATAR_CENTER"> + Centro do avatar + </string> <string name="CursorPos"> Linha [LINE], Coluna [COLUMN] </string> @@ -2894,6 +2924,9 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. <string name="Hip Width"> Largura do quadril </string> + <string name="Hover"> + Pairar + </string> <string name="In"> Dentro </string> @@ -4951,4 +4984,7 @@ Tente colocar o caminho do editor entre aspas. <string name="logging_calls_enabled_log_empty"> Não há conversas registradas. Depois que você entrar em contato com alguém, ou alguém entrar em contato com você, um registro será exibido aqui. </string> + <string name="loading_chat_logs"> + Carregando... + </string> </strings> diff --git a/indra/newview/skins/default/xui/ru/floater_about.xml b/indra/newview/skins/default/xui/ru/floater_about.xml index bb6266ac9a..9494106e96 100755 --- a/indra/newview/skins/default/xui/ru/floater_about.xml +++ b/indra/newview/skins/default/xui/ru/floater_about.xml @@ -8,7 +8,9 @@ ИÑпользован компилÑтор [COMPILER], верÑÐ¸Ñ [COMPILER_VERSION] </floater.string> <floater.string name="AboutPosition"> - Ð’Ñ‹ в точке [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1] в регионе «[REGION]», раÑположенном на <nolink>[HOSTNAME]</nolink> ([HOSTIP]) + Ð’Ñ‹ в точке [POSITION_LOCAL_0,number,1], [POSITION_LOCAL_1,number,1], [POSITION_LOCAL_2,number,1] в регионе «[REGION]», раÑположенном на <nolink>[HOSTNAME]</nolink> ([HOSTIP]) +SLURL: <nolink>[SLURL]</nolink> +(глобальные координаты [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1]) [SERVER_VERSION] [SERVER_RELEASE_NOTES_URL] </floater.string> diff --git a/indra/newview/skins/default/xui/ru/floater_bulk_perms.xml b/indra/newview/skins/default/xui/ru/floater_bulk_perms.xml index ccf13cf02a..31fc1c5ed3 100755 --- a/indra/newview/skins/default/xui/ru/floater_bulk_perms.xml +++ b/indra/newview/skins/default/xui/ru/floater_bulk_perms.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="floaterbulkperms" title="ИЗМЕÐИТЬ Ð ÐЗРЕШЕÐИЯ ÐРИСПОЛЬЗОВÐÐИЕ КОÐТЕÐТÐ"> +<floater name="floaterbulkperms" title="ÐÐСТРОИТЬ Ð ÐЗРЕШЕÐИЯ ÐРИСПОЛЬЗОВÐÐИЕ КОÐТЕÐТÐ"> <floater.string name="nothing_to_modify_text"> Ð’ выбранной облаÑти нет контента, который можно изменÑÑ‚ÑŒ. </floater.string> @@ -24,7 +24,7 @@ <button label="√ Ð’Ñе" name="check_all"/> <button label="ОчиÑтить" label_selected="Ðет" name="check_none"/> <text name="newperms"> - Ðовые Ñ€Ð°Ð·Ñ€ÐµÑˆÐµÐ½Ð¸Ñ Ð½Ð° контент + ÐаÑтроить Ñ€Ð°Ð·Ñ€ÐµÑˆÐµÐ½Ð¸Ñ Ð½Ð° иÑпользование контента: </text> <text name="GroupLabel"> Группа: @@ -40,6 +40,7 @@ <check_box label="ИзменÑÑ‚ÑŒ" name="next_owner_modify"/> <check_box label="Копировать" name="next_owner_copy"/> <check_box initial_value="иÑтина" label="Передать" name="next_owner_transfer" tool_tip="Следующий владелец может отдать или перепродать объект"/> - <button label="ОК" name="apply"/> + <button label="OK" name="ok"/> + <button label="Применить" name="apply"/> <button label="Отмена" name="close"/> </floater> diff --git a/indra/newview/skins/default/xui/ru/floater_goto_line.xml b/indra/newview/skins/default/xui/ru/floater_goto_line.xml new file mode 100644 index 0000000000..51caaa471d --- /dev/null +++ b/indra/newview/skins/default/xui/ru/floater_goto_line.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="script goto" title="ПЕРЕЙТИ ÐРСТРОКУ"> + <button label="OK" label_selected="OK" name="goto_btn"/> + <text name="txt"> + Перейти на Ñтроку + </text> +</floater> diff --git a/indra/newview/skins/default/xui/ru/floater_im_session.xml b/indra/newview/skins/default/xui/ru/floater_im_session.xml index ea110ffb44..d4ca04b88b 100755 --- a/indra/newview/skins/default/xui/ru/floater_im_session.xml +++ b/indra/newview/skins/default/xui/ru/floater_im_session.xml @@ -34,13 +34,11 @@ <layout_panel name="body_panel"> <layout_stack name="im_panels"> <layout_panel name="right_part_holder"> - <panel name="trnsAndChat_panel"> - <layout_stack name="translate_and_chat_stack"> - <layout_panel name="translate_chat_checkbox_lp"> - <check_box label="Переводить чат" name="translate_chat_checkbox"/> - </layout_panel> - </layout_stack> - </panel> + <layout_stack name="translate_and_chat_stack"> + <layout_panel name="translate_chat_checkbox_lp"> + <check_box label="Переводить чат" name="translate_chat_checkbox"/> + </layout_panel> + </layout_stack> </layout_panel> </layout_stack> </layout_panel> diff --git a/indra/newview/skins/default/xui/ru/floater_pathfinding_console.xml b/indra/newview/skins/default/xui/ru/floater_pathfinding_console.xml index 8faddb1805..fa72df04fd 100755 --- a/indra/newview/skins/default/xui/ru/floater_pathfinding_console.xml +++ b/indra/newview/skins/default/xui/ru/floater_pathfinding_console.xml @@ -71,7 +71,7 @@ <text name="show_label"> Показать: </text> - <check_box label="ТеÑÑ‚" name="show_world"/> + <check_box label="Мир" name="show_world"/> <check_box label="Только перемещаемые предметы" name="show_world_movables_only"/> <check_box label="ÐÐ°Ð²Ð¸Ð³Ð°Ñ†Ð¸Ð¾Ð½Ð½Ð°Ñ Ñетка" name="show_navmesh"/> <text name="show_walkability_label"> diff --git a/indra/newview/skins/default/xui/ru/menu_attachment_other.xml b/indra/newview/skins/default/xui/ru/menu_attachment_other.xml index fb1c24448b..76acb32a64 100755 --- a/indra/newview/skins/default/xui/ru/menu_attachment_other.xml +++ b/indra/newview/skins/default/xui/ru/menu_attachment_other.xml @@ -11,7 +11,9 @@ <menu_item_call label="Заморозить" name="Freeze..."/> <menu_item_call label="Выкинуть" name="Eject..."/> <menu_item_call label="Отладка текÑтур" name="Debug..."/> + <menu_item_call label="Вывод XML" name="Dump XML"/> <menu_item_call label="Приблизить" name="Zoom In"/> <menu_item_call label="Заплатить" name="Pay..."/> <menu_item_call label="Профиль объекта" name="Object Inspect"/> + <menu_item_call label="Блокировать владельца учаÑтка" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/ru/menu_attachment_self.xml b/indra/newview/skins/default/xui/ru/menu_attachment_self.xml index f241b48871..2b1291a8d5 100755 --- a/indra/newview/skins/default/xui/ru/menu_attachment_self.xml +++ b/indra/newview/skins/default/xui/ru/menu_attachment_self.xml @@ -12,5 +12,7 @@ <menu_item_call label="Мои группы" name="Groups..."/> <menu_item_call label="Мой профиль" name="Profile..."/> <menu_item_call label="Отладка текÑтур" name="Debug..."/> + <menu_item_call label="Вывод XML" name="Dump XML"/> <menu_item_call label="БроÑить" name="Drop"/> + <menu_item_call label="Блокировать владельца учаÑтка" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/ru/menu_avatar_other.xml b/indra/newview/skins/default/xui/ru/menu_avatar_other.xml index fb283c9d80..dfe3c2e701 100755 --- a/indra/newview/skins/default/xui/ru/menu_avatar_other.xml +++ b/indra/newview/skins/default/xui/ru/menu_avatar_other.xml @@ -11,6 +11,8 @@ <menu_item_call label="Заморозить" name="Freeze..."/> <menu_item_call label="Выкинуть" name="Eject..."/> <menu_item_call label="Отладка текÑтур" name="Debug..."/> + <menu_item_call label="Вывод XML" name="Dump XML"/> <menu_item_call label="Приблизить" name="Zoom In"/> <menu_item_call label="Заплатить" name="Pay..."/> + <menu_item_call label="Блокировать владельца учаÑтка" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/ru/menu_avatar_self.xml b/indra/newview/skins/default/xui/ru/menu_avatar_self.xml index b72f3dcc42..e09117226c 100755 --- a/indra/newview/skins/default/xui/ru/menu_avatar_self.xml +++ b/indra/newview/skins/default/xui/ru/menu_avatar_self.xml @@ -29,4 +29,6 @@ <menu_item_call label="Мои группы" name="Groups..."/> <menu_item_call label="Мой профиль" name="Profile..."/> <menu_item_call label="Отладка текÑтур" name="Debug..."/> + <menu_item_call label="Вывод XML" name="Dump XML"/> + <menu_item_call label="Блокировать владельца учаÑтка" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/ru/menu_conversation.xml b/indra/newview/skins/default/xui/ru/menu_conversation.xml index 530b1ea704..4d1240db98 100644 --- a/indra/newview/skins/default/xui/ru/menu_conversation.xml +++ b/indra/newview/skins/default/xui/ru/menu_conversation.xml @@ -3,6 +3,7 @@ <menu_item_call label="Закрыть разговор" name="close_conversation"/> <menu_item_call label="Открыть голоÑовой чат" name="open_voice_conversation"/> <menu_item_call label="Прекратить голоÑовой чат" name="disconnect_from_voice"/> + <menu_item_call label="Закрыть выбранные" name="close_selected_conversations"/> <menu_item_call label="Смотреть профиль" name="view_profile"/> <menu_item_call label="IM" name="im"/> <menu_item_call label="Предложить телепортацию" name="offer_teleport"/> diff --git a/indra/newview/skins/default/xui/ru/menu_land.xml b/indra/newview/skins/default/xui/ru/menu_land.xml index 89889d7bf6..5aa4e6ccd2 100755 --- a/indra/newview/skins/default/xui/ru/menu_land.xml +++ b/indra/newview/skins/default/xui/ru/menu_land.xml @@ -6,4 +6,5 @@ <menu_item_call label="Купить пропуÑк" name="Land Buy Pass"/> <menu_item_call label="СтроительÑтво" name="Create"/> <menu_item_call label="Изменить ландшафт" name="Edit Terrain"/> + <menu_item_call label="Блокировать владельца учаÑтка" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/ru/menu_login.xml b/indra/newview/skins/default/xui/ru/menu_login.xml index 93a5ffbb25..835c4e186e 100755 --- a/indra/newview/skins/default/xui/ru/menu_login.xml +++ b/indra/newview/skins/default/xui/ru/menu_login.xml @@ -18,7 +18,13 @@ <menu_item_call label="Показать лицензионное Ñоглашение" name="TOS"/> <menu_item_call label="Показать Ñообщение об ошибке" name="Critical"/> <menu_item_call label="ТеÑÑ‚ отладки плавающего окна Ñ Ð²ÐµÐ±-контентом" name="Web Content Floater Debug Test"/> - <menu label="Уровень журнала" name="Set Logging Level"/> + <menu label="Уровень журнала" name="Set Logging Level"> + <menu_item_check label="Отладка" name="Debug"/> + <menu_item_check label="ИнформациÑ" name="Info"/> + <menu_item_check label="Внимание!" name="Warning"/> + <menu_item_check label="Ошибка" name="Error"/> + <menu_item_check label="Ðет" name="None"/> + </menu> <menu_item_check label="Выбор Ñетки" name="Show Grid Picker"/> <menu_item_call label="КонÑоль уведомлений" name="Show Notifications Console"/> </menu> diff --git a/indra/newview/skins/default/xui/ru/menu_mute_particle.xml b/indra/newview/skins/default/xui/ru/menu_mute_particle.xml new file mode 100644 index 0000000000..0c5a147419 --- /dev/null +++ b/indra/newview/skins/default/xui/ru/menu_mute_particle.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<!-- *NOTE: See also menu_attachment_other.xml --> +<context_menu name="Mute Particle Pie"> + <menu_item_call label="Блокировать владельца учаÑтка" name="Mute Particle"/> +</context_menu> diff --git a/indra/newview/skins/default/xui/ru/menu_object.xml b/indra/newview/skins/default/xui/ru/menu_object.xml index 288df3beb9..056dab74c1 100755 --- a/indra/newview/skins/default/xui/ru/menu_object.xml +++ b/indra/newview/skins/default/xui/ru/menu_object.xml @@ -3,13 +3,13 @@ <menu_item_call label="КоÑнутьÑÑ" name="Object Touch"/> <menu_item_call label="Изменить" name="Edit..."/> <menu_item_call label="СтроительÑтво" name="Build"/> - <menu_item_call label="Показывать в наборах ÑвÑзей" name="show_in_linksets"/> - <menu_item_call label="Показывать в перÑонажах" name="show_in_characters"/> <menu_item_call label="Открыто" name="Open"/> <menu_item_call label="СеÑÑ‚ÑŒ здеÑÑŒ" name="Object Sit"/> <menu_item_call label="Ð’Ñтать" name="Object Stand Up"/> <menu_item_call label="Профиль объекта" name="Object Inspect"/> <menu_item_call label="Приблизить" name="Zoom In"/> + <menu_item_call label="Показывать в наборах ÑвÑзей" name="show_in_linksets"/> + <menu_item_call label="Показывать в перÑонажах" name="show_in_characters"/> <context_menu label="Ðадеть" name="Put On"> <menu_item_call label="Ðадеть" name="Wear"/> <menu_item_call label="Добавить" name="Add"/> @@ -26,4 +26,5 @@ <menu_item_call label="Заплатить" name="Pay..."/> <menu_item_call label="Купить" name="Buy..."/> <menu_item_call label="Удалить" name="Delete"/> + <menu_item_call label="Блокировать владельца учаÑтка" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/ru/menu_url_agent.xml b/indra/newview/skins/default/xui/ru/menu_url_agent.xml index 230d049fad..fcd1fe310d 100755 --- a/indra/newview/skins/default/xui/ru/menu_url_agent.xml +++ b/indra/newview/skins/default/xui/ru/menu_url_agent.xml @@ -3,6 +3,7 @@ <menu_item_call label="Смотреть профиль" name="show_agent"/> <menu_item_call label="Отправить Ñообщение..." name="send_im"/> <menu_item_call label="Добавить в друзьÑ..." name="add_friend"/> + <menu_item_call label="Удалить из друзей..." name="remove_friend"/> <menu_item_call label="Копировать название в буфер обмена" name="url_copy_label"/> <menu_item_call label="Копировать URL-Ð°Ð´Ñ€ÐµÑ SL в буфер обмена" name="url_copy"/> </context_menu> diff --git a/indra/newview/skins/default/xui/ru/menu_url_objectim.xml b/indra/newview/skins/default/xui/ru/menu_url_objectim.xml index 1326db708e..4f5361b2e3 100755 --- a/indra/newview/skins/default/xui/ru/menu_url_objectim.xml +++ b/indra/newview/skins/default/xui/ru/menu_url_objectim.xml @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <context_menu name="Url Popup"> <menu_item_call label="Профиль объекта..." name="show_object"/> + <menu_item_call label="Блокировать..." name="block_object"/> <menu_item_call label="Показать на карте" name="show_on_map"/> <menu_item_call label="Телепорт в меÑтоположение объекта" name="teleport_to_object"/> <menu_item_call label="Копировать название объекта в буфер обмена" name="url_copy_label"/> diff --git a/indra/newview/skins/default/xui/ru/menu_viewer.xml b/indra/newview/skins/default/xui/ru/menu_viewer.xml index 92a9943b93..fcb7c4e531 100755 --- a/indra/newview/skins/default/xui/ru/menu_viewer.xml +++ b/indra/newview/skins/default/xui/ru/menu_viewer.xml @@ -16,7 +16,10 @@ <menu_item_call label="ОÑтановить анимацию" name="Stop Animating My Avatar"/> <menu_item_call label="Ходьба / бег / полет..." name="Walk / run / fly"/> </menu> - <menu label="СтатуÑ" name="Status"/> + <menu label="СтатуÑ" name="Status"> + <menu_item_check label="Ðет на меÑте" name="Away"/> + <menu_item_check label="Ðе беÑпокоить" name="Do Not Disturb"/> + </menu> <menu_item_call label="Купить L$..." name="Buy and Sell L$"/> <menu_item_call label="Торговые иÑходÑщие..." name="MerchantOutbox"/> <menu_item_call label="Ð˜Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ð¾Ð½Ð½Ð°Ñ Ð¿Ð°Ð½ÐµÐ»ÑŒ аккаунта..." name="Manage My Account"/> @@ -30,6 +33,7 @@ <menu_item_check label="Разговоры..." name="Conversations"/> <menu_item_check label="Локальный чат..." name="Nearby Chat"/> <menu_item_check label="Говорить" name="Speak"/> + <menu_item_check label="Журнал разговора..." name="Conversation Log..."/> <menu label="Изменение голоÑа" name="VoiceMorphing"> <menu_item_check label="Без Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð³Ð¾Ð»Ð¾Ñа" name="NoVoiceMorphing"/> <menu_item_check label="ПроÑмотр..." name="Preview"/> @@ -40,6 +44,7 @@ <menu_item_check label="Группы" name="My Groups"/> <menu_item_check label="Люди неподалеку" name="Active Speakers"/> <menu_item_call label="Черный ÑпиÑок" name="Block List"/> + <menu_item_check label="Ðе беÑпокоить" name="Do Not Disturb"/> </menu> <menu label="Мир" name="World"> <menu_item_call label="Добавить закладку на Ñто меÑто" name="Create Landmark Here"/> @@ -108,13 +113,13 @@ <menu_item_call label="Включить Ñледующую" name="Include Next Part"/> <menu_item_call label="Включить предыдущую" name="Include Previous Part"/> </menu> + <menu_item_call label="Ðаборы ÑвÑзей..." name="pathfinding_linkset_menu_item"/> <menu_item_call label="Ð¤Ð¾ÐºÑƒÑ Ð½Ð° выбранном" name="Focus on Selection"/> <menu_item_call label="Приблизить к выбранному" name="Zoom to Selection"/> <menu label="Объект" name="Object"> <menu_item_call label="Купить" name="Menu Object Buy"/> <menu_item_call label="ВзÑÑ‚ÑŒ" name="Menu Object Take"/> <menu_item_call label="ВзÑÑ‚ÑŒ копию" name="Take Copy"/> - <menu_item_call label="Сохранить в моем инвентаре" name="Save Object Back to My Inventory"/> <menu_item_call label="Сохранить в контенте объектов" name="Save Object Back to Object Contents"/> <menu_item_call label="Вернуть объект" name="Return Object back to Owner"/> </menu> @@ -270,6 +275,7 @@ <menu_item_check label="Ð¡Ð»ÑƒÑ‡Ð°Ð¹Ð½Ð°Ñ Ñ‡Ð°Ñтота кадров" name="Randomize Framerate"/> <menu_item_check label="ПериодичеÑкое замедление кадров" name="Periodic Slow Frame"/> <menu_item_check label="ТеÑÑ‚ кадров" name="Frame Test"/> + <menu_item_call label="Профиль кадра" name="Frame Profile"/> </menu> <menu label="Визуализировать метаданные" name="Render Metadata"> <menu_item_check label="Рамки" name="Bounding Boxes"/> @@ -304,9 +310,10 @@ <menu_item_check label="ОÑи" name="Axes"/> <menu_item_check label="КаÑательный базиÑ" name="Tangent Basis"/> <menu_item_call label="Ð’Ñ‹Ð±Ñ€Ð°Ð½Ð½Ð°Ñ Ñ‚ÐµÐºÑтура в оÑнове" name="Selected Texture Info Basis"/> + <menu_item_call label="Ð¡Ð²ÐµÐ´ÐµÐ½Ð¸Ñ Ð¾ выбранном материале" name="Selected Material Info"/> <menu_item_check label="КаркаÑ" name="Wireframe"/> <menu_item_check label="Смыкание объектов" name="Object-Object Occlusion"/> - <menu_item_check label="ОÑвещение и тени" name="Advanced Lighting Model"/> + <menu_item_check label="РаÑÑˆÐ¸Ñ€ÐµÐ½Ð½Ð°Ñ Ð¼Ð¾Ð´ÐµÐ»ÑŒ оÑвещениÑ" name="Advanced Lighting Model"/> <menu_item_check label="Тени от Ñолнца, луны и прожекторов" name="Shadows from Sun/Moon/Projectors"/> <menu_item_check label="SSAO и Ñглаживание теней" name="SSAO and Shadow Smoothing"/> <menu_item_check label="Отладка GL" name="Debug GL"/> @@ -316,7 +323,6 @@ <menu_item_check label="ТекÑтуры анимаций" name="Animation Textures"/> <menu_item_check label="Отключить текÑтуры" name="Disable Textures"/> <menu_item_check label="ТекÑтуры в полном разрешении" name="Rull Res Textures"/> - <menu_item_check label="ÐÑ‚Ð»Ð°Ñ Ñ‚ÐµÐºÑтур (ÑкÑÐ¿ÐµÑ€Ð¸Ð¼ÐµÐ½Ñ‚Ð°Ð»ÑŒÐ½Ð°Ñ Ñ„ÑƒÐ½ÐºÑ†Ð¸Ñ)" name="Texture Atlas"/> <menu_item_check label="Ð’Ð¸Ð·ÑƒÐ°Ð»Ð¸Ð·Ð°Ñ†Ð¸Ñ Ð¿Ñ€Ð¸Ñоединенных иÑточников Ñвета" name="Render Attached Lights"/> <menu_item_check label="Ð’Ð¸Ð·ÑƒÐ°Ð»Ð¸Ð·Ð°Ñ†Ð¸Ñ Ð¿Ñ€Ð¸Ñоединенных чаÑтиц" name="Render Attached Particles"/> <menu_item_check label="ПарÑщие ÑветÑщиеÑÑ Ð¾Ð±ÑŠÐµÐºÑ‚Ñ‹" name="Hover Glow Objects"/> @@ -352,7 +358,6 @@ <menu_item_call label="Вывод ÑредÑтва фокуÑировки" name="Dump Focus Holder"/> <menu_item_call label="Печать информации о выбранных объектах" name="Print Selected Object Info"/> <menu_item_call label="Печать информации об агенте" name="Print Agent Info"/> - <menu_item_call label="СтатиÑтичеÑÐºÐ°Ñ Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð¾ памÑти" name="Memory Stats"/> <menu_item_check label="КонÑоль отладки региона" name="Region Debug Console"/> <menu_item_check label="Отладка SelectMgr" name="Debug SelectMgr"/> <menu_item_check label="Отладка щелчков мышью" name="Debug Clicks"/> @@ -386,7 +391,6 @@ </menu> <menu_item_call label="Скинуть параметры" name="Force Params to Default"/> <menu_item_check label="Данные об анимации" name="Animation Info"/> - <menu_item_check label="ÐÐ½Ð¸Ð¼Ð°Ñ†Ð¸Ñ Ð¼ÐµÐ´Ð»ÐµÐ½Ð½Ñ‹Ñ… движений" name="Slow Motion Animations"/> <menu_item_check label="Показать взглÑд" name="Show Look At"/> <menu_item_check label="Показать указание" name="Show Point At"/> <menu_item_check label="Отладка обновленных движений ÑуÑтавов" name="Debug Joint Updates"/> diff --git a/indra/newview/skins/default/xui/ru/notifications.xml b/indra/newview/skins/default/xui/ru/notifications.xml index 00ab0b5763..1dc8202b00 100755 --- a/indra/newview/skins/default/xui/ru/notifications.xml +++ b/indra/newview/skins/default/xui/ru/notifications.xml @@ -210,6 +210,14 @@ Добавить Ñту ÑпоÑобноÑÑ‚ÑŒ к роли «[ROLE_NAME]»? <usetemplate name="okcancelbuttons" notext="Ðет" yestext="Да"/> </notification> + <notification name="EjectGroupMemberWarning"> + Ð’Ñ‹ ÑобираетеÑÑŒ иÑключить [AVATAR_NAME] из группы. + <usetemplate ignoretext="Подтвердите иÑключение учаÑтника из группы" name="okcancelignore" notext="Отмена" yestext="Выкинуть"/> + </notification> + <notification name="EjectGroupMembersWarning"> + Ð’Ñ‹ ÑобираетеÑÑŒ иÑключить [COUNT] учаÑтников из группы. + <usetemplate ignoretext="Подтвердите иÑключение учаÑтников из группы" name="okcancelignore" notext="Отмена" yestext="Выкинуть"/> + </notification> <notification name="AttachmentDrop"> Ð’Ñ‹ ÑобираетеÑÑŒ ÑброÑить Ñвое приÑоединение. Продолжить? @@ -1111,7 +1119,7 @@ Введите более выÑокую цену. </notification> <notification name="ConfirmItemDeleteHasLinks"> - ИмеетÑÑ ÑÑылка, ÑƒÐºÐ°Ð·Ñ‹Ð²Ð°ÑŽÑ‰Ð°Ñ ÐºÐ°Ðº минимум на один из выбранных вами предметов. ЕÑли удалить Ñтот предмет, его ÑÑылки переÑтанут работать. ÐаÑтоÑтельно рекомендуетÑÑ Ñначала удалить ÑÑылки. + По крайней мере у одного предмета еÑÑ‚ÑŒ ÑÑылки, указывающие на него. ЕÑли удалить Ñтот предмет, его ÑÑылки переÑтанут работать. ÐаÑтоÑтельно рекомендуетÑÑ Ñначала удалить ÑÑылки. ДейÑтвительно удалить Ñти предметы? <usetemplate name="okcancelbuttons" notext="Отмена" yestext="OK"/> @@ -1161,7 +1169,7 @@ Ð’Ñ‹ не владеете по крайней мере одним объектом. ДейÑтвительно удалить Ñти предметы? - <usetemplate name="okcancelbuttons" notext="отмена" yestext="OK"/> + <usetemplate name="okcancelbuttons" notext="Отмена" yestext="OK"/> </notification> <notification name="ConfirmObjectTakeLock"> Как минимум один объект фикÑирован. @@ -1480,13 +1488,43 @@ http://secondlife.com/download. </notification> <notification name="RequiredUpdateDownloadedVerboseDialog"> Загружено обÑзательное обновление. -ВерÑÐ¸Ñ [VERSION] +ВерÑÐ¸Ñ [VERSION]. [[INFO_URL] Ð¡Ð²ÐµÐ´ÐµÐ½Ð¸Ñ Ð¾Ð± Ñтом обновлении] Ðеобходимо перезапуÑтить [APP_NAME] Ð´Ð»Ñ ÑƒÑтановки обновлениÑ. <usetemplate name="okbutton" yestext="OK"/> </notification> <notification name="RequiredUpdateDownloadedDialog"> Ðеобходимо перезапуÑтить [APP_NAME] Ð´Ð»Ñ ÑƒÑтановки обновлениÑ. +[[INFO_URL] Ð¡Ð²ÐµÐ´ÐµÐ½Ð¸Ñ Ð¾Ð± Ñтом обновлении] + <usetemplate name="okbutton" yestext="OK"/> + </notification> + <notification name="OtherChannelDownloadBackgroundTip"> + Загружено обновление Ð´Ð»Ñ Ð²Ð°ÑˆÐµÐ¹ верÑии [APP_NAME]. +ВерÑÐ¸Ñ [VERSION] +Ðа замену Ñтой ÑкÑпериментальной верÑии клиента предлагаетÑÑ ÐºÐ»Ð¸ÐµÐ½Ñ‚ [NEW_CHANNEL]; +Ñм. [[INFO_URL] об Ñтом обновлении] + <usetemplate name="okcancelbuttons" notext="Позже..." yestext="УÑтановите обновление и перезапуÑтите [APP_NAME]"/> + </notification> + <notification name="OtherChannelDownloadBackgroundDialog"> + Загружено обновление Ð´Ð»Ñ Ð²Ð°ÑˆÐµÐ¹ верÑии [APP_NAME]. +ВерÑÐ¸Ñ [VERSION] +Ðа замену Ñтой ÑкÑпериментальной верÑии клиента предлагаетÑÑ ÐºÐ»Ð¸ÐµÐ½Ñ‚ [NEW_CHANNEL]; +Ñм. [[INFO_URL] Ð¡Ð²ÐµÐ´ÐµÐ½Ð¸Ñ Ð¾Ð± Ñтом обновлении] + <usetemplate name="okcancelbuttons" notext="Позже..." yestext="УÑтановите обновление и перезапуÑтите [APP_NAME]"/> + </notification> + <notification name="OtherChannelRequiredUpdateDownloadedVerboseDialog"> + Загружено обÑзательное обновление. +ВерÑÐ¸Ñ [VERSION] +Ðа замену Ñтой ÑкÑпериментальной верÑии клиента предлагаетÑÑ ÐºÐ»Ð¸ÐµÐ½Ñ‚ [NEW_CHANNEL]; +Ñм. [[INFO_URL] Ð¡Ð²ÐµÐ´ÐµÐ½Ð¸Ñ Ð¾Ð± Ñтом обновлении] + +Ðеобходимо перезапуÑтить [APP_NAME] Ð´Ð»Ñ ÑƒÑтановки обновлениÑ. + <usetemplate name="okbutton" yestext="OK"/> + </notification> + <notification name="OtherChannelRequiredUpdateDownloadedDialog"> + Ðеобходимо перезапуÑтить [APP_NAME] Ð´Ð»Ñ ÑƒÑтановки обновлениÑ. +Ðа замену Ñтой ÑкÑпериментальной верÑии клиента предлагаетÑÑ ÐºÐ»Ð¸ÐµÐ½Ñ‚ [NEW_CHANNEL]; +Ñм. [[INFO_URL] Ð¡Ð²ÐµÐ´ÐµÐ½Ð¸Ñ Ð¾Ð± Ñтом обновлении] <usetemplate name="okbutton" yestext="OK"/> </notification> <notification name="DeedObjectToGroup"> @@ -1537,6 +1575,10 @@ http://secondlife.com/download. Хотите покинуть группу? <usetemplate name="okcancelbuttons" notext="Отмена" yestext="OK"/> </notification> + <notification name="OwnerCannotLeaveGroup"> + Ðевозможно покинуть группу. Ð’Ñ‹ не можете покинуть группу, так как вы ее поÑледний владелец. Сначала назначьте владельцем другого учаÑтника. + <usetemplate name="okbutton" yestext="OK"/> + </notification> <notification name="ConfirmKick"> Ð’Ñ‹ ДЕЙСТВИТЕЛЬÐО хотите выброÑить вÑех жителей Ñ Ñетки? <usetemplate name="okcancelbuttons" notext="Отмена" yestext="ВыброÑить вÑех жителей"/> @@ -2396,9 +2438,7 @@ http://secondlife.com/download. выбрать команду «ТелепортациÑ».) </notification> <notification name="TeleportToPerson"> - Чтобы обратитьÑÑ Ðº жителю, например «[NAME]», нажмите кнопку «Люди», выберите Ð¶Ð¸Ñ‚ÐµÐ»Ñ Ð² поÑвившемÑÑ Ð¾ÐºÐ½Ðµ и нажмите кнопку - «IM» внизу окна. - (Также можно дважды щелкнуть Ð¸Ð¼Ñ Ð¶Ð¸Ñ‚ÐµÐ»Ñ Ð² ÑпиÑке или щелкнуть его правой кнопкой мыши и выбрать команду «IM».) + Чтобы начать личный разговор, щелкните аватар ÑобеÑедника правой кнопкой мыши и выберите в меню «IM». </notification> <notification name="CantSelectLandFromMultipleRegions"> ÐÐµÐ»ÑŒÐ·Ñ Ð²Ñ‹Ð±Ñ€Ð°Ñ‚ÑŒ землю Ñ Ð¾Ð±ÐµÐ¸Ñ… Ñторон границы между Ñерверами. @@ -2772,6 +2812,15 @@ http://secondlife.com/download. <button name="Deny" text="Отклонить"/> </form> </notification> + <notification name="UnknownScriptQuestion"> + Объект <nolink>[OBJECTNAME]</nolink>» владельца «[NAME]» требует Ñ€Ð°Ð·Ñ€ÐµÑˆÐµÐ½Ð¸Ñ Ð½Ð° выполнение Ñкрипта; разрешение не раÑпознаетÑÑ ÐºÐ»Ð¸ÐµÐ½Ñ‚Ð¾Ð¼ и не будет предоÑтавлено + +Ð”Ð»Ñ Ð¿Ð¾Ð»ÑƒÑ‡ÐµÐ½Ð¸Ñ Ñтого Ñ€Ð°Ð·Ñ€ÐµÑˆÐµÐ½Ð¸Ñ ÑƒÑтановите поÑледнюю верÑию клиента из [DOWNLOADURL]. + <form name="form"> + <button name="Deny" text="OK"/> + <button name="Mute" text="Заблокировать"/> + </form> + </notification> <notification name="ScriptDialog"> [NAME] – «<nolink>[TITLE]</nolink>» [MESSAGE] diff --git a/indra/newview/skins/default/xui/ru/panel_people.xml b/indra/newview/skins/default/xui/ru/panel_people.xml index 7da7fb3191..9606f0aec1 100755 --- a/indra/newview/skins/default/xui/ru/panel_people.xml +++ b/indra/newview/skins/default/xui/ru/panel_people.xml @@ -49,6 +49,9 @@ <menu_button name="plus_btn" tool_tip="ПриÑоединитьÑÑ Ðº группе/Ñоздать новую группу"/> <dnd_button name="minus_btn" tool_tip="Покинуть выбранную группу"/> </panel> + <text name="groupcount"> + Ð’Ñ‹ входите в [COUNT] групп и можете приÑоединитьÑÑ ÐµÑ‰Ðµ к [REMAINING]. + </text> </panel> <panel label="ÐЕДÐÐ’ÐИЕ" name="recent_panel"> <panel label="bottom_panel" name="recent_buttons_panel"> diff --git a/indra/newview/skins/default/xui/ru/panel_preferences_chat.xml b/indra/newview/skins/default/xui/ru/panel_preferences_chat.xml index 6383fc8c2c..914426c91e 100755 --- a/indra/newview/skins/default/xui/ru/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/ru/panel_preferences_chat.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <panel label="ТекÑтовый чат" name="chat"> - <panel> - <check_box initial_value="иÑтина" label="ВоÑпроизводить анимацию ввода текÑта при общении" name="play_typing_animation"/> + <panel name="general_chat_settings"> + <check_box initial_value="true" label="ВоÑпроизводить анимацию ввода текÑта при общении" name="play_typing_animation"/> <check_box label="ОтправлÑÑ‚ÑŒ мне ÑÐ¾Ð¾Ð±Ñ‰ÐµÐ½Ð¸Ñ Ð¿Ð¾ почте, когда Ð¼ÐµÐ½Ñ Ð½ÐµÑ‚ в Ñети" name="send_im_to_email"/> <check_box label="Только Ð´Ñ€ÑƒÐ·ÑŒÑ Ð¸ группы могут звонить мне и отправлÑÑ‚ÑŒ IM" name="voice_call_friends_only_check"/> <text name="font_size"> @@ -14,10 +14,7 @@ </combo_box> <check_box label="Чат в пузырьках" name="bubble_text_chat"/> </panel> - <panel> - <text name="notifications"> - Ð£Ð²ÐµÐ´Ð¾Ð¼Ð»ÐµÐ½Ð¸Ñ - </text> + <panel name="im_notification_settings"> <text name="friend_ims"> IM друзей: </text> @@ -25,8 +22,9 @@ <item label="Открыть окно разговоров" name="OpenConversationsWindow" value="openconversations"/> <item label="Сообщение во вÑплывающем окне" name="PopUpMessage" value="вÑплывание"/> <item label="Мигание кнопки на панели инÑтрументов" name="FlashToolbarButton" value="мигание"/> - <item label="Ðет" name="None" value="нет"/> + <item label="Без дейÑтвиÑ" name="NoAction" value="noaction"/> </combo_box> + <check_box label="Звук" name="play_sound_friend_im"/> <text name="non_friend_ims"> IM чужих: </text> @@ -34,8 +32,9 @@ <item label="Открыть окно разговоров" name="OpenConversationsWindow" value="openconversations"/> <item label="Сообщение во вÑплывающем окне" name="PopUpMessage" value="вÑплывание"/> <item label="Мигание кнопки на панели инÑтрументов" name="FlashToolbarButton" value="мигание"/> - <item label="Ðет" name="None" value="нет"/> + <item label="Без дейÑтвиÑ" name="NoAction" value="noaction"/> </combo_box> + <check_box label="Звук" name="play_sound_non_friend_im"/> <text name="conference_ims"> IM конференции: </text> @@ -43,8 +42,9 @@ <item label="Открыть окно разговоров" name="OpenConversationsWindow" value="openconversations"/> <item label="Сообщение во вÑплывающем окне" name="PopUpMessage" value="вÑплывание"/> <item label="Мигание кнопки на панели инÑтрументов" name="FlashToolbarButton" value="мигание"/> - <item label="Ðет" name="None" value="нет"/> + <item label="Без дейÑтвиÑ" name="NoAction" value="noaction"/> </combo_box> + <check_box label="Звук" name="play_sound_conference_im"/> <text name="group_chat"> Групповой чат: </text> @@ -52,8 +52,9 @@ <item label="Открыть окно разговоров" name="OpenConversationsWindow" value="openconversations"/> <item label="Сообщение во вÑплывающем окне" name="PopUpMessage" value="вÑплывание"/> <item label="Мигание кнопки на панели инÑтрументов" name="FlashToolbarButton" value="мигание"/> - <item label="Ðет" name="None" value="нет"/> + <item label="Без дейÑтвиÑ" name="NoAction" value="noaction"/> </combo_box> + <check_box label="Звук" name="play_sound_group_chat_im"/> <text name="nearby_chat"> Локальный чат: </text> @@ -61,13 +62,24 @@ <item label="Открыть окно разговоров" name="OpenConversationsWindow" value="openconversations"/> <item label="Сообщение во вÑплывающем окне" name="PopUpMessage" value="вÑплывание"/> <item label="Мигание кнопки на панели инÑтрументов" name="FlashToolBarButton" value="мигание"/> - <item label="Ðет" name="None" value="нет"/> + <item label="Без дейÑтвиÑ" name="NoAction" value="noaction"/> + </combo_box> + <check_box label="Звук" name="play_sound_nearby_chat_im"/> + <text name="object_ims"> + IM объектов: + </text> + <combo_box name="ObjectIMOptions"> + <item label="Открыть окно разговоров" name="OpenConversationsWindow" value="openconversations"/> + <item label="Сообщение во вÑплывающем окне" name="PopUpMessage" value="вÑплывание"/> + <item label="Мигание кнопки на панели инÑтрументов" name="FlashToolBarButton" value="мигание"/> + <item label="Без дейÑтвиÑ" name="NoAction" value="noaction"/> </combo_box> + <check_box label="Звук" name="play_sound_object_im"/> <text name="notifications_alert"> Ð”Ð»Ñ Ð²Ñ€ÐµÐ¼ÐµÐ½Ð½Ð¾Ð³Ð¾ Ð¾Ñ‚ÐºÐ»ÑŽÑ‡ÐµÐ½Ð¸Ñ Ð²Ñех уведомлений вызовите меню «Общение > Ðе беÑпокоить». </text> </panel> - <panel> + <panel name="play_sound_settings"> <text name="play_sound"> Звук: </text> @@ -76,7 +88,7 @@ <check_box label="Предложение телепортации" name="teleport_offer"/> <check_box label="Предложение инвентарÑ" name="inventory_offer"/> </panel> - <panel> + <panel name="log_settings"> <button label="ОчиÑтить журнал..." name="clear_log"/> <button label="Удалить запиÑи..." name="delete_transcripts"/> <button label="Обзор..." label_selected="Обзор" name="log_path_button"/> diff --git a/indra/newview/skins/default/xui/ru/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/ru/panel_preferences_graphics1.xml index a7e826f5fc..029e72e137 100755 --- a/indra/newview/skins/default/xui/ru/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/ru/panel_preferences_graphics1.xml @@ -30,7 +30,7 @@ <check_box initial_value="иÑтина" label="Локальный Ñвет" name="LocalLights"/> <check_box initial_value="иÑтина" label="Базовые шейдеры" name="BasicShaders" tool_tip="Отключение Ñтого параметра может предотвратить завиÑание некоторых видеокарт"/> <check_box initial_value="иÑтина" label="ÐтмоÑферные шейдеры" name="WindLightUseAtmosShaders"/> - <check_box initial_value="иÑтина" label="ОÑвещение и тени" name="UseLightShaders"/> + <check_box initial_value="иÑтина" label="РаÑÑˆÐ¸Ñ€ÐµÐ½Ð½Ð°Ñ Ð¼Ð¾Ð´ÐµÐ»ÑŒ оÑвещениÑ" name="UseLightShaders"/> <check_box initial_value="иÑтина" label="Объемный Ñвет" name="UseSSAO"/> <check_box initial_value="иÑтина" label="Глубина полÑ" name="UseDoF"/> <text name="shadows_label"> diff --git a/indra/newview/skins/default/xui/ru/panel_preferences_setup.xml b/indra/newview/skins/default/xui/ru/panel_preferences_setup.xml index 8e7fc71f0d..e9c0c7de10 100755 --- a/indra/newview/skins/default/xui/ru/panel_preferences_setup.xml +++ b/indra/newview/skins/default/xui/ru/panel_preferences_setup.xml @@ -29,6 +29,7 @@ <combo_box.item label="УÑтанавливать автоматичеÑки" name="Install_automatically"/> <combo_box.item label="Загружать и уÑтанавливать Ð¾Ð±Ð½Ð¾Ð²Ð»ÐµÐ½Ð¸Ñ Ð²Ñ€ÑƒÑ‡Ð½ÑƒÑŽ" name="Install_manual"/> </combo_box> + <check_box label="УÑтанавливать бета-верÑии" name="update_willing_to_test"/> <text name="Proxy Settings:"> ÐаÑтройки прокÑи-Ñервера: </text> diff --git a/indra/newview/skins/default/xui/ru/panel_script_ed.xml b/indra/newview/skins/default/xui/ru/panel_script_ed.xml index 05ccaeb54b..a9e5d9ef10 100755 --- a/indra/newview/skins/default/xui/ru/panel_script_ed.xml +++ b/indra/newview/skins/default/xui/ru/panel_script_ed.xml @@ -34,6 +34,7 @@ <menu_item_call label="Выделить вÑе" name="Select All"/> <menu_item_call label="СнÑÑ‚ÑŒ выделение" name="Deselect"/> <menu_item_call label="ПоиÑк и замена..." name="Search / Replace..."/> + <menu_item_call label="Перейти на Ñтроку..." name="Go to line..."/> </menu> <menu label="Справка" name="Help"> <menu_item_call label="Справка..." name="Help..."/> diff --git a/indra/newview/skins/default/xui/ru/panel_tools_texture.xml b/indra/newview/skins/default/xui/ru/panel_tools_texture.xml new file mode 100644 index 0000000000..60717a3d1d --- /dev/null +++ b/indra/newview/skins/default/xui/ru/panel_tools_texture.xml @@ -0,0 +1,116 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<panel label="ТекÑтура" name="Texture"> + <panel.string name="string repeats per meter"> + Повторений на метр + </panel.string> + <panel.string name="string repeats per face"> + Повторений на грань + </panel.string> + <text name="color label"> + Цвет + </text> + <color_swatch label="" name="colorswatch" tool_tip="Щелкните Ð´Ð»Ñ Ð²Ñ‹Ð±Ð¾Ñ€Ð° цвета"/> + <text name="color trans"> + ПрозрачноÑÑ‚ÑŒ % + </text> + <text name="glow label"> + Свечение + </text> + <check_box label="СобÑÑ‚Ð²ÐµÐ½Ð½Ð°Ñ ÑркоÑÑ‚ÑŒ" name="checkbox fullbright"/> + <combo_box name="combobox matmedia"> + <combo_box.item label="Материалы" name="Materials"/> + <combo_box.item label="Медиа" name="Media"/> + </combo_box> + <combo_box name="combobox mattype"> + <combo_box.item label="ТекÑтура (раÑÑеÑннаÑ)" name="Texture (diffuse)"/> + <combo_box.item label="ШероховатоÑÑ‚ÑŒ (обычнаÑ)" name="Bumpiness (normal)"/> + <combo_box.item label="БлеÑк (зеркальный)" name="Shininess (specular)"/> + </combo_box> + <texture_picker label="ТекÑтура" name="texture control" tool_tip="Щелкните Ð´Ð»Ñ Ð²Ñ‹Ð±Ð¾Ñ€Ð° изображениÑ"/> + <text name="label alphamode"> + Ðльфа-режим + </text> + <combo_box name="combobox alphamode"> + <combo_box.item label="Ðет" name="None"/> + <combo_box.item label="Ðльфа-Ñмешивание" name="Alpha blending"/> + <combo_box.item label="Ðльфа-маÑкирование" name="Alpha masking"/> + <combo_box.item label="Ð˜Ð·Ð»ÑƒÑ‡Ð°ÑŽÑ‰Ð°Ñ Ð¼Ð°Ñка" name="Emissive mask"/> + </combo_box> + <text name="label maskcutoff"> + ОтÑечка маÑки + </text> + <texture_picker label="ТекÑтура" name="bumpytexture control" tool_tip="Щелкните Ð´Ð»Ñ Ð²Ñ‹Ð±Ð¾Ñ€Ð° изображениÑ"/> + <text name="label bumpiness"> + РельефноÑÑ‚ÑŒ + </text> + <combo_box name="combobox bumpiness"> + <combo_box.item label="Ðет" name="None"/> + <combo_box.item label="ЯркоÑÑ‚ÑŒ" name="Brightness"/> + <combo_box.item label="По темному" name="Darkness"/> + <combo_box.item label="дерево" name="woodgrain"/> + <combo_box.item label="кора" name="bark"/> + <combo_box.item label="кирпич" name="bricks"/> + <combo_box.item label="ÑˆÐ°Ñ…Ð¼Ð°Ñ‚Ð½Ð°Ñ Ð´Ð¾Ñка" name="checker"/> + <combo_box.item label="бетон" name="concrete"/> + <combo_box.item label="ÑÑ‚Ð°Ñ€Ð°Ñ Ð¿Ð»Ð¸Ñ‚ÐºÐ°" name="crustytile"/> + <combo_box.item label="теÑаный камень" name="cutstone"/> + <combo_box.item label="диÑки" name="discs"/> + <combo_box.item label="гравий" name="gravel"/> + <combo_box.item label="чашка Петри" name="petridish"/> + <combo_box.item label="Ñайдинг" name="siding"/> + <combo_box.item label="ÐºÐ°Ð¼ÐµÐ½Ð½Ð°Ñ Ð¿Ð»Ð¸Ñ‚ÐºÐ°" name="stonetile"/> + <combo_box.item label="штукатурка" name="stucco"/> + <combo_box.item label="приÑоÑка" name="suction"/> + <combo_box.item label="переплетение" name="weave"/> + </combo_box> + <texture_picker label="ТекÑтура" name="shinytexture control" tool_tip="Щелкните Ð´Ð»Ñ Ð²Ñ‹Ð±Ð¾Ñ€Ð° изображениÑ"/> + <text name="label shininess"> + БлеÑк + </text> + <combo_box name="combobox shininess"> + <combo_box.item label="Ðет" name="None"/> + <combo_box.item label="Ðизкий" name="Low"/> + <combo_box.item label="Средний" name="Medium"/> + <combo_box.item label="Ð’Ñ‹Ñокий" name="High"/> + </combo_box> + <text name="label glossiness"> + ГлÑнец + </text> + <text name="label environment"> + Среда + </text> + <text name="label shinycolor"> + Цвет + </text> + <color_swatch label="" name="shinycolorswatch" tool_tip="Щелкните Ð´Ð»Ñ Ð²Ñ‹Ð±Ð¾Ñ€Ð° цвета"/> + <text name="media_info"> + URL выбранного медиа (еÑли еÑÑ‚ÑŒ) + </text> + <button label="Выбрать..." name="add_media" tool_tip="Добавить медиа"/> + <button label="Удалить" name="delete_media" tool_tip="Удалить медиа-текÑтуру"/> + <button label="ВыровнÑÑ‚ÑŒ" label_selected="ВыровнÑÑ‚ÑŒ медиа" name="button align" tool_tip="МаÑштабирование медиа-текÑтуры (Ñначала нужно загрузить)"/> + <text name="tex gen"> + Ðаложение + </text> + <combo_box name="combobox texgen"> + <combo_box.item label="По умолчанию" name="Default"/> + <combo_box.item label="Ðа плоÑкоÑÑ‚ÑŒ" name="Planar"/> + </combo_box> + <spinner label="МаÑштаб по горизонтали" name="TexScaleU"/> + <spinner label="МаÑштаб по вертикали" name="TexScaleV"/> + <spinner label="Повторений на метр" name="rptctrl"/> + <spinner label="Поворот, градуÑÑ‹" name="TexRot"/> + <spinner label="Смещение по горизонтали" name="TexOffsetU"/> + <spinner label="Смещение по вертикали" name="TexOffsetV"/> + <spinner label="МаÑштаб по горизонтали" name="bumpyScaleU"/> + <spinner label="МаÑштаб по вертикали" name="bumpyScaleV"/> + <spinner label="Поворот, градуÑÑ‹" name="bumpyRot"/> + <spinner label="Смещение по горизонтали" name="bumpyOffsetU"/> + <spinner label="Смещение по вертикали" name="bumpyOffsetV"/> + <spinner label="МаÑштаб по горизонтали" name="shinyScaleU"/> + <spinner label="МаÑштаб по вертикали" name="shinyScaleV"/> + <spinner label="Поворот, градуÑÑ‹" name="shinyRot"/> + <spinner label="Смещение по горизонтали" name="shinyOffsetU"/> + <spinner label="Смещение по вертикали" name="shinyOffsetV"/> + <check_box initial_value="ложь" label="СоглаÑование" name="checkbox planar align" tool_tip="СоглаÑование текÑтур на вÑех выбранных гранÑÑ… по поÑледней выбранной грани. Должно быть выбрано наложение по плоÑкоÑÑ‚Ñм."/> +</panel> diff --git a/indra/newview/skins/default/xui/ru/role_actions.xml b/indra/newview/skins/default/xui/ru/role_actions.xml index b6ba818abd..3f31ecfa10 100755 --- a/indra/newview/skins/default/xui/ru/role_actions.xml +++ b/indra/newview/skins/default/xui/ru/role_actions.xml @@ -25,7 +25,7 @@ </action_set> <action_set description="К Ñтим ÑпоÑобноÑÑ‚Ñм отноÑитÑÑ Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ðµ Ð½Ð°Ð·Ð²Ð°Ð½Ð¸Ñ ÑƒÑ‡Ð°Ñтка и Ð¿ÑƒÐ±Ð»Ð¸ÐºÐ°Ñ†Ð¸Ñ Ð½Ð°Ñтроек, поиÑк видимых каталогов, а также наÑтройки точек и вариантов телепортации." name="Parcel Identity"> <action description="Включение-отключение показа меÑта в результатах поиÑка и наÑтройка категории" longdescription="Включить-отключить показ меÑта в результатах поиÑка и наÑтроить категорию учаÑтка можно в окне «О земле» на вкладке «Параметры»." name="land find places" value="17"/> - <action description="Изменение Ð½Ð°Ð·Ð²Ð°Ð½Ð¸Ñ Ð¸Ð»Ð¸ опиÑÐ°Ð½Ð¸Ñ ÑƒÑ‡Ð°Ñтка, наÑтройки «Показать меÑто в поиÑке»" longdescription="Изменение Ð½Ð°Ð·Ð²Ð°Ð½Ð¸Ñ Ð¸Ð»Ð¸ опиÑÐ°Ð½Ð¸Ñ ÑƒÑ‡Ð°Ñтка, наÑтройки «Показать меÑто в поиÑке». Ðто можно выполнить в окне «О земле» на вкладке «Параметры»." name="land change identity" value="18"/> + <action description="Изменение Ð½Ð°Ð·Ð²Ð°Ð½Ð¸Ñ Ð¸Ð»Ð¸ опиÑÐ°Ð½Ð¸Ñ ÑƒÑ‡Ð°Ñтка, наÑтройки «Умеренный контент»" longdescription="Изменение Ð½Ð°Ð·Ð²Ð°Ð½Ð¸Ñ Ð¸Ð»Ð¸ опиÑÐ°Ð½Ð¸Ñ ÑƒÑ‡Ð°Ñтка, наÑтройки «Умеренный контент». Ðто можно выполнить в окне «О земле» на вкладке «Параметры»." name="land change identity" value="18"/> <action description="УÑтановка конечной точки и варианта телепортации" longdescription="УчаÑтники роли Ñ Ñтой ÑпоÑобноÑтью могут уÑтановить конечную точку телепортации на учаÑтке группы, а также задать вариант телепортации Ð´Ð»Ñ ÑƒÑÐ¸Ð»ÐµÐ½Ð¸Ñ ÐºÐ¾Ð½Ñ‚Ñ€Ð¾Ð»Ñ. Ðто можно выполнить в окне «О земле» на вкладке «Параметры»." name="land set landing point" value="19"/> </action_set> <action_set description="К Ñтим ÑпоÑобноÑÑ‚Ñм отноÑитÑÑ Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ðµ наÑтроек учаÑтка, в Ñ‚. ч. «Создать объекты», «Изменить ландшафт», а также наÑтройки музыки и медиа." name="Parcel Settings"> diff --git a/indra/newview/skins/default/xui/ru/strings.xml b/indra/newview/skins/default/xui/ru/strings.xml index d7d4df4a37..49ce33ec96 100755 --- a/indra/newview/skins/default/xui/ru/strings.xml +++ b/indra/newview/skins/default/xui/ru/strings.xml @@ -139,6 +139,9 @@ <string name="create_account_url"> http://join.secondlife.com/?sourceid=[sourceid] </string> + <string name="ViewerDownloadURL"> + http://secondlife.com/download + </string> <string name="LoginFailedViewerNotPermitted"> У клиента, которым вы пользуетеÑÑŒ, больше нет доÑтупа к игре Second Life. Загрузить новую верÑию клиента можно по адреÑу http://secondlife.com/download @@ -448,6 +451,9 @@ support@secondlife.com. <string name="SLappAgentRequestFriend"> Предложить дружбу </string> + <string name="SLappAgentRemoveFriend"> + Удаление друга + </string> <string name="BUTTON_CLOSE_DARWIN"> Закрыть (⌘W) </string> @@ -835,6 +841,9 @@ support@secondlife.com. <string name="multiple_textures"> ÐеÑколько </string> + <string name="use_texture"> + ИÑпользовать текÑтуру + </string> <string name="texture_loading"> Загрузка... </string> @@ -934,6 +943,21 @@ support@secondlife.com. <string name="TeleportYourAgent"> Телепортировать Ð²Ð°Ñ </string> + <string name="JoinAnExperience"> + ПриÑоединитеÑÑŒ + </string> + <string name="SilentlyManageEstateAccess"> + Отключить Ð¸Ð·Ð²ÐµÑ‰ÐµÐ½Ð¸Ñ Ð¿Ñ€Ð¸ управлении ÑпиÑками доÑтупа к землевладениÑм + </string> + <string name="OverrideYourAnimations"> + Заменить ваши Ñтандартные анимации + </string> + <string name="ScriptReturnObjects"> + Вернуть объекты от вашего имени + </string> + <string name="UnknownScriptPermission"> + (неизвеÑтно)! + </string> <string name="SIM_ACCESS_PG"> Общий </string> @@ -1965,6 +1989,12 @@ support@secondlife.com. <string name="ATTACH_HUD_BOTTOM_RIGHT"> Данные в игре внизу Ñправа </string> + <string name="ATTACH_NECK"> + Ð¨ÐµÑ + </string> + <string name="ATTACH_AVATAR_CENTER"> + Центр аватара + </string> <string name="CursorPos"> Строка [LINE], Ñтолбец [COLUMN] </string> @@ -2991,6 +3021,9 @@ support@secondlife.com. <string name="Hip Width"> Ширина бедер </string> + <string name="Hover"> + Ðаведите + </string> <string name="In"> Внутрь </string> @@ -5087,4 +5120,7 @@ support@secondlife.com. <string name="logging_calls_enabled_log_empty"> Ðет зарегиÑтрированных разговоров. ЕÑли вы обратитеÑÑŒ к кому-то или наоборот, в журнале поÑвитÑÑ Ð½Ð¾Ð²Ð°Ñ Ð·Ð°Ð¿Ð¸ÑÑŒ. </string> + <string name="loading_chat_logs"> + Загрузка... + </string> </strings> diff --git a/indra/newview/skins/default/xui/tr/floater_about.xml b/indra/newview/skins/default/xui/tr/floater_about.xml index 9cc9c7a220..7b925e8830 100755 --- a/indra/newview/skins/default/xui/tr/floater_about.xml +++ b/indra/newview/skins/default/xui/tr/floater_about.xml @@ -8,7 +8,9 @@ [COMPILER] [COMPILER_VERSION] sürümü ile oluÅŸturuldu </floater.string> <floater.string name="AboutPosition"> - <nolink>[HOSTNAME]</nolink> ([HOSTIP]) üzerinde bulunan [REGION] içerisinde [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1] konumundasınız + <nolink>[HOSTNAME]</nolink> ([HOSTIP]) üzerinde bulunan [REGION] içerisinde [POSITION_LOCAL_0,number,1], [POSITION_LOCAL_1,number,1], [POSITION_LOCAL_2,number,1] konumundasınız +SLURL: <nolink>[SLURL]</nolink> +(küresel koordinatlar [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1]) [SERVER_VERSION] [SERVER_RELEASE_NOTES_URL] </floater.string> diff --git a/indra/newview/skins/default/xui/tr/floater_bulk_perms.xml b/indra/newview/skins/default/xui/tr/floater_bulk_perms.xml index 1d929a2dd3..bf4473ce1f 100755 --- a/indra/newview/skins/default/xui/tr/floater_bulk_perms.xml +++ b/indra/newview/skins/default/xui/tr/floater_bulk_perms.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="floaterbulkperms" title="İÇERÄ°K Ä°ZÄ°NLERÄ°NÄ° DÃœZENLE"> +<floater name="floaterbulkperms" title="İÇERÄ°K Ä°ZÄ°NLERÄ°NÄ° AYARLA"> <floater.string name="nothing_to_modify_text"> Seçim içerisinde düzenlenebilir içerik yok. </floater.string> @@ -24,7 +24,7 @@ <button label="√ Tümü" name="check_all"/> <button label="Temizle" label_selected="Hiçbiri" name="check_none"/> <text name="newperms"> - Yeni İçerik Ä°zinleri + Åžunun İçin İçerik Ä°zinlerini Ayarla: </text> <text name="GroupLabel"> Grup: @@ -40,6 +40,7 @@ <check_box label="DeÄŸiÅŸtir" name="next_owner_modify"/> <check_box label="Kopyala" name="next_owner_copy"/> <check_box initial_value="true" label="Aktar" name="next_owner_transfer" tool_tip="Sonraki sahibi bu nesneyi verebilir veya tekrar satabilir"/> - <button label="Tamam" name="apply"/> + <button label="Tamam" name="ok"/> + <button label="Uygula" name="apply"/> <button label="Ä°ptal" name="close"/> </floater> diff --git a/indra/newview/skins/default/xui/tr/floater_goto_line.xml b/indra/newview/skins/default/xui/tr/floater_goto_line.xml new file mode 100644 index 0000000000..673fe553cc --- /dev/null +++ b/indra/newview/skins/default/xui/tr/floater_goto_line.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="script goto" title="ÅžU SATIRA GÄ°T:"> + <button label="Tamam" label_selected="Tamam" name="goto_btn"/> + <text name="txt"> + Åžu satıra git: + </text> +</floater> diff --git a/indra/newview/skins/default/xui/tr/floater_im_session.xml b/indra/newview/skins/default/xui/tr/floater_im_session.xml index 8ce8f0fe13..52a10feeef 100755 --- a/indra/newview/skins/default/xui/tr/floater_im_session.xml +++ b/indra/newview/skins/default/xui/tr/floater_im_session.xml @@ -34,13 +34,11 @@ <layout_panel name="body_panel"> <layout_stack name="im_panels"> <layout_panel name="right_part_holder"> - <panel name="trnsAndChat_panel"> - <layout_stack name="translate_and_chat_stack"> - <layout_panel name="translate_chat_checkbox_lp"> - <check_box label="Sohbeti çevir" name="translate_chat_checkbox"/> - </layout_panel> - </layout_stack> - </panel> + <layout_stack name="translate_and_chat_stack"> + <layout_panel name="translate_chat_checkbox_lp"> + <check_box label="Sohbeti çevir" name="translate_chat_checkbox"/> + </layout_panel> + </layout_stack> </layout_panel> </layout_stack> </layout_panel> diff --git a/indra/newview/skins/default/xui/tr/floater_pathfinding_console.xml b/indra/newview/skins/default/xui/tr/floater_pathfinding_console.xml index 35f47e6dfa..6eecc7fb77 100755 --- a/indra/newview/skins/default/xui/tr/floater_pathfinding_console.xml +++ b/indra/newview/skins/default/xui/tr/floater_pathfinding_console.xml @@ -71,7 +71,7 @@ <text name="show_label"> Göster: </text> - <check_box label="Test" name="show_world"/> + <check_box label="Dünya" name="show_world"/> <check_box label="Sadece hareket ettirilebilir nesneler" name="show_world_movables_only"/> <check_box label="Navigasyon örgüsü" name="show_navmesh"/> <text name="show_walkability_label"> diff --git a/indra/newview/skins/default/xui/tr/menu_attachment_other.xml b/indra/newview/skins/default/xui/tr/menu_attachment_other.xml index 9ba214ff31..0cb233a657 100755 --- a/indra/newview/skins/default/xui/tr/menu_attachment_other.xml +++ b/indra/newview/skins/default/xui/tr/menu_attachment_other.xml @@ -11,7 +11,9 @@ <menu_item_call label="Dondur" name="Freeze..."/> <menu_item_call label="Çıkar" name="Eject..."/> <menu_item_call label="Dokularda Hata Ayıkla" name="Debug..."/> + <menu_item_call label="XML Dökümünü Al" name="Dump XML"/> <menu_item_call label="YakınlaÅŸtır" name="Zoom In"/> <menu_item_call label="Öde" name="Pay..."/> <menu_item_call label="Nesne Profili" name="Object Inspect"/> + <menu_item_call label="Parçacık Sahibini Engelle" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/tr/menu_attachment_self.xml b/indra/newview/skins/default/xui/tr/menu_attachment_self.xml index 16d1e3f356..ff7c718979 100755 --- a/indra/newview/skins/default/xui/tr/menu_attachment_self.xml +++ b/indra/newview/skins/default/xui/tr/menu_attachment_self.xml @@ -12,5 +12,7 @@ <menu_item_call label="Gruplarım" name="Groups..."/> <menu_item_call label="Profilim" name="Profile..."/> <menu_item_call label="Dokularda Hata Ayıkla" name="Debug..."/> + <menu_item_call label="XML Dökümünü Al" name="Dump XML"/> <menu_item_call label="Bırak" name="Drop"/> + <menu_item_call label="Parçacık Sahibini Engelle" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/tr/menu_avatar_other.xml b/indra/newview/skins/default/xui/tr/menu_avatar_other.xml index 7d691d2ac5..0da328a894 100755 --- a/indra/newview/skins/default/xui/tr/menu_avatar_other.xml +++ b/indra/newview/skins/default/xui/tr/menu_avatar_other.xml @@ -11,6 +11,8 @@ <menu_item_call label="Dondur" name="Freeze..."/> <menu_item_call label="Çıkar" name="Eject..."/> <menu_item_call label="Dokularda Hata Ayıkla" name="Debug..."/> + <menu_item_call label="XML Dökümünü Al" name="Dump XML"/> <menu_item_call label="YakınlaÅŸtır" name="Zoom In"/> <menu_item_call label="Öde" name="Pay..."/> + <menu_item_call label="Parçacık Sahibini Engelle" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/tr/menu_avatar_self.xml b/indra/newview/skins/default/xui/tr/menu_avatar_self.xml index c520aff521..6996dc612f 100755 --- a/indra/newview/skins/default/xui/tr/menu_avatar_self.xml +++ b/indra/newview/skins/default/xui/tr/menu_avatar_self.xml @@ -29,4 +29,6 @@ <menu_item_call label="Gruplarım" name="Groups..."/> <menu_item_call label="Profilim" name="Profile..."/> <menu_item_call label="Dokularda Hata Ayıkla" name="Debug..."/> + <menu_item_call label="XML Dökümünü Al" name="Dump XML"/> + <menu_item_call label="Parçacık Sahibini Engelle" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/tr/menu_conversation.xml b/indra/newview/skins/default/xui/tr/menu_conversation.xml index 31404f2501..c2773cdc26 100644 --- a/indra/newview/skins/default/xui/tr/menu_conversation.xml +++ b/indra/newview/skins/default/xui/tr/menu_conversation.xml @@ -3,6 +3,7 @@ <menu_item_call label="Sohbeti kapat" name="close_conversation"/> <menu_item_call label="Ses sohbetini aç" name="open_voice_conversation"/> <menu_item_call label="Ses baÄŸlantısını kes" name="disconnect_from_voice"/> + <menu_item_call label="Seçileni Kapat" name="close_selected_conversations"/> <menu_item_call label="Profili Göster" name="view_profile"/> <menu_item_call label="AÄ°" name="im"/> <menu_item_call label="Işınlama teklif et" name="offer_teleport"/> diff --git a/indra/newview/skins/default/xui/tr/menu_land.xml b/indra/newview/skins/default/xui/tr/menu_land.xml index db65f1af1e..d6d8dbf730 100755 --- a/indra/newview/skins/default/xui/tr/menu_land.xml +++ b/indra/newview/skins/default/xui/tr/menu_land.xml @@ -6,4 +6,5 @@ <menu_item_call label="GeçiÅŸ Hakkı Satın Al" name="Land Buy Pass"/> <menu_item_call label="Ä°nÅŸa Et" name="Create"/> <menu_item_call label="Yüzeyi Düzenle" name="Edit Terrain"/> + <menu_item_call label="Parçacık Sahibini Engelle" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/tr/menu_login.xml b/indra/newview/skins/default/xui/tr/menu_login.xml index f27908bf7a..79c95407e8 100755 --- a/indra/newview/skins/default/xui/tr/menu_login.xml +++ b/indra/newview/skins/default/xui/tr/menu_login.xml @@ -18,7 +18,13 @@ <menu_item_call label="Hizmet Åžartlarını Göster" name="TOS"/> <menu_item_call label="Kritik Ä°letiyi Göster" name="Critical"/> <menu_item_call label="Web İçeriÄŸi Gezdiricisi Hata Ayıklama Testi" name="Web Content Floater Debug Test"/> - <menu label="Günlük Tutma Seviyesini Seç" name="Set Logging Level"/> + <menu label="Günlük Tutma Seviyesini Seç" name="Set Logging Level"> + <menu_item_check label="Hata ayıkla" name="Debug"/> + <menu_item_check label="Bilgi" name="Info"/> + <menu_item_check label="Uyarı" name="Warning"/> + <menu_item_check label="Hata" name="Error"/> + <menu_item_check label="Hiçbiri" name="None"/> + </menu> <menu_item_check label="Izgara Seçiciyi Göster" name="Show Grid Picker"/> <menu_item_call label="Bildirimler Konsolunu Göster" name="Show Notifications Console"/> </menu> diff --git a/indra/newview/skins/default/xui/tr/menu_mute_particle.xml b/indra/newview/skins/default/xui/tr/menu_mute_particle.xml new file mode 100644 index 0000000000..a05a745ed0 --- /dev/null +++ b/indra/newview/skins/default/xui/tr/menu_mute_particle.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<!-- *NOTE: See also menu_attachment_other.xml --> +<context_menu name="Mute Particle Pie"> + <menu_item_call label="Parçacık Sahibini Engelle" name="Mute Particle"/> +</context_menu> diff --git a/indra/newview/skins/default/xui/tr/menu_object.xml b/indra/newview/skins/default/xui/tr/menu_object.xml index 72f7adf016..2f8b5c0362 100755 --- a/indra/newview/skins/default/xui/tr/menu_object.xml +++ b/indra/newview/skins/default/xui/tr/menu_object.xml @@ -3,13 +3,13 @@ <menu_item_call label="Dokun" name="Object Touch"/> <menu_item_call label="Düzenle" name="Edit..."/> <menu_item_call label="Ä°nÅŸa Et" name="Build"/> - <menu_item_call label="BaÄŸlantı kümelerinde göster" name="show_in_linksets"/> - <menu_item_call label="Karakterlerde göster" name="show_in_characters"/> <menu_item_call label="Aç" name="Open"/> <menu_item_call label="Buraya Otur" name="Object Sit"/> <menu_item_call label="Kalk" name="Object Stand Up"/> <menu_item_call label="Nesne Profili" name="Object Inspect"/> <menu_item_call label="YakınlaÅŸtır" name="Zoom In"/> + <menu_item_call label="BaÄŸlantı kümelerinde göster" name="show_in_linksets"/> + <menu_item_call label="Karakterlerde göster" name="show_in_characters"/> <context_menu label="Ãœzerine Koy" name="Put On"> <menu_item_call label="Giy" name="Wear"/> <menu_item_call label="Ekle" name="Add"/> @@ -26,4 +26,5 @@ <menu_item_call label="Öde" name="Pay..."/> <menu_item_call label="Satın Al" name="Buy..."/> <menu_item_call label="Sil" name="Delete"/> + <menu_item_call label="Parçacık Sahibini Engelle" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/tr/menu_url_agent.xml b/indra/newview/skins/default/xui/tr/menu_url_agent.xml index b14a0509bf..109cd62495 100755 --- a/indra/newview/skins/default/xui/tr/menu_url_agent.xml +++ b/indra/newview/skins/default/xui/tr/menu_url_agent.xml @@ -3,6 +3,7 @@ <menu_item_call label="Profili Göster" name="show_agent"/> <menu_item_call label="AÄ° Gönder..." name="send_im"/> <menu_item_call label="ArkadaÅŸ Ekle..." name="add_friend"/> + <menu_item_call label="Arkadaşı Çıkar..." name="remove_friend"/> <menu_item_call label="Adı panoya kopyala" name="url_copy_label"/> <menu_item_call label="SLurl'yi Panoya Kopyala" name="url_copy"/> </context_menu> diff --git a/indra/newview/skins/default/xui/tr/menu_url_objectim.xml b/indra/newview/skins/default/xui/tr/menu_url_objectim.xml index 00fa3c27c2..ae68669605 100755 --- a/indra/newview/skins/default/xui/tr/menu_url_objectim.xml +++ b/indra/newview/skins/default/xui/tr/menu_url_objectim.xml @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <context_menu name="Url Popup"> <menu_item_call label="Nesne Profili..." name="show_object"/> + <menu_item_call label="Engelle..." name="block_object"/> <menu_item_call label="Haritada Göster" name="show_on_map"/> <menu_item_call label="Nesne Konumuna Işınla" name="teleport_to_object"/> <menu_item_call label="Nesne Adını panoya kopyala" name="url_copy_label"/> diff --git a/indra/newview/skins/default/xui/tr/menu_viewer.xml b/indra/newview/skins/default/xui/tr/menu_viewer.xml index 35485bb292..4236f91636 100755 --- a/indra/newview/skins/default/xui/tr/menu_viewer.xml +++ b/indra/newview/skins/default/xui/tr/menu_viewer.xml @@ -16,7 +16,10 @@ <menu_item_call label="Beni Anime Etmeyi Durdur" name="Stop Animating My Avatar"/> <menu_item_call label="Yürü / koÅŸ / uç..." name="Walk / run / fly"/> </menu> - <menu label="Durum" name="Status"/> + <menu label="Durum" name="Status"> + <menu_item_check label="Uzakta" name="Away"/> + <menu_item_check label="Rahatsız Etme" name="Do Not Disturb"/> + </menu> <menu_item_call label="L$ Satın Al..." name="Buy and Sell L$"/> <menu_item_call label="Satıcı Giden Kutusu..." name="MerchantOutbox"/> <menu_item_call label="Hesap kontrol paneli..." name="Manage My Account"/> @@ -30,6 +33,7 @@ <menu_item_check label="Sohbetler..." name="Conversations"/> <menu_item_check label="Yakındaki Sohbet..." name="Nearby Chat"/> <menu_item_check label="KonuÅŸ" name="Speak"/> + <menu_item_check label="Sohbet Günlüğü..." name="Conversation Log..."/> <menu label="Ses ÅŸekillendirme" name="VoiceMorphing"> <menu_item_check label="Ses ÅŸekillendirme yok" name="NoVoiceMorphing"/> <menu_item_check label="Önizleme..." name="Preview"/> @@ -40,6 +44,7 @@ <menu_item_check label="Gruplar" name="My Groups"/> <menu_item_check label="Yakındaki kiÅŸiler" name="Active Speakers"/> <menu_item_call label="Engelleme Listesi" name="Block List"/> + <menu_item_check label="Rahatsız Etme" name="Do Not Disturb"/> </menu> <menu label="Dünya" name="World"> <menu_item_call label="Bu Yeri Yer Ä°mlerine Ekle" name="Create Landmark Here"/> @@ -108,6 +113,7 @@ <menu_item_call label="Sonraki Parçayı Dahil Et" name="Include Next Part"/> <menu_item_call label="Önceki Parçayı Dahil Et" name="Include Previous Part"/> </menu> + <menu_item_call label="BaÄŸlantı kümeleri..." name="pathfinding_linkset_menu_item"/> <menu_item_call label="Seçime Odaklan" name="Focus on Selection"/> <menu_item_call label="Seçimi YakınlaÅŸtır" name="Zoom to Selection"/> <menu label="Nesne" name="Object"> @@ -277,6 +283,7 @@ <menu_item_check label="Çerçeve Hızını Rastgele Seç" name="Randomize Framerate"/> <menu_item_check label="Düzenli YavaÅŸ Çerçeve" name="Periodic Slow Frame"/> <menu_item_check label="Çerçeve Testi" name="Frame Test"/> + <menu_item_call label="Çerçeve Profili..." name="Frame Profile"/> </menu> <menu label="Meta Verileri Ä°ÅŸle" name="Render Metadata"> <menu_item_check label="Sınırlama Kutuları" name="Bounding Boxes"/> @@ -311,9 +318,10 @@ <menu_item_check label="Eksenler" name="Axes"/> <menu_item_check label="Tanjant Temeli" name="Tangent Basis"/> <menu_item_call label="Seçilen Doku Bilgi Temeli" name="Selected Texture Info Basis"/> + <menu_item_call label="Seçilen Malzeme Bilgisi" name="Selected Material Info"/> <menu_item_check label="Telkafes" name="Wireframe"/> <menu_item_check label="Görünen Nesneler İçin Gölgeleme" name="Object-Object Occlusion"/> - <menu_item_check label="Işıklandırma ve Gölgeler" name="Advanced Lighting Model"/> + <menu_item_check label="GeliÅŸmiÅŸ Aydınlatma Modeli" name="Advanced Lighting Model"/> <menu_item_check label="GüneÅŸ/Ay/Projektörlerden Gelen Gölgeler" name="Shadows from Sun/Moon/Projectors"/> <menu_item_check label="SSAO ve Gölge YumuÅŸatma" name="SSAO and Shadow Smoothing"/> <menu_item_check label="GL Hata Ayıklama" name="Debug GL"/> @@ -323,7 +331,6 @@ <menu_item_check label="Animasyon Dokuları" name="Animation Textures"/> <menu_item_check label="Dokuları Devre Dışı Bırak" name="Disable Textures"/> <menu_item_check label="Tam Çöz. Dokular" name="Rull Res Textures"/> - <menu_item_check label="Doku Atlas (deneysel)" name="Texture Atlas"/> <menu_item_check label="EklenmiÅŸ Işıkları Ä°ÅŸle" name="Render Attached Lights"/> <menu_item_check label="EklenmiÅŸ Parçacıkları Ä°ÅŸle" name="Render Attached Particles"/> <menu_item_check label="Parıldayan Nesneler Ãœzerine Gel" name="Hover Glow Objects"/> @@ -359,7 +366,6 @@ <menu_item_call label="Odaklayıcı Tutucunun Dökümünü Al" name="Dump Focus Holder"/> <menu_item_call label="Seçilen Nesne Bilgisini Yazdır" name="Print Selected Object Info"/> <menu_item_call label="Aracı Bilgisini Yazdır" name="Print Agent Info"/> - <menu_item_call label="Bellek Ä°statistikleri" name="Memory Stats"/> <menu_item_check label="Bölge Hata Ayıklama Konsolu" name="Region Debug Console"/> <menu_item_check label="SelectMgr İçin Hata Ayıklama" name="Debug SelectMgr"/> <menu_item_check label="Tıklamalar İçin Hata Ayıklama" name="Debug Clicks"/> diff --git a/indra/newview/skins/default/xui/tr/notifications.xml b/indra/newview/skins/default/xui/tr/notifications.xml index ad92a4b478..492178ab82 100755 --- a/indra/newview/skins/default/xui/tr/notifications.xml +++ b/indra/newview/skins/default/xui/tr/notifications.xml @@ -210,6 +210,14 @@ Bu Yetenek '[ROLE_NAME]' rolüne eklensin mi? Bu Yetenek '[ROLE_NAME]' rolüne eklensin mi? <usetemplate name="okcancelbuttons" notext="Hayır" yestext="Evet"/> </notification> + <notification name="EjectGroupMemberWarning"> + Gruptan [AVATAR_NAME] adlı üyeyi çıkarmak üzeresiniz. + <usetemplate ignoretext="Gruptan bir katılımcının çıkarılmasını doÄŸrulayın" name="okcancelignore" notext="Ä°ptal" yestext="Çıkar"/> + </notification> + <notification name="EjectGroupMembersWarning"> + Gruptan [COUNT] üyeyi çıkarmak üzeresiniz. + <usetemplate ignoretext="Gruptan birden çok üyenin çıkarılmasını doÄŸrulayın" name="okcancelignore" notext="Ä°ptal" yestext="Çıkar"/> + </notification> <notification name="AttachmentDrop"> Aksesuarınızı çıkarmak üzeresiniz. Devam etmek istediÄŸinize emin misiniz? @@ -1111,7 +1119,7 @@ bu simdeki TÃœM ARAZÄ°LERDEN SÄ°LMEK istediÄŸinize emin misiniz? Lütfen daha yüksek bir tutar girin. </notification> <notification name="ConfirmItemDeleteHasLinks"> - SeçtiÄŸiniz öğelerden en az birinin kendisine iÅŸaret eden baÄŸlantılı öğeler var. Bu öğeyi silerseniz, baÄŸlantıları kalıcı olarak çalışmaz hale gelecek. Önce baÄŸlantıları silmeniz önemle tavsiye edilir. + Öğelerden en az birinde kendisine iÅŸaret eden baÄŸlantılar var. Bu öğeyi silerseniz, baÄŸlantıları kalıcı olarak çalışmaz hale gelecek. Önce baÄŸlantıları silmeniz önemle tavsiye edilir. Bu öğeleri silmek istediÄŸinize emin misiniz? <usetemplate name="okcancelbuttons" notext="Ä°ptal" yestext="Tamam"/> @@ -1479,14 +1487,44 @@ Sürüm [VERSION] [[RELEASE_NOTES_FULL_URL] Bu güncelleme hakkında ayrıntılÄ <usetemplate name="okcancelbuttons" notext="Sonra..." yestext="Åžimdi kur ve [APP_NAME] uygulamasını yeniden baÅŸlat"/> </notification> <notification name="RequiredUpdateDownloadedVerboseDialog"> - Gerekli bir yazılım güncellemesini karşıdan yükledik. -Sürüm [VERSION] + Gerekli bir yazılım güncellemesi indirdik. +Sürüm [VERSION] [[INFO_URL] Bu güncelleme hakkında ayrıntılı bilgi] -Güncellemeyi kurmak için [APP_NAME] uygulamasını yeniden baÅŸlatmalısınız. +Güncellemeyi yüklemek için [APP_NAME] uygulamasını yeniden baÅŸlatmalısınız. <usetemplate name="okbutton" yestext="Tamam"/> </notification> <notification name="RequiredUpdateDownloadedDialog"> - Güncellemeyi kurmak için [APP_NAME] uygulamasını yeniden baÅŸlatmalısınız. + Güncellemeyi yüklemek için [APP_NAME] uygulamasını yeniden baÅŸlatmalısınız. +[[INFO_URL] Bu güncelleme hakkında bilgi] + <usetemplate name="okbutton" yestext="Tamam"/> + </notification> + <notification name="OtherChannelDownloadBackgroundTip"> + [APP_NAME] kurulumunuz için bir güncelleme indirdik. +Sürüm [VERSION] +Bu deneysel görüntüleyicinin yerini bir [NEW_CHANNEL] görüntüleyici aldı; +bkz. [bu güncelleme hakkında bilgi için [INFO_URL]] + <usetemplate name="okcancelbuttons" notext="Sonra..." yestext="Åžimdi yükle ve [APP_NAME] uygulamasını yeniden baÅŸlat"/> + </notification> + <notification name="OtherChannelDownloadBackgroundDialog"> + [APP_NAME] kurulumunuz için bir güncelleme indirdik. +Sürüm [VERSION] +Bu deneysel görüntüleyicinin yerini bir [NEW_CHANNEL] görüntüleyici aldı; +bkz. [[INFO_URL] Bu güncelleme hakkında bilgi] + <usetemplate name="okcancelbuttons" notext="Sonra..." yestext="Åžimdi yükle ve [APP_NAME] uygulamasını yeniden baÅŸlat"/> + </notification> + <notification name="OtherChannelRequiredUpdateDownloadedVerboseDialog"> + Gerekli bir yazılım güncellemesi indirdik. +Sürüm [VERSION] +Bu deneysel görüntüleyicinin yerini bir [NEW_CHANNEL] görüntüleyici aldı; +bkz. [[INFO_URL] Bu güncelleme hakkında bilgi] + +Güncellemeyi yüklemek için [APP_NAME] uygulamasını yeniden baÅŸlatmalısınız. + <usetemplate name="okbutton" yestext="Tamam"/> + </notification> + <notification name="OtherChannelRequiredUpdateDownloadedDialog"> + Güncellemeyi yüklemek için [APP_NAME] uygulamasını yeniden baÅŸlatmalısınız. +Bu deneysel görüntüleyicinin yerini bir [NEW_CHANNEL] görüntüleyici aldı; +bkz. [[INFO_URL] Bu güncelleme hakkında bilgi] <usetemplate name="okbutton" yestext="Tamam"/> </notification> <notification name="DeedObjectToGroup"> @@ -1537,6 +1575,10 @@ Güncellemeyi kurmak için [APP_NAME] uygulamasını yeniden baÅŸlatmalısınız Gruptan ayrılmak istiyor musunuz? <usetemplate name="okcancelbuttons" notext="Ä°ptal" yestext="Tamam"/> </notification> + <notification name="OwnerCannotLeaveGroup"> + Gruptan ayrılınamıyor. Gruptan ayrılamazsınız çünkü grubun son sahibisiniz. Lütfen önce sahip rolüne baÅŸka bir üye atayın. + <usetemplate name="okbutton" yestext="Tamam"/> + </notification> <notification name="ConfirmKick"> Tüm Sakinleri GERÇEKTEN aÄŸ dışına çıkarmak istiyor musunuz? <usetemplate name="okcancelbuttons" notext="Ä°ptal Et" yestext="Tüm Sakinleri Çıkar"/> @@ -2396,9 +2438,7 @@ Lütfen tek bir nesne seçin. 'Işınla' seçimini yapabilirsiniz.) </notification> <notification name="TeleportToPerson"> - '[NAME]' gibi sakinlerle baÄŸlantıya geçmek için "KiÅŸiler" düğmesine tıklayın, açılan pencereden bir Sakin seçin ve sonra - pencerenin altında 'Anlık Ä°leti" üzerine tıklayın. - (Listede adlarına çift tıklayarak veya saÄŸ tıklayıp "Anlık Ä°leti"yi seçerek de bunu yapabilirsiniz.) + Biriyle özel bir sohbet baÅŸlatmak için, avatarlarına saÄŸ tıklayın ve menüden "AÄ°" seçimini yapın. </notification> <notification name="CantSelectLandFromMultipleRegions"> Sunucunun sınırları dışındaki arazi seçilemez. @@ -2772,6 +2812,15 @@ EÄŸer hesabınıza neden eriÅŸmek istediÄŸini tam olarak anlamıyorsanız, eriÅŸ <button name="Deny" text="Reddet"/> </form> </notification> + <notification name="UnknownScriptQuestion"> + '[NAME]' tarafından sahip olunan bir nesne olan '<nolink>[OBJECTNAME]</nolink>' tarafından istenen çalışma zamanı komut dosyası izni görüntüleyici tarafından tanınmadı ve verilemez. + +Bu izni vermek için lütfen [DOWNLOADURL] adresinden görüntüleyicinizi en son sürüme güncelleyin. + <form name="form"> + <button name="Deny" text="Tamam"/> + <button name="Mute" text="Engelle"/> + </form> + </notification> <notification name="ScriptDialog"> [NAME] adlı kiÅŸiye ait '<nolink>[TITLE]</nolink>' [MESSAGE] diff --git a/indra/newview/skins/default/xui/tr/panel_people.xml b/indra/newview/skins/default/xui/tr/panel_people.xml index 08efd0aa61..b499ec8307 100755 --- a/indra/newview/skins/default/xui/tr/panel_people.xml +++ b/indra/newview/skins/default/xui/tr/panel_people.xml @@ -49,6 +49,9 @@ Birlikte takılacak kiÅŸiler mi arıyorsunuz? [secondlife:///app/worldmap Dünya <menu_button name="plus_btn" tool_tip="Gruba katıl/yeni grup oluÅŸtur"/> <dnd_button name="minus_btn" tool_tip="Seçilen gruptan ayrıl"/> </panel> + <text name="groupcount"> + [COUNT] gruba üyesiniz, daha [REMAINING] gruba üye olabilirsiniz. + </text> </panel> <panel label="SON" name="recent_panel"> <panel label="bottom_panel" name="recent_buttons_panel"> diff --git a/indra/newview/skins/default/xui/tr/panel_preferences_chat.xml b/indra/newview/skins/default/xui/tr/panel_preferences_chat.xml index aaeebdfe6e..d46f3e08cc 100755 --- a/indra/newview/skins/default/xui/tr/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/tr/panel_preferences_chat.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <panel label="Metin Sohbeti" name="chat"> - <panel> + <panel name="general_chat_settings"> <check_box initial_value="true" label="Sohbet sırasında yazma animasyonunu oynat" name="play_typing_animation"/> <check_box label="Çevrimdışı olduÄŸunda AÄ°'ler e-posta ile bana gönderilsin" name="send_im_to_email"/> <check_box label="Sadece arkadaÅŸlar ve gruplar beni arasın veya AÄ° göndersin" name="voice_call_friends_only_check"/> @@ -14,19 +14,17 @@ </combo_box> <check_box label="Balon Sohbeti" name="bubble_text_chat"/> </panel> - <panel> - <text name="notifications"> - Bildirimler - </text> + <panel name="im_notification_settings"> <text name="friend_ims"> ArkadaÅŸ AÄ°'leri: </text> <combo_box name="FriendIMOptions"> <item label="Sohbetler penceresini aç" name="OpenConversationsWindow" value="openconversations"/> - <item label="Mesajı aç" name="PopUpMessage" value="toast"/> + <item label="Mesajı açılır pencerede göster" name="PopUpMessage" value="toast"/> <item label="Araç çubuÄŸu düğmesi yanıp sönsün" name="FlashToolbarButton" value="flash"/> - <item label="Hiçbiri" name="None" value="none"/> + <item label="Eylem yok" name="NoAction" value="noaction"/> </combo_box> + <check_box label="Sesi çal" name="play_sound_friend_im"/> <text name="non_friend_ims"> ArkadaÅŸ harici AÄ°'ler: </text> @@ -34,40 +32,54 @@ <item label="Sohbetler penceresini aç" name="OpenConversationsWindow" value="openconversations"/> <item label="Mesajı açılır pencerede göster" name="PopUpMessage" value="toast"/> <item label="Araç çubuÄŸu düğmesi yanıp sönsün" name="FlashToolbarButton" value="flash"/> - <item label="Hiçbiri" name="None" value="none"/> + <item label="Eylem yok" name="NoAction" value="noaction"/> </combo_box> + <check_box label="Sesi çal" name="play_sound_non_friend_im"/> <text name="conference_ims"> Konferans AÄ°'leri: </text> <combo_box name="ConferenceIMOptions"> <item label="Sohbetler penceresini aç" name="OpenConversationsWindow" value="openconversations"/> - <item label="Mesajı aç" name="PopUpMessage" value="toast"/> + <item label="Mesajı açılır pencerede göster" name="PopUpMessage" value="toast"/> <item label="Araç çubuÄŸu düğmesi yanıp sönsün" name="FlashToolbarButton" value="flash"/> - <item label="Hiçbiri" name="None" value="none"/> + <item label="Eylem yok" name="NoAction" value="noaction"/> </combo_box> + <check_box label="Sesi çal" name="play_sound_conference_im"/> <text name="group_chat"> Grup sohbeti: </text> <combo_box name="GroupChatOptions"> <item label="Sohbetler penceresini aç" name="OpenConversationsWindow" value="openconversations"/> - <item label="Mesajı aç" name="PopUpMessage" value="toast"/> + <item label="Mesajı açılır pencerede göster" name="PopUpMessage" value="toast"/> <item label="Araç çubuÄŸu düğmesi yanıp sönsün" name="FlashToolbarButton" value="flash"/> - <item label="Hiçbiri" name="None" value="none"/> + <item label="Eylem yok" name="NoAction" value="noaction"/> </combo_box> + <check_box label="Sesi çal" name="play_sound_group_chat_im"/> <text name="nearby_chat"> Yakındaki sohbet: </text> <combo_box name="NearbyChatOptions"> <item label="Sohbetler penceresini aç" name="OpenConversationsWindow" value="openconversations"/> - <item label="Mesajı aç" name="PopUpMessage" value="toast"/> + <item label="Mesajı açılır pencerede göster" name="PopUpMessage" value="toast"/> + <item label="Araç çubuÄŸu düğmesi yanıp sönsün" name="FlashToolBarButton" value="flash"/> + <item label="Eylem yok" name="NoAction" value="noaction"/> + </combo_box> + <check_box label="Sesi çal" name="play_sound_nearby_chat_im"/> + <text name="object_ims"> + Nesne AÄ°'leri: + </text> + <combo_box name="ObjectIMOptions"> + <item label="Sohbetler penceresini aç" name="OpenConversationsWindow" value="openconversations"/> + <item label="Mesajı açılır pencerede göster" name="PopUpMessage" value="toast"/> <item label="Araç çubuÄŸu düğmesi yanıp sönsün" name="FlashToolBarButton" value="flash"/> - <item label="Hiçbiri" name="None" value="none"/> + <item label="Eylem yok" name="NoAction" value="noaction"/> </combo_box> + <check_box label="Sesi çal" name="play_sound_object_im"/> <text name="notifications_alert"> Tüm bildirimleri geçici olarak durdurmak için Ä°letiÅŸim Kur > Rahatsız Etme seçeneÄŸini kullanın. </text> </panel> - <panel> + <panel name="play_sound_settings"> <text name="play_sound"> Sesi çal: </text> @@ -76,7 +88,7 @@ <check_box label="Işınlama teklifi" name="teleport_offer"/> <check_box label="Envanter teklifi" name="inventory_offer"/> </panel> - <panel> + <panel name="log_settings"> <button label="Günlüğü temizle..." name="clear_log"/> <button label="Dökümleri sil..." name="delete_transcripts"/> <button label="Gözat..." label_selected="Gözat" name="log_path_button"/> diff --git a/indra/newview/skins/default/xui/tr/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/tr/panel_preferences_graphics1.xml index ddb83ffc69..25c9e966c7 100755 --- a/indra/newview/skins/default/xui/tr/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/tr/panel_preferences_graphics1.xml @@ -30,7 +30,7 @@ <check_box initial_value="true" label="Yerel Işıklar" name="LocalLights"/> <check_box initial_value="true" label="Temel gölgeleyiciler" name="BasicShaders" tool_tip="Bu seçeneÄŸin devre dışı bırakılması bazı grafik kartlarının sürücülerinin kilitlenmesini önleyebilir"/> <check_box initial_value="true" label="Atmosferik gölgeleyiciler" name="WindLightUseAtmosShaders"/> - <check_box initial_value="true" label="Işıklandırma ve Gölgeler" name="UseLightShaders"/> + <check_box initial_value="true" label="GeliÅŸmiÅŸ Aydınlatma Modeli" name="UseLightShaders"/> <check_box initial_value="true" label="Ortam Gölgeleme" name="UseSSAO"/> <check_box initial_value="true" label="Alan DerinliÄŸi" name="UseDoF"/> <text name="shadows_label"> diff --git a/indra/newview/skins/default/xui/tr/panel_preferences_setup.xml b/indra/newview/skins/default/xui/tr/panel_preferences_setup.xml index 9d03d9b01d..2039761748 100755 --- a/indra/newview/skins/default/xui/tr/panel_preferences_setup.xml +++ b/indra/newview/skins/default/xui/tr/panel_preferences_setup.xml @@ -29,6 +29,7 @@ <combo_box.item label="Otomatik olarak kurulsun" name="Install_automatically"/> <combo_box.item label="GüncelleÅŸtirmeler manuel olarak karşıdan yüklensin ve kurulsun" name="Install_manual"/> </combo_box> + <check_box label="Sürüm adaylarına güncelleme yapmaya gönüllü" name="update_willing_to_test"/> <text name="Proxy Settings:"> Proxy Ayarları: </text> diff --git a/indra/newview/skins/default/xui/tr/panel_script_ed.xml b/indra/newview/skins/default/xui/tr/panel_script_ed.xml index 7aa1da6fb2..79cd86c3f0 100755 --- a/indra/newview/skins/default/xui/tr/panel_script_ed.xml +++ b/indra/newview/skins/default/xui/tr/panel_script_ed.xml @@ -34,6 +34,7 @@ <menu_item_call label="Tümünü Seç" name="Select All"/> <menu_item_call label="Seçimi Kaldır" name="Deselect"/> <menu_item_call label="Ara / DeÄŸiÅŸtir..." name="Search / Replace..."/> + <menu_item_call label="Åžu satıra git:" name="Go to line..."/> </menu> <menu label="Yardım" name="Help"> <menu_item_call label="Yardım..." name="Help..."/> diff --git a/indra/newview/skins/default/xui/tr/panel_tools_texture.xml b/indra/newview/skins/default/xui/tr/panel_tools_texture.xml new file mode 100644 index 0000000000..2ce7c9c11f --- /dev/null +++ b/indra/newview/skins/default/xui/tr/panel_tools_texture.xml @@ -0,0 +1,116 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<panel label="Doku" name="Texture"> + <panel.string name="string repeats per meter"> + Metrede Kaç Kez Tekrarlandığı + </panel.string> + <panel.string name="string repeats per face"> + Bir Yüzde Kaç Kez Tekrarlandığı + </panel.string> + <text name="color label"> + Renk + </text> + <color_swatch label="" name="colorswatch" tool_tip="Renk seçiciyi açmak için tıklayın"/> + <text name="color trans"> + Saydamlık % + </text> + <text name="glow label"> + Parıltı + </text> + <check_box label="Tam Parlak" name="checkbox fullbright"/> + <combo_box name="combobox matmedia"> + <combo_box.item label="Malzemeler" name="Materials"/> + <combo_box.item label="Ortam" name="Media"/> + </combo_box> + <combo_box name="combobox mattype"> + <combo_box.item label="Doku (yayılmış)" name="Texture (diffuse)"/> + <combo_box.item label="Yumruluk (normal)" name="Bumpiness (normal)"/> + <combo_box.item label="Parıldama (yansıtan)" name="Shininess (specular)"/> + </combo_box> + <texture_picker label="Doku" name="texture control" tool_tip="Bir resim seçmek için tıklayın"/> + <text name="label alphamode"> + Alfa modu + </text> + <combo_box name="combobox alphamode"> + <combo_box.item label="Hiçbiri" name="None"/> + <combo_box.item label="Alfa karıştırma" name="Alpha blending"/> + <combo_box.item label="Alfa maskeleme" name="Alpha masking"/> + <combo_box.item label="Yayımlatıcı maske" name="Emissive mask"/> + </combo_box> + <text name="label maskcutoff"> + Maske kesimi + </text> + <texture_picker label="Doku" name="bumpytexture control" tool_tip="Bir resim seçmek için tıklayın"/> + <text name="label bumpiness"> + Yumruluk + </text> + <combo_box name="combobox bumpiness"> + <combo_box.item label="Yok" name="None"/> + <combo_box.item label="Parlaklık" name="Brightness"/> + <combo_box.item label="Koyuluk" name="Darkness"/> + <combo_box.item label="damarlı ahÅŸap" name="woodgrain"/> + <combo_box.item label="aÄŸaç kabuÄŸu" name="bark"/> + <combo_box.item label="tuÄŸlalar" name="bricks"/> + <combo_box.item label="dama tahtası" name="checker"/> + <combo_box.item label="beton" name="concrete"/> + <combo_box.item label="sert çini" name="crustytile"/> + <combo_box.item label="kesilmiÅŸ taÅŸ" name="cutstone"/> + <combo_box.item label="diskler" name="discs"/> + <combo_box.item label="çakıl" name="gravel"/> + <combo_box.item label="petri kabı" name="petridish"/> + <combo_box.item label="dış kaplama" name="siding"/> + <combo_box.item label="taÅŸ çini" name="stonetile"/> + <combo_box.item label="stükko" name="stucco"/> + <combo_box.item label="vakum" name="suction"/> + <combo_box.item label="örgü" name="weave"/> + </combo_box> + <texture_picker label="Doku" name="shinytexture control" tool_tip="Bir resim seçmek için tıklayın"/> + <text name="label shininess"> + Parıldama + </text> + <combo_box name="combobox shininess"> + <combo_box.item label="Yok" name="None"/> + <combo_box.item label="Düşük" name="Low"/> + <combo_box.item label="Orta" name="Medium"/> + <combo_box.item label="Yüksek" name="High"/> + </combo_box> + <text name="label glossiness"> + Pürüzsüzlük + </text> + <text name="label environment"> + Ortam + </text> + <text name="label shinycolor"> + Renk + </text> + <color_swatch label="" name="shinycolorswatch" tool_tip="Renk seçiciyi açmak için tıklayın"/> + <text name="media_info"> + Varsa, seçilen ortamın URL'si burada yer alır + </text> + <button label="Seç..." name="add_media" tool_tip="Ortam Ekle"/> + <button label="Kaldır" name="delete_media" tool_tip="Bu ortam dokusunu sil"/> + <button label="Hizala" label_selected="Ortamı Hizala" name="button align" tool_tip="Ortam dokusunu hizala (önce yüklenmelidir)"/> + <text name="tex gen"> + EÅŸleÅŸtirme + </text> + <combo_box name="combobox texgen"> + <combo_box.item label="Varsayılan" name="Default"/> + <combo_box.item label="Planar" name="Planar"/> + </combo_box> + <spinner label="Yatay ölçek" name="TexScaleU"/> + <spinner label="Dikey ölçek" name="TexScaleV"/> + <spinner label="Metrede kaç kez tekrarlandığı" name="rptctrl"/> + <spinner label="Dönüş derecesi" name="TexRot"/> + <spinner label="Yatay ofset" name="TexOffsetU"/> + <spinner label="Dikey ofset" name="TexOffsetV"/> + <spinner label="Yatay ölçek" name="bumpyScaleU"/> + <spinner label="Dikey ölçek" name="bumpyScaleV"/> + <spinner label="Dönüş derecesi" name="bumpyRot"/> + <spinner label="Yatay ofset" name="bumpyOffsetU"/> + <spinner label="Dikey ofset" name="bumpyOffsetV"/> + <spinner label="Yatay ölçek" name="shinyScaleU"/> + <spinner label="Dikey ölçek" name="shinyScaleV"/> + <spinner label="Dönüş derecesi" name="shinyRot"/> + <spinner label="Yatay ofset" name="shinyOffsetU"/> + <spinner label="Dikey ofset" name="shinyOffsetV"/> + <check_box initial_value="false" label="Planar yüzleri hizala" name="checkbox planar align" tool_tip="Tüm seçili yüzeylerdeki dokuları son seçili yüzdekiyle hizalar. Planar doku eÅŸleÅŸtirmesi gerektirir."/> +</panel> diff --git a/indra/newview/skins/default/xui/tr/role_actions.xml b/indra/newview/skins/default/xui/tr/role_actions.xml index 655ac64172..76ca58c319 100755 --- a/indra/newview/skins/default/xui/tr/role_actions.xml +++ b/indra/newview/skins/default/xui/tr/role_actions.xml @@ -25,7 +25,7 @@ </action_set> <action_set description="Bu yetenekler arasında parsel adını ve yayınlama ayarlarını, Bul dizinindeki görünürlük ile iniÅŸ noktası ve TP yönlendirme seçeneklerini deÄŸiÅŸtirme imkanları yer alır." name="Parcel Identity"> <action description="'Konumu Arama Sonuçlarında Göster' seçeneÄŸini Aç/Kapa ve kategoriyi ayarla" longdescription="Arazi Hakkında > Seçenekler sekmesinden 'Konumu Arama Sonuçlarında Göster' seçeneÄŸini Açın/Kapayın ve parsel kategorisini ayarlayın." name="land find places" value="17"/> - <action description="Parsel adını, açıklamasını ve "Konumu Arama Sonuçlarında Göster" ayarlarını deÄŸiÅŸtir" longdescription="Parsel adını, açıklamasını ve "Konumu Arama Sonuçlarında Göster" ayarlarını deÄŸiÅŸtirin. Bu iÅŸlem Arazi Hakkında > Seçenekler sekmesinde yapılır." name="land change identity" value="18"/> + <action description="Parsel adını, açıklamasını ve "Orta Seviyede İçerik" ayarlarını deÄŸiÅŸtir" longdescription="Parsel adını, açıklamasını ve "Orta Seviyede İçerik" ayarlarını deÄŸiÅŸtir. Bu iÅŸlem Arazi Hakkında > Seçenekler sekmesinde yapılır." name="land change identity" value="18"/> <action description="Ä°niÅŸ noktasını ve ışınlama yönlendirmesini ayarlayın" longdescription="Bir grubun sahip olduÄŸu parsel üzerinde, bu YeteneÄŸe sahip olan bir Roldeki Ãœyeler gelen ışınlanmaların varacağı iniÅŸ noktasını ve daha fazla kontrol için ışınlama yönlendirmesini ayarlayabilirler. Bu iÅŸlem Arazi Hakkında > Seçenekler sekmesinde yapılır." name="land set landing point" value="19"/> </action_set> <action_set description="Bu Yeteneklere 'Nesneleri OluÅŸtur', 'Yüzeyi Düzenle', müzik ve ortam ayarları gibi parsel seçeneklerini etkileyen güçler de dahildir." name="Parcel Settings"> diff --git a/indra/newview/skins/default/xui/tr/strings.xml b/indra/newview/skins/default/xui/tr/strings.xml index 155dc8749a..5a809ea783 100755 --- a/indra/newview/skins/default/xui/tr/strings.xml +++ b/indra/newview/skins/default/xui/tr/strings.xml @@ -139,6 +139,9 @@ <string name="create_account_url"> http://join.secondlife.com/?sourceid=[sourceid] </string> + <string name="ViewerDownloadURL"> + http://secondlife.com/download + </string> <string name="LoginFailedViewerNotPermitted"> Kullandığınız görüntüleyici ile artık Second Life'a eriÅŸemezsiniz. Yeni bir görüntüleyiciyi karşıdan yüklemek için lütfen ÅŸu sayfayı ziyaret edin: http://secondlife.com/download @@ -448,6 +451,9 @@ Lütfen bir dakika içerisinde tekrar oturum açmayı deneyin. <string name="SLappAgentRequestFriend"> ArkadaÅŸlık Talebi </string> + <string name="SLappAgentRemoveFriend"> + ArkadaÅŸların Çıkarılması + </string> <string name="BUTTON_CLOSE_DARWIN"> Kapat (⌘W) </string> @@ -835,6 +841,9 @@ Lütfen bir dakika içerisinde tekrar oturum açmayı deneyin. <string name="multiple_textures"> Birden Çok </string> + <string name="use_texture"> + Dokuyu kullan + </string> <string name="texture_loading"> Yükleniyor... </string> @@ -934,6 +943,21 @@ Lütfen bir dakika içerisinde tekrar oturum açmayı deneyin. <string name="TeleportYourAgent"> Sizi ışınlama </string> + <string name="JoinAnExperience"> + Bir tecrübeye katıl + </string> + <string name="SilentlyManageEstateAccess"> + Gayri menkul eriÅŸim listelerini yönetirken uyarıları bastır + </string> + <string name="OverrideYourAnimations"> + Varsayılan animasyonlarınızı deÄŸiÅŸtirin + </string> + <string name="ScriptReturnObjects"> + Kendi adınıza nesneler iade edin + </string> + <string name="UnknownScriptPermission"> + (bilinmiyor)! + </string> <string name="SIM_ACCESS_PG"> Genel </string> @@ -1965,6 +1989,12 @@ Lütfen bir dakika içerisinde tekrar oturum açmayı deneyin. <string name="ATTACH_HUD_BOTTOM_RIGHT"> BÃœG SaÄŸ Alt </string> + <string name="ATTACH_NECK"> + Boyun + </string> + <string name="ATTACH_AVATAR_CENTER"> + Avatar Merkezi + </string> <string name="CursorPos"> Satır [LINE], Sütun [COLUMN] </string> @@ -2994,6 +3024,9 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne baÅŸvurun. <string name="Hip Width"> Kalça GeniÅŸliÄŸi </string> + <string name="Hover"> + Ãœzerine getir + </string> <string name="In"> İçeri </string> @@ -5088,4 +5121,7 @@ Düzenleyici yolunu çift tırnakla çevrelemeyi deneyin. <string name="logging_calls_enabled_log_empty"> Günlüğü tutulmuÅŸ sohbet yok. Siz biriyle iletiÅŸime geçtikten sonra veya biri sizinle iletiÅŸime geçtikten sonra, burada bir günlük giriÅŸi gösterilir. </string> + <string name="loading_chat_logs"> + Yükleniyor... + </string> </strings> diff --git a/indra/newview/skins/default/xui/zh/floater_about.xml b/indra/newview/skins/default/xui/zh/floater_about.xml index 643881e416..2dfb35fa54 100755 --- a/indra/newview/skins/default/xui/zh/floater_about.xml +++ b/indra/newview/skins/default/xui/zh/floater_about.xml @@ -8,7 +8,9 @@ 以 [COMPILER_VERSION] 版本 [COMPILER] 建置 </floater.string> <floater.string name="AboutPosition"> - ä½ çš„æ–¹ä½æ˜¯ [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1],地å€å:[REGION],主機:<nolink>[HOSTNAME]</nolink> ([HOSTIP]) + ä½ çš„æ–¹ä½æ˜¯ [POSITION_LOCAL_0,number,1], [POSITION_LOCAL_1,number,1], [POSITION_LOCAL_2,number,1],地å€å:[REGION],主機:<nolink>[HOSTNAME]</nolink> ([HOSTIP]) +第二人生 URL:<nolink>[SLURL]</nolink> +(全域å標:[POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1]) [SERVER_VERSION] [SERVER_RELEASE_NOTES_URL] </floater.string> diff --git a/indra/newview/skins/default/xui/zh/floater_bulk_perms.xml b/indra/newview/skins/default/xui/zh/floater_bulk_perms.xml index 59751a3a46..c103ea938f 100755 --- a/indra/newview/skins/default/xui/zh/floater_bulk_perms.xml +++ b/indra/newview/skins/default/xui/zh/floater_bulk_perms.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="floaterbulkperms" title="編輯內容物權é™"> +<floater name="floaterbulkperms" title="調整內容物權é™"> <floater.string name="nothing_to_modify_text"> é¸æ“‡æœªåŒ…å«å¯ç·¨è¼¯çš„內容物。 </floater.string> @@ -24,7 +24,7 @@ <button label="√ 全部" name="check_all"/> <button label="清除" label_selected="ç„¡" name="check_none"/> <text name="newperms"> - æ–°å…§å®¹ç‰©æ¬Šé™ + 調整內容物權é™ï¼š </text> <text name="GroupLabel"> 群組: @@ -40,6 +40,7 @@ <check_box label="修改" name="next_owner_modify"/> <check_box label="æšåº¨" name="next_owner_copy"/> <check_box initial_value="true" label="轉移" name="next_owner_transfer" tool_tip="下一個所有人å¯è´ˆé€æˆ–轉售這個物件"/> - <button label="確定" name="apply"/> + <button label="確定" name="ok"/> + <button label="套用" name="apply"/> <button label="å–消" name="close"/> </floater> diff --git a/indra/newview/skins/default/xui/zh/floater_goto_line.xml b/indra/newview/skins/default/xui/zh/floater_goto_line.xml new file mode 100644 index 0000000000..e0215aef8a --- /dev/null +++ b/indra/newview/skins/default/xui/zh/floater_goto_line.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater name="script goto" title="å‰å¾€æŸè¡Œæ•¸"> + <button label="確定" label_selected="確定" name="goto_btn"/> + <text name="txt"> + å‰å¾€æŸè¡Œæ•¸ + </text> +</floater> diff --git a/indra/newview/skins/default/xui/zh/floater_im_session.xml b/indra/newview/skins/default/xui/zh/floater_im_session.xml index d63c5507db..864af2e592 100755 --- a/indra/newview/skins/default/xui/zh/floater_im_session.xml +++ b/indra/newview/skins/default/xui/zh/floater_im_session.xml @@ -34,13 +34,11 @@ <layout_panel name="body_panel"> <layout_stack name="im_panels"> <layout_panel name="right_part_holder"> - <panel name="trnsAndChat_panel"> - <layout_stack name="translate_and_chat_stack"> - <layout_panel name="translate_chat_checkbox_lp"> - <check_box label="ç¿»è¯èŠå¤©å…§å®¹" name="translate_chat_checkbox"/> - </layout_panel> - </layout_stack> - </panel> + <layout_stack name="translate_and_chat_stack"> + <layout_panel name="translate_chat_checkbox_lp"> + <check_box label="ç¿»è¯èŠå¤©å…§å®¹" name="translate_chat_checkbox"/> + </layout_panel> + </layout_stack> </layout_panel> </layout_stack> </layout_panel> diff --git a/indra/newview/skins/default/xui/zh/floater_pathfinding_console.xml b/indra/newview/skins/default/xui/zh/floater_pathfinding_console.xml index d0978b8b01..be009b54d8 100755 --- a/indra/newview/skins/default/xui/zh/floater_pathfinding_console.xml +++ b/indra/newview/skins/default/xui/zh/floater_pathfinding_console.xml @@ -71,7 +71,7 @@ <text name="show_label"> 顯示: </text> - <check_box label="測試" name="show_world"/> + <check_box label="世界" name="show_world"/> <check_box label="僅é™å¯ç§»å‹•çš„" name="show_world_movables_only"/> <check_box label="導航網é¢" name="show_navmesh"/> <text name="show_walkability_label"> diff --git a/indra/newview/skins/default/xui/zh/menu_attachment_other.xml b/indra/newview/skins/default/xui/zh/menu_attachment_other.xml index 885c4b9add..41b3409627 100755 --- a/indra/newview/skins/default/xui/zh/menu_attachment_other.xml +++ b/indra/newview/skins/default/xui/zh/menu_attachment_other.xml @@ -11,7 +11,9 @@ <menu_item_call label="å‡çµ" name="Freeze..."/> <menu_item_call label="踢出" name="Eject..."/> <menu_item_call label="æ質除錯" name="Debug..."/> + <menu_item_call label="å‚¾å° XML" name="Dump XML"/> <menu_item_call label="放大" name="Zoom In"/> <menu_item_call label="支付" name="Pay..."/> <menu_item_call label="物件檔案" name="Object Inspect"/> + <menu_item_call label="å°éŽ–ç²’å所有人" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/zh/menu_attachment_self.xml b/indra/newview/skins/default/xui/zh/menu_attachment_self.xml index c14a98c64b..eb1bad0ca2 100755 --- a/indra/newview/skins/default/xui/zh/menu_attachment_self.xml +++ b/indra/newview/skins/default/xui/zh/menu_attachment_self.xml @@ -12,5 +12,7 @@ <menu_item_call label="我的群組" name="Groups..."/> <menu_item_call label="我的個人檔案" name="Profile..."/> <menu_item_call label="æ質除錯" name="Debug..."/> + <menu_item_call label="å‚¾å° XML" name="Dump XML"/> <menu_item_call label="丟棄" name="Drop"/> + <menu_item_call label="å°éŽ–ç²’å所有人" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/zh/menu_avatar_other.xml b/indra/newview/skins/default/xui/zh/menu_avatar_other.xml index 1d02464748..dc035bafa0 100755 --- a/indra/newview/skins/default/xui/zh/menu_avatar_other.xml +++ b/indra/newview/skins/default/xui/zh/menu_avatar_other.xml @@ -11,6 +11,8 @@ <menu_item_call label="å‡çµ" name="Freeze..."/> <menu_item_call label="踢出" name="Eject..."/> <menu_item_call label="æ質除錯" name="Debug..."/> + <menu_item_call label="å‚¾å° XML" name="Dump XML"/> <menu_item_call label="放大" name="Zoom In"/> <menu_item_call label="支付" name="Pay..."/> + <menu_item_call label="å°éŽ–ç²’å所有人" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/zh/menu_avatar_self.xml b/indra/newview/skins/default/xui/zh/menu_avatar_self.xml index 32757bbff6..68d0600141 100755 --- a/indra/newview/skins/default/xui/zh/menu_avatar_self.xml +++ b/indra/newview/skins/default/xui/zh/menu_avatar_self.xml @@ -29,4 +29,6 @@ <menu_item_call label="我的群組" name="Groups..."/> <menu_item_call label="我的個人檔案" name="Profile..."/> <menu_item_call label="æ質除錯" name="Debug..."/> + <menu_item_call label="å‚¾å° XML" name="Dump XML"/> + <menu_item_call label="å°éŽ–ç²’å所有人" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/zh/menu_conversation.xml b/indra/newview/skins/default/xui/zh/menu_conversation.xml index 507255d0c0..adfeefc337 100644 --- a/indra/newview/skins/default/xui/zh/menu_conversation.xml +++ b/indra/newview/skins/default/xui/zh/menu_conversation.xml @@ -3,6 +3,7 @@ <menu_item_call label="關閉交談" name="close_conversation"/> <menu_item_call label="開啟語音交談" name="open_voice_conversation"/> <menu_item_call label="切斷語音交談" name="disconnect_from_voice"/> + <menu_item_call label="關閉所é¸" name="close_selected_conversations"/> <menu_item_call label="察看檔案" name="view_profile"/> <menu_item_call label="IM" name="im"/> <menu_item_call label="發出瞬間傳é€é‚€è«‹" name="offer_teleport"/> diff --git a/indra/newview/skins/default/xui/zh/menu_land.xml b/indra/newview/skins/default/xui/zh/menu_land.xml index a87ab77dd0..3ad9c0ab31 100755 --- a/indra/newview/skins/default/xui/zh/menu_land.xml +++ b/indra/newview/skins/default/xui/zh/menu_land.xml @@ -6,4 +6,5 @@ <menu_item_call label="購買通行權" name="Land Buy Pass"/> <menu_item_call label="å»ºé€ " name="Create"/> <menu_item_call label="編輯地形" name="Edit Terrain"/> + <menu_item_call label="å°éŽ–ç²’å所有人" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/zh/menu_login.xml b/indra/newview/skins/default/xui/zh/menu_login.xml index c327b132a1..1d3d771efb 100755 --- a/indra/newview/skins/default/xui/zh/menu_login.xml +++ b/indra/newview/skins/default/xui/zh/menu_login.xml @@ -18,7 +18,13 @@ <menu_item_call label="顯示 TOS" name="TOS"/> <menu_item_call label="顯示嚴é‡è¨Šæ¯" name="Critical"/> <menu_item_call label="網é 內容浮動視窗除錯測試" name="Web Content Floater Debug Test"/> - <menu label="è¨å®šè¨˜éŒ„細節" name="Set Logging Level"/> + <menu label="è¨å®šè¨˜éŒ„細節" name="Set Logging Level"> + <menu_item_check label="除錯" name="Debug"/> + <menu_item_check label="資訊" name="Info"/> + <menu_item_check label="è¦å‘Š" name="Warning"/> + <menu_item_check label="錯誤" name="Error"/> + <menu_item_check label="ç„¡" name="None"/> + </menu> <menu_item_check label="é¡¯ç¤ºç¶²æ ¼æŒ‘é¸å™¨" name="Show Grid Picker"/> <menu_item_call label="顯示通知控制å°" name="Show Notifications Console"/> </menu> diff --git a/indra/newview/skins/default/xui/zh/menu_mute_particle.xml b/indra/newview/skins/default/xui/zh/menu_mute_particle.xml new file mode 100644 index 0000000000..fbde9b435d --- /dev/null +++ b/indra/newview/skins/default/xui/zh/menu_mute_particle.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<!-- *NOTE: See also menu_attachment_other.xml --> +<context_menu name="Mute Particle Pie"> + <menu_item_call label="å°éŽ–ç²’å所有人" name="Mute Particle"/> +</context_menu> diff --git a/indra/newview/skins/default/xui/zh/menu_object.xml b/indra/newview/skins/default/xui/zh/menu_object.xml index 4282c1e131..f6657d876e 100755 --- a/indra/newview/skins/default/xui/zh/menu_object.xml +++ b/indra/newview/skins/default/xui/zh/menu_object.xml @@ -3,13 +3,13 @@ <menu_item_call label="觸碰" name="Object Touch"/> <menu_item_call label="編輯" name="Edit..."/> <menu_item_call label="å»ºé€ " name="Build"/> - <menu_item_call label="在è¯çµé›†è£¡é¡¯ç¤º" name="show_in_linksets"/> - <menu_item_call label="在角色ä¸é¡¯ç¤º" name="show_in_characters"/> <menu_item_call label="打開" name="Open"/> <menu_item_call label="å在這裡" name="Object Sit"/> <menu_item_call label="èµ·ç«‹" name="Object Stand Up"/> <menu_item_call label="物件檔案" name="Object Inspect"/> <menu_item_call label="放大" name="Zoom In"/> + <menu_item_call label="在è¯çµé›†è£¡é¡¯ç¤º" name="show_in_linksets"/> + <menu_item_call label="在角色ä¸é¡¯ç¤º" name="show_in_characters"/> <context_menu label="穿上" name="Put On"> <menu_item_call label="穿上" name="Wear"/> <menu_item_call label="æ·»åŠ " name="Add"/> @@ -26,4 +26,5 @@ <menu_item_call label="支付" name="Pay..."/> <menu_item_call label="購買" name="Buy..."/> <menu_item_call label="刪除" name="Delete"/> + <menu_item_call label="å°éŽ–ç²’å所有人" name="Mute Particle"/> </context_menu> diff --git a/indra/newview/skins/default/xui/zh/menu_url_agent.xml b/indra/newview/skins/default/xui/zh/menu_url_agent.xml index 72629822d4..752634dc6b 100755 --- a/indra/newview/skins/default/xui/zh/menu_url_agent.xml +++ b/indra/newview/skins/default/xui/zh/menu_url_agent.xml @@ -3,6 +3,7 @@ <menu_item_call label="察看檔案" name="show_agent"/> <menu_item_call label="é€å‡º IM..." name="send_im"/> <menu_item_call label="åŠ ç‚ºæœ‹å‹..." name="add_friend"/> + <menu_item_call label="移除朋å‹â€¦" name="remove_friend"/> <menu_item_call label="覆製å稱到剪貼簿" name="url_copy_label"/> <menu_item_call label="覆製 SLurl 到剪貼簿" name="url_copy"/> </context_menu> diff --git a/indra/newview/skins/default/xui/zh/menu_url_objectim.xml b/indra/newview/skins/default/xui/zh/menu_url_objectim.xml index 9f3a9d58ff..ac366f92ef 100755 --- a/indra/newview/skins/default/xui/zh/menu_url_objectim.xml +++ b/indra/newview/skins/default/xui/zh/menu_url_objectim.xml @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <context_menu name="Url Popup"> <menu_item_call label="物件檔案..." name="show_object"/> + <menu_item_call label="å°éŽ–…" name="block_object"/> <menu_item_call label="顯示在地圖上" name="show_on_map"/> <menu_item_call label="瞬間傳é€åˆ°ç‰©ä»¶ä½ç½®" name="teleport_to_object"/> <menu_item_call label="覆製物件å稱到剪貼簿" name="url_copy_label"/> diff --git a/indra/newview/skins/default/xui/zh/menu_viewer.xml b/indra/newview/skins/default/xui/zh/menu_viewer.xml index d4844b191b..b267bda2bb 100755 --- a/indra/newview/skins/default/xui/zh/menu_viewer.xml +++ b/indra/newview/skins/default/xui/zh/menu_viewer.xml @@ -16,7 +16,10 @@ <menu_item_call label="åœæ¢æˆ‘身上的動作" name="Stop Animating My Avatar"/> <menu_item_call label="行走 / è·‘æ¥ / 飛行…" name="Walk / run / fly"/> </menu> - <menu label="狀態" name="Status"/> + <menu label="狀態" name="Status"> + <menu_item_check label="離開" name="Away"/> + <menu_item_check label="請勿打擾" name="Do Not Disturb"/> + </menu> <menu_item_call label="購買 L$…" name="Buy and Sell L$"/> <menu_item_call label="商家發件匣…" name="MerchantOutbox"/> <menu_item_call label="帳戶主控臺…" name="Manage My Account"/> @@ -30,6 +33,7 @@ <menu_item_check label="交談……" name="Conversations"/> <menu_item_check label="附近的èŠå¤©â€¦â€¦" name="Nearby Chat"/> <menu_item_check label="說話" name="Speak"/> + <menu_item_check label="交談記錄…" name="Conversation Log..."/> <menu label="語音變è²" name="VoiceMorphing"> <menu_item_check label="沒有變è²æ•ˆæžœ" name="NoVoiceMorphing"/> <menu_item_check label="é 覽……" name="Preview"/> @@ -40,6 +44,7 @@ <menu_item_check label="群組" name="My Groups"/> <menu_item_check label="附近的人群" name="Active Speakers"/> <menu_item_call label="å°éŽ–清單" name="Block List"/> + <menu_item_check label="請勿打擾" name="Do Not Disturb"/> </menu> <menu label="世界" name="World"> <menu_item_call label="å°‡æ¤è™•è¨˜ç‚ºåœ°æ¨™" name="Create Landmark Here"/> @@ -108,6 +113,7 @@ <menu_item_call label="包括下一部ä½" name="Include Next Part"/> <menu_item_call label="包括上一部ä½" name="Include Previous Part"/> </menu> + <menu_item_call label="è¯çµé›†â€¦" name="pathfinding_linkset_menu_item"/> <menu_item_call label="èšç„¦æ–¼æ‰€é¸éƒ¨ä½" name="Focus on Selection"/> <menu_item_call label="縮放至所é¸éƒ¨ä½" name="Zoom to Selection"/> <menu label="物件" name="Object"> @@ -277,6 +283,7 @@ <menu_item_check label="隨機變動幀率" name="Randomize Framerate"/> <menu_item_check label="定期出ç¾æ…¢å¹€çŽ‡" name="Periodic Slow Frame"/> <menu_item_check label="ç•«é¢æ¸¬è©¦" name="Frame Test"/> + <menu_item_call label="幀特性" name="Frame Profile"/> </menu> <menu label="呈åƒçš„元資料" name="Render Metadata"> <menu_item_check label="外框箱" name="Bounding Boxes"/> @@ -311,9 +318,10 @@ <menu_item_check label="軸" name="Axes"/> <menu_item_check label="切線基礎" name="Tangent Basis"/> <menu_item_call label="å·²é¸å–æ質資訊基礎" name="Selected Texture Info Basis"/> + <menu_item_call label="所é¸æ料資訊" name="Selected Material Info"/> <menu_item_check label="線框" name="Wireframe"/> <menu_item_check label="物件導å‘çš„é®è”½" name="Object-Object Occlusion"/> - <menu_item_check label="光線和陰影" name="Advanced Lighting Model"/> + <menu_item_check label="進階照明模型" name="Advanced Lighting Model"/> <menu_item_check label="來自日/月/投影物的陰影" name="Shadows from Sun/Moon/Projectors"/> <menu_item_check label="å±å¹•ç©ºé–“環境光é®è”½å’Œé™°å½±å¹³æ»‘技術" name="SSAO and Shadow Smoothing"/> <menu_item_check label="GL 除錯" name="Debug GL"/> @@ -323,7 +331,6 @@ <menu_item_check label="動作æ質" name="Animation Textures"/> <menu_item_check label="關閉æ質" name="Disable Textures"/> <menu_item_check label="全解æžåº¦æ質" name="Rull Res Textures"/> - <menu_item_check label="æ質圖集(實驗性質)" name="Texture Atlas"/> <menu_item_check label="使附著燈光呈åƒ" name="Render Attached Lights"/> <menu_item_check label="使附著例å效果呈åƒ" name="Render Attached Particles"/> <menu_item_check label="åœæ‡¸ç™¼å…‰ç‰©ä»¶" name="Hover Glow Objects"/> @@ -359,7 +366,6 @@ <menu_item_call label="傾å°ç„¦é»žå®¹å™¨" name="Dump Focus Holder"/> <menu_item_call label="列å°æ‰€é¸ç‰©ä»¶è³‡è¨Š" name="Print Selected Object Info"/> <menu_item_call label="列å°ç”¨æˆ¶è³‡è¨Š" name="Print Agent Info"/> - <menu_item_call label="計憶體狀態" name="Memory Stats"/> <menu_item_check label="地å€é™¤éŒ¯æŽ§åˆ¶å°" name="Region Debug Console"/> <menu_item_check label="除錯 SelectMgr" name="Debug SelectMgr"/> <menu_item_check label="除錯點按動作" name="Debug Clicks"/> diff --git a/indra/newview/skins/default/xui/zh/notifications.xml b/indra/newview/skins/default/xui/zh/notifications.xml index 59be26d43b..864f20fc15 100755 --- a/indra/newview/skins/default/xui/zh/notifications.xml +++ b/indra/newview/skins/default/xui/zh/notifications.xml @@ -210,6 +210,14 @@ ä½ ä»è¦æ–°å¢žé€™é …能力給「[ROLE_NAME]ã€ï¼Ÿ <usetemplate name="okcancelbuttons" notext="å¦" yestext="是"/> </notification> + <notification name="EjectGroupMemberWarning"> + ä½ å³å°‡æŠŠ [AVATAR_NAME] 踢出群組。 + <usetemplate ignoretext="確定將æŸäººè¸¢å‡ºç¾¤çµ„" name="okcancelignore" notext="å–消" yestext="踢出"/> + </notification> + <notification name="EjectGroupMembersWarning"> + ä½ å³å°‡æŠŠ [COUNT] 個人踢出群組。 + <usetemplate ignoretext="確定將多人踢出群組" name="okcancelignore" notext="å–消" yestext="踢出"/> + </notification> <notification name="AttachmentDrop"> ä½ å³å°‡å¸é™¤ä½ 的附件。 ä½ ç¢ºå®šä½ è¦ç¹¼çºŒï¼Ÿ @@ -1470,13 +1478,43 @@ SHA1 指紋:[MD5_DIGEST] </notification> <notification name="RequiredUpdateDownloadedVerboseDialog"> 我們已下載了一個必è¦çš„軟體更新。 -版本:[VERSION] +[VERSION] 版本 [[INFO_URL] 關於æ¤æ›´æ–°çš„資訊] æˆ‘é–€å¿…é ˆé‡æ–°å•Ÿå‹• [APP_NAME] 以安è£æ›´æ–°ã€‚ <usetemplate name="okbutton" yestext="確定"/> </notification> <notification name="RequiredUpdateDownloadedDialog"> æˆ‘é–€å¿…é ˆé‡æ–°å•Ÿå‹• [APP_NAME] 以安è£æ›´æ–°ã€‚ +[[INFO_URL] 關於æ¤æ›´æ–°çš„資訊] + <usetemplate name="okbutton" yestext="確定"/> + </notification> + <notification name="OtherChannelDownloadBackgroundTip"> + æˆ‘å€‘å·²ç‚ºä½ çš„ [APP_NAME] 軟體下載了更新。 +版本:[VERSION] +原本試驗性質的ç€è¦½å™¨å·²è¢« [NEW_CHANNEL] ç€è¦½å™¨å–代, +åƒè¦‹[[INFO_URL] æ¤æ›´æ–°ç‰ˆçš„詳情] + <usetemplate name="okcancelbuttons" notext="ç¨å€™..." yestext="ç«‹å³å®‰è£ä¸¦é‡æ–°å•Ÿå‹• [APP_NAME]"/> + </notification> + <notification name="OtherChannelDownloadBackgroundDialog"> + æˆ‘å€‘å·²ç‚ºä½ çš„ [APP_NAME] 軟體下載了更新。 +版本:[VERSION] +原本試驗性質的ç€è¦½å™¨å·²è¢« [NEW_CHANNEL] ç€è¦½å™¨å–代, +åƒè¦‹[[INFO_URL] 介紹æ¤æ›´æ–°ç‰ˆçš„資訊] + <usetemplate name="okcancelbuttons" notext="ç¨å€™â€¦" yestext="ç«‹å³å®‰è£ä¸¦é‡æ–°å•Ÿå‹• [APP_NAME]"/> + </notification> + <notification name="OtherChannelRequiredUpdateDownloadedVerboseDialog"> + 我們已下載了一個必è¦çš„軟體更新。 +版本:[VERSION] +原本試驗性質的ç€è¦½å™¨å·²è¢« [NEW_CHANNEL] ç€è¦½å™¨å–代, +åƒè¦‹[[INFO_URL] 介紹æ¤æ›´æ–°ç‰ˆçš„資訊] + +æˆ‘å€‘å¿…é ˆé‡æ–°å•Ÿå‹• [APP_NAME] 以便安è£æ›´æ–°ã€‚ + <usetemplate name="okbutton" yestext="確定"/> + </notification> + <notification name="OtherChannelRequiredUpdateDownloadedDialog"> + æˆ‘å€‘å¿…é ˆé‡æ–°å•Ÿå‹• [APP_NAME] 以便安è£æ›´æ–°ã€‚ +原本試驗性質的ç€è¦½å™¨å·²è¢« [NEW_CHANNEL] ç€è¦½å™¨å–代, +åƒè¦‹[[INFO_URL] 介紹æ¤æ›´æ–°ç‰ˆçš„資訊] <usetemplate name="okbutton" yestext="確定"/> </notification> <notification name="DeedObjectToGroup"> @@ -1527,6 +1565,10 @@ SHA1 指紋:[MD5_DIGEST] 是å¦è¦é›¢é–‹ç¾¤çµ„? <usetemplate name="okcancelbuttons" notext="å–消" yestext="確定"/> </notification> + <notification name="OwnerCannotLeaveGroup"> + 無法離開群組。 ä½ æ˜¯æ¤ç¾¤çµ„僅å˜çš„所有人,ä¸å¾—離開群組。 請先把所有人è·éŠœæŒ‡æ´¾çµ¦å¦ä¸€äººã€‚ + <usetemplate name="okbutton" yestext="確定"/> + </notification> <notification name="ConfirmKick"> ä½ ç¢ºå®šè¦è¸¢å‡ºé€™ç¶²æ ¼å…§çš„全部居民? <usetemplate name="okcancelbuttons" notext="å–消" yestext="踢出全部居民"/> @@ -2386,9 +2428,7 @@ SHA1 指紋:[MD5_DIGEST] ï¼ˆä½ é‚„å¯ä»¥ç›´æŽ¥æŒ‰å…©ä¸‹é‚£å€‹åœ°æ¨™ï¼Œæˆ–æŒ‰æ»‘é¼ å³éµï¼Œé¸æ“‡ã€Œçž¬é–“傳é€ã€ã€‚) </notification> <notification name="TeleportToPerson"> - è¦è¯çµ¡å¦‚「[NAME]ã€çš„任何一ä½å±…民,請點按「人群ã€æŒ‰éˆ•ï¼Œå¾žæ‰“開的視窗ä¸é¸æ“‡ä¸€ä½å±…民,å†é»žæŒ‰è¦–窗底下的「IMã€ã€‚ - - ï¼ˆä½ é‚„å¯ä»¥å¾žæ¸…單直接按兩下åå—ï¼Œæˆ–æŒ‰æ»‘é¼ å³éµï¼Œé¸æ“‡ã€ŒIMã€ã€‚) + è¦å’ŒæŸäººç§ä¸‹äº¤è«‡ï¼Œè«‹å³éµé»žæŒ‰åŒ–身,å†é»žæŒ‰é¸å–®çš„「IMã€ã€‚ </notification> <notification name="CantSelectLandFromMultipleRegions"> 無法é¸æ“‡è¶…出伺æœå™¨é‚Šç•Œçš„土地。 @@ -2762,6 +2802,15 @@ SHA1 指紋:[MD5_DIGEST] <button name="Deny" text="拒絕"/> </form> </notification> + <notification name="UnknownScriptQuestion"> + ç”± '[NAME]' 所æ“有的物件 '<nolink>[OBJECTNAME]</nolink>' æ£è«‹æ±‚æŸé …執行時期腳本權é™ï¼Œä½†æœ¬ç€è¦½å™¨ç„¡æ³•è¾¨è˜è©²æ¬Šé™ï¼Œæ•…ä¸å…准。 + +欲准許æ¤æ¬Šé™ï¼Œè«‹å¾ž [DOWNLOADURL] 下載並更新為最新版ç€è¦½å™¨ã€‚ + <form name="form"> + <button name="Deny" text="確定"/> + <button name="Mute" text="å°éŽ–"/> + </form> + </notification> <notification name="ScriptDialog"> [NAME] çš„ '<nolink>[TITLE]</nolink>' [MESSAGE] diff --git a/indra/newview/skins/default/xui/zh/panel_people.xml b/indra/newview/skins/default/xui/zh/panel_people.xml index 5f7aca387a..da5918d553 100755 --- a/indra/newview/skins/default/xui/zh/panel_people.xml +++ b/indra/newview/skins/default/xui/zh/panel_people.xml @@ -49,6 +49,9 @@ <menu_button name="plus_btn" tool_tip="åŠ å…¥ç¾¤çµ„/創立新群組"/> <dnd_button name="minus_btn" tool_tip="離開所é¸ç¾¤çµ„"/> </panel> + <text name="groupcount"> + ä½ ç›®å‰å±¬æ–¼ [COUNT] 個群組,å¯å†åŠ å…¥ [REMAINING] 個。 + </text> </panel> <panel label="最近" name="recent_panel"> <panel label="bottom_panel" name="recent_buttons_panel"> diff --git a/indra/newview/skins/default/xui/zh/panel_preferences_chat.xml b/indra/newview/skins/default/xui/zh/panel_preferences_chat.xml index e700e35516..b5cdddc252 100755 --- a/indra/newview/skins/default/xui/zh/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/zh/panel_preferences_chat.xml @@ -1,11 +1,11 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <panel label="æ–‡å—èŠå¤©" name="chat"> - <panel> - <check_box initial_value="true" label="èŠå¤©æ™‚æ’放打å—動作" name="play_typing_animation"/> + <panel name="general_chat_settings"> + <check_box initial_value="true" label="èŠå¤©æ™‚呈ç¾æ‰“å—動作" name="play_typing_animation"/> <check_box label="當我離線時將收到的 IM 訊æ¯éƒµå¯„給我" name="send_im_to_email"/> - <check_box label="åªæœ‰æˆ‘的朋å‹å’Œç¾¤çµ„å¯ä»¥ IM 或與我通話。" name="voice_call_friends_only_check"/> + <check_box label="åªå…許我的朋å‹å’Œç¾¤çµ„與我通話或 IM 給我" name="voice_call_friends_only_check"/> <text name="font_size"> - å—型尺寸: + å—型大å°ï¼š </text> <combo_box name="chat_font_size"> <item label="å°" name="Small" value="0"/> @@ -14,10 +14,7 @@ </combo_box> <check_box label="èŠå¤©æ³¡æ³¡" name="bubble_text_chat"/> </panel> - <panel> - <text name="notifications"> - 通知 - </text> + <panel name="im_notification_settings"> <text name="friend_ims"> æœ‹å‹ IM: </text> @@ -25,8 +22,9 @@ <item label="開啟交談視窗" name="OpenConversationsWindow" value="openconversations"/> <item label="以çªé¡¯å¼è¦–窗顯示訊æ¯" name="PopUpMessage" value="toast"/> <item label="Flash 工具列按鈕" name="FlashToolbarButton" value="flash"/> - <item label="ç„¡" name="None" value="ç„¡"/> + <item label="無動作" name="NoAction" value="noaction"/> </combo_box> + <check_box label="æ’放è²éŸ³" name="play_sound_friend_im"/> <text name="non_friend_ims"> éžæœ‹å‹ IM: </text> @@ -34,8 +32,9 @@ <item label="開啟交談視窗" name="OpenConversationsWindow" value="openconversations"/> <item label="以çªé¡¯å¼è¦–窗顯示訊æ¯" name="PopUpMessage" value="toast"/> <item label="Flash 工具列按鈕" name="FlashToolbarButton" value="flash"/> - <item label="ç„¡" name="None" value="ç„¡"/> + <item label="無動作" name="NoAction" value="noaction"/> </combo_box> + <check_box label="æ’放è²éŸ³" name="play_sound_non_friend_im"/> <text name="conference_ims"> 多方交談 IM: </text> @@ -43,8 +42,9 @@ <item label="開啟交談視窗" name="OpenConversationsWindow" value="openconversations"/> <item label="以çªé¡¯å¼è¦–窗顯示訊æ¯" name="PopUpMessage" value="toast"/> <item label="Flash 工具列按鈕" name="FlashToolbarButton" value="flash"/> - <item label="ç„¡" name="None" value="ç„¡"/> + <item label="無動作" name="NoAction" value="noaction"/> </combo_box> + <check_box label="æ’放è²éŸ³" name="play_sound_conference_im"/> <text name="group_chat"> 群組èŠå¤©ï¼š </text> @@ -52,8 +52,9 @@ <item label="開啟交談視窗" name="OpenConversationsWindow" value="openconversations"/> <item label="以çªé¡¯å¼è¦–窗顯示訊æ¯" name="PopUpMessage" value="toast"/> <item label="Flash 工具列按鈕" name="FlashToolbarButton" value="flash"/> - <item label="ç„¡" name="None" value="ç„¡"/> + <item label="無動作" name="NoAction" value="noaction"/> </combo_box> + <check_box label="æ’放è²éŸ³" name="play_sound_group_chat_im"/> <text name="nearby_chat"> 附近的èŠå¤©ï¼š </text> @@ -61,13 +62,24 @@ <item label="開啟交談視窗" name="OpenConversationsWindow" value="openconversations"/> <item label="以çªé¡¯å¼è¦–窗顯示訊æ¯" name="PopUpMessage" value="toast"/> <item label="Flash 工具列按鈕" name="FlashToolBarButton" value="flash"/> - <item label="ç„¡" name="None" value="ç„¡"/> + <item label="無動作" name="NoAction" value="noaction"/> + </combo_box> + <check_box label="æ’放è²éŸ³" name="play_sound_nearby_chat_im"/> + <text name="object_ims"> + 來自物件的 IM: + </text> + <combo_box name="ObjectIMOptions"> + <item label="開啟交談視窗" name="OpenConversationsWindow" value="openconversations"/> + <item label="以çªé¡¯å¼è¦–窗顯示訊æ¯" name="PopUpMessage" value="toast"/> + <item label="Flash 工具列按鈕" name="FlashToolBarButton" value="flash"/> + <item label="無動作" name="NoAction" value="noaction"/> </combo_box> + <check_box label="æ’放è²éŸ³" name="play_sound_object_im"/> <text name="notifications_alert"> è‹¥è¦æš«æ™‚åœæ¢æ‰€æœ‰é€šçŸ¥ï¼Œè«‹è¨å®šã€Œæºé€š > 請勿打擾ã€ã€‚ </text> </panel> - <panel> + <panel name="play_sound_settings"> <text name="play_sound"> æ’放è²éŸ³ï¼š </text> @@ -76,9 +88,9 @@ <check_box label="瞬間傳é€é‚€è«‹" name="teleport_offer"/> <check_box label="收ç´ç‰©å“è´ˆé€" name="inventory_offer"/> </panel> - <panel> - <button label="清空記錄……" name="clear_log"/> - <button label="刪除交談內容記錄……" name="delete_transcripts"/> + <panel name="log_settings"> + <button label="清空記錄…" name="clear_log"/> + <button label="刪除交談內容記錄…" name="delete_transcripts"/> <button label="ç€è¦½â€¦" label_selected="ç€è¦½" name="log_path_button"/> </panel> <button label="ç¿»è¯â€¦" name="ok_btn"/> diff --git a/indra/newview/skins/default/xui/zh/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/zh/panel_preferences_graphics1.xml index 3948a48992..2311eb99a7 100755 --- a/indra/newview/skins/default/xui/zh/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/zh/panel_preferences_graphics1.xml @@ -30,7 +30,7 @@ <check_box initial_value="true" label="本地光線" name="LocalLights"/> <check_box initial_value="true" label="基本著色" name="BasicShaders" tool_tip="關閉æ¤ä¸€é¸é …å¯èƒ½é¿å…部分顯示å¡é©…動程å¼æ毀當機"/> <check_box initial_value="true" label="大氣著色" name="WindLightUseAtmosShaders"/> - <check_box initial_value="true" label="光線和陰影" name="UseLightShaders"/> + <check_box initial_value="true" label="進階照明模型" name="UseLightShaders"/> <check_box initial_value="true" label="環境光é®è”½" name="UseSSAO"/> <check_box initial_value="true" label="景深" name="UseDoF"/> <text name="shadows_label"> diff --git a/indra/newview/skins/default/xui/zh/panel_preferences_setup.xml b/indra/newview/skins/default/xui/zh/panel_preferences_setup.xml index a607a7c33b..0fcc49b203 100755 --- a/indra/newview/skins/default/xui/zh/panel_preferences_setup.xml +++ b/indra/newview/skins/default/xui/zh/panel_preferences_setup.xml @@ -29,6 +29,7 @@ <combo_box.item label="自動安è£" name="Install_automatically"/> <combo_box.item label="手動下載åŠå®‰è£" name="Install_manual"/> </combo_box> + <check_box label="願æ„在更新時æ¶å…ˆè©¦ç”¨é‡‹å‡ºå€™é¸ç‰ˆ" name="update_willing_to_test"/> <text name="Proxy Settings:"> 代ç†ä¼ºæœå™¨è¨å®šï¼š </text> diff --git a/indra/newview/skins/default/xui/zh/panel_script_ed.xml b/indra/newview/skins/default/xui/zh/panel_script_ed.xml index 29e9a35869..198e59be7b 100755 --- a/indra/newview/skins/default/xui/zh/panel_script_ed.xml +++ b/indra/newview/skins/default/xui/zh/panel_script_ed.xml @@ -34,6 +34,7 @@ <menu_item_call label="å…¨é¸" name="Select All"/> <menu_item_call label="å–消é¸æ“‡" name="Deselect"/> <menu_item_call label="æœå°‹ / å–代..." name="Search / Replace..."/> + <menu_item_call label="å‰å¾€æŸè¡Œæ•¸â€¦" name="Go to line..."/> </menu> <menu label="幫助" name="Help"> <menu_item_call label="幫助..." name="Help..."/> diff --git a/indra/newview/skins/default/xui/zh/panel_tools_texture.xml b/indra/newview/skins/default/xui/zh/panel_tools_texture.xml new file mode 100644 index 0000000000..5ea6d818c7 --- /dev/null +++ b/indra/newview/skins/default/xui/zh/panel_tools_texture.xml @@ -0,0 +1,116 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<panel label="æ質" name="Texture"> + <panel.string name="string repeats per meter"> + æ¯å…¬å°ºé‡è¦†æ¬¡æ•¸ + </panel.string> + <panel.string name="string repeats per face"> + æ¯ä¸€é¢é‡è¦†æ¬¡æ•¸ + </panel.string> + <text name="color label"> + é¡è‰² + </text> + <color_swatch label="" name="colorswatch" tool_tip="點按以開啟é¡è‰²æŒ‘é¸å™¨"/> + <text name="color trans"> + é€æ˜Žåº¦ % + </text> + <text name="glow label"> + 光暈 + </text> + <check_box label="全亮" name="checkbox fullbright"/> + <combo_box name="combobox matmedia"> + <combo_box.item label="ææ–™" name="Materials"/> + <combo_box.item label="媒體" name="Media"/> + </combo_box> + <combo_box name="combobox mattype"> + <combo_box.item label="æ質(漫å射圖)" name="Texture (diffuse)"/> + <combo_box.item label="凹凸度(æ£äº¤ï¼‰" name="Bumpiness (normal)"/> + <combo_box.item label="閃亮度(é¡å光)" name="Shininess (specular)"/> + </combo_box> + <texture_picker label="æ質" name="texture control" tool_tip="點按以挑é¸åœ–片"/> + <text name="label alphamode"> + åŠé€æ˜Žæ¨¡å¼ + </text> + <combo_box name="combobox alphamode"> + <combo_box.item label="ç„¡" name="None"/> + <combo_box.item label="åŠé€æ˜Žæ”™æ··" name="Alpha blending"/> + <combo_box.item label="åŠé€æ˜Žé®ç½©" name="Alpha masking"/> + <combo_box.item label="自發光é®ç½©" name="Emissive mask"/> + </combo_box> + <text name="label maskcutoff"> + é®ç½©æˆªæ–·å€¼ + </text> + <texture_picker label="æ質" name="bumpytexture control" tool_tip="點按以挑é¸åœ–片"/> + <text name="label bumpiness"> + 凹凸度 + </text> + <combo_box name="combobox bumpiness"> + <combo_box.item label="ç„¡" name="None"/> + <combo_box.item label="亮度" name="Brightness"/> + <combo_box.item label="暗度" name="Darkness"/> + <combo_box.item label="木紋" name="woodgrain"/> + <combo_box.item label="樹皮" name="bark"/> + <combo_box.item label="磚" name="bricks"/> + <combo_box.item label="æ ¼å" name="checker"/> + <combo_box.item label="æ··å‡åœŸ" name="concrete"/> + <combo_box.item label="粗花磚" name="crustytile"/> + <combo_box.item label="石磚" name="cutstone"/> + <combo_box.item label="圓盤" name="discs"/> + <combo_box.item label="碎石" name="gravel"/> + <combo_box.item label="培養皿" name="petridish"/> + <combo_box.item label="å´é‚Šç‰‡" name="siding"/> + <combo_box.item label="çŸ³ç£šæ ¼" name="stonetile"/> + <combo_box.item label="彩色沙岩" name="stucco"/> + <combo_box.item label="å¸é™„" name="suction"/> + <combo_box.item label="編織" name="weave"/> + </combo_box> + <texture_picker label="æ質" name="shinytexture control" tool_tip="點按以挑é¸åœ–片"/> + <text name="label shininess"> + 閃亮度 + </text> + <combo_box name="combobox shininess"> + <combo_box.item label="ç„¡" name="None"/> + <combo_box.item label="低" name="Low"/> + <combo_box.item label="ä¸" name="Medium"/> + <combo_box.item label="高" name="High"/> + </combo_box> + <text name="label glossiness"> + 光滑度 + </text> + <text name="label environment"> + 環境 + </text> + <text name="label shinycolor"> + é¡è‰² + </text> + <color_swatch label="" name="shinycolorswatch" tool_tip="點按以開啟é¡è‰²æŒ‘é¸å™¨"/> + <text name="media_info"> + 所é¸åª’體如有 URLï¼Œç½®æ–¼æ¤ + </text> + <button label="é¸æ“‡â€¦" name="add_media" tool_tip="æ·»åŠ åª’é«”"/> + <button label="移除" name="delete_media" tool_tip="刪除這個媒體æ質"/> + <button label="å°é½Š" label_selected="å°é½Šåª’é«”" name="button align" tool_tip="å°é½Šåª’é«”æè³ªï¼ˆé ˆå…ˆè¼‰å…¥ï¼‰"/> + <text name="tex gen"> + æ˜ å°„æ–¹å¼ + </text> + <combo_box name="combobox texgen"> + <combo_box.item label="é è¨" name="Default"/> + <combo_box.item label="å¹³é¢" name="Planar"/> + </combo_box> + <spinner label="水平刻度" name="TexScaleU"/> + <spinner label="垂直刻度" name="TexScaleV"/> + <spinner label="æ¯å…¬å°ºé‡è¦†æ¬¡æ•¸" name="rptctrl"/> + <spinner label="旋轉角度" name="TexRot"/> + <spinner label="æ°´å¹³åè·" name="TexOffsetU"/> + <spinner label="åž‚ç›´åè·" name="TexOffsetV"/> + <spinner label="水平刻度" name="bumpyScaleU"/> + <spinner label="垂直刻度" name="bumpyScaleV"/> + <spinner label="旋轉角度" name="bumpyRot"/> + <spinner label="æ°´å¹³åè·" name="bumpyOffsetU"/> + <spinner label="åž‚ç›´åè·" name="bumpyOffsetV"/> + <spinner label="水平刻度" name="shinyScaleU"/> + <spinner label="垂直刻度" name="shinyScaleV"/> + <spinner label="旋轉角度" name="shinyRot"/> + <spinner label="æ°´å¹³åè·" name="shinyOffsetU"/> + <spinner label="åž‚ç›´åè·" name="shinyOffsetV"/> + <check_box initial_value="false" label="å°é½Šå¹³é¢" name="checkbox planar align" tool_tip="以最後所é¸æ“‡çš„é¢ç‚ºåŸºæº–,å°é½Šå…¨éƒ¨æ‰€é¸æ“‡çš„é¢ä¸Šçš„æ質。 é€™å¿…é ˆä½¿ç”¨å¹³é¢æè³ªæ˜ å°„æ–¹å¼ã€‚"/> +</panel> diff --git a/indra/newview/skins/default/xui/zh/role_actions.xml b/indra/newview/skins/default/xui/zh/role_actions.xml index 767bcecde7..9587981444 100755 --- a/indra/newview/skins/default/xui/zh/role_actions.xml +++ b/indra/newview/skins/default/xui/zh/role_actions.xml @@ -25,7 +25,7 @@ </action_set> <action_set description="這些能力包括å¯æ›´æ”¹åœ°æ®µå稱和發佈è¨å®šã€è¨å®šæ˜¯å¦å…¬é–‹åˆ°æœå°‹çµæžœã€è¨å®šç™»é™¸åœ°é»žå’Œçž¬é–“傳é€ç¹žè·¯é¸é …。" name="Parcel Identity"> <action description="切æ›ã€Œå°‡åœ°é»žé¡¯ç¤ºåœ¨æœå°‹çµæžœã€è¨å®šï¼Œä¸¦é¸å®šé¡žåˆ¥" longdescription="切æ›ã€Œå°‡åœ°é»žé¡¯ç¤ºåœ¨æœå°‹çµæžœã€è¨å®šï¼Œä¸¦åœ¨ã€ŒåœŸåœ°è³‡æ–™ã€> é¸é …é 籤è¨å®šåœ°æ®µé¡žåˆ¥ã€‚" name="land find places" value="17"/> - <action description="更改地段å稱ã€æ述,和「將地點顯示在æœå°‹çµæžœã€è¨å®šã€‚" longdescription="更改地段å稱ã€æ述,和「將地點顯示在æœå°‹çµæžœã€è¨å®šã€‚ 這å¯åœ¨ã€ŒåœŸåœ°è³‡æ–™ã€> é¸é …é 籤完æˆã€‚" name="land change identity" value="18"/> + <action description="更改地段å稱ã€æè¿°ã€ã€Œé©åº¦æˆäººå…§å®¹ã€è¨å®š" longdescription="更改地段å稱ã€æè¿°ã€ã€Œé©åº¦æˆäººå…§å®¹ã€è¨å®šã€‚ 這å¯åœ¨ã€ŒåœŸåœ°è³‡æ–™ã€> é¸é …é 籤完æˆã€‚" name="land change identity" value="18"/> <action description="è¨å®šç™»é™¸åœ°é»žå’Œçž¬é–“傳é€ç¹žè·¯è¨å®šã€‚" longdescription="åœ¨ç¾¤çµ„æ‰€æœ‰çš„åœ°æ®µä¸Šï¼Œèº«è² å…·æ¤èƒ½åŠ›çš„æˆå“¡ï¼Œå¯ä»¥è¨å®šäººå€‘瞬間傳é€é€²ä¾†æ™‚的登陸地點,和瞬間傳é€çš„繞路é¸é …。 這å¯åœ¨ã€ŒåœŸåœ°è³‡æ–™ã€> é¸é …é 籤完æˆã€‚" name="land set landing point" value="19"/> </action_set> <action_set description="這些能力包括有權更改地段é¸é …,例如「新建物件ã€ã€ã€Œç·¨è¼¯åœ°å½¢ã€ï¼Œå’ŒéŸ³æ¨‚ã€åª’é«”è¨å®šç‰ã€‚" name="Parcel Settings"> diff --git a/indra/newview/skins/default/xui/zh/strings.xml b/indra/newview/skins/default/xui/zh/strings.xml index 31713ac281..d9fa105ef4 100755 --- a/indra/newview/skins/default/xui/zh/strings.xml +++ b/indra/newview/skins/default/xui/zh/strings.xml @@ -139,6 +139,9 @@ <string name="create_account_url"> http://join.secondlife.com/?sourceid=[sourceid] </string> + <string name="ViewerDownloadURL"> + http://secondlife.com/download + </string> <string name="LoginFailedViewerNotPermitted"> ä½ ç›®å‰æ‰€ç”¨çš„ Viewer 已經無法å†é€²å…¥ç¬¬äºŒäººç”Ÿã€‚ 請到這個é é¢ä¸‹è¼‰æœ€æ–° Viewer: http://secondlife.com/download @@ -443,6 +446,9 @@ http://secondlife.com/viewer-access-faq <string name="SLappAgentRequestFriend"> 交å‹è¦æ±‚ </string> + <string name="SLappAgentRemoveFriend"> + ç§»é™¤æœ‹å‹ + </string> <string name="BUTTON_CLOSE_DARWIN"> 關閉(⌘W) </string> @@ -830,6 +836,9 @@ http://secondlife.com/viewer-access-faq <string name="multiple_textures"> 多個 </string> + <string name="use_texture"> + 使用æ質 + </string> <string name="texture_loading"> 載入ä¸... </string> @@ -929,6 +938,21 @@ http://secondlife.com/viewer-access-faq <string name="TeleportYourAgent"> 瞬間傳é€ä½ 本人 </string> + <string name="JoinAnExperience"> + åŠ å…¥é«”é©— + </string> + <string name="SilentlyManageEstateAccess"> + 管ç†é ˜å‡ºå…¥è¨±å¯å單時,ä¸é¡¯ç¤ºè¦ç¤º + </string> + <string name="OverrideYourAnimations"> + 替æ›ä½ é è¨çš„動作 + </string> + <string name="ScriptReturnObjects"> + ç‚ºä½ é€è¿”物件 + </string> + <string name="UnknownScriptPermission"> + ï¼ˆæœªçŸ¥ï¼‰ï¼ + </string> <string name="SIM_ACCESS_PG"> 一般普級 </string> @@ -1960,6 +1984,12 @@ http://secondlife.com/viewer-access-faq <string name="ATTACH_HUD_BOTTOM_RIGHT"> æ“¡é 顯示å³ä¸‹ </string> + <string name="ATTACH_NECK"> + é ¸éƒ¨ + </string> + <string name="ATTACH_AVATAR_CENTER"> + 化身ä¸å¿ƒ + </string> <string name="CursorPos"> æ©«è¡Œ [LINE],縱列 [COLUMN] </string> @@ -2989,6 +3019,9 @@ http://secondlife.com/viewer-access-faq <string name="Hip Width"> 腰寬 </string> + <string name="Hover"> + åœæ‡¸ + </string> <string name="In"> å‘å…§ </string> @@ -5085,4 +5118,7 @@ http://secondlife.com/viewer-access-faq <string name="logging_calls_enabled_log_empty"> ç›®å‰æ²’有交談記錄。 åœ¨ä½ è¯çµ¡æŸäººæˆ–æŸäººè¯çµ¡ä½ 之後,這裡將留å˜è¨˜éŒ„。 </string> + <string name="loading_chat_logs"> + 載入ä¸â€¦ + </string> </strings> diff --git a/indra/newview/tests/llagentaccess_test.cpp b/indra/newview/tests/llagentaccess_test.cpp index 3ba25f3c10..45ce1ba62f 100755 --- a/indra/newview/tests/llagentaccess_test.cpp +++ b/indra/newview/tests/llagentaccess_test.cpp @@ -40,7 +40,7 @@ static U32 test_preferred_maturity = SIM_ACCESS_PG; LLControlGroup::LLControlGroup(const std::string& name) - : LLInstanceTracker<LLControlGroup, std::string>(name) +: LLInstanceTracker<LLControlGroup, std::string>(name) { } @@ -49,10 +49,10 @@ LLControlGroup::~LLControlGroup() } // Implementation of just the LLControlGroup methods we requre -BOOL LLControlGroup::declareU32(const std::string& name, U32 initial_val, const std::string& comment, BOOL persist) +LLControlVariable* LLControlGroup::declareU32(const std::string& name, U32 initial_val, const std::string& comment, LLControlVariable::ePersist persist) { test_preferred_maturity = initial_val; - return true; + return NULL; } void LLControlGroup::setU32(const std::string& name, U32 val) @@ -80,7 +80,7 @@ namespace tut void agentaccess_object_t::test<1>() { LLControlGroup cgr("test"); - cgr.declareU32("PreferredMaturity", SIM_ACCESS_PG, "declared_for_test", FALSE); + cgr.declareU32("PreferredMaturity", SIM_ACCESS_PG, "declared_for_test", LLControlVariable::PERSIST_NO); LLAgentAccess aa(cgr); cgr.setU32("PreferredMaturity", SIM_ACCESS_PG); @@ -109,7 +109,7 @@ namespace tut void agentaccess_object_t::test<2>() { LLControlGroup cgr("test"); - cgr.declareU32("PreferredMaturity", SIM_ACCESS_PG, "declared_for_test", FALSE); + cgr.declareU32("PreferredMaturity", SIM_ACCESS_PG, "declared_for_test", LLControlVariable::PERSIST_NO); LLAgentAccess aa(cgr); // make sure default is PG @@ -157,7 +157,7 @@ namespace tut void agentaccess_object_t::test<3>() { LLControlGroup cgr("test"); - cgr.declareU32("PreferredMaturity", SIM_ACCESS_PG, "declared_for_test", FALSE); + cgr.declareU32("PreferredMaturity", SIM_ACCESS_PG, "declared_for_test", LLControlVariable::PERSIST_NO); LLAgentAccess aa(cgr); #ifndef HACKED_GODLIKE_VIEWER @@ -195,7 +195,7 @@ namespace tut void agentaccess_object_t::test<4>() { LLControlGroup cgr("test"); - cgr.declareU32("PreferredMaturity", SIM_ACCESS_PG, "declared_for_test", FALSE); + cgr.declareU32("PreferredMaturity", SIM_ACCESS_PG, "declared_for_test", LLControlVariable::PERSIST_NO); LLAgentAccess aa(cgr); #ifndef HACKED_GODLIKE_VIEWER @@ -272,7 +272,7 @@ namespace tut void agentaccess_object_t::test<5>() { LLControlGroup cgr("test"); - cgr.declareU32("PreferredMaturity", SIM_ACCESS_PG, "declared_for_test", FALSE); + cgr.declareU32("PreferredMaturity", SIM_ACCESS_PG, "declared_for_test", LLControlVariable::PERSIST_NO); LLAgentAccess aa(cgr); cgr.setU32("PreferredMaturity", SIM_ACCESS_ADULT); diff --git a/indra/newview/tests/lllogininstance_test.cpp b/indra/newview/tests/lllogininstance_test.cpp index f038112fd0..adeb848e03 100755 --- a/indra/newview/tests/lllogininstance_test.cpp +++ b/indra/newview/tests/lllogininstance_test.cpp @@ -135,6 +135,7 @@ void LLGridManager::addSystemGrid(const std::string& label, const std::string& login, const std::string& helper, const std::string& login_page, + const std::string& update_url_base, const std::string& login_id) { } @@ -175,8 +176,8 @@ F32 LLControlGroup::getF32(const std::string& name) { return 0.0f; } U32 LLControlGroup::saveToFile(const std::string& filename, BOOL nondefault_only) { return 1; } void LLControlGroup::setString(const std::string& name, const std::string& val) {} std::string LLControlGroup::getString(const std::string& name) { return "test_string"; } -BOOL LLControlGroup::declareBOOL(const std::string& name, BOOL initial_val, const std::string& comment, BOOL persist) { return TRUE; } -BOOL LLControlGroup::declareString(const std::string& name, const std::string &initial_val, const std::string& comment, BOOL persist) { return TRUE; } +LLControlVariable* LLControlGroup::declareBOOL(const std::string& name, BOOL initial_val, const std::string& comment, LLControlVariable::ePersist persist) { return NULL; } +LLControlVariable* LLControlGroup::declareString(const std::string& name, const std::string &initial_val, const std::string& comment, LLControlVariable::ePersist persist) { return NULL; } #include "lluicolortable.h" void LLUIColorTable::saveUserSettings(void)const {} @@ -208,9 +209,7 @@ std::string const & LLUpdaterService::pumpName(void) return wakka; } bool LLUpdaterService::updateReadyToInstall(void) { return false; } -void LLUpdaterService::initialize(const std::string& url, - const std::string& path, - const std::string& channel, +void LLUpdaterService::initialize(const std::string& channel, const std::string& version, const std::string& platform, const std::string& platform_version, @@ -344,13 +343,13 @@ namespace tut gTOSReplyPump = 0; // clear the callback. - gSavedSettings.declareBOOL("NoInventoryLibrary", FALSE, "", FALSE); - gSavedSettings.declareBOOL("ConnectAsGod", FALSE, "", FALSE); - gSavedSettings.declareBOOL("UseDebugMenus", FALSE, "", FALSE); - gSavedSettings.declareBOOL("ForceMandatoryUpdate", FALSE, "", FALSE); - gSavedSettings.declareString("ClientSettingsFile", "test_settings.xml", "", FALSE); - gSavedSettings.declareString("NextLoginLocation", "", "", FALSE); - gSavedSettings.declareBOOL("LoginLastLocation", FALSE, "", FALSE); + gSavedSettings.declareBOOL("NoInventoryLibrary", FALSE, "", LLControlVariable::PERSIST_NO); + gSavedSettings.declareBOOL("ConnectAsGod", FALSE, "", LLControlVariable::PERSIST_NO); + gSavedSettings.declareBOOL("UseDebugMenus", FALSE, "", LLControlVariable::PERSIST_NO); + gSavedSettings.declareBOOL("ForceMandatoryUpdate", FALSE, "", LLControlVariable::PERSIST_NO); + gSavedSettings.declareString("ClientSettingsFile", "test_settings.xml", "", LLControlVariable::PERSIST_NO); + gSavedSettings.declareString("NextLoginLocation", "", "", LLControlVariable::PERSIST_NO); + gSavedSettings.declareBOOL("LoginLastLocation", FALSE, "", LLControlVariable::PERSIST_NO); LLSD authenticator = LLSD::emptyMap(); LLSD identifier = LLSD::emptyMap(); diff --git a/indra/newview/tests/llsecapi_test.cpp b/indra/newview/tests/llsecapi_test.cpp index 703603e2db..d7e87ed52e 100755 --- a/indra/newview/tests/llsecapi_test.cpp +++ b/indra/newview/tests/llsecapi_test.cpp @@ -39,10 +39,10 @@ LLControlGroup::LLControlGroup(const std::string& name) : LLInstanceTracker<LLControlGroup, std::string>(name) {} LLControlGroup::~LLControlGroup() {} -BOOL LLControlGroup::declareString(const std::string& name, +LLControlVariable* LLControlGroup::declareString(const std::string& name, const std::string& initial_val, const std::string& comment, - BOOL persist) {return TRUE;} + LLControlVariable::ePersist persist) {return NULL;} void LLControlGroup::setString(const std::string& name, const std::string& val){} std::string LLControlGroup::getString(const std::string& name) { diff --git a/indra/newview/tests/llsechandler_basic_test.cpp b/indra/newview/tests/llsechandler_basic_test.cpp index 0235400976..2a8dc15346 100755 --- a/indra/newview/tests/llsechandler_basic_test.cpp +++ b/indra/newview/tests/llsechandler_basic_test.cpp @@ -71,10 +71,10 @@ std::string gLastName; LLControlGroup::LLControlGroup(const std::string& name) : LLInstanceTracker<LLControlGroup, std::string>(name) {} LLControlGroup::~LLControlGroup() {} -BOOL LLControlGroup::declareString(const std::string& name, +LLControlVariable* LLControlGroup::declareString(const std::string& name, const std::string& initial_val, const std::string& comment, - BOOL persist) {return TRUE;} + LLControlVariable::ePersist persist) {return NULL;} void LLControlGroup::setString(const std::string& name, const std::string& val){} std::string LLControlGroup::getString(const std::string& name) { diff --git a/indra/newview/tests/llslurl_test.cpp b/indra/newview/tests/llslurl_test.cpp index 09343ef227..86229ad636 100755 --- a/indra/newview/tests/llslurl_test.cpp +++ b/indra/newview/tests/llslurl_test.cpp @@ -37,10 +37,10 @@ LLControlGroup::LLControlGroup(const std::string& name) : LLInstanceTracker<LLControlGroup, std::string>(name) {} LLControlGroup::~LLControlGroup() {} -BOOL LLControlGroup::declareString(const std::string& name, +LLControlVariable* LLControlGroup::declareString(const std::string& name, const std::string& initial_val, const std::string& comment, - BOOL persist) {return TRUE;} + LLControlVariable::ePersist persist) {return NULL;} void LLControlGroup::setString(const std::string& name, const std::string& val){} std::string gCmdLineLoginURI; diff --git a/indra/newview/tests/llviewerhelputil_test.cpp b/indra/newview/tests/llviewerhelputil_test.cpp index 710881d811..f6456a2839 100755 --- a/indra/newview/tests/llviewerhelputil_test.cpp +++ b/indra/newview/tests/llviewerhelputil_test.cpp @@ -49,10 +49,10 @@ static std::string gOS; LLControlGroup::LLControlGroup(const std::string& name) : LLInstanceTracker<LLControlGroup, std::string>(name) {} LLControlGroup::~LLControlGroup() {} -BOOL LLControlGroup::declareString(const std::string& name, +LLControlVariable* LLControlGroup::declareString(const std::string& name, const std::string& initial_val, const std::string& comment, - BOOL persist) {return TRUE;} + LLControlVariable::ePersist persist) {return NULL;} void LLControlGroup::setString(const std::string& name, const std::string& val){} std::string LLControlGroup::getString(const std::string& name) { diff --git a/indra/newview/tests/llviewernetwork_test.cpp b/indra/newview/tests/llviewernetwork_test.cpp index a1e97ea17e..7ad7947ca4 100755 --- a/indra/newview/tests/llviewernetwork_test.cpp +++ b/indra/newview/tests/llviewernetwork_test.cpp @@ -37,10 +37,10 @@ LLControlGroup::LLControlGroup(const std::string& name) : LLInstanceTracker<LLControlGroup, std::string>(name) {} LLControlGroup::~LLControlGroup() {} -BOOL LLControlGroup::declareString(const std::string& name, +LLControlVariable* LLControlGroup::declareString(const std::string& name, const std::string& initial_val, const std::string& comment, - BOOL persist) {return TRUE;} + LLControlVariable::ePersist persist) {return NULL;} void LLControlGroup::setString(const std::string& name, const std::string& val){} std::string gCmdLineLoginURI; @@ -127,6 +127,7 @@ const char *gSampleGridFile = " <array>" " <string>myloginuri</string>" " </array>" + " <key>update_query_url_base</key><string>https://update.secondlife.com/update</string>" " <key>keyname</key><string>util.foobar.lindenlab.com</string>" " </map>" " </map>" @@ -185,6 +186,9 @@ namespace tut ensure_equals("id for agni", std::string("Agni"), LLGridManager::getInstance()->getGridId("util.agni.lindenlab.com")); + ensure_equals("update url base for Agni", // relies on agni being the default + std::string("https://update.secondlife.com/update"), + LLGridManager::getInstance()->getUpdateServiceURL()); ensure_equals("label for agni", LLGridManager::getInstance()->getGridLabel("util.agni.lindenlab.com"), std::string("Second Life Main Grid (Agni)")); @@ -256,6 +260,9 @@ namespace tut ensure_equals("id for agni", LLGridManager::getInstance()->getGridId("util.agni.lindenlab.com"), std::string("Agni")); + ensure_equals("update url base for Agni", // relies on agni being the default + std::string("https://update.secondlife.com/update"), + LLGridManager::getInstance()->getUpdateServiceURL()); ensure_equals("label for agni", LLGridManager::getInstance()->getGridLabel("util.agni.lindenlab.com"), std::string("Second Life Main Grid (Agni)")); @@ -384,6 +391,9 @@ namespace tut ensure_equals("getLoginPage", LLGridManager::getInstance()->getLoginPage(), std::string("http://viewer-login.agni.lindenlab.com/")); + ensure_equals("update url base for Agni", // relies on agni being the default + std::string("https://update.secondlife.com/update"), + LLGridManager::getInstance()->getUpdateServiceURL()); ensure("Is Agni a production grid", LLGridManager::getInstance()->isInProductionGrid()); std::vector<std::string> uris; LLGridManager::getInstance()->getLoginURIs(uris); diff --git a/indra/newview/tests/llxmlrpclistener_test.cpp b/indra/newview/tests/llxmlrpclistener_test.cpp index 711c2a3d51..20f913b670 100755 --- a/indra/newview/tests/llxmlrpclistener_test.cpp +++ b/indra/newview/tests/llxmlrpclistener_test.cpp @@ -62,8 +62,8 @@ namespace tut // These variables are required by machinery used by // LLXMLRPCTransaction. The values reflect reality for this test // executable; hopefully these values are correct. - gSavedSettings.declareBOOL("BrowserProxyEnabled", FALSE, "", FALSE); // don't persist - gSavedSettings.declareBOOL("NoVerifySSLCert", TRUE, "", FALSE); // don't persist + gSavedSettings.declareBOOL("BrowserProxyEnabled", FALSE, "", LLControlVariable::PERSIST_NO); // don't persist + gSavedSettings.declareBOOL("NoVerifySSLCert", TRUE, "", LLControlVariable::PERSIST_NO); // don't persist } // LLEventPump listener signature diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 35451c9621..19863dd845 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -34,9 +34,15 @@ import tarfile import time import random viewer_dir = os.path.dirname(__file__) -# add llmanifest library to our path so we don't have to muck with PYTHONPATH -sys.path.append(os.path.join(viewer_dir, '../lib/python/indra/util')) -from llmanifest import LLManifest, main, proper_windows_path, path_ancestors +# Add indra/lib/python to our path so we don't have to muck with PYTHONPATH. +# Put it FIRST because some of our build hosts have an ancient install of +# indra.util.llmanifest under their system Python! +sys.path.insert(0, os.path.join(viewer_dir, os.pardir, "lib", "python")) +from indra.util.llmanifest import LLManifest, main, proper_windows_path, path_ancestors +try: + from llbase import llsd +except ImportError: + from indra.base import llsd class ViewerManifest(LLManifest): def is_packaging_viewer(self): @@ -65,13 +71,13 @@ class ViewerManifest(LLManifest): # include the entire shaders directory recursively self.path("shaders") # include the extracted list of contributors - contributor_names = self.extract_names("../../doc/contributions.txt") - self.put_in_file(contributor_names, "contributors.txt") - self.file_list.append(["../../doc/contributions.txt",self.dst_path_of("contributors.txt")]) + contributions_path = "../../doc/contributions.txt" + contributor_names = self.extract_names(contributions_path) + self.put_in_file(contributor_names, "contributors.txt", src=contributions_path) # include the extracted list of translators - translator_names = self.extract_names("../../doc/translations.txt") - self.put_in_file(translator_names, "translators.txt") - self.file_list.append(["../../doc/translations.txt",self.dst_path_of("translators.txt")]) + translations_path = "../../doc/translations.txt" + translator_names = self.extract_names(translations_path) + self.put_in_file(translator_names, "translators.txt", src=translations_path) # include the list of Lindens (if any) # see https://wiki.lindenlab.com/wiki/Generated_Linden_Credits linden_names_path = os.getenv("LINDEN_CREDITS") @@ -85,10 +91,9 @@ class ViewerManifest(LLManifest): else: # all names should be one line, but the join below also converts to a string linden_names = ', '.join(linden_file.readlines()) - self.put_in_file(linden_names, "lindens.txt") + self.put_in_file(linden_names, "lindens.txt", src=linden_names_path) linden_file.close() print "Linden names extracted from '%s'" % linden_names_path - self.file_list.append([linden_names_path,self.dst_path_of("lindens.txt")]) # ... and the entire windlight directory self.path("windlight") @@ -99,6 +104,27 @@ class ViewerManifest(LLManifest): self.path("dictionaries") self.end_prefix(pkgdir) + # CHOP-955: If we have "sourceid" in the build process + # environment, generate it into settings_install.xml. + try: + sourceid = os.environ["sourceid"] + except KeyError: + # no sourceid, no settings_install.xml file + pass + else: + if sourceid: + # Single-entry subset of the LLSD content of settings.xml + content = dict(sourceid=dict(Comment='Identify referring agency to Linden web servers', + Persist=1, + Type='String', + Value=sourceid)) + # put_in_file(src=) need not be an actual pathname; it + # only needs to be non-empty + settings_install = self.put_in_file(llsd.format_pretty_xml(content), + "settings_install.xml", + src="environment") + print "Put sourceid '%s' in %s" % (sourceid, settings_install) + self.end_prefix("app_settings") if self.prefix(src="character"): @@ -172,7 +198,7 @@ class ViewerManifest(LLManifest): def app_name(self): app_suffix='Test' channel_type=self.channel_lowerword() - if channel_type == 'release' : + if channel_type.startswith('release') : app_suffix='Viewer' elif re.match('^(beta|project).*',channel_type) : app_suffix=self.channel_unique() @@ -182,8 +208,8 @@ class ViewerManifest(LLManifest): icon_path="icons/" channel_type=self.channel_lowerword() print "Icon channel type '%s'" % channel_type - if channel_type == 'release' : - icon_path += channel_type + if channel_type.startswith('release') : + icon_path += 'release' elif re.match('^beta.*',channel_type) : icon_path += 'beta' elif re.match('^project.*',channel_type) : @@ -196,24 +222,26 @@ class ViewerManifest(LLManifest): """ Convenience function that returns the command-line flags for the grid""" - # Set command line flags relating to the target grid - grid_flags = '' - if not self.default_grid(): - grid_flags = "--grid %(grid)s "\ - "--helperuri http://preview-%(grid)s.secondlife.com/helpers/" %\ - {'grid':self.grid()} - - # Deal with settings - setting_flags = '' - if not self.default_channel() or not self.default_grid(): - if self.default_grid(): - setting_flags = '--settings settings_%s.xml'\ - % self.channel_lowerword() - else: - setting_flags = '--settings settings_%s_%s.xml'\ - % (self.grid(), self.channel_lowerword()) - - return " ".join((grid_flags, setting_flags)).strip() + # The original role of this method seems to have been to build a + # grid-specific viewer: one that would, on launch, preselect a + # particular grid. (Apparently that dates back to when the protocol + # between viewer and simulator required them to be updated in + # lockstep, so that "the beta grid" required "a beta viewer.") But + # those viewer command-line switches no longer work without tweaking + # user_settings/grids.xml. In fact, going forward, it's unclear what + # use case that would address. + + # This method also set a channel-specific (or grid-and-channel- + # specific) user_settings/settings_something.xml file. It has become + # clear that saving user settings in a channel-specific file causes + # more problems (confusion) than it solves, so we've discontinued that. + + # In fact we now avoid forcing viewer command-line switches at all, + # instead introducing a settings_install.xml file. Command-line + # switches don't aggregate well; for instance the generated --channel + # switch actually prevented the user specifying --channel on the + # command line. Settings files have well-defined override semantics. + return None def extract_names(self,src): try: @@ -242,7 +270,7 @@ class WindowsManifest(ViewerManifest): def final_exe(self): app_suffix="Test" channel_type=self.channel_lowerword() - if channel_type == 'release' : + if channel_type.startswith('release') : app_suffix='' elif re.match('^(beta|project).*',channel_type) : app_suffix=''.join(self.channel_unique().split()) @@ -366,6 +394,7 @@ class WindowsManifest(ViewerManifest): self.path("zlib1.dll") self.path("vivoxplatform.dll") self.path("vivoxoal.dll") + self.path("ca-bundle.crt") # Security self.path("ssleay32.dll") @@ -529,8 +558,7 @@ class WindowsManifest(ViewerManifest): 'final_exe' : self.final_exe(), 'grid':self.args['grid'], 'grid_caps':self.args['grid'].upper(), - # escape quotes becase NSIS doesn't handle them well - 'flags':self.flags_list().replace('"', '$\\"'), + 'flags':'', 'channel':self.channel(), 'channel_oneword':self.channel_oneword(), 'channel_unique':self.channel_unique(), @@ -726,6 +754,7 @@ class DarwinManifest(ViewerManifest): 'libvivoxoal.dylib', 'libvivoxsdk.dylib', 'libvivoxplatform.dylib', + 'ca-bundle.crt', 'SLVoice', ): self.path2basename(libdir, libfile) @@ -757,9 +786,6 @@ class DarwinManifest(ViewerManifest): self.end_prefix("llplugin") - # command line arguments for connecting to the proper grid - self.put_in_file(self.flags_list(), 'arguments.txt') - self.end_prefix("Resources") self.end_prefix("Contents") @@ -805,10 +831,6 @@ class DarwinManifest(ViewerManifest): 'bundle': self.get_dst_prefix() }) - channel_standin = 'Second Life Viewer' # hah, our default channel is not usable on its own - if not self.default_channel(): - channel_standin = self.channel() - imagename="SecondLife_" + '_'.join(self.args['version']) # MBW -- If the mounted volume name changes, it breaks the .DS_Store's background image and icon positioning. @@ -926,9 +948,6 @@ class LinuxManifest(ViewerManifest): self.path("install.sh") self.end_prefix("linux_tools") - # Create an appropriate gridargs.dat for this package, denoting required grid. - self.put_in_file(self.flags_list(), 'etc/gridargs.dat') - if self.prefix(src="", dst="bin"): self.path("secondlife-bin","do-not-directly-run-secondlife-bin") self.path("../linux_crash_logger/linux-crash-logger","linux-crash-logger.bin") diff --git a/indra/test/lltemplatemessagebuilder_tut.cpp b/indra/test/lltemplatemessagebuilder_tut.cpp index 6c0b70edd2..dde70f98c8 100755 --- a/indra/test/lltemplatemessagebuilder_tut.cpp +++ b/indra/test/lltemplatemessagebuilder_tut.cpp @@ -958,6 +958,7 @@ namespace tut reader->validateMessage(buffer, builtSize, LLHost()); reader->readMessage(buffer, LLHost()); reader->getU32(_PREHASH_Test0, _PREHASH_Test0, outValue); + (void)outValue; char outBuffer[bufferSize]; memset(buffer, 0xcc, bufferSize); reader->getString(_PREHASH_Test1, _PREHASH_Test0, bufferSize, diff --git a/indra/viewer_components/updater/llupdatechecker.cpp b/indra/viewer_components/updater/llupdatechecker.cpp index 1e768f52d9..d6e06e5316 100755 --- a/indra/viewer_components/updater/llupdatechecker.cpp +++ b/indra/viewer_components/updater/llupdatechecker.cpp @@ -62,8 +62,7 @@ LLUpdateChecker::LLUpdateChecker(LLUpdateChecker::Client & client): } -void LLUpdateChecker::checkVersion(std::string const & hostUrl, - std::string const & servicePath, +void LLUpdateChecker::checkVersion(std::string const & urlBase, std::string const & channel, std::string const & version, std::string const & platform, @@ -71,7 +70,7 @@ void LLUpdateChecker::checkVersion(std::string const & hostUrl, unsigned char uniqueid[MD5HEX_STR_SIZE], bool willing_to_test) { - mImplementation->checkVersion(hostUrl, servicePath, channel, version, platform, platform_version, uniqueid, willing_to_test); + mImplementation->checkVersion(urlBase, channel, version, platform, platform_version, uniqueid, willing_to_test); } @@ -99,8 +98,7 @@ LLUpdateChecker::Implementation::~Implementation() } -void LLUpdateChecker::Implementation::checkVersion(std::string const & hostUrl, - std::string const & servicePath, +void LLUpdateChecker::Implementation::checkVersion(std::string const & urlBase, std::string const & channel, std::string const & version, std::string const & platform, @@ -112,8 +110,7 @@ void LLUpdateChecker::Implementation::checkVersion(std::string const & hostUrl, { mInProgress = true; - mHostUrl = hostUrl; - mServicePath = servicePath; + mUrlBase = urlBase; mChannel = channel; mVersion = version; mPlatform = platform; @@ -123,7 +120,7 @@ void LLUpdateChecker::Implementation::checkVersion(std::string const & hostUrl, mProtocol = sProtocolVersion; - std::string checkUrl = buildUrl(hostUrl, servicePath, channel, version, platform, platform_version, uniqueid, willing_to_test); + std::string checkUrl = buildUrl(urlBase, channel, version, platform, platform_version, uniqueid, willing_to_test); LL_INFOS("UpdaterService") << "checking for updates at " << checkUrl << LL_ENDL; mHttpClient.get(checkUrl, this); @@ -158,7 +155,7 @@ void LLUpdateChecker::Implementation::completed(U32 status, if (mProtocol == sProtocolVersion) { mProtocol = sLegacyProtocolVersion; - std::string retryUrl = buildUrl(mHostUrl, mServicePath, mChannel, mVersion, mPlatform, mPlatformVersion, mUniqueId, mWillingToTest); + std::string retryUrl = buildUrl(mUrlBase, mChannel, mVersion, mPlatform, mPlatformVersion, mUniqueId, mWillingToTest); LL_WARNS("UpdaterService") << "update response using " << sProtocolVersion @@ -203,17 +200,15 @@ void LLUpdateChecker::Implementation::error(U32 status, const std::string & reas } -std::string LLUpdateChecker::Implementation::buildUrl(std::string const & hostUrl, - std::string const & servicePath, +std::string LLUpdateChecker::Implementation::buildUrl(std::string const & urlBase, std::string const & channel, std::string const & version, std::string const & platform, std::string const & platform_version, unsigned char uniqueid[MD5HEX_STR_SIZE], bool willing_to_test) -{ +{ LLSD path; - path.append(servicePath); path.append(mProtocol); path.append(channel); path.append(version); @@ -224,5 +219,5 @@ std::string LLUpdateChecker::Implementation::buildUrl(std::string const & hostUr path.append(willing_to_test ? "testok" : "testno"); path.append((char*)uniqueid); } - return LLURI::buildHTTP(hostUrl, path).asString(); + return LLURI::buildHTTP(urlBase, path).asString(); } diff --git a/indra/viewer_components/updater/llupdatechecker.h b/indra/viewer_components/updater/llupdatechecker.h index 8e85587490..4244007340 100755 --- a/indra/viewer_components/updater/llupdatechecker.h +++ b/indra/viewer_components/updater/llupdatechecker.h @@ -43,8 +43,7 @@ public: public: Implementation(Client & client); ~Implementation(); - void checkVersion(std::string const & hostUrl, - std::string const & servicePath, + void checkVersion(std::string const & urlBase, std::string const & channel, std::string const & version, std::string const & platform, @@ -68,16 +67,14 @@ public: LLHTTPClient mHttpClient; bool mInProgress; std::string mVersion; - std::string mHostUrl; - std::string mServicePath; + std::string mUrlBase; std::string mChannel; std::string mPlatform; std::string mPlatformVersion; unsigned char mUniqueId[MD5HEX_STR_SIZE]; bool mWillingToTest; - std::string buildUrl(std::string const & hostUrl, - std::string const & servicePath, + std::string buildUrl(std::string const & urlBase, std::string const & channel, std::string const & version, std::string const & platform, @@ -95,8 +92,7 @@ public: LLUpdateChecker(Client & client); // Check status of current app on the given host for the channel and version provided. - void checkVersion(std::string const & hostUrl, - std::string const & servicePath, + void checkVersion(std::string const & urlBase, std::string const & channel, std::string const & version, std::string const & platform, diff --git a/indra/viewer_components/updater/llupdaterservice.cpp b/indra/viewer_components/updater/llupdaterservice.cpp index 1bd9fa4fc0..16950e1d62 100755 --- a/indra/viewer_components/updater/llupdaterservice.cpp +++ b/indra/viewer_components/updater/llupdaterservice.cpp @@ -38,6 +38,7 @@ #include "lldir.h" #include "llsdserialize.h" #include "llfile.h" +#include "llviewernetwork.h" #if LL_WINDOWS #pragma warning (disable : 4355) // 'this' used in initializer list: yes, intentionally @@ -93,8 +94,6 @@ class LLUpdaterServiceImpl : static const std::string sListenerName; std::string mProtocolVersion; - std::string mUrl; - std::string mPath; std::string mChannel; std::string mVersion; std::string mPlatform; @@ -120,9 +119,7 @@ public: LLUpdaterServiceImpl(); virtual ~LLUpdaterServiceImpl(); - void initialize(const std::string& url, - const std::string& path, - const std::string& channel, + void initialize(const std::string& channel, const std::string& version, const std::string& platform, const std::string& platform_version, @@ -183,9 +180,7 @@ LLUpdaterServiceImpl::~LLUpdaterServiceImpl() LLEventPumps::instance().obtain("mainloop").stopListening(sListenerName); } -void LLUpdaterServiceImpl::initialize(const std::string& url, - const std::string& path, - const std::string& channel, +void LLUpdaterServiceImpl::initialize(const std::string& channel, const std::string& version, const std::string& platform, const std::string& platform_version, @@ -198,8 +193,6 @@ void LLUpdaterServiceImpl::initialize(const std::string& url, "while updater is running."); } - mUrl = url; - mPath = path; mChannel = channel; mVersion = version; mPlatform = platform; @@ -207,8 +200,6 @@ void LLUpdaterServiceImpl::initialize(const std::string& url, memcpy(mUniqueId, uniqueid, MD5HEX_STR_SIZE); mWillingToTest = willing_to_test; LL_DEBUGS("UpdaterService") - << "\n url: " << mUrl - << "\n path: " << mPath << "\n channel: " << mChannel << "\n version: " << mVersion << "\n uniqueid: " << mUniqueId @@ -228,7 +219,7 @@ void LLUpdaterServiceImpl::setBandwidthLimit(U64 bytesPerSecond) void LLUpdaterServiceImpl::startChecking(bool install_if_ready) { - if(mUrl.empty() || mChannel.empty() || mVersion.empty()) + if(mChannel.empty() || mVersion.empty()) { throw LLUpdaterService::UsageError("Set params before call to " "LLUpdaterService::startCheck()."); @@ -415,7 +406,7 @@ void LLUpdaterServiceImpl::response(LLSD const & content) setState(LLUpdaterService::UP_TO_DATE); } - else + else if ( content.isMap() && content.has("url") ) { // there is an update available... stopTimer(); @@ -439,6 +430,12 @@ void LLUpdaterServiceImpl::response(LLSD const & content) << LL_ENDL; mUpdateDownloader.download(url, content["hash"].asString(), mNewChannel, mNewVersion, more_info, required); } + else + { + LL_WARNS("UpdaterService") << "Invalid update query response ignored; retry in " + << mCheckPeriod << " seconds" << LL_ENDL; + restartTimer(mCheckPeriod); + } } void LLUpdaterServiceImpl::downloadComplete(LLSD const & data) @@ -565,8 +562,26 @@ bool LLUpdaterServiceImpl::onMainLoop(LLSD const & event) } else { - mUpdateChecker.checkVersion(mUrl, mPath, mChannel, mVersion, mPlatform, mPlatformVersion, mUniqueId, mWillingToTest); - setState(LLUpdaterService::CHECKING_FOR_UPDATE); + std::string query_url = LLGridManager::getInstance()->getUpdateServiceURL(); + if ( !query_url.empty() ) + { + mUpdateChecker.checkVersion(query_url, mChannel, mVersion, + mPlatform, mPlatformVersion, mUniqueId, + mWillingToTest); + setState(LLUpdaterService::CHECKING_FOR_UPDATE); + } + else + { + LL_WARNS("UpdaterService") + << "No updater service defined for grid '" << LLGridManager::getInstance()->getGrid() + << "' will check again in " << mCheckPeriod << " seconds" + << LL_ENDL; + // Because the grid can be changed after the viewer is started (when the first check takes place) + // but before the user logs in, the next check may be on a different grid, so set the retry timer + // even though this check did not happen. The default time is once an hour, and if we're not + // doing the check anyway the performance impact is completely insignificant. + restartTimer(mCheckPeriod); + } } } else @@ -610,9 +625,7 @@ LLUpdaterService::~LLUpdaterService() { } -void LLUpdaterService::initialize(const std::string& url, - const std::string& path, - const std::string& channel, +void LLUpdaterService::initialize(const std::string& channel, const std::string& version, const std::string& platform, const std::string& platform_version, @@ -620,7 +633,7 @@ void LLUpdaterService::initialize(const std::string& url, const bool& willing_to_test ) { - mImpl->initialize(url, path, channel, version, platform, platform_version, uniqueid, willing_to_test); + mImpl->initialize(channel, version, platform, platform_version, uniqueid, willing_to_test); } void LLUpdaterService::setCheckPeriod(unsigned int seconds) diff --git a/indra/viewer_components/updater/llupdaterservice.h b/indra/viewer_components/updater/llupdaterservice.h index 982f99b861..0ddf24935b 100755 --- a/indra/viewer_components/updater/llupdaterservice.h +++ b/indra/viewer_components/updater/llupdaterservice.h @@ -71,9 +71,7 @@ public: LLUpdaterService(); ~LLUpdaterService(); - void initialize(const std::string& url, - const std::string& path, - const std::string& channel, + void initialize(const std::string& channel, const std::string& version, const std::string& platform, const std::string& platform_version, diff --git a/indra/viewer_components/updater/scripts/linux/update_install b/indra/viewer_components/updater/scripts/linux/update_install index a9df9042fd..03089f192e 100755 --- a/indra/viewer_components/updater/scripts/linux/update_install +++ b/indra/viewer_components/updater/scripts/linux/update_install @@ -69,8 +69,11 @@ then # zenity on PATH and is executable # clear any previous message clear_message # put up a new zenity box and capture its pid - "$zenpath" --info --title "Second Life Viewer Updater" \ - --width=320 --height=120 --text="$*" & +## "$zenpath" --info --title "Second Life Viewer Updater" \ +## --width=320 --height=120 --text="$*" & + # MAINT-2333: use bouncing progress bar + "$zenpath" --progress --pulsate --no-cancel --title "Second Life Viewer Updater" \ + --width=320 --height=120 --text "$*" </dev/null & statuspid=$! } diff --git a/indra/viewer_components/updater/tests/llupdaterservice_test.cpp b/indra/viewer_components/updater/tests/llupdaterservice_test.cpp index 4812272ebc..759e41ef4c 100755 --- a/indra/viewer_components/updater/tests/llupdaterservice_test.cpp +++ b/indra/viewer_components/updater/tests/llupdaterservice_test.cpp @@ -44,8 +44,7 @@ *****************************************************************************/ LLUpdateChecker::LLUpdateChecker(LLUpdateChecker::Client & client) {} -void LLUpdateChecker::checkVersion(std::string const & hostUrl, - std::string const & servicePath, +void LLUpdateChecker::checkVersion(std::string const & urlBase, std::string const & channel, std::string const & version, std::string const & platform, @@ -91,6 +90,21 @@ bool LLDir::setCacheDir(const std::string &path){ return true; } void LLDir::dumpCurrentDirectories() {} void LLDir::updatePerAccountChatLogsDir() {} +#include "llviewernetwork.h" +LLGridManager::LLGridManager() : + mGrid("test.grid.lindenlab.com"), + mIsInProductionGrid(false) +{ +} +std::string LLGridManager::getUpdateServiceURL() +{ + return "https://update.secondlife.com/update"; +} +LLGridManager::~LLGridManager() +{ +} + + std::string LLDir::getExpandedFilename(ELLPath location, const std::string &filename) const { @@ -179,10 +193,10 @@ namespace tut try { unsigned char id1[MD5HEX_STR_SIZE] = "11111111111111111111111111111111"; - updater.initialize(test_url, "update" ,test_channel, test_version, "win", "1.2.3", id1, true); + updater.initialize(test_channel, test_version, "win", "1.2.3", id1, true); updater.startChecking(); unsigned char id2[MD5HEX_STR_SIZE] = "22222222222222222222222222222222"; - updater.initialize("other_url", "update", test_channel, test_version, "win", "4.5.6", id2, true); + updater.initialize(test_channel, test_version, "win", "4.5.6", id2, true); } catch(LLUpdaterService::UsageError) { @@ -197,7 +211,7 @@ namespace tut DEBUG; LLUpdaterService updater; unsigned char id[MD5HEX_STR_SIZE] = "33333333333333333333333333333333"; - updater.initialize(test_url, "update", test_channel, test_version, "win", "7.8.9", id, true); + updater.initialize(test_channel, test_version, "win", "7.8.9", id, true); updater.startChecking(); ensure(updater.isChecking()); updater.stopChecking(); diff --git a/scripts/gpu_table_tester b/scripts/gpu_table_tester index 9bc958636d..0fe3e9e8f7 100755 --- a/scripts/gpu_table_tester +++ b/scripts/gpu_table_tester @@ -73,6 +73,10 @@ die "Must specify a --gpu-table <gpu_table.txt> value" open(GPUS, "<$GpuTable") || die "Failed to open gpu table '$GpuTable':\n\t$!\n"; +my $FirstLine = <GPUS>; +die "First line of gpu table does not begin with '//GPU_TABLE'" + unless $FirstLine =~ m|^//GPU_TABLE|; + # Parse the GPU table into these tables, indexed by the name my %NameLine; # name -> line number on which a given name was found (catches duplicate names) my %RecognizerLine; # name -> line number on which a given name was found (catches duplicate names) |