factor out SetPartMediaFlags() function in MoapModule.
parent
2e46027c14
commit
9b345ebf73
|
@ -250,11 +250,7 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap
|
||||||
|
|
||||||
UpdateMediaUrl(part, UUID.Zero);
|
UpdateMediaUrl(part, UUID.Zero);
|
||||||
|
|
||||||
// Temporary code to fix llSetPrimMediaParams() bug, pending refactoring
|
SetPartMediaFlags(part, face, me != null);
|
||||||
Primitive.TextureEntry te = part.Shape.Textures;
|
|
||||||
Primitive.TextureEntryFace teFace = te.CreateFace((uint)face);
|
|
||||||
teFace.MediaFlags = me != null;
|
|
||||||
part.Shape.Textures = te;
|
|
||||||
|
|
||||||
part.ScheduleFullUpdate();
|
part.ScheduleFullUpdate();
|
||||||
part.TriggerScriptChangedEvent(Changed.MEDIA);
|
part.TriggerScriptChangedEvent(Changed.MEDIA);
|
||||||
|
@ -270,6 +266,23 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap
|
||||||
SetMediaEntry(part, face, null);
|
SetMediaEntry(part, face, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Set the media flags on the texture face of the given part.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// The fact that we need a separate function to do what should be a simple one line operation is BUTT UGLY.
|
||||||
|
/// </remarks>
|
||||||
|
/// <param name="part"></param>
|
||||||
|
/// <param name="face"></param>
|
||||||
|
/// <param name="flag"></param>
|
||||||
|
protected void SetPartMediaFlags(SceneObjectPart part, int face, bool flag)
|
||||||
|
{
|
||||||
|
Primitive.TextureEntry te = part.Shape.Textures;
|
||||||
|
Primitive.TextureEntryFace teFace = te.CreateFace((uint)face);
|
||||||
|
teFace.MediaFlags = flag;
|
||||||
|
part.Shape.Textures = te;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sets or gets per face media textures.
|
/// Sets or gets per face media textures.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -393,10 +406,7 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap
|
||||||
// FIXME: Race condition here since some other texture entry manipulator may overwrite/get
|
// FIXME: Race condition here since some other texture entry manipulator may overwrite/get
|
||||||
// overwritten. Unfortunately, PrimitiveBaseShape does not allow us to change texture entry
|
// overwritten. Unfortunately, PrimitiveBaseShape does not allow us to change texture entry
|
||||||
// directly.
|
// directly.
|
||||||
Primitive.TextureEntry te = part.Shape.Textures;
|
SetPartMediaFlags(part, i, true);
|
||||||
Primitive.TextureEntryFace face = te.CreateFace((uint)i);
|
|
||||||
face.MediaFlags = true;
|
|
||||||
part.Shape.Textures = te;
|
|
||||||
// m_log.DebugFormat(
|
// m_log.DebugFormat(
|
||||||
// "[MOAP]: Media flags for face {0} is {1}",
|
// "[MOAP]: Media flags for face {0} is {1}",
|
||||||
// i, part.Shape.Textures.FaceTextures[i].MediaFlags);
|
// i, part.Shape.Textures.FaceTextures[i].MediaFlags);
|
||||||
|
@ -428,8 +438,7 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap
|
||||||
if (null == media[i])
|
if (null == media[i])
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
Primitive.TextureEntryFace face = te.CreateFace((uint)i);
|
SetPartMediaFlags(part, i, true);
|
||||||
face.MediaFlags = true;
|
|
||||||
|
|
||||||
// m_log.DebugFormat(
|
// m_log.DebugFormat(
|
||||||
// "[MOAP]: Media flags for face {0} is {1}",
|
// "[MOAP]: Media flags for face {0} is {1}",
|
||||||
|
|
Loading…
Reference in New Issue