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.
parent
06829c4082
commit
9ae24cac2f
|
@ -4549,6 +4549,14 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
oldTex.DefaultTexture = fallbackOldFace;
|
oldTex.DefaultTexture = fallbackOldFace;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Materials capable viewers can send a ObjectImage packet
|
||||||
|
// when nothing in TE has changed. MaterialID should be updated
|
||||||
|
// by the RenderMaterials CAP handler, so updating it here may cause a
|
||||||
|
// race condtion. Therefore, if no non-materials TE fields have changed,
|
||||||
|
// we should ignore any changes and not update Shape.TextureEntry
|
||||||
|
|
||||||
|
bool otherFieldsChanged = false;
|
||||||
|
|
||||||
for (int i = 0 ; i < GetNumberOfSides(); i++)
|
for (int i = 0 ; i < GetNumberOfSides(); i++)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -4571,14 +4579,29 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
if (oldFace.TextureID != newFace.TextureID)
|
if (oldFace.TextureID != newFace.TextureID)
|
||||||
changeFlags |= Changed.TEXTURE;
|
changeFlags |= Changed.TEXTURE;
|
||||||
if (oldFace.MaterialID != newFace.MaterialID)
|
|
||||||
changeFlags |= Changed.TEXTURE;
|
|
||||||
|
|
||||||
// Max change, skip the rest of testing
|
// Max change, skip the rest of testing
|
||||||
if (changeFlags == (Changed.TEXTURE | Changed.COLOR))
|
if (changeFlags == (Changed.TEXTURE | Changed.COLOR))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
if (!otherFieldsChanged)
|
||||||
|
{
|
||||||
|
if (oldFace.Bump != newFace.Bump) otherFieldsChanged = true;
|
||||||
|
if (oldFace.Fullbright != newFace.Fullbright) otherFieldsChanged = true;
|
||||||
|
if (oldFace.Glow != newFace.Glow) otherFieldsChanged = true;
|
||||||
|
if (oldFace.MediaFlags != newFace.MediaFlags) otherFieldsChanged = true;
|
||||||
|
if (oldFace.OffsetU != newFace.OffsetU) otherFieldsChanged = true;
|
||||||
|
if (oldFace.OffsetV != newFace.OffsetV) otherFieldsChanged = true;
|
||||||
|
if (oldFace.RepeatU != newFace.RepeatU) otherFieldsChanged = true;
|
||||||
|
if (oldFace.RepeatV != newFace.RepeatV) otherFieldsChanged = true;
|
||||||
|
if (oldFace.Rotation != newFace.Rotation) otherFieldsChanged = true;
|
||||||
|
if (oldFace.Shiny != newFace.Shiny) otherFieldsChanged = true;
|
||||||
|
if (oldFace.TexMapType != newFace.TexMapType) otherFieldsChanged = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (changeFlags != 0 || otherFieldsChanged)
|
||||||
|
{
|
||||||
m_shape.TextureEntry = newTex.GetBytes();
|
m_shape.TextureEntry = newTex.GetBytes();
|
||||||
if (changeFlags != 0)
|
if (changeFlags != 0)
|
||||||
TriggerScriptChangedEvent(changeFlags);
|
TriggerScriptChangedEvent(changeFlags);
|
||||||
|
@ -4590,6 +4613,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
//This is sparta
|
//This is sparta
|
||||||
ScheduleFullUpdate();
|
ScheduleFullUpdate();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void aggregateScriptEvents()
|
public void aggregateScriptEvents()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue