From e84ac65b58b63ae4af18ab8ebd9a82664ff4ea21 Mon Sep 17 00:00:00 2001 From: diva Date: Tue, 24 Feb 2009 23:06:15 +0000 Subject: Close-to-final tweaking with appearance. This time sending *everything*. Addresses mantis #3223. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 29 +++++++----------------- 1 file changed, 8 insertions(+), 21 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 672567b..6fade39 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2688,20 +2688,8 @@ namespace OpenSim.Region.Framework.Scenes cAgent.VisualParams = m_appearance.VisualParams; - // Textures is not really needed in the base case, I think. But it's handy for - // the Hypergrid and other decentralized models, so that we know which - // textures to fecth from the user's asset server. - i = 0; - UUID[] textures = new UUID[m_appearance.Texture.FaceTextures.Length]; - foreach (Primitive.TextureEntryFace face in m_appearance.Texture.FaceTextures) - { - if (face != null) - textures[i] = face.TextureID; - else - textures[i] = UUID.Zero; - ++i; - } - cAgent.AgentTextures = textures; + if (m_appearance.Texture != null) + cAgent.AgentTextures = m_appearance.Texture.ToBytes(); } catch (Exception e) { @@ -2758,13 +2746,12 @@ namespace OpenSim.Region.Framework.Scenes } m_appearance.Wearables = wears; - // We're setting it here to default, but the viewer will soon send a SetAppearance that will - // set things straight. We should probably parse these textures too, we have them... - // In any case, the least we need to do is to check if this is HG and fetch the textures - // so that they can then be distributed to the other clients that ask for them later. - Primitive.TextureEntry te = AvatarAppearance.GetDefaultTexture(); //new Primitive.TextureEntry(UUID.Random()); - - m_appearance.SetAppearance(te.ToBytes(), new List(cAgent.VisualParams)); + byte[] te = null; + if (cAgent.AgentTextures != null) + te = cAgent.AgentTextures; + else + te = AvatarAppearance.GetDefaultTexture().ToBytes(); + m_appearance.SetAppearance(te, new List(cAgent.VisualParams)); } catch (Exception e) { -- cgit v1.1