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.cs12
1 files changed, 6 insertions, 6 deletions
diff --git a/OpenSim/Data/NHibernate/Terrain.cs b/OpenSim/Data/NHibernate/Terrain.cs
index 292b3b4..bd6f992 100644
--- a/OpenSim/Data/NHibernate/Terrain.cs
+++ b/OpenSim/Data/NHibernate/Terrain.cs
@@ -74,15 +74,15 @@ namespace OpenSim.Data.NHibernate
74 74
75 private static double[,] parseTerrain(byte[] data) 75 private static double[,] parseTerrain(byte[] data)
76 { 76 {
77 double[,] terret = new double[256,256]; 77 double[,] terret = new double[Constants.RegionSize, Constants.RegionSize];
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 {
83 for (int x = 0; x < 256; x++) 83 for (int x = 0; x < Constants.RegionSize; x++)
84 { 84 {
85 for (int y = 0; y < 256; y++) 85 for (int y = 0; y < Constants.RegionSize; y++)
86 { 86 {
87 terret[x, y] = br.ReadDouble(); 87 terret[x, y] = br.ReadDouble();
88 } 88 }
@@ -97,13 +97,13 @@ namespace OpenSim.Data.NHibernate
97 97
98 private static byte[] serializeTerrain(double[,] val) 98 private static byte[] serializeTerrain(double[,] val)
99 { 99 {
100 MemoryStream str = new MemoryStream((int)(65536 * sizeof (double))); 100 MemoryStream str = new MemoryStream((int) ((Constants.RegionSize*Constants.RegionSize)*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 < Constants.RegionSize; x++)
105 { 105 {
106 for (int y = 0; y < 256; y++) 106 for (int y = 0; y < Constants.RegionSize; y++)
107 { 107 {
108 double height = val[x, y]; 108 double height = val[x, y];
109 if (height <= 0.0) 109 if (height <= 0.0)