Exemplo n.º 1
0
 public void ReadXml(XmlNode node)
 {
     SerializerVersion  = 2;    // Xml.GetChildIntAttribute(node, "SerializerVersion");
     PoseMatcherVersion = 0;    // Xml.GetChildIntAttribute(node, "PoseMatcherVersion");
     Signature          = Xml.GetChildUIntAttribute(node, "Signature");
     Unk7          = 0.033333f; // Xml.GetChildFloatAttribute(node, "Unk7");
     Unk8          = 1;         // Xml.GetChildIntAttribute(node, "Unk8");
     BoneTags      = Xml.GetChildRawUshortArray(node, "BoneTags");
     BoneTagsCount = (BoneTags?.Length ?? 0);
     WeightSet     = new PoseMatcherWeightSet(node);
     Samples       = XmlMeta.ReadItemArray <PoseMatcherMatchSample>(node, "Samples");
     SamplesCount  = (Samples?.Length ?? 0);
 }
Exemplo n.º 2
0
        private void Read(DataReader r)
        {
            byte magic = r.ReadByte();

            if (magic != 0x1A) // 0x1A indicates to the game deserializer that it's binary instead of text
            {
            }                  // no hit

            SerializerVersion  = r.ReadInt32();
            PoseMatcherVersion = r.ReadInt32();
            Signature          = r.ReadUInt32();

            SamplesCount = r.ReadInt32();
            if (SamplesCount > 0)
            {
                Samples = new PoseMatcherMatchSample[SamplesCount];

                for (int i = 0; i < SamplesCount; i++)
                {
                    Samples[i] = new PoseMatcherMatchSample(r);
                }
            }

            BoneTagsCount = r.ReadInt32();
            if (BoneTagsCount > 0)
            {
                BoneTags = new ushort[BoneTagsCount];

                for (int i = 0; i < BoneTagsCount; i++)
                {
                    BoneTags[i] = r.ReadUInt16();
                }
            }

            WeightSet = new PoseMatcherWeightSet(r);

            Unk7 = r.ReadSingle();
            Unk8 = r.ReadInt32();

            uint signature2 = r.ReadUInt32();

            if (SerializerVersion != 2)
            {
            }   // no hit
            if (PoseMatcherVersion != 0)
            {
            }   // no hit
            if (BoneTagsCount != WeightSet.WeightsCount)
            {
            }   // no hit
            if (Unk7 != 0.033333f)
            {
            }   // no hit
            if (Unk8 != 1)
            {
            }   // no hit
            if (Signature != signature2)
            {
            }   // no hit

            if (r.Position != r.Length)
            {
            }
        }