diff options
author | Adam Frisby | 2009-04-01 05:58:07 +0000 |
---|---|---|
committer | Adam Frisby | 2009-04-01 05:58:07 +0000 |
commit | 5225e40f9e2cfdbc5a14099f45e794ed208838f5 (patch) | |
tree | 5669e6208ca03c860082ac7c08fc82923c473f49 /OpenSim/Data/NHibernate/Terrain.cs | |
parent | Finally clean up the Scene.Permissions and permissions module. (diff) | |
download | opensim-SC-5225e40f9e2cfdbc5a14099f45e794ed208838f5.zip opensim-SC-5225e40f9e2cfdbc5a14099f45e794ed208838f5.tar.gz opensim-SC-5225e40f9e2cfdbc5a14099f45e794ed208838f5.tar.bz2 opensim-SC-5225e40f9e2cfdbc5a14099f45e794ed208838f5.tar.xz |
* Removes some hard-coded magic numbers relating to RegionSize. We now use Constants.RegionSize as expected. (Working towards enlarged or smaller regionsizes that arent multiples of 256m)
* Adds minor functionality to MRM Scripting.
Diffstat (limited to 'OpenSim/Data/NHibernate/Terrain.cs')
-rw-r--r-- | OpenSim/Data/NHibernate/Terrain.cs | 12 |
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) |