From c8a68fb3fbac0d99b53a62bb062232c0d5695d3c Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Fri, 7 Aug 2009 18:40:56 -0400 Subject: * Remove hard coded 256 limitations from various places. There's no more 256m limitation within the OpenSimulator framework, however, the LLClient ClientView does not support regions larger then 256 meters so, if you try and make your region larger by setting Constants.RegionSize = 512; in OpenSim.Framework.Constants.cs, the terrain will not display on clients using the LLUDP protocol --- OpenSim/Data/MSSQL/MSSQLRegionData.cs | 12 ++++++------ OpenSim/Data/MySQL/MySQLRegionData.cs | 12 ++++++------ OpenSim/Data/NHibernate/NHibernateRegionData.cs | 4 ++-- OpenSim/Data/SQLite/SQLiteRegionData.cs | 18 +++++++++--------- 4 files changed, 23 insertions(+), 23 deletions(-) (limited to 'OpenSim/Data') 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 /// public double[,] LoadTerrain(UUID regionID) { - double[,] terrain = new double[256, 256]; + double[,] terrain = new double[(int)Constants.RegionSize, (int)Constants.RegionSize]; terrain.Initialize(); string sql = "select top 1 RegionUUID, Revision, Heightfield from terrain where RegionUUID = @RegionUUID order by Revision desc"; @@ -502,9 +502,9 @@ ELSE { MemoryStream str = new MemoryStream((byte[])reader["Heightfield"]); BinaryReader br = new BinaryReader(str); - for (int x = 0; x < 256; x++) + for (int x = 0; x < (int)Constants.RegionSize; x++) { - for (int y = 0; y < 256; y++) + for (int y = 0; y < (int)Constants.RegionSize; y++) { terrain[x, y] = br.ReadDouble(); } @@ -749,12 +749,12 @@ VALUES /// private static Array serializeTerrain(double[,] val) { - MemoryStream str = new MemoryStream(65536 * sizeof(double)); + MemoryStream str = new MemoryStream(((int)Constants.RegionSize * (int)Constants.RegionSize) * sizeof(double)); BinaryWriter bw = new BinaryWriter(str); // TODO: COMPATIBILITY - Add byte-order conversions - for (int x = 0; x < 256; x++) - for (int y = 0; y < 256; y++) + for (int x = 0; x < (int)Constants.RegionSize; x++) + for (int y = 0; y < (int)Constants.RegionSize; y++) { double height = val[x, y]; 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 { while (reader.Read()) { - terrain = new double[256,256]; + terrain = new double[(int)Constants.RegionSize, (int)Constants.RegionSize]; terrain.Initialize(); MemoryStream mstr = new MemoryStream((byte[]) reader["Heightfield"]); int rev = 0; BinaryReader br = new BinaryReader(mstr); - for (int x = 0; x < 256; x++) + for (int x = 0; x < (int)Constants.RegionSize; x++) { - for (int y = 0; y < 256; y++) + for (int y = 0; y < (int)Constants.RegionSize; y++) { terrain[x, y] = br.ReadDouble(); } @@ -1141,12 +1141,12 @@ namespace OpenSim.Data.MySQL /// private static Array SerializeTerrain(double[,] val) { - MemoryStream str = new MemoryStream(65536*sizeof (double)); + MemoryStream str = new MemoryStream(((int)Constants.RegionSize * (int)Constants.RegionSize) *sizeof (double)); BinaryWriter bw = new BinaryWriter(str); // TODO: COMPATIBILITY - Add byte-order conversions - for (int x = 0; x < 256; x++) - for (int y = 0; y < 256; y++) + for (int x = 0; x < (int)Constants.RegionSize; x++) + for (int y = 0; y < (int)Constants.RegionSize; y++) { double height = val[x, y]; 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 // BinaryWriter bw = new BinaryWriter(str); // // // TODO: COMPATIBILITY - Add byte-order conversions -// for (int x = 0; x < 256; x++) -// for (int y = 0; y < 256; y++) +// for (int x = 0; x < (int)Constants.RegionSize; x++) +// for (int y = 0; y < (int)Constants.RegionSize; y++) // bw.Write(val[x, y]); // // 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 { lock (ds) { - double[,] terret = new double[256,256]; + double[,] terret = new double[(int)Constants.RegionSize, (int)Constants.RegionSize]; terret.Initialize(); String sql = "select RegionUUID, Revision, Heightfield from terrain" + @@ -589,9 +589,9 @@ namespace OpenSim.Data.SQLite // TODO: put this into a function MemoryStream str = new MemoryStream((byte[]) row["Heightfield"]); BinaryReader br = new BinaryReader(str); - for (int x = 0; x < 256; x++) + for (int x = 0; x < (int)Constants.RegionSize; x++) { - for (int y = 0; y < 256; y++) + for (int y = 0; y < (int)Constants.RegionSize; y++) { terret[x, y] = br.ReadDouble(); } @@ -1427,12 +1427,12 @@ namespace OpenSim.Data.SQLite /// private static Array serializeTerrain(double[,] val) { - MemoryStream str = new MemoryStream(65536*sizeof (double)); + MemoryStream str = new MemoryStream(((int)Constants.RegionSize * (int)Constants.RegionSize) *sizeof (double)); BinaryWriter bw = new BinaryWriter(str); // TODO: COMPATIBILITY - Add byte-order conversions - for (int x = 0; x < 256; x++) - for (int y = 0; y < 256; y++) + for (int x = 0; x < (int)Constants.RegionSize; x++) + for (int y = 0; y < (int)Constants.RegionSize; y++) bw.Write(val[x, y]); return str.ToArray(); @@ -1443,12 +1443,12 @@ namespace OpenSim.Data.SQLite // row["RegionUUID"] = regionUUID; // row["Revision"] = rev; -// MemoryStream str = new MemoryStream(65536*sizeof (double)); + // MemoryStream str = new MemoryStream(((int)Constants.RegionSize * (int)Constants.RegionSize )*sizeof (double)); // BinaryWriter bw = new BinaryWriter(str); // // TODO: COMPATIBILITY - Add byte-order conversions -// for (int x = 0; x < 256; x++) -// for (int y = 0; y < 256; y++) + // for (int x = 0; x < (int)Constants.RegionSize; x++) + // for (int y = 0; y < (int)Constants.RegionSize; y++) // bw.Write(val[x, y]); // row["Heightfield"] = str.ToArray(); -- cgit v1.1