diff options
author | dahlia | 2013-04-19 00:35:06 -0700 |
---|---|---|
committer | dahlia | 2013-04-19 00:35:06 -0700 |
commit | 9ae24cac2fcf5ac00ec8e4ccae5e58e9ff90db74 (patch) | |
tree | 4ec3bdd45d0ff3af7cda775397e06372e8d3518c /OpenSim/Region/Framework | |
parent | remove default parameter value that apparently mono cant handle (diff) | |
download | opensim-SC_OLD-9ae24cac2fcf5ac00ec8e4ccae5e58e9ff90db74.zip opensim-SC_OLD-9ae24cac2fcf5ac00ec8e4ccae5e58e9ff90db74.tar.gz opensim-SC_OLD-9ae24cac2fcf5ac00ec8e4ccae5e58e9ff90db74.tar.bz2 opensim-SC_OLD-9ae24cac2fcf5ac00ec8e4ccae5e58e9ff90db74.tar.xz |
Materials-capable viewers send ImageUpdate packets when updating materials that are normally sent via RenderMaterials CAP. This can cause a race condition for updating TextureEntry fields. Therefore filter any TextureEntry updates so they only update if something actually changed.
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 46 |
1 files changed, 35 insertions, 11 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 0e85b87..347a2b5 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -4549,6 +4549,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
4549 | oldTex.DefaultTexture = fallbackOldFace; | 4549 | oldTex.DefaultTexture = fallbackOldFace; |
4550 | } | 4550 | } |
4551 | 4551 | ||
4552 | // Materials capable viewers can send a ObjectImage packet | ||
4553 | // when nothing in TE has changed. MaterialID should be updated | ||
4554 | // by the RenderMaterials CAP handler, so updating it here may cause a | ||
4555 | // race condtion. Therefore, if no non-materials TE fields have changed, | ||
4556 | // we should ignore any changes and not update Shape.TextureEntry | ||
4557 | |||
4558 | bool otherFieldsChanged = false; | ||
4559 | |||
4552 | for (int i = 0 ; i < GetNumberOfSides(); i++) | 4560 | for (int i = 0 ; i < GetNumberOfSides(); i++) |
4553 | { | 4561 | { |
4554 | 4562 | ||
@@ -4571,24 +4579,40 @@ namespace OpenSim.Region.Framework.Scenes | |||
4571 | 4579 | ||
4572 | if (oldFace.TextureID != newFace.TextureID) | 4580 | if (oldFace.TextureID != newFace.TextureID) |
4573 | changeFlags |= Changed.TEXTURE; | 4581 | changeFlags |= Changed.TEXTURE; |
4574 | if (oldFace.MaterialID != newFace.MaterialID) | ||
4575 | changeFlags |= Changed.TEXTURE; | ||
4576 | 4582 | ||
4577 | // Max change, skip the rest of testing | 4583 | // Max change, skip the rest of testing |
4578 | if (changeFlags == (Changed.TEXTURE | Changed.COLOR)) | 4584 | if (changeFlags == (Changed.TEXTURE | Changed.COLOR)) |
4579 | break; | 4585 | break; |
4586 | |||
4587 | if (!otherFieldsChanged) | ||
4588 | { | ||
4589 | if (oldFace.Bump != newFace.Bump) otherFieldsChanged = true; | ||
4590 | if (oldFace.Fullbright != newFace.Fullbright) otherFieldsChanged = true; | ||
4591 | if (oldFace.Glow != newFace.Glow) otherFieldsChanged = true; | ||
4592 | if (oldFace.MediaFlags != newFace.MediaFlags) otherFieldsChanged = true; | ||
4593 | if (oldFace.OffsetU != newFace.OffsetU) otherFieldsChanged = true; | ||
4594 | if (oldFace.OffsetV != newFace.OffsetV) otherFieldsChanged = true; | ||
4595 | if (oldFace.RepeatU != newFace.RepeatU) otherFieldsChanged = true; | ||
4596 | if (oldFace.RepeatV != newFace.RepeatV) otherFieldsChanged = true; | ||
4597 | if (oldFace.Rotation != newFace.Rotation) otherFieldsChanged = true; | ||
4598 | if (oldFace.Shiny != newFace.Shiny) otherFieldsChanged = true; | ||
4599 | if (oldFace.TexMapType != newFace.TexMapType) otherFieldsChanged = true; | ||
4600 | } | ||
4580 | } | 4601 | } |
4581 | 4602 | ||
4582 | m_shape.TextureEntry = newTex.GetBytes(); | 4603 | if (changeFlags != 0 || otherFieldsChanged) |
4583 | if (changeFlags != 0) | 4604 | { |
4584 | TriggerScriptChangedEvent(changeFlags); | 4605 | m_shape.TextureEntry = newTex.GetBytes(); |
4585 | UpdateFlag = UpdateRequired.FULL; | 4606 | if (changeFlags != 0) |
4586 | ParentGroup.HasGroupChanged = true; | 4607 | TriggerScriptChangedEvent(changeFlags); |
4608 | UpdateFlag = UpdateRequired.FULL; | ||
4609 | ParentGroup.HasGroupChanged = true; | ||
4587 | 4610 | ||
4588 | //This is madness.. | 4611 | //This is madness.. |
4589 | //ParentGroup.ScheduleGroupForFullUpdate(); | 4612 | //ParentGroup.ScheduleGroupForFullUpdate(); |
4590 | //This is sparta | 4613 | //This is sparta |
4591 | ScheduleFullUpdate(); | 4614 | ScheduleFullUpdate(); |
4615 | } | ||
4592 | } | 4616 | } |
4593 | 4617 | ||
4594 | public void aggregateScriptEvents() | 4618 | public void aggregateScriptEvents() |