From 904baa6da6107c3aabfae45d977491b97c22a6ef Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 25 Apr 2014 22:37:58 +0100 Subject: Fix issue where terrain height values > 327 caused chaotic spiked terrain. Per http://wiki.secondlife.com/wiki/Tips_for_Creating_Heightfields_and_Details_on_Terrain_RAW_Files#Notes_for_Creating_Height_Field_Maps_for_Second_Life terrain heights up to 508 are possible on the LL grid (and were available on previous releases of OpenSimulator). The obvious way to allow both this and equivalent -z values, is to rewiden the internal terrain height storage from short to int. The memory tradeoff is most noticeable on the maximum 8192x8192 var region (equiv to 1024 normal regions), where it adds 128mb to resident use (128k on a normal region) This is still better than the double used in previous releases. This does not affect physics or data storage since they already use float and double respectively. This may not be the final solution if we actually want to sacrifice -z, >327 or something else. Relates to http://opensimulator.org/mantis/view.php?id=7076 --- OpenSim/Region/Framework/Scenes/TerrainChannel.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/TerrainChannel.cs') diff --git a/OpenSim/Region/Framework/Scenes/TerrainChannel.cs b/OpenSim/Region/Framework/Scenes/TerrainChannel.cs index cc040a6..3d563a6 100644 --- a/OpenSim/Region/Framework/Scenes/TerrainChannel.cs +++ b/OpenSim/Region/Framework/Scenes/TerrainChannel.cs @@ -363,8 +363,8 @@ namespace OpenSim.Region.Framework.Scenes public int SizeY; public int SizeZ; public float CompressionFactor; - public short[] Map; - public TerrainChannelXMLPackage(int pX, int pY, int pZ, float pCompressionFactor, short[] pMap) + public int[] Map; + public TerrainChannelXMLPackage(int pX, int pY, int pZ, float pCompressionFactor, int[] pMap) { Version = 1; SizeX = pX; -- cgit v1.1