diff options
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index 877231a..a19790d 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | |||
@@ -422,7 +422,6 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
422 | } | 422 | } |
423 | continue; | 423 | continue; |
424 | } | 424 | } |
425 | |||
426 | 425 | ||
427 | wearableCache[idx].TextureAsset = null; | 426 | wearableCache[idx].TextureAsset = null; |
428 | if (cache != null) | 427 | if (cache != null) |
@@ -456,7 +455,16 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
456 | { | 455 | { |
457 | m_log.Debug("[UpdateBakedCache] uploading to bakedModule cache"); | 456 | m_log.Debug("[UpdateBakedCache] uploading to bakedModule cache"); |
458 | 457 | ||
459 | m_BakedTextureModule.Store(sp.UUID, wearableCache); | 458 | WearableCacheItem[] toBakedModule = new WearableCacheItem[AvatarAppearance.BAKE_INDICES.Length]; |
459 | |||
460 | for (int i = 0; i < cacheItems.Length; i++) | ||
461 | { | ||
462 | int idx = (int)cacheItems[i].TextureIndex; | ||
463 | cacheItems[i].CacheId = wearableCache[idx].CacheId; | ||
464 | cacheItems[i].TextureID = wearableCache[idx].TextureID; | ||
465 | cacheItems[i].TextureAsset = wearableCache[idx].TextureAsset; | ||
466 | } | ||
467 | m_BakedTextureModule.Store(sp.UUID, cacheItems); | ||
460 | } | 468 | } |
461 | } | 469 | } |
462 | 470 | ||
@@ -513,22 +521,17 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
513 | 521 | ||
514 | if (bakedModuleCache != null) | 522 | if (bakedModuleCache != null) |
515 | { | 523 | { |
516 | m_log.Debug("[ValidateBakedCache] got bakedModule cache " + wearableCache.Length); | 524 | m_log.Debug("[ValidateBakedCache] got bakedModule cache " + bakedModuleCache.Length); |
517 | |||
518 | // old store have diferent sizes and index starts at 1 | ||
519 | int offset = 0; | ||
520 | if (bakedModuleCache[0].TextureIndex == 1) | ||
521 | offset = -1; | ||
522 | int j; | ||
523 | 525 | ||
524 | for (int i = 0; i < bakedModuleCache.Length; i++) | 526 | for (int i = 0; i < bakedModuleCache.Length; i++) |
525 | { | 527 | { |
526 | j = (int)bakedModuleCache[i].TextureIndex + offset; | 528 | int j = (int)bakedModuleCache[i].TextureIndex; |
527 | 529 | ||
528 | if (bakedModuleCache[i].TextureAsset != null) | 530 | if (bakedModuleCache[i].TextureAsset != null) |
529 | { | 531 | { |
530 | wearableCache[j].TextureID = bakedModuleCache[i].TextureID; | 532 | wearableCache[j].TextureID = bakedModuleCache[i].TextureID; |
531 | wearableCache[j].CacheId = bakedModuleCache[i].TextureID; | 533 | wearableCache[j].CacheId = bakedModuleCache[i].TextureID; |
534 | wearableCache[j].TextureAsset = bakedModuleCache[i].TextureAsset; | ||
532 | bakedModuleCache[i].TextureAsset.Temporary = true; | 535 | bakedModuleCache[i].TextureAsset.Temporary = true; |
533 | bakedModuleCache[i].TextureAsset.Local = true; | 536 | bakedModuleCache[i].TextureAsset.Local = true; |
534 | cache.Store(bakedModuleCache[i].TextureAsset); | 537 | cache.Store(bakedModuleCache[i].TextureAsset); |