aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs')
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs91
1 files changed, 49 insertions, 42 deletions
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
index 8df9623..ddaf9fb 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
@@ -1501,62 +1501,69 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
1501 1501
1502 private Byte[] GenerateOverlay() 1502 private Byte[] GenerateOverlay()
1503 { 1503 {
1504 Bitmap overlay = new Bitmap(256, 256); 1504 using (Bitmap overlay = new Bitmap(256, 256))
1505
1506 bool[,] saleBitmap = new bool[64, 64];
1507 for (int x = 0 ; x < 64 ; x++)
1508 { 1505 {
1509 for (int y = 0 ; y < 64 ; y++) 1506 bool[,] saleBitmap = new bool[64, 64];
1510 saleBitmap[x, y] = false; 1507 for (int x = 0 ; x < 64 ; x++)
1511 } 1508 {
1512 1509 for (int y = 0 ; y < 64 ; y++)
1513 bool landForSale = false; 1510 saleBitmap[x, y] = false;
1511 }
1514 1512
1515 List<ILandObject> parcels = m_scene.LandChannel.AllParcels(); 1513 bool landForSale = false;
1516 1514
1517 Color background = Color.FromArgb(0, 0, 0, 0); 1515 List<ILandObject> parcels = m_scene.LandChannel.AllParcels();
1518 SolidBrush transparent = new SolidBrush(background);
1519 Graphics g = Graphics.FromImage(overlay);
1520 g.FillRectangle(transparent, 0, 0, 256, 256);
1521 1516
1522 SolidBrush yellow = new SolidBrush(Color.FromArgb(255, 249, 223, 9)); 1517 Color background = Color.FromArgb(0, 0, 0, 0);
1523 1518
1524 foreach (ILandObject land in parcels) 1519 using (Graphics g = Graphics.FromImage(overlay))
1525 {
1526 // m_log.DebugFormat("[WORLD MAP]: Parcel {0} flags {1}", land.LandData.Name, land.LandData.Flags);
1527 if ((land.LandData.Flags & (uint)ParcelFlags.ForSale) != 0)
1528 { 1520 {
1529 landForSale = true; 1521 using (SolidBrush transparent = new SolidBrush(background))
1522 g.FillRectangle(transparent, 0, 0, 256, 256);
1530 1523
1531 saleBitmap = land.MergeLandBitmaps(saleBitmap, land.GetLandBitmap());
1532 }
1533 }
1534 1524
1535 if (!landForSale) 1525 foreach (ILandObject land in parcels)
1536 { 1526 {
1537 m_log.DebugFormat("[WORLD MAP]: Region {0} has no parcels for sale, not generating overlay", m_scene.RegionInfo.RegionName); 1527 // m_log.DebugFormat("[WORLD MAP]: Parcel {0} flags {1}", land.LandData.Name, land.LandData.Flags);
1538 return null; 1528 if ((land.LandData.Flags & (uint)ParcelFlags.ForSale) != 0)
1539 } 1529 {
1530 landForSale = true;
1540 1531
1541 m_log.DebugFormat("[WORLD MAP]: Region {0} has parcels for sale, generating overlay", m_scene.RegionInfo.RegionName); 1532 saleBitmap = land.MergeLandBitmaps(saleBitmap, land.GetLandBitmap());
1533 }
1534 }
1542 1535
1543 for (int x = 0 ; x < 64 ; x++) 1536 if (!landForSale)
1544 { 1537 {
1545 for (int y = 0 ; y < 64 ; y++) 1538 m_log.DebugFormat("[WORLD MAP]: Region {0} has no parcels for sale, not generating overlay", m_scene.RegionInfo.RegionName);
1539 return null;
1540 }
1541
1542 m_log.DebugFormat("[WORLD MAP]: Region {0} has parcels for sale, generating overlay", m_scene.RegionInfo.RegionName);
1543
1544 using (SolidBrush yellow = new SolidBrush(Color.FromArgb(255, 249, 223, 9)))
1545 {
1546 for (int x = 0 ; x < 64 ; x++)
1547 {
1548 for (int y = 0 ; y < 64 ; y++)
1549 {
1550 if (saleBitmap[x, y])
1551 g.FillRectangle(yellow, x * 4, 252 - (y * 4), 4, 4);
1552 }
1553 }
1554 }
1555 }
1556
1557 try
1558 {
1559 return OpenJPEG.EncodeFromImage(overlay, true);
1560 }
1561 catch (Exception e)
1546 { 1562 {
1547 if (saleBitmap[x, y]) 1563 m_log.DebugFormat("[WORLD MAP]: Error creating parcel overlay: " + e.ToString());
1548 g.FillRectangle(yellow, x * 4, 252 - (y * 4), 4, 4);
1549 } 1564 }
1550 } 1565 }
1551 1566
1552 try
1553 {
1554 return OpenJPEG.EncodeFromImage(overlay, true);
1555 }
1556 catch (Exception e)
1557 {
1558 m_log.DebugFormat("[WORLD MAP]: Error creating parcel overlay: " + e.ToString());
1559 }
1560 return null; 1567 return null;
1561 } 1568 }
1562 } 1569 }