aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
diff options
context:
space:
mode:
authorUbitUmarov2015-12-03 16:21:43 +0000
committerUbitUmarov2015-12-03 16:21:43 +0000
commit0ae7b7e7e8bffe4efe147c505a2782aff7ce9c74 (patch)
treeb3984e90bd5e0ceda4bd780c359da84249de1baf /OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
parentfix a 1m diference in regions view range estimations (diff)
downloadopensim-SC_OLD-0ae7b7e7e8bffe4efe147c505a2782aff7ce9c74.zip
opensim-SC_OLD-0ae7b7e7e8bffe4efe147c505a2782aff7ce9c74.tar.gz
opensim-SC_OLD-0ae7b7e7e8bffe4efe147c505a2782aff7ce9c74.tar.bz2
opensim-SC_OLD-0ae7b7e7e8bffe4efe147c505a2782aff7ce9c74.tar.xz
change handling of optional skirt baked texture
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs52
1 files changed, 40 insertions, 12 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
index bbea181..c800383 100644
--- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
@@ -382,6 +382,9 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
382 382
383 List<UUID> missing = new List<UUID>(); 383 List<UUID> missing = new List<UUID>();
384 384
385 bool haveSkirt = (wearableCache[19].TextureAsset != null);
386 bool haveNewSkirt = false;
387
385 // Process received baked textures 388 // Process received baked textures
386 for (int i = 0; i < cacheItems.Length; i++) 389 for (int i = 0; i < cacheItems.Length; i++)
387 { 390 {
@@ -392,8 +395,11 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
392 if (face == null) 395 if (face == null)
393 { 396 {
394 // for some reason viewer is cleaning this 397 // for some reason viewer is cleaning this
395 sp.Appearance.Texture.FaceTextures[idx] = sp.Appearance.Texture.CreateFace((uint) idx); 398 if(idx != 19) // skirt is optional
396 sp.Appearance.Texture.FaceTextures[idx].TextureID = AppearanceManager.DEFAULT_AVATAR_TEXTURE; 399 {
400 sp.Appearance.Texture.FaceTextures[idx] = sp.Appearance.Texture.CreateFace((uint) idx);
401 sp.Appearance.Texture.FaceTextures[idx].TextureID = AppearanceManager.DEFAULT_AVATAR_TEXTURE;
402 }
397 wearableCache[idx].CacheId = UUID.Zero; 403 wearableCache[idx].CacheId = UUID.Zero;
398 wearableCache[idx].TextureID = UUID.Zero; 404 wearableCache[idx].TextureID = UUID.Zero;
399 wearableCache[idx].TextureAsset = null; 405 wearableCache[idx].TextureAsset = null;
@@ -409,6 +415,8 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
409 continue; 415 continue;
410 } 416 }
411 417
418 if(idx == 19)
419 haveNewSkirt = true;
412/* 420/*
413 if (face.TextureID == wearableCache[idx].TextureID && m_BakedTextureModule != null) 421 if (face.TextureID == wearableCache[idx].TextureID && m_BakedTextureModule != null)
414 { 422 {
@@ -448,6 +456,15 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
448 } 456 }
449 } 457 }
450 458
459 // handle optional skirt case
460 if(!haveNewSkirt && haveSkirt)
461 {
462 wearableCache[19].CacheId = UUID.Zero;
463 wearableCache[19].TextureID = UUID.Zero;
464 wearableCache[19].TextureAsset = null;
465 validDirtyBakes++;
466 }
467
451 sp.Appearance.WearableCacheItems = wearableCache; 468 sp.Appearance.WearableCacheItems = wearableCache;
452 469
453 if (missing.Count > 0) 470 if (missing.Count > 0)
@@ -461,7 +478,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
461 // if we got a full set of baked textures save all in BakedTextureModule 478 // if we got a full set of baked textures save all in BakedTextureModule
462 if (m_BakedTextureModule != null) 479 if (m_BakedTextureModule != null)
463 { 480 {
464 m_log.Debug("[UpdateBakedCache] uploading to bakedModule cache"); 481 m_log.Debug("[UpdateBakedCache] start async uploading to bakedModule cache");
465 482
466 m_BakedTextureModule.Store(sp.UUID, wearableCache); 483 m_BakedTextureModule.Store(sp.UUID, wearableCache);
467 } 484 }
@@ -573,12 +590,15 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
573 wearableCacheValid = (wearableCacheValid && (hits >= AvatarAppearance.BAKE_INDICES.Length - 1)); 590 wearableCacheValid = (wearableCacheValid && (hits >= AvatarAppearance.BAKE_INDICES.Length - 1));
574 if (wearableCacheValid) 591 if (wearableCacheValid)
575 m_log.Debug("[ValidateBakedCache] have valid local cache"); 592 m_log.Debug("[ValidateBakedCache] have valid local cache");
593 else
594 wearableCache[19].TextureAsset = null; // clear optional skirt
576 } 595 }
577 596
578 bool checkExternal = false; 597 bool checkExternal = false;
579 598
580 if (!wearableCacheValid) 599 if (!wearableCacheValid)
581 { 600 {
601 hits = 0;
582 // only use external bake module on login condition check 602 // only use external bake module on login condition check
583// ScenePresence ssp = null; 603// ScenePresence ssp = null;
584// if (sp is ScenePresence) 604// if (sp is ScenePresence)
@@ -594,7 +614,6 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
594 614
595 if (checkExternal) 615 if (checkExternal)
596 { 616 {
597 hits = 0;
598 bool gotbacked = false; 617 bool gotbacked = false;
599 618
600 m_log.Debug("[ValidateBakedCache] local cache invalid, checking bakedModule"); 619 m_log.Debug("[ValidateBakedCache] local cache invalid, checking bakedModule");
@@ -635,17 +654,26 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
635 for (int i = 0; i < AvatarAppearance.BAKE_INDICES.Length; i++) 654 for (int i = 0; i < AvatarAppearance.BAKE_INDICES.Length; i++)
636 { 655 {
637 int idx = AvatarAppearance.BAKE_INDICES[i]; 656 int idx = AvatarAppearance.BAKE_INDICES[i];
657 if(wearableCache[idx].TextureAsset == null)
658 {
659 if(idx == 19)
660 {
661 sp.Appearance.Texture.FaceTextures[idx] = null;
662 hits++;
663 }
664 continue;
665 }
666
638 Primitive.TextureEntryFace face = sp.Appearance.Texture.FaceTextures[idx]; 667 Primitive.TextureEntryFace face = sp.Appearance.Texture.FaceTextures[idx];
639 668
640 if (sp.Appearance.Texture.FaceTextures[idx] == null) 669 if (face == null)
641 sp.Appearance.Texture.FaceTextures[idx] = sp.Appearance.Texture.CreateFace((uint)idx); 670 {
642 sp.Appearance.Texture.FaceTextures[idx].TextureID = wearableCache[idx].TextureID; 671 face = sp.Appearance.Texture.CreateFace((uint)idx);
643 face = sp.Appearance.Texture.FaceTextures[idx]; 672 sp.Appearance.Texture.FaceTextures[idx] = face;
673 }
644 674
645 // this should be removed 675 face.TextureID = wearableCache[idx].TextureID;
646 if (face.TextureID != UUID.Zero && face.TextureID != AppearanceManager.DEFAULT_AVATAR_TEXTURE) 676 hits++;
647 hits++;
648 continue;
649 } 677 }
650 } 678 }
651 } 679 }