diff options
Diffstat (limited to 'OpenSim.Terrain.BasicTerrain')
-rw-r--r-- | OpenSim.Terrain.BasicTerrain/TerrainEngine.cs | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs b/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs index 0b066aa..6576ab8 100644 --- a/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs +++ b/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs | |||
@@ -11,6 +11,7 @@ namespace OpenSim.Terrain | |||
11 | /// A [normally] 256x256 heightmap | 11 | /// A [normally] 256x256 heightmap |
12 | /// </summary> | 12 | /// </summary> |
13 | public Channel heightmap; | 13 | public Channel heightmap; |
14 | public int tainted; | ||
14 | 15 | ||
15 | int w, h; | 16 | int w, h; |
16 | 17 | ||
@@ -23,6 +24,7 @@ namespace OpenSim.Terrain | |||
23 | h = 256; | 24 | h = 256; |
24 | heightmap = new Channel(w, h); | 25 | heightmap = new Channel(w, h); |
25 | 26 | ||
27 | tainted++; | ||
26 | } | 28 | } |
27 | 29 | ||
28 | /// <summary> | 30 | /// <summary> |
@@ -67,9 +69,11 @@ namespace OpenSim.Terrain | |||
67 | { | 69 | { |
68 | heightmap.map[i / w, i % w] = heights[i]; | 70 | heightmap.map[i / w, i % w] = heights[i]; |
69 | } | 71 | } |
72 | |||
73 | tainted++; | ||
70 | } | 74 | } |
71 | 75 | ||
72 | public float[,] setHeights2D(float[,] heights) | 76 | public void setHeights2D(float[,] heights) |
73 | { | 77 | { |
74 | int x, y; | 78 | int x, y; |
75 | for (x = 0; x < w; x++) | 79 | for (x = 0; x < w; x++) |
@@ -79,12 +83,13 @@ namespace OpenSim.Terrain | |||
79 | heightmap.set(x,y,(double)heights[x,y]); | 83 | heightmap.set(x,y,(double)heights[x,y]); |
80 | } | 84 | } |
81 | } | 85 | } |
82 | return heights; | 86 | tainted++; |
83 | } | 87 | } |
84 | 88 | ||
85 | public void setRange(float min, float max) | 89 | public void setRange(float min, float max) |
86 | { | 90 | { |
87 | heightmap.normalise((double)min, (double)max); | 91 | heightmap.normalise((double)min, (double)max); |
92 | tainted++; | ||
88 | } | 93 | } |
89 | 94 | ||
90 | /// <summary> | 95 | /// <summary> |
@@ -108,6 +113,8 @@ namespace OpenSim.Terrain | |||
108 | 113 | ||
109 | bs.Close(); | 114 | bs.Close(); |
110 | s.Close(); | 115 | s.Close(); |
116 | |||
117 | tainted++; | ||
111 | } | 118 | } |
112 | 119 | ||
113 | /// <summary> | 120 | /// <summary> |
@@ -131,6 +138,8 @@ namespace OpenSim.Terrain | |||
131 | 138 | ||
132 | bs.Close(); | 139 | bs.Close(); |
133 | s.Close(); | 140 | s.Close(); |
141 | |||
142 | tainted++; | ||
134 | } | 143 | } |
135 | 144 | ||
136 | public void writeToFileF64(string filename) | 145 | public void writeToFileF64(string filename) |
@@ -189,6 +198,8 @@ namespace OpenSim.Terrain | |||
189 | { | 198 | { |
190 | heightmap.raise(rx, ry, size, amount); | 199 | heightmap.raise(rx, ry, size, amount); |
191 | } | 200 | } |
201 | |||
202 | tainted++; | ||
192 | } | 203 | } |
193 | 204 | ||
194 | /// <summary> | 205 | /// <summary> |
@@ -204,6 +215,8 @@ namespace OpenSim.Terrain | |||
204 | { | 215 | { |
205 | heightmap.lower(rx, ry, size, amount); | 216 | heightmap.lower(rx, ry, size, amount); |
206 | } | 217 | } |
218 | |||
219 | tainted++; | ||
207 | } | 220 | } |
208 | 221 | ||
209 | /// <summary> | 222 | /// <summary> |
@@ -217,10 +230,13 @@ namespace OpenSim.Terrain | |||
217 | heightmap.normalise(); | 230 | heightmap.normalise(); |
218 | heightmap *= 60.0; // Raise to 60m | 231 | heightmap *= 60.0; // Raise to 60m |
219 | } | 232 | } |
233 | |||
234 | tainted++; | ||
220 | } | 235 | } |
221 | 236 | ||
222 | public static TerrainEngine operator *(TerrainEngine meep, Double val) { | 237 | public static TerrainEngine operator *(TerrainEngine meep, Double val) { |
223 | meep.heightmap *= val; | 238 | meep.heightmap *= val; |
239 | meep.tainted++; | ||
224 | return meep; | 240 | return meep; |
225 | } | 241 | } |
226 | 242 | ||
@@ -232,6 +248,7 @@ namespace OpenSim.Terrain | |||
232 | } | 248 | } |
233 | set | 249 | set |
234 | { | 250 | { |
251 | tainted++; | ||
235 | heightmap.set(x,y,(double)value); | 252 | heightmap.set(x,y,(double)value); |
236 | } | 253 | } |
237 | } | 254 | } |