diff options
author | Adam Frisby | 2008-05-01 18:04:42 +0000 |
---|---|---|
committer | Adam Frisby | 2008-05-01 18:04:42 +0000 |
commit | 20a9bf08f51351e1e0a9de94f184ff56cd572665 (patch) | |
tree | 52da64dab26353b903c8e4befed0178fa72a188b /OpenSim/Region/Environment/Modules/World/Terrain | |
parent | More config cleanup in LaunchSLClient. (diff) | |
download | opensim-SC_OLD-20a9bf08f51351e1e0a9de94f184ff56cd572665.zip opensim-SC_OLD-20a9bf08f51351e1e0a9de94f184ff56cd572665.tar.gz opensim-SC_OLD-20a9bf08f51351e1e0a9de94f184ff56cd572665.tar.bz2 opensim-SC_OLD-20a9bf08f51351e1e0a9de94f184ff56cd572665.tar.xz |
* Rolled back a few changes.
Diffstat (limited to 'OpenSim/Region/Environment/Modules/World/Terrain')
8 files changed, 13 insertions, 12 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/Effects/CookieCutter.cs b/OpenSim/Region/Environment/Modules/World/Terrain/Effects/CookieCutter.cs index 331c49d..a2e0c40 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/Effects/CookieCutter.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/Effects/CookieCutter.cs | |||
@@ -78,7 +78,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.Effects | |||
78 | { | 78 | { |
79 | for (y = 0; y < map.Height; y++) | 79 | for (y = 0; y < map.Height; y++) |
80 | { | 80 | { |
81 | if (cliffMask[x, y]) | 81 | if (cliffMask[x, y] == true) |
82 | eroder.PaintEffect(map, x, y, 4, 0.1); | 82 | eroder.PaintEffect(map, x, y, 4, 0.1); |
83 | } | 83 | } |
84 | } | 84 | } |
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs index 90728da..5d6723f 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs | |||
@@ -47,7 +47,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
47 | { | 47 | { |
48 | for (x = 0; x < retval.Width; x++) | 48 | for (x = 0; x < retval.Width; x++) |
49 | { | 49 | { |
50 | retval[x, y] = bs.ReadByte() * (bs.ReadByte() / 127.0); | 50 | retval[x, y] = (double) bs.ReadByte() * ((double) bs.ReadByte() / 127.0); |
51 | bs.ReadBytes(11); // Advance the stream to next bytes. | 51 | bs.ReadBytes(11); // Advance the stream to next bytes. |
52 | } | 52 | } |
53 | } | 53 | } |
@@ -76,7 +76,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
76 | { | 76 | { |
77 | for (j = 0; j < 256; j++) | 77 | for (j = 0; j < 256; j++) |
78 | { | 78 | { |
79 | lookupHeightTable[i + (j * 256)] = (i * (j / 127.0)); | 79 | lookupHeightTable[i + (j * 256)] = ((double) i * ((double) j / 127.0)); |
80 | } | 80 | } |
81 | } | 81 | } |
82 | 82 | ||
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/Terragen.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/Terragen.cs index 04c3f1a..7cb4b00 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/Terragen.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/Terragen.cs | |||
@@ -50,14 +50,14 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
50 | BinaryReader bs = new BinaryReader(s); | 50 | BinaryReader bs = new BinaryReader(s); |
51 | 51 | ||
52 | bool eof = false; | 52 | bool eof = false; |
53 | if (Encoding.ASCII.GetString(bs.ReadBytes(16)) == "TERRAGENTERRAIN ") | 53 | if (ASCIIEncoding.ASCII.GetString(bs.ReadBytes(16)) == "TERRAGENTERRAIN ") |
54 | { | 54 | { |
55 | // Terragen file | 55 | // Terragen file |
56 | while (eof == false) | 56 | while (eof == false) |
57 | { | 57 | { |
58 | int w = 256; | 58 | int w = 256; |
59 | int h = 256; | 59 | int h = 256; |
60 | string tmp = Encoding.ASCII.GetString(bs.ReadBytes(4)); | 60 | string tmp = ASCIIEncoding.ASCII.GetString(bs.ReadBytes(4)); |
61 | switch (tmp) | 61 | switch (tmp) |
62 | { | 62 | { |
63 | case "SIZE": | 63 | case "SIZE": |
@@ -84,7 +84,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
84 | { | 84 | { |
85 | for (y = 0; y < h; y++) | 85 | for (y = 0; y < h; y++) |
86 | { | 86 | { |
87 | retval[x, y] = baseHeight + bs.ReadInt16() * (double) heightScale / 65536.0; | 87 | retval[x, y] = (double) baseHeight + (double) bs.ReadInt16() * (double) heightScale / 65536.0; |
88 | } | 88 | } |
89 | } | 89 | } |
90 | break; | 90 | break; |
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/FlattenSphere.cs b/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/FlattenSphere.cs index fa52a00..dee455f 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/FlattenSphere.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/FlattenSphere.cs | |||
@@ -31,6 +31,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.PaintBrushes | |||
31 | { | 31 | { |
32 | public class FlattenSphere : ITerrainPaintableEffect | 32 | public class FlattenSphere : ITerrainPaintableEffect |
33 | { | 33 | { |
34 | |||
34 | #region ITerrainPaintableEffect Members | 35 | #region ITerrainPaintableEffect Members |
35 | 36 | ||
36 | public void PaintEffect(ITerrainChannel map, double rx, double ry, double strength, double duration) | 37 | public void PaintEffect(ITerrainChannel map, double rx, double ry, double strength, double duration) |
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/NoiseSphere.cs b/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/NoiseSphere.cs index 5037533..8ae583e 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/NoiseSphere.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/NoiseSphere.cs | |||
@@ -57,7 +57,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.PaintBrushes | |||
57 | z *= z; | 57 | z *= z; |
58 | z -= ((x - rx) * (x - rx)) + ((y - ry) * (y - ry)); | 58 | z -= ((x - rx) * (x - rx)) + ((y - ry) * (y - ry)); |
59 | 59 | ||
60 | double noise = TerrainUtil.PerlinNoise2D(x / (double) Constants.RegionSize, y / (double) Constants.RegionSize, 8, 1.0); | 60 | double noise = TerrainUtil.PerlinNoise2D((double) x / (double) Constants.RegionSize, (double) y / (double) Constants.RegionSize, 8, 1.0); |
61 | 61 | ||
62 | if (z > 0.0) | 62 | if (z > 0.0) |
63 | map[x, y] += noise * z * duration; | 63 | map[x, y] += noise * z * duration; |
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/RevertSphere.cs b/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/RevertSphere.cs index acce32e..b47e041 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/RevertSphere.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/RevertSphere.cs | |||
@@ -32,7 +32,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.PaintBrushes | |||
32 | { | 32 | { |
33 | public class RevertSphere : ITerrainPaintableEffect | 33 | public class RevertSphere : ITerrainPaintableEffect |
34 | { | 34 | { |
35 | private readonly ITerrainChannel m_revertmap; | 35 | private ITerrainChannel m_revertmap; |
36 | 36 | ||
37 | public RevertSphere(ITerrainChannel revertmap) | 37 | public RevertSphere(ITerrainChannel revertmap) |
38 | { | 38 | { |
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainException.cs b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainException.cs index 2411de0..f5c0fe4 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainException.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainException.cs | |||
@@ -31,7 +31,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain | |||
31 | { | 31 | { |
32 | public class TerrainException : Exception | 32 | public class TerrainException : Exception |
33 | { | 33 | { |
34 | public TerrainException() | 34 | public TerrainException() : base() |
35 | { | 35 | { |
36 | } | 36 | } |
37 | 37 | ||
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs index c105620..eff6159 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs | |||
@@ -83,7 +83,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain | |||
83 | private Dictionary<string, ITerrainEffect> m_plugineffects; | 83 | private Dictionary<string, ITerrainEffect> m_plugineffects; |
84 | private ITerrainChannel m_revert; | 84 | private ITerrainChannel m_revert; |
85 | private Scene m_scene; | 85 | private Scene m_scene; |
86 | private bool m_tainted; | 86 | private bool m_tainted = false; |
87 | 87 | ||
88 | #region ICommandableModule Members | 88 | #region ICommandableModule Members |
89 | 89 | ||
@@ -223,8 +223,6 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain | |||
223 | } | 223 | } |
224 | } | 224 | } |
225 | 225 | ||
226 | #endregion | ||
227 | |||
228 | #region Plugin Loading Methods | 226 | #region Plugin Loading Methods |
229 | 227 | ||
230 | private void LoadPlugins() | 228 | private void LoadPlugins() |
@@ -278,6 +276,8 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain | |||
278 | 276 | ||
279 | #endregion | 277 | #endregion |
280 | 278 | ||
279 | #endregion | ||
280 | |||
281 | /// <summary> | 281 | /// <summary> |
282 | /// Installs into terrain module the standard suite of brushes | 282 | /// Installs into terrain module the standard suite of brushes |
283 | /// </summary> | 283 | /// </summary> |