Help big boobies to dance (avatar visualParams). May not persist and need more lobe ?

avinationmerge
UbitUmarov 2012-04-26 16:17:46 +01:00
parent 22ea2ef9a0
commit fd19601c6b
4 changed files with 42 additions and 18 deletions

View File

@ -42,6 +42,8 @@ namespace OpenSim.Framework
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
// this is viewer capabilities and weared things dependent
// should be only used as initial default value ( V1 viewers )
public readonly static int VISUALPARAM_COUNT = 218; public readonly static int VISUALPARAM_COUNT = 218;
public readonly static int TEXTURE_COUNT = 21; public readonly static int TEXTURE_COUNT = 21;
@ -319,19 +321,30 @@ namespace OpenSim.Framework
// made. We determine if any of the visual parameters actually // made. We determine if any of the visual parameters actually
// changed to know if the appearance should be saved later // changed to know if the appearance should be saved later
bool changed = false; bool changed = false;
for (int i = 0; i < AvatarAppearance.VISUALPARAM_COUNT; i++)
int newsize = visualParams.Length;
if (newsize != m_visualparams.Length)
{
changed = true;
m_visualparams = (byte[])visualParams.Clone();
}
else
{
for (int i = 0; i < newsize; i++)
{ {
if (visualParams[i] != m_visualparams[i]) if (visualParams[i] != m_visualparams[i])
{ {
// DEBUG ON // DEBUG ON
// m_log.WarnFormat("[AVATARAPPEARANCE] vparams changed [{0}] {1} ==> {2}", // m_log.WarnFormat("[AVATARAPPEARANCE] vparams changed [{0}] {1} ==> {2}",
// i,m_visualparams[i],visualParams[i]); // i,m_visualparams[i],visualParams[i]);
// DEBUG OFF // DEBUG OFF
m_visualparams[i] = visualParams[i]; m_visualparams[i] = visualParams[i];
changed = true; changed = true;
} }
} }
}
// Reset the height if the visual parameters actually changed // Reset the height if the visual parameters actually changed
if (changed) if (changed)
SetHeight(); SetHeight();
@ -389,7 +402,8 @@ namespace OpenSim.Framework
} }
s += "Visual Params: "; s += "Visual Params: ";
for (uint j = 0; j < AvatarAppearance.VISUALPARAM_COUNT; j++) // for (uint j = 0; j < AvatarAppearance.VISUALPARAM_COUNT; j++)
for (uint j = 0; j < m_visualparams.Length; j++)
s += String.Format("{0},",m_visualparams[j]); s += String.Format("{0},",m_visualparams[j]);
s += "\n"; s += "\n";

View File

@ -3533,7 +3533,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
AvatarAppearancePacket avp = (AvatarAppearancePacket)PacketPool.Instance.GetPacket(PacketType.AvatarAppearance); AvatarAppearancePacket avp = (AvatarAppearancePacket)PacketPool.Instance.GetPacket(PacketType.AvatarAppearance);
// TODO: don't create new blocks if recycling an old packet // TODO: don't create new blocks if recycling an old packet
avp.VisualParam = new AvatarAppearancePacket.VisualParamBlock[218]; avp.VisualParam = new AvatarAppearancePacket.VisualParamBlock[visualParams.Length];
avp.ObjectData.TextureEntry = textureEntry; avp.ObjectData.TextureEntry = textureEntry;
AvatarAppearancePacket.VisualParamBlock avblock = null; AvatarAppearancePacket.VisualParamBlock avblock = null;

View File

@ -162,10 +162,16 @@ namespace OpenSim.Services.Interfaces
} }
// Visual Params // Visual Params
string[] vps = new string[AvatarAppearance.VISUALPARAM_COUNT]; // string[] vps = new string[AvatarAppearance.VISUALPARAM_COUNT];
byte[] binary = appearance.VisualParams; // byte[] binary = appearance.VisualParams;
for (int i = 0 ; i < AvatarAppearance.VISUALPARAM_COUNT ; i++) // for (int i = 0 ; i < AvatarAppearance.VISUALPARAM_COUNT ; i++)
byte[] binary = appearance.VisualParams;
string[] vps = new string[binary.Length];
for (int i = 0; i < binary.Length; i++)
{ {
vps[i] = binary[i].ToString(); vps[i] = binary[i].ToString();
} }
@ -265,9 +271,13 @@ namespace OpenSim.Services.Interfaces
if (Data.ContainsKey("VisualParams")) if (Data.ContainsKey("VisualParams"))
{ {
string[] vps = Data["VisualParams"].Split(new char[] {','}); string[] vps = Data["VisualParams"].Split(new char[] {','});
byte[] binary = new byte[AvatarAppearance.VISUALPARAM_COUNT]; // byte[] binary = new byte[AvatarAppearance.VISUALPARAM_COUNT];
// for (int i = 0 ; i < vps.Length && i < binary.Length ; i++)
byte[] binary = new byte[vps.Length];
for (int i = 0; i < vps.Length; i++)
for (int i = 0 ; i < vps.Length && i < binary.Length ; i++)
binary[i] = (byte)Convert.ToInt32(vps[i]); binary[i] = (byte)Convert.ToInt32(vps[i]);
appearance.VisualParams = binary; appearance.VisualParams = binary;