diff options
author | Justin Clark-Casey (justincc) | 2014-05-30 19:38:10 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2014-05-30 19:40:10 +0100 |
commit | 8656b5e948b5865f431a6178992b2c0bd83899a3 (patch) | |
tree | ebf3fbffa8fa25d9ac155996e000023fef35e1bc /OpenSim/Region | |
parent | Add some info about xbuild command line switches to clean and select between ... (diff) | |
download | opensim-SC_OLD-8656b5e948b5865f431a6178992b2c0bd83899a3.zip opensim-SC_OLD-8656b5e948b5865f431a6178992b2c0bd83899a3.tar.gz opensim-SC_OLD-8656b5e948b5865f431a6178992b2c0bd83899a3.tar.bz2 opensim-SC_OLD-8656b5e948b5865f431a6178992b2c0bd83899a3.tar.xz |
Fix bug where setting a parcel in a varregion for sale would make sale bitmap generation in WorldMapModule throw an exception on next startup.
This commit replaces the hardcoded region sizes in WorldMapModule.GenerateOverlay() with numbers pulled from m_scene.RegionInfo
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index b98afbc..e4977cf 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 | |||
1578 | 1578 | ||
1579 | private Byte[] GenerateOverlay() | 1579 | private Byte[] GenerateOverlay() |
1580 | { | 1580 | { |
1581 | using (Bitmap overlay = new Bitmap(256, 256)) | 1581 | // These need to be ints for bitmap generation |
1582 | int regionSizeX = (int)m_scene.RegionInfo.RegionSizeX; | ||
1583 | int regionSizeY = (int)m_scene.RegionInfo.RegionSizeY; | ||
1584 | |||
1585 | int landTileSize = LandManagementModule.LandUnit; | ||
1586 | int regionLandTilesX = regionSizeX / landTileSize; | ||
1587 | int regionLandTilesY = regionSizeY / landTileSize; | ||
1588 | |||
1589 | using (Bitmap overlay = new Bitmap(regionSizeX, regionSizeY)) | ||
1582 | { | 1590 | { |
1583 | bool[,] saleBitmap = new bool[64, 64]; | 1591 | bool[,] saleBitmap = new bool[regionLandTilesX, regionLandTilesY]; |
1584 | for (int x = 0 ; x < 64 ; x++) | 1592 | for (int x = 0; x < regionLandTilesX; x++) |
1585 | { | 1593 | { |
1586 | for (int y = 0 ; y < 64 ; y++) | 1594 | for (int y = 0; y < regionLandTilesY; y++) |
1587 | saleBitmap[x, y] = false; | 1595 | saleBitmap[x, y] = false; |
1588 | } | 1596 | } |
1589 | 1597 | ||
@@ -1596,8 +1604,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
1596 | using (Graphics g = Graphics.FromImage(overlay)) | 1604 | using (Graphics g = Graphics.FromImage(overlay)) |
1597 | { | 1605 | { |
1598 | using (SolidBrush transparent = new SolidBrush(background)) | 1606 | using (SolidBrush transparent = new SolidBrush(background)) |
1599 | g.FillRectangle(transparent, 0, 0, 256, 256); | 1607 | g.FillRectangle(transparent, 0, 0, regionSizeX, regionSizeY); |
1600 | |||
1601 | 1608 | ||
1602 | foreach (ILandObject land in parcels) | 1609 | foreach (ILandObject land in parcels) |
1603 | { | 1610 | { |
@@ -1620,12 +1627,16 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
1620 | 1627 | ||
1621 | using (SolidBrush yellow = new SolidBrush(Color.FromArgb(255, 249, 223, 9))) | 1628 | using (SolidBrush yellow = new SolidBrush(Color.FromArgb(255, 249, 223, 9))) |
1622 | { | 1629 | { |
1623 | for (int x = 0 ; x < 64 ; x++) | 1630 | for (int x = 0 ; x < regionLandTilesX ; x++) |
1624 | { | 1631 | { |
1625 | for (int y = 0 ; y < 64 ; y++) | 1632 | for (int y = 0 ; y < regionLandTilesY ; y++) |
1626 | { | 1633 | { |
1627 | if (saleBitmap[x, y]) | 1634 | if (saleBitmap[x, y]) |
1628 | g.FillRectangle(yellow, x * 4, 252 - (y * 4), 4, 4); | 1635 | g.FillRectangle( |
1636 | yellow, x * landTileSize, | ||
1637 | regionSizeX - landTileSize - (y * landTileSize), | ||
1638 | landTileSize, | ||
1639 | landTileSize); | ||
1629 | } | 1640 | } |
1630 | } | 1641 | } |
1631 | } | 1642 | } |
@@ -1654,4 +1665,4 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
1654 | public uint itemtype; | 1665 | public uint itemtype; |
1655 | public ulong regionhandle; | 1666 | public ulong regionhandle; |
1656 | } | 1667 | } |
1657 | } | 1668 | } \ No newline at end of file |