From e860dd33fa7a69e25bbab3f720710c9a7c50ed48 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 11 Aug 2014 00:54:30 +0100 Subject: [PATCH] remove confusing defonly control --- .../AvatarFactory/AvatarFactoryModule.cs | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index d5f271d433..2290c443c7 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs @@ -366,8 +366,6 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory // called on textures update public bool UpdateBakedTextureCache(IScenePresence sp, WearableCacheItem[] cacheItems) { - bool defonly = true; // are we only using default textures - // uploaded baked textures will be in assets local cache IAssetService cache = m_scene.AssetService; @@ -409,8 +407,6 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory continue; } - defonly = false; // found a non-default texture reference - if(sp.Appearance.Texture.FaceTextures[idx].TextureID == wearableCache[idx].TextureID) { if(wearableCache[idx].CacheId != cacheItems[i].CacheId) @@ -479,14 +475,12 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory sp.Appearance.WearableCacheItems[j].TextureID); } - // If we only found default textures, then the appearance is not cached - return (defonly ? false : true); + return (hits == cacheItems.Length); } // called when we get a new root avatar public bool ValidateBakedTextureCache(IScenePresence sp) { - bool defonly = true; // are we only using default textures int hits = 0; lock (m_setAppearanceLock) @@ -557,10 +551,8 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory // this should be removed if (face.TextureID != UUID.Zero && face.TextureID != AppearanceManager.DEFAULT_AVATAR_TEXTURE) - { - defonly = false; // found a non-default texture reference hits++; - } + continue; } else @@ -608,7 +600,6 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory } else hits++; - defonly = false; // found a non-default texture reference } } } @@ -616,7 +607,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory sp.Appearance.WearableCacheItems = wearableCache; } - m_log.DebugFormat("[AVFACTORY]: Completed texture check for {0} {1} {2} {3}", sp.Name, sp.UUID, hits, defonly.ToString()); + m_log.DebugFormat("[AVFACTORY]: Completed texture check for {0} {1} {2}", sp.Name, sp.UUID, hits); // debug for (int iter = 0; iter < AvatarAppearance.BAKE_INDICES.Length; iter++) { @@ -627,10 +618,9 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory sp.Appearance.WearableCacheItems[j].TextureID); } - // If we only found default textures, then the appearance is not cached - // return (defonly ? false : true); return (hits >= AvatarAppearance.BAKE_INDICES.Length - 1); // skirt is optional } + public int RequestRebake(IScenePresence sp, bool missingTexturesOnly) { int texturesRebaked = 0;