obscurestar avatar obscurestar committed ebaad85 Merge

Merged in from viewer-development.

Comments (0)

Files changed (367)

 09984bfa6cae17e0f72d02b75c1b7393c65eecfc 2.7.5-beta1
 e1ed60913230dd64269a7f7fc52cbc6004f6d52c 2.8.0-start
 502f6a5deca9365ddae57db4f1e30172668e171e 2.8.1-start
+c04e68e1b0034fd0a20815ae24c77e5f8428e822 DRTVWR-188
 888768f162d2c0a8de1dcc5fb9a08bd8bd120a6b DRTVWR-175
 2a3965b3ad202df7ea25d2be689291bb14a1280e DRTVWR-155
 6866d9df6efbd441c66451debd376d21211de39c DRTVWR-68_2.7.5-release
 a8057e1b9a1246b434a27405be35e030f7d28b0c 3.3.4-beta3
 4281aa899fb2cedb7a9ca7ce91c5c29d4aa69594 DRTVWR-180
 9cd174d3a54d93d409a7c346a15b8bfb40fc58f4 DRTVWR-184
+47f0d08ba7ade0a3905074009067c6d3df7e16ae DRTVWR-190
 5c08e1d8edd871807153603b690e3ee9dbb548aa DRTVWR-183
 6c75f220b103db1420919c8b635fe53e2177f318 3.3.4-beta4
 ab2ffc547c8a8950ff187c4f6c95e5334fab597b 3.3.4-beta5
 28e100d0379a2b0710c57647a28fc5239d3d7b99 3.3.4-release
+a8b3eca451a9eaab59987efb0ab1c4217e3f2dcc DRTVWR-182
+1f27cdfdc54246484f8afbbe42ce48e954175cbd 3.4.0-beta1
+81f6b745ef27f5915fd07f988fdec9944f2bb73e DRTVWR-186
+78ca0bbf43a92e8914d4cfa87d69a6717ef7d4cf DRTVWR-194
+cc953f00956be52cc64c30637bbeec310eea603f DRTVWR-181
+9ee9387789701d597130f879d9011a4958753862 DRTVWR-189
+ae5c83dd61d2d37c45f1d5b8bf2b036d87599f1b DRTVWR-198
+e9732c739c8a72a590216951505ea9c76a526a84 DRTVWR-193
+33a2fc7a910ae29ff8b4850316ed7fbff9f64d33 DRTVWR-195
+421126293dcbde918e0da027ca0ab9deb5b4fbf2 DRTVWR-192
+4b2c52aecb7a75de31dbb12d9f5b9a251d8707be DRTVWR-191
+7602f61c804a512764e349c034c02ddabeefebc4 DRTVWR-196
 email_status_this_is_os = true
 
 # Limit extent of codeticket updates to revisions after...
-codeticket_since = 2.2.0-release
+codeticket_since = 3.3.0-release
 
 # ========================================
 # Viewer Development
 integration_viewer-development.login_channel = "Second Life Development"
 integration_viewer-development.build_viewer_update_version_manager = false
 integration_viewer-development.email = viewer-development-builds@lists.secondlife.com
-integration_viewer-development.build_enforce_coding_policy = true
-integration_viewer-development.codeticket_add_context = true
+integration_viewer-development.build_enforce_coding_policy = false
+integration_viewer-development.codeticket_add_context = false
 
 viewer-beta.viewer_channel = "Second Life Beta Viewer"
 viewer-beta.login_channel = "Second Life Beta Viewer"
 viewer-beta.build_debug_release_separately = true
 viewer-beta.build_viewer_update_version_manager = true
+viewer-beta.codeticket_add_context = false
 
 viewer-release.viewer_channel = "Second Life Release"
 viewer-release.login_channel = "Second Life Release"
 viewer-release.build_debug_release_separately = true
 viewer-release.build_viewer_update_version_manager = true
+viewer-release.codeticket_add_context = false
 
 # ========================================
 # mesh-development
 viewer-adult-check.build_CYGWIN_Debug = false
 viewer-adult-check.build_viewer_update_version_manager = false
 
-# ================
-# oz
-# ================
+# ========================================
+# viewer-pathfinding
+# ========================================
 
-Snowstorm_viewer-project-review.build_debug_release_separately = true
-Snowstorm_viewer-project-review.codeticket_add_context = true
-Snowstorm_viewer-project-review.viewer_channel = "Project Viewer - Snowstorm Team"
-Snowstorm_viewer-project-review.login_channel = "Project Viewer - Snowstorm Team"
-Snowstorm_viewer-project-review.codeticket_add_context = true
-
-oz_viewer-devreview.build_debug_release_separately = true
-oz_viewer-devreview.codeticket_add_context = false
-oz_viewer-devreview.build_enforce_coding_policy = true
-oz_viewer-devreview.email = oz@lindenlab.com
-
-oz_viewer-trial.build_debug_release_separately = true
-oz_viewer-trial.codeticket_add_context = false
-oz_viewer-trial.build_enforce_coding_policy = true
-oz_viewer-trial.email = oz@lindenlab.com
-
-oz_viewer-beta-review.build_debug_release_separately = true
-oz_viewer-beta-review.codeticket_add_context = false
-oz_viewer-beta-review.viewer_channel = "Second Life Beta Viewer"
-oz_viewer-beta-review.login_channel = "Second Life Beta Viewer"
-oz_viewer-beta-review.email = oz@lindenlab.com
-
-oz_project-7.build_debug_release_separately = true
-oz_project-7.codeticket_add_context = false
-oz_project-7.email = "sldev@catznip.com oz@lindenlab.com"
+viewer-pathfinding.viewer_channel = "Project Viewer - Pathfinding"
+viewer-pathfinding.login_channel = "Project Viewer - Pathfinding"
+viewer-pathfinding.viewer_grid = agni
+viewer-pathfinding.build_debug_release_separately = true
+viewer-pathfinding.build_CYGWIN_Debug = false
+viewer-pathfinding.build_viewer_update_version_manager = false
 
 # =================================================================
 # asset delivery 2010 projects
           </map>
         </map>
       </map>
+      <key>havok-source</key>
+      <map>
+        <key>license</key>
+        <string>havok-ares</string>
+        <key>license_file</key>
+        <string>LICENSES/havok.txt</string>
+        <key>name</key>
+        <string>havok-source</string>
+        <key>platforms</key>
+        <map>
+          <key>darwin</key>
+          <map>
+            <key>archive</key>
+            <map>
+              <key>hash</key>
+              <string>efaf5cb3e861d44518eb03f4c406f03c</string>
+              <key>url</key>
+              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/falcon_3p-havok-source/rev/261536/arch/Darwin/installer/havok_source-2012.1-darwin-20120710.tar.bz2</string>
+            </map>
+            <key>name</key>
+            <string>darwin</string>
+          </map>
+          <key>linux</key>
+          <map>
+            <key>archive</key>
+            <map>
+              <key>hash</key>
+              <string>50037fff3fd3356a073cdae88348c9ab</string>
+              <key>url</key>
+              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/falcon_3p-havok-source/rev/261536/arch/Linux/installer/havok_source-2012.1-linux-20120711.tar.bz2</string>
+            </map>
+            <key>name</key>
+            <string>linux</string>
+          </map>
+          <key>windows</key>
+          <map>
+            <key>archive</key>
+            <map>
+              <key>hash</key>
+              <string>cd6638f5a03469654615730c16889a60</string>
+              <key>url</key>
+              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/falcon_3p-havok-source/rev/261536/arch/CYGWIN/installer/havok_source-2012.1-windows-20120710.tar.bz2</string>
+            </map>
+            <key>name</key>
+            <string>windows</string>
+          </map>
+        </map>
+      </map>
       <key>jpeglib</key>
       <map>
         <key>license</key>
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>d91e1f483209cd3eba04135c6a59e829</string>
+              <string>a5b2dff0d97b643227a58473e5c57906</string>
               <key>url</key>
-              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-kdu-private/rev/221672/arch/Darwin/installer/kdu-6.4.1-darwin-20110218.tar.bz2</string>
+              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-kdu-private/rev/256978/arch/Darwin/installer/kdu-7.0.0-darwin-20120515.tar.bz2</string>
             </map>
             <key>name</key>
             <string>darwin</string>
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>6cd9f36465ef73a3df34bf2b3bba2ced</string>
+              <string>6d80d35524e1c0c32d3385014d02d48c</string>
               <key>url</key>
-              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-kdu-private/rev/221672/arch/CYGWIN/installer/kdu-6.4.1-windows-20110218.tar.bz2</string>
+              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-kdu-private/rev/256978/arch/CYGWIN/installer/kdu-7.0.0-windows-20120515.tar.bz2</string>
             </map>
             <key>name</key>
             <string>windows</string>
           </map>
         </map>
       </map>
-      <key>llconvexdecomposition</key>
+      <key>llphysicsextensions_source</key>
       <map>
         <key>license</key>
-        <string>havok</string>
+        <string>TEMPORARY</string>
+        <key>license_file</key>
+        <string>LICENSES/llphysicsextensions.txt</string>
         <key>name</key>
-        <string>llconvexdecomposition</string>
+        <string>llphysicsextensions_source</string>
         <key>platforms</key>
         <map>
           <key>darwin</key>
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>362654a472ef7368d4c803ae3fb89d95</string>
+              <string>0578fa67ef9906c6aaa326f51db2669f</string>
+              <key>hash_algorithm</key>
+              <string>md5</string>
               <key>url</key>
-              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-llconvexdecomposition/rev/238959/arch/Darwin/installer/llconvexdecomposition-0.1-darwin-20110819.tar.bz2</string>
+              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/llphysicsextensions-source/rev/263415/arch/Darwin/installer/llphysicsextensions_source-0.3-darwin-20120814.tar.bz2</string>
             </map>
             <key>name</key>
             <string>darwin</string>
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>c7801d899daec5338fbe95053255b7e7</string>
+              <string>b706fdeed4ce2182d434043dc33d9d1d</string>
               <key>url</key>
-              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-llconvexdecomposition/rev/238959/arch/Linux/installer/llconvexdecomposition-0.1-linux-20110819.tar.bz2</string>
+              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/llphysicsextensions-source/rev/263415/arch/Linux/installer/llphysicsextensions_source-0.3-linux-20120814.tar.bz2</string>
             </map>
             <key>name</key>
             <string>linux</string>
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>6ecf2f85f03c5ae87fe45769566a5660</string>
+              <string>0cebd359ea732a7db363d88f9886a1ef</string>
               <key>url</key>
-              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-llconvexdecomposition/rev/238959/arch/CYGWIN/installer/llconvexdecomposition-0.1-windows-20110819.tar.bz2</string>
+              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/llphysicsextensions-source/rev/263415/arch/CYGWIN/installer/llphysicsextensions_source-0.3-windows-20120814.tar.bz2</string>
             </map>
             <key>name</key>
             <string>windows</string>
           </map>
         </map>
+        <key>version</key>
+        <string>0.2</string>
       </map>
-      <key>llconvexdecompositionstub</key>
+      <key>llphysicsextensions_stub</key>
       <map>
         <key>license</key>
-        <string>lgpl</string>
+        <string>TEMPORARY</string>
         <key>license_file</key>
-        <string>LICENSES/LLConvexDecompositionStubLicense.txt</string>
+        <string>LICENSES/llphysicsextensions.txt</string>
         <key>name</key>
-        <string>llconvexdecompositionstub</string>
+        <string>llphysicsextensions_stub</string>
         <key>platforms</key>
         <map>
           <key>darwin</key>
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>a5f53e09f67271fd50f1131ffdda9d27</string>
+              <string>3ae798d4dfb54a1d806ee5f8b31f7626</string>
+              <key>hash_algorithm</key>
+              <string>md5</string>
               <key>url</key>
-              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llconvexdecompositionstub/rev/238958/arch/Darwin/installer/llconvexdecompositionstub-0.3-darwin-20110819.tar.bz2</string>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/llphysicsextensions-stub/rev/263415/arch/Darwin/installer/llphysicsextensions_stub-0.3-darwin-20120814.tar.bz2</string>
             </map>
             <key>name</key>
             <string>darwin</string>
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>0006a964f1497f55a5f181b7042d2d22</string>
+              <string>aa8a2f25e8629cf5e6a96cc0eb93de8e</string>
               <key>url</key>
-              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llconvexdecompositionstub/rev/238958/arch/Linux/installer/llconvexdecompositionstub-0.3-linux-20110819.tar.bz2</string>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/llphysicsextensions-stub/rev/263415/arch/Linux/installer/llphysicsextensions_stub-0.3-linux-20120814.tar.bz2</string>
             </map>
             <key>name</key>
             <string>linux</string>
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>b859e7e3bb03ebb467f0309f46422995</string>
+              <string>3ea4cee6a8dd4c89fbfd3ad6abd703c2</string>
               <key>url</key>
-              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llconvexdecompositionstub/rev/238958/arch/CYGWIN/installer/llconvexdecompositionstub-0.3-windows-20110819.tar.bz2</string>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/llphysicsextensions-stub/rev/263415/arch/CYGWIN/installer/llphysicsextensions_stub-0.3-windows-20120814.tar.bz2</string>
             </map>
             <key>name</key>
             <string>windows</string>
           </map>
         </map>
+        <key>version</key>
+        <string>0.2</string>
       </map>
       <key>llqtwebkit</key>
       <map>
   end_section "Pre$variant"
 }
 
+package_llphysicsextensions_tpv()
+{
+  begin_section "PhysicsExtensions_TPV"
+  tpv_status=0
+  if [ "$variant" = "Release" ]
+  then 
+      llpetpvcfg=$build_dir/packages/llphysicsextensions/autobuild-tpv.xml
+      "$AUTOBUILD" build --verbose --config-file $llpetpvcfg -c Tpv
+      
+      # capture the package file name for use in upload later...
+      PKGTMP=`mktemp -t pgktpv.XXXXXX`
+      trap "rm $PKGTMP* 2>/dev/null" 0
+      "$AUTOBUILD" package --verbose --config-file $llpetpvcfg > $PKGTMP
+      tpv_status=$?
+      sed -n -e 's/^wrote *//p' $PKGTMP > $build_dir/llphysicsextensions_package
+  else
+      echo "Do not provide llphysicsextensions_tpv for $variant"
+      llphysicsextensions_package=""
+  fi
+  end_section "PhysicsExtensions_TPV"
+  return $tpv_status
+}
+
 build()
 {
   local variant="$1"
   if $build_viewer
   then
     begin_section "Viewer$variant"
-
     check_for "Before 'autobuild build'" ${build_dir}/packages/dictionaries
 
-    if "$AUTOBUILD" build --no-configure -c $variant
+    "$AUTOBUILD" build --no-configure -c $variant
+    viewer_build_ok=$?
+    end_section "Viewer$variant"
+    package_llphysicsextensions_tpv
+    tpvlib_build_ok=$?
+    if [ $viewer_build_ok -eq 0 -a $tpvlib_build_ok -eq 0 ]
     then
       echo true >"$build_dir"/build_ok
     else
     fi
     check_for "After 'autobuild configure'" ${build_dir}/packages/dictionaries
 
-    end_section "Viewer$variant"
   fi
 }
 
   mkdir -p "$build_dir"
   mkdir -p "$build_dir/tmp"
 
-  # Install packages.
-  begin_section "AutobuildInstall" 
-  "$AUTOBUILD" install --verbose --skip-license-check
-  end_section "AutobuildInstall" 
-
   if pre_build "$variant" "$build_dir" >> "$build_log" 2>&1
   then
     if $build_link_parallel
       upload_item quicklink "$package" binary/octet-stream
       [ -f summary.json ] && upload_item installer summary.json text/plain
 
-      # Upload crash reporter files.
       case "$last_built_variant" in
       Release)
+        # Upload crash reporter files
         for symbolfile in $symbolfiles
         do
           upload_item symbolfile "$build_dir/$symbolfile" binary/octet-stream
         done
+        
+        # Upload the llphysicsextensions_tpv package, if one was produced
+        if [ -r "$build_dir/llphysicsextensions_package" ]
+        then
+            llphysicsextensions_package=$(cat $build_dir/llphysicsextensions_package)
+            upload_item private_artifact "$llphysicsextensions_package" binary/octet-stream
+        else
+            echo "No llphysicsextensions_package"
+        fi
+        ;;
+      *)
+        echo "Skipping mapfile for $last_built_variant"
         ;;
       esac
 
 					<key>trusted-sender</key>
 					<boolean>true</boolean>
 				</map>
-				
-				<!-- UDPDeprecated Messages -->
+
+        <key>NavMeshStatusUpdate</key>
+        <map>
+          <key>flavor</key>
+          <string>llsd</string>
+          <key>trusted-sender</key>
+          <boolean>true</boolean>
+        </map>
+
+        <key>AgentStateUpdate</key>
+        <map>
+          <key>flavor</key>
+          <string>llsd</string>
+          <key>trusted-sender</key>
+          <boolean>true</boolean>
+        </map>
+
+        <!-- UDPDeprecated Messages -->
 				<key>ScriptRunningReply</key>
 				<map>
 					<key>flavor</key>
Add a comment to this file

indra/cmake/00-Common.cmake

File contents unchanged.

indra/cmake/CMakeLists.txt

     LLAudio.cmake
     LLCharacter.cmake
     LLCommon.cmake
-    LLConvexDecomposition.cmake
     LLCrashLogger.cmake
     LLDatabase.cmake
     LLImage.cmake
     LLMessage.cmake
     LLPlugin.cmake
     LLPrimitive.cmake
+    LLPhysicsExtensions.cmake
     LLRender.cmake
     LLScene.cmake
     LLTestCommand.cmake

indra/cmake/Havok.cmake

+# -*- cmake -*-
+
+use_prebuilt_binary(havok-source)
+set(Havok_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/havok/Source)
+list(APPEND Havok_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/havok/Demo)
+
+set(HAVOK_DEBUG_LIBRARY_PATH ${LIBS_PREBUILT_DIR}/lib/debug/havok-fulldebug)
+set(HAVOK_RELEASE_LIBRARY_PATH ${LIBS_PREBUILT_DIR}/lib/release/havok)
+
+if (LL_DEBUG_HAVOK)
+   if (WIN32)
+      # Always link relwithdebinfo to havok-hybrid on windows.
+      set(HAVOK_RELWITHDEBINFO_LIBRARY_PATH ${LIBS_PREBUILT_DIR}/lib/debug/havok-hybrid)
+   else (WIN32)
+      set(HAVOK_RELWITHDEBINFO_LIBRARY_PATH ${LIBS_PREBUILT_DIR}/lib/debug/havok-fulldebug)
+   endif (WIN32)
+else (LL_DEBUG_HAVOK)
+   set(HAVOK_RELWITHDEBINFO_LIBRARY_PATH ${LIBS_PREBUILT_DIR}/lib/release/havok)
+endif (LL_DEBUG_HAVOK)
+
+set(HAVOK_LIBS
+    hkBase
+    hkCompat
+    hkGeometryUtilities
+    hkInternal
+    hkSerialize
+    hkSceneData
+    hkpCollide
+    hkpUtilities
+    hkpConstraintSolver
+    hkpDynamics
+    hkpInternal
+    hkaiInternal
+    hkaiPathfinding
+    hkaiAiPhysicsBridge
+    hkcdInternal
+    hkcdCollide
+    hkpVehicle
+    hkVisualize
+    hkaiVisualize
+    hkgpConvexDecomposition
+)
+
+unset(HK_DEBUG_LIBRARIES)
+unset(HK_RELEASE_LIBRARIES)
+unset(HK_RELWITHDEBINFO_LIBRARIES)
+
+foreach(HAVOK_LIB ${HAVOK_LIBS})
+        find_library(HAVOK_DEBUG_LIB_${HAVOK_LIB}   ${HAVOK_LIB} PATHS ${HAVOK_DEBUG_LIBRARY_PATH})
+        find_library(HAVOK_RELEASE_LIB_${HAVOK_LIB} ${HAVOK_LIB} PATHS ${HAVOK_RELEASE_LIBRARY_PATH})
+        find_library(HAVOK_RELWITHDEBINFO_LIB_${HAVOK_LIB} ${HAVOK_LIB} PATHS ${HAVOK_RELWITHDEBINFO_LIBRARY_PATH})
+        
+        if(LINUX)
+            set(cmd "mkdir")
+            set(debug_dir "${HAVOK_DEBUG_LIBRARY_PATH}/${HAVOK_LIB}")
+            set(release_dir "${HAVOK_RELEASE_LIBRARY_PATH}/${HAVOK_LIB}")
+            set(relwithdebinfo_dir "${HAVOK_RELWITHDEBINFO_LIBRARY_PATH}/${HAVOK_LIB}")
+
+            exec_program( ${cmd} ${HAVOK_DEBUG_LIBRARY_PATH} ARGS ${debug_dir} OUTPUT_VARIABLE rv)
+            exec_program( ${cmd} ${HAVOK_RELEASE_LIBRARY_PATH} ARGS ${release_dir} OUTPUT_VARIABLE rv)
+            exec_program( ${cmd} ${HAVOK_RELWITHDEBINFO_LIBRARY_PATH} ARGS ${relwithdebinfo_dir} OUTPUT_VARIABLE rv)
+
+            set(cmd "ar")
+            set(arg " -xv")
+            set(arg "${arg} ../lib${HAVOK_LIB}.a")
+            exec_program( ${cmd} ${debug_dir} ARGS ${arg} OUTPUT_VARIABLE rv)
+            exec_program( ${cmd} ${release_dir} ARGS ${arg} OUTPUT_VARIABLE rv)
+            exec_program( ${cmd} ${relwithdebinfo_dir} ARGS ${arg} OUTPUT_VARIABLE rv)
+
+            file(GLOB extracted_debug "${debug_dir}/*.o")
+            file(GLOB extracted_release "${release_dir}/*.o")
+            file(GLOB extracted_relwithdebinfo "${relwithdebinfo_dir}/*.o")
+            list(APPEND HK_DEBUG_LIBRARIES ${extracted_debug})
+            list(APPEND HK_RELEASE_LIBRARIES ${extracted_release})
+            list(APPEND HK_RELWITHDEBINFO_LIBRARIES ${extracted_relwithdebinfo})
+        else(LINUX)
+        # Win32
+            list(APPEND HK_DEBUG_LIBRARIES   ${HAVOK_DEBUG_LIB_${HAVOK_LIB}})
+            list(APPEND HK_RELEASE_LIBRARIES ${HAVOK_RELEASE_LIB_${HAVOK_LIB}})
+            list(APPEND HK_RELWITHDEBINFO_LIBRARIES ${HAVOK_RELWITHDEBINFO_LIB_${HAVOK_LIB}})
+        endif (LINUX)
+endforeach(HAVOK_LIB)
+

indra/cmake/LLAddBuildTest.cmake

   endif(TEST_DEBUG)
   ADD_EXECUTABLE(INTEGRATION_TEST_${testname} ${source_files})
   SET_TARGET_PROPERTIES(INTEGRATION_TEST_${testname} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${EXE_STAGING_DIR}")
+  if (WINDOWS)
+    set_target_properties(INTEGRATION_TEST_${testname}
+      PROPERTIES 
+      LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:WINDOWS /INCLUDE:__tcmalloc"
+      LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMT;LIBCMTD;MSVCRT\" /INCREMENTAL:NO"
+      LINK_FLAGS_RELEASE ""
+      )
+  endif(WINDOWS)
+
   if(STANDALONE)
     SET_TARGET_PROPERTIES(INTEGRATION_TEST_${testname} PROPERTIES COMPILE_FLAGS -I"${TUT_INCLUDE_DIR}")
   endif(STANDALONE)

indra/cmake/LLCommon.cmake

 
 add_definitions(${TCMALLOC_FLAG})
 
-set(LLCOMMON_LINK_SHARED ON CACHE BOOL "Build the llcommon target as a shared library.")
+set(LLCOMMON_LINK_SHARED OFF CACHE BOOL "Build the llcommon target as a shared library.")
 if(LLCOMMON_LINK_SHARED)
   add_definitions(-DLL_COMMON_LINK_SHARED=1)
 endif(LLCOMMON_LINK_SHARED)

indra/cmake/LLConvexDecomposition.cmake

-# -*- cmake -*-
-include(Prebuilt)
-
-set(LLCONVEXDECOMP_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
-  
-if (INSTALL_PROPRIETARY AND NOT STANDALONE)
-  use_prebuilt_binary(llconvexdecomposition)
-  set(LLCONVEXDECOMP_LIBRARY llconvexdecomposition)
-else (INSTALL_PROPRIETARY AND NOT STANDALONE)
-  use_prebuilt_binary(llconvexdecompositionstub)
-  set(LLCONVEXDECOMP_LIBRARY llconvexdecompositionstub)
-endif (INSTALL_PROPRIETARY AND NOT STANDALONE)

indra/cmake/LLPhysicsExtensions.cmake

+# -*- cmake -*-
+include(Prebuilt)
+
+# There are three possible solutions to provide the llphysicsextensions:
+# - The full source package, selected by -DHAVOK:BOOL=ON
+# - The stub source package, selected by -DHAVOK:BOOL=OFF 
+# - The prebuilt package available to those with sublicenses, selected by -DHAVOK_TPV:BOOL=ON
+
+if (INSTALL_PROPRIETARY)
+   set(HAVOK ON CACHE BOOL "Use Havok physics library")
+endif (INSTALL_PROPRIETARY)
+
+
+# Note that the use_prebuilt_binary macros below do not in fact include binaries;
+# the llphysicsextensions_* packages are source only and are built here.
+# The source package and the stub package both build libraries of the same name.
+
+if (HAVOK)
+   include(Havok)
+   use_prebuilt_binary(llphysicsextensions_source)
+   set(LLPHYSICSEXTENSIONS_SRC_DIR ${LIBS_PREBUILT_DIR}/llphysicsextensions/src)
+   set(LLPHYSICSEXTENSIONS_LIBRARIES    llphysicsextensions)
+
+elseif (HAVOK_TPV)
+   use_prebuilt_binary(llphysicsextensions_tpv)
+   set(LLPHYSICSEXTENSIONS_LIBRARIES    llphysicsextensions_tpv)
+
+else (HAVOK)
+   use_prebuilt_binary(llphysicsextensions_stub)
+   set(LLPHYSICSEXTENSIONS_SRC_DIR ${LIBS_PREBUILT_DIR}/llphysicsextensions/stub)
+   set(LLPHYSICSEXTENSIONS_LIBRARIES    llphysicsextensionsstub)
+
+endif (HAVOK)
+
+set(LLPHYSICSEXTENSIONS_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/llphysicsextensions)

indra/cmake/Linking.cmake

   # packages/lib/release directory to deal with autobuild packages that don't
   # provide (e.g.) lib/debug libraries.
   list(APPEND AUTOBUILD_LIBS_INSTALL_DIRS ${ARCH_PREBUILT_DIRS_RELEASE})
-  message(STATUS "CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE}, extending AUTOBUILD_LIBS_INSTALL_DIRS")
 endif (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Release")
-message(STATUS "For ${CMAKE_BUILD_TYPE}, AUTOBUILD_LIBS_INSTALL_DIRS: ${AUTOBUILD_LIBS_INSTALL_DIRS}")
+
 link_directories(${AUTOBUILD_LIBS_INSTALL_DIRS})
 
 if (LINUX)
Add a comment to this file

indra/cmake/Variables.cmake

File contents unchanged.

indra/cmake/ViewerMiscLibs.cmake

   use_prebuilt_binary(fontconfig)
 endif(NOT STANDALONE)
 
-if(VIEWER AND NOT STANDALONE)
-  if(EXISTS ${CMAKE_SOURCE_DIR}/newview/res/have_artwork_bundle.marker)
-    message(STATUS "We seem to have an artwork bundle in the tree - brilliant.")
-  else(EXISTS ${CMAKE_SOURCE_DIR}/newview/res/have_artwork_bundle.marker)
-    message(FATAL_ERROR "Didn't find an artwork bundle - this needs to be downloaded separately and unpacked into this tree.  You can probably get it from the same place you got your viewer source.  Thanks!")
-  endif(EXISTS ${CMAKE_SOURCE_DIR}/newview/res/have_artwork_bundle.marker)
-endif(VIEWER AND NOT STANDALONE)

indra/llcommon/CMakeLists.txt

     llfoldertype.h
     llformat.h
     llframetimer.h
+    llhandle.h
     llhash.h
     llheartbeat.h
     llhttpstatuscodes.h

indra/llcommon/indra_constants.h

 	STAT_FILTER_BY_PARCEL	= 0x00000001,
 	STAT_FILTER_BY_OWNER	= 0x00000002,
 	STAT_FILTER_BY_OBJECT	= 0x00000004,
+	STAT_FILTER_BY_PARCEL_NAME	= 0x00000008,
 	STAT_REQUEST_LAST_ENTRY	= 0x80000000,
 };
 

indra/llcommon/llcursortypes.cpp

 		cursor_string_table["UI_CURSOR_TOOLSIT"] = UI_CURSOR_TOOLSIT;
 		cursor_string_table["UI_CURSOR_TOOLBUY"] = UI_CURSOR_TOOLBUY;
 		cursor_string_table["UI_CURSOR_TOOLOPEN"] = UI_CURSOR_TOOLOPEN;
+		cursor_string_table["UI_CURSOR_TOOLPATHFINDING"] = UI_CURSOR_TOOLPATHFINDING;
+		cursor_string_table["UI_CURSOR_TOOLPATHFINDINGPATHSTART"] = UI_CURSOR_TOOLPATHFINDING_PATH_START;
+		cursor_string_table["UI_CURSOR_TOOLPATHFINDINGPATHSTARTADD"] = UI_CURSOR_TOOLPATHFINDING_PATH_START_ADD;
+		cursor_string_table["UI_CURSOR_TOOLPATHFINDINGPATHEND"] = UI_CURSOR_TOOLPATHFINDING_PATH_END;
+		cursor_string_table["UI_CURSOR_TOOLPATHFINDINGPATHENDADD"] = UI_CURSOR_TOOLPATHFINDING_PATH_END_ADD;
+		cursor_string_table["UI_CURSOR_TOOLNO"] = UI_CURSOR_TOOLNO;
 	}
 
 	std::map<std::string,U32>::const_iterator iter = cursor_string_table.find(cursor_string);

indra/llcommon/llcursortypes.h

 	UI_CURSOR_TOOLSIT,
 	UI_CURSOR_TOOLBUY,
 	UI_CURSOR_TOOLOPEN,
+	UI_CURSOR_TOOLPATHFINDING,
+	UI_CURSOR_TOOLPATHFINDING_PATH_START,
+	UI_CURSOR_TOOLPATHFINDING_PATH_START_ADD,
+	UI_CURSOR_TOOLPATHFINDING_PATH_END,
+	UI_CURSOR_TOOLPATHFINDING_PATH_END_ADD,
+	UI_CURSOR_TOOLNO,
 	UI_CURSOR_COUNT			// Number of elements in this enum (NOT a cursor)
 };
 

indra/llcommon/llerror.cpp

 	}
 	
 	
-	void commonInit(const std::string& dir)
+	void commonInit(const std::string& dir, bool log_to_stderr = true)
 	{
 		LLError::Settings::reset();
 		
 		LLError::setFatalFunction(LLError::crashAndLoop);
 		LLError::setTimeFunction(LLError::utcTime);
 
-		if (shouldLogToStderr())
+		// log_to_stderr is only false in the unit and integration tests to keep builds quieter
+		if (log_to_stderr && shouldLogToStderr())
 		{
 			LLError::addRecorder(new RecordToStderr(stderrLogWantsTime()));
 		}
 #endif
 	}
 
-	void initForApplication(const std::string& dir)
+	void initForApplication(const std::string& dir, bool log_to_stderr)
 	{
-		commonInit(dir);
+		commonInit(dir, log_to_stderr);
 	}
 
 	void setPrintLocation(bool print)

indra/llcommon/llerror.h

 #include "stdtypes.h"
 
 
-/* Error Logging Facility
+/** Error Logging Facility
 
 	Information for most users:
 	
 	even release.  Which means you can use them to help debug even when deployed
 	to a real grid.
 */
-
 namespace LLError
 {
 	enum ELevel
 		CallSite(ELevel, const char* file, int line,
 				const std::type_info& class_info, const char* function, const char* broadTag, const char* narrowTag, bool printOnce);
 						
+#ifdef LL_LIBRARY_INCLUDE
+		bool shouldLog();
+#else // LL_LIBRARY_INCLUDE
 		bool shouldLog()
 			{ return mCached ? mShouldLog : Log::shouldLog(*this); }
 			// this member function needs to be in-line for efficiency
+#endif // LL_LIBRARY_INCLUDE
 		
 		void invalidate();
 		

indra/llcommon/llerrorcontrol.h

 		// logs to stderr, syslog, and windows debug log
 		// the identity string is used for in the syslog
 
-	LL_COMMON_API void initForApplication(const std::string& dir);
+	LL_COMMON_API void initForApplication(const std::string& dir, bool log_to_stderr = true);
 		// resets all logging settings to defaults needed by applicaitons
 		// logs to stderr and windows debug log
 		// sets up log configuration from the file logcontrol.xml in dir

indra/llcommon/llhandle.h

+/** 
+* @file llhandle.h
+* @brief "Handle" to an object (usually a floater) whose lifetime you don't
+* control.
+*
+* $LicenseInfo:firstyear=2001&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2010, Linden Research, Inc.
+* 
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation;
+* version 2.1 of the License only.
+* 
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+* Lesser General Public License for more details.
+* 
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+* 
+* Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+* $/LicenseInfo$
+*/
+#ifndef LLHANDLE_H
+#define LLHANDLE_H
+
+#include "llpointer.h"
+#include <boost/type_traits/is_convertible.hpp>
+#include <boost/utility/enable_if.hpp>
+
+/**
+ * Helper object for LLHandle. Don't instantiate these directly, used
+ * exclusively by LLHandle.
+ */
+class LLTombStone : public LLRefCount
+{
+public:
+	LLTombStone(void* target = NULL) : mTarget(target) {}
+
+	void setTarget(void* target) { mTarget = target; }
+	void* getTarget() const { return mTarget; }
+private:
+	mutable void* mTarget;
+};
+
+/**
+ *	LLHandles are used to refer to objects whose lifetime you do not control or influence.  
+ *	Calling get() on a handle will return a pointer to the referenced object or NULL, 
+ *	if the object no longer exists.  Note that during the lifetime of the returned pointer, 
+ *	you are assuming that the object will not be deleted by any action you perform, 
+ *	or any other thread, as normal when using pointers, so avoid using that pointer outside of
+ *	the local code block.
+ * 
+ *  https://wiki.lindenlab.com/mediawiki/index.php?title=LLHandle&oldid=79669
+ *
+ * The implementation is like some "weak pointer" implementations. When we
+ * can't control the lifespan of the referenced object of interest, we can
+ * still instantiate a proxy object whose lifespan we DO control, and store in
+ * the proxy object a dumb pointer to the actual target. Then we just have to
+ * ensure that on destruction of the target object, the proxy's dumb pointer
+ * is set NULL.
+ *
+ * LLTombStone is our proxy object. LLHandle contains an LLPointer to the
+ * LLTombStone, so every copy of an LLHandle increments the LLTombStone's ref
+ * count as usual.
+ *
+ * One copy of the LLHandle, specifically the LLRootHandle, must be stored in
+ * the referenced object. Destroying the LLRootHandle is what NULLs the
+ * proxy's target pointer.
+ *
+ * Minor optimization: we want LLHandle's mTombStone to always be a valid
+ * LLPointer, saving some conditionals in dereferencing. That's the
+ * getDefaultTombStone() mechanism. The default LLTombStone object's target
+ * pointer is always NULL, so it's semantically identical to allowing
+ * mTombStone to be invalid.
+ */
+template <typename T>
+class LLHandle
+{
+	template <typename U> friend class LLHandle;
+	template <typename U> friend class LLHandleProvider;
+public:
+	LLHandle() : mTombStone(getDefaultTombStone()) {}
+
+	template<typename U>
+	LLHandle(const LLHandle<U>& other, typename boost::enable_if< typename boost::is_convertible<U*, T*> >::type* dummy = 0)
+	: mTombStone(other.mTombStone)
+	{}
+
+	bool isDead() const 
+	{ 
+		return mTombStone->getTarget() == NULL; 
+	}
+
+	void markDead() 
+	{ 
+		mTombStone = getDefaultTombStone();
+	}
+
+	T* get() const
+	{
+		return reinterpret_cast<T*>(mTombStone->getTarget());
+	}
+
+	friend bool operator== (const LLHandle<T>& lhs, const LLHandle<T>& rhs)
+	{
+		return lhs.mTombStone == rhs.mTombStone;
+	}
+	friend bool operator!= (const LLHandle<T>& lhs, const LLHandle<T>& rhs)
+	{
+		return !(lhs == rhs);
+	}
+	friend bool	operator< (const LLHandle<T>& lhs, const LLHandle<T>& rhs)
+	{
+		return lhs.mTombStone < rhs.mTombStone;
+	}
+	friend bool	operator> (const LLHandle<T>& lhs, const LLHandle<T>& rhs)
+	{
+		return lhs.mTombStone > rhs.mTombStone;
+	}
+
+protected:
+	LLPointer<LLTombStone> mTombStone;
+
+private:
+	typedef T* pointer_t;
+	static LLPointer<LLTombStone>& getDefaultTombStone()
+	{
+		static LLPointer<LLTombStone> sDefaultTombStone = new LLTombStone;
+		return sDefaultTombStone;
+	}
+};
+
+/**
+ * LLRootHandle isa LLHandle which must be stored in the referenced object.
+ * You can either store it directly and explicitly bind(this), or derive from
+ * LLHandleProvider (q.v.) which automates that for you. The essential point
+ * is that destroying the LLRootHandle (as a consequence of destroying the
+ * referenced object) calls unbind(), setting the LLTombStone's target pointer
+ * NULL.
+ */
+template <typename T>
+class LLRootHandle : public LLHandle<T>
+{
+public:
+	typedef LLRootHandle<T> self_t;
+	typedef LLHandle<T> base_t;
+
+	LLRootHandle(T* object) { bind(object); }
+	LLRootHandle() {};
+	~LLRootHandle() { unbind(); }
+
+	// this is redundant, since an LLRootHandle *is* an LLHandle
+	//LLHandle<T> getHandle() { return LLHandle<T>(*this); }
+
+	void bind(T* object) 
+	{ 
+		// unbind existing tombstone
+		if (LLHandle<T>::mTombStone.notNull())
+		{
+			if (LLHandle<T>::mTombStone->getTarget() == (void*)object) return;
+			LLHandle<T>::mTombStone->setTarget(NULL);
+		}
+		// tombstone reference counted, so no paired delete
+		LLHandle<T>::mTombStone = new LLTombStone((void*)object);
+	}
+
+	void unbind() 
+	{
+		LLHandle<T>::mTombStone->setTarget(NULL);
+	}
+
+	//don't allow copying of root handles, since there should only be one
+private:
+	LLRootHandle(const LLRootHandle& other) {};
+};
+
+/**
+ * Use this as a mixin for simple classes that need handles and when you don't
+ * want handles at multiple points of the inheritance hierarchy
+ */
+template <typename T>
+class LLHandleProvider
+{
+public:
+	LLHandle<T> getHandle() const
+	{ 
+		// perform lazy binding to avoid small tombstone allocations for handle
+		// providers whose handles are never referenced
+		mHandle.bind(static_cast<T*>(const_cast<LLHandleProvider<T>* >(this))); 
+		return mHandle; 
+	}
+
+protected:
+	typedef LLHandle<T> handle_type_t;
+	LLHandleProvider() 
+	{
+		// provided here to enforce T deriving from LLHandleProvider<T>
+	} 
+
+	template <typename U>
+	LLHandle<U> getDerivedHandle(typename boost::enable_if< typename boost::is_convertible<U*, T*> >::type* dummy = 0) const
+	{
+		LLHandle<U> downcast_handle;
+		downcast_handle.mTombStone = getHandle().mTombStone;
+		return downcast_handle;
+	}
+
+
+private:
+	mutable LLRootHandle<T> mHandle;
+};
+
+#endif

indra/llcommon/llinitparam.h

 #include <boost/shared_ptr.hpp>
 
 #include "llerror.h"
-#include "lltypeinfolookup.h"
+#include "llstl.h"
 
 namespace LLInitParam
 {
 
 	public:
 		
-		struct CompareTypeID
-		{
-			bool operator()(const std::type_info* lhs, const std::type_info* rhs) const
-			{
-				return lhs->before(*rhs);
-			}
-		};
-
 		typedef std::vector<std::pair<std::string, bool> >					name_stack_t;
 		typedef std::pair<name_stack_t::iterator, name_stack_t::iterator>	name_stack_range_t;
 		typedef std::vector<std::string>									possible_values_t;
 		typedef bool (*parser_write_func_t)(Parser& parser, const void*, name_stack_t&);
 		typedef boost::function<void (name_stack_t&, S32, S32, const possible_values_t*)>	parser_inspect_func_t;
 
-		typedef LLTypeInfoLookup<parser_read_func_t>		parser_read_func_map_t;
-		typedef LLTypeInfoLookup<parser_write_func_t>		parser_write_func_map_t;
-		typedef LLTypeInfoLookup<parser_inspect_func_t>		parser_inspect_func_map_t;
+		typedef std::map<const std::type_info*, parser_read_func_t>		parser_read_func_map_t;
+		typedef std::map<const std::type_info*, parser_write_func_t>	parser_write_func_map_t;
+		typedef std::map<const std::type_info*, parser_inspect_func_t>	parser_inspect_func_map_t;
 
 		Parser(parser_read_func_map_t& read_map, parser_write_func_map_t& write_map, parser_inspect_func_map_t& inspect_map)
 		:	mParseSilently(false),

indra/llcommon/llpointer.h

 	}
 
 protected:
+#ifdef LL_LIBRARY_INCLUDE
+	void ref();                             
+	void unref();
+#else
 	void ref()                             
 	{ 
 		if (mPointer)
 			}
 		}
 	}
-
+#endif
 protected:
 	Type*	mPointer;
 };

indra/llcommon/llregistry.h

 
 #include <boost/type_traits.hpp>
 #include "llsingleton.h"
-#include "lltypeinfolookup.h"
+#include "llstl.h"
 
 template <typename T>
-class LLRegistryDefaultComparator
+struct LLRegistryDefaultComparator
 {
-	bool operator()(const T& lhs, const T& rhs) { return lhs < rhs; }
-};
-
-template <typename KEY, typename VALUE>
-struct LLRegistryMapSelector
-{
-    typedef std::map<KEY, VALUE> type;
-};
-
-template <typename VALUE>
-struct LLRegistryMapSelector<std::type_info*, VALUE>
-{
-    typedef LLTypeInfoLookup<VALUE> type;
-};
-
-template <typename VALUE>
-struct LLRegistryMapSelector<const std::type_info*, VALUE>
-{
-    typedef LLTypeInfoLookup<VALUE> type;
+	bool operator()(const T& lhs, const T& rhs) const
+	{
+		using std::less;
+		return less<T>()(lhs, rhs);
+	}
 };
 
 template <typename KEY, typename VALUE, typename COMPARATOR = LLRegistryDefaultComparator<KEY> >
 	{
 		friend class LLRegistry<KEY, VALUE, COMPARATOR>;
 	public:
-		typedef typename LLRegistryMapSelector<KEY, VALUE>::type registry_map_t;
+		typedef std::map<KEY, VALUE, COMPARATOR> registry_map_t;
 
 		bool add(ref_const_key_t key, ref_const_value_t value)
 		{

indra/llcommon/llsdserialize.cpp

 const std::string LLSD_BINARY_HEADER("LLSD/Binary");
 const std::string LLSD_XML_HEADER("LLSD/XML");
 
+//used to deflate a gzipped asset (currently used for navmeshes)
+#define windowBits 15
+#define ENABLE_ZLIB_GZIP 32
+
 /**
  * LLSDSerialize
  */
 	strm.next_in = in;
 
 	S32 ret = inflateInit(&strm);
-
+	
 	do
 	{
 		strm.avail_out = CHUNK;
 			llwarns << "Failed to unzip LLSD block" << llendl;
 			free(result);
 			return false;
-		}
+		}		
 	}
 
 	free(result);
 	return true;
 }
+//This unzip function will only work with a gzip header and trailer - while the contents
+//of the actual compressed data is the same for either format (gzip vs zlib ), the headers
+//and trailers are different for the formats.
+U8* unzip_llsdNavMesh( bool& valid, unsigned int& outsize, std::istream& is, S32 size )
+{
+	U8* result = NULL;
+	U32 cur_size = 0;
+	z_stream strm;
+		
+	const U32 CHUNK = 0x4000;
 
+	U8 *in = new U8[size];
+	is.read((char*) in, size); 
 
+	U8 out[CHUNK];
+		
+	strm.zalloc = Z_NULL;
+	strm.zfree = Z_NULL;
+	strm.opaque = Z_NULL;
+	strm.avail_in = size;
+	strm.next_in = in;
 
+	
+	S32 ret = inflateInit2(&strm,  windowBits | ENABLE_ZLIB_GZIP );
+	do
+	{
+		strm.avail_out = CHUNK;
+		strm.next_out = out;
+		ret = inflate(&strm, Z_NO_FLUSH);
+		if (ret == Z_STREAM_ERROR)
+		{
+			inflateEnd(&strm);
+			free(result);
+			delete [] in;
+			valid = false;
+		}
+		
+		switch (ret)
+		{
+		case Z_NEED_DICT:
+			ret = Z_DATA_ERROR;
+		case Z_DATA_ERROR:
+		case Z_MEM_ERROR:
+			inflateEnd(&strm);
+			free(result);
+			delete [] in;
+			valid = false;
+			break;
+		}
+
+		U32 have = CHUNK-strm.avail_out;
+
+		result = (U8*) realloc(result, cur_size + have);
+		memcpy(result+cur_size, out, have);
+		cur_size += have;
+
+	} while (ret == Z_OK);
+
+	inflateEnd(&strm);
+	delete [] in;
+
+	if (ret != Z_STREAM_END)
+	{
+		free(result);
+		valid = false;
+		return NULL;
+	}
+
+	//result now points to the decompressed LLSD block
+	{
+		outsize= cur_size;
+		valid = true;		
+	}
+
+	return result;
+}
+
+

indra/llcommon/llsdserialize.h

 //dirty little zip functions -- yell at davep
 LL_COMMON_API std::string zip_llsd(LLSD& data);
 LL_COMMON_API bool unzip_llsd(LLSD& data, std::istream& is, S32 size);
-
+LL_COMMON_API U8* unzip_llsdNavMesh( bool& valid, unsigned int& outsize,std::istream& is, S32 size);
 #endif // LL_LLSDSERIALIZE_H

indra/llcommon/llstat.cpp

 S32	            LLPerfBlock::sStatsFlags = LLPerfBlock::LLSTATS_NO_OPTIONAL_STATS;       // Control what is being recorded
 LLPerfBlock::stat_map_t    LLPerfBlock::sStatMap;    // Map full path string to LLStatTime objects, tracks all active objects
 std::string        LLPerfBlock::sCurrentStatPath = "";    // Something like "/total_time/physics/physics step"
-LLStat::stat_map_t LLStat::sStatList;
 
 //------------------------------------------------------------------------
 // Live config file to trigger stats logging
 
 	if (!mName.empty())
 	{
-		stat_map_t::iterator iter = sStatList.find(mName);
-		if (iter != sStatList.end())
+		stat_map_t::iterator iter = getStatList().find(mName);
+		if (iter != getStatList().end())
 			llwarns << "LLStat with duplicate name: " << mName << llendl;
-		sStatList.insert(std::make_pair(mName, this));
+		getStatList().insert(std::make_pair(mName, this));
 	}
 }
 
+LLStat::stat_map_t& LLStat::getStatList()
+{
+	static LLStat::stat_map_t stat_list;
+	return stat_list;
+}
+
 LLStat::LLStat(const U32 num_bins, const BOOL use_frame_timer)
 	: mUseFrameTimer(use_frame_timer),
 	  mNumBins(num_bins)
 	if (!mName.empty())
 	{
 		// handle multiple entries with the same name
-		stat_map_t::iterator iter = sStatList.find(mName);
-		while (iter != sStatList.end() && iter->second != this)
+		stat_map_t::iterator iter = getStatList().find(mName);
+		while (iter != getStatList().end() && iter->second != this)
 			++iter;
-		sStatList.erase(iter);
+		getStatList().erase(iter);
 	}
 }
 

indra/llcommon/llstat.h

 {
 private:
 	typedef std::multimap<std::string, LLStat*> stat_map_t;
-	static stat_map_t sStatList;
 
 	void init();
+	static stat_map_t& getStatList();
 
 public:
 	LLStat(U32 num_bins = 32, BOOL use_frame_timer = FALSE);
 	static LLStat* getStat(const std::string& name)
 	{
 		// return the first stat that matches 'name'
-		stat_map_t::iterator iter = sStatList.find(name);
-		if (iter != sStatList.end())
+		stat_map_t::iterator iter = getStatList().find(name);
+		if (iter != getStatList().end())
 			return iter->second;
 		else
 			return NULL;

indra/llcommon/llstatenums.h

 
 enum
 {
-	LL_SIM_STAT_TIME_DILATION,				// 0
-	LL_SIM_STAT_FPS,
-	LL_SIM_STAT_PHYSFPS,
-	LL_SIM_STAT_AGENTUPS,
-	LL_SIM_STAT_FRAMEMS,
-	LL_SIM_STAT_NETMS,						// 5
-	LL_SIM_STAT_SIMOTHERMS,
-	LL_SIM_STAT_SIMPHYSICSMS,
-	LL_SIM_STAT_AGENTMS,
-	LL_SIM_STAT_IMAGESMS,
-	LL_SIM_STAT_SCRIPTMS,					// 10
-	LL_SIM_STAT_NUMTASKS,
-	LL_SIM_STAT_NUMTASKSACTIVE,
-	LL_SIM_STAT_NUMAGENTMAIN,
-	LL_SIM_STAT_NUMAGENTCHILD,
-	LL_SIM_STAT_NUMSCRIPTSACTIVE,			// 15
-	LL_SIM_STAT_LSLIPS,
-	LL_SIM_STAT_INPPS,
-	LL_SIM_STAT_OUTPPS,
-	LL_SIM_STAT_PENDING_DOWNLOADS,
-	LL_SIM_STAT_PENDING_UPLOADS,			// 20
-	LL_SIM_STAT_VIRTUAL_SIZE_KB,
-	LL_SIM_STAT_RESIDENT_SIZE_KB,
-	LL_SIM_STAT_PENDING_LOCAL_UPLOADS,
-	LL_SIM_STAT_TOTAL_UNACKED_BYTES,
-	LL_SIM_STAT_PHYSICS_PINNED_TASKS,		// 25
-	LL_SIM_STAT_PHYSICS_LOD_TASKS,
-	LL_SIM_STAT_SIMPHYSICSSTEPMS,
-	LL_SIM_STAT_SIMPHYSICSSHAPEMS,
-	LL_SIM_STAT_SIMPHYSICSOTHERMS,
-	LL_SIM_STAT_SIMPHYSICSMEMORY,			// 30
-	LL_SIM_STAT_SCRIPT_EPS,
-	LL_SIM_STAT_SIMSPARETIME,
-	LL_SIM_STAT_SIMSLEEPTIME,
-	LL_SIM_STAT_IOPUMPTIME,
+	LL_SIM_STAT_TIME_DILATION         =  0,
+	LL_SIM_STAT_FPS                   =  1,
+	LL_SIM_STAT_PHYSFPS               =  2,
+	LL_SIM_STAT_AGENTUPS              =  3,
+	LL_SIM_STAT_FRAMEMS               =  4,
+	LL_SIM_STAT_NETMS                 =  5,
+	LL_SIM_STAT_SIMOTHERMS            =  6,
+	LL_SIM_STAT_SIMPHYSICSMS          =  7,
+	LL_SIM_STAT_AGENTMS               =  8,
+	LL_SIM_STAT_IMAGESMS              =  9,
+	LL_SIM_STAT_SCRIPTMS              = 10,
+	LL_SIM_STAT_NUMTASKS              = 11,
+	LL_SIM_STAT_NUMTASKSACTIVE        = 12,
+	LL_SIM_STAT_NUMAGENTMAIN          = 13,
+	LL_SIM_STAT_NUMAGENTCHILD         = 14,
+	LL_SIM_STAT_NUMSCRIPTSACTIVE      = 15,
+	LL_SIM_STAT_LSLIPS                = 16,
+	LL_SIM_STAT_INPPS                 = 17,
+	LL_SIM_STAT_OUTPPS                = 18,
+	LL_SIM_STAT_PENDING_DOWNLOADS     = 19,
+	LL_SIM_STAT_PENDING_UPLOADS       = 20,
+	LL_SIM_STAT_VIRTUAL_SIZE_KB       = 21,
+	LL_SIM_STAT_RESIDENT_SIZE_KB      = 22,
+	LL_SIM_STAT_PENDING_LOCAL_UPLOADS = 23,
+	LL_SIM_STAT_TOTAL_UNACKED_BYTES   = 24,
+	LL_SIM_STAT_PHYSICS_PINNED_TASKS  = 25,
+	LL_SIM_STAT_PHYSICS_LOD_TASKS     = 26,
+	LL_SIM_STAT_SIMPHYSICSSTEPMS      = 27,
+	LL_SIM_STAT_SIMPHYSICSSHAPEMS     = 28,
+	LL_SIM_STAT_SIMPHYSICSOTHERMS     = 29,
+	LL_SIM_STAT_SIMPHYSICSMEMORY      = 30,
+	LL_SIM_STAT_SCRIPT_EPS            = 31,
+	LL_SIM_STAT_SIMSPARETIME          = 32,
+	LL_SIM_STAT_SIMSLEEPTIME          = 33,
+	LL_SIM_STAT_IOPUMPTIME            = 34,
+	LL_SIM_STAT_PCTSCRIPTSRUN         = 35,
+	LL_SIM_STAT_REGION_IDLE           = 36, // dataserver only
+	LL_SIM_STAT_REGION_IDLE_POSSIBLE  = 37, // dataserver only
+	LL_SIM_STAT_SIMAISTEPTIMEMS       = 38,
+	LL_SIM_STAT_SKIPPEDAISILSTEPS_PS  = 39,
+	LL_SIM_STAT_PCTSTEPPEDCHARACTERS  = 40
+
 };
 
 #endif

indra/llcommon/llstl.h

 #include <vector>
 #include <set>
 #include <deque>
+#include <typeinfo>
 
 // Use to compare the first element only of a pair
 // e.g. typedef std::set<std::pair<int, Data*>, compare_pair<int, Data*> > some_pair_set_t; 
   return llbinder2nd<_Operation>(__oper, _Arg2_type(__x));
 }
 
+/**
+ * Compare std::type_info* pointers a la std::less. We break this out as a
+ * separate function for use in two different std::less specializations.
+ */
+inline
+bool before(const std::type_info* lhs, const std::type_info* rhs)
+{
+#if LL_LINUX && defined(__GNUC__) && ((__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 4))
+    // If we're building on Linux with gcc, and it's either gcc 3.x or
+    // 4.{0,1,2,3}, then we have to use a workaround. Note that we use gcc on
+    // Mac too, and some people build with gcc on Windows (cygwin or mingw).
+    // On Linux, different load modules may produce different type_info*
+    // pointers for the same type. Have to compare name strings to get good
+    // results.
+    return strcmp(lhs->name(), rhs->name()) < 0;
+#else  // not Linux, or gcc 4.4+
+    // Just use before(), as we normally would
+    return lhs->before(*rhs);
+#endif
+}
+
+/**
+ * Specialize std::less<std::type_info*> to use std::type_info::before().
+ * See MAINT-1175. It is NEVER a good idea to directly compare std::type_info*
+ * because, on Linux, you might get different std::type_info* pointers for the
+ * same type (from different load modules)!
+ */
+namespace std
+{
+	template <>
+	struct less<const std::type_info*>:
+		public std::binary_function<const std::type_info*, const std::type_info*, bool>
+	{
+		bool operator()(const std::type_info* lhs, const std::type_info* rhs) const
+		{
+			return before(lhs, rhs);
+		}
+	};
+
+	template <>
+	struct less<std::type_info*>:
+		public std::binary_function<std::type_info*, std::type_info*, bool>
+	{
+		bool operator()(std::type_info* lhs, std::type_info* rhs) const
+		{
+			return before(lhs, rhs);
+		}
+	};
+} // std
+
 #endif // LL_LLSTL_H

indra/llcommon/lltypeinfolookup.h

 #if ! defined(LL_LLTYPEINFOLOOKUP_H)
 #define LL_LLTYPEINFOLOOKUP_H
 
-#include "llsortedvector.h"
+#include <boost/unordered_map.hpp>
+#include <boost/functional/hash.hpp>
+#include <boost/optional.hpp>
+#include <functional>               // std::binary_function
 #include <typeinfo>
 
 /**
+ * The following helper classes are based on the Boost.Unordered documentation:
+ * http://www.boost.org/doc/libs/1_45_0/doc/html/unordered/hash_equality.html
+ */
+
+/**
+ * Compute hash for a string passed as const char*
+ */
+struct const_char_star_hash: public std::unary_function<const char*, std::size_t>
+{
+    std::size_t operator()(const char* str) const
+    {
+        std::size_t seed = 0;
+        for ( ; *str; ++str)
+        {
+            boost::hash_combine(seed, *str);
+        }
+        return seed;
+    }
+};
+
+/**
+ * Compute equality for strings passed as const char*
+ *
+ * I (nat) suspect that this is where the default behavior breaks for the
+ * const char* values returned from std::type_info::name(). If you compare the
+ * two const char* pointer values, as a naive, unspecialized implementation
+ * will surely do, they'll compare unequal.
+ */
+struct const_char_star_equal: public std::binary_function<const char*, const char*, bool>
+{
+    bool operator()(const char* lhs, const char* rhs) const
+    {
+        return strcmp(lhs, rhs) == 0;
+    }
+};
+
+/**
  * LLTypeInfoLookup is specifically designed for use cases for which you might
  * consider std::map<std::type_info*, VALUE>. We have several such data
  * structures in the viewer. The trouble with them is that at least on Linux,
  * different load modules will produce different std::type_info*.
  * LLTypeInfoLookup contains a workaround to address this issue.
  *
- * Specifically, when we don't find the passed std::type_info*,
- * LLTypeInfoLookup performs a linear search over registered entries to
- * compare name() strings. Presuming that this succeeds, we cache the new
- * (previously unrecognized) std::type_info* to speed future lookups.
- *
- * This worst-case fallback search (linear search with string comparison)
- * should only happen the first time we look up a given type from a particular
- * load module other than the one from which we initially registered types.
- * (However, a lookup which wouldn't succeed anyway will always have
- * worst-case performance.) This class is probably best used with less than a
- * few dozen different types.
+ * The API deliberately diverges from std::map in several respects:
+ * * It avoids iterators, not only begin()/end() but also as return values
+ *   from insert() and find(). This bypasses transform_iterator overhead.
+ * * Since we literally use compile-time types as keys, the essential insert()
+ *   and find() methods accept the key type as a @em template parameter,
+ *   accepting and returning value_type as a normal runtime value. This is to
+ *   permit future optimization (e.g. compile-time type hashing) without
+ *   changing the API.
  */
 template <typename VALUE>
 class LLTypeInfoLookup
 {
+    // Use this for our underlying implementation: lookup by
+    // std::type_info::name() string. This is one of the rare cases in which I
+    // dare use const char* directly, rather than std::string, because I'm
+    // sure that every value returned by std::type_info::name() is static.
+    // HOWEVER, specify our own hash + equality functors: naively comparing
+    // distinct const char* values won't work.
+    typedef boost::unordered_map<const char*, VALUE,
+                                 const_char_star_hash, const_char_star_equal> impl_map_type;
+
 public:
-    typedef LLTypeInfoLookup<VALUE> self;
-    typedef LLSortedVector<const std::type_info*, VALUE> vector_type;
-    typedef typename vector_type::key_type key_type;
-    typedef typename vector_type::mapped_type mapped_type;
-    typedef typename vector_type::value_type value_type;
-    typedef typename vector_type::iterator iterator;
-    typedef typename vector_type::const_iterator const_iterator;
+    typedef VALUE value_type;
 
     LLTypeInfoLookup() {}
 
-    iterator begin() { return mVector.begin(); }
-    iterator end()   { return mVector.end(); }
-    const_iterator begin() const { return mVector.begin(); }
-    const_iterator end()   const { return mVector.end(); }
-    bool empty() const { return mVector.empty(); }
-    std::size_t size() const { return mVector.size(); }
+    bool empty() const { return mMap.empty(); }
+    std::size_t size() const { return mMap.size(); }
 
-    std::pair<iterator, bool> insert(const std::type_info* key, const VALUE& value)
+    template <typename KEY>
+    bool insert(const value_type& value)
     {
-        return insert(value_type(key, value));
+        // Obtain and store the std::type_info::name() string as the key.
+        // Return just the bool from std::map::insert()'s return pair.
+        return mMap.insert(typename impl_map_type::value_type(typeid(KEY).name(), value)).second;
     }
 
-    std::pair<iterator, bool> insert(const value_type& pair)
+    template <typename KEY>
+    boost::optional<value_type> find() const
     {
-        return mVector.insert(pair);
-    }
-
-    // const find() forwards to non-const find(): this can alter mVector!
-    const_iterator find(const std::type_info* key) const
-    {
-        return const_cast<self*>(this)->find(key);
-    }
-
-    // non-const find() caches previously-unknown type_info* to speed future
-    // lookups.
-    iterator find(const std::type_info* key)
-    {
-        iterator found = mVector.find(key);
-        if (found != mVector.end())
-        {
-            // If LLSortedVector::find() found, great, we're done.
-            return found;
-        }
-        // Here we didn't find the passed type_info*. On Linux, though, even
-        // for the same type, typeid(sametype) produces a different type_info*
-        // when used in different load modules. So the fact that we didn't
-        // find the type_info* we seek doesn't mean this type isn't
-        // registered. Scan for matching name() string.
-        for (typename vector_type::iterator ti(mVector.begin()), tend(mVector.end());
-             ti != tend; ++ti)
-        {
-            if (std::string(ti->first->name()) == key->name())
-            {
-                // This unrecognized 'key' is for the same type as ti->first.
-                // To speed future lookups, insert a new entry that lets us
-                // look up ti->second using this same 'key'.
-                return insert(key, ti->second).first;
-            }
-        }
-        // We simply have never seen a type with this type_info* from any load
-        // module.
-        return mVector.end();