aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/NHibernate/Terrain.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data/NHibernate/Terrain.cs')
-rw-r--r--OpenSim/Data/NHibernate/Terrain.cs20
1 files changed, 10 insertions, 10 deletions
diff --git a/OpenSim/Data/NHibernate/Terrain.cs b/OpenSim/Data/NHibernate/Terrain.cs
index a95e45a..608f03e 100644
--- a/OpenSim/Data/NHibernate/Terrain.cs
+++ b/OpenSim/Data/NHibernate/Terrain.cs
@@ -32,21 +32,21 @@ using OpenSim.Framework;
32using log4net; 32using log4net;
33using libsecondlife; 33using libsecondlife;
34 34
35namespace OpenSim.Data.NHibernate 35namespace OpenSim.Data.NHibernate
36{ 36{
37 public class Terrain 37 public class Terrain
38 { 38 {
39 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 39 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
40 40
41 private double[,] map; 41 private double[,] map;
42 private LLUUID regionID; 42 private LLUUID regionID;
43 43
44 public Terrain(LLUUID Region, double[,] array) 44 public Terrain(LLUUID Region, double[,] array)
45 { 45 {
46 map = array; 46 map = array;
47 regionID = Region; 47 regionID = Region;
48 } 48 }
49 49
50 public Terrain() 50 public Terrain()
51 { 51 {
52 map = new double[Constants.RegionSize, Constants.RegionSize]; 52 map = new double[Constants.RegionSize, Constants.RegionSize];
@@ -65,7 +65,7 @@ namespace OpenSim.Data.NHibernate
65 get { return serializeTerrain(map); } 65 get { return serializeTerrain(map); }
66 set { map = parseTerrain(value); } 66 set { map = parseTerrain(value); }
67 } 67 }
68 68
69 public double[,] Doubles 69 public double[,] Doubles
70 { 70 {
71 get {return map;} 71 get {return map;}
@@ -76,7 +76,7 @@ namespace OpenSim.Data.NHibernate
76 { 76 {
77 double[,] terret = new double[256,256]; 77 double[,] terret = new double[256,256];
78 terret.Initialize(); 78 terret.Initialize();
79 79
80 MemoryStream str = new MemoryStream(data); 80 MemoryStream str = new MemoryStream(data);
81 BinaryReader br = new BinaryReader(str); 81 BinaryReader br = new BinaryReader(str);
82 try { 82 try {
@@ -87,7 +87,7 @@ namespace OpenSim.Data.NHibernate
87 terret[x, y] = br.ReadDouble(); 87 terret[x, y] = br.ReadDouble();
88 } 88 }
89 } 89 }
90 } 90 }
91 catch (Exception e) 91 catch (Exception e)
92 { 92 {
93 m_log.Error("Issue parsing Map", e); 93 m_log.Error("Issue parsing Map", e);
@@ -99,7 +99,7 @@ namespace OpenSim.Data.NHibernate
99 { 99 {
100 MemoryStream str = new MemoryStream((int)(65536 * sizeof (double))); 100 MemoryStream str = new MemoryStream((int)(65536 * sizeof (double)));
101 BinaryWriter bw = new BinaryWriter(str); 101 BinaryWriter bw = new BinaryWriter(str);
102 102
103 // TODO: COMPATIBILITY - Add byte-order conversions 103 // TODO: COMPATIBILITY - Add byte-order conversions
104 for (int x = 0; x < 256; x++) 104 for (int x = 0; x < 256; x++)
105 { 105 {
@@ -108,11 +108,11 @@ namespace OpenSim.Data.NHibernate
108 double height = val[x, y]; 108 double height = val[x, y];
109 if (height <= 0.0) 109 if (height <= 0.0)
110 height = double.Epsilon; 110 height = double.Epsilon;
111 111
112 bw.Write(height); 112 bw.Write(height);
113 } 113 }
114 } 114 }
115 return str.ToArray(); 115 return str.ToArray();
116 } 116 }
117 } 117 }
118} \ No newline at end of file 118}