diff options
author | UbitUmarov | 2015-08-27 15:48:13 +0100 |
---|---|---|
committer | UbitUmarov | 2015-08-27 15:48:13 +0100 |
commit | 030c866b34e80daa685bda4b571a0e7d39a70ffc (patch) | |
tree | 382e1b43c001898862e9b4b0c775adf4669e09a5 /OpenSim/Region/CoreModules/World/Terrain | |
parent | take taints check terrain out of Onframe event and add a new event for it. S... (diff) | |
download | opensim-SC_OLD-030c866b34e80daa685bda4b571a0e7d39a70ffc.zip opensim-SC_OLD-030c866b34e80daa685bda4b571a0e7d39a70ffc.tar.gz opensim-SC_OLD-030c866b34e80daa685bda4b571a0e7d39a70ffc.tar.bz2 opensim-SC_OLD-030c866b34e80daa685bda4b571a0e7d39a70ffc.tar.xz |
rename revert map as baked map, bc thats what it is
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Terrain')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs index fa357f5..45a5784 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs | |||
@@ -87,7 +87,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
87 | 87 | ||
88 | private Dictionary<string, ITerrainEffect> m_plugineffects; | 88 | private Dictionary<string, ITerrainEffect> m_plugineffects; |
89 | private ITerrainChannel m_channel; | 89 | private ITerrainChannel m_channel; |
90 | private ITerrainChannel m_revert; | 90 | private ITerrainChannel m_baked; |
91 | private Scene m_scene; | 91 | private Scene m_scene; |
92 | private volatile bool m_tainted; | 92 | private volatile bool m_tainted; |
93 | private readonly Stack<LandUndoState> m_undo = new Stack<LandUndoState>(5); | 93 | private readonly Stack<LandUndoState> m_undo = new Stack<LandUndoState>(5); |
@@ -220,12 +220,12 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
220 | (int)m_scene.RegionInfo.RegionSizeY, | 220 | (int)m_scene.RegionInfo.RegionSizeY, |
221 | (int)m_scene.RegionInfo.RegionSizeZ); | 221 | (int)m_scene.RegionInfo.RegionSizeZ); |
222 | m_scene.Heightmap = m_channel; | 222 | m_scene.Heightmap = m_channel; |
223 | UpdateRevertMap(); | 223 | UpdateBakedMap(); |
224 | } | 224 | } |
225 | else | 225 | else |
226 | { | 226 | { |
227 | m_channel = m_scene.Heightmap; | 227 | m_channel = m_scene.Heightmap; |
228 | UpdateRevertMap(); | 228 | UpdateBakedMap(); |
229 | } | 229 | } |
230 | 230 | ||
231 | m_scene.RegisterModuleInterface<ITerrainModule>(this); | 231 | m_scene.RegisterModuleInterface<ITerrainModule>(this); |
@@ -329,7 +329,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
329 | m_log.DebugFormat("[TERRAIN]: Loaded terrain, wd/ht: {0}/{1}", channel.Width, channel.Height); | 329 | m_log.DebugFormat("[TERRAIN]: Loaded terrain, wd/ht: {0}/{1}", channel.Width, channel.Height); |
330 | m_scene.Heightmap = channel; | 330 | m_scene.Heightmap = channel; |
331 | m_channel = channel; | 331 | m_channel = channel; |
332 | UpdateRevertMap(); | 332 | UpdateBakedMap(); |
333 | } | 333 | } |
334 | catch (NotImplementedException) | 334 | catch (NotImplementedException) |
335 | { | 335 | { |
@@ -421,7 +421,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
421 | { | 421 | { |
422 | ITerrainChannel channel = loader.Value.LoadStream(stream); | 422 | ITerrainChannel channel = loader.Value.LoadStream(stream); |
423 | m_channel.Merge(channel, displacement, radianRotation, rotationDisplacement); | 423 | m_channel.Merge(channel, displacement, radianRotation, rotationDisplacement); |
424 | UpdateRevertMap(); | 424 | UpdateBakedMap(); |
425 | } | 425 | } |
426 | catch (NotImplementedException) | 426 | catch (NotImplementedException) |
427 | { | 427 | { |
@@ -622,7 +622,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
622 | m_painteffects[StandardTerrainEffects.Smooth] = new SmoothSphere(); | 622 | m_painteffects[StandardTerrainEffects.Smooth] = new SmoothSphere(); |
623 | m_painteffects[StandardTerrainEffects.Noise] = new NoiseSphere(); | 623 | m_painteffects[StandardTerrainEffects.Noise] = new NoiseSphere(); |
624 | m_painteffects[StandardTerrainEffects.Flatten] = new FlattenSphere(); | 624 | m_painteffects[StandardTerrainEffects.Flatten] = new FlattenSphere(); |
625 | m_painteffects[StandardTerrainEffects.Revert] = new RevertSphere(m_revert); | 625 | m_painteffects[StandardTerrainEffects.Revert] = new RevertSphere(m_baked); |
626 | m_painteffects[StandardTerrainEffects.Erode] = new ErodeSphere(); | 626 | m_painteffects[StandardTerrainEffects.Erode] = new ErodeSphere(); |
627 | m_painteffects[StandardTerrainEffects.Weather] = new WeatherSphere(); | 627 | m_painteffects[StandardTerrainEffects.Weather] = new WeatherSphere(); |
628 | m_painteffects[StandardTerrainEffects.Olsen] = new OlsenSphere(); | 628 | m_painteffects[StandardTerrainEffects.Olsen] = new OlsenSphere(); |
@@ -633,7 +633,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
633 | m_floodeffects[StandardTerrainEffects.Smooth] = new SmoothArea(); | 633 | m_floodeffects[StandardTerrainEffects.Smooth] = new SmoothArea(); |
634 | m_floodeffects[StandardTerrainEffects.Noise] = new NoiseArea(); | 634 | m_floodeffects[StandardTerrainEffects.Noise] = new NoiseArea(); |
635 | m_floodeffects[StandardTerrainEffects.Flatten] = new FlattenArea(); | 635 | m_floodeffects[StandardTerrainEffects.Flatten] = new FlattenArea(); |
636 | m_floodeffects[StandardTerrainEffects.Revert] = new RevertArea(m_revert); | 636 | m_floodeffects[StandardTerrainEffects.Revert] = new RevertArea(m_baked); |
637 | 637 | ||
638 | // Filesystem load/save loaders | 638 | // Filesystem load/save loaders |
639 | m_loaders[".r32"] = new RAW32(); | 639 | m_loaders[".r32"] = new RAW32(); |
@@ -650,9 +650,9 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
650 | } | 650 | } |
651 | 651 | ||
652 | /// <summary> | 652 | /// <summary> |
653 | /// Saves the current state of the region into the revert map buffer. | 653 | /// Saves the current state of the region into the baked map buffer. |
654 | /// </summary> | 654 | /// </summary> |
655 | public void UpdateRevertMap() | 655 | public void UpdateBakedMap() |
656 | { | 656 | { |
657 | /* | 657 | /* |
658 | int x; | 658 | int x; |
@@ -661,11 +661,11 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
661 | int y; | 661 | int y; |
662 | for (y = 0; y < m_channel.Height; y++) | 662 | for (y = 0; y < m_channel.Height; y++) |
663 | { | 663 | { |
664 | m_revert[x, y] = m_channel[x, y]; | 664 | m_baked[x, y] = m_channel[x, y]; |
665 | } | 665 | } |
666 | } | 666 | } |
667 | */ | 667 | */ |
668 | m_revert = m_channel.MakeCopy(); | 668 | m_baked = m_channel.MakeCopy(); |
669 | } | 669 | } |
670 | 670 | ||
671 | /// <summary> | 671 | /// <summary> |
@@ -696,7 +696,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
696 | (int) m_scene.RegionInfo.RegionSizeY); | 696 | (int) m_scene.RegionInfo.RegionSizeY); |
697 | m_scene.Heightmap = channel; | 697 | m_scene.Heightmap = channel; |
698 | m_channel = channel; | 698 | m_channel = channel; |
699 | UpdateRevertMap(); | 699 | UpdateBakedMap(); |
700 | } | 700 | } |
701 | 701 | ||
702 | return; | 702 | return; |
@@ -904,13 +904,13 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
904 | float maxDelta = (float)m_scene.RegionInfo.RegionSettings.TerrainRaiseLimit; | 904 | float maxDelta = (float)m_scene.RegionInfo.RegionSettings.TerrainRaiseLimit; |
905 | 905 | ||
906 | // loop through the height map for this patch and compare it against | 906 | // loop through the height map for this patch and compare it against |
907 | // the revert map | 907 | // the baked map |
908 | for (int x = xStart; x < xStart + Constants.TerrainPatchSize; x++) | 908 | for (int x = xStart; x < xStart + Constants.TerrainPatchSize; x++) |
909 | { | 909 | { |
910 | for (int y = yStart; y < yStart + Constants.TerrainPatchSize; y++) | 910 | for (int y = yStart; y < yStart + Constants.TerrainPatchSize; y++) |
911 | { | 911 | { |
912 | float requestedHeight = terrData[x, y]; | 912 | float requestedHeight = terrData[x, y]; |
913 | float bakedHeight = (float)m_revert[x, y]; | 913 | float bakedHeight = (float)m_baked[x, y]; |
914 | float requestedDelta = requestedHeight - bakedHeight; | 914 | float requestedDelta = requestedHeight - bakedHeight; |
915 | 915 | ||
916 | if (requestedDelta > maxDelta) | 916 | if (requestedDelta > maxDelta) |
@@ -1169,7 +1169,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
1169 | m_painteffects[(StandardTerrainEffects) action].PaintEffect( | 1169 | m_painteffects[(StandardTerrainEffects) action].PaintEffect( |
1170 | m_channel, allowMask, west, south, height, size, seconds); | 1170 | m_channel, allowMask, west, south, height, size, seconds); |
1171 | 1171 | ||
1172 | //revert changes outside estate limits | 1172 | //block changes outside estate limits |
1173 | if (!god) | 1173 | if (!god) |
1174 | EnforceEstateLimits(); | 1174 | EnforceEstateLimits(); |
1175 | } | 1175 | } |
@@ -1211,7 +1211,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
1211 | StoreUndoState(); | 1211 | StoreUndoState(); |
1212 | m_floodeffects[(StandardTerrainEffects) action].FloodEffect(m_channel, fillArea, size); | 1212 | m_floodeffects[(StandardTerrainEffects) action].FloodEffect(m_channel, fillArea, size); |
1213 | 1213 | ||
1214 | //revert changes outside estate limits | 1214 | //block changes outside estate limits |
1215 | if (!god) | 1215 | if (!god) |
1216 | EnforceEstateLimits(); | 1216 | EnforceEstateLimits(); |
1217 | } | 1217 | } |
@@ -1293,7 +1293,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
1293 | 1293 | ||
1294 | private void InterfaceBakeTerrain(Object[] args) | 1294 | private void InterfaceBakeTerrain(Object[] args) |
1295 | { | 1295 | { |
1296 | UpdateRevertMap(); | 1296 | UpdateBakedMap(); |
1297 | } | 1297 | } |
1298 | 1298 | ||
1299 | private void InterfaceRevertTerrain(Object[] args) | 1299 | private void InterfaceRevertTerrain(Object[] args) |
@@ -1301,7 +1301,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
1301 | int x, y; | 1301 | int x, y; |
1302 | for (x = 0; x < m_channel.Width; x++) | 1302 | for (x = 0; x < m_channel.Width; x++) |
1303 | for (y = 0; y < m_channel.Height; y++) | 1303 | for (y = 0; y < m_channel.Height; y++) |
1304 | m_channel[x, y] = m_revert[x, y]; | 1304 | m_channel[x, y] = m_baked[x, y]; |
1305 | 1305 | ||
1306 | } | 1306 | } |
1307 | 1307 | ||
@@ -1595,9 +1595,9 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
1595 | multiplyCommand.AddArgument("value", "The value to multiply the heightmap by.", "Double"); | 1595 | multiplyCommand.AddArgument("value", "The value to multiply the heightmap by.", "Double"); |
1596 | 1596 | ||
1597 | Command bakeRegionCommand = | 1597 | Command bakeRegionCommand = |
1598 | new Command("bake", CommandIntentions.COMMAND_HAZARDOUS, InterfaceBakeTerrain, "Saves the current terrain into the regions revert map."); | 1598 | new Command("bake", CommandIntentions.COMMAND_HAZARDOUS, InterfaceBakeTerrain, "Saves the current terrain into the regions baked map."); |
1599 | Command revertRegionCommand = | 1599 | Command revertRegionCommand = |
1600 | new Command("revert", CommandIntentions.COMMAND_HAZARDOUS, InterfaceRevertTerrain, "Loads the revert map terrain into the regions heightmap."); | 1600 | new Command("revert", CommandIntentions.COMMAND_HAZARDOUS, InterfaceRevertTerrain, "Loads the baked map terrain into the regions heightmap."); |
1601 | 1601 | ||
1602 | Command flipCommand = | 1602 | Command flipCommand = |
1603 | new Command("flip", CommandIntentions.COMMAND_HAZARDOUS, InterfaceFlipTerrain, "Flips the current terrain about the X or Y axis"); | 1603 | new Command("flip", CommandIntentions.COMMAND_HAZARDOUS, InterfaceFlipTerrain, "Flips the current terrain about the X or Y axis"); |