diff options
author | Robert Adams | 2013-11-30 15:28:39 -0800 |
---|---|---|
committer | Robert Adams | 2013-11-30 15:28:39 -0800 |
commit | 6cd0d7a62b696d28d488f3cb82838ccf973ccfd7 (patch) | |
tree | 6b058a23eccf0eda55666abee9a3bb52c415e0ce /OpenSim/Framework | |
parent | varregion: add ITerrainChannel.GetHeightAtXYZ() for eventual mesh terrain. (diff) | |
download | opensim-SC_OLD-6cd0d7a62b696d28d488f3cb82838ccf973ccfd7.zip opensim-SC_OLD-6cd0d7a62b696d28d488f3cb82838ccf973ccfd7.tar.gz opensim-SC_OLD-6cd0d7a62b696d28d488f3cb82838ccf973ccfd7.tar.bz2 opensim-SC_OLD-6cd0d7a62b696d28d488f3cb82838ccf973ccfd7.tar.xz |
varregion: Add MaxRegionSize constant and enforce in RegionInfo.
Intermediate checkin of changing border cross computation from checking
boundry limits to requests to GridService. Not totally functional.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Constants.cs | 4 | ||||
-rw-r--r-- | OpenSim/Framework/RegionInfo.cs | 11 |
2 files changed, 13 insertions, 2 deletions
diff --git a/OpenSim/Framework/Constants.cs b/OpenSim/Framework/Constants.cs index d18b32e..d80808c 100644 --- a/OpenSim/Framework/Constants.cs +++ b/OpenSim/Framework/Constants.cs | |||
@@ -30,11 +30,13 @@ namespace OpenSim.Framework | |||
30 | { | 30 | { |
31 | public class Constants | 31 | public class Constants |
32 | { | 32 | { |
33 | // 'RegionSize' captures the legacy region size. | 33 | // 'RegionSize' is the legacy region size. |
34 | // DO NOT USE THIS FOR ANY NEW CODE. Use Scene.RegionSize[XYZ] as a region might not | 34 | // DO NOT USE THIS FOR ANY NEW CODE. Use Scene.RegionSize[XYZ] as a region might not |
35 | // be the legacy region size. | 35 | // be the legacy region size. |
36 | public const uint RegionSize = 256; | 36 | public const uint RegionSize = 256; |
37 | public const uint RegionHeight = 4096; | 37 | public const uint RegionHeight = 4096; |
38 | // This could be a parameters but, really, a region of greater than this is pretty unmanageable | ||
39 | public const uint MaximumRegionSize = 8192; | ||
38 | 40 | ||
39 | // Since terrain is stored in 16x16 heights, regions must be a multiple of this number and that is the minimum | 41 | // Since terrain is stored in 16x16 heights, regions must be a multiple of this number and that is the minimum |
40 | public const int MinRegionSize = 16; | 42 | public const int MinRegionSize = 16; |
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index cf909cd..63b3d89 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs | |||
@@ -788,7 +788,16 @@ namespace OpenSim.Framework | |||
788 | RegionSizeX = minSize; | 788 | RegionSizeX = minSize; |
789 | RegionSizeY = minSize; | 789 | RegionSizeY = minSize; |
790 | m_log.ErrorFormat("{0} Regions must be square until viewers are updated. Forcing region {1} size to <{2},{3}>", | 790 | m_log.ErrorFormat("{0} Regions must be square until viewers are updated. Forcing region {1} size to <{2},{3}>", |
791 | LogHeader, m_regionName, RegionSizeX, RegionSizeY); | 791 | LogHeader, m_regionName, RegionSizeX, RegionSizeY); |
792 | } | ||
793 | |||
794 | // There is a practical limit to region size. | ||
795 | if (RegionSizeX > Constants.MaximumRegionSize || RegionSizeY > Constants.MaximumRegionSize) | ||
796 | { | ||
797 | RegionSizeX = Util.Clamp<uint>(RegionSizeX, Constants.RegionSize, Constants.MaximumRegionSize); | ||
798 | RegionSizeY = Util.Clamp<uint>(RegionSizeY, Constants.RegionSize, Constants.MaximumRegionSize); | ||
799 | m_log.ErrorFormat("{0} Region dimensions must be less than {1}. Clamping {2}'s size to <{3},{4}>", | ||
800 | LogHeader, Constants.MaximumRegionSize, m_regionName, RegionSizeX, RegionSizeY); | ||
792 | } | 801 | } |
793 | 802 | ||
794 | m_log.InfoFormat("{0} Region {1} size set to <{2},{3}>", LogHeader, m_regionName, RegionSizeX, RegionSizeY); | 803 | m_log.InfoFormat("{0} Region {1} size set to <{2},{3}>", LogHeader, m_regionName, RegionSizeX, RegionSizeY); |