diff options
author | Justin Clark-Casey (justincc) | 2010-07-21 17:12:43 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-07-26 23:34:22 +0100 |
commit | b06308e1d30022f1a240fdc7ca875cc7277b10ea (patch) | |
tree | dcf31e0013e99e6c689ebaf561192a4bd8870ac0 | |
parent | start adding user ids to the media urls (diff) | |
download | opensim-SC_OLD-b06308e1d30022f1a240fdc7ca875cc7277b10ea.zip opensim-SC_OLD-b06308e1d30022f1a240fdc7ca875cc7277b10ea.tar.gz opensim-SC_OLD-b06308e1d30022f1a240fdc7ca875cc7277b10ea.tar.bz2 opensim-SC_OLD-b06308e1d30022f1a240fdc7ca875cc7277b10ea.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.
-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); |