diff options
author | Teravus Ovares | 2008-09-06 07:52:41 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-09-06 07:52:41 +0000 |
commit | 7d89e122930be39e84a6d174548fa2d12ac0484a (patch) | |
tree | e5aa5752f988a9aba2a969f49e5e208985eda80c /OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs | |
parent | * minor: speculatively try a change to bamboo.build to see if this generates ... (diff) | |
download | opensim-SC_OLD-7d89e122930be39e84a6d174548fa2d12ac0484a.zip opensim-SC_OLD-7d89e122930be39e84a6d174548fa2d12ac0484a.tar.gz opensim-SC_OLD-7d89e122930be39e84a6d174548fa2d12ac0484a.tar.bz2 opensim-SC_OLD-7d89e122930be39e84a6d174548fa2d12ac0484a.tar.xz |
* This is the fabled LibOMV update with all of the libOMV types from JHurliman
* This is a HUGE OMG update and will definitely have unknown side effects.. so this is really only for the strong hearted at this point. Regular people should let the dust settle.
* This has been tested to work with most basic functions. However.. make sure you back up 'everything' before using this. It's that big!
* Essentially we're back at square 1 in the testing phase.. so lets identify things that broke.
Diffstat (limited to 'OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs')
-rw-r--r-- | OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs index 2430822..ec9b79c 100644 --- a/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/Environment/Modules/World/WorldMap/WorldMapModule.cs | |||
@@ -32,8 +32,8 @@ using System.Drawing; | |||
32 | using System.Drawing.Imaging; | 32 | using System.Drawing.Imaging; |
33 | using System.IO; | 33 | using System.IO; |
34 | using System.Reflection; | 34 | using System.Reflection; |
35 | using libsecondlife; | 35 | using OpenMetaverse; |
36 | using OpenJPEGNet; | 36 | using OpenMetaverse.Imaging; |
37 | using log4net; | 37 | using log4net; |
38 | using Nini.Config; | 38 | using Nini.Config; |
39 | using OpenSim.Framework; | 39 | using OpenSim.Framework; |
@@ -103,7 +103,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
103 | 103 | ||
104 | #endregion | 104 | #endregion |
105 | 105 | ||
106 | public void OnRegisterCaps(LLUUID agentID, Caps caps) | 106 | public void OnRegisterCaps(UUID agentID, Caps caps) |
107 | { | 107 | { |
108 | m_log.DebugFormat("[VOICE] OnRegisterCaps: agentID {0} caps {1}", agentID, caps); | 108 | m_log.DebugFormat("[VOICE] OnRegisterCaps: agentID {0} caps {1}", agentID, caps); |
109 | string capsBase = "/CAPS/" + caps.CapsObjectPath; | 109 | string capsBase = "/CAPS/" + caps.CapsObjectPath; |
@@ -127,7 +127,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
127 | /// <param name="caps"></param> | 127 | /// <param name="caps"></param> |
128 | /// <returns></returns> | 128 | /// <returns></returns> |
129 | public string MapLayerRequest(string request, string path, string param, | 129 | public string MapLayerRequest(string request, string path, string param, |
130 | LLUUID agentID, Caps caps) | 130 | UUID agentID, Caps caps) |
131 | { | 131 | { |
132 | //try | 132 | //try |
133 | //{ | 133 | //{ |
@@ -197,7 +197,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
197 | LLSDMapLayer mapLayer = new LLSDMapLayer(); | 197 | LLSDMapLayer mapLayer = new LLSDMapLayer(); |
198 | mapLayer.Right = 5000; | 198 | mapLayer.Right = 5000; |
199 | mapLayer.Top = 5000; | 199 | mapLayer.Top = 5000; |
200 | mapLayer.ImageID = new LLUUID("00000000-0000-1111-9999-000000000006"); | 200 | mapLayer.ImageID = new UUID("00000000-0000-1111-9999-000000000006"); |
201 | 201 | ||
202 | return mapLayer; | 202 | return mapLayer; |
203 | } | 203 | } |
@@ -223,7 +223,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
223 | //doFriendListUpdateOnline(client.AgentId); | 223 | //doFriendListUpdateOnline(client.AgentId); |
224 | client.OnRequestMapBlocks += RequestMapBlocks; | 224 | client.OnRequestMapBlocks += RequestMapBlocks; |
225 | } | 225 | } |
226 | private void ClientLoggedOut(LLUUID AgentId) | 226 | private void ClientLoggedOut(UUID AgentId) |
227 | { | 227 | { |
228 | 228 | ||
229 | } | 229 | } |
@@ -248,15 +248,14 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
248 | m_log.Info("[WEBMAP]: Sending map image jpeg"); | 248 | m_log.Info("[WEBMAP]: Sending map image jpeg"); |
249 | Hashtable reply = new Hashtable(); | 249 | Hashtable reply = new Hashtable(); |
250 | int statuscode = 200; | 250 | int statuscode = 200; |
251 | 251 | byte[] jpeg = new byte[0]; | |
252 | byte[] jpeg; | ||
253 | |||
254 | 252 | ||
255 | if (myMapImageJPEG.Length == 0) | 253 | if (myMapImageJPEG.Length == 0) |
256 | { | 254 | { |
257 | MemoryStream imgstream = new MemoryStream(); | 255 | MemoryStream imgstream = new MemoryStream(); |
258 | Bitmap mapTexture = new Bitmap(1,1); | 256 | Bitmap mapTexture = new Bitmap(1,1); |
259 | System.Drawing.Image image = (System.Drawing.Image)mapTexture; | 257 | ManagedImage managedImage; |
258 | Image image = (Image)mapTexture; | ||
260 | 259 | ||
261 | try | 260 | try |
262 | { | 261 | { |
@@ -268,21 +267,24 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
268 | AssetBase mapasset = m_scene.AssetCache.GetAsset(m_scene.RegionInfo.lastMapUUID, true); | 267 | AssetBase mapasset = m_scene.AssetCache.GetAsset(m_scene.RegionInfo.lastMapUUID, true); |
269 | 268 | ||
270 | // Decode image to System.Drawing.Image | 269 | // Decode image to System.Drawing.Image |
271 | image = OpenJPEG.DecodeToImage(mapasset.Data); | 270 | if (OpenJPEG.DecodeToImage(mapasset.Data, out managedImage, out image)) |
271 | { | ||
272 | // Save to bitmap | ||
273 | mapTexture = new Bitmap(image); | ||
272 | 274 | ||
273 | // Save to bitmap | 275 | ImageCodecInfo myImageCodecInfo; |
274 | mapTexture = new Bitmap(image); | ||
275 | 276 | ||
276 | ImageCodecInfo myImageCodecInfo; | 277 | Encoder myEncoder; |
277 | 278 | ||
278 | Encoder myEncoder; | 279 | EncoderParameter myEncoderParameter; |
280 | EncoderParameters myEncoderParameters = new EncoderParameters(); | ||
279 | 281 | ||
280 | EncoderParameter myEncoderParameter; | 282 | myImageCodecInfo = GetEncoderInfo("image/jpeg"); |
281 | EncoderParameters myEncoderParameters = new EncoderParameters(); | ||
282 | 283 | ||
283 | myImageCodecInfo = GetEncoderInfo("image/jpeg"); | 284 | myEncoder = Encoder.Quality; |
284 | 285 | ||
285 | myEncoder = Encoder.Quality; | 286 | myEncoderParameter = new EncoderParameter(myEncoder, 95L); |
287 | myEncoderParameters.Param[0] = myEncoderParameter; | ||
286 | 288 | ||
287 | myEncoderParameter = new EncoderParameter(myEncoder, 95L); | 289 | myEncoderParameter = new EncoderParameter(myEncoder, 95L); |
288 | myEncoderParameters.Param[0] = myEncoderParameter; | 290 | myEncoderParameters.Param[0] = myEncoderParameter; |
@@ -290,14 +292,14 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
290 | // Save bitmap to stream | 292 | // Save bitmap to stream |
291 | mapTexture.Save(imgstream, myImageCodecInfo, myEncoderParameters); | 293 | mapTexture.Save(imgstream, myImageCodecInfo, myEncoderParameters); |
292 | 294 | ||
293 | // Write the stream to a byte array for output | 295 | // Write the stream to a byte array for output |
294 | jpeg = imgstream.ToArray(); | 296 | jpeg = imgstream.ToArray(); |
295 | myMapImageJPEG = jpeg; | 297 | myMapImageJPEG = jpeg; |
298 | } | ||
296 | } | 299 | } |
297 | catch (Exception) | 300 | catch (Exception) |
298 | { | 301 | { |
299 | // Dummy! | 302 | // Dummy! |
300 | jpeg = new byte[0]; | ||
301 | m_log.Warn("[WEBMAP]: Unable to generate Map image"); | 303 | m_log.Warn("[WEBMAP]: Unable to generate Map image"); |
302 | } | 304 | } |
303 | finally | 305 | finally |
@@ -314,7 +316,6 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
314 | // Use cached version so we don't have to loose our mind | 316 | // Use cached version so we don't have to loose our mind |
315 | jpeg = myMapImageJPEG; | 317 | jpeg = myMapImageJPEG; |
316 | } | 318 | } |
317 | //jpeg = new byte[0]; | ||
318 | 319 | ||
319 | reply["str_response_string"] = Convert.ToBase64String(jpeg); | 320 | reply["str_response_string"] = Convert.ToBase64String(jpeg); |
320 | reply["int_response_code"] = statuscode; | 321 | reply["int_response_code"] = statuscode; |