diff options
author | Adam Frisby | 2008-03-08 19:11:22 +0000 |
---|---|---|
committer | Adam Frisby | 2008-03-08 19:11:22 +0000 |
commit | 8f6f85e530b84217d14aa9f9c198e7ad14f18c03 (patch) | |
tree | 960d625dc706df580c1e18cde2a62b56dc04b1fc /OpenSim/Region/Environment/Modules/Terrain/TerrainModule.cs | |
parent | Thank you kindly, Ldviopeng for: (diff) | |
download | opensim-SC-8f6f85e530b84217d14aa9f9c198e7ad14f18c03.zip opensim-SC-8f6f85e530b84217d14aa9f9c198e7ad14f18c03.tar.gz opensim-SC-8f6f85e530b84217d14aa9f9c198e7ad14f18c03.tar.bz2 opensim-SC-8f6f85e530b84217d14aa9f9c198e7ad14f18c03.tar.xz |
* Implemented 'Revert' channel in Terrain Module.
* Added Revert Area, flood brush.
* Added Revert Sphere, paint brush.
Diffstat (limited to 'OpenSim/Region/Environment/Modules/Terrain/TerrainModule.cs')
-rw-r--r-- | OpenSim/Region/Environment/Modules/Terrain/TerrainModule.cs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/OpenSim/Region/Environment/Modules/Terrain/TerrainModule.cs b/OpenSim/Region/Environment/Modules/Terrain/TerrainModule.cs index 15c6dcf..491d2e0 100644 --- a/OpenSim/Region/Environment/Modules/Terrain/TerrainModule.cs +++ b/OpenSim/Region/Environment/Modules/Terrain/TerrainModule.cs | |||
@@ -190,6 +190,7 @@ namespace OpenSim.Region.Environment.Modules.Terrain | |||
190 | private Dictionary<string, ITerrainLoader> m_loaders = new Dictionary<string, ITerrainLoader>(); | 190 | private Dictionary<string, ITerrainLoader> m_loaders = new Dictionary<string, ITerrainLoader>(); |
191 | Scene m_scene; | 191 | Scene m_scene; |
192 | ITerrainChannel m_channel; | 192 | ITerrainChannel m_channel; |
193 | ITerrainChannel m_revert; | ||
193 | bool m_tainted = false; | 194 | bool m_tainted = false; |
194 | private IConfigSource m_gConfig; | 195 | private IConfigSource m_gConfig; |
195 | 196 | ||
@@ -201,6 +202,7 @@ namespace OpenSim.Region.Environment.Modules.Terrain | |||
201 | m_painteffects[StandardTerrainEffects.Smooth] = new PaintBrushes.SmoothSphere(); | 202 | m_painteffects[StandardTerrainEffects.Smooth] = new PaintBrushes.SmoothSphere(); |
202 | m_painteffects[StandardTerrainEffects.Noise] = new PaintBrushes.NoiseSphere(); | 203 | m_painteffects[StandardTerrainEffects.Noise] = new PaintBrushes.NoiseSphere(); |
203 | m_painteffects[StandardTerrainEffects.Flatten] = new PaintBrushes.FlattenSphere(); | 204 | m_painteffects[StandardTerrainEffects.Flatten] = new PaintBrushes.FlattenSphere(); |
205 | m_painteffects[StandardTerrainEffects.Revert] = new PaintBrushes.RevertSphere(m_revert); | ||
204 | 206 | ||
205 | // Area of effect selection effects | 207 | // Area of effect selection effects |
206 | m_floodeffects[StandardTerrainEffects.Raise] = new FloodBrushes.RaiseArea(); | 208 | m_floodeffects[StandardTerrainEffects.Raise] = new FloodBrushes.RaiseArea(); |
@@ -208,6 +210,7 @@ namespace OpenSim.Region.Environment.Modules.Terrain | |||
208 | m_floodeffects[StandardTerrainEffects.Smooth] = new FloodBrushes.SmoothArea(); | 210 | m_floodeffects[StandardTerrainEffects.Smooth] = new FloodBrushes.SmoothArea(); |
209 | m_floodeffects[StandardTerrainEffects.Noise] = new FloodBrushes.NoiseArea(); | 211 | m_floodeffects[StandardTerrainEffects.Noise] = new FloodBrushes.NoiseArea(); |
210 | m_floodeffects[StandardTerrainEffects.Flatten] = new FloodBrushes.FlattenArea(); | 212 | m_floodeffects[StandardTerrainEffects.Flatten] = new FloodBrushes.FlattenArea(); |
213 | m_floodeffects[StandardTerrainEffects.Revert] = new FloodBrushes.RevertArea(m_revert); | ||
211 | 214 | ||
212 | // Filesystem load/save loaders | 215 | // Filesystem load/save loaders |
213 | m_loaders[".r32"] = new FileLoaders.RAW32(); | 216 | m_loaders[".r32"] = new FileLoaders.RAW32(); |
@@ -218,6 +221,18 @@ namespace OpenSim.Region.Environment.Modules.Terrain | |||
218 | m_loaders[".jpeg"] = m_loaders[".jpg"]; | 221 | m_loaders[".jpeg"] = m_loaders[".jpg"]; |
219 | } | 222 | } |
220 | 223 | ||
224 | public void UpdateRevertMap() | ||
225 | { | ||
226 | int x, y; | ||
227 | for (x = 0; x < m_channel.Width; x++) | ||
228 | { | ||
229 | for (y = 0; y < m_channel.Height; y++) | ||
230 | { | ||
231 | m_revert[x, y] = m_channel[x, y]; | ||
232 | } | ||
233 | } | ||
234 | } | ||
235 | |||
221 | public void LoadFromFile(string filename) | 236 | public void LoadFromFile(string filename) |
222 | { | 237 | { |
223 | foreach (KeyValuePair<string, ITerrainLoader> loader in m_loaders) | 238 | foreach (KeyValuePair<string, ITerrainLoader> loader in m_loaders) |
@@ -229,6 +244,7 @@ namespace OpenSim.Region.Environment.Modules.Terrain | |||
229 | ITerrainChannel channel = loader.Value.LoadFile(filename); | 244 | ITerrainChannel channel = loader.Value.LoadFile(filename); |
230 | m_scene.Heightmap = channel; | 245 | m_scene.Heightmap = channel; |
231 | m_channel = channel; | 246 | m_channel = channel; |
247 | UpdateRevertMap(); | ||
232 | } | 248 | } |
233 | return; | 249 | return; |
234 | } | 250 | } |
@@ -266,11 +282,15 @@ namespace OpenSim.Region.Environment.Modules.Terrain | |||
266 | { | 282 | { |
267 | m_channel = new TerrainChannel(); | 283 | m_channel = new TerrainChannel(); |
268 | m_scene.Heightmap = m_channel; | 284 | m_scene.Heightmap = m_channel; |
285 | m_revert = new TerrainChannel(); | ||
286 | UpdateRevertMap(); | ||
269 | } | 287 | } |
270 | } | 288 | } |
271 | else | 289 | else |
272 | { | 290 | { |
273 | m_channel = m_scene.Heightmap; | 291 | m_channel = m_scene.Heightmap; |
292 | m_revert = new TerrainChannel(); | ||
293 | UpdateRevertMap(); | ||
274 | } | 294 | } |
275 | 295 | ||
276 | m_scene.EventManager.OnNewClient += EventManager_OnNewClient; | 296 | m_scene.EventManager.OnNewClient += EventManager_OnNewClient; |