From 5dfd2643dfc530280e5dcd0056b59add7d49f313 Mon Sep 17 00:00:00 2001
From: John Hurliman
Date: Wed, 30 Sep 2009 15:53:03 -0700
Subject: * Change the signature of the agent set appearance callback to
prevent unnecessary serialization/deserialization of TextureEntry objects and
allow TextureEntry to be inspected for missing bakes * Inspect incoming
TextureEntry updates for bakes that do not exist on the simulator and request
the missing textures * Properly handle appearance updates that do not have a
TextureEntry set
---
OpenSim/Framework/AvatarAppearance.cs | 12 ++++++------
OpenSim/Framework/IClientAPI.cs | 2 +-
OpenSim/Framework/Tests/AgentCircuitDataTest.cs | 3 +--
3 files changed, 8 insertions(+), 9 deletions(-)
(limited to 'OpenSim/Framework')
diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs
index 940ae3b..3f4214e 100644
--- a/OpenSim/Framework/AvatarAppearance.cs
+++ b/OpenSim/Framework/AvatarAppearance.cs
@@ -380,13 +380,13 @@ namespace OpenSim.Framework
///
/// Set up appearance textures and avatar parameters, including a height calculation
///
- ///
- ///
- public virtual void SetAppearance(byte[] texture, List visualParam)
+ public virtual void SetAppearance(Primitive.TextureEntry textureEntry, byte[] visualParams)
{
- Primitive.TextureEntry textureEnt = new Primitive.TextureEntry(texture, 0, texture.Length);
- m_texture = textureEnt;
- m_visualparams = visualParam.ToArray();
+ if (textureEntry != null)
+ m_texture = textureEntry;
+ if (visualParams != null)
+ m_visualparams = visualParams;
+
m_avatarHeight = 1.23077f // Shortest possible avatar height
+ 0.516945f * (float)m_visualparams[(int)VPElement.SHAPE_HEIGHT] / 255.0f // Body height
+ 0.072514f * (float)m_visualparams[(int)VPElement.SHAPE_HEAD_SIZE] / 255.0f // Head size
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 2ca2df9..430cbd7 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -65,7 +65,7 @@ namespace OpenSim.Framework
public delegate void NetworkStats(int inPackets, int outPackets, int unAckedBytes);
- public delegate void SetAppearance(byte[] texture, List visualParamList);
+ public delegate void SetAppearance(Primitive.TextureEntry textureEntry, byte[] visualParams);
public delegate void StartAnim(IClientAPI remoteClient, UUID animID);
diff --git a/OpenSim/Framework/Tests/AgentCircuitDataTest.cs b/OpenSim/Framework/Tests/AgentCircuitDataTest.cs
index ecd35c0..2fda6f3 100644
--- a/OpenSim/Framework/Tests/AgentCircuitDataTest.cs
+++ b/OpenSim/Framework/Tests/AgentCircuitDataTest.cs
@@ -227,8 +227,7 @@ namespace OpenSim.Framework.Tests
wearbyte.Add(VisualParams[i]);
}
-
- AvAppearance.SetAppearance(AvAppearance.Texture.GetBytes(), wearbyte);
+ AvAppearance.SetAppearance(AvAppearance.Texture, (byte[])VisualParams.Clone());
}
///
--
cgit v1.1