From 8f6f85e530b84217d14aa9f9c198e7ad14f18c03 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Sat, 8 Mar 2008 19:11:22 +0000 Subject: * Implemented 'Revert' channel in Terrain Module. * Added Revert Area, flood brush. * Added Revert Sphere, paint brush. --- .../Environment/Modules/Terrain/TerrainModule.cs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'OpenSim/Region/Environment/Modules/Terrain/TerrainModule.cs') 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 private Dictionary m_loaders = new Dictionary(); Scene m_scene; ITerrainChannel m_channel; + ITerrainChannel m_revert; bool m_tainted = false; private IConfigSource m_gConfig; @@ -201,6 +202,7 @@ namespace OpenSim.Region.Environment.Modules.Terrain m_painteffects[StandardTerrainEffects.Smooth] = new PaintBrushes.SmoothSphere(); m_painteffects[StandardTerrainEffects.Noise] = new PaintBrushes.NoiseSphere(); m_painteffects[StandardTerrainEffects.Flatten] = new PaintBrushes.FlattenSphere(); + m_painteffects[StandardTerrainEffects.Revert] = new PaintBrushes.RevertSphere(m_revert); // Area of effect selection effects m_floodeffects[StandardTerrainEffects.Raise] = new FloodBrushes.RaiseArea(); @@ -208,6 +210,7 @@ namespace OpenSim.Region.Environment.Modules.Terrain m_floodeffects[StandardTerrainEffects.Smooth] = new FloodBrushes.SmoothArea(); m_floodeffects[StandardTerrainEffects.Noise] = new FloodBrushes.NoiseArea(); m_floodeffects[StandardTerrainEffects.Flatten] = new FloodBrushes.FlattenArea(); + m_floodeffects[StandardTerrainEffects.Revert] = new FloodBrushes.RevertArea(m_revert); // Filesystem load/save loaders m_loaders[".r32"] = new FileLoaders.RAW32(); @@ -218,6 +221,18 @@ namespace OpenSim.Region.Environment.Modules.Terrain m_loaders[".jpeg"] = m_loaders[".jpg"]; } + public void UpdateRevertMap() + { + int x, y; + for (x = 0; x < m_channel.Width; x++) + { + for (y = 0; y < m_channel.Height; y++) + { + m_revert[x, y] = m_channel[x, y]; + } + } + } + public void LoadFromFile(string filename) { foreach (KeyValuePair loader in m_loaders) @@ -229,6 +244,7 @@ namespace OpenSim.Region.Environment.Modules.Terrain ITerrainChannel channel = loader.Value.LoadFile(filename); m_scene.Heightmap = channel; m_channel = channel; + UpdateRevertMap(); } return; } @@ -266,11 +282,15 @@ namespace OpenSim.Region.Environment.Modules.Terrain { m_channel = new TerrainChannel(); m_scene.Heightmap = m_channel; + m_revert = new TerrainChannel(); + UpdateRevertMap(); } } else { m_channel = m_scene.Heightmap; + m_revert = new TerrainChannel(); + UpdateRevertMap(); } m_scene.EventManager.OnNewClient += EventManager_OnNewClient; -- cgit v1.1