Exemplo n.º 1
0
        /// <summary>
        /// Unserializes a BinaryStream into the Attributes of this Instance
        /// </summary>
        /// <param name="reader">The Stream that contains the FileData</param>
        public override void Unserialize(System.IO.BinaryReader reader)
        {
            version = reader.ReadUInt32();

            slb.BlockName = reader.ReadString();
            slb.BlockID   = reader.ReadUInt32();
            slb.Unserialize(reader);

            sgres.BlockName = reader.ReadString();
            sgres.BlockID   = reader.ReadUInt32();
            sgres.Unserialize(reader);

            lt.BlockName = reader.ReadString();
            lt.BlockID   = reader.ReadUInt32();
            lt.Unserialize(reader);

            rn.BlockName = reader.ReadString();
            rn.BlockID   = reader.ReadUInt32();
            rn.Unserialize(reader);

            ogn.BlockName = reader.ReadString();
            ogn.BlockID   = reader.ReadUInt32();
            ogn.Unserialize(reader);

            unknown2 = reader.ReadString();
            unknown3 = reader.ReadSingle();
            unknown4 = reader.ReadSingle();
            red      = reader.ReadSingle();
            green    = reader.ReadSingle();
            blue     = reader.ReadSingle();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Unserializes a BinaryStream into the Attributes of this Instance
        /// </summary>
        /// <param name="reader">The Stream that contains the FileData</param>
        public override void Unserialize(System.IO.BinaryReader reader)
        {
            version = reader.ReadUInt32();

            string name = reader.ReadString();
            uint   myid = reader.ReadUInt32();

            ogn.Unserialize(reader);
            ogn.BlockID = myid;

            name = reader.ReadString();
            myid = reader.ReadUInt32();
            sgres.Unserialize(reader);
            sgres.BlockID = myid;

            if (version == 0x0b)
            {
                unknown1 = reader.ReadInt16();
            }

            if ((version == 0x0b) || (version == 0x0c))
            {
                unknown2 = reader.ReadInt16();
                unknown3 = reader.ReadByte();
            }

            int count = reader.ReadInt32();

            data = new IRcolBlock[count];
            for (int i = 0; i < count; i++)
            {
                uint id = reader.ReadUInt32();
                data[i] = Parent.ReadBlock(id, reader);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Unserializes a BinaryStream into the Attributes of this Instance
        /// </summary>
        /// <param name="reader">The Stream that contains the FileData</param>
        public override void Unserialize(System.IO.BinaryReader reader)
        {
            version  = reader.ReadUInt32();
            typecode = reader.ReadByte();

            string fldsc = reader.ReadString();
            uint   myid  = reader.ReadUInt32();

            if (typecode == 0x01)
            {
                sgres.Unserialize(reader);
                sgres.BlockID = myid;

                fldsc = reader.ReadString();
                myid  = reader.ReadUInt32();
                ctn.Unserialize(reader);
                ctn.BlockID = myid;

                fldsc = reader.ReadString();
                myid  = reader.ReadUInt32();
                ogn.Unserialize(reader);
                ogn.BlockID = myid;

                items = new ResourceNodeItem[reader.ReadByte()];
                for (int i = 0; i < items.Length; i++)
                {
                    items[i] = new ResourceNodeItem();
                    items[i].Unserialize(reader);
                }
                unknown1 = reader.ReadInt32();
            }
            else if (typecode == 0x00)
            {
                ogn.Unserialize(reader);
                ogn.BlockID = myid;

                items    = new ResourceNodeItem[1];
                items[0] = new ResourceNodeItem();
                items[0].Unserialize(reader);
            }
            else
            {
                throw new Exception("Unknown ResourceNode 0x" + Helper.HexString(version) + ", 0x" + Helper.HexString(typecode));
            }
            unknown2 = reader.ReadInt32();
        }
Exemplo n.º 4
0
        /// <summary>
        /// Unserializes a BinaryStream into the Attributes of this Instance
        /// </summary>
        /// <param name="reader">The Stream that contains the FileData</param>
        public override void Unserialize(System.IO.BinaryReader reader)
        {
            version = reader.ReadUInt32();
            string s = reader.ReadString();

            sgres.BlockID = reader.ReadUInt32();
            sgres.Unserialize(reader);

            s = reader.ReadString();
            refnode.BlockID = reader.ReadUInt32();
            refnode.Unserialize(reader);

            s           = reader.ReadString();
            ogn.BlockID = reader.ReadUInt32();
            ogn.Unserialize(reader);

            if (version != 0x06)
            {
                unknown = new uint[reader.ReadUInt32()];
            }
            else
            {
                unknown = new uint[0];
            }
            for (int i = 0; i < unknown.Length; i++)
            {
                unknown[i] = reader.ReadUInt32();
            }

            items = new ShapeItem[reader.ReadUInt32()];
            for (int i = 0; i < items.Length; i++)
            {
                items[i] = new ShapeItem(this);
                items[i].Unserialize(reader);
            }

            parts = new ShapePart[reader.ReadUInt32()];
            for (int i = 0; i < parts.Length; i++)
            {
                parts[i] = new ShapePart();
                parts[i].Unserialize(reader);
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// Unserializes a BinaryStream into the Attributes of this Instance
        /// </summary>
        /// <param name="reader">The Stream that contains the FileData</param>
        public override void Unserialize(System.IO.BinaryReader reader)
        {
            version = reader.ReadUInt32();

            string name = reader.ReadString();
            uint   myid = reader.ReadUInt32();

            ctn.Unserialize(reader);
            ctn.BlockID = myid;

            name = reader.ReadString();
            myid = reader.ReadUInt32();
            ogn.Unserialize(reader);
            ogn.BlockID = myid;

            //items = new TransformNodeItem[];
            uint count = reader.ReadUInt32();

            items.Clear();
            for (int i = 0; i < count; i++)
            {
                TransformNodeItem tni = new TransformNodeItem();
                tni.Unserialize(reader);
                items.Add(tni);
            }

            trans.Order = VectorTransformation.TransformOrder.TranslateRotate;
            trans.Unserialize(reader);
#if DEBUG
            trans.Name = this.ogn.FileName;
#endif
            //trans.Rotation = Quaternion.FromAxisAngle(trans.Rotation.X, trans.Rotation.Y, trans.Rotation.Z, Quaternion.DegToRad(trans.Rotation.W));


            unknown = reader.ReadInt32();
        }