aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL/MySQLRegionData.cs
diff options
context:
space:
mode:
authorMelanie2009-08-07 23:06:52 +0100
committerMelanie2009-08-07 23:06:52 +0100
commit9337a94f33eb80ed4e031256ffd45a3f74294977 (patch)
tree851c648c79a2f4bdca9f929fc27bff1a8cbd84e9 /OpenSim/Data/MySQL/MySQLRegionData.cs
parentRemove debugging output frm ini file loading. Make it collect matching (diff)
parent* Remove hard coded 256 limitations from various places. There's no more 2... (diff)
downloadopensim-SC_OLD-9337a94f33eb80ed4e031256ffd45a3f74294977.zip
opensim-SC_OLD-9337a94f33eb80ed4e031256ffd45a3f74294977.tar.gz
opensim-SC_OLD-9337a94f33eb80ed4e031256ffd45a3f74294977.tar.bz2
opensim-SC_OLD-9337a94f33eb80ed4e031256ffd45a3f74294977.tar.xz
Merge branch 'master' of ssh://melanie@opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Data/MySQL/MySQLRegionData.cs')
-rw-r--r--OpenSim/Data/MySQL/MySQLRegionData.cs12
1 files changed, 6 insertions, 6 deletions
diff --git a/OpenSim/Data/MySQL/MySQLRegionData.cs b/OpenSim/Data/MySQL/MySQLRegionData.cs
index 09564de..2166845 100644
--- a/OpenSim/Data/MySQL/MySQLRegionData.cs
+++ b/OpenSim/Data/MySQL/MySQLRegionData.cs
@@ -583,16 +583,16 @@ namespace OpenSim.Data.MySQL
583 { 583 {
584 while (reader.Read()) 584 while (reader.Read())
585 { 585 {
586 terrain = new double[256,256]; 586 terrain = new double[(int)Constants.RegionSize, (int)Constants.RegionSize];
587 terrain.Initialize(); 587 terrain.Initialize();
588 588
589 MemoryStream mstr = new MemoryStream((byte[]) reader["Heightfield"]); 589 MemoryStream mstr = new MemoryStream((byte[]) reader["Heightfield"]);
590 int rev = 0; 590 int rev = 0;
591 591
592 BinaryReader br = new BinaryReader(mstr); 592 BinaryReader br = new BinaryReader(mstr);
593 for (int x = 0; x < 256; x++) 593 for (int x = 0; x < (int)Constants.RegionSize; x++)
594 { 594 {
595 for (int y = 0; y < 256; y++) 595 for (int y = 0; y < (int)Constants.RegionSize; y++)
596 { 596 {
597 terrain[x, y] = br.ReadDouble(); 597 terrain[x, y] = br.ReadDouble();
598 } 598 }
@@ -1141,12 +1141,12 @@ namespace OpenSim.Data.MySQL
1141 /// <returns></returns> 1141 /// <returns></returns>
1142 private static Array SerializeTerrain(double[,] val) 1142 private static Array SerializeTerrain(double[,] val)
1143 { 1143 {
1144 MemoryStream str = new MemoryStream(65536*sizeof (double)); 1144 MemoryStream str = new MemoryStream(((int)Constants.RegionSize * (int)Constants.RegionSize) *sizeof (double));
1145 BinaryWriter bw = new BinaryWriter(str); 1145 BinaryWriter bw = new BinaryWriter(str);
1146 1146
1147 // TODO: COMPATIBILITY - Add byte-order conversions 1147 // TODO: COMPATIBILITY - Add byte-order conversions
1148 for (int x = 0; x < 256; x++) 1148 for (int x = 0; x < (int)Constants.RegionSize; x++)
1149 for (int y = 0; y < 256; y++) 1149 for (int y = 0; y < (int)Constants.RegionSize; y++)
1150 { 1150 {
1151 double height = val[x, y]; 1151 double height = val[x, y];
1152 if (height == 0.0) 1152 if (height == 0.0)