diff options
author | UbitUmarov | 2019-11-10 00:47:40 +0000 |
---|---|---|
committer | UbitUmarov | 2019-11-10 00:47:40 +0000 |
commit | f6ea22647dc42a2e29d05219ffa89b59ed748da6 (patch) | |
tree | 711ebaf17d0275d0e2de5ee5a9ad6ce9262145d8 | |
parent | terraforming changes: missing file (diff) | |
download | opensim-SC-f6ea22647dc42a2e29d05219ffa89b59ed748da6.zip opensim-SC-f6ea22647dc42a2e29d05219ffa89b59ed748da6.tar.gz opensim-SC-f6ea22647dc42a2e29d05219ffa89b59ed748da6.tar.bz2 opensim-SC-f6ea22647dc42a2e29d05219ffa89b59ed748da6.tar.xz |
terraforming changes: make jenkis happy
4 files changed, 12 insertions, 12 deletions
diff --git a/OpenSim/Region/CoreModules/World/Terrain/FloodBrushes/LowerArea.cs b/OpenSim/Region/CoreModules/World/Terrain/FloodBrushes/LowerArea.cs index 8020962..ecf7dfb 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/FloodBrushes/LowerArea.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/FloodBrushes/LowerArea.cs | |||
@@ -37,15 +37,15 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FloodBrushes | |||
37 | int startX, int endX, int startY, int endY) | 37 | int startX, int endX, int startY, int endY) |
38 | { | 38 | { |
39 | int x,y; | 39 | int x,y; |
40 | for (x = startX; x <= endX; x++) | 40 | for (x = startX; x <= endX; ++x) |
41 | { | 41 | { |
42 | for (y = startY; y <= endY; y++) | 42 | for (y = startY; y <= endY; ++y) |
43 | { | 43 | { |
44 | if (fillArea[x, y]) | 44 | if (fillArea[x, y]) |
45 | { | 45 | { |
46 | map[x, y] -= strength; | 46 | map[x, y] -= strength; |
47 | if (map[x, y] < -100f) | 47 | if (map[x, y] < 0f) |
48 | map[x, y] = -100f; | 48 | map[x, y] = 0f; |
49 | } | 49 | } |
50 | } | 50 | } |
51 | } | 51 | } |
diff --git a/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/LowerSphere.cs b/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/LowerSphere.cs index 68c6151..5a31a60 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/LowerSphere.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/LowerSphere.cs | |||
@@ -54,8 +54,8 @@ namespace OpenSim.Region.CoreModules.World.Terrain.PaintBrushes | |||
54 | if (distancefactor > 0.0) | 54 | if (distancefactor > 0.0) |
55 | { | 55 | { |
56 | double newz = map[x, y] - distancefactor * strength; | 56 | double newz = map[x, y] - distancefactor * strength; |
57 | if (newz <= -100f) | 57 | if (newz <= 0f) |
58 | map[x, y] = -100f; | 58 | map[x, y] = 0f; |
59 | else | 59 | else |
60 | map[x, y] = newz; | 60 | map[x, y] = newz; |
61 | } | 61 | } |
diff --git a/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/RaiseSphere.cs b/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/RaiseSphere.cs index 2155368..e277363 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/RaiseSphere.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/RaiseSphere.cs | |||
@@ -43,14 +43,14 @@ namespace OpenSim.Region.CoreModules.World.Terrain.PaintBrushes | |||
43 | 43 | ||
44 | int x, y; | 44 | int x, y; |
45 | 45 | ||
46 | for (x = startX; x <= endX; x++) | 46 | for (x = startX; x <= endX; ++x) |
47 | { | 47 | { |
48 | for (y = startY; y <= endY; y++) | 48 | for (y = startY; y <= endY; ++y) |
49 | { | 49 | { |
50 | if (!mask[x, y]) | 50 | if (!mask[x, y]) |
51 | continue; | 51 | continue; |
52 | 52 | ||
53 | // Calculate a cos-sphere and add it to the heighmap | 53 | // Calculate a cos-sphere and add it to the heighmap |
54 | double r = Math.Sqrt((x - rx) * (x - rx) + (y - ry) * (y - ry)); | 54 | double r = Math.Sqrt((x - rx) * (x - rx) + (y - ry) * (y - ry)); |
55 | double distancefactor = Math.Cos(r * size); | 55 | double distancefactor = Math.Cos(r * size); |
56 | if (distancefactor > 0.0) | 56 | if (distancefactor > 0.0) |
diff --git a/OpenSim/Region/CoreModules/World/Terrain/Tests/TerrainTest.cs b/OpenSim/Region/CoreModules/World/Terrain/Tests/TerrainTest.cs index 3edef3a..b39e0a2 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/Tests/TerrainTest.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/Tests/TerrainTest.cs | |||
@@ -60,10 +60,10 @@ namespace OpenSim.Region.CoreModules.World.Terrain.Tests | |||
60 | TerrainChannel map = new TerrainChannel((int)Constants.RegionSize, (int)Constants.RegionSize); | 60 | TerrainChannel map = new TerrainChannel((int)Constants.RegionSize, (int)Constants.RegionSize); |
61 | ITerrainPaintableEffect effect = new RaiseSphere(); | 61 | ITerrainPaintableEffect effect = new RaiseSphere(); |
62 | 62 | ||
63 | effect.PaintEffect(map, allowMask, midRegion, midRegion, -1.0f, 2, 6.0f, | 63 | effect.PaintEffect(map, allowMask, midRegion, midRegion, -1.0f, 5, 6.0f, |
64 | 0, midRegion - 1,0, (int)Constants.RegionSize -1); | 64 | 0, midRegion - 1,0, (int)Constants.RegionSize -1); |
65 | Assert.That(map[127, midRegion] > 0.0, "Raise brush should raising value at this point (127,128)."); | 65 | Assert.That(map[127, midRegion] > 0.0, "Raise brush should raising value at this point (127,128)."); |
66 | Assert.That(map[125, midRegion] > 0.0, "Raise brush should raising value at this point (124,128)."); | 66 | Assert.That(map[124, midRegion] > 0.0, "Raise brush should raising value at this point (124,128)."); |
67 | Assert.That(map[120, midRegion] == 0.0, "Raise brush should not change value at this point (120,128)."); | 67 | Assert.That(map[120, midRegion] == 0.0, "Raise brush should not change value at this point (120,128)."); |
68 | Assert.That(map[128, midRegion] == 0.0, "Raise brush should not change value at this point (128,128)."); | 68 | Assert.That(map[128, midRegion] == 0.0, "Raise brush should not change value at this point (128,128)."); |
69 | // Assert.That(map[0, midRegion] == 0.0, "Raise brush should not change value at this point (0,128)."); | 69 | // Assert.That(map[0, midRegion] == 0.0, "Raise brush should not change value at this point (0,128)."); |
@@ -80,7 +80,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.Tests | |||
80 | } | 80 | } |
81 | effect = new LowerSphere(); | 81 | effect = new LowerSphere(); |
82 | 82 | ||
83 | effect.PaintEffect(map, allowMask, midRegion, midRegion, -1.0f, 2, 6.0f, | 83 | effect.PaintEffect(map, allowMask, midRegion, midRegion, -1.0f, 5, 6.0f, |
84 | 0, (int)Constants.RegionSize -1,0, (int)Constants.RegionSize -1); | 84 | 0, (int)Constants.RegionSize -1,0, (int)Constants.RegionSize -1); |
85 | Assert.That(map[127, midRegion] >= 0.0, "Lower should not lowering value below 0.0 at this point (127,128)."); | 85 | Assert.That(map[127, midRegion] >= 0.0, "Lower should not lowering value below 0.0 at this point (127,128)."); |
86 | Assert.That(map[127, midRegion] == 0.0, "Lower brush should lowering value to 0.0 at this point (127,128)."); | 86 | Assert.That(map[127, midRegion] == 0.0, "Lower brush should lowering value to 0.0 at this point (127,128)."); |