Esempio n. 1
0
        public override void Write(BinaryWriter file)
        {
            base.Write(file);

            buffername.Write(file);
            count.Write(file);
            unk.Write(file);
            buffer.Write(file);
        }
Esempio n. 2
0
        public override void Write(BinaryWriter file)
        {
            SetUInt16byName("waypointsCount", (UInt16)waypoints.elements.Count);
            SetUInt16byName("componentsMappingsCount", (UInt16)componentsMappings.elements.Count);
            SetUInt16byName("waypointsGroupsCount", (UInt16)waypointsGroups.elements.Count);
            SetUInt32byName("indexesCount", (UInt32)indexes.elements.Count);

            base.Write(file);

            using (var ms = new MemoryStream())
                using (var bw = new BinaryWriter(ms))
                {
                    waypoints.Write(bw);
                    componentsMappings.Write(bw);
                    waypointsGroups.Write(bw);
                    indexes.Write(bw);

                    bw.Flush();

                    int buffersize = (int)ms.Position;

                    int calcb = CalculateBufferSize();
                    if (buffersize != calcb)
                    {
                        throw new InvalidParsingException("Calculated buffersize is not equal actual buffersize.");
                    }

                    file.Write(buffersize);
                    file.Write(ms.ToArray());
                }

            void SetUInt16byName(string name, UInt16 val)
            {
                var v = variables.FirstOrDefault(_ => _.Name == name);

                if ((v as CUInt16) != null)
                {
                    (v as CUInt16).val = val;
                }
            }

            void SetUInt32byName(string name, UInt32 val)
            {
                var v = variables.FirstOrDefault(_ => _.Name == name);

                if ((v as CUInt32) != null)
                {
                    (v as CUInt32).val = val;
                }
            }
        }
Esempio n. 3
0
        public override void Write(BinaryWriter file)
        {
            base.Write(file);

            unk.Write(file);
            MipsCount.Write(file);

            Mips.Write(file);

            ResidentmipSize.Write(file);
            unk2.Write(file);

            Residentmip.Write(file);
        }
Esempio n. 4
0
        public override void Write(BinaryWriter file)
        {
            base.Write(file);

            unk.Write(file);
            MipsCount.Write(file);

            mips.Write(file);

            filesize.Write(file);
            unk2.Write(file);

            Image.Write(file);
        }
Esempio n. 5
0
        public override void Write(BinaryWriter file)
        {
            base.Write(file);

            if (buffername != null)
            {
                buffername.Write(file);
            }
            if (count != null)
            {
                count.Write(file);
            }
            if (buffername != null)
            {
                unk.Write(file);
            }
            if (buffer != null)
            {
                buffer.Write(file);
            }
        }
Esempio n. 6
0
        public override void Write(BinaryWriter file)
        {
            //Write the 8 unknown bytes.
            Unknown1.Write(file);
            Unknown2.Write(file);

            Resources.Write(file);
            Objects.Write(file);

            byte[] buffer;
            using (var ms = new MemoryStream())
                using (var bw = new BinaryWriter(ms))
                {
                    BlockData.Write(bw);
                    blocksize.val = (int)ms.Length;
                    buffer        = ms.ToArray();
                }

            blocksize.Write(file);
            file.Write(buffer);
        }
Esempio n. 7
0
        public override void Write(BinaryWriter file)
        {
            base.Write(file);

            rigdata.Write(file);
        }