diff options
Diffstat (limited to 'OpenSim/Data')
-rw-r--r-- | OpenSim/Data/MSSQL/MSSQLRegionData.cs | 12 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/MySQLRegionData.cs | 12 | ||||
-rw-r--r-- | OpenSim/Data/NHibernate/NHibernateRegionData.cs | 4 | ||||
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteRegionData.cs | 18 |
4 files changed, 23 insertions, 23 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLRegionData.cs b/OpenSim/Data/MSSQL/MSSQLRegionData.cs index 0fe8de7..d79d32b 100644 --- a/OpenSim/Data/MSSQL/MSSQLRegionData.cs +++ b/OpenSim/Data/MSSQL/MSSQLRegionData.cs | |||
@@ -485,7 +485,7 @@ ELSE | |||
485 | /// <returns></returns> | 485 | /// <returns></returns> |
486 | public double[,] LoadTerrain(UUID regionID) | 486 | public double[,] LoadTerrain(UUID regionID) |
487 | { | 487 | { |
488 | double[,] terrain = new double[256, 256]; | 488 | double[,] terrain = new double[(int)Constants.RegionSize, (int)Constants.RegionSize]; |
489 | terrain.Initialize(); | 489 | terrain.Initialize(); |
490 | 490 | ||
491 | string sql = "select top 1 RegionUUID, Revision, Heightfield from terrain where RegionUUID = @RegionUUID order by Revision desc"; | 491 | string sql = "select top 1 RegionUUID, Revision, Heightfield from terrain where RegionUUID = @RegionUUID order by Revision desc"; |
@@ -502,9 +502,9 @@ ELSE | |||
502 | { | 502 | { |
503 | MemoryStream str = new MemoryStream((byte[])reader["Heightfield"]); | 503 | MemoryStream str = new MemoryStream((byte[])reader["Heightfield"]); |
504 | BinaryReader br = new BinaryReader(str); | 504 | BinaryReader br = new BinaryReader(str); |
505 | for (int x = 0; x < 256; x++) | 505 | for (int x = 0; x < (int)Constants.RegionSize; x++) |
506 | { | 506 | { |
507 | for (int y = 0; y < 256; y++) | 507 | for (int y = 0; y < (int)Constants.RegionSize; y++) |
508 | { | 508 | { |
509 | terrain[x, y] = br.ReadDouble(); | 509 | terrain[x, y] = br.ReadDouble(); |
510 | } | 510 | } |
@@ -749,12 +749,12 @@ VALUES | |||
749 | /// <returns></returns> | 749 | /// <returns></returns> |
750 | private static Array serializeTerrain(double[,] val) | 750 | private static Array serializeTerrain(double[,] val) |
751 | { | 751 | { |
752 | MemoryStream str = new MemoryStream(65536 * sizeof(double)); | 752 | MemoryStream str = new MemoryStream(((int)Constants.RegionSize * (int)Constants.RegionSize) * sizeof(double)); |
753 | BinaryWriter bw = new BinaryWriter(str); | 753 | BinaryWriter bw = new BinaryWriter(str); |
754 | 754 | ||
755 | // TODO: COMPATIBILITY - Add byte-order conversions | 755 | // TODO: COMPATIBILITY - Add byte-order conversions |
756 | for (int x = 0; x < 256; x++) | 756 | for (int x = 0; x < (int)Constants.RegionSize; x++) |
757 | for (int y = 0; y < 256; y++) | 757 | for (int y = 0; y < (int)Constants.RegionSize; y++) |
758 | { | 758 | { |
759 | double height = val[x, y]; | 759 | double height = val[x, y]; |
760 | if (height == 0.0) | 760 | if (height == 0.0) |
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) |
diff --git a/OpenSim/Data/NHibernate/NHibernateRegionData.cs b/OpenSim/Data/NHibernate/NHibernateRegionData.cs index 3f04f68..26ec500 100644 --- a/OpenSim/Data/NHibernate/NHibernateRegionData.cs +++ b/OpenSim/Data/NHibernate/NHibernateRegionData.cs | |||
@@ -376,8 +376,8 @@ namespace OpenSim.Data.NHibernate | |||
376 | // BinaryWriter bw = new BinaryWriter(str); | 376 | // BinaryWriter bw = new BinaryWriter(str); |
377 | // | 377 | // |
378 | // // TODO: COMPATIBILITY - Add byte-order conversions | 378 | // // TODO: COMPATIBILITY - Add byte-order conversions |
379 | // for (int x = 0; x < 256; x++) | 379 | // for (int x = 0; x < (int)Constants.RegionSize; x++) |
380 | // for (int y = 0; y < 256; y++) | 380 | // for (int y = 0; y < (int)Constants.RegionSize; y++) |
381 | // bw.Write(val[x, y]); | 381 | // bw.Write(val[x, y]); |
382 | // | 382 | // |
383 | // return str.ToArray(); | 383 | // return str.ToArray(); |
diff --git a/OpenSim/Data/SQLite/SQLiteRegionData.cs b/OpenSim/Data/SQLite/SQLiteRegionData.cs index 2f9f59d..3555caf 100644 --- a/OpenSim/Data/SQLite/SQLiteRegionData.cs +++ b/OpenSim/Data/SQLite/SQLiteRegionData.cs | |||
@@ -571,7 +571,7 @@ namespace OpenSim.Data.SQLite | |||
571 | { | 571 | { |
572 | lock (ds) | 572 | lock (ds) |
573 | { | 573 | { |
574 | double[,] terret = new double[256,256]; | 574 | double[,] terret = new double[(int)Constants.RegionSize, (int)Constants.RegionSize]; |
575 | terret.Initialize(); | 575 | terret.Initialize(); |
576 | 576 | ||
577 | String sql = "select RegionUUID, Revision, Heightfield from terrain" + | 577 | String sql = "select RegionUUID, Revision, Heightfield from terrain" + |
@@ -589,9 +589,9 @@ namespace OpenSim.Data.SQLite | |||
589 | // TODO: put this into a function | 589 | // TODO: put this into a function |
590 | MemoryStream str = new MemoryStream((byte[]) row["Heightfield"]); | 590 | MemoryStream str = new MemoryStream((byte[]) row["Heightfield"]); |
591 | BinaryReader br = new BinaryReader(str); | 591 | BinaryReader br = new BinaryReader(str); |
592 | for (int x = 0; x < 256; x++) | 592 | for (int x = 0; x < (int)Constants.RegionSize; x++) |
593 | { | 593 | { |
594 | for (int y = 0; y < 256; y++) | 594 | for (int y = 0; y < (int)Constants.RegionSize; y++) |
595 | { | 595 | { |
596 | terret[x, y] = br.ReadDouble(); | 596 | terret[x, y] = br.ReadDouble(); |
597 | } | 597 | } |
@@ -1427,12 +1427,12 @@ namespace OpenSim.Data.SQLite | |||
1427 | /// <returns></returns> | 1427 | /// <returns></returns> |
1428 | private static Array serializeTerrain(double[,] val) | 1428 | private static Array serializeTerrain(double[,] val) |
1429 | { | 1429 | { |
1430 | MemoryStream str = new MemoryStream(65536*sizeof (double)); | 1430 | MemoryStream str = new MemoryStream(((int)Constants.RegionSize * (int)Constants.RegionSize) *sizeof (double)); |
1431 | BinaryWriter bw = new BinaryWriter(str); | 1431 | BinaryWriter bw = new BinaryWriter(str); |
1432 | 1432 | ||
1433 | // TODO: COMPATIBILITY - Add byte-order conversions | 1433 | // TODO: COMPATIBILITY - Add byte-order conversions |
1434 | for (int x = 0; x < 256; x++) | 1434 | for (int x = 0; x < (int)Constants.RegionSize; x++) |
1435 | for (int y = 0; y < 256; y++) | 1435 | for (int y = 0; y < (int)Constants.RegionSize; y++) |
1436 | bw.Write(val[x, y]); | 1436 | bw.Write(val[x, y]); |
1437 | 1437 | ||
1438 | return str.ToArray(); | 1438 | return str.ToArray(); |
@@ -1443,12 +1443,12 @@ namespace OpenSim.Data.SQLite | |||
1443 | // row["RegionUUID"] = regionUUID; | 1443 | // row["RegionUUID"] = regionUUID; |
1444 | // row["Revision"] = rev; | 1444 | // row["Revision"] = rev; |
1445 | 1445 | ||
1446 | // MemoryStream str = new MemoryStream(65536*sizeof (double)); | 1446 | // MemoryStream str = new MemoryStream(((int)Constants.RegionSize * (int)Constants.RegionSize )*sizeof (double)); |
1447 | // BinaryWriter bw = new BinaryWriter(str); | 1447 | // BinaryWriter bw = new BinaryWriter(str); |
1448 | 1448 | ||
1449 | // // TODO: COMPATIBILITY - Add byte-order conversions | 1449 | // // TODO: COMPATIBILITY - Add byte-order conversions |
1450 | // for (int x = 0; x < 256; x++) | 1450 | // for (int x = 0; x < (int)Constants.RegionSize; x++) |
1451 | // for (int y = 0; y < 256; y++) | 1451 | // for (int y = 0; y < (int)Constants.RegionSize; y++) |
1452 | // bw.Write(val[x, y]); | 1452 | // bw.Write(val[x, y]); |
1453 | 1453 | ||
1454 | // row["Heightfield"] = str.ToArray(); | 1454 | // row["Heightfield"] = str.ToArray(); |