aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-12-09 17:00:42 +0000
committerJustin Clarke Casey2008-12-09 17:00:42 +0000
commit7c3bfdd8c902375981892ff364b34e68c5344f91 (patch)
treec184e4b19ba2c9d7f4c40574f1de78bd1ee5c357
parent* Fixes a few instances of llSetStatus with Axis lock gone wrong. (diff)
downloadopensim-SC_OLD-7c3bfdd8c902375981892ff364b34e68c5344f91.zip
opensim-SC_OLD-7c3bfdd8c902375981892ff364b34e68c5344f91.tar.gz
opensim-SC_OLD-7c3bfdd8c902375981892ff364b34e68c5344f91.tar.bz2
opensim-SC_OLD-7c3bfdd8c902375981892ff364b34e68c5344f91.tar.xz
* Apply terrain flip patch from http://opensimulator.org/mantis/view.php?id=2315
* This allows terrain to be flipped on the x or y axis with the command "terrain flip x" (or y) * See terrain help from the command prompt * This is in anticipation of change the way around in which terrain raw files are imported to match that of Second Life (to reduce user confusion and improve useability) * Thanks jonc!
-rw-r--r--CONTRIBUTORS.txt3
-rw-r--r--OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs46
2 files changed, 48 insertions, 1 deletions
diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt
index 0b1514f..2cd32bc 100644
--- a/CONTRIBUTORS.txt
+++ b/CONTRIBUTORS.txt
@@ -55,6 +55,7 @@ Patches
55* jhurliman 55* jhurliman
56* jimbo2120 (IBM) 56* jimbo2120 (IBM)
57* John R Sohn (XenReborn) 57* John R Sohn (XenReborn)
58* jonc
58* Junta Kohime 59* Junta Kohime
59* Kayne 60* Kayne
60* Kevin Cozens 61* Kevin Cozens
@@ -64,6 +65,7 @@ Patches
64* M.Igarashi 65* M.Igarashi
65* Mic Bowman 66* Mic Bowman
66* mikkopa/_someone - RealXtend 67* mikkopa/_someone - RealXtend
68* Mircea Kitsune
67* nlin 69* nlin
68* nornalbion 70* nornalbion
69* openlifegrid.com 71* openlifegrid.com
@@ -80,7 +82,6 @@ Patches
80* Y. Nitta 82* Y. Nitta
81* YZh 83* YZh
82* Zha Ewry 84* Zha Ewry
83* Mircea Kitsune
84 85
85 86
86LSL Devs 87LSL Devs
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs
index 5646de1..c1d6ab2 100644
--- a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs
@@ -753,6 +753,47 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain
753 CheckForTerrainUpdates(); 753 CheckForTerrainUpdates();
754 } 754 }
755 755
756 private void InterfaceFlipTerrain(Object[] args)
757 {
758 String direction = (String)args[0];
759
760 if( direction.ToLower().StartsWith("y"))
761 {
762 for (int x = 0; x < Constants.RegionSize; x++)
763 {
764 for (int y = 0; y < Constants.RegionSize / 2; y++)
765 {
766 double height = m_channel[x, y];
767 double flippedHeight = m_channel[x, (int)Constants.RegionSize - 1 - y];
768 m_channel[x, y] = flippedHeight;
769 m_channel[x, (int)Constants.RegionSize - 1 - y] = height;
770
771 }
772 }
773 }
774 else if (direction.ToLower().StartsWith("x"))
775 {
776 for (int y = 0; y < Constants.RegionSize; y++)
777 {
778 for (int x = 0; x < Constants.RegionSize / 2; x++)
779 {
780 double height = m_channel[x, y];
781 double flippedHeight = m_channel[(int)Constants.RegionSize - 1 - x, y];
782 m_channel[x, y] = flippedHeight;
783 m_channel[(int)Constants.RegionSize - 1 - x, y] = height;
784
785 }
786 }
787 }
788 else
789 {
790 m_log.Error("Unrecognised direction - need x or y");
791 }
792
793
794 CheckForTerrainUpdates();
795 }
796
756 private void InterfaceElevateTerrain(Object[] args) 797 private void InterfaceElevateTerrain(Object[] args)
757 { 798 {
758 int x, y; 799 int x, y;
@@ -911,6 +952,10 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain
911 Command revertRegionCommand = 952 Command revertRegionCommand =
912 new Command("revert", CommandIntentions.COMMAND_HAZARDOUS, InterfaceRevertTerrain, "Loads the revert map terrain into the regions heightmap."); 953 new Command("revert", CommandIntentions.COMMAND_HAZARDOUS, InterfaceRevertTerrain, "Loads the revert map terrain into the regions heightmap.");
913 954
955 Command flipCommand =
956 new Command("flip", CommandIntentions.COMMAND_HAZARDOUS, InterfaceFlipTerrain, "Flips the current terrain about the X or Y axis");
957 flipCommand.AddArgument("direction", "[x|y] the direction to flip the terrain in", "String");
958
914 // Debug 959 // Debug
915 Command showDebugStatsCommand = 960 Command showDebugStatsCommand =
916 new Command("stats", CommandIntentions.COMMAND_STATISTICAL, InterfaceShowDebugStats, 961 new Command("stats", CommandIntentions.COMMAND_STATISTICAL, InterfaceShowDebugStats,
@@ -938,6 +983,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain
938 m_commander.RegisterCommand("newbrushes", experimentalBrushesCommand); 983 m_commander.RegisterCommand("newbrushes", experimentalBrushesCommand);
939 m_commander.RegisterCommand("stats", showDebugStatsCommand); 984 m_commander.RegisterCommand("stats", showDebugStatsCommand);
940 m_commander.RegisterCommand("effect", pluginRunCommand); 985 m_commander.RegisterCommand("effect", pluginRunCommand);
986 m_commander.RegisterCommand("flip", flipCommand);
941 987
942 // Add this to our scene so scripts can call these functions 988 // Add this to our scene so scripts can call these functions
943 m_scene.RegisterModuleCommander("Terrain", m_commander); 989 m_scene.RegisterModuleCommander("Terrain", m_commander);