diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/LowerSphere.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/LowerSphere.cs | 30 |
1 files changed, 7 insertions, 23 deletions
diff --git a/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/LowerSphere.cs b/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/LowerSphere.cs index 68145f2..a88a022 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/LowerSphere.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/LowerSphere.cs | |||
@@ -34,34 +34,18 @@ namespace OpenSim.Region.CoreModules.World.Terrain.PaintBrushes | |||
34 | { | 34 | { |
35 | #region ITerrainPaintableEffect Members | 35 | #region ITerrainPaintableEffect Members |
36 | 36 | ||
37 | public void PaintEffect(ITerrainChannel map, bool[,] mask, double rx, double ry, double rz, double strength, double duration) | 37 | public void PaintEffect(ITerrainChannel map, bool[,] mask, double rx, double ry, double rz, |
38 | double strength, double duration, int startX, int endX, int startY, int endY) | ||
38 | { | 39 | { |
39 | int s = (int) (Math.Pow(2, strength) + 0.5); | 40 | int s = (int) (Math.Pow(2, strength) + 0.5); |
40 | 41 | ||
41 | int x; | 42 | int x, y; |
42 | int xFrom = (int)(rx-s+0.5); | ||
43 | int xTo = (int)(rx+s+0.5) + 1; | ||
44 | int yFrom = (int)(ry-s+0.5); | ||
45 | int yTo = (int)(ry+s+0.5) + 1; | ||
46 | 43 | ||
47 | if (xFrom < 0) | 44 | for (x = startX; x <= endX; x++) |
48 | xFrom = 0; | ||
49 | |||
50 | if (yFrom < 0) | ||
51 | yFrom = 0; | ||
52 | |||
53 | if (xTo > map.Width) | ||
54 | xTo = map.Width; | ||
55 | |||
56 | if (yTo > map.Width) | ||
57 | yTo = map.Width; | ||
58 | |||
59 | for (x = xFrom; x < xTo; x++) | ||
60 | { | 45 | { |
61 | int y; | 46 | for (y = startY; y <= endY; y++) |
62 | for (y = yFrom; y < yTo; y++) | ||
63 | { | 47 | { |
64 | if (!mask[x,y]) | 48 | if (!mask[x, y]) |
65 | continue; | 49 | continue; |
66 | 50 | ||
67 | // Calculate a cos-sphere and add it to the heighmap | 51 | // Calculate a cos-sphere and add it to the heighmap |
@@ -74,7 +58,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.PaintBrushes | |||
74 | map[x, y] = 0.0; | 58 | map[x, y] = 0.0; |
75 | else | 59 | else |
76 | map[x, y] = newz; | 60 | map[x, y] = newz; |
77 | } | 61 | } |
78 | } | 62 | } |
79 | } | 63 | } |
80 | 64 | ||