diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs index b6ec6dc..ffb3221 100644 --- a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs +++ b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs | |||
@@ -225,6 +225,12 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap | |||
225 | return me; | 225 | return me; |
226 | } | 226 | } |
227 | 227 | ||
228 | /// <summary> | ||
229 | /// Set the media entry on the face of the given part. | ||
230 | /// </summary> | ||
231 | /// <param name="part">/param> | ||
232 | /// <param name="face"></param> | ||
233 | /// <param name="me"></param> | ||
228 | public void SetMediaEntry(SceneObjectPart part, int face, MediaEntry me) | 234 | public void SetMediaEntry(SceneObjectPart part, int face, MediaEntry me) |
229 | { | 235 | { |
230 | // m_log.DebugFormat("[MOAP]: SetMediaEntry for {0}, face {1}", part.Name, face); | 236 | // m_log.DebugFormat("[MOAP]: SetMediaEntry for {0}, face {1}", part.Name, face); |
@@ -249,9 +255,31 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap | |||
249 | part.TriggerScriptChangedEvent(Changed.MEDIA); | 255 | part.TriggerScriptChangedEvent(Changed.MEDIA); |
250 | } | 256 | } |
251 | 257 | ||
258 | /// <summary> | ||
259 | /// Clear the media entry from the face of the given part. | ||
260 | /// </summary> | ||
261 | /// <param name="part"></param> | ||
262 | /// <param name="face"></param> | ||
252 | public void ClearMediaEntry(SceneObjectPart part, int face) | 263 | public void ClearMediaEntry(SceneObjectPart part, int face) |
253 | { | 264 | { |
254 | SetMediaEntry(part, face, null); | 265 | CheckFaceParam(part, face); |
266 | |||
267 | // If no media has been set up yetthen we don't need to clear anything | ||
268 | if (null == part.Shape.Media) | ||
269 | return; | ||
270 | |||
271 | lock (part.Shape.Media) | ||
272 | part.Shape.Media[face] = null; | ||
273 | |||
274 | UpdateMediaUrl(part, UUID.Zero); | ||
275 | |||
276 | Primitive.TextureEntry te = part.Shape.Textures; | ||
277 | Primitive.TextureEntryFace teFace = te.CreateFace((uint)face); | ||
278 | teFace.MediaFlags = false; | ||
279 | part.Shape.Textures = te; | ||
280 | |||
281 | part.ScheduleFullUpdate(); | ||
282 | part.TriggerScriptChangedEvent(Changed.MEDIA); | ||
255 | } | 283 | } |
256 | 284 | ||
257 | /// <summary> | 285 | /// <summary> |