diff options
author | Jeff Ames | 2008-08-18 00:39:10 +0000 |
---|---|---|
committer | Jeff Ames | 2008-08-18 00:39:10 +0000 |
commit | 6ef9d4da901a346c232458317cca6268da888e2e (patch) | |
tree | dd1d935b10f34f261839da9f9879c02322e8ede7 /OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs | |
parent | Update svn properties, minor formatting cleanup. (diff) | |
download | opensim-SC_OLD-6ef9d4da901a346c232458317cca6268da888e2e.zip opensim-SC_OLD-6ef9d4da901a346c232458317cca6268da888e2e.tar.gz opensim-SC_OLD-6ef9d4da901a346c232458317cca6268da888e2e.tar.bz2 opensim-SC_OLD-6ef9d4da901a346c232458317cca6268da888e2e.tar.xz |
Formatting cleanup.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs | 35 |
1 files changed, 13 insertions, 22 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs index 2a7af87..2430822 100644 --- a/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs | |||
@@ -54,13 +54,13 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
54 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 54 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
55 | 55 | ||
56 | private static readonly string m_mapLayerPath = "0001/"; | 56 | private static readonly string m_mapLayerPath = "0001/"; |
57 | 57 | ||
58 | //private IConfig m_config; | 58 | //private IConfig m_config; |
59 | private Scene m_scene; | 59 | private Scene m_scene; |
60 | private List<MapBlockData> cachedMapBlocks = new List<MapBlockData>(); | 60 | private List<MapBlockData> cachedMapBlocks = new List<MapBlockData>(); |
61 | private int cachedTime = 0; | 61 | private int cachedTime = 0; |
62 | private byte[] myMapImageJPEG; | 62 | private byte[] myMapImageJPEG; |
63 | 63 | ||
64 | //private int CacheRegionsDistance = 256; | 64 | //private int CacheRegionsDistance = 256; |
65 | 65 | ||
66 | #region IRegionModule Members | 66 | #region IRegionModule Members |
@@ -85,7 +85,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
85 | } | 85 | } |
86 | public void PostInitialise() | 86 | public void PostInitialise() |
87 | { | 87 | { |
88 | 88 | ||
89 | } | 89 | } |
90 | 90 | ||
91 | public void Close() | 91 | public void Close() |
@@ -102,10 +102,6 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
102 | } | 102 | } |
103 | 103 | ||
104 | #endregion | 104 | #endregion |
105 | |||
106 | |||
107 | |||
108 | |||
109 | 105 | ||
110 | public void OnRegisterCaps(LLUUID agentID, Caps caps) | 106 | public void OnRegisterCaps(LLUUID agentID, Caps caps) |
111 | { | 107 | { |
@@ -117,9 +113,8 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
117 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 113 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) |
118 | { | 114 | { |
119 | return MapLayerRequest(request, path, param, | 115 | return MapLayerRequest(request, path, param, |
120 | agentID, caps); | 116 | agentID, caps); |
121 | })); | 117 | })); |
122 | |||
123 | } | 118 | } |
124 | 119 | ||
125 | /// <summary> | 120 | /// <summary> |
@@ -138,12 +133,12 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
138 | //{ | 133 | //{ |
139 | //m_log.DebugFormat("[MAPLAYER]: request: {0}, path: {1}, param: {2}, agent:{3}", | 134 | //m_log.DebugFormat("[MAPLAYER]: request: {0}, path: {1}, param: {2}, agent:{3}", |
140 | //request, path, param,agentID.ToString()); | 135 | //request, path, param,agentID.ToString()); |
141 | 136 | ||
142 | // this is here because CAPS map requests work even beyond the 10,000 limit. | 137 | // this is here because CAPS map requests work even beyond the 10,000 limit. |
143 | ScenePresence avatarPresence = null; | 138 | ScenePresence avatarPresence = null; |
144 | 139 | ||
145 | m_scene.TryGetAvatar(agentID, out avatarPresence); | 140 | m_scene.TryGetAvatar(agentID, out avatarPresence); |
146 | 141 | ||
147 | if (avatarPresence != null) | 142 | if (avatarPresence != null) |
148 | { | 143 | { |
149 | bool lookup = false; | 144 | bool lookup = false; |
@@ -168,7 +163,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
168 | 163 | ||
169 | mapBlocks = m_scene.SceneGridService.RequestNeighbourMapBlocks((int)m_scene.RegionInfo.RegionLocX - 8, (int)m_scene.RegionInfo.RegionLocY - 8, (int)m_scene.RegionInfo.RegionLocX + 8, (int)m_scene.RegionInfo.RegionLocY + 8); | 164 | mapBlocks = m_scene.SceneGridService.RequestNeighbourMapBlocks((int)m_scene.RegionInfo.RegionLocX - 8, (int)m_scene.RegionInfo.RegionLocY - 8, (int)m_scene.RegionInfo.RegionLocX + 8, (int)m_scene.RegionInfo.RegionLocY + 8); |
170 | avatarPresence.ControllingClient.SendMapBlock(mapBlocks,0); | 165 | avatarPresence.ControllingClient.SendMapBlock(mapBlocks,0); |
171 | 166 | ||
172 | lock (cachedMapBlocks) | 167 | lock (cachedMapBlocks) |
173 | cachedMapBlocks = mapBlocks; | 168 | cachedMapBlocks = mapBlocks; |
174 | 169 | ||
@@ -262,18 +257,16 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
262 | MemoryStream imgstream = new MemoryStream(); | 257 | MemoryStream imgstream = new MemoryStream(); |
263 | Bitmap mapTexture = new Bitmap(1,1); | 258 | Bitmap mapTexture = new Bitmap(1,1); |
264 | System.Drawing.Image image = (System.Drawing.Image)mapTexture; | 259 | System.Drawing.Image image = (System.Drawing.Image)mapTexture; |
265 | 260 | ||
266 | |||
267 | try | 261 | try |
268 | { | 262 | { |
269 | // Taking our jpeg2000 data, decoding it, then saving it to a byte array with regular jpeg data | 263 | // Taking our jpeg2000 data, decoding it, then saving it to a byte array with regular jpeg data |
270 | 264 | ||
271 | |||
272 | imgstream = new MemoryStream(); | 265 | imgstream = new MemoryStream(); |
273 | 266 | ||
274 | // non-async because we know we have the asset immediately. | 267 | // non-async because we know we have the asset immediately. |
275 | AssetBase mapasset = m_scene.AssetCache.GetAsset(m_scene.RegionInfo.lastMapUUID, true); | 268 | AssetBase mapasset = m_scene.AssetCache.GetAsset(m_scene.RegionInfo.lastMapUUID, true); |
276 | 269 | ||
277 | // Decode image to System.Drawing.Image | 270 | // Decode image to System.Drawing.Image |
278 | image = OpenJPEG.DecodeToImage(mapasset.Data); | 271 | image = OpenJPEG.DecodeToImage(mapasset.Data); |
279 | 272 | ||
@@ -293,7 +286,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
293 | 286 | ||
294 | myEncoderParameter = new EncoderParameter(myEncoder, 95L); | 287 | myEncoderParameter = new EncoderParameter(myEncoder, 95L); |
295 | myEncoderParameters.Param[0] = myEncoderParameter; | 288 | myEncoderParameters.Param[0] = myEncoderParameter; |
296 | 289 | ||
297 | // Save bitmap to stream | 290 | // Save bitmap to stream |
298 | mapTexture.Save(imgstream, myImageCodecInfo, myEncoderParameters); | 291 | mapTexture.Save(imgstream, myImageCodecInfo, myEncoderParameters); |
299 | 292 | ||
@@ -332,16 +325,14 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
332 | // From msdn | 325 | // From msdn |
333 | private static ImageCodecInfo GetEncoderInfo(String mimeType) | 326 | private static ImageCodecInfo GetEncoderInfo(String mimeType) |
334 | { | 327 | { |
335 | int j; | ||
336 | ImageCodecInfo[] encoders; | 328 | ImageCodecInfo[] encoders; |
337 | encoders = ImageCodecInfo.GetImageEncoders(); | 329 | encoders = ImageCodecInfo.GetImageEncoders(); |
338 | for (j = 0; j < encoders.Length; ++j) | 330 | for (int j = 0; j < encoders.Length; ++j) |
339 | { | 331 | { |
340 | if (encoders[j].MimeType == mimeType) | 332 | if (encoders[j].MimeType == mimeType) |
341 | return encoders[j]; | 333 | return encoders[j]; |
342 | } | 334 | } |
343 | return null; | 335 | return null; |
344 | } | 336 | } |
345 | |||
346 | } | 337 | } |
347 | } | 338 | } |