Beispiel #1
0
        internal override void Write(BinaryWriterEx bw)
        {
            Entries entries;

            entries.Models = Models.GetEntries();
            List <Event> events = Events.GetEntries();

            entries.Regions = Regions.GetEntries();
            List <Route> routes = Routes.GetEntries();

            entries.Parts = Parts.GetEntries();

            foreach (Model model in entries.Models)
            {
                model.CountInstances(entries.Parts);
            }
            foreach (Event evt in events)
            {
                evt.GetIndices(entries);
            }
            foreach (Region region in entries.Regions)
            {
                region.GetIndices(entries);
            }
            foreach (Part part in entries.Parts)
            {
                part.GetIndices(this, entries);
            }

            bw.WriteASCII("MSB ");
            bw.WriteInt32(1);
            bw.WriteInt32(0x10);
            bw.WriteBoolean(false);
            bw.WriteBoolean(false);
            bw.WriteByte(1);
            bw.WriteByte(0xFF);

            Models.Write(bw, entries.Models);
            bw.FillInt64("NextParamOffset", bw.Position);
            Events.Write(bw, events);
            bw.FillInt64("NextParamOffset", bw.Position);
            Regions.Write(bw, entries.Regions);
            bw.FillInt64("NextParamOffset", bw.Position);
            Routes.Write(bw, routes);
            bw.FillInt64("NextParamOffset", bw.Position);
            Layers.Write(bw, Layers.GetEntries());
            bw.FillInt64("NextParamOffset", bw.Position);
            Parts.Write(bw, entries.Parts);
            bw.FillInt64("NextParamOffset", bw.Position);
            PartsPoses.Write(bw, Layers.GetEntries());
            bw.FillInt64("NextParamOffset", bw.Position);
            BoneNames.Write(bw, Layers.GetEntries());
            bw.FillInt64("NextParamOffset", 0);
        }
Beispiel #2
0
        /// <summary>
        /// Serializes file data to a stream.
        /// </summary>
        protected override void Write(BinaryWriterEx bw)
        {
            Entries entries;

            entries.Models  = Models.GetEntries();
            entries.Events  = Events.GetEntries();
            entries.Regions = Regions.GetEntries();
            entries.Routes  = Routes.GetEntries();
            entries.Parts   = Parts.GetEntries();

            foreach (Model model in entries.Models)
            {
                model.CountInstances(entries.Parts);
            }
            foreach (Event evt in entries.Events)
            {
                evt.GetIndices(this, entries);
            }
            foreach (Region region in entries.Regions)
            {
                region.GetIndices(entries);
            }
            foreach (Part part in entries.Parts)
            {
                part.GetIndices(this, entries);
            }

            bw.BigEndian = false;
            MSB.WriteHeader(bw);

            Models.Write(bw, entries.Models);
            bw.FillInt64("NextParamOffset", bw.Position);
            Events.Write(bw, entries.Events);
            bw.FillInt64("NextParamOffset", bw.Position);
            Regions.Write(bw, entries.Regions);
            bw.FillInt64("NextParamOffset", bw.Position);
            Routes.Write(bw, entries.Routes);
            bw.FillInt64("NextParamOffset", bw.Position);
            Layers.Write(bw, Layers.GetEntries());
            bw.FillInt64("NextParamOffset", bw.Position);
            Parts.Write(bw, entries.Parts);
            bw.FillInt64("NextParamOffset", bw.Position);
            PartsPoses.Write(bw, Layers.GetEntries());
            bw.FillInt64("NextParamOffset", bw.Position);
            BoneNames.Write(bw, Layers.GetEntries());
            bw.FillInt64("NextParamOffset", 0);
        }