From 5e4d6cab00cb29cd088ab7b62ab13aff103b64cb Mon Sep 17 00:00:00 2001 From: onefang Date: Sun, 19 May 2019 21:24:15 +1000 Subject: Dump OpenSim 0.9.0.1 into it's own branch. --- .../World/Terrain/PaintBrushes/LowerSphere.cs | 30 +++++----------------- 1 file changed, 7 insertions(+), 23 deletions(-) (limited to 'OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/LowerSphere.cs') 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 { #region ITerrainPaintableEffect Members - public void PaintEffect(ITerrainChannel map, bool[,] mask, double rx, double ry, double rz, double strength, double duration) + public void PaintEffect(ITerrainChannel map, bool[,] mask, double rx, double ry, double rz, + double strength, double duration, int startX, int endX, int startY, int endY) { int s = (int) (Math.Pow(2, strength) + 0.5); - int x; - int xFrom = (int)(rx-s+0.5); - int xTo = (int)(rx+s+0.5) + 1; - int yFrom = (int)(ry-s+0.5); - int yTo = (int)(ry+s+0.5) + 1; + int x, y; - if (xFrom < 0) - xFrom = 0; - - if (yFrom < 0) - yFrom = 0; - - if (xTo > map.Width) - xTo = map.Width; - - if (yTo > map.Width) - yTo = map.Width; - - for (x = xFrom; x < xTo; x++) + for (x = startX; x <= endX; x++) { - int y; - for (y = yFrom; y < yTo; y++) + for (y = startY; y <= endY; y++) { - if (!mask[x,y]) + if (!mask[x, y]) continue; // Calculate a cos-sphere and add it to the heighmap @@ -74,7 +58,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.PaintBrushes map[x, y] = 0.0; else map[x, y] = newz; - } + } } } -- cgit v1.1