aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/AvatarAppearance.cs
diff options
context:
space:
mode:
authorMaster ScienceSim2010-10-29 13:37:13 -0700
committerMaster ScienceSim2010-10-29 13:43:35 -0700
commitf5c9a56c8b73ef93db712fefe9f0366c4983e04f (patch)
tree23f47ca462584b41f2151d7a3962aaca11478b2d /OpenSim/Framework/AvatarAppearance.cs
parentConfiguration of persistent baked textures and save/send delays. (diff)
downloadopensim-SC_OLD-f5c9a56c8b73ef93db712fefe9f0366c4983e04f.zip
opensim-SC_OLD-f5c9a56c8b73ef93db712fefe9f0366c4983e04f.tar.gz
opensim-SC_OLD-f5c9a56c8b73ef93db712fefe9f0366c4983e04f.tar.bz2
opensim-SC_OLD-f5c9a56c8b73ef93db712fefe9f0366c4983e04f.tar.xz
Bunch of fixes that reduce the number of times appearance
and avatar data are sent. And the number of times they are stored.
Diffstat (limited to 'OpenSim/Framework/AvatarAppearance.cs')
-rw-r--r--OpenSim/Framework/AvatarAppearance.cs35
1 files changed, 17 insertions, 18 deletions
diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs
index e66a1e7..17e4eb4 100644
--- a/OpenSim/Framework/AvatarAppearance.cs
+++ b/OpenSim/Framework/AvatarAppearance.cs
@@ -45,6 +45,7 @@ namespace OpenSim.Framework
45 public readonly static int VISUALPARAM_COUNT = 218; 45 public readonly static int VISUALPARAM_COUNT = 218;
46 46
47 public readonly static int TEXTURE_COUNT = 21; 47 public readonly static int TEXTURE_COUNT = 21;
48 public readonly static byte[] BAKE_INDICES = new byte[] { 8, 9, 10, 11, 19, 20 };
48 49
49 protected UUID m_owner; 50 protected UUID m_owner;
50 protected int m_serial = 1; 51 protected int m_serial = 1;
@@ -347,14 +348,8 @@ namespace OpenSim.Framework
347 protected virtual void SetDefaultTexture() 348 protected virtual void SetDefaultTexture()
348 { 349 {
349 m_texture = new Primitive.TextureEntry(new UUID("C228D1CF-4B5D-4BA8-84F4-899A0796AA97")); 350 m_texture = new Primitive.TextureEntry(new UUID("C228D1CF-4B5D-4BA8-84F4-899A0796AA97"));
350 // The initialization of these seems to force a rebake regardless of whether it is needed 351 for (uint i = 0; i < TEXTURE_COUNT; i++)
351 // m_textures.CreateFace(0).TextureID = new UUID("00000000-0000-1111-9999-000000000012"); 352 m_texture.CreateFace(i).TextureID = new UUID(AppearanceManager.DEFAULT_AVATAR_TEXTURE);
352 // m_textures.CreateFace(1).TextureID = Util.BLANK_TEXTURE_UUID;
353 // m_textures.CreateFace(2).TextureID = Util.BLANK_TEXTURE_UUID;
354 // m_textures.CreateFace(3).TextureID = new UUID("6522E74D-1660-4E7F-B601-6F48C1659A77");
355 // m_textures.CreateFace(4).TextureID = new UUID("7CA39B4C-BD19-4699-AFF7-F93FD03D3E7B");
356 // m_textures.CreateFace(5).TextureID = new UUID("00000000-0000-1111-9999-000000000010");
357 // m_textures.CreateFace(6).TextureID = new UUID("00000000-0000-1111-9999-000000000011");
358 } 353 }
359 354
360 /// <summary> 355 /// <summary>
@@ -371,7 +366,7 @@ namespace OpenSim.Framework
371 // made. We determine if any of the textures actually 366 // made. We determine if any of the textures actually
372 // changed to know if the appearance should be saved later 367 // changed to know if the appearance should be saved later
373 bool changed = false; 368 bool changed = false;
374 for (int i = 0; i < AvatarAppearance.TEXTURE_COUNT; i++) 369 for (uint i = 0; i < AvatarAppearance.TEXTURE_COUNT; i++)
375 { 370 {
376 Primitive.TextureEntryFace newface = textureEntry.FaceTextures[i]; 371 Primitive.TextureEntryFace newface = textureEntry.FaceTextures[i];
377 Primitive.TextureEntryFace oldface = m_texture.FaceTextures[i]; 372 Primitive.TextureEntryFace oldface = m_texture.FaceTextures[i];
@@ -385,7 +380,6 @@ namespace OpenSim.Framework
385 if (oldface != null && oldface.TextureID == newface.TextureID) continue; 380 if (oldface != null && oldface.TextureID == newface.TextureID) continue;
386 } 381 }
387 382
388 m_texture.FaceTextures[i] = (newface != null) ? new Primitive.TextureEntryFace(newface) : null;
389 changed = true; 383 changed = true;
390// DEBUG ON 384// DEBUG ON
391 if (newface != null) 385 if (newface != null)
@@ -393,6 +387,7 @@ namespace OpenSim.Framework
393// DEBUG OFF 387// DEBUG OFF
394 } 388 }
395 389
390 m_texture = textureEntry;
396 return changed; 391 return changed;
397 } 392 }
398 393
@@ -415,8 +410,8 @@ namespace OpenSim.Framework
415 if (visualParams[i] != m_visualparams[i]) 410 if (visualParams[i] != m_visualparams[i])
416 { 411 {
417// DEBUG ON 412// DEBUG ON
418 m_log.WarnFormat("[AVATARAPPEARANCE] vparams changed [{0}] {1} ==> {2}", 413// m_log.WarnFormat("[AVATARAPPEARANCE] vparams changed [{0}] {1} ==> {2}",
419 i,m_visualparams[i],visualParams[i]); 414// i,m_visualparams[i],visualParams[i]);
420// DEBUG OFF 415// DEBUG OFF
421 m_visualparams[i] = visualParams[i]; 416 m_visualparams[i] = visualParams[i];
422 changed = true; 417 changed = true;
@@ -581,6 +576,8 @@ namespace OpenSim.Framework
581 m_attachments.Clear(); 576 m_attachments.Clear();
582 } 577 }
583 578
579 #region Packing Functions
580
584 /// <summary> 581 /// <summary>
585 /// Create an OSDMap from the appearance data 582 /// Create an OSDMap from the appearance data
586 /// </summary> 583 /// </summary>
@@ -605,7 +602,7 @@ namespace OpenSim.Framework
605 if (m_texture.FaceTextures[i] != null) 602 if (m_texture.FaceTextures[i] != null)
606 textures.Add(OSD.FromUUID(m_texture.FaceTextures[i].TextureID)); 603 textures.Add(OSD.FromUUID(m_texture.FaceTextures[i].TextureID));
607 else 604 else
608 textures.Add(OSD.FromUUID(UUID.Zero)); 605 textures.Add(OSD.FromUUID(AppearanceManager.DEFAULT_AVATAR_TEXTURE));
609 } 606 }
610 data["textures"] = textures; 607 data["textures"] = textures;
611 608
@@ -657,12 +654,10 @@ namespace OpenSim.Framework
657 OSDArray textures = (OSDArray)(data["textures"]); 654 OSDArray textures = (OSDArray)(data["textures"]);
658 for (int i = 0; i < AvatarAppearance.TEXTURE_COUNT && i < textures.Count; i++) 655 for (int i = 0; i < AvatarAppearance.TEXTURE_COUNT && i < textures.Count; i++)
659 { 656 {
657 UUID textureID = AppearanceManager.DEFAULT_AVATAR_TEXTURE;
660 if (textures[i] != null) 658 if (textures[i] != null)
661 { 659 textureID = textures[i].AsUUID();
662 UUID textureID = textures[i].AsUUID(); 660 m_texture.CreateFace((uint)i).TextureID = new UUID(textureID);
663 if (textureID != UUID.Zero)
664 m_texture.CreateFace((uint)i).TextureID = textureID;
665 }
666 } 661 }
667 } 662 }
668 else 663 else
@@ -697,6 +692,9 @@ namespace OpenSim.Framework
697 } 692 }
698 } 693 }
699 694
695 #endregion
696
697 #region VPElement
700 698
701 /// <summary> 699 /// <summary>
702 /// Viewer Params Array Element for AgentSetAppearance 700 /// Viewer Params Array Element for AgentSetAppearance
@@ -1460,5 +1458,6 @@ namespace OpenSim.Framework
1460 SKIRT_SKIRT_GREEN = 216, 1458 SKIRT_SKIRT_GREEN = 216,
1461 SKIRT_SKIRT_BLUE = 217 1459 SKIRT_SKIRT_BLUE = 217
1462 } 1460 }
1461 #endregion
1463 } 1462 }
1464} \ No newline at end of file 1463} \ No newline at end of file