remove confusing defonly control

avinationmerge
UbitUmarov 2014-08-11 00:54:30 +01:00
parent 306875fc61
commit e860dd33fa
1 changed files with 4 additions and 14 deletions

View File

@ -366,8 +366,6 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
// called on textures update // called on textures update
public bool UpdateBakedTextureCache(IScenePresence sp, WearableCacheItem[] cacheItems) 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 // uploaded baked textures will be in assets local cache
IAssetService cache = m_scene.AssetService; IAssetService cache = m_scene.AssetService;
@ -409,8 +407,6 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
continue; continue;
} }
defonly = false; // found a non-default texture reference
if(sp.Appearance.Texture.FaceTextures[idx].TextureID == wearableCache[idx].TextureID) if(sp.Appearance.Texture.FaceTextures[idx].TextureID == wearableCache[idx].TextureID)
{ {
if(wearableCache[idx].CacheId != cacheItems[i].CacheId) if(wearableCache[idx].CacheId != cacheItems[i].CacheId)
@ -479,14 +475,12 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
sp.Appearance.WearableCacheItems[j].TextureID); sp.Appearance.WearableCacheItems[j].TextureID);
} }
// If we only found default textures, then the appearance is not cached return (hits == cacheItems.Length);
return (defonly ? false : true);
} }
// called when we get a new root avatar // called when we get a new root avatar
public bool ValidateBakedTextureCache(IScenePresence sp) public bool ValidateBakedTextureCache(IScenePresence sp)
{ {
bool defonly = true; // are we only using default textures
int hits = 0; int hits = 0;
lock (m_setAppearanceLock) lock (m_setAppearanceLock)
@ -557,10 +551,8 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
// this should be removed // this should be removed
if (face.TextureID != UUID.Zero && face.TextureID != AppearanceManager.DEFAULT_AVATAR_TEXTURE) if (face.TextureID != UUID.Zero && face.TextureID != AppearanceManager.DEFAULT_AVATAR_TEXTURE)
{
defonly = false; // found a non-default texture reference
hits++; hits++;
}
continue; continue;
} }
else else
@ -608,7 +600,6 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
} }
else else
hits++; hits++;
defonly = false; // found a non-default texture reference
} }
} }
} }
@ -616,7 +607,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
sp.Appearance.WearableCacheItems = wearableCache; 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 // debug
for (int iter = 0; iter < AvatarAppearance.BAKE_INDICES.Length; iter++) 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); 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 return (hits >= AvatarAppearance.BAKE_INDICES.Length - 1); // skirt is optional
} }
public int RequestRebake(IScenePresence sp, bool missingTexturesOnly) public int RequestRebake(IScenePresence sp, bool missingTexturesOnly)
{ {
int texturesRebaked = 0; int texturesRebaked = 0;