aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/TerrainCompressor.cs24
1 files changed, 2 insertions, 22 deletions
diff --git a/OpenSim/Region/Framework/Scenes/TerrainCompressor.cs b/OpenSim/Region/Framework/Scenes/TerrainCompressor.cs
index 8d79a86..d3f2737 100644
--- a/OpenSim/Region/Framework/Scenes/TerrainCompressor.cs
+++ b/OpenSim/Region/Framework/Scenes/TerrainCompressor.cs
@@ -256,18 +256,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
256 float zmax = float.MinValue; 256 float zmax = float.MinValue;
257 float zmin = float.MaxValue; 257 float zmin = float.MaxValue;
258 258
259 int startx = patchX * 16; 259 terrData.GetPatchMinMax(patchX, patchY, out zmin, out zmax);
260 int starty = patchY * 16;
261
262 for (int i = startx; i < startx + 16; i++)
263 {
264 for (int j = starty; j < starty + 16; j++)
265 {
266 float val = terrData[i, j];
267 if (val > zmax) zmax = val;
268 if (val < zmin) zmin = val;
269 }
270 }
271 260
272 header.DCOffset = zmin; 261 header.DCOffset = zmin;
273 frange = ((zmax - zmin) + 1.0f); 262 frange = ((zmax - zmin) + 1.0f);
@@ -380,16 +369,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
380 header.QuantWBits = wordsize; 369 header.QuantWBits = wordsize;
381 header.QuantWBits |= wordsize << 4; 370 header.QuantWBits |= wordsize << 4;
382 371
383 int k = 0; 372 terrData.GetPatchBlock(ref block, patchX, patchY, sub, premult);
384 int startX = patchX * 16;
385 int startY = patchY * 16;
386 for (int y = startY; y < startY + 16; y++)
387 {
388 for (int x = startX; x < startX + 16; x++)
389 {
390 block[k++] = (terrData[x, y] - sub) * premult;
391 }
392 }
393 373
394 wbits = (prequant >> 1); 374 wbits = (prequant >> 1);
395 375