From 73dadb4821e7afeacc38b959e52f368ebeb69d44 Mon Sep 17 00:00:00 2001 From: Brian McBee Date: Mon, 6 Aug 2007 17:45:57 +0000 Subject: OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs Backing out previous change to GetHeights1D. Terrain should now load with the correct rotation, but terraforming is now broken again. --- OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs b/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs index bd66c02..a519185 100644 --- a/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs +++ b/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs @@ -155,7 +155,7 @@ namespace OpenSim.Region.Terrain /// Converts the heightmap to a 65536 value 1D floating point array /// /// A float[65536] array containing the heightmap - public float[] GetHeights1D() + public float[] GetHeights1DFixed() { float[] heights = new float[w * h]; int i; @@ -169,6 +169,23 @@ namespace OpenSim.Region.Terrain } /// + /// Converts the heightmap to a 65536 value 1D floating point array + /// + /// A float[65536] array containing the heightmap + public float[] GetHeights1D() + { + float[] heights = new float[w * h]; + int i; + + for (i = 0; i < w * h; i++) + { + heights[i] = (float)heightmap.map[i / w, i % w]; + } + + return heights; + } + + /// /// Converts the heightmap to a 256x256 value 2D floating point array. /// /// An array of 256,256 values containing the heightmap -- cgit v1.1