diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index ce14b58a3e..7ac94a04e7 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs @@ -147,8 +147,29 @@ namespace OpenSim.Framework public uint WorldLocX = 0; public uint WorldLocY = 0; public uint WorldLocZ = 0; + + /// + /// X dimension of the region. + /// + /// + /// If this is a varregion then the default size set here will be replaced when we load the region config. + /// public uint RegionSizeX = Constants.RegionSize; + + /// + /// X dimension of the region. + /// + /// + /// If this is a varregion then the default size set here will be replaced when we load the region config. + /// public uint RegionSizeY = Constants.RegionSize; + + /// + /// Z dimension of the region. + /// + /// + /// XXX: Unknown if this accounts for regions with negative Z. + /// public uint RegionSizeZ = Constants.RegionHeight; private Dictionary m_extraSettings = new Dictionary(); diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index b98afbcb3d..e4977cfdc0 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs @@ -1578,12 +1578,20 @@ namespace OpenSim.Region.CoreModules.World.WorldMap private Byte[] GenerateOverlay() { - using (Bitmap overlay = new Bitmap(256, 256)) + // These need to be ints for bitmap generation + int regionSizeX = (int)m_scene.RegionInfo.RegionSizeX; + int regionSizeY = (int)m_scene.RegionInfo.RegionSizeY; + + int landTileSize = LandManagementModule.LandUnit; + int regionLandTilesX = regionSizeX / landTileSize; + int regionLandTilesY = regionSizeY / landTileSize; + + using (Bitmap overlay = new Bitmap(regionSizeX, regionSizeY)) { - bool[,] saleBitmap = new bool[64, 64]; - for (int x = 0 ; x < 64 ; x++) + bool[,] saleBitmap = new bool[regionLandTilesX, regionLandTilesY]; + for (int x = 0; x < regionLandTilesX; x++) { - for (int y = 0 ; y < 64 ; y++) + for (int y = 0; y < regionLandTilesY; y++) saleBitmap[x, y] = false; } @@ -1596,8 +1604,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap using (Graphics g = Graphics.FromImage(overlay)) { using (SolidBrush transparent = new SolidBrush(background)) - g.FillRectangle(transparent, 0, 0, 256, 256); - + g.FillRectangle(transparent, 0, 0, regionSizeX, regionSizeY); foreach (ILandObject land in parcels) { @@ -1620,12 +1627,16 @@ namespace OpenSim.Region.CoreModules.World.WorldMap using (SolidBrush yellow = new SolidBrush(Color.FromArgb(255, 249, 223, 9))) { - for (int x = 0 ; x < 64 ; x++) + for (int x = 0 ; x < regionLandTilesX ; x++) { - for (int y = 0 ; y < 64 ; y++) + for (int y = 0 ; y < regionLandTilesY ; y++) { if (saleBitmap[x, y]) - g.FillRectangle(yellow, x * 4, 252 - (y * 4), 4, 4); + g.FillRectangle( + yellow, x * landTileSize, + regionSizeX - landTileSize - (y * landTileSize), + landTileSize, + landTileSize); } } } @@ -1654,4 +1665,4 @@ namespace OpenSim.Region.CoreModules.World.WorldMap public uint itemtype; public ulong regionhandle; } -} +} \ No newline at end of file