diff options
author | Justin Clark-Casey (justincc) | 2010-07-21 17:12:43 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-07-21 17:12:43 +0100 |
commit | 6ef2a72c70882810c1ca1b940d6afdbecdbe78a4 (patch) | |
tree | 6b38988ded6b2e1f7844fbc95cf7c09f3d48ec35 /OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs | |
parent | start adding user ids to the media urls (diff) | |
download | opensim-SC_OLD-6ef2a72c70882810c1ca1b940d6afdbecdbe78a4.zip opensim-SC_OLD-6ef2a72c70882810c1ca1b940d6afdbecdbe78a4.tar.gz opensim-SC_OLD-6ef2a72c70882810c1ca1b940d6afdbecdbe78a4.tar.bz2 opensim-SC_OLD-6ef2a72c70882810c1ca1b940d6afdbecdbe78a4.tar.xz |
Properly set TextureEntry.MediaFlags when a media texture is set
Media flags is cleared via a direct TextureEntry update from the client. If the clearing leaves no media textures on the prim, then a CAP ObjectMediaUpdate is not received. If there are still media textures present then one is received.
This change fixes drag-and-drop on Windows (and Mac?) clients. It may also fix problems with clearing and then subsequently setting new media textures.
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs | 46 |
1 files changed, 43 insertions, 3 deletions
diff --git a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs index 6755df7..4818546 100644 --- a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs +++ b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs | |||
@@ -311,19 +311,59 @@ namespace OpenSim.Region.CoreModules.Media.Moap | |||
311 | { | 311 | { |
312 | m_log.DebugFormat("[MOAP]: Setting all new media list for {0}", part.Name); | 312 | m_log.DebugFormat("[MOAP]: Setting all new media list for {0}", part.Name); |
313 | part.Shape.Media = new List<MediaEntry>(omu.FaceMedia); | 313 | part.Shape.Media = new List<MediaEntry>(omu.FaceMedia); |
314 | |||
315 | for (int i = 0; i < omu.FaceMedia.Length; i++) | ||
316 | { | ||
317 | if (omu.FaceMedia[i] != null) | ||
318 | { | ||
319 | // FIXME: Race condition here since some other texture entry manipulator may overwrite/get | ||
320 | // overwritten. Unfortunately, PrimitiveBaseShape does not allow us to change texture entry | ||
321 | // directly. | ||
322 | Primitive.TextureEntry te = part.Shape.Textures; | ||
323 | Primitive.TextureEntryFace face = te.CreateFace((uint)i); | ||
324 | face.MediaFlags = true; | ||
325 | part.Shape.Textures = te; | ||
326 | m_log.DebugFormat( | ||
327 | "[MOAP]: Media flags for face {0} is {1}", | ||
328 | i, part.Shape.Textures.FaceTextures[i].MediaFlags); | ||
329 | } | ||
330 | } | ||
314 | } | 331 | } |
315 | else | 332 | else |
316 | { | 333 | { |
317 | // We need to go through the media textures one at a time to make sure that we have permission | 334 | // We need to go through the media textures one at a time to make sure that we have permission |
318 | // to change them | 335 | // to change them |
336 | |||
337 | // FIXME: Race condition here since some other texture entry manipulator may overwrite/get | ||
338 | // overwritten. Unfortunately, PrimitiveBaseShape does not allow us to change texture entry | ||
339 | // directly. | ||
340 | Primitive.TextureEntry te = part.Shape.Textures; | ||
341 | |||
319 | for (int i = 0; i < media.Count; i++) | 342 | for (int i = 0; i < media.Count; i++) |
320 | { | 343 | { |
321 | if (m_scene.Permissions.CanControlPrimMedia(agentId, part.UUID, i)) | 344 | if (m_scene.Permissions.CanControlPrimMedia(agentId, part.UUID, i)) |
322 | { | 345 | { |
323 | media[i] = omu.FaceMedia[i]; | 346 | media[i] = omu.FaceMedia[i]; |
347 | |||
348 | // When a face is cleared this is done by setting the MediaFlags in the TextureEntry via a normal | ||
349 | // texture update, so we don't need to worry about clearing MediaFlags here. | ||
350 | if (null == media[i]) | ||
351 | continue; | ||
352 | |||
353 | Primitive.TextureEntryFace face = te.CreateFace((uint)i); | ||
354 | face.MediaFlags = true; | ||
355 | |||
356 | m_log.DebugFormat( | ||
357 | "[MOAP]: Media flags for face {0} is {1}", | ||
358 | i, face.MediaFlags); | ||
324 | // m_log.DebugFormat("[MOAP]: Set media entry for face {0} on {1}", i, part.Name); | 359 | // m_log.DebugFormat("[MOAP]: Set media entry for face {0} on {1}", i, part.Name); |
325 | } | 360 | } |
326 | } | 361 | } |
362 | |||
363 | part.Shape.Textures = te; | ||
364 | |||
365 | // for (int i2 = 0; i2 < part.Shape.Textures.FaceTextures.Length; i2++) | ||
366 | // m_log.DebugFormat("[MOAP]: FaceTexture[{0}] is {1}", i2, part.Shape.Textures.FaceTextures[i2]); | ||
327 | } | 367 | } |
328 | 368 | ||
329 | UpdateMediaUrl(part, agentId); | 369 | UpdateMediaUrl(part, agentId); |