diff options
Diffstat (limited to 'OpenSim/Region/Environment/Modules/World/Terrain/Tests')
-rw-r--r-- | OpenSim/Region/Environment/Modules/World/Terrain/Tests/TerrainTest.cs | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/Tests/TerrainTest.cs b/OpenSim/Region/Environment/Modules/World/Terrain/Tests/TerrainTest.cs index eaa674e..71ea07d 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/Tests/TerrainTest.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/Tests/TerrainTest.cs | |||
@@ -37,19 +37,30 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.Tests | |||
37 | [Test] | 37 | [Test] |
38 | public void BrushTest() | 38 | public void BrushTest() |
39 | { | 39 | { |
40 | TerrainChannel x = new TerrainChannel(256, 256); | 40 | TerrainChannel map = new TerrainChannel(256, 256); |
41 | bool[,] allowMask = new bool[map.Width,map.Height]; | ||
42 | int x; | ||
43 | int y; | ||
44 | for (x=0; x<map.Width; x++) | ||
45 | { | ||
46 | for (y=0; y<map.Height; y++) | ||
47 | { | ||
48 | allowMask[x,y] = true; | ||
49 | } | ||
50 | } | ||
51 | |||
41 | ITerrainPaintableEffect effect = new RaiseSphere(); | 52 | ITerrainPaintableEffect effect = new RaiseSphere(); |
42 | 53 | ||
43 | effect.PaintEffect(x, 128.0, 128.0, 100, 0.1); | 54 | effect.PaintEffect(map, allowMask, 128.0, 128.0, 23.0, 50, 0.1); |
44 | Assert.That(x[128, 128] > 0.0, "Raise brush not raising values."); | 55 | Assert.That(map[128, 128] > 0.0, "Raise brush not raising values."); |
45 | Assert.That(x[0, 128] > 0.0, "Raise brush lowering edge values."); | 56 | Assert.That(map[0, 128] > 0.0, "Raise brush lowering edge values."); |
46 | 57 | ||
47 | x = new TerrainChannel(256, 256); | 58 | map = new TerrainChannel(256, 256); |
48 | effect = new LowerSphere(); | 59 | effect = new LowerSphere(); |
49 | 60 | ||
50 | effect.PaintEffect(x, 128.0, 128.0, 100, 0.1); | 61 | effect.PaintEffect(map, allowMask, 128.0, 128.0, -1, 50, 0.1); |
51 | Assert.That(x[128, 128] < 0.0, "Lower not lowering values."); | 62 | Assert.That(map[128, 128] < 0.0, "Lower not lowering values."); |
52 | Assert.That(x[0, 128] < 0.0, "Lower brush affecting edge values."); | 63 | Assert.That(map[0, 128] < 0.0, "Lower brush affecting edge values."); |
53 | } | 64 | } |
54 | 65 | ||
55 | [Test] | 66 | [Test] |