aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/ScenePresence.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs39
1 files changed, 32 insertions, 7 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 66fefa3..3996cdc 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -74,6 +74,8 @@ namespace OpenSim.Region.Framework.Scenes
74 74
75 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 75 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
76 76
77 private static readonly byte[] BAKE_INDICES = new byte[] { 8, 9, 10, 11, 19, 20 };
78
77 public static byte[] DefaultTexture; 79 public static byte[] DefaultTexture;
78 80
79 public UUID currentParcelUUID = UUID.Zero; 81 public UUID currentParcelUUID = UUID.Zero;
@@ -2686,7 +2688,7 @@ namespace OpenSim.Region.Framework.Scenes
2686 /// </summary> 2688 /// </summary>
2687 /// <param name="texture"></param> 2689 /// <param name="texture"></param>
2688 /// <param name="visualParam"></param> 2690 /// <param name="visualParam"></param>
2689 public void SetAppearance(byte[] texture, List<byte> visualParam) 2691 public void SetAppearance(Primitive.TextureEntry textureEntry, byte[] visualParams)
2690 { 2692 {
2691 if (m_physicsActor != null) 2693 if (m_physicsActor != null)
2692 { 2694 {
@@ -2704,7 +2706,30 @@ namespace OpenSim.Region.Framework.Scenes
2704 AddToPhysicalScene(flyingTemp); 2706 AddToPhysicalScene(flyingTemp);
2705 } 2707 }
2706 } 2708 }
2707 m_appearance.SetAppearance(texture, visualParam); 2709
2710 #region Bake Cache Check
2711
2712 if (textureEntry != null)
2713 {
2714 for (int i = 0; i < BAKE_INDICES.Length; i++)
2715 {
2716 int j = BAKE_INDICES[i];
2717 Primitive.TextureEntryFace face = textureEntry.FaceTextures[j];
2718
2719 if (face != null && face.TextureID != AppearanceManager.DEFAULT_AVATAR_TEXTURE)
2720 {
2721 if (m_scene.AssetService.Get(face.TextureID.ToString()) == null)
2722 {
2723 m_log.Warn("[APPEARANCE]: Missing baked texture " + face.TextureID + " (" + (AppearanceManager.TextureIndex)j + ") for avatar " + this.Name);
2724 this.ControllingClient.SendRebakeAvatarTextures(face.TextureID);
2725 }
2726 }
2727 }
2728 }
2729
2730 #endregion Bake Cache Check
2731
2732 m_appearance.SetAppearance(textureEntry, visualParams);
2708 if (m_appearance.AvatarHeight > 0) 2733 if (m_appearance.AvatarHeight > 0)
2709 SetHeight(m_appearance.AvatarHeight); 2734 SetHeight(m_appearance.AvatarHeight);
2710 m_scene.CommsManager.AvatarService.UpdateUserAppearance(m_controllingClient.AgentId, m_appearance); 2735 m_scene.CommsManager.AvatarService.UpdateUserAppearance(m_controllingClient.AgentId, m_appearance);
@@ -3255,14 +3280,14 @@ namespace OpenSim.Region.Framework.Scenes
3255 wears[i++] = new AvatarWearable(itemId, assetId); 3280 wears[i++] = new AvatarWearable(itemId, assetId);
3256 } 3281 }
3257 m_appearance.Wearables = wears; 3282 m_appearance.Wearables = wears;
3258 byte[] te = null; 3283 Primitive.TextureEntry te;
3259 if (cAgent.AgentTextures != null) 3284 if (cAgent.AgentTextures != null && cAgent.AgentTextures.Length > 1)
3260 te = cAgent.AgentTextures; 3285 te = new Primitive.TextureEntry(cAgent.AgentTextures, 0, cAgent.AgentTextures.Length);
3261 else 3286 else
3262 te = AvatarAppearance.GetDefaultTexture().GetBytes(); 3287 te = AvatarAppearance.GetDefaultTexture();
3263 if ((cAgent.VisualParams == null) || (cAgent.VisualParams.Length < AvatarAppearance.VISUALPARAM_COUNT)) 3288 if ((cAgent.VisualParams == null) || (cAgent.VisualParams.Length < AvatarAppearance.VISUALPARAM_COUNT))
3264 cAgent.VisualParams = AvatarAppearance.GetDefaultVisualParams(); 3289 cAgent.VisualParams = AvatarAppearance.GetDefaultVisualParams();
3265 m_appearance.SetAppearance(te, new List<byte>(cAgent.VisualParams)); 3290 m_appearance.SetAppearance(te, (byte[])cAgent.VisualParams.Clone());
3266 } 3291 }
3267 catch (Exception e) 3292 catch (Exception e)
3268 { 3293 {