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.0.8.0.3
parent
1d533b0f01
commit
d25265ae82
|
@ -274,6 +274,7 @@ namespace OpenSim.Framework
|
|||
m_taint = new bool[SizeX / Constants.TerrainPatchSize, SizeY / Constants.TerrainPatchSize];
|
||||
// m_log.DebugFormat("{0} new by dimensions. sizeX={1}, sizeY={2}, sizeZ={3}", LogHeader, SizeX, SizeY, SizeZ);
|
||||
ClearTaint();
|
||||
ClearLand(0f);
|
||||
}
|
||||
|
||||
public HeightmapTerrainData(short[] cmap, float pCompressionFactor, int pX, int pY, int pZ) : this(pX, pY, pZ)
|
||||
|
|
|
@ -134,7 +134,10 @@ namespace OpenSim.Region.CoreModules.World.Land
|
|||
public LandObject(UUID owner_id, bool is_group_owned, Scene scene)
|
||||
{
|
||||
m_scene = scene;
|
||||
m_landBitmap = new bool[m_scene.RegionInfo.RegionSizeX / landUnit, m_scene.RegionInfo.RegionSizeY / landUnit];
|
||||
if (m_scene == null)
|
||||
m_landBitmap = new bool[Constants.RegionSize / landUnit, Constants.RegionSize / landUnit];
|
||||
else
|
||||
m_landBitmap = new bool[m_scene.RegionInfo.RegionSizeX / landUnit, m_scene.RegionInfo.RegionSizeY / landUnit];
|
||||
|
||||
LandData.OwnerID = owner_id;
|
||||
if (is_group_owned)
|
||||
|
|
|
@ -100,10 +100,6 @@ namespace OpenSim.Region.CoreModules.World.Terrain.Tests
|
|||
x[0, 0] -= 1.0;
|
||||
Assert.That(x[0, 0] == 4.0, "Terrain addition/subtraction error.");
|
||||
|
||||
x[0, 0] = Math.PI;
|
||||
double[,] doublesExport = x.GetDoubles();
|
||||
Assert.That(doublesExport[0, 0] == Math.PI, "Export to double[,] array not working correctly.");
|
||||
|
||||
x[0, 0] = 1.0;
|
||||
float[] floatsExport = x.GetFloatsSerialised();
|
||||
Assert.That(floatsExport[0] == 1.0f, "Export to float[] not working correctly.");
|
||||
|
|
Loading…
Reference in New Issue