diff options
author | UbitUmarov | 2015-08-25 16:51:48 +0100 |
---|---|---|
committer | UbitUmarov | 2015-08-25 16:51:48 +0100 |
commit | 244f0c6352a920b8bba5e13fadda49cb5b368e06 (patch) | |
tree | 92d97bde9369dd1e7541f9b6e44d770b429fe503 /OpenSim/Region | |
parent | terrain stored as ushorts with gzip compression (diff) | |
download | opensim-SC-244f0c6352a920b8bba5e13fadda49cb5b368e06.zip opensim-SC-244f0c6352a920b8bba5e13fadda49cb5b368e06.tar.gz opensim-SC-244f0c6352a920b8bba5e13fadda49cb5b368e06.tar.bz2 opensim-SC-244f0c6352a920b8bba5e13fadda49cb5b368e06.tar.xz |
change terrain internal representation to float. ushort work with legal
sl terrain, but may break existent terrain and that may cost a lot more
than the cost of memory
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs | 28 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/TerrainChannel.cs | 4 |
2 files changed, 2 insertions, 30 deletions
diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs index 135fe50..0209d16 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs | |||
@@ -1349,13 +1349,6 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
1349 | double desiredMin = (double)args[0]; | 1349 | double desiredMin = (double)args[0]; |
1350 | double desiredMax = (double)args[1]; | 1350 | double desiredMax = (double)args[1]; |
1351 | 1351 | ||
1352 | if (desiredMin < 0 || desiredMin > 655.35 | ||
1353 | || desiredMax < 0 || desiredMax > 655.35) | ||
1354 | { | ||
1355 | m_log.Error("desired Min and Max must be in range 0.0 to 655.0m"); | ||
1356 | return; | ||
1357 | } | ||
1358 | |||
1359 | // determine desired scaling factor | 1352 | // determine desired scaling factor |
1360 | double desiredRange = desiredMax - desiredMin; | 1353 | double desiredRange = desiredMax - desiredMin; |
1361 | //m_log.InfoFormat("Desired {0}, {1} = {2}", new Object[] { desiredMin, desiredMax, desiredRange }); | 1354 | //m_log.InfoFormat("Desired {0}, {1} = {2}", new Object[] { desiredMin, desiredMax, desiredRange }); |
@@ -1413,11 +1406,6 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
1413 | private void InterfaceElevateTerrain(Object[] args) | 1406 | private void InterfaceElevateTerrain(Object[] args) |
1414 | { | 1407 | { |
1415 | double val = (double)args[0]; | 1408 | double val = (double)args[0]; |
1416 | if (val < 0 || val > 655.35) | ||
1417 | { | ||
1418 | m_log.Error("elevation must be in range 0.0 to 655.0m"); | ||
1419 | return; | ||
1420 | } | ||
1421 | 1409 | ||
1422 | int x, y; | 1410 | int x, y; |
1423 | for (x = 0; x < m_channel.Width; x++) | 1411 | for (x = 0; x < m_channel.Width; x++) |
@@ -1439,7 +1427,6 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
1439 | { | 1427 | { |
1440 | int x, y; | 1428 | int x, y; |
1441 | double val = (double)args[0]; | 1429 | double val = (double)args[0]; |
1442 | if (val < 0 || val > 655.35) | ||
1443 | 1430 | ||
1444 | for (x = 0; x < m_channel.Width; x++) | 1431 | for (x = 0; x < m_channel.Width; x++) |
1445 | for (y = 0; y < m_channel.Height; y++) | 1432 | for (y = 0; y < m_channel.Height; y++) |
@@ -1450,11 +1437,6 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
1450 | { | 1437 | { |
1451 | int x, y; | 1438 | int x, y; |
1452 | double val = (double)args[0]; | 1439 | double val = (double)args[0]; |
1453 | if (val < 0 || val > 655.35) | ||
1454 | { | ||
1455 | m_log.Error("height must be in range 0.0 to 655.0m"); | ||
1456 | return; | ||
1457 | } | ||
1458 | 1440 | ||
1459 | for (x = 0; x < m_channel.Width; x++) | 1441 | for (x = 0; x < m_channel.Width; x++) |
1460 | for (y = 0; y < m_channel.Height; y++) | 1442 | for (y = 0; y < m_channel.Height; y++) |
@@ -1465,11 +1447,6 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
1465 | { | 1447 | { |
1466 | int x, y; | 1448 | int x, y; |
1467 | double val = (double)args[0]; | 1449 | double val = (double)args[0]; |
1468 | if (val < 0 || val > 655.35) | ||
1469 | { | ||
1470 | m_log.Error("minimum must be in range 0.0 to 655.0m"); | ||
1471 | return; | ||
1472 | } | ||
1473 | for (x = 0; x < m_channel.Width; x++) | 1450 | for (x = 0; x < m_channel.Width; x++) |
1474 | { | 1451 | { |
1475 | for (y = 0; y < m_channel.Height; y++) | 1452 | for (y = 0; y < m_channel.Height; y++) |
@@ -1483,11 +1460,6 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
1483 | { | 1460 | { |
1484 | int x, y; | 1461 | int x, y; |
1485 | double val = (double)args[0]; | 1462 | double val = (double)args[0]; |
1486 | if (val < 0 || val > 655.35) | ||
1487 | { | ||
1488 | m_log.Error("maximum must be in range 0.0 to 655.0m"); | ||
1489 | return; | ||
1490 | } | ||
1491 | for (x = 0; x < m_channel.Width; x++) | 1463 | for (x = 0; x < m_channel.Width; x++) |
1492 | { | 1464 | { |
1493 | for (y = 0; y < m_channel.Height; y++) | 1465 | for (y = 0; y < m_channel.Height; y++) |
diff --git a/OpenSim/Region/Framework/Scenes/TerrainChannel.cs b/OpenSim/Region/Framework/Scenes/TerrainChannel.cs index 75c3a3b..6abdc29 100644 --- a/OpenSim/Region/Framework/Scenes/TerrainChannel.cs +++ b/OpenSim/Region/Framework/Scenes/TerrainChannel.cs | |||
@@ -367,8 +367,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
367 | public int SizeY; | 367 | public int SizeY; |
368 | public int SizeZ; | 368 | public int SizeZ; |
369 | public float CompressionFactor; | 369 | public float CompressionFactor; |
370 | public ushort[] Map; | 370 | public float[] Map; |
371 | public TerrainChannelXMLPackage(int pX, int pY, int pZ, float pCompressionFactor, ushort[] pMap) | 371 | public TerrainChannelXMLPackage(int pX, int pY, int pZ, float pCompressionFactor, float[] pMap) |
372 | { | 372 | { |
373 | Version = 1; | 373 | Version = 1; |
374 | SizeX = pX; | 374 | SizeX = pX; |