Ejemplo n.º 1
0
        void FromStream(IO.EndianStream s, AkSubchunkHeader header)
        {
            var bank = s.Owner as AkSoundBank;

            using (s.EnterVirtualBufferWithBookmark(header.ChunkSize))
            {
                for (int x = 0, num_hirc_items = s.Reader.ReadInt32(); x < num_hirc_items; x++)
                {
                    var section = new AKBKSubHircSection(); section.Serialize(s);

                    SerializeItem(s, section);
                }
            }
        }
Ejemplo n.º 2
0
        void SerializeItem(IO.EndianStream s, AKBKSubHircSection section)
        {
            Contract.Assert(s.IsReading);

            using (s.EnterVirtualBufferWithBookmark(section.SectionSize))
            {
                var obj = AkSoundBankHierarchyObjectBase.New(section.Type);
                if (obj != null)
                {
                    s.Stream(obj);

                    MapObject(section.Type, obj);
                }
            }
        }