aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-03-05 02:42:47 +0000
committerJustin Clark-Casey (justincc)2011-03-05 02:42:47 +0000
commit9b345ebf73663a04d8baa69f0fb48ab80b8b1a58 (patch)
treea8c66d0f6683215c4396b9eb30af77e983224818 /OpenSim/Region
parentConstruct test load iar only once and reuse for each test, rather than recrea... (diff)
downloadopensim-SC-9b345ebf73663a04d8baa69f0fb48ab80b8b1a58.zip
opensim-SC-9b345ebf73663a04d8baa69f0fb48ab80b8b1a58.tar.gz
opensim-SC-9b345ebf73663a04d8baa69f0fb48ab80b8b1a58.tar.bz2
opensim-SC-9b345ebf73663a04d8baa69f0fb48ab80b8b1a58.tar.xz
factor out SetPartMediaFlags() function in MoapModule.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs31
1 files changed, 20 insertions, 11 deletions
diff --git a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs
index b8943ad..898ca4a 100644
--- a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs
+++ b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs
@@ -250,11 +250,7 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap
250 250
251 UpdateMediaUrl(part, UUID.Zero); 251 UpdateMediaUrl(part, UUID.Zero);
252 252
253 // Temporary code to fix llSetPrimMediaParams() bug, pending refactoring 253 SetPartMediaFlags(part, face, me != null);
254 Primitive.TextureEntry te = part.Shape.Textures;
255 Primitive.TextureEntryFace teFace = te.CreateFace((uint)face);
256 teFace.MediaFlags = me != null;
257 part.Shape.Textures = te;
258 254
259 part.ScheduleFullUpdate(); 255 part.ScheduleFullUpdate();
260 part.TriggerScriptChangedEvent(Changed.MEDIA); 256 part.TriggerScriptChangedEvent(Changed.MEDIA);
@@ -271,6 +267,23 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap
271 } 267 }
272 268
273 /// <summary> 269 /// <summary>
270 /// Set the media flags on the texture face of the given part.
271 /// </summary>
272 /// <remarks>
273 /// The fact that we need a separate function to do what should be a simple one line operation is BUTT UGLY.
274 /// </remarks>
275 /// <param name="part"></param>
276 /// <param name="face"></param>
277 /// <param name="flag"></param>
278 protected void SetPartMediaFlags(SceneObjectPart part, int face, bool flag)
279 {
280 Primitive.TextureEntry te = part.Shape.Textures;
281 Primitive.TextureEntryFace teFace = te.CreateFace((uint)face);
282 teFace.MediaFlags = flag;
283 part.Shape.Textures = te;
284 }
285
286 /// <summary>
274 /// Sets or gets per face media textures. 287 /// Sets or gets per face media textures.
275 /// </summary> 288 /// </summary>
276 /// <param name="request"></param> 289 /// <param name="request"></param>
@@ -393,10 +406,7 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap
393 // FIXME: Race condition here since some other texture entry manipulator may overwrite/get 406 // FIXME: Race condition here since some other texture entry manipulator may overwrite/get
394 // overwritten. Unfortunately, PrimitiveBaseShape does not allow us to change texture entry 407 // overwritten. Unfortunately, PrimitiveBaseShape does not allow us to change texture entry
395 // directly. 408 // directly.
396 Primitive.TextureEntry te = part.Shape.Textures; 409 SetPartMediaFlags(part, i, true);
397 Primitive.TextureEntryFace face = te.CreateFace((uint)i);
398 face.MediaFlags = true;
399 part.Shape.Textures = te;
400// m_log.DebugFormat( 410// m_log.DebugFormat(
401// "[MOAP]: Media flags for face {0} is {1}", 411// "[MOAP]: Media flags for face {0} is {1}",
402// i, part.Shape.Textures.FaceTextures[i].MediaFlags); 412// i, part.Shape.Textures.FaceTextures[i].MediaFlags);
@@ -428,8 +438,7 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap
428 if (null == media[i]) 438 if (null == media[i])
429 continue; 439 continue;
430 440
431 Primitive.TextureEntryFace face = te.CreateFace((uint)i); 441 SetPartMediaFlags(part, i, true);
432 face.MediaFlags = true;
433 442
434 // m_log.DebugFormat( 443 // m_log.DebugFormat(
435 // "[MOAP]: Media flags for face {0} is {1}", 444 // "[MOAP]: Media flags for face {0} is {1}",