From c305b5501226a4ecaea83b01499e7841ad1c94fb Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 31 Jan 2012 06:31:02 +0100 Subject: [PATCH] Draw brders around parcels for sale --- .../World/WorldMap/WorldMapModule.cs | 48 ++++++++++++++----- 1 file changed, 37 insertions(+), 11 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index c2303efc95..a4210b27ed 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs @@ -1458,9 +1458,10 @@ namespace OpenSim.Region.CoreModules.World.WorldMap Color background = Color.FromArgb(0, 0, 0, 0); SolidBrush transparent = new SolidBrush(background); Graphics g = Graphics.FromImage(overlay); - g.FillRectangle(transparent, 0, 0, 256, 256); + g.FillRectangle(transparent, 0, 0, 255, 255); SolidBrush yellow = new SolidBrush(Color.FromArgb(255, 249, 223, 9)); + Pen grey = new Pen(Color.FromArgb(255, 92, 92, 92)); foreach (ILandObject land in parcels) { @@ -1469,7 +1470,41 @@ namespace OpenSim.Region.CoreModules.World.WorldMap { landForSale = true; - saleBitmap = land.MergeLandBitmaps(saleBitmap, land.GetLandBitmap()); + bool[,] landBitmap = land.GetLandBitmap(); + + for (int x = 0 ; x < 64 ; x++) + { + for (int y = 0 ; y < 64 ; y++) + { + if (landBitmap[x, y]) + { + g.FillRectangle(yellow, x * 4, 252 - (y * 4), 4, 4); + + if (x > 0) + { + if ((saleBitmap[x - 1, y] || landBitmap[x - 1, y]) == false) + g.DrawLine(grey, x * 4, 252 - (y * 4), x * 4, 255 - (y * 4)); + } + if (y > 0) + { + if ((saleBitmap[x, y-1] || landBitmap[x, y-1]) == false) + g.DrawLine(grey, x * 4, 255 - (y * 4), x * 4 + 3, 255 - (y * 4)); + } + if (x < 63) + { + if ((saleBitmap[x + 1, y] || landBitmap[x + 1, y]) == false) + g.DrawLine(grey, x * 4 + 3, 252 - (y * 4), x * 4 + 3, 255 - (y * 4)); + } + if (y < 63) + { + if ((saleBitmap[x, y + 1] || landBitmap[x, y + 1]) == false) + g.DrawLine(grey, x * 4, 252 - (y * 4), x * 4 + 3, 252 - (y * 4)); + } + } + } + } + + saleBitmap = land.MergeLandBitmaps(saleBitmap, landBitmap); } } @@ -1481,15 +1516,6 @@ namespace OpenSim.Region.CoreModules.World.WorldMap m_log.DebugFormat("[WORLD MAP]: Region {0} has parcels for sale, genrating overlay", m_scene.RegionInfo.RegionName); - for (int x = 0 ; x < 64 ; x++) - { - for (int y = 0 ; y < 64 ; y++) - { - if (saleBitmap[x, y]) - g.FillRectangle(yellow, x * 4, 252 - (y * 4), 4, 4); - } - } - try { return OpenJPEG.EncodeFromImage(overlay, true);