From 317c04fe1714631d851684e3bb294f02056bcd07 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Thu, 19 Sep 2013 12:14:21 -0700 Subject: VarRegion: change RegionInfo storage of region coordinates from region count number to integer world coordinates. Added new methods RegionWorldLoc[XY]. Refactored name of 'RegionLoc*' to 'LegacyRegionLoc*' throughout OpenSim. Kept old 'RegionLoc*' entrypoint to RegionInfo for downward compatability of external region management packages. --- OpenSim/Region/Framework/Scenes/Scene.cs | 24 +++++++++++----------- OpenSim/Region/Framework/Scenes/SceneManager.cs | 4 ++-- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 6 +++--- .../Region/Framework/Scenes/SimStatsReporter.cs | 2 +- 4 files changed, 18 insertions(+), 18 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 7772f94..26e7d7d 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -1107,8 +1107,8 @@ namespace OpenSim.Region.Framework.Scenes if (RegionInfo.RegionHandle != otherRegion.RegionHandle) { // If these are cast to INT because long + negative values + abs returns invalid data - int resultX = Math.Abs((int)xcell - (int)RegionInfo.RegionLocX); - int resultY = Math.Abs((int)ycell - (int)RegionInfo.RegionLocY); + int resultX = Math.Abs((int)xcell - (int)RegionInfo.LegacyRegionLocX); + int resultY = Math.Abs((int)ycell - (int)RegionInfo.LegacyRegionLocY); if (resultX <= 1 && resultY <= 1) { // Let the grid service module know, so this can be cached @@ -1183,8 +1183,8 @@ namespace OpenSim.Region.Framework.Scenes /// public int HaveNeighbor(Cardinals car, ref int[] fix) { - uint neighbourx = RegionInfo.RegionLocX; - uint neighboury = RegionInfo.RegionLocY; + uint neighbourx = RegionInfo.LegacyRegionLocX; + uint neighboury = RegionInfo.LegacyRegionLocY; int dir = (int)car; @@ -1204,8 +1204,8 @@ namespace OpenSim.Region.Framework.Scenes if (neighbourRegion == null) { - fix[0] = (int)(RegionInfo.RegionLocX - neighbourx); - fix[1] = (int)(RegionInfo.RegionLocY - neighboury); + fix[0] = (int)(RegionInfo.LegacyRegionLocX - neighbourx); + fix[1] = (int)(RegionInfo.LegacyRegionLocY - neighboury); return dir * (-1); } else @@ -4371,8 +4371,8 @@ namespace OpenSim.Region.Framework.Scenes { uint rRegionX = (uint)(cAgentData.RegionHandle >> 40); uint rRegionY = (((uint)(cAgentData.RegionHandle)) >> 8); - uint tRegionX = RegionInfo.RegionLocX; - uint tRegionY = RegionInfo.RegionLocY; + uint tRegionX = RegionInfo.LegacyRegionLocX; + uint tRegionY = RegionInfo.LegacyRegionLocY; //Send Data to ScenePresence childAgentUpdate.UpdateChildAgent(cAgentData, tRegionX, tRegionY, rRegionX, rRegionY); // Not Implemented: @@ -4600,13 +4600,13 @@ namespace OpenSim.Region.Framework.Scenes ScenePresence sp = GetScenePresence(remoteClient.AgentId); if (sp != null) { - uint regionX = RegionInfo.RegionLocX; - uint regionY = RegionInfo.RegionLocY; + uint regionX = RegionInfo.LegacyRegionLocX; + uint regionY = RegionInfo.LegacyRegionLocY; Utils.LongToUInts(regionHandle, out regionX, out regionY); - int shiftx = (int) regionX - (int) RegionInfo.RegionLocX * (int)Constants.RegionSize; - int shifty = (int) regionY - (int) RegionInfo.RegionLocY * (int)Constants.RegionSize; + int shiftx = (int) regionX - (int) RegionInfo.LegacyRegionLocX * (int)Constants.RegionSize; + int shifty = (int) regionY - (int) RegionInfo.LegacyRegionLocY * (int)Constants.RegionSize; position.X += shiftx; position.Y += shifty; diff --git a/OpenSim/Region/Framework/Scenes/SceneManager.cs b/OpenSim/Region/Framework/Scenes/SceneManager.cs index 28f7896..2677989 100644 --- a/OpenSim/Region/Framework/Scenes/SceneManager.cs +++ b/OpenSim/Region/Framework/Scenes/SceneManager.cs @@ -445,8 +445,8 @@ namespace OpenSim.Region.Framework.Scenes { foreach (Scene mscene in m_localScenes) { - if (mscene.RegionInfo.RegionLocX == locX && - mscene.RegionInfo.RegionLocY == locY) + if (mscene.RegionInfo.LegacyRegionLocX == locX && + mscene.RegionInfo.LegacyRegionLocY == locY) { scene = mscene; return true; diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 7243db1..7ef144c 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -710,7 +710,7 @@ namespace OpenSim.Region.Framework.Scenes Utils.LongToUInts(handle, out x, out y); x = x / Constants.RegionSize; y = y / Constants.RegionSize; - if (Util.IsOutsideView(DrawDistance, x, Scene.RegionInfo.RegionLocX, y, Scene.RegionInfo.RegionLocY)) + if (Util.IsOutsideView(DrawDistance, x, Scene.RegionInfo.LegacyRegionLocX, y, Scene.RegionInfo.LegacyRegionLocY)) { old.Add(handle); } @@ -2094,8 +2094,8 @@ namespace OpenSim.Region.Framework.Scenes // } // Get terrain height for sub-region in a megaregion if necessary - int X = (int)((m_scene.RegionInfo.RegionLocX * Constants.RegionSize) + pos.X); - int Y = (int)((m_scene.RegionInfo.RegionLocY * Constants.RegionSize) + pos.Y); + int X = (int)((m_scene.RegionInfo.LegacyRegionLocX * Constants.RegionSize) + pos.X); + int Y = (int)((m_scene.RegionInfo.LegacyRegionLocY * Constants.RegionSize) + pos.Y); GridRegion target_region = m_scene.GridService.GetRegionByPosition(m_scene.RegionInfo.ScopeID, X, Y); // If X and Y is NaN, target_region will be null if (target_region == null) diff --git a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs index 95f9caf..67998a0 100644 --- a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs +++ b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs @@ -437,7 +437,7 @@ namespace OpenSim.Region.Framework.Scenes SimStats simStats = new SimStats( - ReportingRegion.RegionLocX, ReportingRegion.RegionLocY, regionFlags, (uint)m_objectCapacity, + ReportingRegion.LegacyRegionLocX, ReportingRegion.LegacyRegionLocY, regionFlags, (uint)m_objectCapacity, rb, sb, m_scene.RegionInfo.originRegionID); handlerSendStatResult = OnSendStatsResult; -- cgit v1.1