aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs31
1 files changed, 20 insertions, 11 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 8785ca9..c587b2a 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -1589,20 +1589,29 @@ namespace OpenSim.Region.Framework.Scenes
1589 1589
1590 public void AddTextureAnimation(Primitive.TextureAnimation pTexAnim) 1590 public void AddTextureAnimation(Primitive.TextureAnimation pTexAnim)
1591 { 1591 {
1592 byte[] data = new byte[16]; 1592 byte[] data;
1593 int pos = 0;
1594 1593
1595 // The flags don't like conversion from uint to byte, so we have to do 1594 if (pTexAnim.Flags == Primitive.TextureAnimMode.ANIM_OFF)
1596 // it the crappy way. See the above function :( 1595 {
1596 data = Utils.EmptyBytes;
1597 }
1598 else
1599 {
1600 data = new byte[16];
1601 int pos = 0;
1602
1603 // The flags don't like conversion from uint to byte, so we have to do
1604 // it the crappy way. See the above function :(
1597 1605
1598 data[pos] = ConvertScriptUintToByte((uint)pTexAnim.Flags); pos++; 1606 data[pos] = ConvertScriptUintToByte((uint)pTexAnim.Flags); pos++;
1599 data[pos] = (byte)pTexAnim.Face; pos++; 1607 data[pos] = (byte)pTexAnim.Face; pos++;
1600 data[pos] = (byte)pTexAnim.SizeX; pos++; 1608 data[pos] = (byte)pTexAnim.SizeX; pos++;
1601 data[pos] = (byte)pTexAnim.SizeY; pos++; 1609 data[pos] = (byte)pTexAnim.SizeY; pos++;
1602 1610
1603 Utils.FloatToBytes(pTexAnim.Start).CopyTo(data, pos); 1611 Utils.FloatToBytes(pTexAnim.Start).CopyTo(data, pos);
1604 Utils.FloatToBytes(pTexAnim.Length).CopyTo(data, pos + 4); 1612 Utils.FloatToBytes(pTexAnim.Length).CopyTo(data, pos + 4);
1605 Utils.FloatToBytes(pTexAnim.Rate).CopyTo(data, pos + 8); 1613 Utils.FloatToBytes(pTexAnim.Rate).CopyTo(data, pos + 8);
1614 }
1606 1615
1607 m_TextureAnimation = data; 1616 m_TextureAnimation = data;
1608 } 1617 }