diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Constants.cs | 4 | ||||
-rw-r--r-- | OpenSim/Framework/IClientAPI.cs | 4 | ||||
-rw-r--r-- | OpenSim/Framework/TerrainData.cs | 39 |
3 files changed, 30 insertions, 17 deletions
diff --git a/OpenSim/Framework/Constants.cs b/OpenSim/Framework/Constants.cs index 209c991..d6bfed4 100644 --- a/OpenSim/Framework/Constants.cs +++ b/OpenSim/Framework/Constants.cs | |||
@@ -103,8 +103,8 @@ namespace OpenSim.Framework | |||
103 | /// <summary>Finished, Same Sim</summary> | 103 | /// <summary>Finished, Same Sim</summary> |
104 | FinishedViaSameSim = 1 << 29, | 104 | FinishedViaSameSim = 1 << 29, |
105 | /// <summary>Agent coming into the grid from another grid</summary> | 105 | /// <summary>Agent coming into the grid from another grid</summary> |
106 | ViaHGLogin = 1 << 30 | 106 | ViaHGLogin = 1 << 30, |
107 | notViaHGLogin = 0xbffffff | ||
107 | } | 108 | } |
108 | |||
109 | } | 109 | } |
110 | } | 110 | } |
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 9ab1092..252ee3e 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs | |||
@@ -1146,8 +1146,8 @@ namespace OpenSim.Framework | |||
1146 | 1146 | ||
1147 | bool CanSendLayerData(); | 1147 | bool CanSendLayerData(); |
1148 | 1148 | ||
1149 | void SendLayerData(float[] map); | 1149 | void SendLayerData(); |
1150 | void SendLayerData(int px, int py, float[] map); | 1150 | void SendLayerData(int[] map); |
1151 | 1151 | ||
1152 | void SendWindData(int version, Vector2[] windSpeeds); | 1152 | void SendWindData(int version, Vector2[] windSpeeds); |
1153 | void SendCloudData(int version, float[] cloudCover); | 1153 | void SendCloudData(int version, float[] cloudCover); |
diff --git a/OpenSim/Framework/TerrainData.cs b/OpenSim/Framework/TerrainData.cs index f99dd00..7b99427 100644 --- a/OpenSim/Framework/TerrainData.cs +++ b/OpenSim/Framework/TerrainData.cs | |||
@@ -82,7 +82,7 @@ namespace OpenSim.Framework | |||
82 | public abstract double[,] GetDoubles(); | 82 | public abstract double[,] GetDoubles(); |
83 | 83 | ||
84 | public abstract void GetPatchMinMax(int px, int py, out float zmin, out float zmax); | 84 | public abstract void GetPatchMinMax(int px, int py, out float zmin, out float zmax); |
85 | public abstract void GetPatchBlock(ref float[] block, int px, int py, float sub, float premult); | 85 | public abstract void GetPatchBlock(float[] block, int px, int py, float sub, float premult); |
86 | 86 | ||
87 | public abstract TerrainData Clone(); | 87 | public abstract TerrainData Clone(); |
88 | } | 88 | } |
@@ -279,34 +279,47 @@ namespace OpenSim.Framework | |||
279 | return ret; | 279 | return ret; |
280 | } | 280 | } |
281 | 281 | ||
282 | public override void GetPatchMinMax(int px, int py, out float zmin, out float zmax) | 282 | public override unsafe void GetPatchMinMax(int px, int py, out float zmin, out float zmax) |
283 | { | 283 | { |
284 | zmax = float.MinValue; | 284 | zmax = float.MinValue; |
285 | zmin = float.MaxValue; | 285 | zmin = float.MaxValue; |
286 | 286 | ||
287 | int startx = px * 16; | 287 | int stride = m_heightmap.GetLength(1); |
288 | |||
289 | int startx = px * 16 * stride; | ||
290 | int endx = (px + 1) * 16 * stride; | ||
288 | int starty = py * 16; | 291 | int starty = py * 16; |
289 | for (int i = startx; i < startx + 16; i++) | 292 | fixed (float* map = m_heightmap) |
290 | { | 293 | { |
291 | for (int j = starty; j < starty + 16; j++) | 294 | for (int i = startx; i < endx; i += stride) |
292 | { | 295 | { |
293 | float val = m_heightmap[i, j]; | 296 | float* p = &map[i]; |
294 | if (val > zmax) zmax = val; | 297 | for (int j = starty; j < starty + 16; j++) |
295 | if (val < zmin) zmin = val; | 298 | { |
299 | float val = p[j]; | ||
300 | if (val > zmax) zmax = val; | ||
301 | if (val < zmin) zmin = val; | ||
302 | } | ||
296 | } | 303 | } |
297 | } | 304 | } |
298 | } | 305 | } |
299 | 306 | ||
300 | public override void GetPatchBlock(ref float[] block, int px, int py, float sub, float premult) | 307 | public override unsafe void GetPatchBlock(float[] _block, int px, int py, float sub, float premult) |
301 | { | 308 | { |
302 | int k = 0; | 309 | int k = 0; |
303 | int startX = px * 16; | 310 | int stride = m_heightmap.GetLength(1); |
311 | |||
312 | int startX = px * 16 * stride; | ||
313 | int endX = (px + 1) * 16 * stride; | ||
304 | int startY = py * 16; | 314 | int startY = py * 16; |
305 | for (int y = startY; y < startY + 16; y++) | 315 | fixed(float* block = _block, map = m_heightmap) |
306 | { | 316 | { |
307 | for (int x = startX; x < startX + 16; x++) | 317 | for (int y = startY; y < startY + 16; y++) |
308 | { | 318 | { |
309 | block[k++] = (m_heightmap[x, y] - sub) * premult; | 319 | for (int x = startX; x < endX; x += stride) |
320 | { | ||
321 | block[k++] = (map[x + y] - sub) * premult; | ||
322 | } | ||
310 | } | 323 | } |
311 | } | 324 | } |
312 | } | 325 | } |