From 28d8d4e7664bcd6c8369cc18832e42096af7cad2 Mon Sep 17 00:00:00 2001
From: Jacek Antonelli
Date: Fri, 15 Aug 2008 23:45:01 -0500
Subject: Second Life viewer sources 1.17.3.0

---
 linden/doc/contributions.txt                       |   7 +-
 linden/indra/SConstruct                            |  89 ++-
 linden/indra/indra_complete/indra_complete.sln     |   4 +
 linden/indra/llcharacter/llheadrotmotion.cpp       |  20 +-
 linden/indra/llcharacter/lljointstate.h            |   2 +-
 linden/indra/llcharacter/llmotioncontroller.cpp    |  21 +-
 linden/indra/llcharacter/llmotioncontroller.h      |   2 +-
 linden/indra/llcharacter/llvisualparam.h           |   4 +-
 linden/indra/llcommon/llenum.h                     |   2 +-
 linden/indra/llcommon/llpreprocessor.h             |  22 +-
 linden/indra/llcommon/llprocessor.cpp              |   8 +-
 linden/indra/llcommon/llprocessor.h                |   1 +
 linden/indra/llcommon/llskiplist.h                 |  12 +-
 linden/indra/llcommon/llsys.cpp                    |  25 +-
 linden/indra/llcommon/llsys.h                      |  12 +-
 linden/indra/llcommon/llversion.h                  |   2 +-
 linden/indra/llcommon/metaclass.cpp                |   3 +
 linden/indra/llcommon/metaproperty.cpp             |   3 +
 linden/indra/llcommon/reflective.cpp               |   2 +
 linden/indra/llinventory/llparcel.h                |   2 +-
 linden/indra/llinventory/llparcelflags.h           |   2 +-
 linden/indra/llmath/llmath.vcproj                  |  12 +
 linden/indra/llmath/llmath_vc8.vcproj              |  16 +
 linden/indra/llmath/lluuid.h                       |   2 +
 linden/indra/llmath/llv4math.h                     | 121 ++++
 linden/indra/llmath/llv4matrix3.h                  | 222 +++++++
 linden/indra/llmath/llv4matrix4.h                  | 251 ++++++++
 linden/indra/llmath/llv4vector3.h                  |  82 +++
 linden/indra/llmath/llvolume.h                     |   2 +-
 linden/indra/llmath/v4color.h                      |   2 +-
 linden/indra/llmessage/llteleportflags.h           |   1 +
 linden/indra/llmessage/machine.h                   |   4 +-
 linden/indra/llmessage/net.cpp                     |   5 +-
 linden/indra/llprimitive/llprimitive.h             |   6 +-
 linden/indra/llprimitive/lltreeparams.h            |   2 +-
 linden/indra/llui/llscrolllistctrl.h               |   4 +-
 linden/indra/llui/lltextbox.cpp                    |   7 +
 linden/indra/llui/lluictrl.h                       |   4 +-
 linden/indra/llui/llview.cpp                       |   4 +-
 linden/indra/llui/llviewquery.cpp                  |   2 +-
 linden/indra/llxml/llxmlnode.h                     |   6 +-
 linden/indra/lscript/lscript_library.h             |   4 +-
 .../indra/newview/English.lproj/InfoPlist.strings  |   4 +-
 linden/indra/newview/Info-SecondLife.plist         |   2 +-
 .../shaders/class1/objects/shinyF.glsl             |  26 +-
 .../shaders/class1/objects/shinyV.glsl             |  54 +-
 .../shaders/class3/environment/waterF.glsl         | 290 ++++-----
 linden/indra/newview/files.lst                     |   7 +-
 linden/indra/newview/gpu_table.txt                 |   3 +
 linden/indra/newview/llagent.cpp                   |   4 +-
 linden/indra/newview/llagent.h                     |   4 +-
 linden/indra/newview/llcape.h                      |   3 +-
 linden/indra/newview/llcontroldef.cpp              |   6 +
 linden/indra/newview/llcountdown.cpp               | 106 ----
 linden/indra/newview/llcountdown.h                 |  67 ---
 linden/indra/newview/lldrawable.h                  |  13 +-
 linden/indra/newview/lldriverparam.h               |   3 +-
 linden/indra/newview/llface.cpp                    |   2 +-
 linden/indra/newview/llface.h                      |  10 +-
 linden/indra/newview/llfft.cpp                     | 577 ------------------
 linden/indra/newview/llfft.h                       | 105 ----
 linden/indra/newview/llflexibleobject.cpp          |   4 +-
 linden/indra/newview/llflexibleobject.h            |   3 +-
 linden/indra/newview/llfloaterabout.cpp            |   5 +-
 linden/indra/newview/llfloaterchat.cpp             |  64 +-
 linden/indra/newview/llfloatereditui.cpp           |   4 +-
 linden/indra/newview/llfloaterland.cpp             |  10 +-
 linden/indra/newview/llfloaterregioninfo.cpp       |   5 +
 linden/indra/newview/llfloatertopobjects.cpp       |  11 +-
 linden/indra/newview/llfloatertopobjects.h         |   2 +-
 linden/indra/newview/llimpanel.h                   |   2 +-
 linden/indra/newview/llpanelcontents.cpp           |   1 -
 linden/indra/newview/llpaneldisplay.cpp            |   1 +
 linden/indra/newview/llpanelface.cpp               |   1 -
 linden/indra/newview/llpanellogin.cpp              |  28 +-
 linden/indra/newview/llpolymesh.h                  |   6 +-
 linden/indra/newview/llprogressview.cpp            |   2 +-
 linden/indra/newview/llsrv.cpp                     | 232 ++++++--
 linden/indra/newview/llsrv.h                       |  19 +-
 linden/indra/newview/llstatusbar.cpp               |  85 ++-
 linden/indra/newview/llstatusbar.h                 |   7 +
 linden/indra/newview/lltexlayer.cpp                |   2 +-
 linden/indra/newview/lltexlayer.h                  |   9 +-
 linden/indra/newview/lltexturetable.cpp            | 157 -----
 linden/indra/newview/lltexturetable.h              |  70 ---
 linden/indra/newview/lltextureview.cpp             |   4 -
 linden/indra/newview/llviewerimage.cpp             |   1 -
 linden/indra/newview/llviewerimagelist.cpp         |   1 -
 linden/indra/newview/llviewerjointattachment.h     |   5 +-
 linden/indra/newview/llviewerjointmesh.cpp         | 214 +++++--
 linden/indra/newview/llviewerjointmesh.h           |  16 +
 linden/indra/newview/llviewerjointmesh_sse.cpp     | 114 ++++
 linden/indra/newview/llviewerjointmesh_sse2.cpp    | 116 ++++
 linden/indra/newview/llviewerjointmesh_vec.cpp     |  97 +++
 linden/indra/newview/llviewermenu.cpp              |   3 +
 linden/indra/newview/llviewermenufile.cpp          |   2 +-
 linden/indra/newview/llviewermessage.cpp           |   8 +-
 linden/indra/newview/llviewerwindow.cpp            |   2 +-
 linden/indra/newview/llvosky.h                     |   2 +-
 linden/indra/newview/llvowater.h                   |   3 -
 linden/indra/newview/llwaterpatch.cpp              | 132 -----
 linden/indra/newview/llwaterpatch.h                | 317 ----------
 .../newview/macview.xcodeproj/project.pbxproj      | 648 ++++++++++-----------
 linden/indra/newview/newview.vcproj                |  89 ++-
 linden/indra/newview/newview_vc8.vcproj            | 121 +++-
 linden/indra/newview/releasenotes.txt              |  21 +
 linden/indra/newview/res/newViewRes.rc             |   8 +-
 linden/indra/newview/skins/xui/en-us/alerts.xml    |  25 +-
 .../indra/newview/skins/xui/en-us/panel_login.xml  |   6 +
 .../newview/skins/xui/en-us/panel_status_bar.xml   |  11 +-
 linden/indra/newview/viewer.cpp                    | 142 ++++-
 linden/indra/newview/viewer.h                      |   3 +
 linden/indra/newview/viewer_manifest.py            |   4 +-
 113 files changed, 2736 insertions(+), 2399 deletions(-)
 create mode 100644 linden/indra/llmath/llv4math.h
 create mode 100644 linden/indra/llmath/llv4matrix3.h
 create mode 100644 linden/indra/llmath/llv4matrix4.h
 create mode 100644 linden/indra/llmath/llv4vector3.h
 delete mode 100644 linden/indra/newview/llcountdown.cpp
 delete mode 100644 linden/indra/newview/llcountdown.h
 delete mode 100644 linden/indra/newview/llfft.cpp
 delete mode 100644 linden/indra/newview/llfft.h
 delete mode 100644 linden/indra/newview/lltexturetable.cpp
 delete mode 100644 linden/indra/newview/lltexturetable.h
 create mode 100644 linden/indra/newview/llviewerjointmesh_sse.cpp
 create mode 100644 linden/indra/newview/llviewerjointmesh_sse2.cpp
 create mode 100644 linden/indra/newview/llviewerjointmesh_vec.cpp
 delete mode 100644 linden/indra/newview/llwaterpatch.cpp
 delete mode 100644 linden/indra/newview/llwaterpatch.h

diff --git a/linden/doc/contributions.txt b/linden/doc/contributions.txt
index cd9745b..4546053 100644
--- a/linden/doc/contributions.txt
+++ b/linden/doc/contributions.txt
@@ -5,7 +5,7 @@ received from them.  To see more about these contributions, visit
 http://jira.secondlife.com/ and enter the issue identifier.
 
 Able Whitman - VWR-650
-Alissa Sabre - VWR-81, VWR-83, VWR-171, VWR-251, VWR-414, VWR-415, VWR-459, VWR-606, VWR-652
+Alissa Sabre - VWR-81, VWR-83, VWR-171, VWR-251, VWR-414, VWR-415, VWR-459, VWR-606, VWR-652, VWR-1351, VWR-1410
 Argent Stonecutter - VWR-68
 Benja Kepler - VWR-746
 Blakar Ogre - VWR-881
@@ -17,15 +17,17 @@ Duckless Vandyke - VWR-383
 Dylan Haskell - VWR-72
 Dzonatas Sol - VWR-198, VWR-878
 Eddy Stryker - VWR-15, VWR-23
+Fremont Cunningham - VWR-1147
 Gigs Taggart - VWR-71, VWR-326, VWR-1217
 Ginko Bayliss - VWR-4
 Hikkoshi Sakai - VWR-429
 Hiro Sommambulist - VWR-66, VWR-97, VWR-100, VWR-105, VWR-108, VWR-118, VWR-132, VWR-136, VWR-143
+Iskar Ariantho - VWR-1223
 Jacek Antonelli - VWR-165, VWR-188, VWR-427, VWR-597
 Joghert LeSabre - VWR-64
 Kage Pixel - VWR-11
 Kunnis Basiat - VWR-82
-Nicholaz Beresford - VWR-132, VWR-176, VWR-793, VWR-794, VWR-802, VWR-803, VWR-804, VWR-805, VWR-808, VWR-809, VWR-810, VWR-823, VWR-869, VWR-870, VWR-871, VWR-873, VWR-908, VWR-966
+Nicholaz Beresford - VWR-132, VWR-176, VWR-793, VWR-794, VWR-802, VWR-803, VWR-804, VWR-805, VWR-808, VWR-809, VWR-810, VWR-823, VWR-869, VWR-870, VWR-871, VWR-873, VWR-908, VWR-966, VWR-1410, VWR-1418
 Paul Churchill - VWR-20
 Paula Innis - VWR-30, VWR-1049
 Peekay Semyorka - VWR-7, VWR-19, VWR-49, VWR-79
@@ -38,6 +40,7 @@ Still Defiant - VWR-207, VWR-446
 Strife Onizuka - SVC-9, VWR-74, VWR-85, VWR-148
 tenebrous pau - VWR-247
 TBBle Kurosawa - VWR-938, VWR-941, VWR-944
+Tharax Ferraris - VWR-605
 Zi Ree - VWR-671, VWR-682, VWR-1140
 Zipherius Turas - VWR-76, VWR-77
 
diff --git a/linden/indra/SConstruct b/linden/indra/SConstruct
index 68c8fc7..3de5e4f 100644
--- a/linden/indra/SConstruct
+++ b/linden/indra/SConstruct
@@ -184,13 +184,20 @@ for build_target in targets:
         ./llcommon ./llmath ./llwindow ./llaudio ./llcharacter
         ./lldatabase ./llhavok ./llimage ./llinventory ./llmedia ./llmessage
         ./llprimitive ./llrender ./llscene ./llui ./llvfs ./llwindow
-        ./llxml ./lscript
+        ./llxml ./lscript ./lscript/lscript_compile
         ../libraries/include
         ../libraries/include/havok
         """ +
         '../libraries/' + system_str + '/include' )
 
-    client_external_libs = ['resolv']
+    if platform == 'linux' and build_target == 'client':
+        if arch == 'x86_64' and os.path.exists('/usr/lib64'):
+            client_external_libs = [File('/usr/lib64/libresolv.a')]
+        else:
+            client_external_libs = ['llresolv6']
+    else:
+        client_external_libs = ['resolv']
+
     system_link_flags = ''
 
     if platform != 'linux' and build_target == 'client' and enable_mozlib:
@@ -240,7 +247,7 @@ for build_target in targets:
         cppflags += server_cppflags + ' '
     else:
         # Viewer flags
-        cflags += '-falign-loops=16 -fno-math-errno -fexceptions -fsigned-char -fno-strict-aliasing -ffast-math '
+        cflags += '-fno-math-errno -fexceptions -fsigned-char -fno-strict-aliasing '
         cppflags += '-DLL_MESA_HEADLESS=0 -DLL_MESA=0 '
         try:
             client_cppflags = os.environ['CLIENT_CPPFLAGS']
@@ -283,32 +290,44 @@ for build_target in targets:
         cflags += '-x c++ -arch ppc -pipe -Wno-trigraphs -fpascal-strings -faltivec -fasm-blocks -g -fmessage-length=0 -mtune=G4 -Wno-deprecated-declarations -Wno-invalid-offsetof -mmacosx-version-min=10.3 -Wmost -Wno-sign-compare -Wno-switch -fconstant-cfstrings -ffor-scope -Wno-reorder '
         cppflags += '-x c++ -DLL_DARWIN=1 -fpch-preprocess -F./newview/build/Deployment -fconstant-cfstrings -isysroot /Developer/SDKs/MacOSX10.3.9.sdk '
 
+    if standalone:
+        gcc_bin = 'g++'
+    elif build_target != 'client':
+        gcc_bin = 'g++-3.3'
+    elif arch == 'x86_64cross':
+        gcc_bin = '/opt/crosstool/gcc-4.0.2-glibc-2.3.6/x86_64-unknown-linux-gnu/bin/x86_64-unknown-linux-gnu-gcc'
+        strip_cmd = '/opt/crosstool/gcc-4.0.2-glibc-2.3.6/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/bin/strip -S -o $TARGET $SOURCE'
+
+    else:
+        gcc_bin = 'g++-3.4'
+
+    # Are we using the Intel compiler?
+    if gcc_bin.find('icpc') >= 0:
+        cflags += '-wr193,654,981,1125 -w1 '
+    elif build_target == 'client':
+        cflags += '-falign-loops=16 -ffast-math '
+
     cxxflags += cflags
 
     ### Build type-specific flags ###
 
     debug_cflags = cflags + '-fno-inline -O0 '
+    debug_cxxflags = cxxflags + '-fno-inline -O0 '
     debug_cppflags = cppflags + '-D_DEBUG -DLL_DEBUG=1 '
-    debug_cxxflags = cxxflags
     release_cflags = cflags + '-O2 '
+    release_cxxflags = cxxflags + '-O2 '
     release_cppflags = cppflags + '-DNDEBUG -DLL_RELEASE=1 '
-    release_cxxflags = cxxflags
     releasenoopt_cflags = cflags + '-O0 '
+    releasenoopt_cxxflags = cxxflags + '-O0 '
     releasenoopt_cppflags = cppflags + '-DNDEBUG -DLL_RELEASE=1 '
-    releasenoopt_cxxflags = cxxflags
     releasefordownload_cflags = cflags + '-O2 '
+    releasefordownload_cxxflags = cxxflags + '-O2 '
     releasefordownload_cppflags = cppflags + '-DNDEBUG -DLL_RELEASE=1 -DLL_RELEASE_FOR_DOWNLOAD=1 '
-    releasefordownload_cxxflags = cxxflags
 
     ################
     # ENVIRONMENT  #
     ################
 
-    if standalone:
-        gcc_bin = 'g++'
-    else:
-        gcc_bin = 'g++-3.4'
-
     # If you strip more aggressively than -S then the quality of crash-
     # logger backtraces deteriorates.
     strip_cmd = 'strip -S -o $TARGET $SOURCE'
@@ -324,13 +343,6 @@ for build_target in targets:
     else:
         hidesyms_cmd = 'cp -f $SOURCE $TARGET'
 
-    if build_target != 'client':
-        gcc_bin = 'g++-3.3'
-
-    if arch == 'x86_64cross':
-        gcc_bin = '/opt/crosstool/gcc-4.0.2-glibc-2.3.6/x86_64-unknown-linux-gnu/bin/x86_64-unknown-linux-gnu-gcc'
-        strip_cmd = '/opt/crosstool/gcc-4.0.2-glibc-2.3.6/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/bin/strip -S -o $TARGET $SOURCE'
-
     compiler = gcc_bin 
     compiler_no_distcc = compiler
     if enable_distcc:
@@ -380,6 +392,18 @@ for build_target in targets:
 
     env_no_distcc = env.Copy(CXX = compiler_no_distcc)
 
+    vec_match	= re.compile("_vec\.")
+    env_vec = env.Copy()	# _vec is for default vector optimizations or none
+
+    sse_match	= re.compile("_sse\.")
+    env_sse = env.Copy()
+    env_sse.Append(CPPFLAGS = ' -msse -mfpmath=sse')
+
+    sse2_match	= re.compile("_sse2\.") 
+    env_sse2 = env.Copy()
+    env_sse2.Append(CPPFLAGS = ' -msse2 -mfpmath=sse')
+
+
     ### Distributed build hosts ###
 
     if enable_distcc:
@@ -407,6 +431,21 @@ for build_target in targets:
     # HELPER FUNCTIONS  #
     #####################
 
+    ## handle special compiler modes
+
+    def file_obj(file):
+        if file == 'newsim/lltask.cpp':
+            print 'Found lltask!'
+            return env_no_distcc.Object(file)
+        elif vec_match.search(file) != None:
+            return env_vec.Object(file)
+        elif sse_match.search(file) != None:
+            return env_sse.Object(file)
+        elif sse2_match.search(file) != None:
+            return env_sse2.Object(file)
+        else:
+            return file
+
     ### Load a files.lst and files.PLATFORM.lst for each module ###
 
     def load_files(module, source_fname):
@@ -417,12 +456,7 @@ for build_target in targets:
             for x in list:
                 if not x.startswith('#'):
                     file = os.path.join(build_dir, x)
-                    if x == 'newsim/lltask.cpp':
-                        print 'Found lltask!'
-                        obj = env_no_distcc.Object(file)
-                        new_list.append(obj)
-                    else:
-                        new_list.append(file)
+                    new_list.append(file_obj(file))
             list_file.close()
         except IOError, val:
             print 'Error: unable to open file list',source_fname,
@@ -434,7 +468,7 @@ for build_target in targets:
             list = Split(platform_list_file.read())
             for x in list:
                 file = os.path.join(build_dir, x)
-                new_list.append(file)
+                new_list.append(file_obj(file))
             platform_list_file.close()
         except IOError:
             return new_list
@@ -559,7 +593,8 @@ for build_target in targets:
         if arch != 'x86_64' and arch != 'x86_64cross':
             if enable_fmod:
                 external_libs += [ 'fmod-3.75' ]
-            external_libs += ['tcmalloc', 'stacktrace']
+            if buildtype == 'debug':
+                external_libs += ['tcmalloc', 'stacktrace']
 
         external_libs.remove('cares')
 
diff --git a/linden/indra/indra_complete/indra_complete.sln b/linden/indra/indra_complete/indra_complete.sln
index a56a889..27e147e 100644
--- a/linden/indra/indra_complete/indra_complete.sln
+++ b/linden/indra/indra_complete/indra_complete.sln
@@ -141,12 +141,14 @@ EndProject
 	ProjectSection(ProjectDependencies) = postProject
 		{7BCB4B2C-8378-4186-88EA-5742B5ABE17F} = {7BCB4B2C-8378-4186-88EA-5742B5ABE17F}
 		{44CE6D82-7320-4609-8FC3-5965C19F4808} = {44CE6D82-7320-4609-8FC3-5965C19F4808}
+		{BFA102B0-C891-4E13-B1CF-C2F28073DA8E} = {BFA102B0-C891-4E13-B1CF-C2F28073DA8E}
 		{E87FD9BE-BE42-4EA3-BF4D-D992223046D9} = {E87FD9BE-BE42-4EA3-BF4D-D992223046D9}
 	EndProjectSection
 EndProject
 	ProjectSection(ProjectDependencies) = postProject
 		{7BCB4B2C-8378-4186-88EA-5742B5ABE17F} = {7BCB4B2C-8378-4186-88EA-5742B5ABE17F}
 		{F882263E-4F2A-43D9-A45A-FA4C8EC66552} = {F882263E-4F2A-43D9-A45A-FA4C8EC66552}
+		{BFA102B0-C891-4E13-B1CF-C2F28073DA8E} = {BFA102B0-C891-4E13-B1CF-C2F28073DA8E}
 		{E87FD9BE-BE42-4EA3-BF4D-D992223046D9} = {E87FD9BE-BE42-4EA3-BF4D-D992223046D9}
 	EndProjectSection
 EndProject
@@ -262,6 +264,8 @@ Global
 		Debug = Debug
 		Release = Release
 	EndGlobalSection
+	GlobalSection(ProjectDependencies) = postSolution
+	EndGlobalSection
 	GlobalSection(ProjectConfiguration) = postSolution
 		{7BCB4B2C-8378-4186-88EA-5742B5ABE17F}.Debug.ActiveCfg = Debug|Win32
 		{7BCB4B2C-8378-4186-88EA-5742B5ABE17F}.Debug.Build.0 = Debug|Win32
diff --git a/linden/indra/llcharacter/llheadrotmotion.cpp b/linden/indra/llcharacter/llheadrotmotion.cpp
index cfab048..73f8e8b 100644
--- a/linden/indra/llcharacter/llheadrotmotion.cpp
+++ b/linden/indra/llcharacter/llheadrotmotion.cpp
@@ -438,6 +438,10 @@ BOOL LLEyeMotion::onUpdate(F32 time, U8* joint_mask)
 		up.setVec(eye_look_at % left);
 
 		target_eye_rot = LLQuaternion(eye_look_at, left, up);
+		// convert target rotation to head-local coordinates
+		target_eye_rot *= ~mHeadJoint->getWorldRotation();
+		// constrain target orientation to be in front of avatar's face
+		target_eye_rot.constrain(EYE_ROT_LIMIT_ANGLE);
 
 		// calculate vergence
 		F32 interocular_dist = (mLeftEyeState.getJoint()->getWorldPosition() - mRightEyeState.getJoint()->getWorldPosition()).magVec();
@@ -446,7 +450,7 @@ BOOL LLEyeMotion::onUpdate(F32 time, U8* joint_mask)
 	}
 	else
 	{
-		target_eye_rot = mHeadJoint->getWorldRotation();
+		target_eye_rot = LLQuaternion::DEFAULT;
 		vergence = 0.f;
 	}
 
@@ -488,18 +492,8 @@ BOOL LLEyeMotion::onUpdate(F32 time, U8* joint_mask)
 	vergence_quat.transQuat();
 	right_eye_rot = vergence_quat * eye_jitter_rot * right_eye_rot;
 
-	//set final eye rotations
-	// start with left
-	LLQuaternion tQw = mLeftEyeState.getJoint()->getParent()->getWorldRotation();
-	LLQuaternion tQh = left_eye_rot * ~tQw;
-	tQh.constrain(EYE_ROT_LIMIT_ANGLE);
-	mLeftEyeState.setRotation( tQh );
-
-	// now do right eye
-	tQw = mRightEyeState.getJoint()->getParent()->getWorldRotation();
-	tQh = right_eye_rot * ~tQw;
-	tQh.constrain(EYE_ROT_LIMIT_ANGLE);
-	mRightEyeState.setRotation( tQh );
+	mLeftEyeState.setRotation( left_eye_rot );
+	mRightEyeState.setRotation( right_eye_rot );
 
 	return TRUE;
 }
diff --git a/linden/indra/llcharacter/lljointstate.h b/linden/indra/llcharacter/lljointstate.h
index 8b55410..5311374 100644
--- a/linden/indra/llcharacter/lljointstate.h
+++ b/linden/indra/llcharacter/lljointstate.h
@@ -118,7 +118,7 @@ public:
 	void setScale( const LLVector3& scale )	{ llassert(mUsage & SCALE); mScale = scale; }
 
 	// get/set priority
-	const LLJoint::JointPriority getPriority()		{ return mPriority; }
+	LLJoint::JointPriority getPriority()		{ return mPriority; }
 	void setPriority( const LLJoint::JointPriority priority ) { mPriority = priority; }
 };
 
diff --git a/linden/indra/llcharacter/llmotioncontroller.cpp b/linden/indra/llcharacter/llmotioncontroller.cpp
index 3ef35ec..2427fd8 100644
--- a/linden/indra/llcharacter/llmotioncontroller.cpp
+++ b/linden/indra/llcharacter/llmotioncontroller.cpp
@@ -360,7 +360,7 @@ BOOL LLMotionController::startMotion(const LLUUID &id, F32 start_offset)
 	{	
 		if (motion->isStopped()) // motion has been stopped
 		{
-			deactivateMotion(motion);
+			deactivateMotion(motion, false);
 		}
 		else if (mTime < motion->mSendStopTimestamp)	// motion is still active
 		{
@@ -396,7 +396,7 @@ BOOL LLMotionController::stopMotionLocally(const LLUUID &id, BOOL stop_immediate
 
 		if (stop_immediate)
 		{
-			deactivateMotion(motion);
+			deactivateMotion(motion, false);
 		}
 		return TRUE;
 	}
@@ -492,7 +492,7 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty
 		{
 			if (motionp->isStopped() && mTime > motionp->getStopTime() + motionp->getEaseOutDuration())
 			{
-				deactivateMotion(motionp);
+				deactivateMotion(motionp, false);
 			}
 			else if (motionp->isStopped() && mTime > motionp->getStopTime())
 			{
@@ -546,8 +546,7 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty
 			{
 				if (motionp->isStopped() && mTime > motionp->getStopTime() + motionp->getEaseOutDuration())
 				{
-					posep->setWeight(0.f);
-					deactivateMotion(motionp);
+					deactivateMotion(motionp, true);
 				}
 				continue;
 			}
@@ -573,8 +572,7 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty
 			}
 			else
 			{
-				posep->setWeight(0.f);
-				deactivateMotion(motionp);
+				deactivateMotion(motionp, true);
 				continue;
 			}
 		}
@@ -822,8 +820,15 @@ BOOL LLMotionController::activateMotion(LLMotion *motion, F32 time)
 //-----------------------------------------------------------------------------
 // deactivateMotion()
 //-----------------------------------------------------------------------------
-BOOL LLMotionController::deactivateMotion(LLMotion *motion)
+BOOL LLMotionController::deactivateMotion(LLMotion *motion, bool remove_weight)
 {
+	if( remove_weight )
+	{
+		// immediately remove pose weighting instead of letting it time out
+		LLPose *posep = motion->getPose();
+		posep->setWeight(0.f);
+	}
+	
 	motion->deactivate();
 	mActiveMotions.remove(motion);
 
diff --git a/linden/indra/llcharacter/llmotioncontroller.h b/linden/indra/llcharacter/llmotioncontroller.h
index 94149da..959a16a 100644
--- a/linden/indra/llcharacter/llmotioncontroller.h
+++ b/linden/indra/llcharacter/llmotioncontroller.h
@@ -182,7 +182,7 @@ protected:
 	void deleteAllMotions();
 	void addLoadedMotion(LLMotion *motion);
 	BOOL activateMotion(LLMotion *motion, F32 time);
-	BOOL deactivateMotion(LLMotion *motion);
+	BOOL deactivateMotion(LLMotion *motion, bool remove_weight);
 	void updateRegularMotions();
 	void updateAdditiveMotions();
 	void resetJointSignatures();
diff --git a/linden/indra/llcharacter/llvisualparam.h b/linden/indra/llcharacter/llvisualparam.h
index ec19fa0..ddd0469 100644
--- a/linden/indra/llcharacter/llvisualparam.h
+++ b/linden/indra/llcharacter/llvisualparam.h
@@ -108,7 +108,7 @@ public:
 	virtual void			stopAnimating(BOOL set_by_user);
 
 	// Interface methods
-	const S32				getID() 			{ return mID; }
+	S32						getID() 			{ return mID; }
 	void					setID(S32 id) 		{ llassert(!mInfo); mID = id; }
 	
 	const LLString&			getName() const 			{ return mInfo->mName; }
@@ -120,7 +120,7 @@ public:
 	void					setMaxDisplayName(const char* s) { mInfo->mMaxName = s; }
 	void					setMinDisplayName(const char* s) { mInfo->mMinName = s; }
 
-	const EVisualParamGroup	getGroup() 			{ return mInfo->mGroup; }
+	EVisualParamGroup		getGroup() 			{ return mInfo->mGroup; }
 	F32						getMinWeight() 		{ return mInfo->mMinWeight; }
 	F32						getMaxWeight() 		{ return mInfo->mMaxWeight; }
 	F32						getDefaultWeight() 	{ return mInfo->mDefaultWeight; }
diff --git a/linden/indra/llcommon/llenum.h b/linden/indra/llcommon/llenum.h
index 310ccd2..3e75a22 100644
--- a/linden/indra/llcommon/llenum.h
+++ b/linden/indra/llcommon/llenum.h
@@ -52,7 +52,7 @@ public:
 		}
 	}
 
-	const U32 operator[](std::string str)
+	U32 operator[](std::string str)
 	{
 		std::map<const std::string, const U32>::iterator itor;
 		itor = mEnumMap.find(str);
diff --git a/linden/indra/llcommon/llpreprocessor.h b/linden/indra/llcommon/llpreprocessor.h
index 495b9e8..76145c5 100644
--- a/linden/indra/llcommon/llpreprocessor.h
+++ b/linden/indra/llcommon/llpreprocessor.h
@@ -71,12 +71,22 @@
 	#define MOZILLA_INTERNAL_API 1
 #endif
 
-// Deal with minor differences on Unixy OSes.
-#if LL_DARWIN || LL_LINUX
+// Figure out differences between compilers
+#if defined(__GNUC__)
 	#define GCC_VERSION (__GNUC__ * 10000 \
 						+ __GNUC_MINOR__ * 100 \
 						+ __GNUC_PATCHLEVEL__)
+	#ifndef LL_GNUC
+		#define LL_GNUC 1
+	#endif
+#elif defined(__MSVC_VER__) || defined(_MSC_VER)
+	#ifndef LL_MSVC
+		#define LL_MSVC 1
+	#endif
+#endif
 
+// Deal with minor differences on Unixy OSes.
+#if LL_DARWIN || LL_LINUX
 	// Different name, same functionality.
 	#define stricmp strcasecmp
 	#define strnicmp strncasecmp
@@ -89,9 +99,9 @@
 #endif
 
 // Deal with the differeneces on Windows
-#if LL_WINDOWS
+#if LL_MSVC
 #define snprintf safe_snprintf		/* Flawfinder: ignore */
-#endif	// LL_WINDOWS
+#endif	// LL_MSVC
 
 // Static linking with apr on windows needs to be declared.
 #ifdef LL_WINDOWS
@@ -110,7 +120,7 @@
 
 
 // Deal with VC6 problems
-#if defined(LL_WINDOWS)
+#if LL_MSVC
 #pragma warning( 3	     : 4701 )	// "local variable used without being initialized"  Treat this as level 3, not level 4.
 #pragma warning( 3	     : 4702 )	// "unreachable code"  Treat this as level 3, not level 4.
 #pragma warning( 3	     : 4189 )	// "local variable initialized but not referenced"  Treat this as level 3, not level 4.
@@ -121,6 +131,6 @@
 #pragma warning( disable : 4503 )	// 'decorated name length exceeded, name was truncated'. Does not seem to affect compilation.
 #pragma warning( disable : 4800 )	// 'BOOL' : forcing value to bool 'true' or 'false' (performance warning)
 #pragma warning( disable : 4996 )	// warning: deprecated
-#endif	//	LL_WINDOWS
+#endif	//	LL_MSVC
 
 #endif	//	not LL_LINDEN_PREPROCESSOR_H
diff --git a/linden/indra/llcommon/llprocessor.cpp b/linden/indra/llcommon/llprocessor.cpp
index bd21351..e76294d 100644
--- a/linden/indra/llcommon/llprocessor.cpp
+++ b/linden/indra/llcommon/llprocessor.cpp
@@ -1538,6 +1538,7 @@ void CProcessor::GetStandardProcessorExtensions()
 	CPUInfo._Ext.FXSR_FastStreamingSIMD_ExtensionsSaveRestore	= CheckBit(edxreg, 24);
 	CPUInfo._Ext.SSE_StreamingSIMD_Extensions					= CheckBit(edxreg, 25);
 	CPUInfo._Ext.SSE2_StreamingSIMD2_Extensions					= CheckBit(edxreg, 26);
+	CPUInfo._Ext.Altivec_Extensions = false;
 	CPUInfo._Ext.SS_SelfSnoop									= CheckBit(edxreg, 27);
 	CPUInfo._Ext.HT_HyperThreading								= CheckBit(edxreg, 28);
 	CPUInfo._Ext.HT_HyterThreadingSiblings = (ebxreg >> 16) & 0xFF;
@@ -1891,11 +1892,12 @@ const ProcessorInfo *CProcessor::GetCPUInfo()
 		break;
 	}
 
-	// It's kinda like MMX or SSE...
 	CPUInfo._Ext.EMMX_MultimediaExtensions = 
 	CPUInfo._Ext.MMX_MultimediaExtensions = 
 	CPUInfo._Ext.SSE_StreamingSIMD_Extensions =
-	CPUInfo._Ext.SSE2_StreamingSIMD2_Extensions = hasFeature("hw.optional.altivec");
+	CPUInfo._Ext.SSE2_StreamingSIMD2_Extensions = false;
+
+	CPUInfo._Ext.Altivec_Extensions = hasFeature("hw.optional.altivec");
 
 #endif
 
@@ -1912,6 +1914,7 @@ const ProcessorInfo *CProcessor::GetCPUInfo()
 	CPUInfo._Ext.MMX_MultimediaExtensions = hasFeature("hw.optional.mmx");
 	CPUInfo._Ext.SSE_StreamingSIMD_Extensions = hasFeature("hw.optional.sse");
 	CPUInfo._Ext.SSE2_StreamingSIMD2_Extensions = hasFeature("hw.optional.sse2");
+	CPUInfo._Ext.Altivec_Extensions = false;
 	CPUInfo._Ext.AA64_AMD64BitArchitecture = hasFeature("hw.optional.x86_64");
 
 #endif
@@ -2065,6 +2068,7 @@ bool CProcessor::CPUInfoToText(char *strBuffer, unsigned int uiMaxLen)
 	BOOLADD("SS     Self Snoop:                                 ", CPUInfo._Ext.SS_SelfSnoop);
 	BOOLADD("SSE    Streaming SIMD Extensions:                  ", CPUInfo._Ext.SSE_StreamingSIMD_Extensions);
 	BOOLADD("SSE2   Streaming SIMD 2 Extensions:                ", CPUInfo._Ext.SSE2_StreamingSIMD2_Extensions);
+	BOOLADD("ALTVEC Altivec Extensions:                         ", CPUInfo._Ext.Altivec_Extensions);
 	BOOLADD("TM     Thermal Monitor:                            ", CPUInfo._Ext.TM_ThermalMonitor);
 	BOOLADD("TSC    Time Stamp Counter:                         ", CPUInfo._Ext.TSC_TimeStampCounter);
 	BOOLADD("VME    Virtual 8086 Mode Enhancements:             ", CPUInfo._Ext.VME_Virtual8086ModeEnhancements);
diff --git a/linden/indra/llcommon/llprocessor.h b/linden/indra/llcommon/llprocessor.h
index fd9a5da..6db9328 100644
--- a/linden/indra/llcommon/llprocessor.h
+++ b/linden/indra/llcommon/llprocessor.h
@@ -71,6 +71,7 @@ typedef struct ProcessorExtensions
 	bool FXSR_FastStreamingSIMD_ExtensionsSaveRestore;
 	bool SSE_StreamingSIMD_Extensions;
 	bool SSE2_StreamingSIMD2_Extensions;
+	bool Altivec_Extensions;
 	bool SS_SelfSnoop;
 	bool HT_HyperThreading;
 	unsigned int HT_HyterThreadingSiblings;
diff --git a/linden/indra/llcommon/llskiplist.h b/linden/indra/llcommon/llskiplist.h
index be3385d..40d0c8a 100644
--- a/linden/indra/llcommon/llskiplist.h
+++ b/linden/indra/llcommon/llskiplist.h
@@ -28,11 +28,10 @@
 #ifndef LL_LLSKIPLIST_H
 #define LL_LLSKIPLIST_H
 
-#include "llerror.h"
-//#include "vmath.h"
+#include "llrand.h"
 
 // NOTA BENE: Insert first needs to be < NOT <=
-
+// Binary depth must be >= 2
 template <class DATA_TYPE, S32 BINARY_DEPTH = 10>
 class LLSkipList
 {
@@ -144,14 +143,11 @@ private:
 // Implementation
 //
 
+
+// Binary depth must be >= 2
 template <class DATA_TYPE, S32 BINARY_DEPTH>
 inline void LLSkipList<DATA_TYPE, BINARY_DEPTH>::init()
 {
-	if (BINARY_DEPTH < 2)
-	{
-		llerrs << "Trying to create skip list with too little depth, "
-			"must be 2 or greater" << llendl;
-	}
 	S32 i;
 	for (i = 0; i < BINARY_DEPTH; i++)
 	{
diff --git a/linden/indra/llcommon/llsys.cpp b/linden/indra/llcommon/llsys.cpp
index 48f2474..33e5cda 100644
--- a/linden/indra/llcommon/llsys.cpp
+++ b/linden/indra/llcommon/llsys.cpp
@@ -304,12 +304,33 @@ LLCPUInfo::LLCPUInfo()
 {
 	CProcessor proc;
 	const ProcessorInfo* info = proc.GetCPUInfo();
-	mHasSSE = (info->_Ext.SSE_StreamingSIMD_Extensions != 0);
-	mHasSSE2 = (info->_Ext.SSE2_StreamingSIMD2_Extensions != 0);
+	// proc.WriteInfoTextFile("procInfo.txt");
+	mHasSSE = info->_Ext.SSE_StreamingSIMD_Extensions;
+	mHasSSE2 = info->_Ext.SSE2_StreamingSIMD2_Extensions;
+	mHasAltivec = info->_Ext.Altivec_Extensions;
 	mCPUMhz = (S32)(proc.GetCPUFrequency(50)/1000000.0);
 	mFamily.assign( info->strFamily );
 }
 
+bool LLCPUInfo::hasAltivec() const
+{
+	return mHasAltivec;
+}
+
+bool LLCPUInfo::hasSSE() const
+{
+	return mHasSSE;
+}
+
+bool LLCPUInfo::hasSSE2() const
+{
+	return mHasSSE2;
+}
+
+S32 LLCPUInfo::getMhz() const
+{
+	return mCPUMhz;
+}
 
 std::string LLCPUInfo::getCPUString() const
 {
diff --git a/linden/indra/llcommon/llsys.h b/linden/indra/llcommon/llsys.h
index 2047d9a..83ea081 100644
--- a/linden/indra/llcommon/llsys.h
+++ b/linden/indra/llcommon/llsys.h
@@ -72,16 +72,18 @@ public:
 
 	std::string getCPUString() const;
 
-	BOOL  hasSSE() const	{ return mHasSSE; }
-	BOOL  hasSSE2()	const	{ return mHasSSE2; }
-	S32	  getMhz() const	{ return mCPUMhz; }
+	bool hasAltivec() const;
+	bool hasSSE() const;
+	bool hasSSE2() const;
+	S32	 getMhz() const;
 
 	// Family is "AMD Duron" or "Intel Pentium Pro"
 	const std::string& getFamily() const { return mFamily; }
 
 private:
-	BOOL mHasSSE;
-	BOOL mHasSSE2;
+	bool mHasSSE;
+	bool mHasSSE2;
+	bool mHasAltivec;
 	S32 mCPUMhz;
 	std::string mFamily;
 };
diff --git a/linden/indra/llcommon/llversion.h b/linden/indra/llcommon/llversion.h
index 096cf2e..eb8310e 100644
--- a/linden/indra/llcommon/llversion.h
+++ b/linden/indra/llcommon/llversion.h
@@ -31,7 +31,7 @@
 
 const S32 LL_VERSION_MAJOR = 1;
 const S32 LL_VERSION_MINOR = 17;
-const S32 LL_VERSION_PATCH = 2;
+const S32 LL_VERSION_PATCH = 3;
 const S32 LL_VERSION_BUILD = 0;
 
 #endif
diff --git a/linden/indra/llcommon/metaclass.cpp b/linden/indra/llcommon/metaclass.cpp
index 251795e..e545411 100644
--- a/linden/indra/llcommon/metaclass.cpp
+++ b/linden/indra/llcommon/metaclass.cpp
@@ -28,7 +28,10 @@
  * COMPLETENESS OR PERFORMANCE.
  */
 
+#include "linden_common.h" 
+
 #include "metaclass.h"
+
 #include "metaproperty.h"
 #include "reflective.h"
 
diff --git a/linden/indra/llcommon/metaproperty.cpp b/linden/indra/llcommon/metaproperty.cpp
index 23ed7d9..221f7a7 100644
--- a/linden/indra/llcommon/metaproperty.cpp
+++ b/linden/indra/llcommon/metaproperty.cpp
@@ -28,7 +28,10 @@
  * COMPLETENESS OR PERFORMANCE.
  */
 
+#include "linden_common.h" 
+
 #include "metaproperty.h"
+
 #include "metaclass.h"
 
 LLMetaProperty::LLMetaProperty(const std::string& name, const LLMetaClass& object_class) : 
diff --git a/linden/indra/llcommon/reflective.cpp b/linden/indra/llcommon/reflective.cpp
index 7c07d88..c8050e0 100644
--- a/linden/indra/llcommon/reflective.cpp
+++ b/linden/indra/llcommon/reflective.cpp
@@ -27,6 +27,8 @@
  * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
  * COMPLETENESS OR PERFORMANCE.
  */
+
+#include "linden_common.h" 
  
 #include "reflective.h"
 
diff --git a/linden/indra/llinventory/llparcel.h b/linden/indra/llinventory/llparcel.h
index a33ffad..66af8ad 100644
--- a/linden/indra/llinventory/llparcel.h
+++ b/linden/indra/llinventory/llparcel.h
@@ -298,7 +298,7 @@ public:
 	const char*		getMusicURL() const			{ return mMusicURL.c_str(); }
 	const char*		getMediaURL() const			{ return mMediaURL.c_str(); }
 	const LLUUID&	getMediaID() const			{ return mMediaID; }
-	const U8		getMediaAutoScale() const	{ return mMediaAutoScale; }
+	U8				getMediaAutoScale() const	{ return mMediaAutoScale; }
 	S32				getLocalID() const			{ return mLocalID; }
 	const LLUUID&	getOwnerID() const			{ return mOwnerID; }
 	const LLUUID&	getGroupID() const			{ return mGroupID; }
diff --git a/linden/indra/llinventory/llparcelflags.h b/linden/indra/llinventory/llparcelflags.h
index 38d49fe..0c07b29 100644
--- a/linden/indra/llinventory/llparcelflags.h
+++ b/linden/indra/llinventory/llparcelflags.h
@@ -64,7 +64,7 @@ const U32 PF_ALLOW_GROUP_OBJECT_ENTRY	= 1 << 28;	// Only allow group (and owner)
 const U32 PF_ALLOW_VOICE_CHAT			= 1 << 29;	// Allow residents to use voice chat on this parcel
 const U32 PF_USE_ESTATE_VOICE_CHAN      = 1 << 30;
 
-const U32 PF_RESERVED			= 1 << 31;
+const U32 PF_RESERVED			= 1U << 31;
 
 // If any of these are true the parcel is restricting access in some maner.
 const U32 PF_USE_RESTRICTED_ACCESS = PF_USE_ACCESS_GROUP
diff --git a/linden/indra/llmath/llmath.vcproj b/linden/indra/llmath/llmath.vcproj
index 4876065..bdc8ded 100644
--- a/linden/indra/llmath/llmath.vcproj
+++ b/linden/indra/llmath/llmath.vcproj
@@ -272,6 +272,18 @@
 				RelativePath=".\lluuid.h">
 			</File>
 			<File
+				RelativePath=".\llv4math.h">
+			</File>
+			<File
+				RelativePath=".\llv4matrix3.h">
+			</File>
+			<File
+				RelativePath=".\llv4matrix4.h">
+			</File>
+			<File
+				RelativePath=".\llv4vector3.h">
+			</File>
+			<File
 				RelativePath=".\llvolume.h">
 			</File>
 			<File
diff --git a/linden/indra/llmath/llmath_vc8.vcproj b/linden/indra/llmath/llmath_vc8.vcproj
index ea23702..03d75c3 100644
--- a/linden/indra/llmath/llmath_vc8.vcproj
+++ b/linden/indra/llmath/llmath_vc8.vcproj
@@ -389,6 +389,22 @@
 				>
 			</File>
 			<File
+				RelativePath=".\llv4math.h"
+				>
+			</File>
+			<File
+				RelativePath=".\llv4matrix3.h"
+				>
+			</File>
+			<File
+				RelativePath=".\llv4matrix4.h"
+				>
+			</File>
+			<File
+				RelativePath=".\llv4vector3.h"
+				>
+			</File>
+			<File
 				RelativePath=".\llvolume.h"
 				>
 			</File>
diff --git a/linden/indra/llmath/lluuid.h b/linden/indra/llmath/lluuid.h
index 99cd585..6334ea4 100644
--- a/linden/indra/llmath/lluuid.h
+++ b/linden/indra/llmath/lluuid.h
@@ -317,6 +317,8 @@ typedef LLUUID LLAssetID;
 class LLTransactionID : public LLUUID
 {
 public:
+	LLTransactionID() : LLUUID() { }
+	
 	static const LLTransactionID tnull;
 	LLAssetID makeAssetID(const LLUUID& session) const;
 };
diff --git a/linden/indra/llmath/llv4math.h b/linden/indra/llmath/llv4math.h
new file mode 100644
index 0000000..d0b956b
--- /dev/null
+++ b/linden/indra/llmath/llv4math.h
@@ -0,0 +1,121 @@
+/** 
+ * @file llviewerjointmesh.cpp
+ * @brief LLV4* class header file - vector processor enabled math
+ *
+ * Copyright (c) 2007-2007, Linden Research, Inc.
+ * 
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab.  Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlife.com/developers/opensource/gplv2
+ * 
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at http://secondlife.com/developers/opensource/flossexception
+ * 
+ * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
+ * 
+ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+ * COMPLETENESS OR PERFORMANCE.
+ */
+
+#ifndef	LL_LLV4MATH_H
+#define	LL_LLV4MATH_H
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+// LLV4MATH - GNUC
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+
+#if LL_GNUC && __GNUC__ >= 4 && __SSE__
+
+#define			LL_VECTORIZE					1
+
+#if LL_DARWIN
+
+#include <Accelerate/Accelerate.h>
+#include <xmmintrin.h>
+typedef vFloat	V4F32;
+
+#else
+
+#include <xmmintrin.h>
+typedef float	V4F32							__attribute__((vector_size(16)));
+
+#endif
+
+#endif
+#if LL_GNUC
+
+#define			LL_LLV4MATH_ALIGN_PREFIX
+#define			LL_LLV4MATH_ALIGN_POSTFIX		__attribute__((aligned(16)))
+
+#endif
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+// LLV4MATH - MSVC
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+
+#if LL_MSVC && _M_IX86_FP
+
+#define			LL_VECTORIZE					1
+
+#include <xmmintrin.h>
+
+typedef __m128	V4F32;
+
+#endif
+#if LL_MSVC
+
+#define			LL_LLV4MATH_ALIGN_PREFIX		__declspec(align(16))
+#define			LL_LLV4MATH_ALIGN_POSTFIX
+
+#endif
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+// LLV4MATH - default - no vectorization
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+
+#if !LL_VECTORIZE
+
+#define			LL_VECTORIZE					0
+
+struct			V4F32							{ F32 __pad__[4]; };
+
+inline F32 llv4lerp(F32 a, F32 b, F32 w)		{ return ( b - a ) * w + a; }
+
+#endif
+
+#ifndef			LL_LLV4MATH_ALIGN_PREFIX
+#	define			LL_LLV4MATH_ALIGN_PREFIX
+#endif
+#ifndef			LL_LLV4MATH_ALIGN_POSTFIX
+#	define			LL_LLV4MATH_ALIGN_POSTFIX
+#endif
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+// LLV4MATH
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+
+
+#define			LLV4_NUM_AXIS					4
+
+class LLV4Vector3;
+class LLV4Matrix3;
+class LLV4Matrix4;
+
+#endif
diff --git a/linden/indra/llmath/llv4matrix3.h b/linden/indra/llmath/llv4matrix3.h
new file mode 100644
index 0000000..0811338
--- /dev/null
+++ b/linden/indra/llmath/llv4matrix3.h
@@ -0,0 +1,222 @@
+/** 
+ * @file llviewerjointmesh.cpp
+ * @brief LLV4* class header file - vector processor enabled math
+ *
+ * Copyright (c) 2007-2007, Linden Research, Inc.
+ * 
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab.  Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlife.com/developers/opensource/gplv2
+ * 
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at http://secondlife.com/developers/opensource/flossexception
+ * 
+ * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
+ * 
+ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+ * COMPLETENESS OR PERFORMANCE.
+ */
+
+#ifndef LL_LLV4MATRIX3_H
+#define LL_LLV4MATRIX3_H
+
+#include "llv4math.h"
+#include "llv4vector3.h"
+#include "m3math.h"			// for operator LLMatrix3()
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+// LLV4Matrix3
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+
+LL_LLV4MATH_ALIGN_PREFIX
+
+class LLV4Matrix3
+{
+public:
+	union {
+		F32		mMatrix[LLV4_NUM_AXIS][LLV4_NUM_AXIS];
+		V4F32	mV[LLV4_NUM_AXIS];
+	};
+
+	void				lerp(const LLV4Matrix3 &a, const LLV4Matrix3 &b, const F32 &w);
+	void				multiply(const LLVector3 &a, LLVector3& out) const;
+	void				multiply(const LLVector4 &a, LLV4Vector3& out) const;
+	void				multiply(const LLVector3 &a, LLV4Vector3& out) const;
+
+	const LLV4Matrix3&	transpose();
+	const LLV4Matrix3&	operator=(const LLMatrix3& a);
+
+	operator			LLMatrix3()	const { return (reinterpret_cast<const LLMatrix4*>(const_cast<const F32*>(&mMatrix[0][0])))->getMat3(); }
+
+	friend LLVector3	operator*(const LLVector3& a, const LLV4Matrix3& b);
+}
+
+LL_LLV4MATH_ALIGN_POSTFIX;
+
+
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+// LLV4Matrix3 - SSE
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+
+#if LL_VECTORIZE
+
+inline void LLV4Matrix3::lerp(const LLV4Matrix3 &a, const LLV4Matrix3 &b, const F32 &w)
+{
+	__m128 vw = _mm_set1_ps(w);
+	mV[VX] = _mm_add_ps(_mm_mul_ps(_mm_sub_ps(b.mV[VX], a.mV[VX]), vw), a.mV[VX]); // ( b - a ) * w + a
+	mV[VY] = _mm_add_ps(_mm_mul_ps(_mm_sub_ps(b.mV[VY], a.mV[VY]), vw), a.mV[VY]);
+	mV[VZ] = _mm_add_ps(_mm_mul_ps(_mm_sub_ps(b.mV[VZ], a.mV[VZ]), vw), a.mV[VZ]);
+}
+
+inline void LLV4Matrix3::multiply(const LLVector3 &a, LLVector3& o) const
+{
+	LLV4Vector3 j;
+	j.v = 				 	_mm_mul_ps(_mm_set1_ps(a.mV[VX]), mV[VX]); // ( ax * vx ) + ...
+	j.v = _mm_add_ps(j.v  , _mm_mul_ps(_mm_set1_ps(a.mV[VY]), mV[VY]));
+	j.v = _mm_add_ps(j.v  , _mm_mul_ps(_mm_set1_ps(a.mV[VZ]), mV[VZ]));
+	o.setVec(j.mV);
+}
+
+inline void LLV4Matrix3::multiply(const LLVector4 &a, LLV4Vector3& o) const
+{
+	o.v =					_mm_mul_ps(_mm_set1_ps(a.mV[VX]), mV[VX]); // ( ax * vx ) + ...
+	o.v = _mm_add_ps(o.v  , _mm_mul_ps(_mm_set1_ps(a.mV[VY]), mV[VY]));
+	o.v = _mm_add_ps(o.v  , _mm_mul_ps(_mm_set1_ps(a.mV[VZ]), mV[VZ]));
+}
+
+inline void LLV4Matrix3::multiply(const LLVector3 &a, LLV4Vector3& o) const
+{
+	o.v =					_mm_mul_ps(_mm_set1_ps(a.mV[VX]), mV[VX]); // ( ax * vx ) + ...
+	o.v = _mm_add_ps(o.v  , _mm_mul_ps(_mm_set1_ps(a.mV[VY]), mV[VY]));
+	o.v = _mm_add_ps(o.v  , _mm_mul_ps(_mm_set1_ps(a.mV[VZ]), mV[VZ]));
+}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+// LLV4Matrix3
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+
+#else
+
+inline void LLV4Matrix3::lerp(const LLV4Matrix3 &a, const LLV4Matrix3 &b, const F32 &w)
+{
+	mMatrix[VX][VX] = llv4lerp(a.mMatrix[VX][VX], b.mMatrix[VX][VX], w);
+	mMatrix[VX][VY] = llv4lerp(a.mMatrix[VX][VY], b.mMatrix[VX][VY], w);
+	mMatrix[VX][VZ] = llv4lerp(a.mMatrix[VX][VZ], b.mMatrix[VX][VZ], w);
+
+	mMatrix[VY][VX] = llv4lerp(a.mMatrix[VY][VX], b.mMatrix[VY][VX], w);
+	mMatrix[VY][VY] = llv4lerp(a.mMatrix[VY][VY], b.mMatrix[VY][VY], w);
+	mMatrix[VY][VZ] = llv4lerp(a.mMatrix[VY][VZ], b.mMatrix[VY][VZ], w);
+
+	mMatrix[VZ][VX] = llv4lerp(a.mMatrix[VZ][VX], b.mMatrix[VZ][VX], w);
+	mMatrix[VZ][VY] = llv4lerp(a.mMatrix[VZ][VY], b.mMatrix[VZ][VY], w);
+	mMatrix[VZ][VZ] = llv4lerp(a.mMatrix[VZ][VZ], b.mMatrix[VZ][VZ], w);
+}
+
+inline void LLV4Matrix3::multiply(const LLVector3 &a, LLVector3& o) const
+{
+	o.setVec(		a.mV[VX] * mMatrix[VX][VX] + 
+					a.mV[VY] * mMatrix[VY][VX] + 
+					a.mV[VZ] * mMatrix[VZ][VX],
+					 
+					a.mV[VX] * mMatrix[VX][VY] + 
+					a.mV[VY] * mMatrix[VY][VY] + 
+					a.mV[VZ] * mMatrix[VZ][VY],
+					 
+					a.mV[VX] * mMatrix[VX][VZ] + 
+					a.mV[VY] * mMatrix[VY][VZ] + 
+					a.mV[VZ] * mMatrix[VZ][VZ]);
+}
+
+inline void LLV4Matrix3::multiply(const LLVector4 &a, LLV4Vector3& o) const
+{
+	o.setVec(		a.mV[VX] * mMatrix[VX][VX] + 
+					a.mV[VY] * mMatrix[VY][VX] + 
+					a.mV[VZ] * mMatrix[VZ][VX],
+					 
+					a.mV[VX] * mMatrix[VX][VY] + 
+					a.mV[VY] * mMatrix[VY][VY] + 
+					a.mV[VZ] * mMatrix[VZ][VY],
+					 
+					a.mV[VX] * mMatrix[VX][VZ] + 
+					a.mV[VY] * mMatrix[VY][VZ] + 
+					a.mV[VZ] * mMatrix[VZ][VZ]);
+}
+
+inline void LLV4Matrix3::multiply(const LLVector3 &a, LLV4Vector3& o) const
+{
+	o.setVec(		a.mV[VX] * mMatrix[VX][VX] + 
+					a.mV[VY] * mMatrix[VY][VX] + 
+					a.mV[VZ] * mMatrix[VZ][VX],
+					 
+					a.mV[VX] * mMatrix[VX][VY] + 
+					a.mV[VY] * mMatrix[VY][VY] + 
+					a.mV[VZ] * mMatrix[VZ][VY],
+					 
+					a.mV[VX] * mMatrix[VX][VZ] + 
+					a.mV[VY] * mMatrix[VY][VZ] + 
+					a.mV[VZ] * mMatrix[VZ][VZ]);
+}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+// LLV4Matrix3
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+
+#endif
+
+inline const LLV4Matrix3&	LLV4Matrix3::transpose()
+{
+#if LL_VECTORIZE && defined(_MM_TRANSPOSE4_PS)
+	_MM_TRANSPOSE4_PS(mV[VX], mV[VY], mV[VZ], mV[VW]);
+	return *this;
+#else
+	F32 temp;
+	temp = mMatrix[VX][VY]; mMatrix[VX][VY] = mMatrix[VY][VX]; mMatrix[VY][VX] = temp;
+	temp = mMatrix[VX][VZ]; mMatrix[VX][VZ] = mMatrix[VZ][VX]; mMatrix[VZ][VX] = temp;
+	temp = mMatrix[VY][VZ]; mMatrix[VY][VZ] = mMatrix[VZ][VY]; mMatrix[VZ][VY] = temp;
+#endif
+	return *this;
+}
+
+inline const LLV4Matrix3& LLV4Matrix3::operator=(const LLMatrix3& a)
+{
+	memcpy(mMatrix[VX], a.mMatrix[VX], sizeof(F32) * 3 );
+	memcpy(mMatrix[VY], a.mMatrix[VY], sizeof(F32) * 3 );
+	memcpy(mMatrix[VZ], a.mMatrix[VZ], sizeof(F32) * 3 );
+	return *this;
+}
+
+inline LLVector3 operator*(const LLVector3& a, const LLV4Matrix3& b)
+{
+	return LLVector3(
+				a.mV[VX] * b.mMatrix[VX][VX] + 
+				a.mV[VY] * b.mMatrix[VY][VX] + 
+				a.mV[VZ] * b.mMatrix[VZ][VX],
+	
+				a.mV[VX] * b.mMatrix[VX][VY] + 
+				a.mV[VY] * b.mMatrix[VY][VY] + 
+				a.mV[VZ] * b.mMatrix[VZ][VY],
+	
+				a.mV[VX] * b.mMatrix[VX][VZ] + 
+				a.mV[VY] * b.mMatrix[VY][VZ] + 
+				a.mV[VZ] * b.mMatrix[VZ][VZ] );
+}
+
+#endif
diff --git a/linden/indra/llmath/llv4matrix4.h b/linden/indra/llmath/llv4matrix4.h
new file mode 100644
index 0000000..38280a2
--- /dev/null
+++ b/linden/indra/llmath/llv4matrix4.h
@@ -0,0 +1,251 @@
+/** 
+ * @file llviewerjointmesh.cpp
+ * @brief LLV4* class header file - vector processor enabled math
+ *
+ * Copyright (c) 2007-2007, Linden Research, Inc.
+ * 
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab.  Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlife.com/developers/opensource/gplv2
+ * 
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at http://secondlife.com/developers/opensource/flossexception
+ * 
+ * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
+ * 
+ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+ * COMPLETENESS OR PERFORMANCE.
+ */
+
+#ifndef LL_LLV4MATRIX4_H
+#define LL_LLV4MATRIX4_H
+
+#include "llv4math.h"
+#include "llv4matrix3.h"	// just for operator LLV4Matrix3()
+#include "llv4vector3.h"
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+// LLV4Matrix4
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+
+LL_LLV4MATH_ALIGN_PREFIX
+
+class LLV4Matrix4
+{
+public:
+	union {
+		F32		mMatrix[LLV4_NUM_AXIS][LLV4_NUM_AXIS];
+		V4F32	mV[LLV4_NUM_AXIS];
+	};
+
+	void				lerp(const LLV4Matrix4 &a, const LLV4Matrix4 &b, const F32 &w);
+	void				multiply(const LLVector3 &a, LLVector3& o) const;
+	void				multiply(const LLVector3 &a, LLV4Vector3& o) const;
+
+	const LLV4Matrix4&	transpose();
+	const LLV4Matrix4&  translate(const LLVector3 &vec);
+	const LLV4Matrix4&  translate(const LLV4Vector3 &vec);
+	const LLV4Matrix4&	operator=(const LLMatrix4& a);
+
+	operator			LLMatrix4()	const { return *(reinterpret_cast<const LLMatrix4*>(const_cast<const F32*>(&mMatrix[0][0]))); }
+	operator			LLV4Matrix3()	const { return *(reinterpret_cast<const LLV4Matrix3*>(const_cast<const F32*>(&mMatrix[0][0]))); }
+	
+	friend LLVector3	operator*(const LLVector3 &a, const LLV4Matrix4 &b);
+}
+
+LL_LLV4MATH_ALIGN_POSTFIX;
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+// LLV4Matrix4 - SSE
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+
+#if LL_VECTORIZE
+
+inline void LLV4Matrix4::lerp(const LLV4Matrix4 &a, const LLV4Matrix4 &b, const F32 &w)
+{
+	__m128 vw = _mm_set1_ps(w);
+	mV[VX] = _mm_add_ps(_mm_mul_ps(_mm_sub_ps(b.mV[VX], a.mV[VX]), vw), a.mV[VX]); // ( b - a ) * w + a
+	mV[VY] = _mm_add_ps(_mm_mul_ps(_mm_sub_ps(b.mV[VY], a.mV[VY]), vw), a.mV[VY]);
+	mV[VZ] = _mm_add_ps(_mm_mul_ps(_mm_sub_ps(b.mV[VZ], a.mV[VZ]), vw), a.mV[VZ]);
+	mV[VW] = _mm_add_ps(_mm_mul_ps(_mm_sub_ps(b.mV[VW], a.mV[VW]), vw), a.mV[VW]);
+}
+
+inline void LLV4Matrix4::multiply(const LLVector3 &a, LLVector3& o) const
+{
+	LLV4Vector3 j;
+	j.v = _mm_add_ps(mV[VW], _mm_mul_ps(_mm_set1_ps(a.mV[VX]), mV[VX])); // ( ax * vx ) + vw
+	j.v = _mm_add_ps(j.v   , _mm_mul_ps(_mm_set1_ps(a.mV[VY]), mV[VY]));
+	j.v = _mm_add_ps(j.v   , _mm_mul_ps(_mm_set1_ps(a.mV[VZ]), mV[VZ]));
+	o.setVec(j.mV);
+}
+
+inline void LLV4Matrix4::multiply(const LLVector3 &a, LLV4Vector3& o) const
+{
+	o.v = _mm_add_ps(mV[VW], _mm_mul_ps(_mm_set1_ps(a.mV[VX]), mV[VX])); // ( ax * vx ) + vw
+	o.v = _mm_add_ps(o.v   , _mm_mul_ps(_mm_set1_ps(a.mV[VY]), mV[VY]));
+	o.v = _mm_add_ps(o.v   , _mm_mul_ps(_mm_set1_ps(a.mV[VZ]), mV[VZ]));
+}
+
+inline const LLV4Matrix4& LLV4Matrix4::translate(const LLV4Vector3 &vec)
+{
+	mV[VW] = _mm_add_ps(mV[VW], vec.v);
+	return (*this);
+}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+// LLV4Matrix4
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+
+#else
+
+inline void LLV4Matrix4::lerp(const LLV4Matrix4 &a, const LLV4Matrix4 &b, const F32 &w)
+{
+	mMatrix[VX][VX] = llv4lerp(a.mMatrix[VX][VX], b.mMatrix[VX][VX], w);
+	mMatrix[VX][VY] = llv4lerp(a.mMatrix[VX][VY], b.mMatrix[VX][VY], w);
+	mMatrix[VX][VZ] = llv4lerp(a.mMatrix[VX][VZ], b.mMatrix[VX][VZ], w);
+
+	mMatrix[VY][VX] = llv4lerp(a.mMatrix[VY][VX], b.mMatrix[VY][VX], w);
+	mMatrix[VY][VY] = llv4lerp(a.mMatrix[VY][VY], b.mMatrix[VY][VY], w);
+	mMatrix[VY][VZ] = llv4lerp(a.mMatrix[VY][VZ], b.mMatrix[VY][VZ], w);
+
+	mMatrix[VZ][VX] = llv4lerp(a.mMatrix[VZ][VX], b.mMatrix[VZ][VX], w);
+	mMatrix[VZ][VY] = llv4lerp(a.mMatrix[VZ][VY], b.mMatrix[VZ][VY], w);
+	mMatrix[VZ][VZ] = llv4lerp(a.mMatrix[VZ][VZ], b.mMatrix[VZ][VZ], w);
+
+	mMatrix[VW][VX] = llv4lerp(a.mMatrix[VW][VX], b.mMatrix[VW][VX], w);
+	mMatrix[VW][VY] = llv4lerp(a.mMatrix[VW][VY], b.mMatrix[VW][VY], w);
+	mMatrix[VW][VZ] = llv4lerp(a.mMatrix[VW][VZ], b.mMatrix[VW][VZ], w);
+}
+
+inline void LLV4Matrix4::multiply(const LLVector3 &a, LLVector3& o) const
+{
+	o.setVec(		a.mV[VX] * mMatrix[VX][VX] + 
+					a.mV[VY] * mMatrix[VY][VX] + 
+					a.mV[VZ] * mMatrix[VZ][VX] +
+					mMatrix[VW][VX],
+					 
+					a.mV[VX] * mMatrix[VX][VY] + 
+					a.mV[VY] * mMatrix[VY][VY] + 
+					a.mV[VZ] * mMatrix[VZ][VY] +
+					mMatrix[VW][VY],
+					 
+					a.mV[VX] * mMatrix[VX][VZ] + 
+					a.mV[VY] * mMatrix[VY][VZ] + 
+					a.mV[VZ] * mMatrix[VZ][VZ] +
+					mMatrix[VW][VZ]);
+}
+
+inline void LLV4Matrix4::multiply(const LLVector3 &a, LLV4Vector3& o) const
+{
+	o.setVec(		a.mV[VX] * mMatrix[VX][VX] + 
+					a.mV[VY] * mMatrix[VY][VX] + 
+					a.mV[VZ] * mMatrix[VZ][VX] +
+					mMatrix[VW][VX],
+					 
+					a.mV[VX] * mMatrix[VX][VY] + 
+					a.mV[VY] * mMatrix[VY][VY] + 
+					a.mV[VZ] * mMatrix[VZ][VY] +
+					mMatrix[VW][VY],
+					 
+					a.mV[VX] * mMatrix[VX][VZ] + 
+					a.mV[VY] * mMatrix[VY][VZ] + 
+					a.mV[VZ] * mMatrix[VZ][VZ] +
+					mMatrix[VW][VZ]);
+}
+
+inline const LLV4Matrix4& LLV4Matrix4::translate(const LLV4Vector3 &vec)
+{
+	mMatrix[3][0] += vec.mV[0];
+	mMatrix[3][1] += vec.mV[1];
+	mMatrix[3][2] += vec.mV[2];
+	return (*this);
+}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+// LLV4Matrix4
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+
+#endif
+
+inline const LLV4Matrix4& LLV4Matrix4::operator=(const LLMatrix4& a)
+{
+	memcpy(mMatrix, a.mMatrix, sizeof(F32) * 16 );
+	return *this;
+}
+
+inline const LLV4Matrix4& LLV4Matrix4::transpose()
+{
+#if LL_VECTORIZE && defined(_MM_TRANSPOSE4_PS)
+	_MM_TRANSPOSE4_PS(mV[VX], mV[VY], mV[VZ], mV[VW]);
+#else
+	LLV4Matrix4 mat;
+	mat.mMatrix[0][0] = mMatrix[0][0];
+	mat.mMatrix[1][0] = mMatrix[0][1];
+	mat.mMatrix[2][0] = mMatrix[0][2];
+	mat.mMatrix[3][0] = mMatrix[0][3];
+
+	mat.mMatrix[0][1] = mMatrix[1][0];
+	mat.mMatrix[1][1] = mMatrix[1][1];
+	mat.mMatrix[2][1] = mMatrix[1][2];
+	mat.mMatrix[3][1] = mMatrix[1][3];
+
+	mat.mMatrix[0][2] = mMatrix[2][0];
+	mat.mMatrix[1][2] = mMatrix[2][1];
+	mat.mMatrix[2][2] = mMatrix[2][2];
+	mat.mMatrix[3][2] = mMatrix[2][3];
+
+	mat.mMatrix[0][3] = mMatrix[3][0];
+	mat.mMatrix[1][3] = mMatrix[3][1];
+	mat.mMatrix[2][3] = mMatrix[3][2];
+	mat.mMatrix[3][3] = mMatrix[3][3];
+
+	*this = mat;
+#endif
+	return *this;
+}
+
+inline const LLV4Matrix4& LLV4Matrix4::translate(const LLVector3 &vec)
+{
+	mMatrix[3][0] += vec.mV[0];
+	mMatrix[3][1] += vec.mV[1];
+	mMatrix[3][2] += vec.mV[2];
+	return (*this);
+}
+
+inline LLVector3 operator*(const LLVector3 &a, const LLV4Matrix4 &b)
+{
+	return LLVector3(a.mV[VX] * b.mMatrix[VX][VX] + 
+					 a.mV[VY] * b.mMatrix[VY][VX] + 
+					 a.mV[VZ] * b.mMatrix[VZ][VX] +
+					 b.mMatrix[VW][VX],
+					 
+					 a.mV[VX] * b.mMatrix[VX][VY] + 
+					 a.mV[VY] * b.mMatrix[VY][VY] + 
+					 a.mV[VZ] * b.mMatrix[VZ][VY] +
+					 b.mMatrix[VW][VY],
+					 
+					 a.mV[VX] * b.mMatrix[VX][VZ] + 
+					 a.mV[VY] * b.mMatrix[VY][VZ] + 
+					 a.mV[VZ] * b.mMatrix[VZ][VZ] +
+					 b.mMatrix[VW][VZ]);
+}
+
+
+#endif
diff --git a/linden/indra/llmath/llv4vector3.h b/linden/indra/llmath/llv4vector3.h
new file mode 100644
index 0000000..994e7f5
--- /dev/null
+++ b/linden/indra/llmath/llv4vector3.h
@@ -0,0 +1,82 @@
+/** 
+ * @file llviewerjointmesh.cpp
+ * @brief LLV4* class header file - vector processor enabled math
+ *
+ * Copyright (c) 2007-2007, Linden Research, Inc.
+ * 
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab.  Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlife.com/developers/opensource/gplv2
+ * 
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at http://secondlife.com/developers/opensource/flossexception
+ * 
+ * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
+ * 
+ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+ * COMPLETENESS OR PERFORMANCE.
+ */
+
+#ifndef LL_LLV4VECTOR3_H
+#define LL_LLV4VECTOR3_H
+
+#include "llv4math.h"
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+// LLV4Vector3
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+
+LL_LLV4MATH_ALIGN_PREFIX
+
+class LLV4Vector3
+{
+public:
+	union {
+		F32		mV[LLV4_NUM_AXIS];
+		V4F32	v;
+	};
+
+	enum {
+		ALIGNMENT = 16
+		};
+
+	void				setVec(F32 x, F32 y, F32 z);
+	void				setVec(F32 a);
+}
+
+LL_LLV4MATH_ALIGN_POSTFIX;
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+// LLV4Vector3
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+
+inline void	LLV4Vector3::setVec(F32 x, F32 y, F32 z)
+{
+	mV[VX] = x;
+	mV[VY] = y;
+	mV[VZ] = z;
+}
+
+inline void	LLV4Vector3::setVec(F32 a)
+{
+#if LL_VECTORIZE
+	v = _mm_set1_ps(a);
+#else
+	setVec(a, a, a);
+#endif
+}
+
+#endif
diff --git a/linden/indra/llmath/llvolume.h b/linden/indra/llmath/llvolume.h
index 3973f70..8292d0c 100644
--- a/linden/indra/llmath/llvolume.h
+++ b/linden/indra/llmath/llvolume.h
@@ -842,7 +842,7 @@ public:
 	U8 getPathType() const									{ return mPathp->mParams.getCurveType(); }
 	S32	getNumFaces() const									{ return (S32)mProfilep->mFaces.size(); }
 	S32 getNumVolumeFaces() const							{ return mNumVolumeFaces; }
-	const F32 getDetail() const								{ return mDetail; }
+	F32 getDetail() const								{ return mDetail; }
 	const LLVolumeParams & getParams() const				{ return mParams; }
 	LLVolumeParams getCopyOfParams() const					{ return mParams; }
 	const LLProfile& getProfile() const						{ return *mProfilep; }
diff --git a/linden/indra/llmath/v4color.h b/linden/indra/llmath/v4color.h
index d79b6c8..2e9d13f 100644
--- a/linden/indra/llmath/v4color.h
+++ b/linden/indra/llmath/v4color.h
@@ -93,7 +93,7 @@ class LLColor4
 		F32			magVec() const;				// Returns magnitude of LLColor4
 		F32			magVecSquared() const;		// Returns magnitude squared of LLColor4
 		F32			normVec();					// Normalizes and returns the magnitude of LLColor4
-		const BOOL		isOpaque() { return mV[VALPHA] == 1.f; }
+		BOOL		isOpaque() { return mV[VALPHA] == 1.f; }
 
 		F32 operator[](int idx) const { return mV[idx]; }
 		F32 &operator[](int idx) { return mV[idx]; }
diff --git a/linden/indra/llmessage/llteleportflags.h b/linden/indra/llmessage/llteleportflags.h
index 25aac14..60916bd 100644
--- a/linden/indra/llmessage/llteleportflags.h
+++ b/linden/indra/llmessage/llteleportflags.h
@@ -44,6 +44,7 @@ const U32 TELEPORT_FLAGS_911 				= 1 << 10;
 const U32 TELEPORT_FLAGS_DISABLE_CANCEL		= 1 << 11;	// Used for llTeleportAgentHome()
 const U32 TELEPORT_FLAGS_VIA_REGION_ID  	= 1 << 12;
 const U32 TELEPORT_FLAGS_IS_FLYING			= 1 << 13;
+const U32 TELEPORT_FLAGS_SHOW_RESET_HOME	= 1 << 14;
 
 const U32 TELEPORT_FLAGS_MASK_VIA =   TELEPORT_FLAGS_VIA_LURE 
 									| TELEPORT_FLAGS_VIA_LANDMARK
diff --git a/linden/indra/llmessage/machine.h b/linden/indra/llmessage/machine.h
index 490ddc5..b28e621 100644
--- a/linden/indra/llmessage/machine.h
+++ b/linden/indra/llmessage/machine.h
@@ -62,8 +62,8 @@ public:
 
 	// get functions
 	EMachineType	getMachineType()	const { return mMachineType; }
-	const U32		getMachineIP()		const { return mHost.getAddress(); }
-	const S32		getMachinePort()	const { return mHost.getPort(); }
+	U32				getMachineIP()		const { return mHost.getAddress(); }
+	S32				getMachinePort()	const { return mHost.getPort(); }
 	const LLHost	&getMachineHost()	const { return mHost; }
 	// The control port is the listen port of the parent process that
 	// launched this machine. 0 means none or not known.
diff --git a/linden/indra/llmessage/net.cpp b/linden/indra/llmessage/net.cpp
index 1395093..92efd15 100644
--- a/linden/indra/llmessage/net.cpp
+++ b/linden/indra/llmessage/net.cpp
@@ -291,8 +291,9 @@ S32 start_net(S32& socket_out, int& nPort)
 
 void end_net(S32& socket_out)
 {
-	if (socket_out < 0)
+	if (socket_out >= 0)
 	{
+		shutdown(socket_out, SD_BOTH);
 		closesocket(socket_out);
 	}
 	WSACleanup();
@@ -463,7 +464,7 @@ S32 start_net(S32& socket_out, int& nPort)
 
 void end_net(S32& socket_out)
 {
-	if (socket_out < 0)
+	if (socket_out >= 0)
 	{
 		close(socket_out);
 	}
diff --git a/linden/indra/llprimitive/llprimitive.h b/linden/indra/llprimitive/llprimitive.h
index 29cd09f..1a568d1 100644
--- a/linden/indra/llprimitive/llprimitive.h
+++ b/linden/indra/llprimitive/llprimitive.h
@@ -340,14 +340,14 @@ public:
 	void 		setAcceleration(const F32 x, const F32 y, const F32 z)		{ mAcceleration.setVec(x,y,z); }
 #endif
 	
-	const LLPCode		getPCode() const			{ return mPrimitiveCode; }
+	LLPCode				getPCode() const			{ return mPrimitiveCode; }
 	const char *		getPCodeString() const		{ return pCodeToString(mPrimitiveCode); }
 	const LLVector3&	getAngularVelocity() const	{ return mAngularVelocity; }
 	const LLVector3&	getVelocity() const			{ return mVelocity; }
 	const LLVector3&	getAcceleration() const		{ return mAcceleration; }
-	const U8			getNumTEs() const			{ return mNumTEs; }
+	U8					getNumTEs() const			{ return mNumTEs; }
 
-	const U8			getMaterial() const			{ return mMaterial; }
+	U8					getMaterial() const			{ return mMaterial; }
 	
 	void				setVolumeType(const U8 code);
 	U8					getVolumeType();
diff --git a/linden/indra/llprimitive/lltreeparams.h b/linden/indra/llprimitive/lltreeparams.h
index 29bbc9a..2754eb4 100644
--- a/linden/indra/llprimitive/lltreeparams.h
+++ b/linden/indra/llprimitive/lltreeparams.h
@@ -32,7 +32,7 @@
 /* for information about formulas associated with each type
  * check the Weber + Penn paper
  */
-typedef enum EShapeRatio { SR_CONICAL, SR_SPHERICAL, SR_HEMISPHERICAL, 
+enum EShapeRatio { SR_CONICAL, SR_SPHERICAL, SR_HEMISPHERICAL, 
 				SR_CYLINDRICAL, SR_TAPERED_CYLINDRICAL, SR_FLAME, 
 				SR_INVERSE_CONICAL, SR_TEND_FLAME, SR_ENVELOPE};
 
diff --git a/linden/indra/llui/llscrolllistctrl.h b/linden/indra/llui/llscrolllistctrl.h
index 9829832..f1bd9bb 100644
--- a/linden/indra/llui/llscrolllistctrl.h
+++ b/linden/indra/llui/llscrolllistctrl.h
@@ -59,7 +59,7 @@ public:
 	virtual S32				getHeight() const = 0;
 	virtual const LLString&	getText() const { return LLString::null; }
 	virtual const LLString&	getTextLower() const { return LLString::null; }
-	virtual const BOOL		getVisible() const { return TRUE; }
+	virtual BOOL			getVisible() const { return TRUE; }
 	virtual void			setWidth(S32 width) = 0;
 	virtual void			highlightText(S32 offset, S32 num_chars) {}
 	virtual BOOL			isText() = 0;
@@ -96,7 +96,7 @@ public:
 	virtual void	setWidth(S32 width)			{ mWidth = width; }
 	virtual S32		getHeight() const			{ return llround(mFont->getLineHeight()); }
 	virtual const LLString&		getText() const		{ return mText.getString(); }
-	virtual const BOOL			getVisible() const  { return mVisible; }
+	virtual BOOL	getVisible() const  { return mVisible; }
 	virtual void	highlightText(S32 offset, S32 num_chars) {mHighlightOffset = offset; mHighlightCount = num_chars;}
 	void			setText(const LLString& text);
 	virtual void	setColor(const LLColor4&);
diff --git a/linden/indra/llui/lltextbox.cpp b/linden/indra/llui/lltextbox.cpp
index c4f2cea..ba0747f 100644
--- a/linden/indra/llui/lltextbox.cpp
+++ b/linden/indra/llui/lltextbox.cpp
@@ -439,6 +439,7 @@ LLView* LLTextBox::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *f
 		text,
 		font,
 		FALSE);
+		
 
 	LLFontGL::HAlign halign = LLView::selectFontHAlign(node);
 	text_box->setHAlign(halign);
@@ -450,6 +451,12 @@ LLView* LLTextBox::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *f
 	{
 		text_box->mFontStyle = LLFontGL::getStyleFromString(font_style);
 	}
+	
+	BOOL mouse_opaque;
+	if (node->getAttributeBOOL("mouse_opaque", mouse_opaque))
+	{
+		text_box->setMouseOpaque(mouse_opaque);
+	}	
 
 	if(node->hasAttribute("text_color"))
 	{
diff --git a/linden/indra/llui/lluictrl.h b/linden/indra/llui/lluictrl.h
index 3093437..5056319 100644
--- a/linden/indra/llui/lluictrl.h
+++ b/linden/indra/llui/lluictrl.h
@@ -136,7 +136,7 @@ public:
 	{
 		/*virtual*/ filterResult_t operator() (const LLView* const view, const viewList_t & children) const 
 		{
-			return filterResult_t(view->isCtrl() && static_cast<const LLUICtrl * const>(view)->hasTabStop() && children.size() == 0, TRUE);
+			return filterResult_t(view->isCtrl() && static_cast<const LLUICtrl *>(view)->hasTabStop() && children.size() == 0, TRUE);
 		}
 	};
 
@@ -144,7 +144,7 @@ public:
 	{
 		/*virtual*/ filterResult_t operator() (const LLView* const view, const viewList_t & children) const 
 		{
-			return filterResult_t(view->isCtrl() && static_cast<const LLUICtrl * const>(view)->acceptsTextInput(), TRUE);
+			return filterResult_t(view->isCtrl() && static_cast<const LLUICtrl *>(view)->acceptsTextInput(), TRUE);
 		}
 	};
 
diff --git a/linden/indra/llui/llview.cpp b/linden/indra/llui/llview.cpp
index 22d426a..0b04213 100644
--- a/linden/indra/llui/llview.cpp
+++ b/linden/indra/llui/llview.cpp
@@ -455,8 +455,8 @@ bool LLCompareByTabOrder::operator() (const LLView* const a, const LLView* const
 	if(b && b->isCtrl()) b_score--;
 	if(a_score == -2 && b_score == -2)
 	{
-		const LLUICtrl * const a_ctrl = static_cast<const LLUICtrl* const>(a);
-		const LLUICtrl * const b_ctrl = static_cast<const LLUICtrl* const>(b);
+		const LLUICtrl * const a_ctrl = static_cast<const LLUICtrl*>(a);
+		const LLUICtrl * const b_ctrl = static_cast<const LLUICtrl*>(b);
 		LLView::child_tab_order_const_iter_t a_found = mTabOrder.find(a_ctrl), b_found = mTabOrder.find(b_ctrl);
 		if(a_found != mTabOrder.end()) a_score--;
 		if(b_found != mTabOrder.end()) b_score--;
diff --git a/linden/indra/llui/llviewquery.cpp b/linden/indra/llui/llviewquery.cpp
index 65f191b..314a483 100644
--- a/linden/indra/llui/llviewquery.cpp
+++ b/linden/indra/llui/llviewquery.cpp
@@ -49,7 +49,7 @@ filterResult_t LLEnabledFilter::operator() (const LLView* const view, const view
 }
 filterResult_t LLTabStopFilter::operator() (const LLView* const view, const viewList_t & children) const 
 {
-	return filterResult_t(view->isCtrl() && static_cast<const LLUICtrl* const>(view)->hasTabStop(),
+	return filterResult_t(view->isCtrl() && static_cast<const LLUICtrl*>(view)->hasTabStop(),
 						view->canFocusChildren());
 }
 
diff --git a/linden/indra/llxml/llxmlnode.h b/linden/indra/llxml/llxmlnode.h
index f95a53b..3c338e2 100644
--- a/linden/indra/llxml/llxmlnode.h
+++ b/linden/indra/llxml/llxmlnode.h
@@ -171,12 +171,12 @@ public:
 	BOOL getAttributeString(const LLString& name, LLString& value );
 
     const ValueType& getType() const { return mType; }
-    const U32 getLength() const { return mLength; }
-    const U32 getPrecision() const { return mPrecision; }
+    U32 getLength() const { return mLength; }
+    U32 getPrecision() const { return mPrecision; }
     const LLString& getValue() const { return mValue; }
 	LLString getTextContents() const;
     const LLStringTableEntry* getName() const { return mName; }
-	const BOOL hasName(LLString name) const { return mName == gStringTable.checkStringEntry(name); }
+	BOOL hasName(LLString name) const { return mName == gStringTable.checkStringEntry(name); }
     const LLString& getID() const { return mID; }
 
     U32 getChildCount() const;
diff --git a/linden/indra/lscript/lscript_library.h b/linden/indra/lscript/lscript_library.h
index 8c4a3d0..353ff69 100644
--- a/linden/indra/lscript/lscript_library.h
+++ b/linden/indra/lscript/lscript_library.h
@@ -84,7 +84,7 @@ public:
 	LLQuaternion	mQuat;
 	LLScriptLibData *mListp;
 
-	friend const bool operator<=(const LLScriptLibData &a, const LLScriptLibData &b)
+	friend bool operator<=(const LLScriptLibData &a, const LLScriptLibData &b)
 	{
 		if (a.mType == b.mType)
 		{
@@ -112,7 +112,7 @@ public:
 		return TRUE;
 	}
 
-	friend const bool operator==(const LLScriptLibData &a, const LLScriptLibData &b)
+	friend bool operator==(const LLScriptLibData &a, const LLScriptLibData &b)
 	{
 		if (a.mType == b.mType)
 		{
diff --git a/linden/indra/newview/English.lproj/InfoPlist.strings b/linden/indra/newview/English.lproj/InfoPlist.strings
index 6044498..794f869 100644
--- a/linden/indra/newview/English.lproj/InfoPlist.strings
+++ b/linden/indra/newview/English.lproj/InfoPlist.strings
@@ -1,5 +1,5 @@
 /* Localized versions of Info.plist keys */
 
 CFBundleName = "Second Life";
-CFBundleShortVersionString = "Second Life version 1.17.2.0";
-CFBundleGetInfoString = "Second Life version 1.17.2.0, Copyright 2004-2007 Linden Research, Inc.";
+CFBundleShortVersionString = "Second Life version 1.17.3.0";
+CFBundleGetInfoString = "Second Life version 1.17.3.0, Copyright 2004-2007 Linden Research, Inc.";
diff --git a/linden/indra/newview/Info-SecondLife.plist b/linden/indra/newview/Info-SecondLife.plist
index 3fbf135..5d351bb 100644
--- a/linden/indra/newview/Info-SecondLife.plist
+++ b/linden/indra/newview/Info-SecondLife.plist
@@ -32,7 +32,7 @@
 		</dict>
 	</array>
 	<key>CFBundleVersion</key>
-	<string>1.17.2.0</string>
+	<string>1.17.3.0</string>
 	<key>CSResourcesFileMapped</key>
 	<true/>
 </dict>
diff --git a/linden/indra/newview/app_settings/shaders/class1/objects/shinyF.glsl b/linden/indra/newview/app_settings/shaders/class1/objects/shinyF.glsl
index 12c99a6..6942132 100644
--- a/linden/indra/newview/app_settings/shaders/class1/objects/shinyF.glsl
+++ b/linden/indra/newview/app_settings/shaders/class1/objects/shinyF.glsl
@@ -1,13 +1,13 @@
-void applyScatter(inout vec3 col);
-
-uniform samplerCube environmentMap;
-
-void main() 
-{
-	vec3 ref = textureCube(environmentMap, gl_TexCoord[0].xyz).rgb;
-			
-	applyScatter(ref);
-		
-	gl_FragColor.rgb = ref;
-	gl_FragColor.a = gl_Color.a;
-}
+void applyScatter(inout vec3 col);
+
+uniform samplerCube environmentMap;
+
+void main() 
+{
+	vec3 ref = textureCube(environmentMap, gl_TexCoord[0].xyz).rgb;
+			
+	applyScatter(ref);
+		
+	gl_FragColor.rgb = ref;
+	gl_FragColor.a = gl_Color.a;
+}
diff --git a/linden/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl b/linden/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl
index 621ff6b..16fba01 100644
--- a/linden/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl
+++ b/linden/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl
@@ -1,27 +1,27 @@
-void default_scatter(vec3 viewVec, vec3 lightDir);
-
-uniform vec4 origin;
-
-void main()
-{
-	//transform vertex
-	gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
-	
-	vec3 pos = (gl_ModelViewMatrix * gl_Vertex).xyz;
-	vec3 norm = normalize(gl_NormalMatrix * gl_Normal);
-	
-	gl_FrontColor = gl_Color;
-	
-	vec3 ref = reflect(pos, norm);
-	
-	vec3 d = pos - origin.xyz;
-	float dist = dot(normalize(d), ref);
-	vec3 e = d + (ref * max(origin.w-dist, 0.0));
-	
-	ref = e - origin.xyz;
-	
-	gl_TexCoord[0] = gl_TextureMatrix[0]*vec4(ref,1.0);
-	
-	default_scatter(pos.xyz, gl_LightSource[0].position.xyz);
-}
-
+void default_scatter(vec3 viewVec, vec3 lightDir);
+
+uniform vec4 origin;
+
+void main()
+{
+	//transform vertex
+	gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+	
+	vec3 pos = (gl_ModelViewMatrix * gl_Vertex).xyz;
+	vec3 norm = normalize(gl_NormalMatrix * gl_Normal);
+	
+	gl_FrontColor = gl_Color;
+	
+	vec3 ref = reflect(pos, norm);
+	
+	vec3 d = pos - origin.xyz;
+	float dist = dot(normalize(d), ref);
+	vec3 e = d + (ref * max(origin.w-dist, 0.0));
+	
+	ref = e - origin.xyz;
+	
+	gl_TexCoord[0] = gl_TextureMatrix[0]*vec4(ref,1.0);
+	
+	default_scatter(pos.xyz, gl_LightSource[0].position.xyz);
+}
+
diff --git a/linden/indra/newview/app_settings/shaders/class3/environment/waterF.glsl b/linden/indra/newview/app_settings/shaders/class3/environment/waterF.glsl
index 3a117c5..ac8b07c 100644
--- a/linden/indra/newview/app_settings/shaders/class3/environment/waterF.glsl
+++ b/linden/indra/newview/app_settings/shaders/class3/environment/waterF.glsl
@@ -1,145 +1,145 @@
-void applyScatter(inout vec3 color);
-
-uniform sampler2D diffuseMap;
-uniform sampler2D bumpMap;   
-uniform samplerCube environmentMap; //: TEXUNIT4,   // Environment map texture
-uniform sampler2D screenTex;   //   : TEXUNIT5
-
-uniform vec3 lightDir;
-uniform vec3 specular;
-uniform float lightExp;
-uniform vec2 fbScale;
-uniform float refScale;
-
-float msin(float x) {
-   float k = sin(x)+1.0;
-   k *= 0.5;
-   k *= k;
-   return 2.0 * k;
-}
-
-float mcos(float x) {
-   float k = cos(x)+1.0;
-   k *= 0.5;
-   k *= k;
-   return 2.0 * k;
-}
-
-float waveS(vec2 v, float t, float a, float f, vec2 d, float s, sampler1D sinMap) 
-{
-   return texture1D(sinMap, (dot(d, v)*f + t*s)*f).r*a;
-}
-
-float waveC(vec2 v, float t, float a, float f, vec2 d, float s, sampler1D sinMap) 
-{
-   return texture1D(sinMap, (dot(d, v)*f + t*s)*f).g*a*2.0-1.0;
-}
-
-float magnitude(vec3 vec) {
-   return sqrt(dot(vec,vec));
-}
-
-vec3 mreflect(vec3 i, vec3 n) {
-   return i + n * 2.0 * abs(dot(n,i))+vec3(0.0,0.0,0.5);
-}
-
-void main() 
-{
-   vec2 texCoord = gl_TexCoord[0].xy;   // Texture coordinates
-   vec2 littleWave1 = gl_TexCoord[0].zw;
-   vec2 littleWave2 = gl_TexCoord[1].xy;
-   vec2 bigWave = gl_TexCoord[1].zw;
-   vec3 viewVec = gl_TexCoord[2].xyz;
-   vec4 refCoord = gl_TexCoord[3];
-   vec4 col = gl_Color;
-   vec4 color;
-   
-   //get color from alpha map (alpha denotes water depth), rgb denotes water color
-   vec4 wcol = texture2D(diffuseMap, texCoord.xy);
-      
-   float dist = length(viewVec);
-   
-   //store texture alpha
-   float da = wcol.a;
-         
-   //modulate by incoming water color
-   //wcol.a *= refCoord.w;
-   
-   //scale wcol.a (water depth) for steep transition
-   wcol.a *= wcol.a;
-   
-   //normalize view vector
-   viewVec = normalize(viewVec);
-   
-   //get bigwave normal
-   vec3 wavef = texture2D(bumpMap, bigWave).xyz*2.0;
-      
-   vec3 view = vec3(viewVec.x, viewVec.y, viewVec.z);
-   
-   float dx = 1.0-(dot(wavef*2.0-vec3(1.0), view))*da;
-   dx *= 0.274;
-      
-   //get detail normals
-   vec3 dcol = texture2D(bumpMap, littleWave1+dx*view.xy).rgb*0.75;
-   dcol += texture2D(bumpMap, littleWave2+view.xy*dx*0.1).rgb*1.25;
-      
-   //interpolate between big waves and little waves (big waves in deep water)
-   wavef = wavef*wcol.a + dcol*(1.0-wcol.a);
-   
-   //crunch normal to range [-1,1]
-   wavef -= vec3(1,1,1);
-   wavef = normalize(wavef);
-   //wavef = vec3(0.0, 0.0, 1.0);
-   
-   //get base fresnel component
-   float df = dot(viewVec,wavef);
-   //translate and flip fresnel
-   df = 1.0-clamp(-df,0.0,1.0);
-   
-   //set output alpha based on fresnel
-   color.a = clamp((1.0-df+da)*0.5,0.0,1.0);
-         
-   //calculate reflection vector
-   vec3 refnorm = vec3(wavef.x*0.5, wavef.y*0.5, wavef.z*2.0);
-   
-   //ramp normal towards eye for far view stuff
-   float ramp = dist/256.0;
-   refnorm -= viewVec * ramp;
-   vec3 ref = reflect(viewVec.xyz, normalize(refnorm));
-   ref.z /= sqrt(dist);
-   
-   //get diffuse component
-   float diff = clamp(dot(ref, wavef),0.0,1.0)*0.9;
-      
-   //fudge diffuse for extra contrast and ambience
-   diff *= diff;
-   diff += 0.4;
-      
-   vec3 fog = gl_TexCoord[5].rgb*0.5;
-   
-   //read from reflection map
-   vec3 refcol = textureCube(environmentMap, ref).rgb;
-   //tint reflection by fresnal, bias by z component of view vec
-   color.rgb = refcol*(df*df*dcol.x*dcol.y);
-   
-   //add diffuse contribution (fake blue water, yay!)
-   vec3 blue = vec3(0.1, 0.3, 0.6);
-   color.rgb += (diff/(max(ramp, 1.0)))*vec3(fog.r*blue.r, fog.g*blue.g, fog.b*blue.b);
-      
-   //figure out distortion vector (ripply)   
-   vec2 distort = clamp(((refCoord.xy/refCoord.z) * 0.5 + 0.5 + wavef.xy*refScale),0.0,0.99);
-   
-   //read from framebuffer (offset)
-   vec4 fb = texture2D(screenTex, distort*fbScale);
-   
-   //tint by framebuffer
-   color.rgb = da*color.rgb + (1.0-da)*fb.rgb;
-   
-   //render as solid (previous pixel color already present)
-   color.a = 1.0;
-   
-   //apply fog
-   applyScatter(color.rgb);
-   
-   gl_FragColor = color;
-}
+void applyScatter(inout vec3 color);
+
+uniform sampler2D diffuseMap;
+uniform sampler2D bumpMap;   
+uniform samplerCube environmentMap; //: TEXUNIT4,   // Environment map texture
+uniform sampler2D screenTex;   //   : TEXUNIT5
+
+uniform vec3 lightDir;
+uniform vec3 specular;
+uniform float lightExp;
+uniform vec2 fbScale;
+uniform float refScale;
+
+float msin(float x) {
+   float k = sin(x)+1.0;
+   k *= 0.5;
+   k *= k;
+   return 2.0 * k;
+}
+
+float mcos(float x) {
+   float k = cos(x)+1.0;
+   k *= 0.5;
+   k *= k;
+   return 2.0 * k;
+}
+
+float waveS(vec2 v, float t, float a, float f, vec2 d, float s, sampler1D sinMap) 
+{
+   return texture1D(sinMap, (dot(d, v)*f + t*s)*f).r*a;
+}
+
+float waveC(vec2 v, float t, float a, float f, vec2 d, float s, sampler1D sinMap) 
+{
+   return texture1D(sinMap, (dot(d, v)*f + t*s)*f).g*a*2.0-1.0;
+}
+
+float magnitude(vec3 vec) {
+   return sqrt(dot(vec,vec));
+}
+
+vec3 mreflect(vec3 i, vec3 n) {
+   return i + n * 2.0 * abs(dot(n,i))+vec3(0.0,0.0,0.5);
+}
+
+void main() 
+{
+   vec2 texCoord = gl_TexCoord[0].xy;   // Texture coordinates
+   vec2 littleWave1 = gl_TexCoord[0].zw;
+   vec2 littleWave2 = gl_TexCoord[1].xy;
+   vec2 bigWave = gl_TexCoord[1].zw;
+   vec3 viewVec = gl_TexCoord[2].xyz;
+   vec4 refCoord = gl_TexCoord[3];
+   vec4 col = gl_Color;
+   vec4 color;
+   
+   //get color from alpha map (alpha denotes water depth), rgb denotes water color
+   vec4 wcol = texture2D(diffuseMap, texCoord.xy);
+      
+   float dist = length(viewVec);
+   
+   //store texture alpha
+   float da = wcol.a;
+         
+   //modulate by incoming water color
+   //wcol.a *= refCoord.w;
+   
+   //scale wcol.a (water depth) for steep transition
+   wcol.a *= wcol.a;
+   
+   //normalize view vector
+   viewVec = normalize(viewVec);
+   
+   //get bigwave normal
+   vec3 wavef = texture2D(bumpMap, bigWave).xyz*2.0;
+      
+   vec3 view = vec3(viewVec.x, viewVec.y, viewVec.z);
+   
+   float dx = 1.0-(dot(wavef*2.0-vec3(1.0), view))*da;
+   dx *= 0.274;
+      
+   //get detail normals
+   vec3 dcol = texture2D(bumpMap, littleWave1+dx*view.xy).rgb*0.75;
+   dcol += texture2D(bumpMap, littleWave2+view.xy*dx*0.1).rgb*1.25;
+      
+   //interpolate between big waves and little waves (big waves in deep water)
+   wavef = wavef*wcol.a + dcol*(1.0-wcol.a);
+   
+   //crunch normal to range [-1,1]
+   wavef -= vec3(1,1,1);
+   wavef = normalize(wavef);
+   //wavef = vec3(0.0, 0.0, 1.0);
+   
+   //get base fresnel component
+   float df = dot(viewVec,wavef);
+   //translate and flip fresnel
+   df = 1.0-clamp(-df,0.0,1.0);
+   
+   //set output alpha based on fresnel
+   color.a = clamp((1.0-df+da)*0.5,0.0,1.0);
+         
+   //calculate reflection vector
+   vec3 refnorm = vec3(wavef.x*0.5, wavef.y*0.5, wavef.z*2.0);
+   
+   //ramp normal towards eye for far view stuff
+   float ramp = dist/256.0;
+   refnorm -= viewVec * ramp;
+   vec3 ref = reflect(viewVec.xyz, normalize(refnorm));
+   ref.z /= sqrt(dist);
+   
+   //get diffuse component
+   float diff = clamp(dot(ref, wavef),0.0,1.0)*0.9;
+      
+   //fudge diffuse for extra contrast and ambience
+   diff *= diff;
+   diff += 0.4;
+      
+   vec3 fog = gl_TexCoord[5].rgb*0.5;
+   
+   //read from reflection map
+   vec3 refcol = textureCube(environmentMap, ref).rgb;
+   //tint reflection by fresnal, bias by z component of view vec
+   color.rgb = refcol*(df*df*dcol.x*dcol.y);
+   
+   //add diffuse contribution (fake blue water, yay!)
+   vec3 blue = vec3(0.1, 0.3, 0.6);
+   color.rgb += (diff/(max(ramp, 1.0)))*vec3(fog.r*blue.r, fog.g*blue.g, fog.b*blue.b);
+      
+   //figure out distortion vector (ripply)   
+   vec2 distort = clamp(((refCoord.xy/refCoord.z) * 0.5 + 0.5 + wavef.xy*refScale),0.0,0.99);
+   
+   //read from framebuffer (offset)
+   vec4 fb = texture2D(screenTex, distort*fbScale);
+   
+   //tint by framebuffer
+   color.rgb = da*color.rgb + (1.0-da)*fb.rgb;
+   
+   //render as solid (previous pixel color already present)
+   color.a = 1.0;
+   
+   //apply fog
+   applyScatter(color.rgb);
+   
+   gl_FragColor = color;
+}
diff --git a/linden/indra/newview/files.lst b/linden/indra/newview/files.lst
index d6794d7..a4ff014 100644
--- a/linden/indra/newview/files.lst
+++ b/linden/indra/newview/files.lst
@@ -25,7 +25,6 @@ newview/llconfirmationmanager.cpp
 newview/llconsole.cpp
 newview/llcontainerview.cpp
 newview/llcontroldef.cpp
-newview/llcountdown.cpp
 newview/llcubemap.cpp
 newview/llcurrencyuimanager.cpp
 newview/llcylinder.cpp
@@ -53,7 +52,6 @@ newview/lleventpoll.cpp
 newview/llface.cpp
 newview/llfasttimerview.cpp
 newview/llfeaturemanager.cpp
-newview/llfft.cpp
 newview/llfilepicker.cpp
 newview/llfirstuse.cpp
 newview/llflexibleobject.cpp
@@ -237,7 +235,6 @@ newview/lltexlayer.cpp
 newview/lltexturecache.cpp
 newview/lltexturefetch.cpp
 newview/lltexturectrl.cpp
-newview/lltexturetable.cpp
 newview/lltextureview.cpp
 newview/lltoolbar.cpp
 newview/lltoolbrush.cpp
@@ -278,6 +275,9 @@ newview/llviewerinventory.cpp
 newview/llviewerjointattachment.cpp
 newview/llviewerjoint.cpp
 newview/llviewerjointmesh.cpp
+newview/llviewerjointmesh_sse.cpp
+newview/llviewerjointmesh_sse2.cpp
+newview/llviewerjointmesh_vec.cpp
 newview/llviewerjointshape.cpp
 newview/llviewerjoystick.cpp
 newview/llviewerkeyboard.cpp
@@ -318,7 +318,6 @@ newview/llvotextbubble.cpp
 newview/llvotree.cpp
 newview/llvovolume.cpp
 newview/llvowater.cpp
-newview/llwaterpatch.cpp
 newview/llwearable.cpp
 newview/llwearablelist.cpp
 newview/llweb.cpp
diff --git a/linden/indra/newview/gpu_table.txt b/linden/indra/newview/gpu_table.txt
index a6d1dee..74fbe2c 100644
--- a/linden/indra/newview/gpu_table.txt
+++ b/linden/indra/newview/gpu_table.txt
@@ -66,6 +66,9 @@ Intel 915GM						.*Intel.*915GM							0
 Intel 945G						.*Intel.*945G							0
 Intel 945GM						.*Intel.*945GM							0
 Intel 950						.*Intel.*950.*950						0
+Intel G965						.*Intel.*G965.*							0
+Intel GM965						.*Intel.*GM965.*						0
+Intel G33						.*Intel.*G33.*							0
 Intel Brookdale					.*Intel.*Brookdale.*					0
 Intel Montara					.*Intel.*Montara.*						0
 Intel Springdale				.*Intel.*Springdale.*					0
diff --git a/linden/indra/newview/llagent.cpp b/linden/indra/newview/llagent.cpp
index 150e35f..553c968 100644
--- a/linden/indra/newview/llagent.cpp
+++ b/linden/indra/newview/llagent.cpp
@@ -1025,7 +1025,7 @@ const LLVector3 &LLAgent::getPositionAgent()
 //-----------------------------------------------------------------------------
 // getRegionsVisited()
 //-----------------------------------------------------------------------------
-const S32 LLAgent::getRegionsVisited() const
+S32 LLAgent::getRegionsVisited() const
 {
 	return mRegionsVisited.size();
 }
@@ -1033,7 +1033,7 @@ const S32 LLAgent::getRegionsVisited() const
 //-----------------------------------------------------------------------------
 // getDistanceTraveled()
 //-----------------------------------------------------------------------------
-const F64 LLAgent::getDistanceTraveled() const
+F64 LLAgent::getDistanceTraveled() const
 {
 	return mDistanceTraveled;
 }
diff --git a/linden/indra/newview/llagent.h b/linden/indra/newview/llagent.h
index 0ca9f22..e4d207c 100644
--- a/linden/indra/newview/llagent.h
+++ b/linden/indra/newview/llagent.h
@@ -300,8 +300,8 @@ public:
 
 	const LLVector3d	&getPositionGlobal();
 	const LLVector3		&getPositionAgent();
-	const S32			getRegionsVisited() const;
-	const F64			getDistanceTraveled() const;
+	S32					getRegionsVisited() const;
+	F64					getDistanceTraveled() const;
 
 	const LLVector3d	&getFocusGlobal() const	{ return mFocusGlobal; }
 	const LLVector3d	&getFocusTargetGlobal() const	{ return mFocusTargetGlobal; }
diff --git a/linden/indra/newview/llcape.h b/linden/indra/newview/llcape.h
index 1ccdc9c..f491a61 100644
--- a/linden/indra/newview/llcape.h
+++ b/linden/indra/newview/llcape.h
@@ -211,7 +211,8 @@ class LLVOCloth : public LLViewerObject
 		//--------------------------------------
 		LLClothAttributes	mAttributes;					// these determine the characteristics of the cloth
 		LLVector3			mAvatarCollisionSpherePosition;	// derived from the avatar
-		LLPointer<LLViewerObject>			mDummyVO [ CLOTH_MAX_STRANDS ];
+		// Backlink only; don't make this an LLPointer.
+		LLViewerObject*			mDummyVO [ CLOTH_MAX_STRANDS ];
 		LLVolumeImplFlexible*	mStrand	[ CLOTH_MAX_STRANDS ];	// the array of strands that make up the cloth
 
 
diff --git a/linden/indra/newview/llcontroldef.cpp b/linden/indra/newview/llcontroldef.cpp
index 7481d99..e0153d7 100644
--- a/linden/indra/newview/llcontroldef.cpp
+++ b/linden/indra/newview/llcontroldef.cpp
@@ -1317,6 +1317,12 @@ void declare_settings()
 	gSavedSettings.declareBOOL("FlycamAbsolute", FALSE, "Treat Flycam values as absolute positions (not deltas).");
 	gSavedSettings.declareBOOL("FlycamZoomDirect", FALSE, "Map flycam zoom axis directly to camera zoom."); 
 
+	// Vector Processor & Math
+	gSavedSettings.declareBOOL("VectorizePerfTest", TRUE, "Test SSE/vectorization performance and choose fastest version.");
+	gSavedSettings.declareBOOL("VectorizeEnable", FALSE, "Enable general vector operations and data alignment.");
+	gSavedSettings.declareBOOL("VectorizeSkin", TRUE, "Enable vector operations for avatar skinning.");
+	gSavedSettings.declareU32( "VectorizeProcessor", 0, "0=Compiler Default, 1=SSE, 2=SSE2, autodetected", NO_PERSIST);
+
 	//
 	// crash_settings.xml
 	//
diff --git a/linden/indra/newview/llcountdown.cpp b/linden/indra/newview/llcountdown.cpp
deleted file mode 100644
index 42dc440..0000000
--- a/linden/indra/newview/llcountdown.cpp
+++ /dev/null
@@ -1,106 +0,0 @@
-/** 
- * @file llcountdown.cpp
- * @brief Implementation of the countdown box.
- *
- * Copyright (c) 2002-2007, Linden Research, Inc.
- * 
- * Second Life Viewer Source Code
- * The source code in this file ("Source Code") is provided by Linden Lab
- * to you under the terms of the GNU General Public License, version 2.0
- * ("GPL"), unless you have obtained a separate licensing agreement
- * ("Other License"), formally executed by you and Linden Lab.  Terms of
- * the GPL can be found in doc/GPL-license.txt in this distribution, or
- * online at http://secondlife.com/developers/opensource/gplv2
- * 
- * There are special exceptions to the terms and conditions of the GPL as
- * it is applied to this Source Code. View the full text of the exception
- * in the file doc/FLOSS-exception.txt in this software distribution, or
- * online at http://secondlife.com/developers/opensource/flossexception
- * 
- * By copying, modifying or distributing this software, you acknowledge
- * that you have read and understood your obligations described above,
- * and agree to abide by those obligations.
- * 
- * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
- * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
- * COMPLETENESS OR PERFORMANCE.
- */
-
-#include "llviewerprecompiledheaders.h"
-
-#include "llcountdown.h"
-
-///----------------------------------------------------------------------------
-/// Local function declarations, constants, enums, and typedefs
-///----------------------------------------------------------------------------
-
-const LLString DEFAULT_BASE_PREFIX("This dialag will close in ");
-const LLString DEFAULT_BASE_SUFFIX(" seconds");
-
-///----------------------------------------------------------------------------
-/// Class llcountdown
-///----------------------------------------------------------------------------
-
-// Default constructor
-LLCountdown::LLCountdown(const std::string& name, const LLRect& rect, F32 seconds,
-						 const char* base_prefix, const char* base_suffix) :
-	LLTextBox(name, rect),
-	mSeconds(seconds),
-	mHalfway(seconds/2-0.99f)
-{
-	mExpired.reset();
-	if(base_prefix)
-	{
-		mBasePrefix.assign(base_prefix);
-	}
-	else
-	{
-		mBasePrefix = DEFAULT_BASE_PREFIX;
-	}
-	if(base_suffix)
-	{
-		mBaseSuffix.assign(base_suffix);
-	}
-	else
-	{
-		mBaseSuffix = DEFAULT_BASE_SUFFIX;
-	}
-	S32 s = llfloor(mSeconds);
-	LLString buffer = mBasePrefix + llformat("%d",s) + mBaseSuffix;
-	setText(buffer);
-}
-
-// Destroys the object
-LLCountdown::~LLCountdown()
-{
-}
-
-BOOL LLCountdown::isExpired()
-{
-	if(mExpired.getElapsedTimeF32() > mSeconds)
-	{
-		return TRUE;
-	}
-	return FALSE;
-}
-
-void LLCountdown::draw()
-{
-	F32 elapsed = mExpired.getElapsedTimeF32();
-	if(elapsed > mSeconds)
-	{
-		LLString buffer = mBasePrefix + "0" + mBaseSuffix;
-		setText(buffer);
-	}
-	else if(elapsed > mHalfway)
-	{
-		S32 seconds = llfloor(llmax((mSeconds - elapsed), 0.0f));
-		LLString buffer = mBasePrefix + llformat("%d",seconds) + mBaseSuffix;
-		setText(buffer);
-	}
-	LLTextBox::draw();
-}
-
-///----------------------------------------------------------------------------
-/// Local function definitions
-///----------------------------------------------------------------------------
diff --git a/linden/indra/newview/llcountdown.h b/linden/indra/newview/llcountdown.h
deleted file mode 100644
index 06f6167..0000000
--- a/linden/indra/newview/llcountdown.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/** 
- * @file llcountdown.h
- * @brief LLCountdown class header file
- *
- * Copyright (c) 2002-2007, Linden Research, Inc.
- * 
- * Second Life Viewer Source Code
- * The source code in this file ("Source Code") is provided by Linden Lab
- * to you under the terms of the GNU General Public License, version 2.0
- * ("GPL"), unless you have obtained a separate licensing agreement
- * ("Other License"), formally executed by you and Linden Lab.  Terms of
- * the GPL can be found in doc/GPL-license.txt in this distribution, or
- * online at http://secondlife.com/developers/opensource/gplv2
- * 
- * There are special exceptions to the terms and conditions of the GPL as
- * it is applied to this Source Code. View the full text of the exception
- * in the file doc/FLOSS-exception.txt in this software distribution, or
- * online at http://secondlife.com/developers/opensource/flossexception
- * 
- * By copying, modifying or distributing this software, you acknowledge
- * that you have read and understood your obligations described above,
- * and agree to abide by those obligations.
- * 
- * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
- * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
- * COMPLETENESS OR PERFORMANCE.
- */
-
-#ifndef LL_LLCOUNTDOWN_H
-#define LL_LLCOUNTDOWN_H
-
-#include "lltimer.h"
-#include "lltextbox.h"
-
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-// Class LLCountdown
-//
-// This class draws a text box that counts down from seconds to zero,
-// with a little bit of slop.
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-class LLCountdown : public LLTextBox
-{
-protected:
-	LLString mBasePrefix;
-	LLString mBaseSuffix;
-	LLTimer mExpired;
-	F32 mSeconds;
-	F32 mHalfway;
-
-	void buildLabel();
-
-public:
-	LLCountdown(const std::string& name, const LLRect& rect, F32 seconds,
-				const char* base_prefix = NULL,
-				const char* base_suffix = NULL);
-	virtual ~LLCountdown();
-
-	// cannot be const because our timers are not const. Damn
-	// const-incorrectness.
-	BOOL isExpired();
-
-	virtual void draw();
-};
-
-
-#endif // LL_LLCOUNTDOWN_H
diff --git a/linden/indra/newview/lldrawable.h b/linden/indra/newview/lldrawable.h
index 97e512f..e550142 100644
--- a/linden/indra/newview/lldrawable.h
+++ b/linden/indra/newview/lldrawable.h
@@ -46,6 +46,7 @@
 #include "llviewerobject.h"
 #include "llrect.h"
 
+class LLCamera;
 class LLDrawPool;
 class LLDrawable;
 class LLFace;
@@ -88,7 +89,7 @@ public:
 
 	const LLMatrix4&      getWorldMatrix() const		{ return mXform.getWorldMatrix(); }
 	const LLMatrix4&	  getRenderMatrix() const		{ return isRoot() ? getWorldMatrix() : getParent()->getWorldMatrix(); }
-	const void			  setPosition(LLVector3 v) const { }
+	void				  setPosition(LLVector3 v) const { }
 	const LLVector3&	  getPosition() const			{ return mXform.getPosition(); }
 	const LLVector3&      getWorldPosition() const		{ return mXform.getPositionW(); }
 	const LLVector3		  getPositionAgent() const;
@@ -96,14 +97,14 @@ public:
 	const LLVector3&	  getScale() const				{ return mCurrentScale; }
 	const LLQuaternion&   getWorldRotation() const		{ return mXform.getWorldRotation(); }
 	const LLQuaternion&   getRotation() const			{ return mXform.getRotation(); }
-	const F32             getIntensity() const			{ return llmin(mXform.getScale().mV[0], 4.f); }
-	const S32			  getLOD() const				{ return mVObjp ? mVObjp->getLOD() : 1; }
-	const F64			  getBinRadius() const			{ return mBinRadius; }
+	F32			          getIntensity() const			{ return llmin(mXform.getScale().mV[0], 4.f); }
+	S32					  getLOD() const				{ return mVObjp ? mVObjp->getLOD() : 1; }
+	F64					  getBinRadius() const			{ return mBinRadius; }
 	void  getMinMax(LLVector3& min,LLVector3& max) const { mXform.getMinMax(min,max); }
 	LLXformMatrix*		getXform() { return &mXform; }
 
-	const U32 			getState()           const { return mState; }
-	const BOOL          isState   (U32 bits) const { return ((mState & bits) != 0); }
+	U32					getState()           const { return mState; }
+	BOOL				isState   (U32 bits) const { return ((mState & bits) != 0); }
 	void                setState  (U32 bits)       { mState |= bits; }
 	void                clearState(U32 bits)       { mState &= ~bits; }
 
diff --git a/linden/indra/newview/lldriverparam.h b/linden/indra/newview/lldriverparam.h
index f7b0819..fb13e50 100644
--- a/linden/indra/newview/lldriverparam.h
+++ b/linden/indra/newview/lldriverparam.h
@@ -104,7 +104,8 @@ protected:
 	typedef std::vector<LLDrivenEntry> entry_list_t;
 	entry_list_t mDriven;
 	LLViewerVisualParam* mCurrentDistortionParam;
-	LLPointer<LLVOAvatar> mAvatarp;
+	// Backlink only; don't make this an LLPointer.
+	LLVOAvatar* mAvatarp;
 };
 
 #endif  // LL_LLDRIVERPARAM_H
diff --git a/linden/indra/newview/llface.cpp b/linden/indra/newview/llface.cpp
index 782048c..cfda05a 100644
--- a/linden/indra/newview/llface.cpp
+++ b/linden/indra/newview/llface.cpp
@@ -936,7 +936,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
 	BOOL is_static = mDrawablep->isStatic();
 	BOOL is_global = is_static;
 
-	if (-1 == index_offset)
+	if (index_offset == (U32) -1)
 	{
 		return TRUE;
 	}
diff --git a/linden/indra/newview/llface.h b/linden/indra/newview/llface.h
index 6870789..711cd8e 100644
--- a/linden/indra/newview/llface.h
+++ b/linden/indra/newview/llface.h
@@ -75,11 +75,11 @@ public:
 
 	const LLMatrix4& getWorldMatrix()	const	{ return mVObjp->getWorldMatrix(mXform); }
 	const LLMatrix4& getRenderMatrix() const;
-	const U32		getIndicesCount()	const	{ return mIndicesCount; };
-	const S32		getIndicesStart()	const	{ return mIndicesIndex; };
-	const S32		getGeomCount()		const	{ return mGeomCount; }		// vertex count for this face
-	const S32		getGeomIndex()		const	{ return mGeomIndex; }		// index into draw pool
-	const U32		getGeomStart()		const	{ return mGeomIndex; }		// index into draw pool
+	U32				getIndicesCount()	const	{ return mIndicesCount; };
+	S32				getIndicesStart()	const	{ return mIndicesIndex; };
+	S32				getGeomCount()		const	{ return mGeomCount; }		// vertex count for this face
+	S32				getGeomIndex()		const	{ return mGeomIndex; }		// index into draw pool
+	U32				getGeomStart()		const	{ return mGeomIndex; }		// index into draw pool
 	LLViewerImage*	getTexture()		const	{ return mTexture; }
 	void			setTexture(LLViewerImage* tex) { mTexture = tex; }
 	LLXformMatrix*	getXform()			const	{ return mXform; }
diff --git a/linden/indra/newview/llfft.cpp b/linden/indra/newview/llfft.cpp
deleted file mode 100644
index 2b80ad9..0000000
--- a/linden/indra/newview/llfft.cpp
+++ /dev/null
@@ -1,577 +0,0 @@
-/** 
- * @file llfft.cpp
- * @brief FFT function implementations
- *
- * Copyright (c) 2003-2007, Linden Research, Inc.
- * 
- * Second Life Viewer Source Code
- * The source code in this file ("Source Code") is provided by Linden Lab
- * to you under the terms of the GNU General Public License, version 2.0
- * ("GPL"), unless you have obtained a separate licensing agreement
- * ("Other License"), formally executed by you and Linden Lab.  Terms of
- * the GPL can be found in doc/GPL-license.txt in this distribution, or
- * online at http://secondlife.com/developers/opensource/gplv2
- * 
- * There are special exceptions to the terms and conditions of the GPL as
- * it is applied to this Source Code. View the full text of the exception
- * in the file doc/FLOSS-exception.txt in this software distribution, or
- * online at http://secondlife.com/developers/opensource/flossexception
- * 
- * By copying, modifying or distributing this software, you acknowledge
- * that you have read and understood your obligations described above,
- * and agree to abide by those obligations.
- * 
- * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
- * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
- * COMPLETENESS OR PERFORMANCE.
- */
-
-/*
- *  Fast Fourier Transform
- *
- */
-#include "llviewerprecompiledheaders.h"
-
-#include "llfft.h"
-#include "llerror.h"
-
-/*
-**
-*********************************************************************
-** Forward and inverse discrete Fourier transforms on complex data **
-*********************************************************************
-**
-**
-** forward_fft(array, rows, cols)
-**               COMPLEX *array;
-**               S32 rows, cols;
-**
-** inverse_fft(array, rows, cols)
-**               COMPLEX *array;
-**               S32 rows, cols;
-**
-** These entry points compute the forward and inverse DFT's, respectively, 
-** of a single-precision COMPLEX array.
-**
-** The result is a COMPLEX array of the same size, returned in 
-** the same space as the input array.  That is, the original array is
-** overwritten and destroyed.
-**
-** Rows and columns must each be an integral power of 2.
-**
-** These routines return integer value -1 if an error was detected,
-** 0 otherwise
-**
-** This implementation of the DFT uses the transform pair defined as follows.
-**
-** Let there be two COMPLEX arrays each with n rows and m columns
-** Index them as 
-** f(x,y):    0 <= x <= m - 1,  0 <= y <= n - 1
-** F(u,v):    -m/2 <= u <= m/2 - 1,  -n/2 <= v <= n/2 - 1
-**
-** Then the forward and inverse transforms are related as
-**
-** Forward:
-**
-** F(u,v) = \sum_{x=0}^{m-1} \sum_{y=0}^{n-1} 
-**                      f(x,y) \exp{-2\pi i (ux/m + vy/n)}
-**
-**
-** Inverse:
-**
-** f(x,y) = 1/(mn) \sum_{u=-m/2}^{m/2-1} \sum_{v=-n/2}^{n/2-1} 
-**                      F(u,v) \exp{2\pi i (ux/m + vy/n)}
-**  
-** Therefore, the transforms have these properties:
-** 1.  \sum_x \sum_y  f(x,y) = F(0,0)
-** 2.  m n \sum_x \sum_y |f(x,y)|^2 = \sum_u \sum_v |F(u,v)|^2
-**
-*/
-
-
-//DPCOMPLEX 	*stageBuff;  /* buffer to hold a row or column at a time */
-//COMPLEX 	*bigBuff;    /* a pointer to the input array */
-
-
-/*
- *	These macros move complex data between bigBuff and
- *	stageBuff
- */
-
-inline void LoadRow(DPCOMPLEX* stageBuff, COMPLEX* bigBuff, U32 row, U32 cols)
-{
-    for (U32 j = row*cols, k = 0 ; k < cols ; j++, k++)
-	{
-		stageBuff[k].re = bigBuff[j].re;
-		stageBuff[k].im = bigBuff[j].im;
-	}
-}
-
-inline void StoreRow(DPCOMPLEX* stageBuff, COMPLEX* bigBuff, U32 row, U32 cols)
-{
-    for (U32 j = row*cols, k = 0 ; k < cols ; j++, k++)
-	{
-		bigBuff[j].re = (F32)stageBuff[k].re;
-		bigBuff[j].im = (F32)stageBuff[k].im;
-	}
-}
-
-inline void LoadCol(DPCOMPLEX* stageBuff, COMPLEX* bigBuff, U32 col, U32 rows, U32 cols)
-{
-    for (U32 j = col,k = 0 ; k < rows ; j+=cols, k++)
-	{
-		stageBuff[k].re = bigBuff[j].re;
-		stageBuff[k].im = bigBuff[j].im;
-	}
-}
-
-inline void StoreCol(DPCOMPLEX* stageBuff, COMPLEX* bigBuff, U32 col, U32 rows, U32 cols)
-{
-    for (U32 j = col,k = 0 ; k < rows ; j+=cols, k++)
-	{
-		bigBuff[j].re = (F32)stageBuff[k].re;
-		bigBuff[j].im = (F32)stageBuff[k].im;
-	}
-}
-
-
-/* do something with an error message */
-inline void handle_error(S8* msg)
-{
-	llerrs << msg << llendl;
-}
-
-
-/* 
-** compute DFT: forward if direction==0, inverse if direction==1
-** array must be COMPLEX 
-*/ 
-BOOL fft(const LLFFTPlan& plan, COMPLEX *array, S32 rows, S32 cols, S32 direction)
-{
-	S32 i;
-	
-	if (!plan.valid() || plan.rows() != rows || plan.cols() != cols)
-		return FALSE;
-	
-	/* compute transform row by row */
-	
-	if(cols>1)
-	{
-		for(i=0;i<rows;i++) 
-		{
-			LoadRow(plan.buffer(), array, i, cols);
-			FFT842(direction, cols, plan.buffer());
-			StoreRow(plan.buffer(), array, i, cols);
-		}
-	}
-	
-	if(rows<2) /* done */
-	{
-		//freeBuffer();
-		return TRUE;
-	}
-	
-	
-	/* compute transform column by column */
-	
-	for(i=0;i<cols;i++) 
-	{
-		LoadCol(plan.buffer(), array, i, rows, cols);
-		FFT842(direction, rows, plan.buffer());
-		StoreCol(plan.buffer(), array, i, rows, cols);
-	}
-	
-	//freeBuffer();
-	
-	return TRUE;
-}
-
-
-
-/*
-** FFT842
-** This routine replaces the input DPCOMPLEX vector by its
-** finite discrete complex fourier transform if in==0.
-** It replaces the input DPCOMPLEX vector by its
-** finite discrete complex inverse fourier transform if in==1.
-**
-**     in - FORWARD or INVERSE
-**     n - length of vector
-**     b - input vector
-**
-** It performs as many base 8 iterations as possible and
-** then finishes with a base 4 iteration or a base 2 
-** iteration if needed.
-**
-** Ported from the FORTRAN code in Programming for Digital Signal Processing,
-** IEEE Press 1979, Section 1, by G. D. Bergland and M. T. Dolan
-**
-*/
-void FFT842(S32 in, S32 n, DPCOMPLEX *b)
-{
-	F64 fn, r, fi;
-	
-	S32 L[16],L1,L2,L3,L4,L5,L6,L7,L8,L9,L10,L11,L12,L13,L14,L15;
-	S32 j1,j2,j3,j4,j5,j6,j7,j8,j9,j10,j11,j12,j13,j14;
-	S32 i, j, ij, ji, ij1, ji1;
-	S32 n2pow, n8pow, nthpo, ipass, nxtlt, lengt;
-	
-	n2pow = fastlog2(n);
-	nthpo = n;
-	fn = 1.0 / (F64)nthpo;
-	
-	
-	if(in==FORWARD)
-	{
-		/* take conjugate  */
-		for(i=0;i<n;i++)
-		{
-			b[i].im *= -1.0;
-		}
-	}
-	
-	if(in==INVERSE)
-	{
-		/* scramble inputs */
-		for(i=0,j=n/2;j<n;i++,j++) 
-		{
-			r  = b[j].re;
-			fi = b[j].im;
-			b[j].re = b[i].re;
-			b[j].im = b[i].im;
-			b[i].re = r;
-			b[i].im = fi;
-		}
-	}
-	
-	n8pow = n2pow/3;
-	
-	if(n8pow) 
-    {
-		/* radix 8 iterations */
-		for(ipass=1;ipass<=n8pow;ipass++) 
-		{
-			nxtlt = 0x1 << (n2pow - 3*ipass);
-			lengt = 8*nxtlt;
-			R8TX(nxtlt,nthpo,lengt,
-				b,b+nxtlt,b+2*nxtlt,
-				b+3*nxtlt,b+4*nxtlt,b+5*nxtlt,
-				b+6*nxtlt,b+7*nxtlt);
-		}
-    }
-	
-	if(n2pow%3 == 1) 
-    {
-		/* radix 2 iteration needed */
-		R2TX(nthpo,b,b+1); 
-    }
-	
-	
-	if(n2pow%3 == 2)  
-    {
-		/* radix 4 iteration needed */
-		R4TX(nthpo,b,b+1,b+2,b+3); 
-    }
-	
-	
-	
-	for(j=1;j<=15;j++) 
-    {
-		L[j] = 1;
-		if(j-n2pow <= 0) L[j] = 0x1 << (n2pow + 1 - j);
-    }
-	L15=L[1];L14=L[2];L13=L[3];L12=L[4];L11=L[5];L10=L[6];L9=L[7];
-	L8=L[8];L7=L[9];L6=L[10];L5=L[11];L4=L[12];L3=L[13];L2=L[14];L1=L[15];
-	
-	ij = 1;
-    
-	for(j1=1;j1<=L1;j1++)
-		for(j2=j1;j2<=L2;j2+=L1)
-			for(j3=j2;j3<=L3;j3+=L2)
-				for(j4=j3;j4<=L4;j4+=L3)
-					for(j5=j4;j5<=L5;j5+=L4)
-						for(j6=j5;j6<=L6;j6+=L5)
-							for(j7=j6;j7<=L7;j7+=L6)
-								for(j8=j7;j8<=L8;j8+=L7)
-									for(j9=j8;j9<=L9;j9+=L8)
-										for(j10=j9;j10<=L10;j10+=L9)
-											for(j11=j10;j11<=L11;j11+=L10)
-												for(j12=j11;j12<=L12;j12+=L11)
-													for(j13=j12;j13<=L13;j13+=L12)
-														for(j14=j13;j14<=L14;j14+=L13)
-															for(ji=j14;ji<=L15;ji+=L14) 
-															{
-																ij1 = ij-1;
-																ji1 = ji-1;
-																
-																if(ij-ji<0) 
-																{
-																	r = b[ij1].re;
-																	b[ij1].re = b[ji1].re;
-																	b[ji1].re = r;
-																	fi = b[ij1].im;
-																	b[ij1].im = b[ji1].im;
-																	b[ji1].im = fi;
-																}
-																ij++;
-															}
-															
-															if(in==FORWARD)  // take conjugates & unscramble outputs
-															{
-																for(i=0,j=n/2;j<n;i++,j++)
-																{
-																	r = b[j].re; 
-																	fi = b[j].im;
-																	b[j].re = b[i].re;
-																	b[j].im = -b[i].im;
-																	b[i].re = r;
-																	b[i].im = -fi;
-																}
-															}
-
-															if(in==INVERSE) // scale outputs
-															{
-																for(i=0;i<nthpo;i++) 
-																{
-																	b[i].re *= fn;
-																	b[i].im *= fn;
-																}
-															}
-}
-
-
-/*
-** radix 2 iteration subroutine
-*/
-void R2TX(S32 nthpo, DPCOMPLEX *c0, DPCOMPLEX *c1)
-{
-	S32 k,kk;
-	F64 *cr0, *ci0, *cr1, *ci1, r1, fi1;
-	
-	cr0 = &(c0[0].re);
-	ci0 = &(c0[0].im);
-	cr1 = &(c1[0].re);
-	ci1 = &(c1[0].im);
-	
-	for(k = 0; k < nthpo; k += 2) 
-    {
-		kk = k*2;
-		
-		r1 = cr0[kk] + cr1[kk];
-		cr1[kk] = cr0[kk] - cr1[kk];
-		cr0[kk] = r1;
-		fi1 = ci0[kk] + ci1[kk];
-		ci1[kk] = ci0[kk] - ci1[kk];
-		ci0[kk] = fi1;
-    }
-}
-
-
-/*
-** radix 4 iteration subroutine
-*/
-void R4TX(S32 nthpo, DPCOMPLEX *c0, DPCOMPLEX *c1, DPCOMPLEX *c2, DPCOMPLEX *c3)
-{
-	S32 k,kk;
-	F64 *cr0, *ci0, *cr1, *ci1, *cr2, *ci2, *cr3, *ci3;
-	F64 r1,r2,r3,r4,i1,i2,i3,i4;
-	
-	cr0 = &(c0[0].re);
-	cr1 = &(c1[0].re);
-	cr2 = &(c2[0].re);
-	cr3 = &(c3[0].re);
-	ci0 = &(c0[0].im);
-	ci1 = &(c1[0].im);
-	ci2 = &(c2[0].im);
-	ci3 = &(c3[0].im);
-	
-	for(k = 1; k <= nthpo; k += 4) 
-    {
-		kk = (k-1)*2;  /* real and imag parts alternate */
-		
-		r1 = cr0[kk] + cr2[kk];
-		r2 = cr0[kk] - cr2[kk];
-		r3 = cr1[kk] + cr3[kk];
-		r4 = cr1[kk] - cr3[kk];
-		i1 = ci0[kk] + ci2[kk];
-		i2 = ci0[kk] - ci2[kk];
-		i3 = ci1[kk] + ci3[kk];
-		i4 = ci1[kk] - ci3[kk];
-		cr0[kk] = r1 + r3;
-		ci0[kk] = i1 + i3;
-		cr1[kk] = r1 - r3;
-		ci1[kk] = i1 - i3;
-		cr2[kk] = r2 - i4;
-		ci2[kk] = i2 + r4;
-		cr3[kk] = r2 + i4;
-		ci3[kk] = i2 - r4;
-    }
-}
-
-
-	
-/*
-** radix 8 iteration subroutine
-*/
-void R8TX(S32 nxtlt, S32 nthpo, S32 lengt, DPCOMPLEX *cc0, DPCOMPLEX *cc1, DPCOMPLEX *cc2,
-		  DPCOMPLEX *cc3, DPCOMPLEX *cc4, DPCOMPLEX *cc5, DPCOMPLEX *cc6, DPCOMPLEX *cc7)
-{
-	S32 j,k,kk;
-	F64 scale, arg, tr, ti;
-	F64 c1,c2,c3,c4,c5,c6,c7;
-	F64 s1,s2,s3,s4,s5,s6,s7;
-	F64 ar0,ar1,ar2,ar3,ar4,ar5,ar6,ar7;
-	F64 ai0,ai1,ai2,ai3,ai4,ai5,ai6,ai7;
-	F64 br0,br1,br2,br3,br4,br5,br6,br7;
-	F64 bi0,bi1,bi2,bi3,bi4,bi5,bi6,bi7;
-	
-	F64 *cr0,*cr1,*cr2,*cr3,*cr4,*cr5,*cr6,*cr7;
-	F64 *ci0,*ci1,*ci2,*ci3,*ci4,*ci5,*ci6,*ci7;
-	
-	cr0 = &(cc0[0].re);
-	cr1 = &(cc1[0].re);
-	cr2 = &(cc2[0].re);
-	cr3 = &(cc3[0].re);
-	cr4 = &(cc4[0].re);
-	cr5 = &(cc5[0].re);
-	cr6 = &(cc6[0].re);
-	cr7 = &(cc7[0].re);
-	
-	ci0 = &(cc0[0].im);
-	ci1 = &(cc1[0].im);
-	ci2 = &(cc2[0].im);
-	ci3 = &(cc3[0].im);
-	ci4 = &(cc4[0].im);
-	ci5 = &(cc5[0].im);
-	ci6 = &(cc6[0].im);
-	ci7 = &(cc7[0].im);
-	
-	
-	scale = F_TWO_PI/lengt;
-	
-	for(j = 1; j <= nxtlt; j++) 
-    {
-		arg = (j-1)*scale;
-		c1 = cos(arg);
-		s1 = sin(arg);
-		c2 = c1*c1 - s1*s1;
-		s2 = c1*s1 + c1*s1;
-		c3 = c1*c2 - s1*s2;
-		s3 = c2*s1 + s2*c1;
-		c4 = c2*c2 - s2*s2;
-		s4 = c2*s2 + c2*s2;
-		c5 = c2*c3 - s2*s3;
-		s5 = c3*s2 + s3*c2;
-		c6 = c3*c3 - s3*s3;
-		s6 = c3*s3 + c3*s3;
-		c7 = c3*c4 - s3*s4;
-		s7 = c4*s3 + s4*c3;
-		
-		for(k = j; k <= nthpo; k += lengt) 
-		{
-			kk = (k-1)*2; /* index by twos; re & im alternate */
-			
-			ar0 = cr0[kk] + cr4[kk];
-			ar1 = cr1[kk] + cr5[kk];
-			ar2 = cr2[kk] + cr6[kk];
-			ar3 = cr3[kk] + cr7[kk];
-			ar4 = cr0[kk] - cr4[kk];
-			ar5 = cr1[kk] - cr5[kk];
-			ar6 = cr2[kk] - cr6[kk];
-			ar7 = cr3[kk] - cr7[kk];
-			ai0 = ci0[kk] + ci4[kk];
-			ai1 = ci1[kk] + ci5[kk];
-			ai2 = ci2[kk] + ci6[kk];
-			ai3 = ci3[kk] + ci7[kk];
-			ai4 = ci0[kk] - ci4[kk];
-			ai5 = ci1[kk] - ci5[kk];
-			ai6 = ci2[kk] - ci6[kk];
-			ai7 = ci3[kk] - ci7[kk];
-			br0 = ar0 + ar2;
-			br1 = ar1 + ar3;
-			br2 = ar0 - ar2;
-			br3 = ar1 - ar3;
-			br4 = ar4 - ai6;
-			br5 = ar5 - ai7;
-			br6 = ar4 + ai6;
-			br7 = ar5 + ai7;
-			bi0 = ai0 + ai2;
-			bi1 = ai1 + ai3;
-			bi2 = ai0 - ai2;
-			bi3 = ai1 - ai3;
-			bi4 = ai4 + ar6;
-			bi5 = ai5 + ar7;
-			bi6 = ai4 - ar6;
-			bi7 = ai5 - ar7;
-			cr0[kk] = br0 + br1;
-			ci0[kk] = bi0 + bi1;
-			if(j > 1) 
-			{
-				cr1[kk] = c4*(br0-br1) - s4*(bi0-bi1);
-				cr2[kk] = c2*(br2-bi3) - s2*(bi2+br3);
-				cr3[kk] = c6*(br2+bi3) - s6*(bi2-br3);
-				ci1[kk] = c4*(bi0-bi1) + s4*(br0-br1);
-				ci2[kk] = c2*(bi2+br3) + s2*(br2-bi3);
-				ci3[kk] = c6*(bi2-br3) + s6*(br2+bi3);
-				tr = OO_SQRT2*(br5-bi5);
-				ti = OO_SQRT2*(br5+bi5);
-				cr4[kk] = c1*(br4+tr) - s1*(bi4+ti);
-				ci4[kk] = c1*(bi4+ti) + s1*(br4+tr);
-				cr5[kk] = c5*(br4-tr) - s5*(bi4-ti);
-				ci5[kk] = c5*(bi4-ti) + s5*(br4-tr);
-				tr = -OO_SQRT2*(br7+bi7);
-				ti = OO_SQRT2*(br7-bi7);
-				cr6[kk] = c3*(br6+tr) - s3*(bi6+ti);
-				ci6[kk] = c3*(bi6+ti) + s3*(br6+tr);
-				cr7[kk] = c7*(br6-tr) - s7*(bi6-ti);
-				ci7[kk] = c7*(bi6-ti) + s7*(br6-tr);
-			}
-			else 
-			{
-				cr1[kk] = br0 - br1;
-				cr2[kk] = br2 - bi3;
-				cr3[kk] = br2 + bi3;
-				ci1[kk] = bi0 - bi1;
-				ci2[kk] = bi2 + br3;
-				ci3[kk] = bi2 - br3;
-				tr = OO_SQRT2*(br5-bi5);
-				ti = OO_SQRT2*(br5+bi5);
-				cr4[kk] = br4 + tr;
-				ci4[kk] = bi4 + ti;
-				cr5[kk] = br4 - tr;
-				ci5[kk] = bi4 - ti;
-				tr = -OO_SQRT2*(br7+bi7);
-				ti = OO_SQRT2*(br7-bi7);
-				cr6[kk] = br6 + tr;
-				ci6[kk] = bi6 + ti;
-				cr7[kk] = br6 - tr;
-				ci7[kk] = bi6 - ti;
-			}
-		}
-    }
-}
-	
-
-/* see if exactly one bit is set in integer argument */
-S32 power_of_2(S32 n)
-{
-	S32 bits=0;
-	while(n)
-	{
-		bits += n & 1;
-		n >>= 1;
-	}
-	return(bits==1);
-}
-
-/* get binary log of integer argument; exact if n a power of 2 */
-S32 fastlog2(S32 n)
-{
-	S32 log = -1;
-	while(n)
-	{
-		log++;
-		n >>= 1;
-	}
-	return(log);
-}
diff --git a/linden/indra/newview/llfft.h b/linden/indra/newview/llfft.h
deleted file mode 100644
index 07e868b..0000000
--- a/linden/indra/newview/llfft.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/** 
- * @file llfft.h
- * @brief FFT function definitions
- *
- * Copyright (c) 2003-2007, Linden Research, Inc.
- * 
- * Second Life Viewer Source Code
- * The source code in this file ("Source Code") is provided by Linden Lab
- * to you under the terms of the GNU General Public License, version 2.0
- * ("GPL"), unless you have obtained a separate licensing agreement
- * ("Other License"), formally executed by you and Linden Lab.  Terms of
- * the GPL can be found in doc/GPL-license.txt in this distribution, or
- * online at http://secondlife.com/developers/opensource/gplv2
- * 
- * There are special exceptions to the terms and conditions of the GPL as
- * it is applied to this Source Code. View the full text of the exception
- * in the file doc/FLOSS-exception.txt in this software distribution, or
- * online at http://secondlife.com/developers/opensource/flossexception
- * 
- * By copying, modifying or distributing this software, you acknowledge
- * that you have read and understood your obligations described above,
- * and agree to abide by those obligations.
- * 
- * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
- * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
- * COMPLETENESS OR PERFORMANCE.
- */
-
-#ifndef LL_LLFFT_H
-#define LL_LLFFT_H
-
-/*
- *  Fast Fourier Transform
- *
- */
-
-//#include <stdio.h>
-//#include <math.h>
-
-#include "llmath.h"
-
-#define FORWARD	0
-#define INVERSE 1
-
-typedef struct {F32 re; F32 im;} COMPLEX;
-typedef struct {F64 re; F64 im;} DPCOMPLEX;
-
-
-void FFT842(S32 in, S32 n, DPCOMPLEX *b);
-void R2TX(S32 nthpo, DPCOMPLEX *c0, DPCOMPLEX *c1);
-void R4TX(S32 nthpo, DPCOMPLEX *c0, DPCOMPLEX *c1, DPCOMPLEX *c2, DPCOMPLEX *c3);
-void R8TX(S32 nxtlt, S32 nthpo, S32 lengt, DPCOMPLEX *cc0, DPCOMPLEX *cc1, DPCOMPLEX *cc2,
-	 DPCOMPLEX *cc3, DPCOMPLEX *cc4, DPCOMPLEX *cc5, DPCOMPLEX *cc6, DPCOMPLEX *cc7);
-S32 power_of_2(S32 n);
-S32 fastlog2(S32 n);
-
-class LLFFTPlan
-{
-private:
-	S32 mRows;
-	S32 mCols;
-	S32 mSize;
-	DPCOMPLEX* mBuff;
-public:
-	LLFFTPlan() : mRows(0), mCols(0), mSize(0), mBuff(0) {}
-	LLFFTPlan(S32 rows, S32 cols) { init(rows, cols); }
-	~LLFFTPlan() { destroy(); }
-
-	void init(S32 rows, S32 cols)
-	{
-		if(power_of_2(rows) && power_of_2(cols))
-		{
-			mRows = rows;
-			mCols = cols;
-			mSize = mRows > mCols ? mRows : mCols;
-			mBuff = new DPCOMPLEX[mSize];
-		}
-	}
-	void destroy()
-	{
-		delete [] mBuff;
-		mSize = 0;
-	}
-
-	BOOL valid() const { return mBuff != NULL; }
-	DPCOMPLEX* buffer() const { return mBuff; }
-	S32 rows() const { return mRows; }
-	S32 cols() const { return mCols; }
-};
-
-S32 fft(const LLFFTPlan& plan, COMPLEX *array, S32 rows, S32 cols, S32 direction);
-
-/* do forward transform.  array must be COMPLEX  */
-inline S32 forward_fft(const LLFFTPlan& plan, COMPLEX *array, S32 rows, S32 cols)
-{
-	return fft(plan, array, rows, cols, FORWARD);
-}
-
-/* do inverse transform. array must be COMPLEX  */
-inline S32 inverse_fft(const LLFFTPlan& plan, COMPLEX *array, S32 rows, S32 cols)
-{
-	return fft(plan, array, rows, cols, INVERSE);
-}
-
-#endif
diff --git a/linden/indra/newview/llflexibleobject.cpp b/linden/indra/newview/llflexibleobject.cpp
index 8e4fe91..836cfdc 100644
--- a/linden/indra/newview/llflexibleobject.cpp
+++ b/linden/indra/newview/llflexibleobject.cpp
@@ -626,7 +626,7 @@ void LLVolumeImplFlexible::onSetScale(const LLVector3& scale, BOOL damped)
 
 BOOL LLVolumeImplFlexible::doUpdateGeometry(LLDrawable *drawable)
 {
-	LLVOVolume *volume = (LLVOVolume*)mVO.get();
+	LLVOVolume *volume = (LLVOVolume*)mVO;
 
 	if (volume->mDrawable.isNull()) // Not sure why this is happening, but it is...
 	{
@@ -742,7 +742,7 @@ void LLVolumeImplFlexible::updateRelativeXform()
 {
 	LLQuaternion delta_rot;
 	LLVector3 delta_pos, delta_scale;
-	LLVOVolume* vo = (LLVOVolume*) mVO.get();
+	LLVOVolume* vo = (LLVOVolume*) mVO;
 
 	//matrix from local space to parent relative/global space
 	delta_rot = vo->mDrawable->isSpatialRoot() ? LLQuaternion() : vo->mDrawable->getRotation();
diff --git a/linden/indra/newview/llflexibleobject.h b/linden/indra/newview/llflexibleobject.h
index 507073b..f3da5bb 100644
--- a/linden/indra/newview/llflexibleobject.h
+++ b/linden/indra/newview/llflexibleobject.h
@@ -111,7 +111,8 @@ class LLVolumeImplFlexible : public LLVolumeInterface
 		//--------------------------------------
 		// private members
 		//--------------------------------------
-		LLPointer<LLViewerObject>	mVO;
+	    // Backlink only; don't make this an LLPointer.
+		LLViewerObject*				mVO;
 		LLTimer						mTimer;
 		LLVector3					mAnchorPosition;
 		LLVector3					mParentPosition;
diff --git a/linden/indra/newview/llfloaterabout.cpp b/linden/indra/newview/llfloaterabout.cpp
index 372d7e0..cc3bb08 100644
--- a/linden/indra/newview/llfloaterabout.cpp
+++ b/linden/indra/newview/llfloaterabout.cpp
@@ -82,9 +82,10 @@ LLFloaterAbout::LLFloaterAbout()
 
 	// Version string
 	LLString version = gSecondLife
-		+ llformat(" %d.%d.%d (%d) %s %s",
+		+ llformat(" %d.%d.%d (%d) %s %s (%s)",
 				   LL_VERSION_MAJOR, LL_VERSION_MINOR, LL_VERSION_PATCH, LL_VIEWER_BUILD,
-				   __DATE__, __TIME__);
+				   __DATE__, __TIME__,
+				   gChannelName.c_str());
 	support.append(version);
 	support.append("\n\n");
 
diff --git a/linden/indra/newview/llfloaterchat.cpp b/linden/indra/newview/llfloaterchat.cpp
index 5e416d4..dd79afd 100644
--- a/linden/indra/newview/llfloaterchat.cpp
+++ b/linden/indra/newview/llfloaterchat.cpp
@@ -187,22 +187,22 @@ void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file)
 	// could flash the chat button in the status bar here. JC
 	if (!gFloaterChat) return;
 
-	LLViewerTextEditor*	HistoryEditor = (LLViewerTextEditor*)gFloaterChat->getChildByName("Chat History Editor");
-	LLViewerTextEditor*	HistoryEditorWithMute = (LLViewerTextEditor*)gFloaterChat->getChildByName("Chat History Editor with mute");
+	LLViewerTextEditor*	history_editor = (LLViewerTextEditor*)gFloaterChat->getChildByName("Chat History Editor");
+	LLViewerTextEditor*	history_editor_with_mute = (LLViewerTextEditor*)gFloaterChat->getChildByName("Chat History Editor with mute");
 
-	HistoryEditor->setParseHTML(TRUE);
-	HistoryEditorWithMute->setParseHTML(TRUE);
+	history_editor->setParseHTML(TRUE);
+	history_editor_with_mute->setParseHTML(TRUE);
 	
 	if (!chat.mMuted)
 	{
-		add_timestamped_line(HistoryEditor, chat.mText, color);
-		add_timestamped_line(HistoryEditorWithMute, chat.mText, color);
+		add_timestamped_line(history_editor, chat.mText, color);
+		add_timestamped_line(history_editor_with_mute, chat.mText, color);
 	}
 	else
 	{
 		// desaturate muted chat
 		LLColor4 muted_color = lerp(color, LLColor4::grey, 0.5f);
-		add_timestamped_line(HistoryEditorWithMute, chat.mText, color);
+		add_timestamped_line(history_editor_with_mute, chat.mText, color);
 	}
 
 	if (!chat.mMuted
@@ -211,17 +211,19 @@ void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file)
 		&& chat.mFromID != gAgent.getID())
 	{
 			
-		LLComboBox*	ChatterCombo = LLUICtrlFactory::getComboBoxByName(gFloaterChat,"chatter combobox");
+		LLComboBox*	chatter_combo = LLUICtrlFactory::getComboBoxByName(gFloaterChat,"chatter combobox");
 		
-		if(!ChatterCombo)
-				return;
+		if(!chatter_combo)
+		{
+			return;
+		}
 
-		if (!ChatterCombo->setCurrentByID(chat.mFromID))
+		if (!chatter_combo->setCurrentByID(chat.mFromID))
 		{
 			// if we have too many items...
-			if (ChatterCombo->getItemCount() >= MAX_CHATTER_COUNT)
+			if (chatter_combo->getItemCount() >= MAX_CHATTER_COUNT)
 			{
-				ChatterCombo->remove(0);
+				chatter_combo->remove(0);
 			}
 			
 			LLMute mute(chat.mFromID, chat.mFromName);
@@ -234,8 +236,8 @@ void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file)
 				mute.mType = LLMute::AGENT;
 			}
 			LLString item = mute.getDisplayName();
-			ChatterCombo->add(item, chat.mFromID);
-			ChatterCombo->setCurrentByIndex(ChatterCombo->getItemCount() - 1);
+			chatter_combo->add(item, chat.mFromID);
+			chatter_combo->setCurrentByIndex(chatter_combo->getItemCount() - 1);
 			gFloaterChat->childSetEnabled("Mute resident",TRUE);
 		}
 	}
@@ -246,11 +248,11 @@ void LLFloaterChat::setHistoryCursorAndScrollToEnd()
 {
 	if (gFloaterChat)
 	{
-		LLViewerTextEditor*	HistoryEditor = (LLViewerTextEditor*)gFloaterChat->getChildByName("Chat History Editor");
-		LLViewerTextEditor*	HistoryEditorWithMute = (LLViewerTextEditor*)gFloaterChat->getChildByName("Chat History Editor with mute");
+		LLViewerTextEditor*	history_editor = (LLViewerTextEditor*)gFloaterChat->getChildByName("Chat History Editor");
+		LLViewerTextEditor*	history_editor_with_mute = (LLViewerTextEditor*)gFloaterChat->getChildByName("Chat History Editor with mute");
 		
-		HistoryEditor->setCursorAndScrollToEnd();
-		HistoryEditorWithMute->setCursorAndScrollToEnd();
+		history_editor->setCursorAndScrollToEnd();
+		history_editor_with_mute->setCursorAndScrollToEnd();
 	}
 }
 
@@ -279,10 +281,10 @@ void LLFloaterChat::onClickMute(void *data)
 {
 	LLFloaterChat* self = (LLFloaterChat*)data;
 
-	LLComboBox*	ChatterCombo = LLUICtrlFactory::getComboBoxByName(self,"chatter combobox");
+	LLComboBox*	chatter_combo = LLUICtrlFactory::getComboBoxByName(self,"chatter combobox");
 
-	const LLString& name = ChatterCombo->getSimple();
-	LLUUID id = ChatterCombo->getCurrentID();
+	const LLString& name = chatter_combo->getSimple();
+	LLUUID id = chatter_combo->getCurrentID();
 
 	if (name.empty()) return;
 
@@ -328,24 +330,24 @@ void LLFloaterChat::onClickToggleShowMute(LLUICtrl* caller, void *data)
 
 	//LLCheckBoxCtrl*	
 	BOOL show_mute = LLUICtrlFactory::getCheckBoxByName(floater,"show mutes")->get();
-	LLViewerTextEditor*	HistoryEditor = (LLViewerTextEditor*)floater->getChildByName("Chat History Editor");
-	LLViewerTextEditor*	HistoryEditorWithMute = (LLViewerTextEditor*)floater->getChildByName("Chat History Editor with mute");
+	LLViewerTextEditor*	history_editor = (LLViewerTextEditor*)floater->getChildByName("Chat History Editor");
+	LLViewerTextEditor*	history_editor_with_mute = (LLViewerTextEditor*)floater->getChildByName("Chat History Editor with mute");
 
-	if (!HistoryEditor || !HistoryEditorWithMute)
+	if (!history_editor || !history_editor_with_mute)
 		return;
 
 	//BOOL show_mute = floater->mShowMuteCheckBox->get();
 	if (show_mute)
 	{
-		HistoryEditor->setVisible(FALSE);
-		HistoryEditorWithMute->setVisible(TRUE);
-		HistoryEditorWithMute->setCursorAndScrollToEnd();
+		history_editor->setVisible(FALSE);
+		history_editor_with_mute->setVisible(TRUE);
+		history_editor_with_mute->setCursorAndScrollToEnd();
 	}
 	else
 	{
-		HistoryEditor->setVisible(TRUE);
-		HistoryEditorWithMute->setVisible(FALSE);
-		HistoryEditor->setCursorAndScrollToEnd();
+		history_editor->setVisible(TRUE);
+		history_editor_with_mute->setVisible(FALSE);
+		history_editor->setCursorAndScrollToEnd();
 	}
 }
 
diff --git a/linden/indra/newview/llfloatereditui.cpp b/linden/indra/newview/llfloatereditui.cpp
index 81c93ce..47cf97d 100644
--- a/linden/indra/newview/llfloatereditui.cpp
+++ b/linden/indra/newview/llfloatereditui.cpp
@@ -68,7 +68,7 @@ void	LLFloaterEditUI::navigateHierarchyButtonPressed(void*	data)
 				idx = parentChildren->size()-1;
 			else
 				idx--;
-			if( idx < 0 || idx >= parentChildren->size())break;
+			if( (long) idx < 0 || idx >= parentChildren->size())break;
 			for(sidx = 0,itor = parentChildren->begin();itor!=parentChildren->end();itor++,sidx++){
 				if(sidx == idx)
 				{
@@ -84,7 +84,7 @@ void	LLFloaterEditUI::navigateHierarchyButtonPressed(void*	data)
 				idx = 0;
 			else
 				idx++;
-			if( idx < 0 || idx >= parentChildren->size())break;
+			if( (long) idx < 0 || idx >= parentChildren->size())break;
 			for(sidx = 0,itor = parentChildren->begin();itor!=parentChildren->end();itor++,sidx++){
 				if(sidx == idx)
 				{
diff --git a/linden/indra/newview/llfloaterland.cpp b/linden/indra/newview/llfloaterland.cpp
index ee89975..78e5e70 100644
--- a/linden/indra/newview/llfloaterland.cpp
+++ b/linden/indra/newview/llfloaterland.cpp
@@ -192,13 +192,11 @@ void LLFloaterLand::show()
 	// (and hence we have the local id).
 	// gParcelMgr->sendParcelAccessListRequest(AL_ACCESS | AL_BAN | AL_RENTER);
 
-	// If we've already got the parcel data, fill the
-	// floater with it.
 	sInstance->mParcel = gParcelMgr->getFloatingParcelSelection();
-	if (sInstance->mParcel->getParcel())
-	{
-		sInstance->refresh();
-	}
+	
+	// Refresh even if not over a region so we don't get an
+	// uninitialized dialog. The dialog is 0-region aware.
+	sInstance->refresh();
 }
 
 //static
diff --git a/linden/indra/newview/llfloaterregioninfo.cpp b/linden/indra/newview/llfloaterregioninfo.cpp
index 85fbfe1..70e975e 100644
--- a/linden/indra/newview/llfloaterregioninfo.cpp
+++ b/linden/indra/newview/llfloaterregioninfo.cpp
@@ -50,6 +50,7 @@
 #include "llcombobox.h"
 #include "llfilepicker.h"
 #include "llfloatergodtools.h"	// for send_sim_wide_deletes()
+#include "llfloatertopobjects.h" // added to fix SL-32336
 #include "llfloatergroups.h"
 #include "llfloatertelehub.h"
 #include "lllineeditor.h"
@@ -885,6 +886,8 @@ void LLPanelRegionDebugInfo::onClickTopColliders(void* data)
 	strings_t strings;
 	strings.push_back("1");	// one physics step
 	LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
+	LLFloaterTopObjects::show();
+	LLFloaterTopObjects::clearList();
 	self->sendEstateOwnerMessage(gMessageSystem, "colliders", invoice, strings);
 }
 
@@ -895,6 +898,8 @@ void LLPanelRegionDebugInfo::onClickTopScripts(void* data)
 	strings_t strings;
 	strings.push_back("6");	// top 5 scripts
 	LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
+	LLFloaterTopObjects::show();
+	LLFloaterTopObjects::clearList();
 	self->sendEstateOwnerMessage(gMessageSystem, "scripts", invoice, strings);
 }
 
diff --git a/linden/indra/newview/llfloatertopobjects.cpp b/linden/indra/newview/llfloatertopobjects.cpp
index 6212ce9..53d00fc 100644
--- a/linden/indra/newview/llfloatertopobjects.cpp
+++ b/linden/indra/newview/llfloatertopobjects.cpp
@@ -370,19 +370,22 @@ void LLFloaterTopObjects::onDisableSelected(void* data)
 	sInstance->doToObjects(ACTION_DISABLE, false);
 }
 
+//static
 void LLFloaterTopObjects::clearList()
 {
-	LLCtrlListInterface *list = childGetListInterface("objects_list");
+	LLCtrlListInterface *list = sInstance->childGetListInterface("objects_list");
 	
 	if (list) 
 	{
 		list->operateOnAll(LLCtrlListInterface::OP_DELETE);
 	}
 
-	mObjectListData.clear();
-	mObjectListIDs.clear();
+	sInstance->mObjectListData.clear();
+	sInstance->mObjectListIDs.clear();
+	sInstance->mtotalScore = 0.f;
 }
 
+//static
 void LLFloaterTopObjects::onRefresh(void* data)
 {
 	U32 mode = STAT_REPORT_TOP_SCRIPTS;
@@ -397,8 +400,6 @@ void LLFloaterTopObjects::onRefresh(void* data)
 		sInstance->clearList();
 	}
 
-	sInstance->mtotalScore = 0.f;
-
 	LLMessageSystem *msg = gMessageSystem;
 	msg->newMessageFast(_PREHASH_LandStatRequest);
 	msg->nextBlockFast(_PREHASH_AgentData);
diff --git a/linden/indra/newview/llfloatertopobjects.h b/linden/indra/newview/llfloatertopobjects.h
index 3d8a1e6..b539ebc 100644
--- a/linden/indra/newview/llfloatertopobjects.h
+++ b/linden/indra/newview/llfloatertopobjects.h
@@ -44,7 +44,7 @@ public:
 	static void handle_land_reply(LLMessageSystem* msg, void** data);
 	void handleReply(LLMessageSystem* msg, void** data);
 	
-	void clearList();
+	static void clearList();
 	void updateSelectionInfo();
 	virtual BOOL postBuild();
 
diff --git a/linden/indra/newview/llimpanel.h b/linden/indra/newview/llimpanel.h
index 00b7033..10d387e 100644
--- a/linden/indra/newview/llimpanel.h
+++ b/linden/indra/newview/llimpanel.h
@@ -98,7 +98,7 @@ public:
 
 	const LLUUID& getSessionID() const { return mSessionUUID; }
 	const LLUUID& getOtherParticipantID() const { return mOtherParticipantUUID; }
-	const EInstantMessage getDialogType() const { return mDialog; }
+	EInstantMessage getDialogType() const { return mDialog; }
 
 	void sessionInitReplyReceived(const LLUUID& im_session_id);
 
diff --git a/linden/indra/newview/llpanelcontents.cpp b/linden/indra/newview/llpanelcontents.cpp
index 4d138d4..73c1cac 100644
--- a/linden/indra/newview/llpanelcontents.cpp
+++ b/linden/indra/newview/llpanelcontents.cpp
@@ -56,7 +56,6 @@
 #include "llviewerobject.h"
 #include "llviewerregion.h"
 #include "llresmgr.h"
-#include "lltexturetable.h"
 #include "llselectmgr.h"
 #include "llpreviewscript.h"
 #include "lltool.h"
diff --git a/linden/indra/newview/llpaneldisplay.cpp b/linden/indra/newview/llpaneldisplay.cpp
index d79dcb4..c4fa1dc 100644
--- a/linden/indra/newview/llpaneldisplay.cpp
+++ b/linden/indra/newview/llpaneldisplay.cpp
@@ -520,6 +520,7 @@ void LLPanelDisplay2::refreshEnabledState()
 
 void LLPanelDisplay2::apply()
 {
+
 	// Anisotropic rendering
 	BOOL old_anisotropic = LLImageGL::sGlobalUseAnisotropic;
 	LLImageGL::sGlobalUseAnisotropic = childGetValue("ani");
diff --git a/linden/indra/newview/llpanelface.cpp b/linden/indra/newview/llpanelface.cpp
index 9cbfdc2..b48d8c7 100644
--- a/linden/indra/newview/llpanelface.cpp
+++ b/linden/indra/newview/llpanelface.cpp
@@ -51,7 +51,6 @@
 #include "lltextbox.h"
 #include "lltexturectrl.h"
 #include "lltextureentry.h"
-#include "lltexturetable.h"
 #include "lltooldraganddrop.h"
 #include "llui.h"
 #include "llviewercontrol.h"
diff --git a/linden/indra/newview/llpanellogin.cpp b/linden/indra/newview/llpanellogin.cpp
index 5f31216..fdc431c 100644
--- a/linden/indra/newview/llpanellogin.cpp
+++ b/linden/indra/newview/llpanellogin.cpp
@@ -220,7 +220,8 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
 		text->setClickedCallback(onClickVersion);
 		text->setCallbackUserData(this);
 
-		// HACK
+		// HACK to move to the lower-right of the window
+		// replace/remove this logic when we have dynamic layouts
 		S32 right = getRect().mRight;
 		LLRect r = text->getRect();
 		const S32 PAD = 2;
@@ -229,6 +230,31 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
 		text->setRect(r);
 	}
 
+	LLTextBox* channel_text = LLUICtrlFactory::getTextBoxByName(this, "channel_text");
+	if (channel_text)
+	{
+		channel_text->setText(gChannelName);
+		channel_text->setClickedCallback(onClickVersion);
+		channel_text->setCallbackUserData(this);
+
+		// HACK to move to the right of the window, above the version string,
+		// replace/remove this logic when we have dynamic layouts
+		S32 right = getRect().mRight;
+		LLRect r = channel_text->getRect();
+		const S32 PAD = 2;
+		S32 version_string_top = r.mTop;
+		if(text)
+		{
+			version_string_top = text->getRect().mTop;
+		}
+		r.setOriginAndSize( 
+			right - r.getWidth() - PAD,
+			version_string_top, 
+			r.getWidth(), 
+			r.getHeight());
+		channel_text->setRect(r);
+	}
+
 	// get the web browser control
 	#if LL_LIBXUL_ENABLED
 	LLWebBrowserCtrl* web_browser = LLUICtrlFactory::getWebBrowserCtrlByName(this, "login_html");
diff --git a/linden/indra/newview/llpolymesh.h b/linden/indra/newview/llpolymesh.h
index 9634dbf..a421e05 100644
--- a/linden/indra/newview/llpolymesh.h
+++ b/linden/indra/newview/llpolymesh.h
@@ -360,7 +360,8 @@ protected:
 	typedef LLAssocList<std::string, LLPolyMeshSharedData*> LLPolyMeshSharedDataTable; 
 	static LLPolyMeshSharedDataTable sGlobalSharedMeshList;
 
-	LLPointer<LLVOAvatar> mAvatarp;
+	// Backlink only; don't make this an LLPointer.
+	LLVOAvatar* mAvatarp;
 };
 
 //-----------------------------------------------------------------------------
@@ -426,7 +427,8 @@ protected:
 	joint_vec_map_t mJointScales;
 	joint_vec_map_t mJointOffsets;
 	LLVector3	mDefaultVec;
-	LLPointer<LLVOAvatar> mAvatar;
+	// Backlink only; don't make this an LLPointer.
+	LLVOAvatar *mAvatar;
 };
 
 #endif // LL_LLPOLYMESH_H
diff --git a/linden/indra/newview/llprogressview.cpp b/linden/indra/newview/llprogressview.cpp
index 71a1d66..2ec8dcd 100644
--- a/linden/indra/newview/llprogressview.cpp
+++ b/linden/indra/newview/llprogressview.cpp
@@ -124,7 +124,7 @@ BOOL LLProgressView::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent)
 		// Suck up all keystokes except CTRL-Q.
 		if( ('Q' == key) && (MASK_CONTROL == mask) )
 		{
-			app_request_quit();
+			app_user_quit();
 		}
 		return TRUE;
 	}
diff --git a/linden/indra/newview/llsrv.cpp b/linden/indra/newview/llsrv.cpp
index 4dec48d..5a623bc 100644
--- a/linden/indra/newview/llsrv.cpp
+++ b/linden/indra/newview/llsrv.cpp
@@ -73,49 +73,37 @@ vector<LLSRVRecord> LLSRV::query(const string& name)
 
 #include <netdb.h>
 
-vector<LLSRVRecord> LLSRV::query(const string& queryName)
+#ifdef HOMEGROWN_RESPONSE_PARSER
+
+// We ought to be using libresolv's ns_initparse and ns_parserr to
+// parse the result of our query.  However, libresolv isn't packaged
+// correctly on Linux (as of BIND 9), so neither of these functions is
+// available without statically linking against libresolv.  Ugh!  This
+// fallback function is available if we need to parse the response
+// ourselves without relying too much on libresolv.  It is NOT THE
+// DEFAULT.
+
+vector<LLSRVRecord> LLSRV::parseResponse(const unsigned char *response,
+										 int resp_len)
 {
-	unsigned char response[16384];
 	vector<LLSRVRecord> recs;
-	char name[1024];
-	int len;
-	
-	len = res_query(queryName.c_str(), ns_c_in, ns_t_srv, response,
-					sizeof(response));
-
-	if (len == -1)
-	{
-		llinfos << "Query failed for " << queryName << llendl;
-		return recs;
-	}
-	else if (len > (int) sizeof(response))
-	{
-		llinfos << "Response too big for " << queryName
-				<< " (capacity " << sizeof(response)
-				<< ", response " << len << ")" << llendl;
-		return recs;
-	}
-
-    // We "should" be using libresolv's ns_initparse and ns_parserr to
-    // parse the result of our query.  However, libresolv isn't
-    // packaged correctly on Linux (as of BIND 9), so neither of these
-    // functions is available without statically linking against
-    // libresolv.  Ugh!  So we parse the response ourselves.
 
 	const unsigned char *pos = response + sizeof(HEADER);
-	const unsigned char *end = response + len;
+	const unsigned char *end = response + resp_len;
 	const HEADER *hdr = (const HEADER *) response;
+	char name[1024];
 
 	// Skip over the query embedded in the response.
 
 	for (int q = ntohs(hdr->qdcount); q > 0; --q)
 	{
-		len = dn_expand(response, end, pos, name, sizeof(name));
+		int len = dn_expand(response, end, pos, name, sizeof(name));
 
 		if (len == -1)
 		{
-			llinfos << "Could not expand queried name in RR response" << llendl;
-			return recs;
+			llinfos << "Could not expand queried name in RR response"
+					<< llendl;
+			goto bail;
 		}
 		
 		pos += len + NS_QFIXEDSZ;
@@ -125,11 +113,12 @@ vector<LLSRVRecord> LLSRV::query(const string& queryName)
 	{
 		static const ns_rr *rr;
 
-		len = dn_expand(response, end, pos, name, sizeof(name) - 1);
+		int len = dn_expand(response, end, pos, name, sizeof(name) - 1);
 		if (len == -1)
 		{
-			llinfos << "Could not expand response name in RR response" << llendl;
-			return recs;
+			llinfos << "Could not expand response name in RR response"
+					<< llendl;
+			goto bail;
 		}
 
 		// Skip over the resource name and headers we don't care about.
@@ -150,7 +139,7 @@ vector<LLSRVRecord> LLSRV::query(const string& queryName)
 		if (len == -1)
 		{
 			llinfos << "Could not expand name in RR response" << llendl;
-			return recs;
+			goto bail;
 		}
 
 		recs.push_back(LLSRVRecord(prio, weight, name, port));
@@ -158,12 +147,177 @@ vector<LLSRVRecord> LLSRV::query(const string& queryName)
 
 	// There are likely to be more records in the response, but we
 	// don't care about those, at least for now.
+bail:
+	return reorder(recs);
+}
 
-	return recs;
+#else // HOMEGROWN_RESPONSE_PARSER
+
+// This version of the response parser is the one to use if libresolv
+// is available and behaving itself.
+
+vector<LLSRVRecord> LLSRV::parseResponse(const unsigned char *response,
+										 int resp_len)
+{
+	vector<LLSRVRecord> recs;
+	ns_msg hdr;
+
+	if (ns_initparse(response, resp_len, &hdr))
+	{
+		llinfos << "Could not parse response" << llendl;
+		goto bail;
+	}
+	
+	for (int i = 0; i < ns_msg_count(hdr, ns_s_an); i++)
+	{
+		ns_rr rr;
+		
+		if (ns_parserr(&hdr, ns_s_an, i, &rr))
+		{
+			llinfos << "Could not parse RR" << llendl;
+			goto bail;
+		}
+
+		if (ns_rr_type(rr) != ns_t_srv)
+		{
+			continue;
+		}
+
+		const unsigned char *pos = ns_rr_rdata(rr);
+		U16 prio, weight, port;
+		char name[1024];
+		int ret;
+		
+		NS_GET16(prio, pos);
+		NS_GET16(weight, pos);
+		NS_GET16(port, pos);
+		
+		ret = dn_expand(ns_msg_base(hdr), ns_msg_end(hdr), pos,
+						name, sizeof(name));
+
+		if (ret == -1)
+		{
+			llinfos << "Could not decompress name" << llendl;
+			goto bail;
+		}
+
+		recs.push_back(LLSRVRecord(prio, weight, name, port));
+	}
+	
+bail:
+	return reorder(recs);
+}
+
+#endif // HOMEGROWN_RESPONSE_PARSER
+
+vector<LLSRVRecord> LLSRV::query(const string& queryName)
+{
+	unsigned char response[16384];
+	vector<LLSRVRecord> recs;
+	int len;
+	
+	len = res_query(queryName.c_str(), ns_c_in, ns_t_srv, response,
+					sizeof(response));
+
+	if (len == -1)
+	{
+		llinfos << "Query failed for " << queryName << llendl;
+		goto bail;
+	}
+	else if (len > (int) sizeof(response))
+	{
+		llinfos << "Response too big for " << queryName
+				<< " (capacity " << sizeof(response)
+				<< ", response " << len << ")" << llendl;
+		goto bail;
+	}
+
+	recs = parseResponse(response, len);
+bail:
+	return reorder(recs);
 }
 
 #endif // LL_WINDOWS
 
+// Implement the algorithm specified in RFC 2782 for dealing with RRs
+// of differing priorities and weights.
+vector<LLSRVRecord> LLSRV::reorder(vector<LLSRVRecord>& recs)
+{
+	typedef list<const LLSRVRecord *> reclist_t;
+	typedef map<U16, reclist_t> bucket_t;
+	vector<LLSRVRecord> newRecs;
+	bucket_t buckets;
+
+	// Don't rely on the DNS server to shuffle responses.
+	
+	random_shuffle(recs.begin(), recs.end());
+
+	for (vector<LLSRVRecord>::const_iterator iter = recs.begin();
+		 iter != recs.end(); ++iter)
+	{
+		buckets[iter->priority()].push_back(&*iter);
+	}
+	
+	// Priorities take precedence over weights.
+
+	for (bucket_t::iterator iter = buckets.begin();
+		 iter != buckets.end(); ++iter)
+	{
+		reclist_t& myPrio = iter->second;
+		reclist_t r;
+
+		// RRs with weight zero go to the front of the intermediate
+		// list, so they'll have little chance of being chosen.
+		// Larger weights have a higher likelihood of selection.
+
+		for (reclist_t::iterator i = myPrio.begin(); i != myPrio.end(); )
+		{
+			if ((*i)->weight() == 0)
+			{
+				r.push_back(*i);
+				i = myPrio.erase(i);
+			} else {
+				++i;
+			}
+		}
+
+		r.insert(r.end(), myPrio.begin(), myPrio.end());
+		
+		while (!r.empty())
+		{
+			U32 total = 0;
+
+			for (reclist_t::const_iterator i = r.begin(); i != r.end(); ++i)
+			{
+				total += (*i)->weight();
+			}
+
+			U32 target = total > 1 ? (rand() % total) : 0;
+			U32 partial = 0;
+			
+			for (reclist_t::iterator i = r.begin(); i != r.end(); )
+			{
+				partial += (*i)->weight();
+				if (partial >= target)
+				{
+					newRecs.push_back(**i);
+					i = r.erase(i);
+				} else {
+					++i;
+				}
+			}
+		}
+	}
+	
+	// Order RRs by lowest numeric priority.  The stable sort
+	// preserves the weight choices we made above.
+
+	stable_sort(newRecs.begin(), newRecs.end(),
+				LLSRVRecord::ComparePriorityLowest());
+
+	return newRecs;
+}
+
 vector<string> LLSRV::rewriteURI(const string& uriStr)
 {
 	LLURI uri(uriStr);
@@ -186,6 +340,14 @@ vector<string> LLSRV::rewriteURI(const string& uriStr)
 		size_t i;
 
 		llinfos << "Got " << srvs.size() << " results" << llendl;
+		for (iter = srvs.begin(); iter != srvs.end(); ++iter)
+		{
+			lldebugs << "host " << iter->target() << ':' << iter->port()
+					 << " prio " << iter->priority()
+					 << " weight " << iter->weight()
+					 << llendl;
+		}
+
 		if (srvs.size() > maxSrvs)
 		{
 			llinfos << "Clamping to " << maxSrvs << llendl;
diff --git a/linden/indra/newview/llsrv.h b/linden/indra/newview/llsrv.h
index fca646d..9417664 100644
--- a/linden/indra/newview/llsrv.h
+++ b/linden/indra/newview/llsrv.h
@@ -41,6 +41,7 @@ protected:
 	std::string mTarget;
 	U16 mPort;
 
+public:
 	LLSRVRecord(U16 priority, U16 weight, const std::string& target,
 				U16 port) :
 		mPriority(priority),
@@ -48,16 +49,30 @@ protected:
 		mTarget(target),
 		mPort(port) {
 	}
-	
-public:
+
 	U16 priority() const { return mPriority; }
 	U16 weight() const { return mWeight; }
 	const std::string& target() const { return mTarget; }
 	U16 port() const { return mPort; }
+
+	struct ComparePriorityLowest
+	{
+		bool operator()(const LLSRVRecord& lhs, const LLSRVRecord& rhs)
+		{
+			return lhs.mPriority < rhs.mPriority;
+		}
+	};
 };
 	
 class LLSRV
 {
+protected:
+#ifndef LL_WINDOWS
+	static std::vector<LLSRVRecord> parseResponse(const unsigned char *response,
+												  int resp_len);
+#endif
+	static std::vector<LLSRVRecord> reorder(std::vector<LLSRVRecord>& recs);
+
 public:
 	static std::vector<LLSRVRecord> query(const std::string& name);
 	static std::vector<std::string> rewriteURI(const std::string& uri);
diff --git a/linden/indra/newview/llstatusbar.cpp b/linden/indra/newview/llstatusbar.cpp
index 784765b..f0c6ea5 100644
--- a/linden/indra/newview/llstatusbar.cpp
+++ b/linden/indra/newview/llstatusbar.cpp
@@ -82,6 +82,7 @@ LLStatusBar *gStatusBar = NULL;
 S32 STATUS_BAR_HEIGHT = 0;
 extern S32 MENU_BAR_HEIGHT;
 
+
 // TODO: these values ought to be in the XML too
 const S32 MENU_PARCEL_SPACING = 1;	// Distance from right of menu item to parcel information
 const S32 SIM_STAT_WIDTH = 8;
@@ -95,6 +96,10 @@ const F32 ICON_FLASH_FREQUENCY	= 2.f;
 const S32 GRAPHIC_FUDGE = 4;
 const S32 TEXT_HEIGHT = 18;
 
+std::vector<std::string> LLStatusBar::sDays;
+std::vector<std::string> LLStatusBar::sMonths;
+const U32 LLStatusBar::MAX_DATE_STRING_LENGTH = 2000;
+
 LLStatusBar::LLStatusBar(const std::string& name, const LLRect& rect)
 :	LLPanel(name, LLRect(), FALSE),		// not mouse opaque
 	mBalance(0),
@@ -106,6 +111,10 @@ LLStatusBar::LLStatusBar(const std::string& name, const LLRect& rect)
 	mMouseOpaque = FALSE;
 	setIsChrome(TRUE);
 
+	// size of day of the weeks and year
+	sDays.reserve(7);
+	sMonths.reserve(12);
+
 	mBalanceTimer = new LLFrameTimer();
 	mHealthTimer = new LLFrameTimer();
 
@@ -114,6 +123,9 @@ LLStatusBar::LLStatusBar(const std::string& name, const LLRect& rect)
 	// status bar can never get a tab
 	setFocusRoot(FALSE);
 
+	// build date necessary data (must do after panel built)
+	setupDate();
+
 	mBtnScriptOut = LLUICtrlFactory::getButtonByName( this, "scriptout" );
 	mBtnHealth = LLUICtrlFactory::getButtonByName( this, "health" );
 	mBtnFly = LLUICtrlFactory::getButtonByName( this, "fly" );
@@ -128,7 +140,7 @@ LLStatusBar::LLStatusBar(const std::string& name, const LLRect& rect)
 
 	mTextHealth = LLUICtrlFactory::getTextBoxByName( this, "HealthText" );
 	mTextTime = LLUICtrlFactory::getTextBoxByName( this, "TimeText" );
-
+	
 	S32 x = mRect.getWidth() - 2;
 	S32 y = 0;
 	LLRect r;
@@ -265,6 +277,14 @@ void LLStatusBar::refresh()
 	  << " " << am_pm << " " << tz;
 	mTextTime->setText(t.str().c_str());
 
+	// Year starts at 1900, set the tooltip to have the date
+	std::ostringstream date;
+	date	<< sDays[internal_time->tm_wday] << ", "
+			<< std::setfill('0') << std::setw(2) << internal_time->tm_mday << " "
+			<< sMonths[internal_time->tm_mon] << " "
+			<< internal_time->tm_year + 1900;
+	mTextTime->setToolTip(date.str().c_str());
+
 	LLRect r;
 	const S32 MENU_RIGHT = gMenuBarView->getRightmostMenuEdge();
 	S32 x = MENU_RIGHT + MENU_PARCEL_SPACING;
@@ -644,6 +664,69 @@ void LLStatusBar::onClickBuyLand(void*)
 	gParcelMgr->startBuyLand();
 }
 
+// sets the static variables necessary for the date
+void LLStatusBar::setupDate()
+{
+	// fill the day array with what's in the xui
+	LLString day_list = childGetText("StatBarDaysOfWeek");
+	size_t length = day_list.size();
+	
+	// quick input check
+	if(length < MAX_DATE_STRING_LENGTH)
+	{
+		// tokenize it and put it in the array
+		LLString cur_word;
+		for(size_t i = 0; i < length; ++i)
+		{
+			if(day_list[i] == ':')
+			{
+				sDays.push_back(cur_word);
+				cur_word.clear();
+			}
+			else
+			{
+				cur_word.append(1, day_list.c_str()[i]);
+			}
+		}
+		sDays.push_back(cur_word);
+	}
+	
+	// fill the day array with what's in the xui	
+	LLString month_list = childGetText( "StatBarMonthsOfYear" );
+	length = month_list.size();
+	
+	// quick input check
+	if(length < MAX_DATE_STRING_LENGTH)
+	{
+		// tokenize it and put it in the array
+		LLString cur_word;
+		for(size_t i = 0; i < length; ++i)
+		{
+			if(month_list[i] == ':')
+			{
+				sMonths.push_back(cur_word);
+				cur_word.clear();
+			}
+			else
+			{
+				cur_word.append(1, month_list.c_str()[i]);
+			}
+		}
+		sMonths.push_back(cur_word);
+	}
+	
+	// make sure we have at least 7 days and 12 months
+	if(sDays.size() < 7)
+	{
+		sDays.resize(7);
+	}
+	
+	if(sMonths.size() < 12)
+	{
+		sMonths.resize(12);
+	}
+}
+
 BOOL can_afford_transaction(S32 cost)
 {
 	return((cost <= 0)||((gStatusBar) && (gStatusBar->getBalance() >=cost)));
diff --git a/linden/indra/newview/llstatusbar.h b/linden/indra/newview/llstatusbar.h
index a072cd9..e08066b 100644
--- a/linden/indra/newview/llstatusbar.h
+++ b/linden/indra/newview/llstatusbar.h
@@ -93,6 +93,9 @@ protected:
 	static void onClickScripts(void*);
 	static void onClickBuyLand(void*);
 	static void onClickScriptDebug(void*);
+	
+	// simple method to setup the part that holds the date
+	void setupDate();
 
 protected:
 	LLTextBox	*mTextBalance;
@@ -121,6 +124,10 @@ protected:
 	S32				mSquareMetersCommitted;
 	LLFrameTimer*	mBalanceTimer;
 	LLFrameTimer*	mHealthTimer;
+	
+	static std::vector<std::string> sDays;
+	static std::vector<std::string> sMonths;
+	static const U32 LLStatusBar::MAX_DATE_STRING_LENGTH;
 };
 
 // *HACK: Status bar owns your cached money balance. JC
diff --git a/linden/indra/newview/lltexlayer.cpp b/linden/indra/newview/lltexlayer.cpp
index 26ee098..2005e39 100644
--- a/linden/indra/newview/lltexlayer.cpp
+++ b/linden/indra/newview/lltexlayer.cpp
@@ -2314,7 +2314,7 @@ LLColor4 LLTexParamColor::getNetColor()
 {
 	llassert( getInfo()->mNumColors >= 1 );
 
-	F32 effective_weight = ( mAvatar.notNull() && (mAvatar->getSex() & getSex()) ) ? mCurWeight : getDefaultWeight();
+	F32 effective_weight = ( mAvatar && (mAvatar->getSex() & getSex()) ) ? mCurWeight : getDefaultWeight();
 
 	S32 index_last = getInfo()->mNumColors - 1;
 	F32 scaled_weight = effective_weight * index_last;
diff --git a/linden/indra/newview/lltexlayer.h b/linden/indra/newview/lltexlayer.h
index 920ae4a..7d517ee 100644
--- a/linden/indra/newview/lltexlayer.h
+++ b/linden/indra/newview/lltexlayer.h
@@ -286,7 +286,8 @@ protected:
 	typedef std::vector<LLTexLayer *> layer_list_t;
 	layer_list_t			mLayerList;
 	LLTexLayerSetBuffer*	mComposite;
-	LLPointer<LLVOAvatar>	mAvatar;
+	// Backlink only; don't make this an LLPointer.
+	LLVOAvatar*				mAvatar;
 	BOOL					mUpdatesEnabled;
 	BOOL					mHasBump;
 
@@ -443,7 +444,7 @@ public:
 protected:
 	typedef std::vector<LLTexParamColor *> param_list_t;
 	param_list_t			mParamList;
-	LLPointer<LLVOAvatar>	mAvatar;
+	LLVOAvatar*				mAvatar;  // just backlink, don't LLPointer 
 
 	LLTexGlobalColorInfo	*mInfo;
 };
@@ -489,7 +490,7 @@ protected:
 	LLVector3				mAvgDistortionVec;
 	LLTexGlobalColor*		mTexGlobalColor;	// either has mTexGlobalColor or mTexLayer as its parent
 	LLTexLayer*				mTexLayer;
-	LLPointer<LLVOAvatar>	mAvatar;			// redundant, but simplifies the code
+	LLVOAvatar*				mAvatar;			// redundant, but simplifies the code (don't LLPointer)
 };
 
 //-----------------------------------------------------------------------------
@@ -569,7 +570,7 @@ public:
 	~LLBakedUploadData() {}
 
 	LLUUID					mID;
-	LLPointer<LLVOAvatar>	mAvatar;
+	LLVOAvatar*				mAvatar;	 // just backlink, don't LLPointer 
 	LLTexLayerSetBuffer*	mLayerSetBuffer;
 	LLUUID					mWearableAssets[WT_COUNT];
 };
diff --git a/linden/indra/newview/lltexturetable.cpp b/linden/indra/newview/lltexturetable.cpp
deleted file mode 100644
index 52e4a46..0000000
--- a/linden/indra/newview/lltexturetable.cpp
+++ /dev/null
@@ -1,157 +0,0 @@
-/** 
- * @file lltexturetable.cpp
- * @brief Table of texture names and IDs for viewer
- *
- * Copyright (c) 2001-2007, Linden Research, Inc.
- * 
- * Second Life Viewer Source Code
- * The source code in this file ("Source Code") is provided by Linden Lab
- * to you under the terms of the GNU General Public License, version 2.0
- * ("GPL"), unless you have obtained a separate licensing agreement
- * ("Other License"), formally executed by you and Linden Lab.  Terms of
- * the GPL can be found in doc/GPL-license.txt in this distribution, or
- * online at http://secondlife.com/developers/opensource/gplv2
- * 
- * There are special exceptions to the terms and conditions of the GPL as
- * it is applied to this Source Code. View the full text of the exception
- * in the file doc/FLOSS-exception.txt in this software distribution, or
- * online at http://secondlife.com/developers/opensource/flossexception
- * 
- * By copying, modifying or distributing this software, you acknowledge
- * that you have read and understood your obligations described above,
- * and agree to abide by those obligations.
- * 
- * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
- * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
- * COMPLETENESS OR PERFORMANCE.
- */
-
-#include "llviewerprecompiledheaders.h"
-
-#include <string.h>
-
-#include "lltexturetable.h"
-#include "llstring.h"
-
-LLTextureTable gTextureTable;
-
-
-LLTextureInfo::LLTextureInfo(const std::string& name, const LLUUID &uuid, const std::string& description)
-{
-	S32 length = name.size();
-	if (length > 0)
-	{
-		mName = name;
-	}
-	else
-	{
-		char *temp = new char[UUID_STR_LENGTH];
-		uuid.toString(temp);
-		mName = temp;
-	}
-	LLString::toLower(mName);
-	
-	mUUID = uuid;
-	mDescription = description;
-}
-
-LLTextureInfo::~LLTextureInfo()
-{
-}
-
-LLTextureTable::LLTextureTable()
-{
-	mTextureInfoList.setInsertBefore(&LLTextureTable::insertBefore);
-}
-
-LLTextureTable::~LLTextureTable()
-{
-	mTextureInfoList.deleteAllData();
-}
-
-// Comparison function for sorting the list.
-// static
-BOOL LLTextureTable::insertBefore(LLTextureInfo* a, LLTextureInfo* b)
-{
-	return (a->mName.compare(b->mName) < 0);
-}
-
-
-//void LLTextureTable::bubbleSort()
-//{
-//	mTextureInfoList.bubbleSortList();
-//}
-
-BOOL LLTextureTable::add(const std::string& name, const LLUUID &uuid, const std::string& description)
-{
-	LLTextureInfo *infop;
-
-	infop = new LLTextureInfo(name, uuid, description);
-	if (!infop) return FALSE;
-
-	mTextureInfoList.addDataSorted(infop);
-
-	return TRUE;
-}
-
-
-// *FIX: Since the table is sorted based on name, this could be vastly
-// sped up by doing a binary search.
-LLUUID LLTextureTable::getUUID(const std::string& name)
-{
-	LLTextureInfo *infop;
-
-	for (infop = mTextureInfoList.getFirstData(); infop != NULL; infop = mTextureInfoList.getNextData() )
-	{
-		LLString name_lc = name;
-		LLString::toLower(name_lc);
-		if (name_lc == infop->mName)
-		{
-			return infop->mUUID;
-		}
-	}
-
-	return LLUUID::null;
-}
-
-
-std::string LLTextureTable::getDesc(const std::string& name)
-{
-	LLTextureInfo *infop;
-
-	for (infop = mTextureInfoList.getFirstData(); infop != NULL; infop = mTextureInfoList.getNextData() )
-	{
-		LLString name_lc = name;
-		LLString::toLower(name_lc);
-		if (name_lc == infop->mName)
-		{
-			return infop->mDescription;
-		}
-	}
-
-	return LLString::null;
-}
-
-
-std::string LLTextureTable::getName(const LLUUID &id)
-{
-	LLTextureInfo *infop;
-
-	for (infop = mTextureInfoList.getFirstData(); infop != NULL; infop = mTextureInfoList.getNextData() )
-	{
-		if (id == infop->mUUID)
-		{
-			return infop->mName;
-		}
-	}
-
-	return LLString::null;
-}
-
-
-void LLTextureTable::deleteAll()
-{
-	// Clear out the list
-
-	mTextureInfoList.deleteAllData();
-}
diff --git a/linden/indra/newview/lltexturetable.h b/linden/indra/newview/lltexturetable.h
deleted file mode 100644
index 85510b5..0000000
--- a/linden/indra/newview/lltexturetable.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/** 
- * @file lltexturetable.h
- * @brief Table of texture names and IDs for viewer
- *
- * Copyright (c) 2001-2007, Linden Research, Inc.
- * 
- * Second Life Viewer Source Code
- * The source code in this file ("Source Code") is provided by Linden Lab
- * to you under the terms of the GNU General Public License, version 2.0
- * ("GPL"), unless you have obtained a separate licensing agreement
- * ("Other License"), formally executed by you and Linden Lab.  Terms of
- * the GPL can be found in doc/GPL-license.txt in this distribution, or
- * online at http://secondlife.com/developers/opensource/gplv2
- * 
- * There are special exceptions to the terms and conditions of the GPL as
- * it is applied to this Source Code. View the full text of the exception
- * in the file doc/FLOSS-exception.txt in this software distribution, or
- * online at http://secondlife.com/developers/opensource/flossexception
- * 
- * By copying, modifying or distributing this software, you acknowledge
- * that you have read and understood your obligations described above,
- * and agree to abide by those obligations.
- * 
- * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
- * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
- * COMPLETENESS OR PERFORMANCE.
- */
-
-// Table of texture information for the viewer UI. The Table is
-// maintained in a sorted order at all times.
-
-#ifndef LL_LLTEXTURETABLE_H
-#define LL_LLTEXTURETABLE_H
-
-#include "lluuid.h"
-#include "linked_lists.h"
-
-class LLTextureInfo
-{
-public:
-	LLTextureInfo(const std::string& name, const LLUUID &uuid, const std::string& description);
-	~LLTextureInfo();
-	std::string	mName;
-	LLUUID		mUUID;
-	std::string	mDescription;
-};
-
-class LLTextureTable
-{
-public:
-	LLTextureTable();
-	~LLTextureTable();
-	
-	BOOL	add(const std::string& name, const LLUUID &uuid, 
-				const std::string& description);				// copies memory, false if fails
-	LLUUID	getUUID(const std::string& name);					// LLUUID::null if not found
-	std::string getDesc(const std::string& name);
-	std::string	getName(const LLUUID &id);
-	void	deleteAll();
-	//void	bubbleSort();
-
-	static BOOL insertBefore(LLTextureInfo* a, LLTextureInfo* b);
-
-public:
-	LLLinkedList<LLTextureInfo>	mTextureInfoList;
-};
-
-extern LLTextureTable gTextureTable;
-
-#endif
diff --git a/linden/indra/newview/lltextureview.cpp b/linden/indra/newview/lltextureview.cpp
index bd9b273..6a24a57 100644
--- a/linden/indra/newview/lltextureview.cpp
+++ b/linden/indra/newview/lltextureview.cpp
@@ -43,7 +43,6 @@
 #include "lltexlayer.h"
 #include "lltexturecache.h"
 #include "lltexturefetch.h"
-#include "lltexturetable.h"
 #include "llviewerobject.h"
 #include "llviewerimage.h"
 #include "llviewerimagelist.h"
@@ -183,9 +182,6 @@ void LLTextureBar::draw()
 
 	LLGLSUIDefault gls_ui;
 	
-	// Get the name or UUID of the image.
-	gTextureTable.getName(mImagep->mID);
-	
 	// Name, pixel_area, requested pixel area, decode priority
 	char uuid_str[255];
 	mImagep->mID.toString(uuid_str);
diff --git a/linden/indra/newview/llviewerimage.cpp b/linden/indra/newview/llviewerimage.cpp
index b129a9a..e40fb80 100644
--- a/linden/indra/newview/llviewerimage.cpp
+++ b/linden/indra/newview/llviewerimage.cpp
@@ -43,7 +43,6 @@
 #include "llimagetga.h"
 #include "llmemtype.h"
 #include "llstl.h"
-#include "lltexturetable.h"
 #include "llvfile.h"
 #include "llvfs.h"
 #include "message.h"
diff --git a/linden/indra/newview/llviewerimagelist.cpp b/linden/indra/newview/llviewerimagelist.cpp
index fce719f..6616bc6 100644
--- a/linden/indra/newview/llviewerimagelist.cpp
+++ b/linden/indra/newview/llviewerimagelist.cpp
@@ -51,7 +51,6 @@
 #include "llagent.h"
 #include "lltexturecache.h"
 #include "lltexturefetch.h"
-#include "lltexturetable.h" // For looking up names from uuid's.
 #include "llviewercontrol.h"
 #include "llviewerimage.h"
 #include "llviewerregion.h"
diff --git a/linden/indra/newview/llviewerjointattachment.h b/linden/indra/newview/llviewerjointattachment.h
index a8c2c71..ce2f8b9 100644
--- a/linden/indra/newview/llviewerjointattachment.h
+++ b/linden/indra/newview/llviewerjointattachment.h
@@ -79,7 +79,7 @@ public:
 
 	S32 getGroup() { return mGroup; }
 	S32 getPieSlice() { return mPieSlice; }
-	BOOL getAttachmentDirty() { return mAttachmentDirty && mAttachedObject.notNull(); }
+	BOOL getAttachmentDirty() { return mAttachmentDirty && mAttachedObject; }
 	LLViewerObject *getObject() { return mAttachedObject; }
 	S32	getNumObjects() { return (mAttachedObject ? 1 : 0); }
 	const LLUUID& getItemID() { return mItemID; }
@@ -99,7 +99,8 @@ protected:
 	
 protected:
 	LLJoint*		mJoint;
-	LLPointer<LLViewerObject>	mAttachedObject;
+	// Backlink only; don't make this an LLPointer.
+	LLViewerObject*	mAttachedObject;
 	BOOL			mAttachmentDirty;	// does attachment drawable need to be fixed up?
 	BOOL			mVisibleInFirst;
 	LLVector3		mOriginalPos;
diff --git a/linden/indra/newview/llviewerjointmesh.cpp b/linden/indra/newview/llviewerjointmesh.cpp
index c76990c..642fa7b 100644
--- a/linden/indra/newview/llviewerjointmesh.cpp
+++ b/linden/indra/newview/llviewerjointmesh.cpp
@@ -31,14 +31,11 @@
 //-----------------------------------------------------------------------------
 #include "llviewerprecompiledheaders.h"
 
-#if LL_WINDOWS // For Intel vector classes
-	#include "fvec.h"
-#endif
-
 #include "imageids.h"
 #include "llfasttimer.h"
 
 #include "llagent.h"
+#include "llapr.h"
 #include "llbox.h"
 #include "lldrawable.h"
 #include "lldrawpoolavatar.h"
@@ -49,12 +46,18 @@
 #include "llglheaders.h"
 #include "lltexlayer.h"
 #include "llviewercamera.h"
+#include "llviewercontrol.h"
 #include "llviewerimagelist.h"
 #include "llviewerjointmesh.h"
 #include "llvoavatar.h"
 #include "llsky.h"
 #include "pipeline.h"
 #include "llglslshader.h"
+#include "llmath.h"
+#include "v4math.h"
+#include "m3math.h"
+#include "m4math.h"
+
 
 #if !LL_DARWIN && !LL_LINUX
 extern PFNGLWEIGHTPOINTERARBPROC glWeightPointerARB;
@@ -68,6 +71,7 @@ static const U32 sRenderMask = LLVertexBuffer::MAP_VERTEX |
 							   LLVertexBuffer::MAP_NORMAL |
 							   LLVertexBuffer::MAP_TEXCOORD;
 
+
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 // LLViewerJointMesh::LLSkinJoint
@@ -120,6 +124,7 @@ BOOL LLSkinJoint::setupSkinJoint( LLViewerJoint *joint)
 	return TRUE;
 }
 
+
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 // LLViewerJointMesh
@@ -414,9 +419,9 @@ const S32 NUM_AXES = 3;
 // rotation Z 0-n
 // pivot parent 0-n -- child = n+1
 
-static LLMatrix4 gJointMat[32];
-static LLMatrix3 gJointRot[32];
-static LLVector4 gJointPivot[32];
+static LLMatrix4	gJointMatUnaligned[32];
+static LLMatrix3	gJointRotUnaligned[32];
+static LLVector4	gJointPivot[32];
 
 //-----------------------------------------------------------------------------
 // uploadJointMatrices()
@@ -437,8 +442,8 @@ void LLViewerJointMesh::uploadJointMatrices()
 		{
 			joint_mat *= LLDrawPoolAvatar::getModelView();
 		}
-		gJointMat[joint_num] = joint_mat;
-		gJointRot[joint_num] = joint_mat.getMat3();
+		gJointMatUnaligned[joint_num] = joint_mat;
+		gJointRotUnaligned[joint_num] = joint_mat.getMat3();
 	}
 
 	BOOL last_pivot_uploaded = FALSE;
@@ -475,8 +480,8 @@ void LLViewerJointMesh::uploadJointMatrices()
 	{
 		LLVector3 pivot;
 		pivot = LLVector3(gJointPivot[i]);
-		pivot = pivot * gJointRot[i];
-		gJointMat[i].translate(pivot);
+		pivot = pivot * gJointRotUnaligned[i];
+		gJointMatUnaligned[i].translate(pivot);
 	}
 
 	// upload matrices
@@ -487,11 +492,11 @@ void LLViewerJointMesh::uploadJointMatrices()
 
 		for (joint_num = 0; joint_num < reference_mesh->mJointRenderData.count(); joint_num++)
 		{
-			gJointMat[joint_num].transpose();
+			gJointMatUnaligned[joint_num].transpose();
 
 			for (S32 axis = 0; axis < NUM_AXES; axis++)
 			{
-				F32* vector = gJointMat[joint_num].mMatrix[axis];
+				F32* vector = gJointMatUnaligned[joint_num].mMatrix[axis];
 				//glProgramLocalParameter4fvARB(GL_VERTEX_PROGRAM_ARB, LL_CHARACTER_MAX_JOINTS_PER_MESH * axis + joint_num+5, (GLfloat*)vector);
 				U32 offset = LL_CHARACTER_MAX_JOINTS_PER_MESH*axis+joint_num;
 				memcpy(mat+offset*4, vector, sizeof(GLfloat)*4);
@@ -903,21 +908,9 @@ BOOL LLViewerJointMesh::updateLOD(F32 pixel_area, BOOL activate)
 	return (valid != activate);
 }
 
-
-void LLViewerJointMesh::updateGeometry()
+// static
+void LLViewerJointMesh::updateGeometryOriginal(LLFace *mFace, LLPolyMesh *mMesh)
 {
-	if (!(mValid
-		  && mMesh
-		  && mFace
-		  && mMesh->hasWeights()
-		  && mFace->mVertexBuffer.notNull()
-		  && LLShaderMgr::getVertexShaderLevel(LLShaderMgr::SHADER_AVATAR) == 0))
-	{
-		return;
-	}
-	
-	uploadJointMatrices();
-
 	LLStrider<LLVector3> o_vertices;
 	LLStrider<LLVector3> o_normals;
 
@@ -958,9 +951,9 @@ void LLViewerJointMesh::updateGeometry()
 		// No lerp required in this case.
 		if (w == 1.0f)
 		{
-			gBlendMat = gJointMat[joint+1];
+			gBlendMat = gJointMatUnaligned[joint+1];
 			o_vertices[bidx] = coords[index] * gBlendMat;
-			gBlendRotMat = gJointRot[joint+1];
+			gBlendRotMat = gJointRotUnaligned[joint+1];
 			o_normals[bidx] = normals[index] * gBlendRotMat;
 			continue;
 		}
@@ -968,8 +961,8 @@ void LLViewerJointMesh::updateGeometry()
 		// Try to keep all the accesses to the matrix data as close
 		// together as possible.  This function is a hot spot on the
 		// Mac. JC
-		LLMatrix4 &m0 = gJointMat[joint+1];
-		LLMatrix4 &m1 = gJointMat[joint+0];
+		LLMatrix4 &m0 = gJointMatUnaligned[joint+1];
+		LLMatrix4 &m1 = gJointMatUnaligned[joint+0];
 		
 		gBlendMat.mMatrix[VX][VX] = lerp(m1.mMatrix[VX][VX], m0.mMatrix[VX][VX], w);
 		gBlendMat.mMatrix[VX][VY] = lerp(m1.mMatrix[VX][VY], m0.mMatrix[VX][VY], w);
@@ -989,8 +982,8 @@ void LLViewerJointMesh::updateGeometry()
 
 		o_vertices[bidx] = coords[index] * gBlendMat;
 		
-		LLMatrix3 &n0 = gJointRot[joint+1];
-		LLMatrix3 &n1 = gJointRot[joint+0];
+		LLMatrix3 &n0 = gJointRotUnaligned[joint+1];
+		LLMatrix3 &n1 = gJointRotUnaligned[joint+0];
 		
 		gBlendRotMat.mMatrix[VX][VX] = lerp(n1.mMatrix[VX][VX], n0.mMatrix[VX][VX], w);
 		gBlendRotMat.mMatrix[VX][VY] = lerp(n1.mMatrix[VX][VY], n0.mMatrix[VX][VY], w);
@@ -1008,6 +1001,161 @@ void LLViewerJointMesh::updateGeometry()
 	}
 }
 
+const U32 UPDATE_GEOMETRY_CALL_MASK			= 0x1FFF; // 8K samples before overflow
+const U32 UPDATE_GEOMETRY_CALL_OVERFLOW		= ~UPDATE_GEOMETRY_CALL_MASK;
+static bool sUpdateGeometryCallPointer		= false;
+static F64 sUpdateGeometryGlobalTime		= 0.0 ;
+static F64 sUpdateGeometryElapsedTime		= 0.0 ;
+static F64 sUpdateGeometryElapsedTimeOff	= 0.0 ;
+static F64 sUpdateGeometryElapsedTimeOn		= 0.0 ;
+static F64 sUpdateGeometryRunAvgOff[10];
+static F64 sUpdateGeometryRunAvgOn[10];
+static U32 sUpdateGeometryRunCount			= 0 ;
+static U32 sUpdateGeometryCalls				= 0 ;
+static U32 sUpdateGeometryLastProcessor		= 0 ;
+void (*LLViewerJointMesh::sUpdateGeometryFunc)(LLFace* face, LLPolyMesh* mesh);
+
+void LLViewerJointMesh::updateGeometry()
+{
+	extern BOOL gVectorizePerfTest;
+	extern U32	gVectorizeProcessor;
+
+	if (!(mValid
+		  && mMesh
+		  && mFace
+		  && mMesh->hasWeights()
+		  && mFace->mVertexBuffer.notNull()
+		  && LLShaderMgr::getVertexShaderLevel(LLShaderMgr::SHADER_AVATAR) == 0))
+	{
+		return;
+	}
+
+	if (!gVectorizePerfTest)
+	{
+		// Once we've measured performance, just run the specified
+		// code version.
+		if(sUpdateGeometryFunc == updateGeometryOriginal)
+			uploadJointMatrices();
+		sUpdateGeometryFunc(mFace, mMesh);
+	}
+	else
+	{
+		// At startup, measure the amount of time in skinning and choose
+		// the fastest one.
+		LLTimer ug_timer ;
+		
+		if (sUpdateGeometryCallPointer)
+		{
+			if(sUpdateGeometryFunc == updateGeometryOriginal)
+				uploadJointMatrices();
+			// call accelerated version for this processor
+			sUpdateGeometryFunc(mFace, mMesh);
+		}
+		else
+		{
+			uploadJointMatrices();
+			updateGeometryOriginal(mFace, mMesh);
+		}
+	
+		sUpdateGeometryElapsedTime += ug_timer.getElapsedTimeF64();
+		++sUpdateGeometryCalls;
+		if(0 != (sUpdateGeometryCalls & UPDATE_GEOMETRY_CALL_OVERFLOW))
+		{
+			F64 time_since_app_start = ug_timer.getElapsedSeconds();
+			if(sUpdateGeometryGlobalTime == 0.0 
+				|| sUpdateGeometryLastProcessor != gVectorizeProcessor)
+			{
+				sUpdateGeometryGlobalTime		= time_since_app_start;
+				sUpdateGeometryElapsedTime		= 0;
+				sUpdateGeometryCalls			= 0;
+				sUpdateGeometryRunCount			= 0;
+				sUpdateGeometryLastProcessor	= gVectorizeProcessor;
+				sUpdateGeometryCallPointer		= false;
+				return;
+			}
+			F64 percent_time_in_function = 
+				( sUpdateGeometryElapsedTime * 100.0 ) / ( time_since_app_start - sUpdateGeometryGlobalTime ) ;
+			sUpdateGeometryGlobalTime = time_since_app_start;
+			if (!sUpdateGeometryCallPointer)
+			{
+				// First set of run data is with vectorization off.
+				sUpdateGeometryCallPointer = true;
+				llinfos << "profile (avg of " << sUpdateGeometryCalls << " samples) = "
+					<< "vectorize off " << percent_time_in_function
+					<< "% of time with "
+					<< (sUpdateGeometryElapsedTime / (F64)sUpdateGeometryCalls)
+					<< " seconds per call "
+					<< llendl;
+				sUpdateGeometryRunAvgOff[sUpdateGeometryRunCount] = percent_time_in_function;
+				sUpdateGeometryElapsedTimeOff += sUpdateGeometryElapsedTime;
+				sUpdateGeometryCalls = 0;
+			}
+			else
+			{
+				// Second set of run data is with vectorization on.
+				sUpdateGeometryCallPointer = false;
+				llinfos << "profile (avg of " << sUpdateGeometryCalls << " samples) = "
+					<< "VEC on " << percent_time_in_function
+					<< "% of time with "
+					<< (sUpdateGeometryElapsedTime / (F64)sUpdateGeometryCalls)
+					<< " seconds per call "
+					<< llendl;
+				sUpdateGeometryRunAvgOn[sUpdateGeometryRunCount] = percent_time_in_function ;
+				sUpdateGeometryElapsedTimeOn += sUpdateGeometryElapsedTime;
+
+				sUpdateGeometryCalls = 0;
+				sUpdateGeometryRunCount++;
+				F64 a = 0.0, b = 0.0;
+				for(U32 i = 0; i<sUpdateGeometryRunCount; i++)
+				{
+					a += sUpdateGeometryRunAvgOff[i];
+					b += sUpdateGeometryRunAvgOn[i];
+				}
+				a /= sUpdateGeometryRunCount;
+				b /= sUpdateGeometryRunCount;
+				F64 perf_boost = ( sUpdateGeometryElapsedTimeOff - sUpdateGeometryElapsedTimeOn ) / sUpdateGeometryElapsedTimeOn;
+				llinfos << "run averages (" << (F64)sUpdateGeometryRunCount
+					<< "/10) vectorize off " << a
+					<< "% : vectorize type " << gVectorizeProcessor
+					<< " " << b
+					<< "% : performance boost " 
+					<< perf_boost * 100.0
+					<< "%"
+					<< llendl ;
+				if(sUpdateGeometryRunCount == 10)
+				{
+					// In case user runs test again, force reset of data on
+					// next run.
+					sUpdateGeometryGlobalTime = 0.0;
+
+					// We have data now on which version is faster.  Switch to that
+					// code and save the data for next run.
+					gVectorizePerfTest = FALSE;
+					gSavedSettings.setBOOL("VectorizePerfTest", FALSE);
+
+					if (perf_boost > 0.0)
+					{
+						llinfos << "Vectorization improves avatar skinning performance, "
+							<< "keeping on for future runs."
+							<< llendl;
+						gSavedSettings.setBOOL("VectorizeSkin", TRUE);
+					}
+					else
+					{
+						// SIMD decreases performance, fall back to original code
+						llinfos << "Vectorization decreases avatar skinning performance, "
+							<< "switching back to original code."
+							<< llendl;
+
+						gSavedSettings.setBOOL("VectorizeSkin", FALSE);
+					}
+				}
+			}
+			sUpdateGeometryElapsedTime = 0.0f;
+		}
+	}
+}
+
 void LLViewerJointMesh::dump()
 {
 	if (mValid)
diff --git a/linden/indra/newview/llviewerjointmesh.h b/linden/indra/newview/llviewerjointmesh.h
index f016da6..b40daed 100644
--- a/linden/indra/newview/llviewerjointmesh.h
+++ b/linden/indra/newview/llviewerjointmesh.h
@@ -146,6 +146,22 @@ public:
 
 	/*virtual*/ BOOL isAnimatable() { return FALSE; }
 	void writeCAL3D(apr_file_t* fp, S32 material_num, LLCharacter* characterp);
+
+	// Avatar vertex skinning is a significant performance issue on computers
+	// with avatar vertex programs turned off (for example, most Macs).  We
+	// therefore have custom versions that use SIMD instructions.
+	//
+	// These functions require compiler options for SSE2, SSE, or neither, and
+	// hence are contained in separate individual .cpp files.  JC
+	static void updateGeometryOriginal(LLFace* face, LLPolyMesh* mesh);
+	// generic vector code, used for Altivec
+	static void updateGeometryVectorized(LLFace* face, LLPolyMesh* mesh);
+	static void updateGeometrySSE(LLFace* face, LLPolyMesh* mesh);
+	static void updateGeometrySSE2(LLFace* face, LLPolyMesh* mesh);
+
+	// Use a fuction pointer to indicate which version we are running.
+	static void (*sUpdateGeometryFunc)(LLFace* face, LLPolyMesh* mesh);
+
 private:
 	// Allocate skin data
 	BOOL allocateSkinData( U32 numSkinJoints );
diff --git a/linden/indra/newview/llviewerjointmesh_sse.cpp b/linden/indra/newview/llviewerjointmesh_sse.cpp
new file mode 100644
index 0000000..4e30ce1
--- /dev/null
+++ b/linden/indra/newview/llviewerjointmesh_sse.cpp
@@ -0,0 +1,114 @@
+/** 
+ * @file llviewerjointmesh.cpp
+ * @brief LLV4 class implementation with LLViewerJointMesh class
+ *
+ * Copyright (c) 2007-2007, Linden Research, Inc.
+ * 
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab.  Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlife.com/developers/opensource/gplv2
+ * 
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at http://secondlife.com/developers/opensource/flossexception
+ * 
+ * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
+ * 
+ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+ * COMPLETENESS OR PERFORMANCE.
+ */
+
+//-----------------------------------------------------------------------------
+// Header Files
+//-----------------------------------------------------------------------------
+
+// Do not use precompiled headers, because we need to build this file with
+// SSE support, but not the precompiled header file. JC
+#include "linden_common.h"
+
+#include "llviewerjointmesh.h"
+
+// project includes
+#include "llface.h"
+#include "llpolymesh.h"
+
+// library includes
+#include "lldarray.h"
+#include "llv4math.h"		// for LL_VECTORIZE
+#include "llv4matrix3.h"
+#include "llv4matrix4.h"
+#include "v3math.h"
+
+// *NOTE: SSE must be enabled for this module
+
+#if LL_VECTORIZE
+
+static LLV4Matrix4	sJointMat[32];
+
+inline void matrix_translate(LLV4Matrix4& m, const LLMatrix4* w, const LLVector3& j)
+{
+	m.mV[VX] = _mm_loadu_ps(w->mMatrix[VX]);
+	m.mV[VY] = _mm_loadu_ps(w->mMatrix[VY]);
+	m.mV[VZ] = _mm_loadu_ps(w->mMatrix[VZ]);
+	m.mV[VW] = _mm_loadu_ps(w->mMatrix[VW]);
+	m.mV[VW] = _mm_add_ps(m.mV[VW], _mm_mul_ps(_mm_set1_ps(j.mV[VX]), m.mV[VX])); // ( ax * vx ) + vw
+	m.mV[VW] = _mm_add_ps(m.mV[VW], _mm_mul_ps(_mm_set1_ps(j.mV[VY]), m.mV[VY]));
+	m.mV[VW] = _mm_add_ps(m.mV[VW], _mm_mul_ps(_mm_set1_ps(j.mV[VZ]), m.mV[VZ]));
+}
+
+// static
+void LLViewerJointMesh::updateGeometrySSE(LLFace *face, LLPolyMesh *mesh)
+{
+	LLDynamicArray<LLJointRenderData*>& joint_data = mesh->getReferenceMesh()->mJointRenderData;
+
+	//upload joint pivots/matrices
+	for(S32 j = 0, jend = joint_data.count(); j < jend ; ++j )
+	{
+		matrix_translate(sJointMat[j], joint_data[j]->mWorldMatrix,
+			joint_data[j]->mSkinJoint ?
+				joint_data[j]->mSkinJoint->mRootToJointSkinOffset
+				: joint_data[j+1]->mSkinJoint->mRootToParentJointSkinOffset);
+	}
+
+	F32					weight		= F32_MAX;
+	LLV4Matrix4			blend_mat;
+
+	LLStrider<LLVector3> o_vertices;
+	LLStrider<LLVector3> o_normals;
+
+	LLVertexBuffer *buffer = face->mVertexBuffer;
+	buffer->getVertexStrider(o_vertices,  mesh->mFaceVertexOffset);
+	buffer->getNormalStrider(o_normals,   mesh->mFaceVertexOffset);
+
+	const F32*			weights			= mesh->getWeights();
+	const LLVector3*	coords			= mesh->getCoords();
+	const LLVector3*	normals			= mesh->getNormals();
+	for (U32 index = 0, index_end = mesh->getNumVertices(); index < index_end; ++index)
+	{
+		if( weight != weights[index])
+		{
+			S32 joint = llfloor(weight = weights[index]);
+			blend_mat.lerp(sJointMat[joint], sJointMat[joint+1], weight - joint);
+		}
+		blend_mat.multiply(coords[index], o_vertices[index]);
+		((LLV4Matrix3)blend_mat).multiply(normals[index], o_normals[index]);
+	}
+}
+
+#else
+
+void LLViewerJointMesh::updateGeometrySSE(LLFace *face, LLPolyMesh *mesh)
+{
+	LLViewerJointMesh::updateGeometryVectorized(face, mesh);
+	return;
+}
+
+#endif
diff --git a/linden/indra/newview/llviewerjointmesh_sse2.cpp b/linden/indra/newview/llviewerjointmesh_sse2.cpp
new file mode 100644
index 0000000..1c205ae
--- /dev/null
+++ b/linden/indra/newview/llviewerjointmesh_sse2.cpp
@@ -0,0 +1,116 @@
+/** 
+ * @file llviewerjointmesh.cpp
+ * @brief LLV4 class implementation with LLViewerJointMesh class
+ *
+ * Copyright (c) 2007-2007, Linden Research, Inc.
+ * 
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab.  Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlife.com/developers/opensource/gplv2
+ * 
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at http://secondlife.com/developers/opensource/flossexception
+ * 
+ * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
+ * 
+ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+ * COMPLETENESS OR PERFORMANCE.
+ */
+
+//-----------------------------------------------------------------------------
+// Header Files
+//-----------------------------------------------------------------------------
+
+// Do not use precompiled headers, because we need to build this file with
+// SSE support, but not the precompiled header file. JC
+#include "linden_common.h"
+
+#include "llviewerjointmesh.h"
+
+// project includes
+#include "llface.h"
+#include "llpolymesh.h"
+
+// library includes
+#include "lldarray.h"
+#include "llstrider.h"
+#include "llv4math.h"		// for LL_VECTORIZE
+#include "llv4matrix3.h"
+#include "llv4matrix4.h"
+#include "m4math.h"
+#include "v3math.h"
+
+// *NOTE: SSE2 must be enabled for this module
+
+#if LL_VECTORIZE
+
+static LLV4Matrix4	sJointMat[32];
+
+inline void matrix_translate(LLV4Matrix4& m, const LLMatrix4* w, const LLVector3& j)
+{
+	m.mV[VX] = _mm_loadu_ps(w->mMatrix[VX]);
+	m.mV[VY] = _mm_loadu_ps(w->mMatrix[VY]);
+	m.mV[VZ] = _mm_loadu_ps(w->mMatrix[VZ]);
+	m.mV[VW] = _mm_loadu_ps(w->mMatrix[VW]);
+	m.mV[VW] = _mm_add_ps(m.mV[VW], _mm_mul_ps(_mm_set1_ps(j.mV[VX]), m.mV[VX])); // ( ax * vx ) + vw
+	m.mV[VW] = _mm_add_ps(m.mV[VW], _mm_mul_ps(_mm_set1_ps(j.mV[VY]), m.mV[VY]));
+	m.mV[VW] = _mm_add_ps(m.mV[VW], _mm_mul_ps(_mm_set1_ps(j.mV[VZ]), m.mV[VZ]));
+}
+
+// static
+void LLViewerJointMesh::updateGeometrySSE2(LLFace *face, LLPolyMesh *mesh)
+{
+	LLDynamicArray<LLJointRenderData*>& joint_data = mesh->getReferenceMesh()->mJointRenderData;
+
+	//upload joint pivots/matrices
+	for(S32 j = 0, jend = joint_data.count(); j < jend ; ++j )
+	{
+		matrix_translate(sJointMat[j], joint_data[j]->mWorldMatrix,
+			joint_data[j]->mSkinJoint ?
+				joint_data[j]->mSkinJoint->mRootToJointSkinOffset
+				: joint_data[j+1]->mSkinJoint->mRootToParentJointSkinOffset);
+	}
+
+	F32					weight		= F32_MAX;
+	LLV4Matrix4			blend_mat;
+
+	LLStrider<LLVector3> o_vertices;
+	LLStrider<LLVector3> o_normals;
+
+	LLVertexBuffer *buffer = face->mVertexBuffer;
+	buffer->getVertexStrider(o_vertices,  mesh->mFaceVertexOffset);
+	buffer->getNormalStrider(o_normals,   mesh->mFaceVertexOffset);
+
+	const F32*			weights			= mesh->getWeights();
+	const LLVector3*	coords			= mesh->getCoords();
+	const LLVector3*	normals			= mesh->getNormals();
+	for (U32 index = 0, index_end = mesh->getNumVertices(); index < index_end; ++index)
+	{
+		if( weight != weights[index])
+		{
+			S32 joint = llfloor(weight = weights[index]);
+			blend_mat.lerp(sJointMat[joint], sJointMat[joint+1], weight - joint);
+		}
+		blend_mat.multiply(coords[index], o_vertices[index]);
+		((LLV4Matrix3)blend_mat).multiply(normals[index], o_normals[index]);
+	}
+}
+
+#else
+
+void LLViewerJointMesh::updateGeometrySSE2(LLFace *face, LLPolyMesh *mesh)
+{
+	LLViewerJointMesh::updateGeometryVectorized(face, mesh);
+	return;
+}
+
+#endif
diff --git a/linden/indra/newview/llviewerjointmesh_vec.cpp b/linden/indra/newview/llviewerjointmesh_vec.cpp
new file mode 100644
index 0000000..4d52361
--- /dev/null
+++ b/linden/indra/newview/llviewerjointmesh_vec.cpp
@@ -0,0 +1,97 @@
+/** 
+ * @file llviewerjointmesh.cpp
+ * @brief LLV4 math class implementation with LLViewerJointMesh class
+ *
+ * Copyright (c) 2001-2007, Linden Research, Inc.
+ * 
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab.  Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlife.com/developers/opensource/gplv2
+ * 
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at http://secondlife.com/developers/opensource/flossexception
+ * 
+ * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
+ * 
+ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+ * COMPLETENESS OR PERFORMANCE.
+ */
+
+//-----------------------------------------------------------------------------
+// Header Files
+//-----------------------------------------------------------------------------
+#include "llviewerprecompiledheaders.h"
+
+#include "llviewerjointmesh.h"
+
+#include "llface.h"
+#include "llpolymesh.h"
+#include "llv4math.h"
+#include "llv4matrix3.h"
+#include "llv4matrix4.h"
+
+// *NOTE: This is the fallback code for vectorized joint mesh skinning.
+// For builds that must support non-SSE x86 code (Windows, perhaps Linux)
+// SSE code generation should be disabled for this file.
+//
+// For builds that run on processors that always have SSE (Mac),
+// SSE code generation can be enabled.  JC
+
+static LLV4Matrix4	sJointMat[32];
+
+// static
+void LLViewerJointMesh::updateGeometryVectorized(LLFace *face, LLPolyMesh *mesh)
+{
+	LLDynamicArray<LLJointRenderData*>& joint_data = mesh->getReferenceMesh()->mJointRenderData;
+	S32 j, joint_num, joint_end = joint_data.count();
+	LLV4Vector3 pivot;
+
+	//upload joint pivots/matrices
+	for(j = joint_num = 0; joint_num < joint_end ; ++joint_num )
+	{
+		LLSkinJoint *sj;
+		const LLMatrix4 *	wm = joint_data[joint_num]->mWorldMatrix;
+		if (NULL == (sj = joint_data[joint_num]->mSkinJoint))
+		{
+				sj = joint_data[++joint_num]->mSkinJoint;
+				((LLV4Matrix3)(sJointMat[j] = *wm)).multiply(sj->mRootToParentJointSkinOffset, pivot);
+				sJointMat[j++].translate(pivot);
+				wm = joint_data[joint_num]->mWorldMatrix;
+		}
+		((LLV4Matrix3)(sJointMat[j] = *wm)).multiply(sj->mRootToJointSkinOffset, pivot);
+		sJointMat[j++].translate(pivot);
+	}
+
+	F32					weight		= F32_MAX;
+	LLV4Matrix4			blend_mat;
+
+	LLStrider<LLVector3> o_vertices;
+	LLStrider<LLVector3> o_normals;
+
+	LLVertexBuffer *buffer = face->mVertexBuffer;
+	buffer->getVertexStrider(o_vertices,  mesh->mFaceVertexOffset);
+	buffer->getNormalStrider(o_normals,   mesh->mFaceVertexOffset);
+
+	const F32*			weights			= mesh->getWeights();
+	const LLVector3*	coords			= mesh->getCoords();
+	const LLVector3*	normals			= mesh->getNormals();
+	for (U32 index = 0, index_end = mesh->getNumVertices(); index < index_end; ++index)
+	{
+		if( weight != weights[index])
+		{
+			S32 joint = llfloor(weight = weights[index]);
+			blend_mat.lerp(sJointMat[joint], sJointMat[joint+1], weight - joint);
+		}
+		blend_mat.multiply(coords[index], o_vertices[index]);
+		((LLV4Matrix3)blend_mat).multiply(normals[index], o_normals[index]);
+	}
+}
diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp
index b36b9a2..a142aff 100644
--- a/linden/indra/newview/llviewermenu.cpp
+++ b/linden/indra/newview/llviewermenu.cpp
@@ -980,6 +980,7 @@ extern BOOL gDebugClicks;
 extern BOOL gDebugWindowProc;
 extern BOOL gDebugTextEditorTips;
 extern BOOL gDebugSelectMgr;
+extern BOOL gVectorizePerfTest;
 
 void init_debug_ui_menu(LLMenuGL* menu)
 {
@@ -1189,6 +1190,8 @@ void init_debug_rendering_menu(LLMenuGL* menu)
 										   (void*)"ShowDepthBuffer"));
 	sub_menu->append(new LLMenuItemToggleGL("Show Select Buffer", &gDebugSelect));
 
+	sub_menu->append(new LLMenuItemToggleGL("Vectorize Perf Test", &gVectorizePerfTest));
+
 	sub_menu = new LLMenuGL("Render Tests");
 
 	sub_menu->append(new LLMenuItemCheckGL("Camera Offset", 
diff --git a/linden/indra/newview/llviewermenufile.cpp b/linden/indra/newview/llviewermenufile.cpp
index 19dfebe..09b2baf 100644
--- a/linden/indra/newview/llviewermenufile.cpp
+++ b/linden/indra/newview/llviewermenufile.cpp
@@ -435,7 +435,7 @@ class LLFileQuit : public view_listener_t
 {
 	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
 	{
-		app_request_quit();
+		app_user_quit();
 		return true;
 	}
 };
diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp
index 8f2fc1a..d9e2927 100644
--- a/linden/indra/newview/llviewermessage.cpp
+++ b/linden/indra/newview/llviewermessage.cpp
@@ -2268,6 +2268,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
 				}
 				break;
 			case CHAT_TYPE_DEBUG_MSG:
+			case CHAT_TYPE_OWNER:
 			case CHAT_TYPE_NORMAL:
 				verb = ": ";
 				break;
@@ -2573,7 +2574,7 @@ void process_teleport_finish(LLMessageSystem* msg, void**)
 	msg->getStringFast(_PREHASH_Info, _PREHASH_SeedCapability,
 		STD_STRING_BUF_SIZE, seedCap);
 
-	// update home location if we are teleporting out of prelude
+	// update home location if we are teleporting out of prelude - specific to teleporting to welcome area 
 	if((teleport_flags & TELEPORT_FLAGS_SET_HOME_TO_TARGET)
 	   && (!gAgent.isGodlike()))
 	{
@@ -4277,6 +4278,8 @@ void notify_cautioned_script_question(LLScriptQuestionCBData* cbdata, S32 orig_q
 	// only continue if at least some permissions were requested
 	if (orig_questions)
 	{
+		// check to see if the person we are asking
+
 		// "'[OBJECTNAME]', an object owned by '[OWNERNAME]', 
 		// located in [REGIONNAME] at [REGIONPOS], 
 		// has been <granted|denied> permission to: [PERMISSIONS]."
@@ -4440,6 +4443,9 @@ void process_script_question(LLMessageSystem *msg, void **user_data)
 	msg->getStringFast(_PREHASH_Data, _PREHASH_ObjectOwner, DB_FULL_NAME_BUF_SIZE, owner_name);
 	msg->getS32Fast(_PREHASH_Data, _PREHASH_Questions, questions );
 
+	// don't display permission requests if this object is muted - JS.
+	if (gMuteListp->isMuted(taskid)) return;
+
 	LLString script_question;
 	if (questions)
 	{
diff --git a/linden/indra/newview/llviewerwindow.cpp b/linden/indra/newview/llviewerwindow.cpp
index 116df89..d2190cc 100644
--- a/linden/indra/newview/llviewerwindow.cpp
+++ b/linden/indra/newview/llviewerwindow.cpp
@@ -1154,7 +1154,7 @@ BOOL LLViewerWindow::handleCloseRequest(LLWindow *window)
 {
 	// User has indicated they want to close, but we may need to ask
 	// about modified documents.
-	app_request_quit();
+	app_user_quit();
 	// Don't quit immediately
 	return FALSE;
 }
diff --git a/linden/indra/newview/llvosky.h b/linden/indra/newview/llvosky.h
index 81c9bf5..12980c9 100644
--- a/linden/indra/newview/llvosky.h
+++ b/linden/indra/newview/llvosky.h
@@ -277,7 +277,7 @@ public:
 	void setHorizonVisibility(const F32 c = 1)			{ mHorizonVisibility = c; }
 	const F32& getVisibility() const					{ return mVisibility; }
 	void setVisibility(const F32 c = 1)					{ mVisibility = c; }
-	const F32 getHaloBrighness() const
+	F32 getHaloBrighness() const
 	{
 		return llmax(0.f, llmin(0.9f, mHorizonVisibility)) * mVisibility;
 	}
diff --git a/linden/indra/newview/llvowater.h b/linden/indra/newview/llvowater.h
index 0bb0c46..53a0a02 100644
--- a/linden/indra/newview/llvowater.h
+++ b/linden/indra/newview/llvowater.h
@@ -32,9 +32,6 @@
 #include "llviewerobject.h"
 #include "llviewerimage.h"
 #include "v2math.h"
-#include "llfft.h"
-
-#include "llwaterpatch.h"
 
 const U32 N_RES	= 16; //32			// number of subdivisions of wave tile
 const U8  WAVE_STEP		= 8;
diff --git a/linden/indra/newview/llwaterpatch.cpp b/linden/indra/newview/llwaterpatch.cpp
deleted file mode 100644
index f6a8640..0000000
--- a/linden/indra/newview/llwaterpatch.cpp
+++ /dev/null
@@ -1,132 +0,0 @@
-/** 
- * @file llwaterpatch.cpp
- * @brief LLWaterTri class implementation
- *
- * Copyright (c) 2001-2007, Linden Research, Inc.
- * 
- * Second Life Viewer Source Code
- * The source code in this file ("Source Code") is provided by Linden Lab
- * to you under the terms of the GNU General Public License, version 2.0
- * ("GPL"), unless you have obtained a separate licensing agreement
- * ("Other License"), formally executed by you and Linden Lab.  Terms of
- * the GPL can be found in doc/GPL-license.txt in this distribution, or
- * online at http://secondlife.com/developers/opensource/gplv2
- * 
- * There are special exceptions to the terms and conditions of the GPL as
- * it is applied to this Source Code. View the full text of the exception
- * in the file doc/FLOSS-exception.txt in this software distribution, or
- * online at http://secondlife.com/developers/opensource/flossexception
- * 
- * By copying, modifying or distributing this software, you acknowledge
- * that you have read and understood your obligations described above,
- * and agree to abide by those obligations.
- * 
- * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
- * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
- * COMPLETENESS OR PERFORMANCE.
- */
-
-#include "llviewerprecompiledheaders.h"
-
-#include "llwaterpatch.h"
-
-#include "llvowater.h"
-
-U32 LLWaterTri::sMinStep;
-LL2Coord LLWaterTri::sCam;
-F32 LLWaterTri::sClipFar;
-U32 LLWaterTri::sMaxDivLevel;
-BOOL LLWaterTri::sCurrRound = FALSE;
-
-
-LLWaterTri::LLWaterTri (U8 level, S8 type, LLWaterTri* par): LLRoamTriNode(level, type, par), mRefine(FALSE)
-{
-	if (!parent() || type == 0)
-	{
-		mSize = mLvtx.distance(mRvtx) * sMinStep;
-		mCurr = sCurrRound;
-		setNotUpToDate();
-		return;
-	}
-	
-	mSize = par->size() * OO_SQRT2;
-	setPatch(par->patch());
-	//		LL2Coord c1 = par->Lvtx();
-	//		LL2Coord c2 = par->Rvtx();
-	
-	//		if (c1.x() - c2.x() == 1 || c1.y() - c2.y() == 1)
-	//			bool stophere = true;
-	
-	if (type < 0)	// left child
-	{
-		mLvtx = par->Tvtx();
-		mRvtx = par->Lvtx();
-		//mTvtx = middle(c1, c2);
-	} else {
-		mRvtx = par->Tvtx();
-		mLvtx = par->Rvtx();
-		//mTvtx = middle(c1, c2);
-	}
-	mTvtx = par->middleSide();
-	mMiddle = mLvtx.middle(mRvtx);
-	if (((LLWaterPatch*)patch())->visible())
-		setNotUpToDate();
-	else
-		setUpToDate();
-}
-
-
-void LLWaterTri::updatePassive()
-{
-	setUpToDate();
-	if (!leaf())
-	{
-		mLchild->updatePassive();
-		mRchild->updatePassive();
-	}
-}
-
-
-BOOL LLWaterTri::refine()
-{
-	if (upToDate())
-		return mRefine;
-
-	if (!patch()->refine(this))
-	{
-		setUpToDate();
-		mRefine = FALSE;
-		return mRefine;
-	}
-
-	const static F32 a = 0.6f;
-	const static F32 K = sMinStep / 50.f;//0.08f;
-	const static F32 eps = K;//0.01f;
-	
-	const F32 tri_dist = llmin(sCam.distance(middleSide()) * sMinStep, sClipFar);
-	const F32 func = K * (1 - (1 - eps) * exp(a * (tri_dist - sClipFar)));
-	
-	
-	//const F32 tri_size = distance(mLvtx, mRvtx) * sMinStep;// * min_step2;
-	const F32 ratio = mSize / (tri_dist + 1);
-	
-	if (tri_dist > 0.8 * sClipFar)
-		mRefine =  ratio > func;
-	else
-		mRefine = (ratio > func) && (mLevel < sMaxDivLevel);
-
-	if (!mRefine && !mLeaf)
-	{
-		if (mLchild->refine())
-			mRefine = TRUE;
-		else if (mRchild->refine())
-			mRefine = TRUE;
-	}
-
-	setUpToDate();
-	return mRefine;
-
-	//return mGrid->refine(this);
-	//return FALSE;
-}
-
diff --git a/linden/indra/newview/llwaterpatch.h b/linden/indra/newview/llwaterpatch.h
deleted file mode 100644
index f4eddf6..0000000
--- a/linden/indra/newview/llwaterpatch.h
+++ /dev/null
@@ -1,317 +0,0 @@
-/** 
- * @file llwaterpatch.h
- * @brief LLWaterTri class header file
- *
- * Copyright (c) 2001-2007, Linden Research, Inc.
- * 
- * Second Life Viewer Source Code
- * The source code in this file ("Source Code") is provided by Linden Lab
- * to you under the terms of the GNU General Public License, version 2.0
- * ("GPL"), unless you have obtained a separate licensing agreement
- * ("Other License"), formally executed by you and Linden Lab.  Terms of
- * the GPL can be found in doc/GPL-license.txt in this distribution, or
- * online at http://secondlife.com/developers/opensource/gplv2
- * 
- * There are special exceptions to the terms and conditions of the GPL as
- * it is applied to this Source Code. View the full text of the exception
- * in the file doc/FLOSS-exception.txt in this software distribution, or
- * online at http://secondlife.com/developers/opensource/flossexception
- * 
- * By copying, modifying or distributing this software, you acknowledge
- * that you have read and understood your obligations described above,
- * and agree to abide by those obligations.
- * 
- * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
- * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
- * COMPLETENESS OR PERFORMANCE.
- */
-
-#ifndef LL_WATER_PATCH_H
-#define LL_WATER_PATCH_H
-
-#include "llmath.h"
-#include "v3math.h"
-#include "llroam.h"
-
-const U8 MAX_LEVEL = 10;
-
-class LL2Coord
-{
-protected:
-	S32	mX;
-	S32 mY;
-public:
-	LL2Coord() {}
-	//LL2Coord() : mX(0), mY(0) {}
-	LL2Coord (S32 i, S32 j) : mX(i), mY(j) {}
-	LL2Coord operator+ (const LL2Coord& c) const
-	{
-		return LL2Coord(mX + c.mX, mY + c.mY);
-	}
-	LL2Coord operator* (F32 c) const
-	{
-		return LL2Coord(llround(mX * c), llround(mY * c));
-	}
-	S32 x() const { return mX; }
-	S32 y() const { return mY; }
-
-	S32& x() { return mX; }
-	S32& y() { return mY; }
-
-	LL2Coord middle(const LL2Coord& c2) const
-	{
-		return LL2Coord((x() + c2.x()) >> 1, (y() + c2.y()) >> 1);
-	}
-
-	S32 distance2(const LL2Coord& c2) const
-	{
-		S32 dx = x() - c2.x();
-		S32 dy = y() - c2.y();
-
-		return dx * dx + dy * dy;
-	}
-
-	F32 distance(const LL2Coord& c2) const
-	{
-		return (F32) sqrt((F32)distance2(c2));
-	}
-};
-
-
-
-
-
-
-class LLWaterGrid;
-
-class LLWaterTri : public LLRoamTriNode
-{
-protected:
-	LL2Coord	mLvtx; // Left vertex
-	LL2Coord	mRvtx; // Right vertex
-	LL2Coord	mTvtx; // Top vertex
-	LL2Coord	mMiddle; // Top vertex
-
-	F32			mSize;
-
-	BOOL		mCurr;
-	BOOL		mRefine;
-
-public:
-	static LL2Coord sCam;
-	static F32 sClipFar;
-	static U32 sMaxDivLevel;
-	static U32 sMinStep;
-
-	static BOOL sCurrRound;
-
-
-public:
-	LLWaterTri (const LL2Coord& l, const LL2Coord& r, const LL2Coord& t):
-		LLRoamTriNode(0, 0, 0), mLvtx(l), mRvtx(r), mTvtx(t), mRefine(FALSE)
-	{
-		mSize = mLvtx.distance(mRvtx) * sMinStep;
-		mCurr = sCurrRound;
-		mMiddle = mLvtx.middle(mRvtx);
-	}
-
-	LLWaterTri (U8 level = 0, S8 type = 0, LLWaterTri* par = 0);
-
-	virtual LLRoamTriNode* newLChild()
-	{
-		return new LLWaterTri(mLevel+1, -1, this);
-	}
-	virtual LLRoamTriNode* newRChild()
-	{
-		return new LLWaterTri(mLevel+1, 1, this);
-	}
-
-	virtual ~LLWaterTri() {}
-
-	const LL2Coord& Lvtx() const { return mLvtx; }
-	const LL2Coord& Rvtx() const { return mRvtx; }
-	const LL2Coord& Tvtx() const { return mTvtx; }
-
-	F32 size() const { return mSize; }
-
-	LL2Coord middleSide() const { return mMiddle; }//middle(mLvtx, mRvtx); }
-
-	void setLvtx(const LL2Coord& c) { mLvtx = c; }
-	void setRvtx(const LL2Coord& c) { mRvtx = c; }
-	void setTvtx(const LL2Coord& c) { mTvtx = c; }
-
-	void updatePassive();
-	BOOL refine();
-	void initForcefulRefine()
-	{
-		setUpToDate();
-		mRefine = TRUE;
-	}
-	void flushFromQueue() { setUpToDate(); }
-
-	BOOL upToDate() const { return mCurr == sCurrRound; }
-	void setUpToDate() { mCurr = sCurrRound; }
-	void setNotUpToDate() { mCurr = !sCurrRound; }
-	static void nextRound() { sCurrRound = !sCurrRound; }
-
-	BOOL checkUpToDate() const
-	{
-		BOOL ok = leaf() ? upToDate() :
-			upToDate() && ((LLWaterTri*)Lchild())->upToDate() && ((LLWaterTri*)Rchild())->upToDate();
-		if (!ok)
-			return ok;
-		else
-			return ok;
-	}
-
-};
-
-
-
-
-class LLWaterPatch : public LLRoamPatch
-{
-protected:
-	LL2Coord	mOrig; // Bottom left vertex
-	U32			mSize;
-	U32			mRegionWidth;
-	LLVector3	mCenter;			
-	BOOL		mVis;
-
-public:
-	LLWaterPatch() : 
-		LLRoamPatch(MAX_LEVEL, TRUE), mOrig(0, 0), mSize(32), mRegionWidth(256) {}
-
-	LLWaterPatch(const LL2Coord o, U32 size, U32 width, const LLVector3& center,
-									U8 max_level = MAX_LEVEL, BOOL back_slash = TRUE) : 
-		LLRoamPatch(back_slash, max_level), mOrig(o), mSize(size), mRegionWidth(width), mCenter(center)
-		{ createTris(); }
-
-	LLWaterPatch(S32 o1, S32 o2, U32 size, U32 width, const LLVector3& center,
-									U8 max_level = MAX_LEVEL, BOOL back_slash = TRUE) : 
-		LLRoamPatch(back_slash, max_level), mOrig(o1, o2), mSize(size), mRegionWidth(width), mCenter(center)
-		{ createTris(); }
-
-
-	const LL2Coord& orig() const { return mOrig; }
-	void set (S32 o1, S32 o2, U32 size, U32 width, const LLVector3& center,
-								U8 max_level = MAX_LEVEL, BOOL back_slash = TRUE)
-	{
-		deleteTris();
-		mBackSlash = back_slash;
-		mMaxLevel = max_level;
-		mOrig.x() = o1;
-		mOrig.y() = o2;
-		mSize = size;
-		mCenter = center;
-		mRegionWidth = width;
-		mNumTris = 0;
-		createTris();
-	}
-
-	void setMaxLevel (U8 max_level) { mMaxLevel = max_level; }
-
-	void createTris()
-	{
-		if (mBackSlash)
-		{
-			mTri[0]  = new LLWaterTri(LL2Coord(mOrig.x() + mSize, mOrig.y()),
-									LL2Coord(mOrig.x(), mOrig.y() + mSize), mOrig);
-			mTri[1] = new LLWaterTri(LL2Coord(mOrig.x(), mOrig.y() + mSize),
-									LL2Coord(mOrig.x() + mSize, mOrig.y()),
-									LL2Coord(mOrig.x() + mSize, mOrig.y() + mSize));
-		} else {
-			mTri[0]  = new LLWaterTri(mOrig,
-									LL2Coord(mOrig.x() + mSize, mOrig.y() + mSize),
-									LL2Coord(mOrig.x(), mOrig.y() + mSize));
-			mTri[1] = new LLWaterTri(LL2Coord(mOrig.x() + mSize, mOrig.y() + mSize),
-									mOrig,
-									LL2Coord(mOrig.x() + mSize, mOrig.y()));
-		}
-		setTris();
-		((LLWaterTri*)mTri[0])->setUpToDate();
-		((LLWaterTri*)mTri[1])->setUpToDate();
-	}
-	//virtual ~LLWaterPatch() {}
-	void setInvisible() { mVis = FALSE; }
-	void setVisible() { mVis = TRUE; }
-
-	BOOL visible() const { return mVis; }
-	
-	BOOL updateTree(const LLVector3 &camera_pos, const LLVector3 &look_at, const LLVector3 &reg_orig)
-	{
-		const static F32 patch_rad = mRegionWidth * F_SQRT2 * 0.5f;
-
-		LLVector3 to_patch = reg_orig + mCenter - camera_pos;
-		F32 to_patch_dist = to_patch.normVec();
-
-		if ( to_patch_dist < patch_rad)
-		{
-			setVisible();
-			update();
-		} else {
-			const F32 sin_min_angle = patch_rad / to_patch_dist;
-			const F32 cos_min_angle = (F32)sqrt(1.f - sin_min_angle * sin_min_angle);
-			const F32 cos_max = OO_SQRT2 * (cos_min_angle - sin_min_angle);
-
-			if (to_patch * look_at > cos_max)
-			{
-				setVisible();
-				update();
-			} else {
-				setInvisible();
-				updatePassive();
-			}
-		}
-
-		return mVis;
-	}
-
-	BOOL updateVisibility(const LLVector3 &camera_pos, const LLVector3 &look_at, const LLVector3 &reg_orig)
-	{
-		const static F32 patch_rad = mRegionWidth * F_SQRT2 * 0.5f;
-		const static U32 reg_width_half = mRegionWidth / 2;
-		//const static F32 patch_rad2 = patch_rad * patch_rad;
-
-		LLVector3 to_patch = reg_orig + mCenter - camera_pos;
-		//const F32 to_patch_dist2D2 = to_patch.mV[VX] * to_patch.mV[VX] + to_patch.mV[VY] * to_patch.mV[VY];
-
-		if (fabs(to_patch.mV[VX]) <= reg_width_half && fabs(to_patch.mV[VY]) <= reg_width_half)
-		//if ( to_patch_dist2D2 < patch_rad2)
-		{
-			setVisible();
-		} else {
-			F32 to_patch_dist = to_patch.normVec();
-			//const F32 to_patch_dist = sqrt(to_patch_dist2D2 + to_patch.mV[VZ] * to_patch.mV[VZ]);
-			const F32 sin_min_angle = patch_rad / to_patch_dist;
-			if (sin_min_angle >= 1)
-			{
-				setVisible();
-			} else {
-				const F32 cos_min_angle = (F32)sqrt(1.f - sin_min_angle * sin_min_angle);
-				const F32 cos_max = OO_SQRT2 * (cos_min_angle - sin_min_angle);
-
-				if (to_patch * look_at > cos_max)
-				{
-					setVisible();
-				} else {
-					setInvisible();
-				}
-			}
-		}
-
-		return mVis;
-	}
-	void checkUpToDate() const
-	{
-		for (U8 h = 0; h < 2; h++)
-		{
-			((LLWaterTri*)left())->checkUpToDate();
-			((LLWaterTri*)right())->checkUpToDate();
-		}
-	}
-
-};
-
-
-#endif
diff --git a/linden/indra/newview/macview.xcodeproj/project.pbxproj b/linden/indra/newview/macview.xcodeproj/project.pbxproj
index 02be1d5..059ae5a 100644
--- a/linden/indra/newview/macview.xcodeproj/project.pbxproj
+++ b/linden/indra/newview/macview.xcodeproj/project.pbxproj
@@ -27,6 +27,9 @@
 		1A0201850B7A861200D5C589 /* llblowfishcipher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A02017E0B7A861200D5C589 /* llblowfishcipher.cpp */; };
 		1A0201860B7A861200D5C589 /* llnullcipher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0201810B7A861200D5C589 /* llnullcipher.cpp */; };
 		1A0201870B7A861200D5C589 /* llxorcipher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0201830B7A861200D5C589 /* llxorcipher.cpp */; };
+		1A0DA5130C3AC07800361F49 /* llviewerjointmesh_vec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0DA5100C3AC07700361F49 /* llviewerjointmesh_vec.cpp */; };
+		1A0DA5140C3AC07800361F49 /* llviewerjointmesh_sse2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0DA5110C3AC07700361F49 /* llviewerjointmesh_sse2.cpp */; };
+		1A0DA5150C3AC07800361F49 /* llviewerjointmesh_sse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0DA5120C3AC07700361F49 /* llviewerjointmesh_sse.cpp */; };
 		1A1C61620847AEE6005D7227 /* llvolumemgr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A1C615E0847AEE6005D7227 /* llvolumemgr.cpp */; };
 		1A1C61630847AEE6005D7227 /* llvolume.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A1C615F0847AEE6005D7227 /* llvolume.cpp */; };
 		1A1C61760847B307005D7227 /* llvolumemessage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A1C61740847B307005D7227 /* llvolumemessage.cpp */; };
@@ -95,7 +98,6 @@
 		5503BB3C05446B20003D051F /* llwind.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F529C2051F61DF00A80050 /* llwind.cpp */; };
 		5503BB3D05446B20003D051F /* llwearablelist.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F529C3051F61DF00A80050 /* llwearablelist.cpp */; };
 		5503BB3E05446B20003D051F /* llwearable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F529C4051F61DF00A80050 /* llwearable.cpp */; };
-		5503BB3F05446B20003D051F /* llwaterpatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F529C5051F61DF00A80050 /* llwaterpatch.cpp */; };
 		5503BB4005446B20003D051F /* llvowater.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F529C6051F61DF00A80050 /* llvowater.cpp */; };
 		5503BB4105446B20003D051F /* llvovolume.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F529C7051F61DF00A80050 /* llvovolume.cpp */; };
 		5503BB4305446B20003D051F /* llvotree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F529C9051F61DF00A80050 /* llvotree.cpp */; };
@@ -158,7 +160,6 @@
 		5503BB9105446B20003D051F /* llfloaterland.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A17051F61DF00A80050 /* llfloaterland.cpp */; };
 		5503BB9205446B20003D051F /* llpanelface.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A18051F61DF00A80050 /* llpanelface.cpp */; };
 		5503BB9305446B20003D051F /* llpanelevent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A19051F61DF00A80050 /* llpanelevent.cpp */; };
-		5503BB9405446B20003D051F /* llcountdown.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A1A051F61DF00A80050 /* llcountdown.cpp */; };
 		5503BB9505446B20003D051F /* llcontroldef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A1B051F61DF00A80050 /* llcontroldef.cpp */; };
 		5503BB9805446B20003D051F /* llframestatview.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A1E051F61DF00A80050 /* llframestatview.cpp */; };
 		5503BB9905446B20003D051F /* llframestats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A1F051F61DF00A80050 /* llframestats.cpp */; };
@@ -166,7 +167,6 @@
 		5503BB9E05446B20003D051F /* llhudobject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A24051F61DF00A80050 /* llhudobject.cpp */; };
 		5503BB9F05446B20003D051F /* llhudmanager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A25051F61DF00A80050 /* llhudmanager.cpp */; };
 		5503BBA005446B20003D051F /* lldrawpoolalpha.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A26051F61DF00A80050 /* lldrawpoolalpha.cpp */; };
-		5503BBA105446B20003D051F /* lltexturetable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A27051F61DF00A80050 /* lltexturetable.cpp */; };
 		5503BBA205446B20003D051F /* lltexturectrl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A28051F61DF00A80050 /* lltexturectrl.cpp */; };
 		5503BBA405446B20003D051F /* llpanelobject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A2A051F61DF00A80050 /* llpanelobject.cpp */; };
 		5503BBA505446B20003D051F /* llpanelnetwork.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52A2B051F61DF00A80050 /* llpanelnetwork.cpp */; };
@@ -260,7 +260,6 @@
 		5503BC2105446B20003D051F /* llcolorscheme.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52AA9051F61DF00A80050 /* llcolorscheme.cpp */; };
 		5503BC2205446B20003D051F /* llmutelist.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52AAA051F61DF00A80050 /* llmutelist.cpp */; };
 		5503BC2305446B20003D051F /* llmoveview.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52AAB051F61DF00A80050 /* llmoveview.cpp */; };
-		5503BC2405446B20003D051F /* llfft.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52AAC051F61DF00A80050 /* llfft.cpp */; };
 		5503BC2505446B20003D051F /* llfloatermap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52AAD051F61DF00A80050 /* llfloatermap.cpp */; };
 		5503BC2705446B20003D051F /* llregionposition.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52AAF051F61DF00A80050 /* llregionposition.cpp */; };
 		5503BC2905446B20003D051F /* llasynchostbyname.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F52AB2051F61DF00A80050 /* llasynchostbyname.cpp */; };
@@ -822,6 +821,9 @@
 		1A0201820B7A861200D5C589 /* llnullcipher.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llnullcipher.h; sourceTree = "<group>"; };
 		1A0201830B7A861200D5C589 /* llxorcipher.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llxorcipher.cpp; sourceTree = "<group>"; };
 		1A0201840B7A861200D5C589 /* llxorcipher.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llxorcipher.h; sourceTree = "<group>"; };
+		1A0DA5100C3AC07700361F49 /* llviewerjointmesh_vec.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llviewerjointmesh_vec.cpp; sourceTree = "<group>"; };
+		1A0DA5110C3AC07700361F49 /* llviewerjointmesh_sse2.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llviewerjointmesh_sse2.cpp; sourceTree = "<group>"; };
+		1A0DA5120C3AC07700361F49 /* llviewerjointmesh_sse.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llviewerjointmesh_sse.cpp; sourceTree = "<group>"; };
 		1A1C615E0847AEE6005D7227 /* llvolumemgr.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llvolumemgr.cpp; sourceTree = "<group>"; };
 		1A1C615F0847AEE6005D7227 /* llvolume.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llvolume.cpp; sourceTree = "<group>"; };
 		1A1C61600847AEE6005D7227 /* llvolumemgr.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llvolumemgr.h; sourceTree = "<group>"; };
@@ -925,7 +927,6 @@
 		26F529C2051F61DF00A80050 /* llwind.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llwind.cpp; sourceTree = SOURCE_ROOT; };
 		26F529C3051F61DF00A80050 /* llwearablelist.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llwearablelist.cpp; sourceTree = SOURCE_ROOT; };
 		26F529C4051F61DF00A80050 /* llwearable.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llwearable.cpp; sourceTree = SOURCE_ROOT; };
-		26F529C5051F61DF00A80050 /* llwaterpatch.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llwaterpatch.cpp; sourceTree = SOURCE_ROOT; };
 		26F529C6051F61DF00A80050 /* llvowater.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llvowater.cpp; sourceTree = SOURCE_ROOT; };
 		26F529C7051F61DF00A80050 /* llvovolume.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llvovolume.cpp; sourceTree = SOURCE_ROOT; };
 		26F529C9051F61DF00A80050 /* llvotree.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llvotree.cpp; sourceTree = SOURCE_ROOT; };
@@ -989,7 +990,6 @@
 		26F52A17051F61DF00A80050 /* llfloaterland.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfloaterland.cpp; sourceTree = SOURCE_ROOT; };
 		26F52A18051F61DF00A80050 /* llpanelface.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llpanelface.cpp; sourceTree = SOURCE_ROOT; };
 		26F52A19051F61DF00A80050 /* llpanelevent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llpanelevent.cpp; sourceTree = SOURCE_ROOT; };
-		26F52A1A051F61DF00A80050 /* llcountdown.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llcountdown.cpp; sourceTree = SOURCE_ROOT; };
 		26F52A1B051F61DF00A80050 /* llcontroldef.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llcontroldef.cpp; sourceTree = SOURCE_ROOT; };
 		26F52A1E051F61DF00A80050 /* llframestatview.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llframestatview.cpp; sourceTree = SOURCE_ROOT; };
 		26F52A1F051F61DF00A80050 /* llframestats.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llframestats.cpp; sourceTree = SOURCE_ROOT; };
@@ -997,7 +997,6 @@
 		26F52A24051F61DF00A80050 /* llhudobject.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llhudobject.cpp; sourceTree = SOURCE_ROOT; };
 		26F52A25051F61DF00A80050 /* llhudmanager.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llhudmanager.cpp; sourceTree = SOURCE_ROOT; };
 		26F52A26051F61DF00A80050 /* lldrawpoolalpha.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lldrawpoolalpha.cpp; sourceTree = SOURCE_ROOT; };
-		26F52A27051F61DF00A80050 /* lltexturetable.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lltexturetable.cpp; sourceTree = SOURCE_ROOT; };
 		26F52A28051F61DF00A80050 /* lltexturectrl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lltexturectrl.cpp; sourceTree = SOURCE_ROOT; };
 		26F52A2A051F61DF00A80050 /* llpanelobject.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llpanelobject.cpp; sourceTree = SOURCE_ROOT; };
 		26F52A2B051F61DF00A80050 /* llpanelnetwork.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llpanelnetwork.cpp; sourceTree = SOURCE_ROOT; };
@@ -1093,7 +1092,6 @@
 		26F52AA9051F61DF00A80050 /* llcolorscheme.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llcolorscheme.cpp; sourceTree = SOURCE_ROOT; };
 		26F52AAA051F61DF00A80050 /* llmutelist.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llmutelist.cpp; sourceTree = SOURCE_ROOT; };
 		26F52AAB051F61DF00A80050 /* llmoveview.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llmoveview.cpp; sourceTree = SOURCE_ROOT; };
-		26F52AAC051F61DF00A80050 /* llfft.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfft.cpp; sourceTree = SOURCE_ROOT; };
 		26F52AAD051F61DF00A80050 /* llfloatermap.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llfloatermap.cpp; sourceTree = SOURCE_ROOT; };
 		26F52AAF051F61DF00A80050 /* llregionposition.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llregionposition.cpp; sourceTree = SOURCE_ROOT; };
 		26F52AB2051F61DF00A80050 /* llasynchostbyname.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = llasynchostbyname.cpp; sourceTree = SOURCE_ROOT; };
@@ -1634,7 +1632,6 @@
 		997B4BE206015821001B0407 /* llwind.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llwind.h; sourceTree = SOURCE_ROOT; };
 		997B4BE306015821001B0407 /* llwearablelist.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llwearablelist.h; sourceTree = SOURCE_ROOT; };
 		997B4BE406015821001B0407 /* llwearable.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llwearable.h; sourceTree = SOURCE_ROOT; };
-		997B4BE506015821001B0407 /* llwaterpatch.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llwaterpatch.h; sourceTree = SOURCE_ROOT; };
 		997B4BE606015821001B0407 /* llvowater.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llvowater.h; sourceTree = SOURCE_ROOT; };
 		997B4BE706015821001B0407 /* llvovolume.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llvovolume.h; sourceTree = SOURCE_ROOT; };
 		997B4BE806015821001B0407 /* llvotreenew.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llvotreenew.h; sourceTree = SOURCE_ROOT; };
@@ -1701,7 +1698,6 @@
 		997B4C3206015821001B0407 /* lltoolbar.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lltoolbar.h; sourceTree = SOURCE_ROOT; };
 		997B4C3306015821001B0407 /* lltool.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lltool.h; sourceTree = SOURCE_ROOT; };
 		997B4C3406015821001B0407 /* lltextureview.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lltextureview.h; sourceTree = SOURCE_ROOT; };
-		997B4C3506015821001B0407 /* lltexturetable.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lltexturetable.h; sourceTree = SOURCE_ROOT; };
 		997B4C3606015821001B0407 /* lltexturectrl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lltexturectrl.h; sourceTree = SOURCE_ROOT; };
 		997B4C3B06015821001B0407 /* lltexlayer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lltexlayer.h; sourceTree = SOURCE_ROOT; };
 		997B4C3D06015821001B0407 /* lltable.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lltable.h; sourceTree = SOURCE_ROOT; };
@@ -1826,7 +1822,6 @@
 		997B4CE506015822001B0407 /* llfloaterabout.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfloaterabout.h; sourceTree = SOURCE_ROOT; };
 		997B4CE706015822001B0407 /* llfirstuse.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfirstuse.h; sourceTree = SOURCE_ROOT; };
 		997B4CE906015822001B0407 /* llfilepicker.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfilepicker.h; sourceTree = SOURCE_ROOT; };
-		997B4CEA06015822001B0407 /* llfft.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfft.h; sourceTree = SOURCE_ROOT; };
 		997B4CEB06015822001B0407 /* llfeaturemanager.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llfeaturemanager.h; sourceTree = SOURCE_ROOT; };
 		997B4CEC06015822001B0407 /* llface.inl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = llface.inl; sourceTree = SOURCE_ROOT; };
 		997B4CEE06015822001B0407 /* llcylinder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llcylinder.h; sourceTree = SOURCE_ROOT; };
@@ -1848,7 +1843,6 @@
 		997B4D0006015823001B0407 /* lldrawpool.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lldrawpool.h; sourceTree = SOURCE_ROOT; };
 		997B4D0106015823001B0407 /* lldrawable.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lldrawable.h; sourceTree = SOURCE_ROOT; };
 		997B4D0306015823001B0407 /* lldebugview.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lldebugview.h; sourceTree = SOURCE_ROOT; };
-		997B4D0406015823001B0407 /* llcountdown.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llcountdown.h; sourceTree = SOURCE_ROOT; };
 		997B4D0506015823001B0407 /* llconversation.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llconversation.h; sourceTree = SOURCE_ROOT; };
 		997B4D0606015823001B0407 /* llcontainerview.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llcontainerview.h; sourceTree = SOURCE_ROOT; };
 		997B4D0706015823001B0407 /* llconsole.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = llconsole.h; sourceTree = SOURCE_ROOT; };
@@ -2352,6 +2346,9 @@
 		26F529A0051F61CD00A80050 /* newview */ = {
 			isa = PBXGroup;
 			children = (
+				1A0DA5100C3AC07700361F49 /* llviewerjointmesh_vec.cpp */,
+				1A0DA5110C3AC07700361F49 /* llviewerjointmesh_sse2.cpp */,
+				1A0DA5120C3AC07700361F49 /* llviewerjointmesh_sse.cpp */,
 				26F52A9D051F61DF00A80050 /* head.cpp */,
 				26F52A41051F61DF00A80050 /* llagent.cpp */,
 				1A758C910A436FCA00589675 /* llagentdata.cpp */,
@@ -2379,7 +2376,6 @@
 				26F52A03051F61DF00A80050 /* llconsole.cpp */,
 				26F52A78051F61DF00A80050 /* llcontainerview.cpp */,
 				26F52A1B051F61DF00A80050 /* llcontroldef.cpp */,
-				26F52A1A051F61DF00A80050 /* llcountdown.cpp */,
 				26F52ACB051F61DF00A80050 /* llcubemap.cpp */,
 				99BB5170099AC1FC004BF9F2 /* llcurrencyuimanager.cpp */,
 				99BB5171099AC1FC004BF9F2 /* llcurrencyuimanager.h */,
@@ -2412,7 +2408,6 @@
 				26F52A3A051F61DF00A80050 /* llface.cpp */,
 				912541AD0691FF79008C66F7 /* llfasttimerview.cpp */,
 				263E02FE05239C9A00A80050 /* llfeaturemanager.cpp */,
-				26F52AAC051F61DF00A80050 /* llfft.cpp */,
 				26F52AD3051F61DF00A80050 /* llfilepicker.cpp */,
 				8B2ECFA00534C21A00A80059 /* llfirstuse.cpp */,
 				8B2ECF9E0534C17A00A80059 /* llfirstuse.h */,
@@ -2628,7 +2623,6 @@
 				26F52A28051F61DF00A80050 /* lltexturectrl.cpp */,
 				AA02B9BA0B0CE44D00F2996D /* lltexturefetch.cpp */,
 				AA02B9BB0B0CE44D00F2996D /* lltexturefetch.h */,
-				26F52A27051F61DF00A80050 /* lltexturetable.cpp */,
 				26F529F6051F61DF00A80050 /* lltextureview.cpp */,
 				26F529F5051F61DF00A80050 /* lltool.cpp */,
 				26F529F4051F61DF00A80050 /* lltoolbar.cpp */,
@@ -2724,7 +2718,6 @@
 				26F529C9051F61DF00A80050 /* llvotree.cpp */,
 				26F529C7051F61DF00A80050 /* llvovolume.cpp */,
 				26F529C6051F61DF00A80050 /* llvowater.cpp */,
-				26F529C5051F61DF00A80050 /* llwaterpatch.cpp */,
 				26F529C4051F61DF00A80050 /* llwearable.cpp */,
 				26F529C3051F61DF00A80050 /* llwearablelist.cpp */,
 				1AF7C1E30AF6C44800C4BF4A /* llweb.cpp */,
@@ -3155,48 +3148,38 @@
 		6192225C074A9B5A005E1F34 /* llui */ = {
 			isa = PBXGroup;
 			children = (
-				A29852A10BC6BC630005FA09 /* llhtmlhelp.h */,
-				1A1F130A0B3919F100845A6C /* lleditmenuhandler.h */,
-				1A1F130B0B3919F100845A6C /* lleditmenuhandler.cpp */,
-				1AEF0A590B2DFE71003F107C /* llrootview.h */,
-				1AEF0A5A0B2DFE72003F107C /* llrootview.cpp */,
-				1AEF0A560B2DFE67003F107C /* llctrlselectioninterface.cpp */,
-				1AEF0A570B2DFE67003F107C /* llctrlselectioninterface.h */,
-				299F95BE0ADDE5D000C94EEF /* llviewquery.cpp */,
-				299F95BF0ADDE5D000C94EEF /* llviewquery.h */,
-				AAEAAF250A8104D8005F0707 /* llscrollingpanellist.cpp */,
-				AAEAAF260A8104D8005F0707 /* llscrollingpanellist.h */,
-				AAA133690A3F94D000419F7C /* lluistring.cpp */,
-				AAA1336A0A3F94D000419F7C /* lluistring.h */,
-				1A8BF3770A1AAB7B005B9D5A /* llcallbackmap.h */,
-				93AE41C908F483E300141675 /* llalertdialog.h */,
-				93AE41CA08F483E300141675 /* llmodaldialog.h */,
 				93AE41C508F483C800141675 /* llalertdialog.cpp */,
-				93AE41C608F483C900141675 /* llmodaldialog.cpp */,
-				EB9E8314082AEEF2007B4479 /* llmenugl.cpp */,
-				EB9E8315082AEEF2007B4479 /* llmenugl.h */,
-				EB9E8316082AEEF2007B4479 /* llresmgr.cpp */,
-				EB9E8317082AEEF2007B4479 /* llresmgr.h */,
+				93AE41C908F483E300141675 /* llalertdialog.h */,
 				EB3EE68E083ABB5D002BF676 /* llbutton.cpp */,
 				EB3EE68F083ABB5D002BF676 /* llbutton.h */,
+				1A8BF3770A1AAB7B005B9D5A /* llcallbackmap.h */,
 				EB3EE690083ABB5D002BF676 /* llcheckboxctrl.cpp */,
 				EB3EE691083ABB5D002BF676 /* llcheckboxctrl.h */,
 				EB3EE692083ABB5D002BF676 /* llclipboard.cpp */,
 				EB3EE693083ABB5D002BF676 /* llclipboard.h */,
 				EB3EE694083ABB5D002BF676 /* llcombobox.cpp */,
 				EB3EE695083ABB5D002BF676 /* llcombobox.h */,
+				1AEF0A560B2DFE67003F107C /* llctrlselectioninterface.cpp */,
+				1AEF0A570B2DFE67003F107C /* llctrlselectioninterface.h */,
 				EB3EE696083ABB5D002BF676 /* lldraghandle.cpp */,
 				EB3EE697083ABB5D002BF676 /* lldraghandle.h */,
+				1A1F130B0B3919F100845A6C /* lleditmenuhandler.cpp */,
+				1A1F130A0B3919F100845A6C /* lleditmenuhandler.h */,
 				EB3EE698083ABB5D002BF676 /* llfloater.cpp */,
 				EB3EE699083ABB5D002BF676 /* llfloater.h */,
 				EB3EE69A083ABB5D002BF676 /* llfocusmgr.cpp */,
 				EB3EE69B083ABB5D002BF676 /* llfocusmgr.h */,
+				A29852A10BC6BC630005FA09 /* llhtmlhelp.h */,
 				EB3EE69C083ABB5D002BF676 /* lliconctrl.cpp */,
 				EB3EE69D083ABB5D002BF676 /* lliconctrl.h */,
 				EB3EE69E083ABB5D002BF676 /* llkeywords.cpp */,
 				EB3EE69F083ABB5D002BF676 /* llkeywords.h */,
 				EB3EE6A0083ABB5D002BF676 /* lllineeditor.cpp */,
 				EB3EE6A1083ABB5D002BF676 /* lllineeditor.h */,
+				EB9E8314082AEEF2007B4479 /* llmenugl.cpp */,
+				EB9E8315082AEEF2007B4479 /* llmenugl.h */,
+				93AE41C608F483C900141675 /* llmodaldialog.cpp */,
+				93AE41CA08F483E300141675 /* llmodaldialog.h */,
 				EB3EE6A2083ABB5D002BF676 /* llpanel.cpp */,
 				EB3EE6A3083ABB5D002BF676 /* llpanel.h */,
 				EB3EE6A4083ABB5D002BF676 /* llradiogroup.cpp */,
@@ -3205,10 +3188,16 @@
 				EB3EE6A7083ABB5D002BF676 /* llresizebar.h */,
 				EB3EE6A8083ABB5D002BF676 /* llresizehandle.cpp */,
 				EB3EE6A9083ABB5D002BF676 /* llresizehandle.h */,
+				EB9E8316082AEEF2007B4479 /* llresmgr.cpp */,
+				EB9E8317082AEEF2007B4479 /* llresmgr.h */,
+				1AEF0A5A0B2DFE72003F107C /* llrootview.cpp */,
+				1AEF0A590B2DFE71003F107C /* llrootview.h */,
 				EB3EE6AA083ABB5D002BF676 /* llscrollbar.cpp */,
 				EB3EE6AB083ABB5D002BF676 /* llscrollbar.h */,
 				EB3EE6AC083ABB5D002BF676 /* llscrollcontainer.cpp */,
 				EB3EE6AD083ABB5D002BF676 /* llscrollcontainer.h */,
+				AAEAAF250A8104D8005F0707 /* llscrollingpanellist.cpp */,
+				AAEAAF260A8104D8005F0707 /* llscrollingpanellist.h */,
 				EB3EE6AE083ABB5D002BF676 /* llscrolllistctrl.cpp */,
 				EB3EE6AF083ABB5D002BF676 /* llscrolllistctrl.h */,
 				EB3EE6B0083ABB5D002BF676 /* llslider.cpp */,
@@ -3227,19 +3216,23 @@
 				EB3EE6BD083ABB5D002BF676 /* lltextbox.h */,
 				EB3EE6C0083ABB5D002BF676 /* lltexteditor.cpp */,
 				EB3EE6C1083ABB5D002BF676 /* lltexteditor.h */,
-				EB3EE6C2083ABB5D002BF676 /* lluictrlfactory.cpp */,
-				EB3EE6C3083ABB5D002BF676 /* lluictrlfactory.h */,
-				EB3EE6C4083ABB5E002BF676 /* llviewborder.cpp */,
-				EB3EE6C5083ABB5E002BF676 /* llviewborder.h */,
 				EB9E8318082AEEF3007B4479 /* llui.cpp */,
 				EB9E8319082AEEF3007B4479 /* llui.h */,
 				EB9E831A082AEEF3007B4479 /* lluiconstants.h */,
 				EB9E831B082AEEF3007B4479 /* lluictrl.cpp */,
 				EB9E831C082AEEF3007B4479 /* lluictrl.h */,
-				EB9E831D082AEEF3007B4479 /* llview.cpp */,
-				EB9E831E082AEEF3007B4479 /* llview.h */,
+				EB3EE6C2083ABB5D002BF676 /* lluictrlfactory.cpp */,
+				EB3EE6C3083ABB5D002BF676 /* lluictrlfactory.h */,
+				AAA133690A3F94D000419F7C /* lluistring.cpp */,
+				AAA1336A0A3F94D000419F7C /* lluistring.h */,
 				6192225F074A9B5A005E1F34 /* llundo.cpp */,
 				61922260074A9B5A005E1F34 /* llundo.h */,
+				EB9E831D082AEEF3007B4479 /* llview.cpp */,
+				EB9E831E082AEEF3007B4479 /* llview.h */,
+				EB3EE6C4083ABB5E002BF676 /* llviewborder.cpp */,
+				EB3EE6C5083ABB5E002BF676 /* llviewborder.h */,
+				299F95BE0ADDE5D000C94EEF /* llviewquery.cpp */,
+				299F95BF0ADDE5D000C94EEF /* llviewquery.h */,
 			);
 			name = llui;
 			path = ../llui;
@@ -3528,302 +3521,298 @@
 		997B4BCB060157E5001B0407 /* newview headers */ = {
 			isa = PBXGroup;
 			children = (
+				997B4CF006015822001B0407 /* audiosettings.h */,
+				997B4D2406015823001B0407 /* head.h */,
+				997B4D2306015823001B0407 /* llagent.h */,
+				1A758C990A43700400589675 /* llagentdata.h */,
+				997B4D2206015823001B0407 /* llagentpilot.h */,
+				997B4D2106015823001B0407 /* llagparray.h */,
+				997B4D2006015823001B0407 /* llagparray.inl */,
+				997B4D1E06015823001B0407 /* llappearance.h */,
+				997B4D2506015823001B0407 /* llasynchostbyname.h */,
+				997B4D1C06015823001B0407 /* llaudiostatus.h */,
+				997B4D1806015823001B0407 /* llbbox.h */,
+				997B4D1606015823001B0407 /* llbox.h */,
+				997B4D1306015823001B0407 /* llcallbacklist.h */,
+				997B4D1206015823001B0407 /* llcallingcard.h */,
+				997B4D1106015823001B0407 /* llcameraview.h */,
 				9C1842500B9F94F200208356 /* llcaphttpsender.h */,
-				1A8870E60BCC5AAD00E89AA6 /* llresourcedata.h */,
-				A3C20E4E0BB0BD49007E872B /* llviewerjoystick.h */,
-				A3C20E4D0BB0BD37007E872B /* llglslshader.h */,
-				1AF7C1F20AF6C45000C4BF4A /* llweb.h */,
+				997B4D1006015823001B0407 /* llchatbar.h */,
+				997B4D0D06015823001B0407 /* llcloud.h */,
+				997B4D0C06015823001B0407 /* llcolorscheme.h */,
+				997B4D0B06015823001B0407 /* llcolorswatch.h */,
+				997B4D0906015823001B0407 /* llcompass.h */,
+				997B4D0806015823001B0407 /* llcompilequeue.h */,
+				997B4D0706015823001B0407 /* llconsole.h */,
+				997B4D0606015823001B0407 /* llcontainerview.h */,
+				997B4D0506015823001B0407 /* llconversation.h */,
+				997B4CEF06015822001B0407 /* llcubemap.h */,
+				997B4CEE06015822001B0407 /* llcylinder.h */,
+				997B4D0306015823001B0407 /* lldebugview.h */,
+				997B4D0106015823001B0407 /* lldrawable.h */,
+				997B4D0006015823001B0407 /* lldrawpool.h */,
+				997B4CFF06015823001B0407 /* lldrawpoolalpha.h */,
+				997B4CFE06015823001B0407 /* lldrawpoolavatar.h */,
+				997B4CFD06015823001B0407 /* lldrawpoolbump.h */,
+				997B4CFC06015823001B0407 /* lldrawpoolground.h */,
+				997B4CFB06015823001B0407 /* lldrawpoolsimple.h */,
+				997B4CFA06015823001B0407 /* lldrawpoolsky.h */,
+				997B4CF806015823001B0407 /* lldrawpoolterrain.h */,
+				997B4CF706015823001B0407 /* lldrawpooltree.h */,
+				997B4CF606015823001B0407 /* lldrawpooltreenew.h */,
+				997B4CF506015823001B0407 /* lldrawpoolwater.h */,
+				997B4CF406015822001B0407 /* lldriverparam.h */,
+				997B4CF206015822001B0407 /* llemote.h */,
+				915F492B06B5739800F629BF /* lleventinfo.h */,
+				915F492306B572FB00F629BF /* lleventnotifier.h */,
+				997B4CF106015822001B0407 /* llface.h */,
+				997B4CEC06015822001B0407 /* llface.inl */,
+				912541B00691FF8D008C66F7 /* llfasttimerview.h */,
+				997B4CEB06015822001B0407 /* llfeaturemanager.h */,
+				997B4CE906015822001B0407 /* llfilepicker.h */,
+				997B4CE706015822001B0407 /* llfirstuse.h */,
+				997B4CE506015822001B0407 /* llfloaterabout.h */,
+				997B4CE306015822001B0407 /* llfloaterauction.h */,
+				997B4CE206015822001B0407 /* llfloateravatarinfo.h */,
+				1A61A7FA0A5ED44E009FE3D2 /* llfloateravatarpicker.h */,
 				1AF9CA450AE972D4003EFF2D /* llfloateravatartextures.h */,
-				1AD61F6C0AC09B2600507FB9 /* llimview.h */,
+				997B4CE006015822001B0407 /* llfloaterbuildoptions.h */,
 				1A5B3B530A70146900A90391 /* llfloaterbump.h */,
-				A3285A350A71419F00F619A5 /* llinventorybridge.h */,
-				A3D968F10A6EBCA7007E8BD2 /* llfloaternewim.h */,
-				1A61A7FA0A5ED44E009FE3D2 /* llfloateravatarpicker.h */,
-				A3AF6BD00A544F0A005B5E2C /* llpanellogin.h */,
-				1A758C990A43700400589675 /* llagentdata.h */,
-				1A758C980A436FF400589675 /* llpanellandoptions.h */,
-				1A758C970A436FF000589675 /* llpanellandobjects.h */,
-				1AFA40B60A2DFD8200C13F70 /* llsavedsettingsglue.h */,
-				1A8BF3790A1AABAD005B9D5A /* llfloatertest.h */,
-				1A3143DD0A02B725005B87E7 /* llprefschat.h */,
-				1A3143DC0A02B720005B87E7 /* llprefsim.h */,
-				1A3143DB0A02B70E005B87E7 /* llviewernetwork.h */,
+				997B4CDF06015822001B0407 /* llfloaterbuy.h */,
+				997B4CDE06015822001B0407 /* llfloaterbuycontents.h */,
+				997B4CDC06015822001B0407 /* llfloaterchat.h */,
+				91CB311706FB586300DBCE1E /* llfloaterclothing.h */,
+				997B4CDB06015822001B0407 /* llfloatercustomize.h */,
+				997B4CDA06015822001B0407 /* llfloaterdirectory.h */,
+				913AA1FE0798560200D111CE /* llfloaterfriends.h */,
+				997B4CD906015822001B0407 /* llfloatergesture.h */,
+				997B4CD806015822001B0407 /* llfloatergodtools.h */,
+				997B4CD606015822001B0407 /* llfloatergroupinfo.h */,
 				84401E2E0A13CC9A006720A5 /* llfloatergroupinvite.h */,
+				997B4CD506015822001B0407 /* llfloatergroupprofile.h */,
+				997B4CD406015822001B0407 /* llfloatergroups.h */,
+				997B4CD206015822001B0407 /* llfloaterland.h */,
+				997B4CD106015822001B0407 /* llfloaterlandholdings.h */,
+				997B4CCF06015822001B0407 /* llfloatermap.h */,
+				997B4CCD06015822001B0407 /* llfloatermute.h */,
+				997B4CCC06015822001B0407 /* llfloaternamedesc.h */,
+				A3D968F10A6EBCA7007E8BD2 /* llfloaternewim.h */,
+				997B4CCB06015822001B0407 /* llfloaterpostcard.h */,
+				997B4CCA06015822001B0407 /* llfloaterpreference.h */,
+				997B4CC906015822001B0407 /* llfloaterproperties.h */,
+				9174D2C20653FC3700A7E32B /* llfloaterregioninfo.h */,
+				997B4CC706015822001B0407 /* llfloaterreporter.h */,
 				91E86C3307BD3B6400F56E75 /* llfloatersaveavatar.h */,
-				913AA1FE0798560200D111CE /* llfloaterfriends.h */,
-				9104C0CD0778AE20001EC4F6 /* llpanelmsgs.h */,
+				997B4CC606015822001B0407 /* llfloatersnapshot.h */,
+				1A8BF3790A1AABAD005B9D5A /* llfloatertest.h */,
+				997B4CC506015822001B0407 /* llfloatertools.h */,
+				997B4CC406015822001B0407 /* llfloatertos.h */,
+				997B4CC106015822001B0407 /* llfloaterworldmap.h */,
+				997B4CC006015822001B0407 /* llfolderview.h */,
+				997B4CBF06015822001B0407 /* llframestats.h */,
+				997B4CBE06015822001B0407 /* llframestatview.h */,
+				997B4CBD06015822001B0407 /* llgenepool.h */,
+				91FC1D480652802C009CF498 /* llgesturemgr.h */,
+				997B4CBC06015822001B0407 /* llgivemoney.h */,
+				A3C20E4D0BB0BD37007E872B /* llglslshader.h */,
 				2EFEA8EA09F4557900CB0193 /* llgroupnotify.h */,
-				91CB311706FB586300DBCE1E /* llfloaterclothing.h */,
+				997B4CBA06015822001B0407 /* llhippo.h */,
+				997B4CB906015822001B0407 /* llhoverview.h */,
+				997B4CB806015822001B0407 /* llhudconnector.h */,
+				997B4CB706015822001B0407 /* llhudeffect.h */,
+				997B4CB606015822001B0407 /* llhudeffectbeam.h */,
+				997B4CB506015822001B0407 /* llhudeffectlookat.h */,
+				997B4CB406015822001B0407 /* llhudeffectpointat.h */,
+				997B4CB306015822001B0407 /* llhudeffecttrail.h */,
+				997B4CB206015822001B0407 /* llhudmanager.h */,
+				997B4CB106015822001B0407 /* llhudobject.h */,
+				997B4CB006015822001B0407 /* llhudrender.h */,
+				997B4CAF06015822001B0407 /* llhudtext.h */,
+				997B4CAE06015822001B0407 /* llhudview.h */,
+				997B4CAC06015822001B0407 /* llimpanel.h */,
+				1AD61F6C0AC09B2600507FB9 /* llimview.h */,
+				A3285A350A71419F00F619A5 /* llinventorybridge.h */,
+				997B4CAB06015822001B0407 /* llinventoryclipboard.h */,
+				997B4CAA06015822001B0407 /* llinventorymodel.h */,
+				997B4CA906015822001B0407 /* llinventoryview.h */,
+				997B4CA806015822001B0407 /* lljoystickbutton.h */,
+				997B4CA506015822001B0407 /* lllandmarklist.h */,
+				997B4CA406015822001B0407 /* lllightconstants.h */,
+				997B4CA106015822001B0407 /* llmanip.h */,
+				997B4CA006015822001B0407 /* llmaniprotate.h */,
+				997B4C9F06015822001B0407 /* llmanipscale.h */,
+				997B4C9E06015822001B0407 /* llmaniptranslate.h */,
+				E34C14750AE6A3FF009BF4DE /* llmapresponders.h */,
+				997B4C9D06015822001B0407 /* llmenucommands.h */,
+				997B4C9906015822001B0407 /* llmorphview.h */,
+				997B4C9806015822001B0407 /* llmoveview.h */,
+				997B4C9706015822001B0407 /* llmutelist.h */,
+				997B4C9606015822001B0407 /* llnamebox.h */,
+				997B4C9506015822001B0407 /* llnameeditor.h */,
+				997B4C9406015822001B0407 /* llnamelistctrl.h */,
+				997B4C9306015822001B0407 /* llnetmap.h */,
+				997B4C9106015822001B0407 /* llnotify.h */,
+				997B4C9006015822001B0407 /* lloverlaybar.h */,
+				997B4C8E06015822001B0407 /* llpanelaudioprefs.h */,
+				997B4C8D06015822001B0407 /* llpanelavatar.h */,
+				99FBB048087363B00048A5CC /* llpanelclassified.h */,
+				997B4C8B06015822001B0407 /* llpanelcontents.h */,
+				997B4C8A06015822001B0407 /* llpanelcreate.h */,
+				997B4C8906015822001B0407 /* llpaneldebug.h */,
+				997B4C8606015822001B0407 /* llpaneldirbrowser.h */,
+				99FBB090087366930048A5CC /* llpaneldirclassified.h */,
+				997B4C8506015822001B0407 /* llpaneldirevents.h */,
+				997B4C8406015822001B0407 /* llpaneldirfind.h */,
+				997B4C8306015822001B0407 /* llpaneldirgroups.h */,
+				997B4C8206015822001B0407 /* llpaneldirland.h */,
+				997B4C8006015822001B0407 /* llpaneldirpeople.h */,
+				997B4C7F06015822001B0407 /* llpaneldirpicks.h */,
+				997B4C7E06015822001B0407 /* llpaneldirplaces.h */,
+				997B4C7D06015822001B0407 /* llpaneldirpopular.h */,
+				997B4C7C06015822001B0407 /* llpaneldisplay.h */,
+				997B4C7A06015822001B0407 /* llpanelevent.h */,
+				997B4C7906015822001B0407 /* llpanelface.h */,
+				997B4C7706015822001B0407 /* llpanelgeneral.h */,
+				2EFEA8ED09F455C900CB0193 /* llpanelgroup.h */,
+				2EFEA8EF09F4588000CB0193 /* llpanelgroupgeneral.h */,
 				84401E310A13CCB2006720A5 /* llpanelgroupinvite.h */,
 				2EA4CEEE09F83C0B008F60F7 /* llpanelgrouplandmoney.h */,
-				2EA4CEEF09F83C16008F60F7 /* llpanelgrouproles.h */,
 				2E6FE90E09FD562D00AF02FF /* llpanelgroupnotices.h */,
-				915F492B06B5739800F629BF /* lleventinfo.h */,
-				915F492306B572FB00F629BF /* lleventnotifier.h */,
-				91DF405006A73E0C00CA7FE5 /* llviewerdisplay.h */,
-				2EFEA8EF09F4588000CB0193 /* llpanelgroupgeneral.h */,
-				2EFEA8ED09F455C900CB0193 /* llpanelgroup.h */,
-				91DF402206A739CB00CA7FE5 /* llstartup.h */,
-				912541B00691FF8D008C66F7 /* llfasttimerview.h */,
-				9174D2C20653FC3700A7E32B /* llfloaterregioninfo.h */,
-				91FC1D480652802C009CF498 /* llgesturemgr.h */,
+				2EA4CEEF09F83C16008F60F7 /* llpanelgrouproles.h */,
+				997B4C7506015822001B0407 /* llpanelgroupvoting.h */,
+				997B4C7406015822001B0407 /* llpanelinput.h */,
+				997B4C7306015822001B0407 /* llpanelinventory.h */,
+				997B4C7206015822001B0407 /* llpanelland.h */,
+				1A758C970A436FF000589675 /* llpanellandobjects.h */,
+				1A758C980A436FF400589675 /* llpanellandoptions.h */,
+				997B4C7106015822001B0407 /* llpanelleaderboard.h */,
+				A3AF6BD00A544F0A005B5E2C /* llpanellogin.h */,
+				997B4C6F06015822001B0407 /* llpanelmorph.h */,
+				9104C0CD0778AE20001EC4F6 /* llpanelmsgs.h */,
+				997B4C6D06015822001B0407 /* llpanelnetwork.h */,
+				997B4C6C06015821001B0407 /* llpanelobject.h */,
+				997B4C6B06015821001B0407 /* llpanelpermissions.h */,
+				997B4C6A06015821001B0407 /* llpanelpick.h */,
+				997B4C6906015821001B0407 /* llpanelplace.h */,
+				997B4C6706015821001B0407 /* llpatchvertexarray.h */,
+				997B4C6506015821001B0407 /* llpolymesh.h */,
+				997B4C6406015821001B0407 /* llpolymorph.h */,
+				1A3143DD0A02B725005B87E7 /* llprefschat.h */,
+				1A3143DC0A02B720005B87E7 /* llprefsim.h */,
+				997B4C6206015821001B0407 /* llpreview.h */,
 				91FC1D4606527FEC009CF498 /* llpreviewgesture.h */,
-				997B4BD006015820001B0407 /* viewer.h */,
-				997B4BD106015820001B0407 /* VertexCache.h */,
-				997B4BD406015820001B0407 /* randgauss.h */,
-				997B4BD506015820001B0407 /* pipeline.h */,
-				997B4BD906015821001B0407 /* noise.h */,
-				997B4BDA06015821001B0407 /* moviemaker.h */,
-				997B4BDB06015821001B0407 /* macview_Prefix.h */,
-				997B4BDC06015821001B0407 /* macmain.h */,
-				997B4BDE06015821001B0407 /* llworldmapview.h */,
-				997B4BDF06015821001B0407 /* llworldmap.h */,
-				997B4BE006015821001B0407 /* llworld.h */,
-				997B4BE106015821001B0407 /* llwindebug.h */,
-				997B4BE206015821001B0407 /* llwind.h */,
-				997B4BE306015821001B0407 /* llwearablelist.h */,
-				997B4BE406015821001B0407 /* llwearable.h */,
-				997B4BE506015821001B0407 /* llwaterpatch.h */,
-				997B4BE606015821001B0407 /* llvowater.h */,
-				997B4BE706015821001B0407 /* llvovolume.h */,
-				997B4BE806015821001B0407 /* llvotreenew.h */,
-				997B4BE906015821001B0407 /* llvotree.h */,
-				997B4BEA06015821001B0407 /* llvotextbubble.h */,
-				997B4BEB06015821001B0407 /* llvosurfacepatch.h */,
-				997B4BEC06015821001B0407 /* llvosky.h */,
-				997B4BED06015821001B0407 /* llvopartgroup.h */,
-				997B4BEF06015821001B0407 /* llvoground.h */,
-				997B4BF006015821001B0407 /* llvograss.h */,
-				997B4BF106015821001B0407 /* llvoclouds.h */,
-				997B4BF206015821001B0407 /* llvocache.h */,
-				997B4BF306015821001B0407 /* llvoavatar.h */,
-				997B4BF406015821001B0407 /* llvlmanager.h */,
-				997B4BF506015821001B0407 /* llvlcomposition.h */,
-				997B4BF606015821001B0407 /* llviewerwindow.h */,
-				997B4BF706015821001B0407 /* llviewervisualparam.h */,
-				997B4BF806015821001B0407 /* llviewerthrottle.h */,
-				997B4BF906015821001B0407 /* llviewertextureanim.h */,
-				997B4BFA06015821001B0407 /* llviewerstats.h */,
-				997B4BFC06015821001B0407 /* llviewerregion.h */,
-				997B4BFD06015821001B0407 /* llviewerpartsource.h */,
-				997B4BFE06015821001B0407 /* llviewerpartsim.h */,
-				997B4BFF06015821001B0407 /* llviewerparceloverlay.h */,
-				997B4C0006015821001B0407 /* llviewerparcelmgr.h */,
-				997B4C0106015821001B0407 /* llviewerobjectlist.h */,
-				997B4C0206015821001B0407 /* llviewerobject.h */,
-				997B4C0306015821001B0407 /* llviewermessage.h */,
-				997B4C0406015821001B0407 /* llviewermenu.h */,
-				997B4C0506015821001B0407 /* llviewerlayer.h */,
-				997B4C0606015821001B0407 /* llviewerjointshape.h */,
-				997B4C0706015821001B0407 /* llviewerimagelist.h */,
-				997B4C0806015821001B0407 /* llviewerimage.h */,
-				997B4C0906015821001B0407 /* llviewergesture.h */,
-				997B4C0A06015821001B0407 /* llviewercamera.h */,
-				997B4C0B06015821001B0407 /* llviewerbuild.h */,
-				997B4C0E06015821001B0407 /* llvelocitybar.h */,
-				997B4C0F06015821001B0407 /* llviewerjointmesh.h */,
-				997B4C1006015821001B0407 /* llviewerjointattachment.h */,
-				997B4C1106015821001B0407 /* llviewerjoint.h */,
-				997B4C1206015821001B0407 /* llviewerinventory.h */,
-				997B4C1306015821001B0407 /* lluserauth.h */,
-				997B4C1406015821001B0407 /* llurl.h */,
-				997B4C1506015821001B0407 /* lluploaddialog.h */,
-				997B4C1806015821001B0407 /* lluiconstants.h */,
-				997B4C1B06015821001B0407 /* lltoolview.h */,
-				997B4C1C06015821001B0407 /* lltoolselectrect.h */,
-				997B4C1D06015821001B0407 /* lltoolselectland.h */,
-				997B4C1E06015821001B0407 /* lltoolselect.h */,
-				997B4C2006015821001B0407 /* lltoolplacer.h */,
-				997B4C2106015821001B0407 /* lltoolpie.h */,
-				997B4C2406015821001B0407 /* lltracker.h */,
-				997B4C2506015821001B0407 /* lltoolobjpicker.h */,
-				997B4C2606015821001B0407 /* lltoolmorph.h */,
-				997B4C2706015821001B0407 /* lltoolmgr.h */,
-				997B4C2806015821001B0407 /* lltoolindividual.h */,
-				997B4C2906015821001B0407 /* lltoolgun.h */,
-				997B4C2A06015821001B0407 /* lltoolgrab.h */,
-				997B4C2B06015821001B0407 /* lltoolfocus.h */,
-				997B4C2C06015821001B0407 /* lltoolface.h */,
-				997B4C2D06015821001B0407 /* lltooldraganddrop.h */,
-				997B4C2E06015821001B0407 /* lltoolcomp.h */,
-				997B4C3006015821001B0407 /* lltoolbrush.h */,
-				997B4C3206015821001B0407 /* lltoolbar.h */,
-				997B4C3306015821001B0407 /* lltool.h */,
-				997B4C3406015821001B0407 /* lltextureview.h */,
-				997B4C3506015821001B0407 /* lltexturetable.h */,
-				997B4C3606015821001B0407 /* lltexturectrl.h */,
-				997B4C3B06015821001B0407 /* lltexlayer.h */,
-				997B4C3D06015821001B0407 /* lltable.h */,
-				997B4C4006015821001B0407 /* llstatview.h */,
-				997B4C4106015821001B0407 /* llstatusbar.h */,
-				997B4C4206015821001B0407 /* llstatgraph.h */,
-				997B4C4306015821001B0407 /* llstatbar.h */,
-				997B4C4406015821001B0407 /* llsprite.h */,
-				997B4C4606015821001B0407 /* llsphere.h */,
+				997B4C6106015821001B0407 /* llpreviewlandmark.h */,
+				997B4C6006015821001B0407 /* llpreviewnotecard.h */,
+				997B4C5F06015821001B0407 /* llpreviewobject.h */,
+				997B4C5E06015821001B0407 /* llpreviewscript.h */,
+				997B4C5D06015821001B0407 /* llpreviewsound.h */,
+				997B4C5C06015821001B0407 /* llpreviewtexture.h */,
+				997B4C5A06015821001B0407 /* llprogressview.h */,
+				997B4C5706015821001B0407 /* llregionposition.h */,
+				1A8870E60BCC5AAD00E89AA6 /* llresourcedata.h */,
+				997B4C5206015821001B0407 /* llroam.h */,
+				1AFA40B60A2DFD8200C13F70 /* llsavedsettingsglue.h */,
+				997B4C4E06015821001B0407 /* llselectmgr.h */,
+				997B4C4D06015821001B0407 /* llsky.h */,
 				997B4C4706015821001B0407 /* llspatialpartition.h */,
-				997B4C4A06015821001B0407 /* llsurfacepatch.h */,
+				997B4C4606015821001B0407 /* llsphere.h */,
+				997B4C4406015821001B0407 /* llsprite.h */,
+				91DF402206A739CB00CA7FE5 /* llstartup.h */,
+				997B4C4306015821001B0407 /* llstatbar.h */,
+				997B4C4206015821001B0407 /* llstatgraph.h */,
+				997B4C4106015821001B0407 /* llstatusbar.h */,
+				997B4C4006015821001B0407 /* llstatview.h */,
 				997B4C4B06015821001B0407 /* llsurface.h */,
-				997B4C4D06015821001B0407 /* llsky.h */,
-				997B4C4E06015821001B0407 /* llselectmgr.h */,
-				997B4C5206015821001B0407 /* llroam.h */,
-				997B4C5706015821001B0407 /* llregionposition.h */,
-				997B4C5A06015821001B0407 /* llprogressview.h */,
-				997B4C5C06015821001B0407 /* llpreviewtexture.h */,
-				997B4C5D06015821001B0407 /* llpreviewsound.h */,
-				997B4C5E06015821001B0407 /* llpreviewscript.h */,
-				997B4C5F06015821001B0407 /* llpreviewobject.h */,
-				997B4C6006015821001B0407 /* llpreviewnotecard.h */,
-				997B4C6106015821001B0407 /* llpreviewlandmark.h */,
-				997B4C6206015821001B0407 /* llpreview.h */,
-				997B4C6406015821001B0407 /* llpolymorph.h */,
-				997B4C6506015821001B0407 /* llpolymesh.h */,
-				997B4C6706015821001B0407 /* llpatchvertexarray.h */,
-				997B4C6906015821001B0407 /* llpanelplace.h */,
-				997B4C6A06015821001B0407 /* llpanelpick.h */,
-				997B4C6B06015821001B0407 /* llpanelpermissions.h */,
-				997B4C6C06015821001B0407 /* llpanelobject.h */,
-				997B4C6D06015822001B0407 /* llpanelnetwork.h */,
-				997B4C6F06015822001B0407 /* llpanelmorph.h */,
-				997B4C7106015822001B0407 /* llpanelleaderboard.h */,
-				997B4C7206015822001B0407 /* llpanelland.h */,
-				997B4C7306015822001B0407 /* llpanelinventory.h */,
-				997B4C7406015822001B0407 /* llpanelinput.h */,
-				997B4C7506015822001B0407 /* llpanelgroupvoting.h */,
-				997B4C7706015822001B0407 /* llpanelgeneral.h */,
-				997B4C7906015822001B0407 /* llpanelface.h */,
-				997B4C7A06015822001B0407 /* llpanelevent.h */,
-				997B4C7C06015822001B0407 /* llpaneldisplay.h */,
-				997B4C7D06015822001B0407 /* llpaneldirpopular.h */,
-				997B4C7E06015822001B0407 /* llpaneldirplaces.h */,
-				997B4C7F06015822001B0407 /* llpaneldirpicks.h */,
-				997B4C8006015822001B0407 /* llpaneldirpeople.h */,
-				997B4C8206015822001B0407 /* llpaneldirland.h */,
-				997B4C8306015822001B0407 /* llpaneldirgroups.h */,
-				997B4C8406015822001B0407 /* llpaneldirfind.h */,
-				997B4C8506015822001B0407 /* llpaneldirevents.h */,
-				997B4C8606015822001B0407 /* llpaneldirbrowser.h */,
-				99FBB090087366930048A5CC /* llpaneldirclassified.h */,
-				997B4C8906015822001B0407 /* llpaneldebug.h */,
-				997B4C8A06015822001B0407 /* llpanelcreate.h */,
-				99FBB048087363B00048A5CC /* llpanelclassified.h */,
-				997B4C8B06015822001B0407 /* llpanelcontents.h */,
-				997B4C8D06015822001B0407 /* llpanelavatar.h */,
-				997B4C8E06015822001B0407 /* llpanelaudioprefs.h */,
-				997B4C9006015822001B0407 /* lloverlaybar.h */,
-				997B4C9106015822001B0407 /* llnotify.h */,
-				997B4C9306015822001B0407 /* llnetmap.h */,
-				997B4C9406015822001B0407 /* llnamelistctrl.h */,
-				997B4C9506015822001B0407 /* llnameeditor.h */,
-				997B4C9606015822001B0407 /* llnamebox.h */,
-				997B4C9706015822001B0407 /* llmutelist.h */,
-				997B4C9806015822001B0407 /* llmoveview.h */,
-				997B4C9906015822001B0407 /* llmorphview.h */,
-				997B4C9D06015822001B0407 /* llmenucommands.h */,
-				997B4C9E06015822001B0407 /* llmaniptranslate.h */,
-				997B4C9F06015822001B0407 /* llmanipscale.h */,
-				997B4CA006015822001B0407 /* llmaniprotate.h */,
-				997B4CA106015822001B0407 /* llmanip.h */,
-				997B4CA406015822001B0407 /* lllightconstants.h */,
-				997B4CA506015822001B0407 /* lllandmarklist.h */,
-				997B4CA806015822001B0407 /* lljoystickbutton.h */,
-				997B4CA906015822001B0407 /* llinventoryview.h */,
-				997B4CAA06015822001B0407 /* llinventorymodel.h */,
-				997B4CAB06015822001B0407 /* llinventoryclipboard.h */,
-				997B4CAC06015822001B0407 /* llimpanel.h */,
-				997B4CAE06015822001B0407 /* llhudview.h */,
-				997B4CAF06015822001B0407 /* llhudtext.h */,
-				997B4CB006015822001B0407 /* llhudrender.h */,
-				997B4CB106015822001B0407 /* llhudobject.h */,
-				997B4CB206015822001B0407 /* llhudmanager.h */,
-				997B4CB306015822001B0407 /* llhudeffecttrail.h */,
-				997B4CB406015822001B0407 /* llhudeffectpointat.h */,
-				997B4CB506015822001B0407 /* llhudeffectlookat.h */,
-				997B4CB606015822001B0407 /* llhudeffectbeam.h */,
-				997B4CB706015822001B0407 /* llhudeffect.h */,
-				997B4CB806015822001B0407 /* llhudconnector.h */,
-				997B4CB906015822001B0407 /* llhoverview.h */,
-				997B4CBA06015822001B0407 /* llhippo.h */,
-				997B4CBC06015822001B0407 /* llgivemoney.h */,
-				997B4CBD06015822001B0407 /* llgenepool.h */,
-				997B4CBE06015822001B0407 /* llframestatview.h */,
-				997B4CBF06015822001B0407 /* llframestats.h */,
-				997B4CC006015822001B0407 /* llfolderview.h */,
-				997B4CC106015822001B0407 /* llfloaterworldmap.h */,
-				997B4CC406015822001B0407 /* llfloatertos.h */,
-				997B4CC506015822001B0407 /* llfloatertools.h */,
-				997B4CC606015822001B0407 /* llfloatersnapshot.h */,
-				997B4CC706015822001B0407 /* llfloaterreporter.h */,
-				997B4CC906015822001B0407 /* llfloaterproperties.h */,
-				997B4CCA06015822001B0407 /* llfloaterpreference.h */,
-				997B4CCB06015822001B0407 /* llfloaterpostcard.h */,
-				997B4CCC06015822001B0407 /* llfloaternamedesc.h */,
-				997B4CCD06015822001B0407 /* llfloatermute.h */,
-				997B4CCF06015822001B0407 /* llfloatermap.h */,
-				997B4CD106015822001B0407 /* llfloaterlandholdings.h */,
-				997B4CD206015822001B0407 /* llfloaterland.h */,
-				997B4CD406015822001B0407 /* llfloatergroups.h */,
-				997B4CD506015822001B0407 /* llfloatergroupprofile.h */,
-				997B4CD606015822001B0407 /* llfloatergroupinfo.h */,
-				997B4CD806015822001B0407 /* llfloatergodtools.h */,
-				997B4CD906015822001B0407 /* llfloatergesture.h */,
-				997B4CDA06015822001B0407 /* llfloaterdirectory.h */,
-				997B4CDB06015822001B0407 /* llfloatercustomize.h */,
-				997B4CDC06015822001B0407 /* llfloaterchat.h */,
-				997B4CDE06015822001B0407 /* llfloaterbuycontents.h */,
-				997B4CDF06015822001B0407 /* llfloaterbuy.h */,
-				997B4CE006015822001B0407 /* llfloaterbuildoptions.h */,
-				997B4CE206015822001B0407 /* llfloateravatarinfo.h */,
-				997B4CE306015822001B0407 /* llfloaterauction.h */,
-				997B4CE506015822001B0407 /* llfloaterabout.h */,
-				997B4CE706015822001B0407 /* llfirstuse.h */,
-				997B4CE906015822001B0407 /* llfilepicker.h */,
-				997B4CEA06015822001B0407 /* llfft.h */,
-				997B4CEB06015822001B0407 /* llfeaturemanager.h */,
-				997B4CEC06015822001B0407 /* llface.inl */,
-				997B4CEE06015822001B0407 /* llcylinder.h */,
-				997B4CEF06015822001B0407 /* llcubemap.h */,
-				997B4CF006015822001B0407 /* audiosettings.h */,
-				997B4CF106015822001B0407 /* llface.h */,
-				997B4CF206015822001B0407 /* llemote.h */,
-				997B4CF406015822001B0407 /* lldriverparam.h */,
-				997B4CF506015823001B0407 /* lldrawpoolwater.h */,
-				997B4CF606015823001B0407 /* lldrawpooltreenew.h */,
-				997B4CF706015823001B0407 /* lldrawpooltree.h */,
-				997B4CF806015823001B0407 /* lldrawpoolterrain.h */,
-				997B4CFA06015823001B0407 /* lldrawpoolsky.h */,
-				997B4CFB06015823001B0407 /* lldrawpoolsimple.h */,
-				997B4CFC06015823001B0407 /* lldrawpoolground.h */,
-				997B4CFD06015823001B0407 /* lldrawpoolbump.h */,
-				997B4CFE06015823001B0407 /* lldrawpoolavatar.h */,
-				997B4CFF06015823001B0407 /* lldrawpoolalpha.h */,
-				997B4D0006015823001B0407 /* lldrawpool.h */,
-				997B4D0106015823001B0407 /* lldrawable.h */,
-				997B4D0306015823001B0407 /* lldebugview.h */,
-				997B4D0406015823001B0407 /* llcountdown.h */,
-				997B4D0506015823001B0407 /* llconversation.h */,
-				997B4D0606015823001B0407 /* llcontainerview.h */,
-				997B4D0706015823001B0407 /* llconsole.h */,
-				997B4D0806015823001B0407 /* llcompilequeue.h */,
-				997B4D0906015823001B0407 /* llcompass.h */,
-				997B4D0B06015823001B0407 /* llcolorswatch.h */,
-				997B4D0C06015823001B0407 /* llcolorscheme.h */,
-				997B4D0D06015823001B0407 /* llcloud.h */,
-				997B4D1006015823001B0407 /* llchatbar.h */,
-				997B4D1106015823001B0407 /* llcameraview.h */,
-				997B4D1206015823001B0407 /* llcallingcard.h */,
-				997B4D1306015823001B0407 /* llcallbacklist.h */,
-				997B4D1606015823001B0407 /* llbox.h */,
-				997B4D1806015823001B0407 /* llbbox.h */,
-				997B4D1C06015823001B0407 /* llaudiostatus.h */,
-				997B4D1E06015823001B0407 /* llappearance.h */,
-				997B4D2006015823001B0407 /* llagparray.inl */,
-				997B4D2106015823001B0407 /* llagparray.h */,
-				997B4D2206015823001B0407 /* llagentpilot.h */,
-				997B4D2306015823001B0407 /* llagent.h */,
-				997B4D2406015823001B0407 /* head.h */,
-				997B4D2506015823001B0407 /* llasynchostbyname.h */,
+				997B4C4A06015821001B0407 /* llsurfacepatch.h */,
+				997B4C3D06015821001B0407 /* lltable.h */,
+				997B4C3B06015821001B0407 /* lltexlayer.h */,
+				997B4C3606015821001B0407 /* lltexturectrl.h */,
+				997B4C3406015821001B0407 /* lltextureview.h */,
+				997B4C3306015821001B0407 /* lltool.h */,
+				997B4C3206015821001B0407 /* lltoolbar.h */,
+				997B4C3006015821001B0407 /* lltoolbrush.h */,
+				997B4C2E06015821001B0407 /* lltoolcomp.h */,
+				997B4C2D06015821001B0407 /* lltooldraganddrop.h */,
+				997B4C2C06015821001B0407 /* lltoolface.h */,
+				997B4C2B06015821001B0407 /* lltoolfocus.h */,
+				997B4C2A06015821001B0407 /* lltoolgrab.h */,
+				997B4C2906015821001B0407 /* lltoolgun.h */,
+				997B4C2806015821001B0407 /* lltoolindividual.h */,
+				997B4C2706015821001B0407 /* lltoolmgr.h */,
+				997B4C2606015821001B0407 /* lltoolmorph.h */,
+				997B4C2506015821001B0407 /* lltoolobjpicker.h */,
+				997B4C2106015821001B0407 /* lltoolpie.h */,
+				997B4C2006015821001B0407 /* lltoolplacer.h */,
+				997B4C1E06015821001B0407 /* lltoolselect.h */,
+				997B4C1D06015821001B0407 /* lltoolselectland.h */,
+				997B4C1C06015821001B0407 /* lltoolselectrect.h */,
+				997B4C1B06015821001B0407 /* lltoolview.h */,
+				997B4C2406015821001B0407 /* lltracker.h */,
+				997B4C1806015821001B0407 /* lluiconstants.h */,
+				997B4C1506015821001B0407 /* lluploaddialog.h */,
+				997B4C1406015821001B0407 /* llurl.h */,
+				997B4C1306015821001B0407 /* lluserauth.h */,
+				997B4C0E06015821001B0407 /* llvelocitybar.h */,
+				997B4C0B06015821001B0407 /* llviewerbuild.h */,
+				997B4C0A06015821001B0407 /* llviewercamera.h */,
+				91DF405006A73E0C00CA7FE5 /* llviewerdisplay.h */,
+				997B4C0906015821001B0407 /* llviewergesture.h */,
+				997B4C0806015821001B0407 /* llviewerimage.h */,
+				997B4C0706015821001B0407 /* llviewerimagelist.h */,
+				997B4C1206015821001B0407 /* llviewerinventory.h */,
+				997B4C1106015821001B0407 /* llviewerjoint.h */,
+				997B4C1006015821001B0407 /* llviewerjointattachment.h */,
+				997B4C0F06015821001B0407 /* llviewerjointmesh.h */,
+				997B4C0606015821001B0407 /* llviewerjointshape.h */,
+				A3C20E4E0BB0BD49007E872B /* llviewerjoystick.h */,
+				997B4C0506015821001B0407 /* llviewerlayer.h */,
+				997B4C0406015821001B0407 /* llviewermenu.h */,
+				997B4C0306015821001B0407 /* llviewermessage.h */,
+				1A3143DB0A02B70E005B87E7 /* llviewernetwork.h */,
+				997B4C0206015821001B0407 /* llviewerobject.h */,
+				997B4C0106015821001B0407 /* llviewerobjectlist.h */,
+				997B4C0006015821001B0407 /* llviewerparcelmgr.h */,
+				997B4BFF06015821001B0407 /* llviewerparceloverlay.h */,
+				997B4BFE06015821001B0407 /* llviewerpartsim.h */,
+				997B4BFD06015821001B0407 /* llviewerpartsource.h */,
+				997B4BFC06015821001B0407 /* llviewerregion.h */,
+				997B4BFA06015821001B0407 /* llviewerstats.h */,
+				997B4BF906015821001B0407 /* llviewertextureanim.h */,
+				997B4BF806015821001B0407 /* llviewerthrottle.h */,
+				997B4BF706015821001B0407 /* llviewervisualparam.h */,
+				997B4BF606015821001B0407 /* llviewerwindow.h */,
+				997B4BF506015821001B0407 /* llvlcomposition.h */,
+				997B4BF406015821001B0407 /* llvlmanager.h */,
+				997B4BF306015821001B0407 /* llvoavatar.h */,
+				997B4BF206015821001B0407 /* llvocache.h */,
+				997B4BF106015821001B0407 /* llvoclouds.h */,
+				997B4BF006015821001B0407 /* llvograss.h */,
+				997B4BEF06015821001B0407 /* llvoground.h */,
+				997B4BED06015821001B0407 /* llvopartgroup.h */,
+				997B4BEC06015821001B0407 /* llvosky.h */,
+				997B4BEB06015821001B0407 /* llvosurfacepatch.h */,
+				997B4BEA06015821001B0407 /* llvotextbubble.h */,
+				997B4BE906015821001B0407 /* llvotree.h */,
+				997B4BE806015821001B0407 /* llvotreenew.h */,
+				997B4BE706015821001B0407 /* llvovolume.h */,
+				997B4BE606015821001B0407 /* llvowater.h */,
+				997B4BE406015821001B0407 /* llwearable.h */,
+				997B4BE306015821001B0407 /* llwearablelist.h */,
+				1AF7C1F20AF6C45000C4BF4A /* llweb.h */,
+				997B4BE206015821001B0407 /* llwind.h */,
+				997B4BE106015821001B0407 /* llwindebug.h */,
+				997B4BE006015821001B0407 /* llworld.h */,
+				997B4BDF06015821001B0407 /* llworldmap.h */,
+				997B4BDE06015821001B0407 /* llworldmapview.h */,
+				997B4BDC06015821001B0407 /* macmain.h */,
 				FD53B3DB09BDE88B00BFE3BC /* macutil_Prefix.h */,
-				E34C14750AE6A3FF009BF4DE /* llmapresponders.h */,
+				997B4BDB06015821001B0407 /* macview_Prefix.h */,
+				997B4BDA06015821001B0407 /* moviemaker.h */,
+				997B4BD906015821001B0407 /* noise.h */,
+				997B4BD506015820001B0407 /* pipeline.h */,
+				997B4BD406015820001B0407 /* randgauss.h */,
+				997B4BD106015820001B0407 /* VertexCache.h */,
+				997B4BD006015820001B0407 /* viewer.h */,
 			);
 			name = "newview headers";
 			sourceTree = "<group>";
@@ -4149,7 +4138,6 @@
 				5503BB3C05446B20003D051F /* llwind.cpp in Sources */,
 				5503BB3D05446B20003D051F /* llwearablelist.cpp in Sources */,
 				5503BB3E05446B20003D051F /* llwearable.cpp in Sources */,
-				5503BB3F05446B20003D051F /* llwaterpatch.cpp in Sources */,
 				5503BB4005446B20003D051F /* llvowater.cpp in Sources */,
 				5503BB4105446B20003D051F /* llvovolume.cpp in Sources */,
 				5503BB4305446B20003D051F /* llvotree.cpp in Sources */,
@@ -4212,7 +4200,6 @@
 				5503BB9105446B20003D051F /* llfloaterland.cpp in Sources */,
 				5503BB9205446B20003D051F /* llpanelface.cpp in Sources */,
 				5503BB9305446B20003D051F /* llpanelevent.cpp in Sources */,
-				5503BB9405446B20003D051F /* llcountdown.cpp in Sources */,
 				5503BB9505446B20003D051F /* llcontroldef.cpp in Sources */,
 				5503BB9805446B20003D051F /* llframestatview.cpp in Sources */,
 				5503BB9905446B20003D051F /* llframestats.cpp in Sources */,
@@ -4220,7 +4207,6 @@
 				5503BB9E05446B20003D051F /* llhudobject.cpp in Sources */,
 				5503BB9F05446B20003D051F /* llhudmanager.cpp in Sources */,
 				5503BBA005446B20003D051F /* lldrawpoolalpha.cpp in Sources */,
-				5503BBA105446B20003D051F /* lltexturetable.cpp in Sources */,
 				5503BBA205446B20003D051F /* lltexturectrl.cpp in Sources */,
 				5503BBA405446B20003D051F /* llpanelobject.cpp in Sources */,
 				5503BBA505446B20003D051F /* llpanelnetwork.cpp in Sources */,
@@ -4314,7 +4300,6 @@
 				5503BC2105446B20003D051F /* llcolorscheme.cpp in Sources */,
 				5503BC2205446B20003D051F /* llmutelist.cpp in Sources */,
 				5503BC2305446B20003D051F /* llmoveview.cpp in Sources */,
-				5503BC2405446B20003D051F /* llfft.cpp in Sources */,
 				5503BC2505446B20003D051F /* llfloatermap.cpp in Sources */,
 				5503BC2705446B20003D051F /* llregionposition.cpp in Sources */,
 				5503BC2905446B20003D051F /* llasynchostbyname.cpp in Sources */,
@@ -4576,6 +4561,9 @@
 				88A95BB20C14D5FC0027E363 /* llsrv.cpp in Sources */,
 				8833693F0C18AF33007F52DA /* llimagepng.cpp in Sources */,
 				883369400C18AF33007F52DA /* llpngwrapper.cpp in Sources */,
+				1A0DA5130C3AC07800361F49 /* llviewerjointmesh_vec.cpp in Sources */,
+				1A0DA5140C3AC07800361F49 /* llviewerjointmesh_sse2.cpp in Sources */,
+				1A0DA5150C3AC07800361F49 /* llviewerjointmesh_sse.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
diff --git a/linden/indra/newview/newview.vcproj b/linden/indra/newview/newview.vcproj
index ae0c02d..a6d4fa5 100644
--- a/linden/indra/newview/newview.vcproj
+++ b/linden/indra/newview/newview.vcproj
@@ -344,9 +344,6 @@
 				RelativePath=".\llcontroldef.cpp">
 			</File>
 			<File
-				RelativePath=".\llcountdown.cpp">
-			</File>
-			<File
 				RelativePath=".\llcubemap.cpp">
 			</File>
 			<File
@@ -431,9 +428,6 @@
 				RelativePath=".\llfeaturemanager.cpp">
 			</File>
 			<File
-				RelativePath=".\llfft.cpp">
-			</File>
-			<File
 				RelativePath=".\llfilepicker.cpp">
 			</File>
 			<File
@@ -983,9 +977,6 @@
 				RelativePath=".\lltexturefetch.cpp">
 			</File>
 			<File
-				RelativePath=".\lltexturetable.cpp">
-			</File>
-			<File
 				RelativePath=".\lltextureview.cpp">
 			</File>
 			<File
@@ -1109,6 +1100,71 @@
 				RelativePath=".\llviewerjointmesh.cpp">
 			</File>
 			<File
+				RelativePath=".\llviewerjointmesh_sse.cpp">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						EnableEnhancedInstructionSet="1"
+						UsePrecompiledHeader="0"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						EnableEnhancedInstructionSet="1"
+						UsePrecompiledHeader="0"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="ReleaseForDownload|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						EnableEnhancedInstructionSet="1"
+						UsePrecompiledHeader="0"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="ReleaseNoOpt|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						EnableEnhancedInstructionSet="1"
+						UsePrecompiledHeader="0"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath=".\llviewerjointmesh_sse2.cpp">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						EnableEnhancedInstructionSet="2"
+						UsePrecompiledHeader="0"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						EnableEnhancedInstructionSet="2"
+						UsePrecompiledHeader="0"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="ReleaseForDownload|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						EnableEnhancedInstructionSet="2"
+						UsePrecompiledHeader="0"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="ReleaseNoOpt|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						EnableEnhancedInstructionSet="2"
+						UsePrecompiledHeader="0"/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath=".\llviewerjointmesh_vec.cpp">
+			</File>
+			<File
 				RelativePath=".\llviewerjointshape.cpp">
 			</File>
 			<File
@@ -1226,9 +1282,6 @@
 				RelativePath=".\llvowater.cpp">
 			</File>
 			<File
-				RelativePath=".\llwaterpatch.cpp">
-			</File>
-			<File
 				RelativePath=".\llwearable.cpp">
 			</File>
 			<File
@@ -1360,9 +1413,6 @@
 				RelativePath=".\llcontainerview.h">
 			</File>
 			<File
-				RelativePath=".\llcountdown.h">
-			</File>
-			<File
 				RelativePath=".\llcubemap.h">
 			</File>
 			<File
@@ -1447,9 +1497,6 @@
 				RelativePath=".\llfeaturemanager.h">
 			</File>
 			<File
-				RelativePath=".\llfft.h">
-			</File>
-			<File
 				RelativePath=".\llfilepicker.h">
 			</File>
 			<File
@@ -2017,9 +2064,6 @@
 				RelativePath=".\lltexturefetch.h">
 			</File>
 			<File
-				RelativePath=".\lltexturetable.h">
-			</File>
-			<File
 				RelativePath=".\lltextureview.h">
 			</File>
 			<File
@@ -2260,9 +2304,6 @@
 				RelativePath=".\llvowater.h">
 			</File>
 			<File
-				RelativePath=".\llwaterpatch.h">
-			</File>
-			<File
 				RelativePath=".\llwearable.h">
 			</File>
 			<File
diff --git a/linden/indra/newview/newview_vc8.vcproj b/linden/indra/newview/newview_vc8.vcproj
index 445ebd9..5ba125b 100644
--- a/linden/indra/newview/newview_vc8.vcproj
+++ b/linden/indra/newview/newview_vc8.vcproj
@@ -496,10 +496,6 @@
 				>
 			</File>
 			<File
-				RelativePath=".\llcountdown.cpp"
-				>
-			</File>
-			<File
 				RelativePath=".\llcubemap.cpp"
 				>
 			</File>
@@ -612,10 +608,6 @@
 				>
 			</File>
 			<File
-				RelativePath=".\llfft.cpp"
-				>
-			</File>
-			<File
 				RelativePath=".\llfilepicker.cpp"
 				>
 			</File>
@@ -1348,10 +1340,6 @@
 				>
 			</File>
 			<File
-				RelativePath=".\lltexturetable.cpp"
-				>
-			</File>
-			<File
 				RelativePath=".\lltextureview.cpp"
 				>
 			</File>
@@ -1516,6 +1504,95 @@
 				>
 			</File>
 			<File
+				RelativePath=".\llviewerjointmesh_sse.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						EnableEnhancedInstructionSet="1"
+						UsePrecompiledHeader="0"
+						WarnAsError="false"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						EnableEnhancedInstructionSet="1"
+						UsePrecompiledHeader="0"
+						WarnAsError="false"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="ReleaseForDownload|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						EnableEnhancedInstructionSet="1"
+						UsePrecompiledHeader="0"
+						WarnAsError="false"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="ReleaseNoOpt|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						EnableEnhancedInstructionSet="1"
+						UsePrecompiledHeader="0"
+						WarnAsError="false"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath=".\llviewerjointmesh_sse2.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						EnableEnhancedInstructionSet="2"
+						WarnAsError="false"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						EnableEnhancedInstructionSet="2"
+						WarnAsError="false"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="ReleaseForDownload|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						EnableEnhancedInstructionSet="2"
+						WarnAsError="false"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="ReleaseNoOpt|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						EnableEnhancedInstructionSet="2"
+						UsePrecompiledHeader="0"
+						WarnAsError="false"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath=".\llviewerjointmesh_vec.cpp"
+				>
+			</File>
+			<File
 				RelativePath=".\llviewerjointshape.cpp"
 				>
 			</File>
@@ -1672,10 +1749,6 @@
 				>
 			</File>
 			<File
-				RelativePath=".\llwaterpatch.cpp"
-				>
-			</File>
-			<File
 				RelativePath=".\llwearable.cpp"
 				>
 			</File>
@@ -1850,10 +1923,6 @@
 				>
 			</File>
 			<File
-				RelativePath=".\llcountdown.h"
-				>
-			</File>
-			<File
 				RelativePath=".\llcubemap.h"
 				>
 			</File>
@@ -1966,10 +2035,6 @@
 				>
 			</File>
 			<File
-				RelativePath=".\llfft.h"
-				>
-			</File>
-			<File
 				RelativePath=".\llfilepicker.h"
 				>
 			</File>
@@ -2722,10 +2787,6 @@
 				>
 			</File>
 			<File
-				RelativePath=".\lltexturetable.h"
-				>
-			</File>
-			<File
 				RelativePath=".\lltextureview.h"
 				>
 			</File>
@@ -3046,10 +3107,6 @@
 				>
 			</File>
 			<File
-				RelativePath=".\llwaterpatch.h"
-				>
-			</File>
-			<File
 				RelativePath=".\llwearable.h"
 				>
 			</File>
diff --git a/linden/indra/newview/releasenotes.txt b/linden/indra/newview/releasenotes.txt
index 278f022..83fb42f 100644
--- a/linden/indra/newview/releasenotes.txt
+++ b/linden/indra/newview/releasenotes.txt
@@ -1,3 +1,24 @@
+Release Notes for Second Life 1.17.3(0) July 5, 2007
+=====================================
+Changes:
+* Added muting for permissions requests
+* Added viewer channel info to Help > About Second Life...
+
+Bug fixes:
+* SVC-21: Request for making identification of llOwnerSay messages possible
+* VWR-1418: Progressive memory consumption (leak) since 1.17.1
+* VWR-1410: Quirk in net.cpp
+* VWR-1351: Violation against the conding standard in llfloaterchat.cpp
+* VWR-1203: Avatars eyes are constantly crossing in 1.17
+* VWR-1184: [Linux VWR] Signal 7 (SIGBUS) Error (caused by libtcmalloc)
+* VWR-1147: A patch set is provided to add an optional 'Confirm Exit' pop-up window for most user client exit methods. Prevents the 'Accidental Quit'.
+* VWR-605: Include the SL date & day with the time
+* VWR-561: Blurry arrows in camera control and other graphics issues
+* VWR-53: Inconsistency in order of AV texture layer between the upper and lower body
+* Fixed Top Scripts window not refreshing when button is pressed while Top Colliders list is still open
+* Fixed odd text overlay on About Land > General tab
+* Fixed format of llOwnerSay chat text
+
 Release Notes for Second Life 1.17.2(0) June 27, 2007
 =====================================
 Changes:
diff --git a/linden/indra/newview/res/newViewRes.rc b/linden/indra/newview/res/newViewRes.rc
index 5a8c413..bd94933 100644
--- a/linden/indra/newview/res/newViewRes.rc
+++ b/linden/indra/newview/res/newViewRes.rc
@@ -227,8 +227,8 @@ TOOLPIPETTE             CURSOR                  "toolpipette.cur"
 //
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,17,2,0
- PRODUCTVERSION 1,17,2,0
+ FILEVERSION 1,17,3,0
+ PRODUCTVERSION 1,17,3,0
  FILEFLAGSMASK 0x3fL
 #ifdef _DEBUG
  FILEFLAGS 0x1L
@@ -245,12 +245,12 @@ BEGIN
         BEGIN
             VALUE "CompanyName", "Linden Lab"
             VALUE "FileDescription", "Second Life"
-            VALUE "FileVersion", "1.17.2.0"
+            VALUE "FileVersion", "1.17.3.0"
             VALUE "InternalName", "Second Life"
             VALUE "LegalCopyright", "Copyright � 2001-2007, Linden Research, Inc."
             VALUE "OriginalFilename", "SecondLife.exe"
             VALUE "ProductName", "Second Life"
-            VALUE "ProductVersion", "1.17.2.0"
+            VALUE "ProductVersion", "1.17.3.0"
         END
     END
     BLOCK "VarFileInfo"
diff --git a/linden/indra/newview/skins/xui/en-us/alerts.xml b/linden/indra/newview/skins/xui/en-us/alerts.xml
index 6c11a06..319e495 100644
--- a/linden/indra/newview/skins/xui/en-us/alerts.xml
+++ b/linden/indra/newview/skins/xui/en-us/alerts.xml
@@ -1180,17 +1180,6 @@ Please choose the male or female avatar.
 			Female
 		</option>
 	</alert>
-	<alert modal="true" name="ConfirmQuit">
-		<message name="message">
-			Are you sure you want to quit?
-		</message>
-		<option name="Yes">
-			Yes
-		</option>
-		<option name="No">
-			No
-		</option>
-	</alert>
 	<alert modal="true" name="RegionNoTerraforming">
 		<message name="message">
 			The region [REGION] does not allow terraforming.
@@ -4102,6 +4091,20 @@ will only work if a script is added with a money() event.
 			Cancel
 		</option>
 	</alert>
+	<alert modal="true" name="ConfirmQuit">
+		<message name="message">
+			Are you sure you want to quit?
+		</message>
+		<ignore name="ignore">
+			Ignore
+		</ignore>
+		<option name="Quit">
+			Quit
+		</option>
+		<option name="Continue">
+			Continue
+		</option>
+	</alert>
 	<alert modal="true" name="HelpReportAbuseEmailLL" >
 		<message name="message">
 Use this tool to report violations of the Terms of Service 
diff --git a/linden/indra/newview/skins/xui/en-us/panel_login.xml b/linden/indra/newview/skins/xui/en-us/panel_login.xml
index 7df2151..ba4884d 100644
--- a/linden/indra/newview/skins/xui/en-us/panel_login.xml
+++ b/linden/indra/newview/skins/xui/en-us/panel_login.xml
@@ -91,4 +91,10 @@
 	     left="698" mouse_opaque="true" name="version_text" v_pad="0" width="100">
 		1.23.4 (5)
 	</text>
+	<text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
+	     bottom="14" drop_shadow_visible="true" follows="right|bottom"
+	     font="SansSerifSmall" h_pad="0" halign="right" height="12" hidden="false"
+	     left="698" mouse_opaque="true" name="channel_text" v_pad="0" width="300">
+		[Viewer Channel Name]
+	</text>
 </panel>
diff --git a/linden/indra/newview/skins/xui/en-us/panel_status_bar.xml b/linden/indra/newview/skins/xui/en-us/panel_status_bar.xml
index 9feaafc..b584151 100644
--- a/linden/indra/newview/skins/xui/en-us/panel_status_bar.xml
+++ b/linden/indra/newview/skins/xui/en-us/panel_status_bar.xml
@@ -28,7 +28,8 @@
 	     image_unselected="status_buy_currency.tga" label="" label_selected=""
 	     left="-120" mouse_opaque="true" name="buycurrency" scale_image="true"
 	     tool_tip="Buy currency" width="16" />
-	<text type="string" length="12" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
+	<text type="string" length="12" bg_visible="false" border_drop_shadow_visible="false" 
+		 border_visible="false"
 	     bottom="-20" disabled_color="1 1 1 1" drop_shadow_visible="true"
 	     enabled="true" follows="right|bottom" font="SansSerifSmall" h_pad="0"
 	     halign="right" height="18" hidden="false" left="-210" mouse_opaque="true"
@@ -36,6 +37,14 @@
 	     v_pad="2" width="80">
 		12:00 AM
 	</text>
+	
+	<text hidden="true" name="StatBarDaysOfWeek">
+		Sunday:Monday:Tuesday:Wednesday:Thursday:Friday:Saturday
+	</text>
+	<text hidden="true" name="StatBarMonthsOfYear">
+ 		January:February:March:April:May:June:July:August:September:October:November:December
+	</text>
+
 	<button bottom="-18" enabled="true" follows="right|bottom" font="SansSerif"
 	     halign="center" height="16" hidden="false"
 	     image_disabled="status_script_debug.tga"
diff --git a/linden/indra/newview/viewer.cpp b/linden/indra/newview/viewer.cpp
index 7ff6cc3..48108bd 100644
--- a/linden/indra/newview/viewer.cpp
+++ b/linden/indra/newview/viewer.cpp
@@ -205,6 +205,7 @@
 #include "llviewerbuild.h"
 #include "llviewercamera.h"
 #include "llviewercontrol.h"
+#include "llviewerjointmesh.h"
 #include "llviewerimagelist.h"
 #include "llviewerkeyboard.h"
 #include "llviewermenu.h"
@@ -1077,8 +1078,10 @@ int main( int argc, char **argv )
 	// Initialize apple menubar and various callbacks
 	init_apple_menu(gSecondLife.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.
-	if(!gSysCPU.hasSSE())
+	// Only test PowerPC - all Intel Macs have SSE.
+	if(!gSysCPU.hasAltivec())
 	{
 		std::ostringstream msg;
 		msg << gSecondLife << " requires a processor with AltiVec (G4 or later).";
@@ -1089,6 +1092,7 @@ int main( int argc, char **argv )
 		remove_marker_file();
 		return 1;
 	}
+#endif
 	
 #endif // LL_DARWIN
 
@@ -2447,7 +2451,7 @@ static inline bool being_debugged()
 		if (ret != -1)
 		{
 			char buf[1024];
-			size_t n;
+			ssize_t n;
 			
 			n = readlink(name, buf, sizeof(buf) - 1);
 			if (n != -1)
@@ -2899,7 +2903,7 @@ OSErr AEQuitHandler(const AppleEvent *messagein, AppleEvent *reply, long refIn)
 {
 	OSErr result = noErr;
 	
-	app_request_quit();
+	app_user_quit();
 	
 	return(result);
 }
@@ -3171,6 +3175,20 @@ void app_force_quit(const char* launch_file_on_quit)
 	gQuit = TRUE;
 }
 
+static void finish_quit(S32 option, void *userdata)
+{
+	if (option == 0)
+	{
+		app_request_quit();
+	}
+}
+
+void app_user_quit()
+{
+	gViewerWindow->alertXml("ConfirmQuit", finish_quit, NULL);
+}
+
+  
 // Don't quit instantly.  Instead, request to be logged off.
 // Called from control-Q handler, Windows(tm) close-window message (WM_CLOSE), and Mac Quit AppleEvent handler.
 void app_request_quit()
@@ -4980,6 +4998,89 @@ class LLRenderLightingDetailListener: public LLSimpleListener
 };
 static LLRenderLightingDetailListener render_lighting_detail_listener;
 
+
+//-------------------------------------------------------------------
+//-------------------------------------------------------------------
+// Vector Performance Options
+//-------------------------------------------------------------------
+//-------------------------------------------------------------------
+
+// Initially, we test the performance of the vectorization code, then
+// turn it off if it ends up being slower. JC
+BOOL	gVectorizePerfTest	= TRUE;
+BOOL	gVectorizeEnable	= FALSE;
+U32		gVectorizeProcessor	= 0;
+BOOL	gVectorizeSkin		= FALSE;
+
+void update_vector_performances(void)
+{
+	char *vp;
+	
+	switch(gVectorizeProcessor)
+	{
+		case 2: vp = "SSE2"; break;					// *TODO: replace the magic #s
+		case 1: vp = "SSE"; break;
+		default: vp = "COMPILER DEFAULT"; break;
+	}
+	llinfos << "Vectorization         : " << ( gVectorizeEnable ? "ENABLED" : "DISABLED" ) << llendl ;
+	llinfos << "Vector Processor      : " << vp << llendl ;
+	llinfos << "Vectorized Skinning   : " << ( gVectorizeSkin ? "ENABLED" : "DISABLED" ) << llendl ;
+	
+	if(gVectorizeEnable && gVectorizeSkin)
+	{
+		switch(gVectorizeProcessor)
+		{
+			case 2:
+				LLViewerJointMesh::sUpdateGeometryFunc = &LLViewerJointMesh::updateGeometrySSE2;
+				break;
+			case 1:
+				LLViewerJointMesh::sUpdateGeometryFunc = &LLViewerJointMesh::updateGeometrySSE;
+				break;
+			default:
+				LLViewerJointMesh::sUpdateGeometryFunc = &LLViewerJointMesh::updateGeometryVectorized;
+				break;
+		}
+	}
+	else
+	{
+		LLViewerJointMesh::sUpdateGeometryFunc = &LLViewerJointMesh::updateGeometryOriginal;
+	}
+}
+
+
+class LLVectorizationEnableListener: public LLSimpleListener
+{
+	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
+	{
+		gVectorizeEnable = event->getValue().asBoolean();
+		update_vector_performances();
+		return true;
+	}
+};
+static LLVectorizationEnableListener vectorization_enable_listener;
+
+class LLVectorizeSkinListener: public LLSimpleListener
+{
+	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
+	{
+		gVectorizeSkin = event->getValue().asBoolean();
+		update_vector_performances();
+		return true;
+	}
+};
+static LLVectorizeSkinListener vectorize_skin_listener;
+
+class LLVectorProcessorListener: public LLSimpleListener
+{
+	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
+	{
+		gVectorizeProcessor = event->getValue().asInteger();
+		update_vector_performances();
+		return true;
+	}
+};
+static LLVectorProcessorListener vector_processor_listener;
+
 // Use these strictly for things that are constructed at startup,
 // or for things that are performance critical.  JC
 void saved_settings_to_globals()
@@ -5031,6 +5132,38 @@ void saved_settings_to_globals()
 	gHandleKeysAsync = gSavedSettings.getBOOL("AsyncKeyboard");
 	LLHoverView::sShowHoverTips = gSavedSettings.getBOOL("ShowHoverTips");
 
+	if (gSysCPU.hasAltivec())
+	{
+		gSavedSettings.setBOOL("VectorizeEnable", TRUE );
+		gSavedSettings.setU32("VectorizeProcessor", 0 );
+	}
+	else
+	if (gSysCPU.hasSSE2())
+	{
+		gSavedSettings.setBOOL("VectorizeEnable", TRUE );
+		gSavedSettings.setU32("VectorizeProcessor", 2 );
+	}
+	else
+	if (gSysCPU.hasSSE())
+	{
+		gSavedSettings.setBOOL("VectorizeEnable", TRUE );
+		gSavedSettings.setU32("VectorizeProcessor", 1 );
+	}
+	else
+	{
+		// Don't bother testing or running if CPU doesn't support it. JC
+		gSavedSettings.setBOOL("VectorizePerfTest", FALSE );
+		gSavedSettings.setBOOL("VectorizeEnable", FALSE );
+		gSavedSettings.setU32("VectorizeProcessor", 0 );
+		gSavedSettings.setBOOL("VectorizeSkin", FALSE);
+	}
+
+	gVectorizePerfTest = gSavedSettings.getBOOL("VectorizePerfTest");
+	gVectorizeEnable = gSavedSettings.getBOOL("VectorizeEnable");
+	gVectorizeProcessor = gSavedSettings.getU32("VectorizeProcessor");
+	gVectorizeSkin = gSavedSettings.getBOOL("VectorizeSkin");
+	update_vector_performances();
+
 	// Into a global in case we corrupt the list on crash.
 	gCrashBehavior = gCrashSettings.getS32(CRASH_BEHAVIOR_SETTING);
 
@@ -5077,6 +5210,9 @@ void saved_settings_to_globals()
 	gSavedSettings.getControl("FlycamAxis4")->addListener(&joystick_listener);
 	gSavedSettings.getControl("FlycamAxis5")->addListener(&joystick_listener);
 	gSavedSettings.getControl("FlycamAxis6")->addListener(&joystick_listener);
+	gSavedSettings.getControl("VectorizeEnable")->addListener(&vectorization_enable_listener);
+	gSavedSettings.getControl("VectorizeProcessor")->addListener(&vector_processor_listener);
+	gSavedSettings.getControl("VectorizeSkin")->addListener(&vectorize_skin_listener);
 	
 	// gAgent.init() also loads from saved settings.
 }
diff --git a/linden/indra/newview/viewer.h b/linden/indra/newview/viewer.h
index 22edc73..74ca366 100644
--- a/linden/indra/newview/viewer.h
+++ b/linden/indra/newview/viewer.h
@@ -286,6 +286,9 @@ BOOL raycast_for_new_obj_pos( S32 x, S32 y, LLViewerObject** hit_obj, S32* hit_f
 // Saves the final snapshot, but only once.
 void save_final_snapshot(void*);
 
+// Call when user is requesting application to quit, ask for confirmation.
+void app_user_quit();
+
 // Call when user is requesting application to quit.
 void app_request_quit();
 
diff --git a/linden/indra/newview/viewer_manifest.py b/linden/indra/newview/viewer_manifest.py
index 2da4a22..e66af2a 100755
--- a/linden/indra/newview/viewer_manifest.py
+++ b/linden/indra/newview/viewer_manifest.py
@@ -432,8 +432,8 @@ class Linux_i686Manifest(LinuxManifest):
 #                        self.path("libstdc++.so.6")
                         self.path("libuuid.so", "libuuid.so.1")
                         self.path("libSDL-1.2.so.0")
-                        self.path("libtcmalloc.so.0")
-                        self.path("libstacktrace.so.0")
+                        #self.path("libtcmalloc.so.0")
+                        #self.path("libstacktrace.so.0")
 #                        self.path("libllkdu.so", "../bin/libllkdu.so") # llkdu goes in bin for some reason
                         self.end_prefix("lib")
 
-- 
cgit v1.1