aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/WeatherSphere.cs
diff options
context:
space:
mode:
authorAdam Frisby2008-05-03 20:00:35 +0000
committerAdam Frisby2008-05-03 20:00:35 +0000
commit87b313792821cb842fd54b568302b6877c4e53f8 (patch)
tree446719156d1e8d8c12bc3bcd69546f04ba0d79ab /OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/WeatherSphere.cs
parent* Refactor: Move MoveFolder() and PurgeFolder() into CachedUserInfo (which ar... (diff)
downloadopensim-SC_OLD-87b313792821cb842fd54b568302b6877c4e53f8.zip
opensim-SC_OLD-87b313792821cb842fd54b568302b6877c4e53f8.tar.gz
opensim-SC_OLD-87b313792821cb842fd54b568302b6877c4e53f8.tar.bz2
opensim-SC_OLD-87b313792821cb842fd54b568302b6877c4e53f8.tar.xz
* Cleaned up code in Terrain, Tree and Map modules.
* Fixed a bug with Terragen loader where it would do bad things on a non 256x256 sized terrain. Now loads the array correctly. * Moved MapImageModule.cs to Modules/World/WorldMap * Changed Location.RegionHandle to use Helpers.GetUlong instead of doing it ourselves.
Diffstat (limited to 'OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/WeatherSphere.cs')
-rw-r--r--OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/WeatherSphere.cs16
1 files changed, 8 insertions, 8 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/WeatherSphere.cs b/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/WeatherSphere.cs
index b48beb8..753d171 100644
--- a/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/WeatherSphere.cs
+++ b/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/WeatherSphere.cs
@@ -34,18 +34,18 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.PaintBrushes
34 /// </summary> 34 /// </summary>
35 public class WeatherSphere : ITerrainPaintableEffect 35 public class WeatherSphere : ITerrainPaintableEffect
36 { 36 {
37 private double talus = 0.2; // Number of meters max difference before stop eroding. Tweakage required. 37 private const double talus = 0.2;
38 private NeighbourSystem type = NeighbourSystem.Moore; // Parameter 38 private const NeighbourSystem type = NeighbourSystem.Moore;
39 39
40 #region Supporting Functions 40 #region Supporting Functions
41 41
42 private int[] Neighbours(NeighbourSystem type, int index) 42 private static int[] Neighbours(NeighbourSystem neighbourType, int index)
43 { 43 {
44 int[] coord = new int[2]; 44 int[] coord = new int[2];
45 45
46 index++; 46 index++;
47 47
48 switch (type) 48 switch (neighbourType)
49 { 49 {
50 case NeighbourSystem.Moore: 50 case NeighbourSystem.Moore:
51 switch (index) 51 switch (index)
@@ -151,19 +151,19 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.PaintBrushes
151 { 151 {
152 strength = TerrainUtil.MetersToSphericalStrength(strength); 152 strength = TerrainUtil.MetersToSphericalStrength(strength);
153 153
154 int x, y; 154 int x;
155 155
156 for (x = 0; x < map.Width; x++) 156 for (x = 0; x < map.Width; x++)
157 { 157 {
158 int y;
158 for (y = 0; y < map.Height; y++) 159 for (y = 0; y < map.Height; y++)
159 { 160 {
160 double z = TerrainUtil.SphericalFactor(x, y, rx, ry, strength); 161 double z = TerrainUtil.SphericalFactor(x, y, rx, ry, strength);
161 162
162 if (z > 0) // add in non-zero amount 163 if (z > 0) // add in non-zero amount
163 { 164 {
164 int NEIGHBOUR_ME = 4; 165 const int NEIGHBOUR_ME = 4;
165 166 const int NEIGHBOUR_MAX = 9;
166 int NEIGHBOUR_MAX = type == NeighbourSystem.Moore ? 9 : 5;
167 167
168 for (int j = 0; j < NEIGHBOUR_MAX; j++) 168 for (int j = 0; j < NEIGHBOUR_MAX; j++)
169 { 169 {