diff options
author | Teravus Ovares (Dan Olivares) | 2009-08-08 00:10:19 -0400 |
---|---|---|
committer | Teravus Ovares (Dan Olivares) | 2009-08-08 00:10:19 -0400 |
commit | bff26ccdbb94fbdf9623b0b00a16ef88549e648e (patch) | |
tree | 96b56e7c29b16f057ec8727744e2c920a34f51e9 /OpenSim/Region/CoreModules/World/Land | |
parent | Merge branch 'master' of ssh://melanie@opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC-bff26ccdbb94fbdf9623b0b00a16ef88549e648e.zip opensim-SC-bff26ccdbb94fbdf9623b0b00a16ef88549e648e.tar.gz opensim-SC-bff26ccdbb94fbdf9623b0b00a16ef88549e648e.tar.bz2 opensim-SC-bff26ccdbb94fbdf9623b0b00a16ef88549e648e.tar.xz |
* More tweaking of the various services to work with nonstandard region sizes. * Now, what's available of the terrain will show and it'll be truncated if it's larger on Linden Clients. Parcel minimum is 64 (256/4) for the client to accept it.
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Land')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | 24 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/LandObject.cs | 5 |
2 files changed, 21 insertions, 8 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 097a62d..c917840 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -60,7 +60,10 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
60 | private LandChannel landChannel; | 60 | private LandChannel landChannel; |
61 | private Scene m_scene; | 61 | private Scene m_scene; |
62 | 62 | ||
63 | private readonly int[,] m_landIDList = new int[64, 64]; | 63 | // Minimum for parcels to work is 64m even if we don't actually use them. |
64 | private const int landArrayMax = ((int)((int)Constants.RegionSize / 4) >= 64) ? (int)((int)Constants.RegionSize / 4) : 64; | ||
65 | |||
66 | private readonly int[,] m_landIDList = new int[landArrayMax, landArrayMax]; | ||
64 | private readonly Dictionary<int, ILandObject> m_landList = new Dictionary<int, ILandObject>(); | 67 | private readonly Dictionary<int, ILandObject> m_landList = new Dictionary<int, ILandObject>(); |
65 | 68 | ||
66 | private bool m_landPrimCountTainted; | 69 | private bool m_landPrimCountTainted; |
@@ -456,9 +459,9 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
456 | new_land.landData.LocalID = newLandLocalID; | 459 | new_land.landData.LocalID = newLandLocalID; |
457 | 460 | ||
458 | bool[,] landBitmap = new_land.getLandBitmap(); | 461 | bool[,] landBitmap = new_land.getLandBitmap(); |
459 | for (int x = 0; x < 64; x++) | 462 | for (int x = 0; x < landArrayMax; x++) |
460 | { | 463 | { |
461 | for (int y = 0; y < 64; y++) | 464 | for (int y = 0; y < landArrayMax; y++) |
462 | { | 465 | { |
463 | if (landBitmap[x, y]) | 466 | if (landBitmap[x, y]) |
464 | { | 467 | { |
@@ -581,10 +584,17 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
581 | } | 584 | } |
582 | lock (m_landIDList) | 585 | lock (m_landIDList) |
583 | { | 586 | { |
584 | if (m_landList.ContainsKey(m_landIDList[x / 4, y / 4])) | 587 | try |
585 | return m_landList[m_landIDList[x / 4, y / 4]]; | 588 | { |
586 | else | 589 | if (m_landList.ContainsKey(m_landIDList[x / 4, y / 4])) |
590 | return m_landList[m_landIDList[x / 4, y / 4]]; | ||
591 | else | ||
592 | return null; | ||
593 | } | ||
594 | catch (IndexOutOfRangeException) | ||
595 | { | ||
587 | return null; | 596 | return null; |
597 | } | ||
588 | } | 598 | } |
589 | } | 599 | } |
590 | 600 | ||
@@ -941,6 +951,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
941 | { | 951 | { |
942 | for (int y = 0; y < inc_y; y++) | 952 | for (int y = 0; y < inc_y; y++) |
943 | { | 953 | { |
954 | |||
944 | ILandObject currentParcel = GetLandObject(start_x + x, start_y + y); | 955 | ILandObject currentParcel = GetLandObject(start_x + x, start_y + y); |
945 | 956 | ||
946 | if (currentParcel != null) | 957 | if (currentParcel != null) |
@@ -951,6 +962,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
951 | temp.Add(currentParcel); | 962 | temp.Add(currentParcel); |
952 | } | 963 | } |
953 | } | 964 | } |
965 | |||
954 | } | 966 | } |
955 | } | 967 | } |
956 | 968 | ||
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index f41bdac..bb06996 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs | |||
@@ -44,7 +44,8 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
44 | #region Member Variables | 44 | #region Member Variables |
45 | 45 | ||
46 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 46 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
47 | private bool[,] m_landBitmap = new bool[64,64]; | 47 | private const int landArrayMax = ((int)((int)Constants.RegionSize / 4) >= 64) ? (int)((int)Constants.RegionSize / 4) : 64; |
48 | private bool[,] m_landBitmap = new bool[landArrayMax,landArrayMax]; | ||
48 | 49 | ||
49 | protected LandData m_landData = new LandData(); | 50 | protected LandData m_landData = new LandData(); |
50 | protected Scene m_scene; | 51 | protected Scene m_scene; |
@@ -630,7 +631,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
630 | 631 | ||
631 | private bool[,] convertBytesToLandBitmap() | 632 | private bool[,] convertBytesToLandBitmap() |
632 | { | 633 | { |
633 | bool[,] tempConvertMap = new bool[64,64]; | 634 | bool[,] tempConvertMap = new bool[landArrayMax, landArrayMax]; |
634 | tempConvertMap.Initialize(); | 635 | tempConvertMap.Initialize(); |
635 | byte tempByte = 0; | 636 | byte tempByte = 0; |
636 | int x = 0, y = 0, i = 0, bitNum = 0; | 637 | int x = 0, y = 0, i = 0, bitNum = 0; |