diff options
author | Justin Clarke Casey | 2008-10-07 14:49:12 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-10-07 14:49:12 +0000 |
commit | 48d86fb23f7ae0e7919274d67fc25f590e6845b1 (patch) | |
tree | efd239c7ccf4dd09a7c81fd06ebe6f1c5bf2c174 /OpenSim/Region/Environment/Modules/World/Terrain/Tests | |
parent | From: chris yeoh <yeohc@au1.ibm.com> (diff) | |
download | opensim-SC-48d86fb23f7ae0e7919274d67fc25f590e6845b1.zip opensim-SC-48d86fb23f7ae0e7919274d67fc25f590e6845b1.tar.gz opensim-SC-48d86fb23f7ae0e7919274d67fc25f590e6845b1.tar.bz2 opensim-SC-48d86fb23f7ae0e7919274d67fc25f590e6845b1.tar.xz |
* Apply http://opensimulator.org/mantis/view.php?id=1207
* Implmements llModifyLand() and a check for the "Allow others to terraform flag"
* Thanks tglion!
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..5b4bc8c 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, 100, 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, 100, 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] |