Remove the Invisible stuff and add more baked caching. Refactor selection of textures to save to Bakes module.

avinationmerge
Melanie Thielker 2014-11-11 07:09:30 +01:00
parent 9516ebac24
commit bec456c2a5
5 changed files with 7 additions and 54 deletions

View File

@ -72,7 +72,6 @@ namespace OpenSim.Framework
protected float m_avatarAnimOffset = 0;
protected WearableCacheItem[] m_cacheitems;
protected bool m_cacheItemsDirty = true;
public static Primitive.TextureEntry Invisible = null;
public virtual int Serial
{
@ -135,30 +134,8 @@ namespace OpenSim.Framework
set { m_cacheItemsDirty = value; }
}
private void CreateInvisibleTextureEntry()
{
if (Invisible != null)
return;
Invisible = new Primitive.TextureEntry(new UUID("8dcd4a48-2d37-4909-9f78-f7a9eb4ef903"));
Invisible.FaceTextures[8] = new Primitive.TextureEntryFace(null);
Invisible.FaceTextures[8].TextureID = new UUID("8dcd4a48-2d37-4909-9f78-f7a9eb4ef903");
Invisible.FaceTextures[9] = new Primitive.TextureEntryFace(null);
Invisible.FaceTextures[9].TextureID = new UUID("8dcd4a48-2d37-4909-9f78-f7a9eb4ef903");
Invisible.FaceTextures[10] = new Primitive.TextureEntryFace(null);
Invisible.FaceTextures[10].TextureID = new UUID("8dcd4a48-2d37-4909-9f78-f7a9eb4ef903");
Invisible.FaceTextures[11] = new Primitive.TextureEntryFace(null);
Invisible.FaceTextures[11].TextureID = new UUID("8dcd4a48-2d37-4909-9f78-f7a9eb4ef903");
Invisible.FaceTextures[19] = new Primitive.TextureEntryFace(null);
Invisible.FaceTextures[19].TextureID = new UUID("8dcd4a48-2d37-4909-9f78-f7a9eb4ef903");
Invisible.FaceTextures[20] = new Primitive.TextureEntryFace(null);
Invisible.FaceTextures[20].TextureID = new UUID("8dcd4a48-2d37-4909-9f78-f7a9eb4ef903");
}
public AvatarAppearance()
{
CreateInvisibleTextureEntry();
// m_log.WarnFormat("[AVATAR APPEARANCE]: create empty appearance");
m_serial = 0;
@ -172,9 +149,6 @@ namespace OpenSim.Framework
public AvatarAppearance(OSDMap map)
{
CreateInvisibleTextureEntry();
Invisible = new Primitive.TextureEntry(new UUID("8dcd4a48-2d37-4909-9f78-f7a9eb4ef903"));
// m_log.WarnFormat("[AVATAR APPEARANCE]: create appearance from OSDMap");
Unpack(map);
@ -183,7 +157,6 @@ namespace OpenSim.Framework
public AvatarAppearance(AvatarWearable[] wearables, Primitive.TextureEntry textureEntry, byte[] visualParams)
{
CreateInvisibleTextureEntry();
// m_log.WarnFormat("[AVATAR APPEARANCE] create initialized appearance");
m_serial = 0;
@ -221,7 +194,6 @@ namespace OpenSim.Framework
public AvatarAppearance(AvatarAppearance appearance, bool copyWearables, bool copyBaked)
{
CreateInvisibleTextureEntry();
// m_log.WarnFormat("[AVATAR APPEARANCE] create from an existing appearance");
if (appearance == null)

View File

@ -5143,9 +5143,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (sendTexture)
{
if (presence.Invisible)
textureEntry = AvatarAppearance.Invisible.GetBytes();
else
textureEntry = presence.Appearance.Texture.GetBytes();
}
else

View File

@ -460,18 +460,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
{
m_log.Debug("[UpdateBakedCache] uploading to bakedModule cache");
WearableCacheItem[] toBakedModule = new WearableCacheItem[AvatarAppearance.BAKE_INDICES.Length];
for (int i = 0; i < AvatarAppearance.BAKE_INDICES.Length; i++)
{
int idx = (int)AvatarAppearance.BAKE_INDICES[i];
toBakedModule[i] = new WearableCacheItem();
toBakedModule[i].TextureIndex = (uint)idx;
toBakedModule[i].CacheId = wearableCache[idx].CacheId;
toBakedModule[i].TextureID = wearableCache[idx].TextureID;
toBakedModule[i].TextureAsset = wearableCache[idx].TextureAsset;
}
m_BakedTextureModule.Store(sp.UUID, toBakedModule);
m_BakedTextureModule.Store(sp.UUID);
}
}
@ -610,8 +599,9 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
{
bakedModuleCache = bakedModule.Get(sp.UUID);
}
catch (Exception)
catch (Exception e)
{
m_log.ErrorFormat(e.ToString());
bakedModuleCache = null;
}

View File

@ -35,7 +35,7 @@ namespace OpenSim.Services.Interfaces
public interface IBakedTextureModule
{
WearableCacheItem[] Get(UUID id);
void Store(UUID id, WearableCacheItem[] data);
void Store(UUID id);
void UpdateMeshAvatar(UUID id);
}
}

View File

@ -90,7 +90,6 @@ namespace OpenSim.Region.Framework.Scenes
public bool isNPC { get; private set; }
public bool Invisible { get; set; }
private PresenceType m_presenceType;
public PresenceType PresenceType {
get {return m_presenceType;}
@ -950,7 +949,6 @@ namespace OpenSim.Region.Framework.Scenes
public ScenePresence(
IClientAPI client, Scene world, AvatarAppearance appearance, PresenceType type)
{
Invisible = false;
AttachmentsSyncLock = new Object();
AllowMovement = true;
IsChildAgent = true;
@ -3716,10 +3714,6 @@ namespace OpenSim.Region.Framework.Scenes
public void SendAppearanceToAgentNF(ScenePresence avatar)
{
if (Invisible)
avatar.ControllingClient.SendAppearance(
UUID, Appearance.VisualParams, AvatarAppearance.Invisible.GetBytes());
else
avatar.ControllingClient.SendAppearance(
UUID, Appearance.VisualParams, Appearance.Texture.GetBytes());
}