diff options
author | Justin Clark-Casey (justincc) | 2011-03-05 02:21:53 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-03-05 02:21:53 +0000 |
commit | 9e579a7891d6eb4c3e5a0593d67837ed423135ee (patch) | |
tree | 35fcf0878a99659774245776ae075c10b5e095cf | |
parent | Change MoapModule.ClearMediaEntry to set TextureEntryFace.MediaFlags back to ... (diff) | |
download | opensim-SC-9e579a7891d6eb4c3e5a0593d67837ed423135ee.zip opensim-SC-9e579a7891d6eb4c3e5a0593d67837ed423135ee.tar.gz opensim-SC-9e579a7891d6eb4c3e5a0593d67837ed423135ee.tar.bz2 opensim-SC-9e579a7891d6eb4c3e5a0593d67837ed423135ee.tar.xz |
Fold ClearMediaEntry() back into SetMediaEntry()
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs index ffb3221..b8943ad 100644 --- a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs +++ b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs | |||
@@ -230,7 +230,7 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap | |||
230 | /// </summary> | 230 | /// </summary> |
231 | /// <param name="part">/param> | 231 | /// <param name="part">/param> |
232 | /// <param name="face"></param> | 232 | /// <param name="face"></param> |
233 | /// <param name="me"></param> | 233 | /// <param name="me">If null, then the media entry is cleared.</param> |
234 | public void SetMediaEntry(SceneObjectPart part, int face, MediaEntry me) | 234 | public void SetMediaEntry(SceneObjectPart part, int face, MediaEntry me) |
235 | { | 235 | { |
236 | // 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); |
@@ -238,7 +238,12 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap | |||
238 | CheckFaceParam(part, face); | 238 | CheckFaceParam(part, face); |
239 | 239 | ||
240 | if (null == part.Shape.Media) | 240 | if (null == part.Shape.Media) |
241 | part.Shape.Media = new PrimitiveBaseShape.MediaList(new MediaEntry[part.GetNumberOfSides()]); | 241 | { |
242 | if (me == null) | ||
243 | return; | ||
244 | else | ||
245 | part.Shape.Media = new PrimitiveBaseShape.MediaList(new MediaEntry[part.GetNumberOfSides()]); | ||
246 | } | ||
242 | 247 | ||
243 | lock (part.Shape.Media) | 248 | lock (part.Shape.Media) |
244 | part.Shape.Media[face] = me; | 249 | part.Shape.Media[face] = me; |
@@ -248,7 +253,7 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap | |||
248 | // Temporary code to fix llSetPrimMediaParams() bug, pending refactoring | 253 | // Temporary code to fix llSetPrimMediaParams() bug, pending refactoring |
249 | Primitive.TextureEntry te = part.Shape.Textures; | 254 | Primitive.TextureEntry te = part.Shape.Textures; |
250 | Primitive.TextureEntryFace teFace = te.CreateFace((uint)face); | 255 | Primitive.TextureEntryFace teFace = te.CreateFace((uint)face); |
251 | teFace.MediaFlags = true; | 256 | teFace.MediaFlags = me != null; |
252 | part.Shape.Textures = te; | 257 | part.Shape.Textures = te; |
253 | 258 | ||
254 | part.ScheduleFullUpdate(); | 259 | part.ScheduleFullUpdate(); |
@@ -262,24 +267,7 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap | |||
262 | /// <param name="face"></param> | 267 | /// <param name="face"></param> |
263 | public void ClearMediaEntry(SceneObjectPart part, int face) | 268 | public void ClearMediaEntry(SceneObjectPart part, int face) |
264 | { | 269 | { |
265 | CheckFaceParam(part, face); | 270 | SetMediaEntry(part, face, null); |
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); | ||
283 | } | 271 | } |
284 | 272 | ||
285 | /// <summary> | 273 | /// <summary> |