aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorRobert Adams2014-01-28 15:58:45 -0800
committerRobert Adams2014-01-28 15:58:45 -0800
commitd25265ae82a3ac3afc32f65f820c9ed0b2bff31f (patch)
treead74faca895e7bd43cd29f0de4cf7888fa8b6c45 /OpenSim
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC_OLD-d25265ae82a3ac3afc32f65f820c9ed0b2bff31f.zip
opensim-SC_OLD-d25265ae82a3ac3afc32f65f820c9ed0b2bff31f.tar.gz
opensim-SC_OLD-d25265ae82a3ac3afc32f65f820c9ed0b2bff31f.tar.bz2
opensim-SC_OLD-d25265ae82a3ac3afc32f65f820c9ed0b2bff31f.tar.xz
Fix terrain tests by properly initializing low detail terrain to zero height.
Also remove PI heightmap test as new heightmaps only have two significant digits.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/TerrainData.cs1
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandObject.cs5
-rw-r--r--OpenSim/Region/CoreModules/World/Terrain/Tests/TerrainTest.cs4
3 files changed, 5 insertions, 5 deletions
diff --git a/OpenSim/Framework/TerrainData.cs b/OpenSim/Framework/TerrainData.cs
index 1c52a69..d1e0e7e 100644
--- a/OpenSim/Framework/TerrainData.cs
+++ b/OpenSim/Framework/TerrainData.cs
@@ -274,6 +274,7 @@ namespace OpenSim.Framework
274 m_taint = new bool[SizeX / Constants.TerrainPatchSize, SizeY / Constants.TerrainPatchSize]; 274 m_taint = new bool[SizeX / Constants.TerrainPatchSize, SizeY / Constants.TerrainPatchSize];
275 // m_log.DebugFormat("{0} new by dimensions. sizeX={1}, sizeY={2}, sizeZ={3}", LogHeader, SizeX, SizeY, SizeZ); 275 // m_log.DebugFormat("{0} new by dimensions. sizeX={1}, sizeY={2}, sizeZ={3}", LogHeader, SizeX, SizeY, SizeZ);
276 ClearTaint(); 276 ClearTaint();
277 ClearLand(0f);
277 } 278 }
278 279
279 public HeightmapTerrainData(short[] cmap, float pCompressionFactor, int pX, int pY, int pZ) : this(pX, pY, pZ) 280 public HeightmapTerrainData(short[] cmap, float pCompressionFactor, int pX, int pY, int pZ) : this(pX, pY, pZ)
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
index f8f4986..939512f 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
@@ -134,7 +134,10 @@ namespace OpenSim.Region.CoreModules.World.Land
134 public LandObject(UUID owner_id, bool is_group_owned, Scene scene) 134 public LandObject(UUID owner_id, bool is_group_owned, Scene scene)
135 { 135 {
136 m_scene = scene; 136 m_scene = scene;
137 m_landBitmap = new bool[m_scene.RegionInfo.RegionSizeX / landUnit, m_scene.RegionInfo.RegionSizeY / landUnit]; 137 if (m_scene == null)
138 m_landBitmap = new bool[Constants.RegionSize / landUnit, Constants.RegionSize / landUnit];
139 else
140 m_landBitmap = new bool[m_scene.RegionInfo.RegionSizeX / landUnit, m_scene.RegionInfo.RegionSizeY / landUnit];
138 141
139 LandData.OwnerID = owner_id; 142 LandData.OwnerID = owner_id;
140 if (is_group_owned) 143 if (is_group_owned)
diff --git a/OpenSim/Region/CoreModules/World/Terrain/Tests/TerrainTest.cs b/OpenSim/Region/CoreModules/World/Terrain/Tests/TerrainTest.cs
index be719ea..d557168 100644
--- a/OpenSim/Region/CoreModules/World/Terrain/Tests/TerrainTest.cs
+++ b/OpenSim/Region/CoreModules/World/Terrain/Tests/TerrainTest.cs
@@ -100,10 +100,6 @@ namespace OpenSim.Region.CoreModules.World.Terrain.Tests
100 x[0, 0] -= 1.0; 100 x[0, 0] -= 1.0;
101 Assert.That(x[0, 0] == 4.0, "Terrain addition/subtraction error."); 101 Assert.That(x[0, 0] == 4.0, "Terrain addition/subtraction error.");
102 102
103 x[0, 0] = Math.PI;
104 double[,] doublesExport = x.GetDoubles();
105 Assert.That(doublesExport[0, 0] == Math.PI, "Export to double[,] array not working correctly.");
106
107 x[0, 0] = 1.0; 103 x[0, 0] = 1.0;
108 float[] floatsExport = x.GetFloatsSerialised(); 104 float[] floatsExport = x.GetFloatsSerialised();
109 Assert.That(floatsExport[0] == 1.0f, "Export to float[] not working correctly."); 105 Assert.That(floatsExport[0] == 1.0f, "Export to float[] not working correctly.");