aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorAdam Frisby2008-04-11 03:33:51 +0000
committerAdam Frisby2008-04-11 03:33:51 +0000
commitf100fc1b94501f5b0b0ede678838fc9783613369 (patch)
tree5ec2bd760bd4c97f3f45f79eebb2cc075b9702f6
parentadd user profile mapping for nhibernate (diff)
downloadopensim-SC_OLD-f100fc1b94501f5b0b0ede678838fc9783613369.zip
opensim-SC_OLD-f100fc1b94501f5b0b0ede678838fc9783613369.tar.gz
opensim-SC_OLD-f100fc1b94501f5b0b0ede678838fc9783613369.tar.bz2
opensim-SC_OLD-f100fc1b94501f5b0b0ede678838fc9783613369.tar.xz
* Updated MapImageModule to support primitives showing on the world map image. As MapImageModule is of unknown use, this may or may not be reflected on the world map. See the ShadeBuildings function in MapImageModule for reference.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Modules/Terrain/MapImageModule.cs44
1 files changed, 43 insertions, 1 deletions
diff --git a/OpenSim/Region/Environment/Modules/Terrain/MapImageModule.cs b/OpenSim/Region/Environment/Modules/Terrain/MapImageModule.cs
index c4334e0..c791ac3 100644
--- a/OpenSim/Region/Environment/Modules/Terrain/MapImageModule.cs
+++ b/OpenSim/Region/Environment/Modules/Terrain/MapImageModule.cs
@@ -58,6 +58,47 @@ namespace OpenSim.Region.Environment.Modules.Terrain
58 return imageData; 58 return imageData;
59 } 59 }
60 60
61 private void ShadeBuildings(ref Bitmap map)
62 {
63 lock (map)
64 {
65 lock (m_scene.Entities)
66 {
67 foreach (EntityBase entity in m_scene.Entities.Values)
68 {
69 if (entity is SceneObjectGroup)
70 {
71 SceneObjectGroup sog = (SceneObjectGroup)entity;
72
73 foreach (SceneObjectPart primitive in sog.Children.Values)
74 {
75 int x, y, w, h, dx, dy;
76 x = (int)(primitive.AbsolutePosition.X - (primitive.Scale.X / 2));
77 y = (int)(primitive.AbsolutePosition.Y - (primitive.Scale.Y / 2));
78 w = (int)primitive.Scale.X;
79 h = (int)primitive.Scale.Y;
80
81 for (dx = x; dx < x + w; dx++)
82 {
83 for (dy = y; dy < y + h; dy++)
84 {
85 if (x < 0 || y < 0)
86 continue;
87 if (x >= map.Width || y >= map.Height)
88 continue;
89
90 map.SetPixel(dx, dy, Color.DarkGray);
91 }
92 }
93
94
95 }
96 }
97 }
98 }
99 }
100 }
101
61 private Bitmap TerrainToBitmap(string gradientmap) 102 private Bitmap TerrainToBitmap(string gradientmap)
62 { 103 {
63 Bitmap gradientmapLd = new Bitmap(gradientmap); 104 Bitmap gradientmapLd = new Bitmap(gradientmap);
@@ -84,8 +125,9 @@ namespace OpenSim.Region.Environment.Modules.Terrain
84 bmp.SetPixel(x, copy.Height - y - 1, colours[colorindex]); 125 bmp.SetPixel(x, copy.Height - y - 1, colours[colorindex]);
85 } 126 }
86 } 127 }
128 ShadeBuildings(ref bmp);
129 return bmp;
87 } 130 }
88 return bmp;
89 } 131 }
90 132
91 133